Fix boolean results on non-solid shells #4832

This commit is contained in:
Thomas Krijnen
2024-06-18 21:30:00 +02:00
parent 0e42130e9d
commit a3d4642ea9
7 changed files with 17 additions and 19 deletions
@@ -762,7 +762,7 @@ bool IfcGeom::util::create_solid_from_faces(const TopTools_ListOfShape& face_lis
return valid_shell;
}
bool IfcGeom::util::flatten_shape_list(const IfcGeom::ConversionResults& shapes, TopoDS_Shape& result, bool fuse, double tol) {
bool IfcGeom::util::flatten_shape_list(const IfcGeom::ConversionResults& shapes, TopoDS_Shape& result, bool fuse, bool create_shell, double tol) {
TopoDS_Compound compound;
BRep_Builder builder;
builder.MakeCompound(compound);
@@ -772,8 +772,8 @@ bool IfcGeom::util::flatten_shape_list(const IfcGeom::ConversionResults& shapes,
for (IfcGeom::ConversionResults::const_iterator it = shapes.begin(); it != shapes.end(); ++it) {
TopoDS_Shape merged;
const TopoDS_Shape& s = std::static_pointer_cast<ifcopenshell::geometry::OpenCascadeShape>(it->Shape())->shape();
if (fuse) {
util::ensure_fit_for_subtraction(s, merged, tol);
if (fuse || create_shell) {
merged = util::ensure_fit_for_subtraction(s, tol);
} else {
merged = s;
}