diff --git a/src/ifcgeom/IfcGeomWires.cpp b/src/ifcgeom/IfcGeomWires.cpp index b5ccd6d717..f80d172948 100644 --- a/src/ifcgeom/IfcGeomWires.cpp +++ b/src/ifcgeom/IfcGeomWires.cpp @@ -1053,12 +1053,16 @@ bool IfcGeom::Kernel::convert(const IfcSchema::IfcIndexedPolyCurve* l, TopoDS_Wi } } } else if (points.begin() < points.end()) { - std::vector::const_iterator previous = points.begin(); - for (std::vector::const_iterator current = previous+1; current < points.end(); ++current){ - w.Add(BRepBuilderAPI_MakeEdge(*previous, *current)); - previous = current; - } + std::vector::const_iterator previous = points.begin(); + for (std::vector::const_iterator current = previous+1; current < points.end(); ++current){ + BRepBuilderAPI_MakeEdge me(*previous, *current); + double u, v; + if (me.IsDone() && !BRep_Tool::Curve(me.Edge(), u, v).IsNull()) { + w.Add(me.Edge()); + previous = current; + } } + } result = w.Wire(); return true;