Clarify Compound of Solids behaviour in create_solid_from_faces() #6780

This commit is contained in:
Thomas Krijnen
2025-06-05 10:22:28 +02:00
parent 1ce9a4c68e
commit 5af7c9a32d
2 changed files with 5 additions and 3 deletions
@@ -45,6 +45,8 @@ namespace IfcGeom {
bool is_nested_compound_of_solid(const TopoDS_Shape& s, int depth = 0);
// Creates a solid from a compound of faces. When there are multiple connected components,
// a compound of solids is returned.
bool create_solid_from_compound(const TopoDS_Shape& compound, TopoDS_Shape& solid, double tol);
bool shape_to_face_list(const TopoDS_Shape& s, TopTools_ListOfShape& li);
bool create_solid_from_faces(const TopTools_ListOfShape& face_list, TopoDS_Shape& solid, double tol, bool force_sewing = false);
@@ -1451,10 +1451,10 @@ TopoDS_Shape IfcGeom::util::ensure_fit_for_subtraction(const TopoDS_Shape& shape
return shape;
}
TopoDS_Solid solid;
if (!create_solid_from_compound(shape, solid, tol)) {
TopoDS_Shape solid_or_compound_of_solids;
if (!create_solid_from_compound(shape, solid_or_compound_of_solids, tol)) {
return shape;
}
return solid;
return solid_or_compound_of_solids;
}