From 647e379c69b4ee5d0e0ecd1c44f3863e7e6b2463 Mon Sep 17 00:00:00 2001 From: Richard Brice <37087370+RickBrice@users.noreply.github.com> Date: Sun, 20 Oct 2024 08:19:49 -0700 Subject: [PATCH] Fixes problem with evaluating point on vertical alignment Fixes evaluation of IfcLine parent curve for IfcGradientCurve. See https://github.com/IfcOpenShell/IfcOpenShell/discussions/5587 --- src/ifcgeom/mapping/IfcCurveSegment.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/ifcgeom/mapping/IfcCurveSegment.cpp b/src/ifcgeom/mapping/IfcCurveSegment.cpp index 151360392d..5f7acec538 100644 --- a/src/ifcgeom/mapping/IfcCurveSegment.cpp +++ b/src/ifcgeom/mapping/IfcCurveSegment.cpp @@ -696,6 +696,14 @@ class curve_segment_evaluator { auto pcDx = dr[0]; auto pcDy = dr[1]; + if (segment_type_ == ST_VERTICAL && placement_) { + // the general algorithm for mapping parent curve onto curve segment doesn't + // exactly work for IfcLine. This is easily overcome by usnig the curve segment + // placement for the IfcLine direction + pcDx = (*placement_)(0, 0); + pcDy = (*placement_)(1, 0); + } + if (segment_type_ == ST_HORIZONTAL || segment_type_ == ST_VERTICAL || segment_type_ == ST_CANT) { std::function convert_u; if (segment_type_ == ST_HORIZONTAL || segment_type_ == ST_CANT) {