rich_lord Posted December 6, 2012 Share Posted December 6, 2012 Hello, I have a number of point groups, and i`d like to sort the numbers by group. Group_1 should have its points sorted so they are ordered 0-number of points in this group, Group_2 should have its points sorted so they follow on from that.... etc Is there a way to do this? Some kind of expression in the sort node? Thanks! Quote Link to comment Share on other sites More sharing options...
acey195 Posted December 6, 2012 Share Posted December 6, 2012 This can be very easily done by using delete and merge nodes. Per group you delete all the rest. (so you only have group 1 left in one node and group 2 in another node) Then you can simply merge them again. depending on the order at which you connect the nodes to the merge node, the order changes. The first node will get the lowest numbers. Quote Link to comment Share on other sites More sharing options...
anim Posted December 6, 2012 Share Posted December 6, 2012 just append For Each SOP set it to Each Group mode with Group_* as a mask and check Apply To Points since they are point groups this will automatically sort them by group since it processes each group separately then merges together of course groups should include all points and not overlap each other if you have geometry as well not just points then you will need to transfer point numbers from new points back to original geometry and sort by that Quote Link to comment Share on other sites More sharing options...
rich_lord Posted December 6, 2012 Author Share Posted December 6, 2012 Two good methods - thanks! I tried them both and they work great - seems really useful to be able to control point number like this - I didnt realise that happened when I delete/merge and use the foreach. Quote Link to comment Share on other sites More sharing options...
acey195 Posted December 6, 2012 Share Posted December 6, 2012 Under the hood, both methods actually do the exact same thing personally I prefer a copy-delete-combo-loop over a foreach-loop, especially when using the stamp function. but in this case it should not really matter. Quote Link to comment Share on other sites More sharing options...
anim Posted December 7, 2012 Share Posted December 7, 2012 it matters if you want to be procedural and have variable amount of groups, in this case for each doesn't do anything special so it should be fast, but otherwise it is the same thing 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.