File tree Expand file tree Collapse file tree 1 file changed +27
-0
lines changed
Expand file tree Collapse file tree 1 file changed +27
-0
lines changed Original file line number Diff line number Diff line change @@ -300,6 +300,33 @@ struct ShapeRTTI : public boost::static_visitor<PyObject*>
300300 %}
301301};
302302
303+ %extend IfcGeom::BRepElement {
304+ double calc_volume_ () const {
305+ double v;
306+ if ($self->geometry ().calculate_volume (v)) {
307+ return v;
308+ } else {
309+ return std::numeric_limits<double >::quiet_NaN ();
310+ }
311+ }
312+
313+ double calc_surface_area_ () const {
314+ double v;
315+ if ($self->geometry ().calculate_surface_area (v)) {
316+ return v;
317+ } else {
318+ return std::numeric_limits<double >::quiet_NaN ();
319+ }
320+ }
321+
322+ %pythoncode %{
323+ # Hide the getters with read-only property implementations
324+ geometry = property (geometry)
325+ volume = property (calc_volume_)
326+ surface_area = property (calc_surface_area_)
327+ %}
328+ };
329+
303330%extend IfcGeom::Material {
304331 %pythoncode %{
305332 # Hide the getters with read-only property implementations
You can’t perform that action at this time.
0 commit comments