MeshUDF
MeshUDF copied to clipboard
Meshing Non-learned UDFs
Thanks a lot for the awesome contribution to the community!
I understand that the context of the project is more relevant to learned UDFs. However, I wonder if / how we can mesh an exact UDF (e.g., a HxWxD tensor) using the tools you provide?
Thanks a lot!
Hello, Yes you can use our meshing procedure on an exact UDF, provided you also have their spatial gradients. We tried and discussed it in the supplementary (Sec. 5.4): with an exact UDF, most artefacts disappear (holes, staircases...).
You can simply pass your exact UDF values and their gradients to udf_mc_lewiner
:
from _marching_cubes_lewiner import udf_mc_lewiner
udf_values = np.array(...)
gradients = np.array(...)
voxel_size = ...
verts, faces, _, _ = udf_mc_lewiner(udf_values,
gradients,
spacing=[voxel_size] * 3)
Hope it helps, Benoit
Thanks! Yes, that helps a lot!