Skip to content
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

Expose normals in libfive_mesh #547

Open
lf94 opened this issue Oct 4, 2023 · 2 comments
Open

Expose normals in libfive_mesh #547

lf94 opened this issue Oct 4, 2023 · 2 comments

Comments

@lf94
Copy link

lf94 commented Oct 4, 2023

Seems it's possible to compute normals #45 but they aren't exposed in any way.

@lf94
Copy link
Author

lf94 commented Oct 4, 2023

@lf94
Copy link
Author

lf94 commented Oct 4, 2023

Which leads me to a nicer high level function here:

libfive_vec3 libfive_tree_eval_d(libfive_tree t, libfive_vec3 p)
{
    DerivArrayEvaluator e((Tree(t)));
    auto v = e.deriv({p.x, p.y, p.z});
    return {v.x(), v.y(), v.z()};
}

But I'm not sure what exactly when to invoke this. Do I need to traverse the whole SDF, wait until I hit a boundary (0), and then .... something?

Edit: https://jamie-wong.com/2016/07/15/ray-marching-signed-distance-functions/#surface-normals-and-lighting

Edit:

we’ll do an approximation by sampling points around the point on the surface

Aha!

It seems then I need to go into one of the walkers / meshers and add this calculation there when at the boundary?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant