Open jkunimune opened 3 months ago
Thanks for reporting.
I've added documentation for this behavior in both is_closed() and volume() methods, but also in Box
and Cylinder
.
Checking whether the mesh is triangular in volume() might be computationally expensive if these methods are called in loops or for large meshes.
import vedo
box = vedo.Box().triangulate().clean()
print("Box :", box.volume(), box.is_closed(), box.is_manifold())
cylinder = vedo.Cylinder().triangulate().clean()
print("Cylinder:", cylinder.volume(), cylinder.is_closed(), cylinder.is_manifold())
pyramid = vedo.Pyramid() # not necessary, already triangulated
print("Pyramid :", pyramid.volume(), pyramid.is_closed(), pyramid.is_manifold())
sphere = vedo.Sphere()
print("Sphere :", sphere.volume(), sphere.is_closed(), sphere.is_manifold())
Calculating the volume of a Box or a Cylinder seems to always return zero for Box and Cylinder objects, even though they plot just fine and seem overall well-formed. Similarly,
is_closed()
seems to always return False. Pyramids and Spheres work fine. I'm thinking it may be related to the fact that Boxes and Cylinders are wholly composed of non-triangular cells, since callingtriangulate()
causes them to give nonzero volumes (but they still don't register as closed).