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 :


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 !




Share this post

Link to post
Share on other sites
Posted (edited)

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 :( )



Edited by DonRomano

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