#1814 check for the succesful creation of edge curves in IfcIndexedPolyCurve

This commit is contained in:
Thomas Krijnen
2021-10-20 11:14:35 +02:00
parent ba9c2a3280
commit b1b121ebc8
+9 -5
View File
@@ -1053,12 +1053,16 @@ bool IfcGeom::Kernel::convert(const IfcSchema::IfcIndexedPolyCurve* l, TopoDS_Wi
} }
} }
} else if (points.begin() < points.end()) { } 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)); BRepBuilderAPI_MakeEdge me(*previous, *current);
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(); result = w.Wire();
return true; return true;