Fix combination --draw-storey-heights --svg-without-storeys

This commit is contained in:
Thomas Krijnen
2021-09-08 13:50:27 +02:00
parent d0eb716738
commit f31ab80731
+9 -9
View File
@@ -549,13 +549,13 @@ void SvgSerializer::write(const IfcGeom::BRepElement<real_t>* brep_obj) {
} else if (elevation_ref_guid_) {
is_elevation = *elevation_ref_guid_ == brep_obj->guid();
}
BRepBuilderAPI_Transform make_transform_global(compound_local, trsf, true);
make_transform_global.Build();
// (When determinant < 0, copy is implied and the input is not mutated.)
auto compound_unmirrored = make_transform_global.Shape();
if (is_section || is_elevation) {
BRepBuilderAPI_Transform make_transform_global(compound_local, trsf, true);
make_transform_global.Build();
// (When determinant < 0, copy is implied and the input is not mutated.)
auto compound_unmirrored = make_transform_global.Shape();
boost::optional<double> scale;
boost::optional<std::pair<double, double>> size;
@@ -672,6 +672,10 @@ void SvgSerializer::write(const IfcGeom::BRepElement<real_t>* brep_obj) {
element_buffer_.push_back(data);
}
// Augment bnd_ regardless of whether emitting storeys as we depend
// on the global bounds also for the storey height annotations.
BRepBndLib::Add(compound_unmirrored, bnd_);
if (emit_building_storeys_) {
write(data);
}
@@ -733,10 +737,6 @@ void SvgSerializer::write(const geometry_data& data) {
}
#endif
if (is_floor_plan_) {
BRepBndLib::Add(compound_unmirrored, bnd_);
}
// SVG has a coordinate system with the origin in the *upper*-left corner
// therefore we mirror the shape along the XZ-plane.
gp_Trsf trsf_mirror;