mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-20 06:58:56 +00:00
#1153 boolean subtraction on parts
This commit is contained in:
@@ -993,7 +993,20 @@ void SvgSerializer::write(const geometry_data& data) {
|
|||||||
gp_Pnt ref = projection_plane.Position().Location().XYZ() + projection_plane.Position().Direction().XYZ();
|
gp_Pnt ref = projection_plane.Position().Location().XYZ() + projection_plane.Position().Direction().XYZ();
|
||||||
BRepPrimAPI_MakeHalfSpace mhs(f, ref);
|
BRepPrimAPI_MakeHalfSpace mhs(f, ref);
|
||||||
auto s = mhs.Solid();
|
auto s = mhs.Solid();
|
||||||
subtracted_shape = BRepAlgoAPI_Cut(compound_to_use, s).Shape();
|
|
||||||
|
BRep_Builder BB;
|
||||||
|
TopoDS_Compound C;
|
||||||
|
BB.MakeCompound(C);
|
||||||
|
|
||||||
|
// loop over parts to have better luck with co-planar parts
|
||||||
|
TopoDS_Iterator it(compound_to_use);
|
||||||
|
for (; it.More(); it.Next()) {
|
||||||
|
auto part = BRepAlgoAPI_Cut(it.Value(), s).Shape();
|
||||||
|
BB.Add(C, part);
|
||||||
|
}
|
||||||
|
|
||||||
|
subtracted_shape = C;
|
||||||
|
|
||||||
compound_to_hlr = &subtracted_shape;
|
compound_to_hlr = &subtracted_shape;
|
||||||
} catch (...) {
|
} catch (...) {
|
||||||
Logger::Error("Failed to cut element for HLR", data.product);
|
Logger::Error("Failed to cut element for HLR", data.product);
|
||||||
|
|||||||
Reference in New Issue
Block a user