unshmettr Posted June 10, 2022 Share Posted June 10, 2022 Hi! How can I extract the primitveuv of given point on a curve (I asume that on polys one point is used by multiple primitives). Like the one xyzdist provides? Quote Link to comment Share on other sites More sharing options...
konstantin magnus Posted June 10, 2022 Share Posted June 10, 2022 (edited) Hi Joe, you could simply set the xyzdist()-function to the first input, so it's searching on its own geometry stream: int prim; vector uvw; xyzdist(0, v@P, prim, uvw); v@uvw = uvw; Alternatively, the resample node can output the "curveu" attribute. Just make sure to disable "maximum segment length" to avoid any changes on the curve. Edited June 10, 2022 by konstantin magnus Quote Link to comment Share on other sites More sharing options...
unshmettr Posted June 10, 2022 Author Share Posted June 10, 2022 Thanks konstantin, thanks! Just concerned about what happens when multiple curves overlap. I hoped that this can be extracted from some kind of primitive intrinsic or any other way that does not involve a point/prim lookup. Quote Link to comment Share on other sites More sharing options...
konstantin magnus Posted June 10, 2022 Share Posted June 10, 2022 I am afraid there are no intrinsics for points or vertices. But connaiseurs may divide the vertex index by the number of vertices on each primitive: f@u = vertexprimindex(0, i@vtxnum) / (primvertexcount(0, i@primnum) - 1.0); Quote Link to comment Share on other sites More sharing options...
unshmettr Posted June 10, 2022 Author Share Posted June 10, 2022 Yess, that's amazing. It's in my test it was 8x faster than the resample sop. I've had some weird thinks happening with the resample sop, that's why I was looking for alternatives. 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.