Well a single mesh must have a single array of mesh faces, so you certainly won't be able to have two (or more) faces with the same index. However, a list of polylines (like the outlines of each meshface) could be sorted and split into multiple lists.
It seems your original mesh faces are already sorted though. Is this something that can be relied upon? In other words, do you need to just shuffle the order or do you really need to sort any collection of meshfaces?
Just thought I would add something to this discussion. Although it has been dormant for a while I have found it really helpful. For my own work I needed all the mesh face boundaries as individual lines and I needed them sorted. Now as this creates duplicate lines when flattened, removing the duplicates always messes up the orders and quite often the order is mixed up if the original surface/mesh is rotated.
Using the scripts posted on this discussion, particularly David Rutten's 2D sort, I think this may be a solution for sorting the lines (not the faces) according to U and V values rather than the cartesian co-ordinates. This means that for any rotation of the initial surface, it should still work. I would be interested to see if anyone gets the same results or can see ways of improving this.
David Rutten
Well a single mesh must have a single array of mesh faces, so you certainly won't be able to have two (or more) faces with the same index. However, a list of polylines (like the outlines of each meshface) could be sorted and split into multiple lists.
It seems your original mesh faces are already sorted though. Is this something that can be relied upon? In other words, do you need to just shuffle the order or do you really need to sort any collection of meshfaces?
--
David Rutten
david@mcneel.com
Poprad, Slovakia
Mar 23, 2011
L]G
hI, a fellow user redirected me to this thread, but i have not been able to apply the definitions to my problem,here is the post
http://www.grasshopper3d.com/profiles/blogs/sorting-points-based-on
Thank you so much in advance
Mar 23, 2011
Michael Clarke
Just thought I would add something to this discussion. Although it has been dormant for a while I have found it really helpful. For my own work I needed all the mesh face boundaries as individual lines and I needed them sorted. Now as this creates duplicate lines when flattened, removing the duplicates always messes up the orders and quite often the order is mixed up if the original surface/mesh is rotated.
Using the scripts posted on this discussion, particularly David Rutten's 2D sort, I think this may be a solution for sorting the lines (not the faces) according to U and V values rather than the cartesian co-ordinates. This means that for any rotation of the initial surface, it should still work. I would be interested to see if anyone gets the same results or can see ways of improving this.
Jan 23, 2013