CinnamonMetal Posted March 28, 2018 Share Posted March 28, 2018 I want to sort a set of primitives as seen in the image ? Quote Link to comment Share on other sites More sharing options...
konstantin magnus Posted March 29, 2018 Share Posted March 29, 2018 (edited) Sort radially and by distance, then add your results. In a primwrangle: f@radial = atan2(@P.x, @P.z); f@dist = length(@P); @sort = @dist + @radial * 0.01; Afterwards set the sort node to primitives, "by attribute" and "sort". Edited March 29, 2018 by konstantin magnus 1 Quote Link to comment Share on other sites More sharing options...
CinnamonMetal Posted March 29, 2018 Author Share Posted March 29, 2018 Thanks @konstantin magnus, although I know the image I originally posted is sorta identical to this new image posted. I want to have complete control over the primitive number. Although the only way I know is if the object is modeled primitive by primitive as we are all familiar with. Quote Link to comment Share on other sites More sharing options...
StepbyStepVFX Posted March 30, 2018 Share Posted March 30, 2018 You can try using the method described above, but with the UVs attribute (promoted) instead of position... provided you lays the uv correctly (ie. that once unfold, you can use the method above) Quote Link to comment Share on other sites More sharing options...
CinnamonMetal Posted March 30, 2018 Author Share Posted March 30, 2018 What do you mean by, promoted ? I thought of the same although wondered how UV would sort primitives ? Quote Link to comment Share on other sites More sharing options...
StepbyStepVFX Posted March 30, 2018 Share Posted March 30, 2018 I was meaning using Attribute Promote : UVProject, vertices and polar mode UV Transform to center your UVs on the primitve you want as center (prim 0) Attribute Promote from original class Vertex to New class Primitive, with Promotion method = Average Then Primitive Wrangle as explained above : @uv.z = 0; f@radial = atan2(@uv.x, @uv.y); f@dist = length(@uv); @sort = @dist + @radial * 0.01; Sort node, Primitive, By Attribute, put sort as attribute. I tried but not convinced by the result so far :-) But check if that's fine for you... I think you'll have to work on a sort attribute made with a wrangle node setup on Detail (run once) and "navigate" your geometry in an intelligent way... (I did something once to determine symetrical topology : Maybe you can do something similar to "sort" your primitives by navigating in spiral around a point : you start at point 0, then finds all primitives to whom this point belong to, you "sort" them by incrementing a sort variable, once all have this attribute value, you find the adjacent primitves starting by the first allocated, and "sort" them, etc. until you "visited" all primitives (so you'll need an array storing all prim number of visitited primitives). I think that's not to hard, but maybe long to write :-) Quote Link to comment Share on other sites More sharing options...
CinnamonMetal Posted March 30, 2018 Author Share Posted March 30, 2018 Quote Maybe you can do something similar to "sort" your primitives by navigating in spiral around a point : you start at point 0, then finds all primitives to whom this point belong to, you "sort" them by incrementing a sort variable, once all have this attribute value, you find the adjacent primitves starting by the first allocated, and "sort" them, etc. until you "visited" all primitives (so you'll need an array storing all prim number of visitited primitives). I think that's not to hard, but maybe long to write :-) I was thinking about something similar but how do I associate which primitives the point belongs too ? Although I was thinking picking a primitive using that as 0 then it spirals out organized as; 1,2,3,4 etc. Unless I find the nearest primitive of the next primitive and so that sorts the primitive in a organized number method (1,2,3,4 etc). 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.