Skip to content

Commit

Permalink
Bug Fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
beachtom committed Sep 24, 2023
1 parent f85d51b commit 7d15bf2
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
9 changes: 6 additions & 3 deletions src/wasm/geometry/IfcGeometryLoader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2983,15 +2983,17 @@ IfcProfile IfcGeometryLoader::GetProfile(uint32_t expressID) const
if (zID == parsing::IfcTokenType::REF)
{
_loader.StepBack();
zAxis = glm::normalize(GetCartesianPoint3D(_loader.GetRefArgument()));
auto tmpVec = glm::normalize(GetCartesianPoint3D(_loader.GetRefArgument()));
if (glm::length(tmpVec) > 0) zAxis = tmpVec;
}

_loader.MoveToArgumentOffset(expressID, 2);
parsing::IfcTokenType xID = _loader.GetTokenType();
if (xID == parsing::IfcTokenType::REF)
{
_loader.StepBack();
xAxis = glm::normalize(GetCartesianPoint3D(_loader.GetRefArgument()));
auto tmpVec = glm::normalize(GetCartesianPoint3D(_loader.GetRefArgument()));
if (glm::length(tmpVec) > 0) xAxis = tmpVec;
}

glm::dvec3 pos = GetCartesianPoint3D(posID);
Expand All @@ -3018,7 +3020,8 @@ IfcProfile IfcGeometryLoader::GetProfile(uint32_t expressID) const
if (xID == parsing::IfcTokenType::REF)
{
_loader.StepBack();
xAxis = glm::normalize(GetCartesianPoint3D(_loader.GetRefArgument()));
auto tmpVec = glm::normalize(GetCartesianPoint3D(_loader.GetRefArgument()));
if (glm::length(tmpVec) > 0) xAxis = tmpVec;
}

glm::dvec3 pos = GetCartesianPoint3D(posID);
Expand Down
2 changes: 1 addition & 1 deletion src/wasm/parsing/IfcTokenStream.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ namespace webifc::parsing

size_t IfcTokenStream::GetReadOffset()
{
return _currentChunk*_chunkSize + _readPtr;
return _cChunk->GetTokenRef() + _readPtr;
}

}

0 comments on commit 7d15bf2

Please sign in to comment.