From e0a9f44c1378fc324fbb77c42589a84e385c3f81 Mon Sep 17 00:00:00 2001 From: Richard Brice <37087370+RickBrice@users.noreply.github.com> Date: Mon, 6 May 2024 12:27:32 -0700 Subject: [PATCH] Fixes transition code of last segment of vertical alignment --- src/examples/IfcAlignment.cpp | 1 + src/ifcparse/IfcAlignmentHelper.cpp | 8 ++++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/examples/IfcAlignment.cpp b/src/examples/IfcAlignment.cpp index d17bf76cd4..877ad778fd 100644 --- a/src/examples/IfcAlignment.cpp +++ b/src/examples/IfcAlignment.cpp @@ -395,6 +395,7 @@ int main() { // Zero-length terminator auto vertical_terminator_segment = create_gradient(vpoe, -0.5 / 100, 0.0); + vertical_terminator_segment.first->setTransition(Schema::IfcTransitionCode::IfcTransitionCode_DISCONTINUOUS); vertical_curve_segments->push(vertical_terminator_segment.first); vertical_segments->push(vertical_terminator_segment.second); diff --git a/src/ifcparse/IfcAlignmentHelper.cpp b/src/ifcparse/IfcAlignmentHelper.cpp index e16ddbc39e..8e26375ab5 100644 --- a/src/ifcparse/IfcAlignmentHelper.cpp +++ b/src/ifcparse/IfcAlignmentHelper.cpp @@ -163,7 +163,9 @@ std::tuple::ptr, typenam alignment_segment = new Ifc4x3_add2::IfcAlignmentSegment(IfcParse::IfcGlobalId(), nullptr, boost::none, boost::none, boost::none, nullptr, nullptr, design_parameters); horizontal_segments->push(alignment_segment); if (include_geometry) { - horizontal_curve_segments->push(mapAlignmentHorizontalSegment(design_parameters).first); + auto segment = mapAlignmentHorizontalSegment(design_parameters).first; + segment->setTransition(Ifc4x3_add2::IfcTransitionCode::IfcTransitionCode_DISCONTINUOUS); + horizontal_curve_segments->push(segment); } Ifc4x3_add2::IfcCompositeCurve* composite_curve = nullptr; @@ -306,7 +308,9 @@ std::tuple::ptr, typenam alignment_segment = new Ifc4x3_add2::IfcAlignmentSegment(IfcParse::IfcGlobalId(), nullptr, boost::none, boost::none, boost::none, nullptr, nullptr, design_parameters); vertical_segments->push(alignment_segment); if (include_geometry) { - vertical_curve_segments->push(mapAlignmentVerticalSegment(design_parameters).first); + auto segment = mapAlignmentVerticalSegment(design_parameters).first; + segment->setTransition(Ifc4x3_add2::IfcTransitionCode::IfcTransitionCode_DISCONTINUOUS); + vertical_curve_segments->push(segment); } Ifc4x3_add2::IfcGradientCurve* gradient_curve = nullptr;