#1153 SVG OBB check

This commit is contained in:
Thomas Krijnen
2021-04-24 11:05:18 +02:00
parent cb70f97789
commit e06794ef3d
2 changed files with 26 additions and 0 deletions
+16
View File
@@ -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_);
}