diff --git a/src/ifcgeom/mapping/IfcCompositeCurve.cpp b/src/ifcgeom/mapping/IfcCompositeCurve.cpp index 1124cd083e..9f5221fe9f 100644 --- a/src/ifcgeom/mapping/IfcCompositeCurve.cpp +++ b/src/ifcgeom/mapping/IfcCompositeCurve.cpp @@ -67,9 +67,22 @@ taxonomy::ptr mapping::map_impl(const IfcSchema::IfcCompositeCurve* inst) { #ifdef SCHEMA_HAS_IfcCurveSegment else if (segment->as()) { auto crv = map(segment->as()); - for (auto& s : taxonomy::cast(crv)->children) { - loop->children.push_back(s); + auto crv_as_loop = taxonomy::cast(crv); + + // The end of the previous segment must be at the same location as the start of this segment + // @todo - need to apply some tolerancing + if (!loop->children.empty() and !crv_as_loop->children.empty() + and + boost::get(loop->children.back()->end)->components() != boost::get(crv_as_loop->children.front()->start)->components()) + { + std::ostringstream os; + auto& prev = boost::get(loop->children.back()->end)->components(); + auto& next = boost::get(crv_as_loop->children.front()->start)->components(); + os << "Common points are not continuous: (" << prev.x() << ", " << prev.y() << ", " << prev.z() << ")" << " " << "(" << next.x() << ", " << next.y() << ", " << next.z() << ")" << std::endl; + Logger::Notice(os.str()); } + + loop->children.insert(loop->children.end(), crv_as_loop->children.begin(), crv_as_loop->children.end()); } #endif }