@@ -401,6 +401,7 @@ static const std::string SURFACE_AREA_ALONG_X = "SURFACE_AREA_ALONG_X";
401401static const std::string SURFACE_AREA_ALONG_Y = " SURFACE_AREA_ALONG_Y" ;
402402static const std::string SURFACE_AREA_ALONG_Z = " SURFACE_AREA_ALONG_Z" ;
403403static const std::string WALKABLE_SURFACE_AREA = " WALKABLE_SURFACE_AREA" ;
404+ static const std::string LARGEST_FACE_AREA = " LARGEST_FACE_AREA" ;
404405
405406class QuantityWriter_v0 : public EntityExtension {
406407private:
@@ -424,7 +425,7 @@ class QuantityWriter_v1 : public EntityExtension {
424425 QuantityWriter_v1 (const IfcGeom::BRepElement<float , double >* elem) :
425426 elem_ (elem)
426427 {
427- double a, b, c;
428+ double a, b, c, largest_face_area = 0 . ;
428429
429430 if (elem_->geometry ().calculate_surface_area (a)) {
430431 put_json (TOTAL_SURFACE_AREA, a);
@@ -439,6 +440,20 @@ class QuantityWriter_v1 : public EntityExtension {
439440 put_json (SURFACE_AREA_ALONG_Y, b);
440441 put_json (SURFACE_AREA_ALONG_Z, c);
441442 }
443+
444+ for (auto & part : elem->geometry ()) {
445+ TopExp_Explorer exp (part.Shape (), TopAbs_FACE);
446+ while (exp.More ()) {
447+ GProp_GProps prop;
448+ BRepGProp::SurfaceProperties (exp.Current (), prop);
449+ const double area = prop.Mass ();
450+ if (area > largest_face_area) {
451+ largest_face_area = area;
452+ }
453+ }
454+ }
455+
456+ put_json (LARGEST_FACE_AREA, largest_face_area);
442457 }
443458};
444459
0 commit comments