From f31ab80731f3fffb428409092b4cf07c0f835348 Mon Sep 17 00:00:00 2001 From: Thomas Krijnen Date: Wed, 8 Sep 2021 13:50:27 +0200 Subject: [PATCH] Fix combination --draw-storey-heights --svg-without-storeys --- src/serializers/SvgSerializer.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/serializers/SvgSerializer.cpp b/src/serializers/SvgSerializer.cpp index c7e679e793..0a08076ed3 100644 --- a/src/serializers/SvgSerializer.cpp +++ b/src/serializers/SvgSerializer.cpp @@ -549,13 +549,13 @@ void SvgSerializer::write(const IfcGeom::BRepElement* 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 scale; boost::optional> size; @@ -672,6 +672,10 @@ void SvgSerializer::write(const IfcGeom::BRepElement* 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;