From 54131b3fe5af14c8a43dca8faff3869f933dcec2 Mon Sep 17 00:00:00 2001 From: Richard Brice <37087370+RickBrice@users.noreply.github.com> Date: Mon, 22 Jul 2024 13:21:49 -0700 Subject: [PATCH] IfcSectionedSolidHorizontal logs warning if Directrix is not a piecewise function, rather than silently failing. --- src/ifcgeom/mapping/IfcSectionedSolidHorizontal.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/ifcgeom/mapping/IfcSectionedSolidHorizontal.cpp b/src/ifcgeom/mapping/IfcSectionedSolidHorizontal.cpp index 7f5593bbfd..74e6e4cd89 100644 --- a/src/ifcgeom/mapping/IfcSectionedSolidHorizontal.cpp +++ b/src/ifcgeom/mapping/IfcSectionedSolidHorizontal.cpp @@ -52,7 +52,8 @@ taxonomy::ptr mapping::map_impl(const IfcSchema::IfcSectionedSolidHorizontal* in auto pwf = taxonomy::dcast(dir); if (!pwf) { // Only implement on alignment curves - return nullptr; + Logger::Warning("IfcSectionedSolidHorizontal is only implemented for piecewise function Directrix curves", inst); + return nullptr; } { @@ -111,6 +112,7 @@ taxonomy::ptr mapping::map_impl(const IfcSchema::IfcSectionedSolidHorizontal* in loft->axis = nullptr; // @todo currently only the case is handled where directrix returns a piecewise_function + // @todo this "if" statement is not really required because the function returns at the start if the Directrix is not a piecewise function if (pwf) { double start = std::max(0., cross_sections.front().dist_along); double end = std::min(pwf->length(), cross_sections.back().dist_along);