Jump to content

Is there a way to transfer uvw parametric coordinates from a prim to another ?


Recommended Posts

Hey guys,

 

I'm working on some procedural tools and I need to add points on 2 primitives (they are approximately the same) to then add polylines for each pair of points (to make some grooves like there is on haussmannian building rooftops).

This screenshot may help to understand :

Spectacle.Z12044.thumb.png.4bea288395914a292989e82ae36d6eef.png

The thing I do for now is resample the bottom prim, and then use primuv() to sample the pos based on the @curveu (or u in the screenshot) attribute on the upper prim, and for the line I have a Add node -> by group -> by attribute, and it works like a charm; until the 2 primitives have different parametric coordinates. Sometimes it have offset, or even it's inverted, and the points aren't interpolated as I want. So, I wonder if there is a way to copy the uv coordinates from one primitive to another one, or a better solution to this !

 

Cheers, 

 

Link to comment
Share on other sites

I finally found a pretty simple solution :

- iterate through every face of the mesh (before becoming lines it's a ring of polygons) 

- keep the up and bottom lines (like the screenshot before, but here it's for every face, and not all of them like before)

- compare the ptnum "sorting" between the top and bot. line :

    - if the "sorting" is the same (i.e the ptnum are "equal" from left to right or inverse") then the u coord is going in the same direction so I can use it to interpolate points with the same technique as before

    - if the sorting is inverted, the u coords are going in an opposite direction, so I just have to invert it when I interpolate the points

- resample points on the bottom line and then interpolate them on the top line using primuv() with the u or the inverted u

Works really well !!

(if someone needs, I can make schemes but I don't have photoshop at work so i can't for now :( )

Cheers,

 

Edited by DonRomano
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...