Jump to content

Sample NURBS Surface normal at uv?

Recommended Posts

is there a VEX function for sampling N at arbitrary location in NURBS surface (based on uv location for example)?
One way would be to convert NURBS to polys and get normals from them. But I thought that maybe there is easy way of getting N directly from NURBS?



Share this post

Link to post
Share on other sites

Thanks, it works, I can get P and N attributes (even if there is no N attribute at NURBS surface)
Is there a list of attributes I can import from NURBS surface? maybe tangent, bitangent?

However I am not sure if it is a bug or something, but it is super slow to sample those attributes. It takes 2 seconds to compute very simple wrangle on quite fast pc :)

int prim;
vector uv;
float dist = xyzdist(1, v@P, prim, uv);

vector N = primuv(2, "N", prim, uv);

if (dist < chf("tr")) {
    v@P = primuv(2, "P", prim, uv) + N*dist;

If I use the same wrangle but with NURBS converted to polys, then I have realtime feedback when modifying NURBS surface.

Edited by Juraj

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now