From e3867a118cae0563dcc8266461f66dc7a9fd6fb4 Mon Sep 17 00:00:00 2001 From: Thomas Krijnen Date: Sun, 18 Feb 2024 13:59:55 +0100 Subject: [PATCH] IfcConvert --keep-bounding-boxes option, default is now exluded. #4012 #2138 #2044 #4032 --- src/ifcgeom/ConversionSettings.h | 10 +++++++++- src/ifcgeom/mapping/IfcBoundingBox.cpp | 5 +++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/src/ifcgeom/ConversionSettings.h b/src/ifcgeom/ConversionSettings.h index 7928c29748..b6572883d5 100644 --- a/src/ifcgeom/ConversionSettings.h +++ b/src/ifcgeom/ConversionSettings.h @@ -306,6 +306,14 @@ namespace ifcopenshell { static constexpr int defaultvalue = 16; }; + struct KeepBoundingBoxes : public SettingBase { + static constexpr const char* const name = "keep-bounding-boxes"; + static constexpr const char* const description = + "Default is to removes IfcBoundingBox from model prior to converting geometry." + "Setting this option disables that behaviour"; + static constexpr bool defaultvalue = false; + }; + enum PiecewiseStepMethod { MAXSTEPSIZE, MINSTEPS }; @@ -408,7 +416,7 @@ namespace ifcopenshell { }; class IFC_GEOM_API Settings : public SettingsContainer< - std::tuple + std::tuple > {}; } diff --git a/src/ifcgeom/mapping/IfcBoundingBox.cpp b/src/ifcgeom/mapping/IfcBoundingBox.cpp index d2a3a507f1..21085fb2bb 100644 --- a/src/ifcgeom/mapping/IfcBoundingBox.cpp +++ b/src/ifcgeom/mapping/IfcBoundingBox.cpp @@ -23,6 +23,11 @@ using namespace ifcopenshell::geometry; taxonomy::ptr mapping::map_impl(const IfcSchema::IfcBoundingBox* inst) { + if (!settings_.get().get()) { + // @todo make sure it doesn't log. + return nullptr; + } + const double dx = inst->XDim() * length_unit_; const double dy = inst->YDim() * length_unit_; const double dz = inst->ZDim() * length_unit_;