-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Meshing Non-learned UDFs #6
Comments
Hello, You can simply pass your exact UDF values and their gradients to 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, |
Thanks! Yes, that helps a lot! |
@bguillard hi, thanks for sharing your great work. May I ask, how to compute gradients? grad_x, grad_y, grad_z = np.gradient(udf)
gradients = np.stack([grad_x, grad_y, grad_z], axis=-1) # (v v v 3)
# optional, gradients=norm(gradients)
verts, faces, _, _ = udf_mc_lewiner(udf, -gradients, spacing=[2.0 / (vol_resolution - 1)] * 3) |
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!
The text was updated successfully, but these errors were encountered: