Labeling/Numbering order

Hello everyone!
I need help for the labeling of this pavilion so that the assembly, after the laser cut, is more orderly! Because as you will see in the images it is not ordered.

How can I make it so that the order is in any of these ways?



A0, A1, A2… B0,B1,B2… C0,C1,C2…

Label order.gh (217.9 KB)

PD: I’m using OpenNest plugin por the Text

Aaaaaaargh :smiley:

Label order.gh (233.0 KB)

:roll_eyes:

missing

Missed three of those :grimacing:… It’s only for display though.

If you really want to look at this definition, prepair some aspirin :smiley:

Label order.gh (230.4 KB)

1 Like

I already did but I learned nothing.

Yes that’s mainly sorting upon sorting, nothing very creative.
I tried to use Point3d.SortAndCullPoints method but the results were not very good.

I think there might be some sorting techniques related to triangular meshes, but this is a spot where I lack knowledge.

My two cents for a qnd solution:

  1. Split up the triangles manually into the three groups
  2. Retrieve each center point using the “Area” component
  3. Sort the triangles according to their center point’s z-coordinate

It still is a little messy, I know, but it might be enough depending on your use case.

grafik

triangle-sort.gh (195.2 KB)

1 Like

This code separates the three branches and sorts them based on the distance from each triangle’s centroid to its respective branch “base line” (yellow group). It’s not as accurate as @magicteddy’s code but maybe good enough? (considering it’s simpler and more comprehensible, at least to me)

The gray group inside the blue group shouldn’t be necessary but I couldn’t get it to work so took the expedient route. There are surely ways to improve this…


Label order_2023May25a.gh (251.7 KB)

1 Like

I’m amazed by the result’s accuracy by only sorting one time.

It’s necessary because Create Set doesn’t output A,B and C in this order.

Changed it like this :

Sorry but the canvas just magicteddycally got four times larger :sweat_smile:

Label order_2023May25b.gh (241.8 KB)

1 Like

Aha! Thanks for that insight. I’ve gotten rusty from lack of practice.

In this particular case, just reversing the output from the yellow group makes it work without the gray group, but it’s not robust. Jittering the list of surfaces will break this:

You seem to love that canvas sprawl. :man_shrugging: Why not delete my groups while you were at it? :wink:

This really helps me a lot for the production! Thanks a lot guys @Joseph_Oster @magicteddy @henry.langner

1 Like