Why does my solid have 0.0 volume?
Created by: reiniervandijk
Okay, finally got my head around this after experiencing this problem multiple times. For a lot of boolean-operations (merging, uniting, etc.) where open faces are the input, the resulting brep will not be a true solid and have a volume of 0.0. The only way to get around this is to make another explicit 'manifold-solid with that former brep as input, since there are no :make-manifold? messages to set (with the exception of merged-solid). Only then will the new brep be a true solid (with 2 regions) with a real volume. I don't think the whole manifold story is well explained in the documentation, actually not at all. This is a serious issue right now.
Replicate:
(define-object volume-sample (base-object)
:objects
((box :type 'box-solid
:width 2 :length 2 :height 2)
(merged :type 'merged-solid :other-brep (the box :face-breps :list-elements))
(united :type 'united-solid :other-brep (the box :face-breps :list-elements))
(merged-manifold :type 'manifold-solid :brep (the merged))
(united-manifold :type 'manifold-solid :brep (the united))
)
)
Then try:
> (make-self 'volume-sample)
#<volume-sample @ #x27e80aea>
> (the merged :volume)
0.0
> (the united :volume)
warn? = t ;; <-- for what?
0.0
> (the merged-manifold :volume)
Manifold Success!
8.0
> (the united-manifold :volume)
Manifold Success!
8.0
I guess you see the pattern. This should definitely become clearer from documentation or warnings, because now user is just disappointed. Strange enough, the properties function does return values:
> (the merged :properties)
(:area 24.0 :volume -7.999999999999999 :barycenter #(0.0 0.0 0.0))
> (the united :properties)
(:area 24.0 :volume -7.999999999999999 :barycenter #(0.0 0.0 0.0))
Imported comments:
By genworks on 2015-01-30 23:08:06 UTC
moving to internal tracking list.