Remeshing using level set zero

246 views
Skip to first unread message

ramesh santhanam

unread,
May 19, 2015, 7:02:46 PM5/19/15
to openvd...@googlegroups.com

Greetings. Has anyone had experience using vdb to remesh (using level sets) an input mesh with texture (u,v)'s and generating (u,v)
on the output mesh. Was thinking along the following lines: Generate (u,v) for the voxel vertices defining the narrow band. One could
use the mesh triangle primitives that are nearest to the voxel vertex and use barycentric coordinates on the (u,v)'s of the nearest triangle.
The (u,v) on the voxels will need to be transferred to the resulting mesh when doing the volume to mesh conversion. Any pointers would
be appreciated. An alternate brute force way would be finding the closest point for each vertex on the resulting mesh to the input mesh and
then using barycentric coordinate to assign an (u,v).
Regards
ramesh

Ryan Mazzolini

unread,
May 24, 2015, 5:29:17 PM5/24/15
to openvd...@googlegroups.com
Hi Ramesh,

There was another thread here where we had a short discussion on generating UV's. I use the closest primitive index created by the MeshToVolume method to approximate the UV's. From the primitive index, I project the voxel's position onto the closest poly and use barycentric coordinates to get the approximate UV (be careful of edge cases where the voxels pos is outside of the poly).

On the VolumeToMesh side, I basically do the inverse operation and create a new texture with UV's (I went that route because I heavily modify the grid shape and colours). I parameterize the mesh created (I use a really naive method of UV creation for now) then run through every pixel within the poly's UV's. For each pixel in the poly's UV I find it's world position from its UV value. Then I do a closest distance check for each pixel's world position and find the the closest voxel in the narrow band (accelerated by an octree traversal). Finally, I colour the pixel according to the closest voxel. You might want to interpolate between a bunch of the nearest voxels here :)

Hope that makes sense and is helpful!
Ryan
Reply all
Reply to author
Forward
0 new messages