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