Signed distance from mesh surface#
from vedo import *
settings.default_backend = "vtk"
msh = Mesh(dataurl + "panther.stl")
msh
vedo.mesh.Mesh (...l.es/examples/data/panther.stl)
|
# create a Volume (3D Image) from a Mesh
vol = msh.signed_distance(dims=[25,125,25])
iso = vol.isosurface(0.0)
iso
vedo.mesh.Mesh
|
plt = Plotter()
plt += iso.wireframe()
for i in range(0, 25, 5):
plt += vol.xslice(i).cmap("jet")
# vol.write("panther.tif") #can save it this way.
plt.show(axes=1)
plt.close()