DonRomano Posted July 30, 2020 Share Posted July 30, 2020 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 ! Cheers, Quote Link to comment Share on other sites More sharing options...
DonRomano Posted July 30, 2020 Author Share Posted July 30, 2020 (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 ) Cheers, Edited July 30, 2020 by DonRomano Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.