#945 don't fail on degenerate edges in polygonal faceset

This commit is contained in:
Thomas Krijnen
2020-08-09 20:55:44 +02:00
parent 06b512c2e3
commit f9bf6f814d
+12 -2
View File
@@ -987,7 +987,12 @@ bool IfcGeom::Kernel::convert(const IfcSchema::IfcIndexedPolyCurve* l, TopoDS_Wi
} }
const gp_Pnt& current = points[*jt - 1]; const gp_Pnt& current = points[*jt - 1];
if (jt != indices.begin()) { if (jt != indices.begin()) {
w.Add(BRepBuilderAPI_MakeEdge(previous, current)); BRepBuilderAPI_MakeEdge me(previous, current);
if (me.IsDone()) {
w.Add(me.Edge());
} else {
Logger::Warning("Ignoring segment on", l);
}
} }
previous = current; previous = current;
} }
@@ -1007,7 +1012,12 @@ bool IfcGeom::Kernel::convert(const IfcSchema::IfcIndexedPolyCurve* l, TopoDS_Wi
const gp_Pnt& b = points[indices[1] - 1]; const gp_Pnt& b = points[indices[1] - 1];
const gp_Pnt& c = points[indices[2] - 1]; const gp_Pnt& c = points[indices[2] - 1];
Handle(Geom_Circle) circ = GC_MakeCircle(a, b, c).Value(); Handle(Geom_Circle) circ = GC_MakeCircle(a, b, c).Value();
w.Add(BRepBuilderAPI_MakeEdge(circ, a, c)); BRepBuilderAPI_MakeEdge me(circ, a, c);
if (me.IsDone()) {
w.Add(me.Edge());
} else {
Logger::Warning("Ignoring segment on", l);
}
} else { } else {
throw IfcParse::IfcException("Unexpected IfcIndexedPolyCurve segment of type " + segment->declaration().name()); throw IfcParse::IfcException("Unexpected IfcIndexedPolyCurve segment of type " + segment->declaration().name());
} }