vdb_tool 10.8.0

# This example demonstrates how to read a polygon mesh from a PLY file,
# convert it into a narrow-band level set, dilate the level set,
# convert the level set back into an adaptive polygon mesh, and write
# the result to a binary PLY file.

# Read mesh
read bunny.ply

# Mesh to level set conversion:
#   dimension is 256 voxels along the longest axis
#   narrow-band half-width is 3 voxel units
mesh2ls dim=256 width=3

# Dilate level set:
#   radius of dilation is 5.0 voxels
#   spatial discretization is 5th-order WENO
#   temporal discretization is 1st-order TVD-RK
dilate radius=5 space=5 time=1

# Level set to polygon mesh conversion:
#   mesh adaptivity is 0.1 %
ls2mesh adapt=0.1

# Write polygon mesh to binary PLY file
write bunny_dilated.ply
