Sort point order - Aligning point order of similar objects

unhandled

(PA_83) #1

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


(Michael Pryor) #2

Post files


(PA_83) #3

Point order issue.gh (1.2 MB)


(Michael Pryor) #4

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)


(PA_83) #5

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.


#6

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


(PA_83) #7

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


#8

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


(PA_83) #9

There is a file…and a question…


#10

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.


(Tim Stark) #11

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.


(Tim Stark) #12

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)


(PA_83) #13

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


(PA_83) #14

@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?


(Tim Stark) #15

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.


(PA_83) #16

It does work. Thanks!