Jump to content

Sample NURBS Surface normal at uv?


Juraj

Recommended Posts

Hello,
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?

 

Thanks,
Juraj

Link to comment
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
typo
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...