diff --git a/src/ifcgeom/IfcGeomWires.cpp b/src/ifcgeom/IfcGeomWires.cpp index 82435e29f2..e1e2ed4781 100644 --- a/src/ifcgeom/IfcGeomWires.cpp +++ b/src/ifcgeom/IfcGeomWires.cpp @@ -400,7 +400,8 @@ bool IfcGeom::Kernel::convert(const IfcSchema::IfcPolyline* l, TopoDS_Wire& resu const double eps = getValue(GV_PRECISION) * 10; const bool closed_by_proximity = polygon.Length() >= 2 && polygon.First().Distance(polygon.Last()) < eps; if (closed_by_proximity) { - polygon.Remove(polygon.Upper()); + // tfk: note 1-based + polygon.Remove(polygon.Length()); } // Remove points that are too close to one another