Check for inner wires before reinitializing face builder

This commit is contained in:
Thomas Krijnen
2019-11-05 15:27:39 +01:00
parent a1253b004d
commit 8d96f40934
+5 -2
View File
@@ -318,10 +318,10 @@ bool IfcGeom::Kernel::convert(const IfcSchema::IfcFace* l, TopoDS_Shape& result)
} }
} else if (!fd.all_outer()) { } else if (!fd.all_outer()) {
BRepBuilderAPI_MakeFace mf(fd.surface(), fd.outer_wire()); BRepBuilderAPI_MakeFace mf(fd.surface(), fd.outer_wire());
TopoDS_Face f = mf.Face();
if (mf.IsDone()) { if (mf.IsDone()) {
// Is this necessary if (std::distance(fd.inner_wires().first, fd.inner_wires().second)) {
TopoDS_Face f = mf.Face();
mf.Init(f); mf.Init(f);
for (auto it = fd.inner_wires().first; it != fd.inner_wires().second; ++it) { for (auto it = fd.inner_wires().first; it != fd.inner_wires().second; ++it) {
@@ -329,6 +329,9 @@ bool IfcGeom::Kernel::convert(const IfcSchema::IfcFace* l, TopoDS_Shape& result)
} }
face_list.Append(mf.Face()); face_list.Append(mf.Face());
} else {
face_list.Append(f);
}
} }
} else { } else {
for (const auto& w : fd.wires()) { for (const auto& w : fd.wires()) {