diff --git a/src/ifcgeomserver/IfcGeomServer.cpp b/src/ifcgeomserver/IfcGeomServer.cpp index 4eb2ef7f4f..dfa041f05b 100644 --- a/src/ifcgeomserver/IfcGeomServer.cpp +++ b/src/ifcgeomserver/IfcGeomServer.cpp @@ -49,6 +49,8 @@ #include #include +#include +#include #include #include @@ -402,6 +404,8 @@ static const std::string SURFACE_AREA_ALONG_Y = "SURFACE_AREA_ALONG_Y"; static const std::string SURFACE_AREA_ALONG_Z = "SURFACE_AREA_ALONG_Z"; static const std::string WALKABLE_SURFACE_AREA = "WALKABLE_SURFACE_AREA"; static const std::string LARGEST_FACE_AREA = "LARGEST_FACE_AREA"; +static const std::string BOUNDING_BOX_SIZE_ALONG_ = "BOUNDING_BOX_SIZE_ALONG_"; +static const std::array XYZ = { "X", "Y", "Z" }; class QuantityWriter_v0 : public EntityExtension { private: @@ -454,6 +458,24 @@ public: } put_json(LARGEST_FACE_AREA, largest_face_area); + + { + Bnd_Box box; + double xyz[6]; + + for (auto& part : elem->geometry()) { + BRepBndLib::AddClose(part.Shape(), box); + } + + if (!box.IsVoid()) { + box.Get(xyz[0], xyz[1], xyz[2], xyz[3], xyz[4], xyz[5]); + for (int i = 0; i < 3; ++i) { + const double bsz = xyz[i + 3] - xyz[i]; + put_json(BOUNDING_BOX_SIZE_ALONG_ + XYZ[i], bsz); + } + } + + } } };