mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-09 09:21:46 +00:00
#1153 SVG OBB check
This commit is contained in:
@@ -574,6 +574,11 @@ void SvgSerializer::write(const IfcGeom::BRepElement<real_t>* 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<string_property> 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_);
|
||||
}
|
||||
|
||||
@@ -33,6 +33,11 @@
|
||||
#include <HLRAlgo_Projector.hxx>
|
||||
#include <gp_Pln.hxx>
|
||||
#include <Bnd_Box.hxx>
|
||||
#include <Standard_Version.hxx>
|
||||
|
||||
#if OCC_VERSION_HEX >= 0x70300
|
||||
#include <Bnd_OBB.hxx>
|
||||
#endif
|
||||
|
||||
#include <sstream>
|
||||
#include <string>
|
||||
@@ -141,6 +146,11 @@ protected:
|
||||
boost::optional<std::pair<double, double>> size_, offset_2d_;
|
||||
boost::optional<std::string> space_name_transform_;
|
||||
|
||||
#if OCC_VERSION_HEX >= 0x70300
|
||||
boost::optional<Bnd_OBB> 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_;
|
||||
|
||||
Reference in New Issue
Block a user