mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-11 10:06:47 +00:00
Be a bit more careful in throwing NoSuchObject in case of triangulated face handling https://github.com/IfcOpenShell/wasm-preview/issues/1
This commit is contained in:
+10
-3
@@ -201,6 +201,9 @@ bool IfcGeom::Kernel::convert(const IfcSchema::IfcFace* l, TopoDS_Shape& result)
|
||||
for (const auto& w : fd.wires()) {
|
||||
TopTools_ListOfShape fl;
|
||||
auto r = util::triangulate_wire({ w }, fl);
|
||||
if (r == util::TRIANGULATE_WIRE_FAIL) {
|
||||
continue;
|
||||
}
|
||||
face_list.Append(fl);
|
||||
if (faceset_helper_ && r == util::TRIANGULATE_WIRE_NON_MANIFOLD) {
|
||||
faceset_helper_->non_manifold() = true;
|
||||
@@ -208,8 +211,10 @@ bool IfcGeom::Kernel::convert(const IfcSchema::IfcFace* l, TopoDS_Shape& result)
|
||||
}
|
||||
} else {
|
||||
auto r = util::triangulate_wire(fd.wires(), face_list);
|
||||
if (faceset_helper_ && r == util::TRIANGULATE_WIRE_NON_MANIFOLD) {
|
||||
faceset_helper_->non_manifold() = true;
|
||||
if (r != util::TRIANGULATE_WIRE_FAIL) {
|
||||
if (faceset_helper_ && r == util::TRIANGULATE_WIRE_NON_MANIFOLD) {
|
||||
faceset_helper_->non_manifold() = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
} else if (!fd.all_outer()) {
|
||||
@@ -313,7 +318,9 @@ bool IfcGeom::Kernel::convert(const IfcSchema::IfcFace* l, TopoDS_Shape& result)
|
||||
}
|
||||
}
|
||||
|
||||
if (face_list.Extent() > 1) {
|
||||
if (face_list.Extent() == 0) {
|
||||
return false;
|
||||
} else if (face_list.Extent() > 1) {
|
||||
TopoDS_Compound compound;
|
||||
BRep_Builder builder;
|
||||
builder.MakeCompound(compound);
|
||||
|
||||
Reference in New Issue
Block a user