Update SvgSerializer.cpp

This commit is contained in:
Thomas Krijnen
2017-12-19 14:58:56 +01:00
committed by GitHub
parent 01d261e168
commit e3a7e6137d
+10 -13
View File
@@ -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();