Sort point order - Aligning point order of similar objects

Hi All,
I have around 1000 Breps in my model. When I deconstruct the Breps, I can see that all are based on a different point order. I have tried the following ways to align the point order of all the Breps:
-sort points by distance to an external point
-sort points of one Brep and then sort lists of all other Breps to match that one Brep.
None of the method is giving me the result. Is there a way to align the point order of all the Breps?
Thanks for your help.
PA

Post files

Point order issue.gh (1.2 MB)

Sorry the file is much too heavy to examine. Reduce the problem down to a usable size (maybe just include a few of the breps, not all)

I think it actually becomes more challenging since it is such a high number of elements. If I just put 10 elements in the file, the solution might not work for the situation I am looking at.

Without a file (I see you posted one later), this solution isn’t specific to your model and might be useless.

Thanks, but this isn’t what I am looking at at the moment

Which is why it’s so important to post a file with a question - to avoid wasting people’s time!!!

There is a file…and a question…

I nearly always regret responding to threads where a file wasn’t posted with the initial question. Will try even harder to avoid doing that in the future.

Yes, but we can compare the calculation time of two different solutions. I mean, when 10 breps in Solution A take 1 sec and in Solution B 2 sec, you would know A is better. But you can‘t expect that the people trying to help you wait 10 min to load your file.

And there should be no difference in 10 or 1000 breps. And even if, you can adjust the script when you have once a good method.

Dunno why, but I think I was bored. I just deleted 900 breps and this should work. They all are oriented to the “midpoint” of your stadium or whatever. Starting bottom right side, against the clock.


Point order issue_re.gh (476.7 KB)

Thanks for your help and input. Will have a look at the solution.
Best,
PA

@tim.stark
Am I right to think that the same logic could work for an object with 12 points instead of 8? The only thing I would need to change is the duplication of circles from 2 to 3?

Should work I think. If not, shouldn’t be a Problem to Change the script. Try it, if it’s not working, I’ll help.

It does work. Thanks!