mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-12 06:32:09 +00:00
Re-sew non-manifold operands; interior loop re-orientations affect edge identity #8140
This commit is contained in:
@@ -136,20 +136,36 @@ bool IfcGeom::OpenCascadeKernel::convert_openings(const express::Base& entity, c
|
|||||||
for (auto& entity_part : parts) {
|
for (auto& entity_part : parts) {
|
||||||
bool is_manifold = util::is_manifold(entity_part);
|
bool is_manifold = util::is_manifold(entity_part);
|
||||||
|
|
||||||
|
if (!is_manifold) {
|
||||||
|
// force sewing, edge identity might have been mudied by FixAdvFace.FixOrientation.MSG5 to fix interior loop winding order
|
||||||
|
TopTools_ListOfShape list;
|
||||||
|
IfcGeom::util::shape_to_face_list(entity_part, list);
|
||||||
|
IfcGeom::util::create_solid_from_faces(list, entity_part, settings_.get<settings::Precision>().get(), true);
|
||||||
|
is_manifold = util::is_manifold(entity_part);
|
||||||
|
if (is_manifold) {
|
||||||
|
logger::warning("Successfully sewed non-manifold first operand", entity);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (!is_manifold) {
|
if (!is_manifold) {
|
||||||
if (settings_.get<settings::MakeVolume>().get()) {
|
if (settings_.get<settings::MakeVolume>().get()) {
|
||||||
BOPAlgo_MakerVolume mv;
|
BOPAlgo_MakerVolume mv;
|
||||||
mv.AddArgument(entity_part);
|
mv.AddArgument(entity_part);
|
||||||
mv.Perform();
|
mv.SetAvoidInternalShapes(true);
|
||||||
if (mv.HasErrors()) {
|
try {
|
||||||
logger::warning("Non-manifold first operand, --make-volume failed");
|
mv.Perform();
|
||||||
} else {
|
if (mv.HasErrors()) {
|
||||||
entity_part = mv.Shape();
|
logger::warning("Non-manifold first operand, --make-volume failed", entity);
|
||||||
is_manifold = util::is_manifold(entity_part);
|
} else {
|
||||||
|
entity_part = mv.Shape();
|
||||||
|
is_manifold = util::is_manifold(entity_part);
|
||||||
|
logger::warning("Successfully detected exterior volume to non-manifold first operand", entity);
|
||||||
|
}
|
||||||
|
} catch (const Standard_Failure& e) {
|
||||||
|
logger::warning("MakeVolume failed: " + std::string(e.GetMessageString()), entity);
|
||||||
}
|
}
|
||||||
}
|
} else {
|
||||||
if (!is_manifold) {
|
logger::warning("Non-manifold first operand, use --make-volume to try and make manifold", entity);
|
||||||
logger::warning("Non-manifold first operand, use --make-volume to try and make manifold");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user