mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-20 06:58:56 +00:00
prevent index out of bound in case of a single point
This commit is contained in:
@@ -912,7 +912,7 @@ bool IfcGeom::Kernel::convert(const IfcSchema::IfcIndexedPolyCurve* l, TopoDS_Wi
|
|||||||
throw IfcParse::IfcException("Unexpected IfcIndexedPolyCurve segment of type " + IfcSchema::Type::ToString(segment->type()));
|
throw IfcParse::IfcException("Unexpected IfcIndexedPolyCurve segment of type " + IfcSchema::Type::ToString(segment->type()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else if (points.begin() < points.end()) {
|
||||||
std::vector<gp_Pnt>::const_iterator previous = points.begin();
|
std::vector<gp_Pnt>::const_iterator previous = points.begin();
|
||||||
for (std::vector<gp_Pnt>::const_iterator current = previous+1; current < points.end(); ++current){
|
for (std::vector<gp_Pnt>::const_iterator current = previous+1; current < points.end(); ++current){
|
||||||
w.Add(BRepBuilderAPI_MakeEdge(*previous, *current));
|
w.Add(BRepBuilderAPI_MakeEdge(*previous, *current));
|
||||||
|
|||||||
Reference in New Issue
Block a user