From c93704f097625b518731e7d4d8ded06c5ef7c779 Mon Sep 17 00:00:00 2001 From: Richard Brice <37087370+RickBrice@users.noreply.github.com> Date: Thu, 2 May 2024 16:00:59 -0700 Subject: [PATCH] Fixes problem with IfcCurveSegment.Placement direction for parabolic vertical curves --- src/examples/IfcAlignment.cpp | 2 +- src/ifcparse/IfcAlignmentHelper.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/examples/IfcAlignment.cpp b/src/examples/IfcAlignment.cpp index f9ece6d5cb..a80ca10c97 100644 --- a/src/examples/IfcAlignment.cpp +++ b/src/examples/IfcAlignment.cpp @@ -163,7 +163,7 @@ std::pair{1.0, 0.0})), + new Schema::IfcAxis2Placement2D(p, new Schema::IfcDirection(std::vector{sqrt(1 - start_slope * start_slope), start_slope})), new Schema::IfcLengthMeasure(0.0), new Schema::IfcLengthMeasure(length), parent_curve); diff --git a/src/ifcparse/IfcAlignmentHelper.cpp b/src/ifcparse/IfcAlignmentHelper.cpp index 0e73b1cadf..08e17043b3 100644 --- a/src/ifcparse/IfcAlignmentHelper.cpp +++ b/src/ifcparse/IfcAlignmentHelper.cpp @@ -708,7 +708,7 @@ std::pair mapAlign auto curve_segment = new Ifc4x3_add2::IfcCurveSegment( Ifc4x3_add2::IfcTransitionCode::IfcTransitionCode_CONTSAMEGRADIENT, - new Ifc4x3_add2::IfcAxis2Placement2D(new Ifc4x3_add2::IfcCartesianPoint({start_distance_along,start_height}), new Ifc4x3_add2::IfcDirection({1.0, 0.0})), + new Ifc4x3_add2::IfcAxis2Placement2D(new Ifc4x3_add2::IfcCartesianPoint({start_distance_along, start_height}), new Ifc4x3_add2::IfcDirection({sqrt(1.0 - start_gradient * start_gradient), start_gradient})), new Ifc4x3_add2::IfcLengthMeasure(0.0), new Ifc4x3_add2::IfcLengthMeasure(horizontal_length), parent_curve);