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, smooth the level set with a
# Gaussian filter, 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

# Gaussian filtering of level set:
#   number of iterations is 5
#   spatial discretization is 5th-order WENO
#   temporal discretization is 1st-order TVD-RK
#   filter-kernel size is 1.0 voxels
gauss iter=5 space=5 time=1 size=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_smooth.ply
