Prevent stackoverflow on long alignments in adjustments

This commit is contained in:
Thomas Krijnen
2024-04-29 21:02:31 +02:00
parent e6cc500227
commit 710f19af08
5 changed files with 75 additions and 30 deletions
@@ -31,12 +31,13 @@ taxonomy::ptr mapping::map_impl(const IfcSchema::IfcSegmentedReferenceCurve* ins
auto cant = taxonomy::make<taxonomy::piecewise_function>(&settings_);
auto segments = inst->Segments();
current_segment_count_ = segments->size();
for (auto& segment : *segments) {
if (segment->as<IfcSchema::IfcCurveSegment>()) {
// @todo check that we don't get a mixture of implicit and explicit definitions
auto crv = map(segment->as<IfcSchema::IfcCurveSegment>());
if (crv->kind() == taxonomy::PIECEWISE_FUNCTION) {
if (crv && crv->kind() == taxonomy::PIECEWISE_FUNCTION) {
auto seg = taxonomy::cast<taxonomy::piecewise_function>(crv);
cant->spans.insert(cant->spans.end(), seg->spans.begin(), seg->spans.end());
} else {