From 951ade4b578069028c0c7092e8d1f5eb36b7e356 Mon Sep 17 00:00:00 2001 From: Richard Brice <37087370+RickBrice@users.noreply.github.com> Date: Thu, 5 Mar 2026 14:50:33 -0800 Subject: [PATCH] Fix bug introduced in 65d5df78 --- .../mapping/IfcSectionedSolidHorizontal.cpp | 13 ++++++++++--- src/ifcgeom/mapping/IfcSectionedSurface.cpp | 17 ++++++++++++----- 2 files changed, 22 insertions(+), 8 deletions(-) diff --git a/src/ifcgeom/mapping/IfcSectionedSolidHorizontal.cpp b/src/ifcgeom/mapping/IfcSectionedSolidHorizontal.cpp index ad1e2e0d4c..f2556092b4 100644 --- a/src/ifcgeom/mapping/IfcSectionedSolidHorizontal.cpp +++ b/src/ifcgeom/mapping/IfcSectionedSolidHorizontal.cpp @@ -61,9 +61,16 @@ taxonomy::ptr mapping::map_impl(const IfcSchema::IfcSectionedSolidHorizontal* in longitudes.push_back(*pbde->DistanceAlong()->as(true) * length_unit_); - auto linear_placement = taxonomy::cast(map(csp)); - profile_offsets.push_back(linear_placement->ccomponents().block<3, 1>(0, 3)); - boost::optional rot(linear_placement->ccomponents().block<3,3>(0,0)); + Eigen::Vector3d po( + pbde->OffsetLateral().get_value_or(0.), + // @todo I don't understand whether vertical is an offset relative to the tangent plane or to the global XY plane + pbde->OffsetVertical().get_value_or(0.), + 0.); + + profile_offsets.push_back(po); + + auto axis2_placement_linear = taxonomy::cast(map(csp)); + boost::optional rot(axis2_placement_linear->ccomponents().block<3, 3>(0, 0)); profile_rotations.push_back(rot); } if (faces.size() != profile_offsets.size()) { diff --git a/src/ifcgeom/mapping/IfcSectionedSurface.cpp b/src/ifcgeom/mapping/IfcSectionedSurface.cpp index b91b7b62c2..efdeda5757 100644 --- a/src/ifcgeom/mapping/IfcSectionedSurface.cpp +++ b/src/ifcgeom/mapping/IfcSectionedSurface.cpp @@ -63,11 +63,18 @@ taxonomy::ptr mapping::map_impl(const IfcSchema::IfcSectionedSurface* inst) { longitudes.push_back(*pbde->DistanceAlong()->as(true) * length_unit_); - auto linear_placement = taxonomy::cast(map(csp)); - profile_offsets.push_back(linear_placement->ccomponents().block<3, 1>(0, 3)); - boost::optional rot(linear_placement->ccomponents().block<3, 3>(0, 0)); - profile_rotations.push_back(rot); - } + Eigen::Vector3d po( + pbde->OffsetLateral().get_value_or(0.), + // @todo I don't understand whether vertical is an offset relative to the tangent plane or to the global XY plane + pbde->OffsetVertical().get_value_or(0.), + 0.); + + profile_offsets.push_back(po); + + auto axis2_placement_linear = taxonomy::cast(map(csp)); + boost::optional rot(axis2_placement_linear->ccomponents().block<3, 3>(0, 0)); + profile_rotations.push_back(rot); + } #else return nullptr; #endif