volume of box-solid always :unbound
Created by: reiniervandijk
Object surf:box-solid inherits both surf:brep and geom-base:box. Object geom-base:box defines volume as multiplication of width, length, height. Object surf:brep defines it as the result of a geometry kernel function call. Unfortunately the slot-status of :volume is now always set to :unbound, no matter if volume was already evaluated or not. This is in absolute contrast to lean computing on the basis of dependency tracking. Suggestion to keep volume message definition according to box and remove brep definition.
gdl-user> (make-self 'box-solid :width 2 :length 3 :height 4)
#<box-solid @ #x26ccd92a>
gdl-user> (the (slot-status :volume))
:unbound
gdl-user> (the volume)
24.000000000000007
gdl-user> (the (slot-status :volume))
:unbound
**Imported comments:**
*By genworks on 2013-01-22 19:30:04 UTC*
That is because :volume in the geometry kernel is a function and not a computed-slot per se. That is because it accepts a tolerance argument, and computed-slots cannot accept arguments.
We may want to make this into a cached-function, although we have not much real-world testing experience with cached-functions yet.
Will have to think this one over.
*By reiniervandijk on 2013-01-22 19:35:01 UTC*
Note that I had already explained exactly what the reasons were for this behavior, no need to repeat. Cached-functions may be a nice approach, however, please note that the issue I address here is that:
"it is only reasonable for a user to expect that volume is a computed slot"
however, is contrast, it behaves completely different. This causes massive misuse, hence a serious issue.
*By genworks on 2015-01-30 23:21:10 UTC*
Indeed maybe we can override the volume for this specific brep and just compute it directly as we do for box...
*By genworks on 2015-01-30 23:21:16 UTC*
moving to internal tracking list.