mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-23 20:26:22 +00:00
Update SvgSerializer.cpp
This commit is contained in:
@@ -352,17 +352,14 @@ void SvgSerializer::write(const IfcGeom::BRepElement<real_t>* o)
|
|||||||
if (pnt.Z() < zmin) { zmin = pnt.Z(); }
|
if (pnt.Z() < zmin) { zmin = pnt.Z(); }
|
||||||
if (pnt.Z() > zmax) { zmax = pnt.Z(); }
|
if (pnt.Z() > zmax) { zmax = pnt.Z(); }
|
||||||
}}
|
}}
|
||||||
|
|
||||||
if (section_height) {
|
// Empty geometry, no vertices encountered
|
||||||
if (zmin > section_height || zmax < section_height) continue;
|
if (zmin == inf) continue;
|
||||||
} else {
|
|
||||||
if (zmin == inf || (zmax - zmin) < 1.) continue;
|
// Determine slicing plane z coordinate, priority:
|
||||||
}
|
// 1) explicitly set global section height
|
||||||
|
// 2) containing building storey elevation + 1m
|
||||||
// Priority:
|
// 3) zmin (from geometry bounding box) + 1m
|
||||||
// 1) section_height
|
|
||||||
// 2) Storey elevation + 1m
|
|
||||||
// 3) zmin + 1m
|
|
||||||
double cut_z;
|
double cut_z;
|
||||||
if (section_height) {
|
if (section_height) {
|
||||||
cut_z = section_height.get();
|
cut_z = section_height.get();
|
||||||
@@ -372,10 +369,10 @@ void SvgSerializer::write(const IfcGeom::BRepElement<real_t>* o)
|
|||||||
cut_z = zmin + 1.;
|
cut_z = zmin + 1.;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// No intersection with bounding box, fail early
|
||||||
if (zmin > cut_z || zmax < cut_z) continue;
|
if (zmin > cut_z || zmax < cut_z) continue;
|
||||||
|
|
||||||
|
// Evaluate cross section geometry
|
||||||
// Create a horizontal cross section 1 meter above the bottom point of the shape
|
|
||||||
TopoDS_Shape result = BRepAlgoAPI_Section(moved_shape, gp_Pln(gp_Pnt(0, 0, cut_z), gp::DZ()));
|
TopoDS_Shape result = BRepAlgoAPI_Section(moved_shape, gp_Pln(gp_Pnt(0, 0, cut_z), gp::DZ()));
|
||||||
|
|
||||||
Handle(TopTools_HSequenceOfShape) edges = new TopTools_HSequenceOfShape();
|
Handle(TopTools_HSequenceOfShape) edges = new TopTools_HSequenceOfShape();
|
||||||
|
|||||||
Reference in New Issue
Block a user