diff --git a/src/serializers/SvgSerializer.cpp b/src/serializers/SvgSerializer.cpp index 9662544c8a..475cbc0423 100644 --- a/src/serializers/SvgSerializer.cpp +++ b/src/serializers/SvgSerializer.cpp @@ -574,6 +574,11 @@ void SvgSerializer::write(const IfcGeom::BRepElement* brep_obj) { b->second[0] - b->first[0], b->second[1] - b->first[1] ); + +#if OCC_VERSION_HEX >= 0x70300 + view_box_3d_.emplace(); + BRepBndLib::AddOBB(compound_unmirrored, *view_box_3d_, false, false, false); +#endif } std::vector props; @@ -712,6 +717,17 @@ void SvgSerializer::write(const geometry_data& data) { // (When determinant < 0, copy is implied and the input is not mutated.) auto compound_unmirrored = make_transform_global.Shape(); +#if OCC_VERSION_HEX >= 0x70300 + if (view_box_3d_) { + Bnd_OBB obb; + BRepBndLib::AddOBB(compound_unmirrored, obb, false, false, false); + if (view_box_3d_->IsOut(obb)) { + Logger::Notice("Not including element due to viewBox", data.product); + return; + } + } +#endif + if (is_floor_plan_) { BRepBndLib::Add(compound_unmirrored, bnd_); } diff --git a/src/serializers/SvgSerializer.h b/src/serializers/SvgSerializer.h index 270130d996..957bc1aa90 100644 --- a/src/serializers/SvgSerializer.h +++ b/src/serializers/SvgSerializer.h @@ -33,6 +33,11 @@ #include #include #include +#include + +#if OCC_VERSION_HEX >= 0x70300 +#include +#endif #include #include @@ -141,6 +146,11 @@ protected: boost::optional> size_, offset_2d_; boost::optional space_name_transform_; +#if OCC_VERSION_HEX >= 0x70300 + boost::optional view_box_3d_; +#endif + + bool with_section_heights_from_storey_, print_space_names_, print_space_areas_; storey_height_display_types storey_height_display_; bool draw_door_arcs_, is_floor_plan_;