Align bounding boxes

Hi guys, I need your help with a Grasshopper script I’m working on. I have 151 elements enclosed by bounding boxes, and I want to arrange them so that their vertical edges are precisely aligned.

Please read this: Help us Help you, Before you call or email tech support

and then ask again, so we can help you better.

Regards, Eef

thanks, eef weenink, i will be more clear. This is the situation I was talking about. Right now, I have bounding boxes that I can’t align correctly because some are closer and others are farther away. I tried using Grasshopper, as you can see in the picture below, but I still can’t align them properly.



I’ll also upload the Grasshopper file just to be safe.
coll-nome-v910-rh8.gh (1.7 MB)

Have you tried the move to plane component yet?

Hi Martin, yes, I’ve already tried that, but I still can’t align them correctly. Do you have any solution in mind?

Which of the vertical edges do you want to align? The left side on the YZ plane?


These ones marked in blue.

This and some more pufferfish. I can’t help you with that file.

The blue lines are horizontal. You want to make the gaps even? Basically distribute the objects?

I’m extracting the problem from that file. The components it asks you to download are not essential for solving the issue.
Problem 01.gh (360.1 KB)
this file sould be ok

I would like the lines marked in the picture to be attached to each other uniformly.

= no gaps?

I’m not sure what’s up with the empty groups.

Problem 01.gh (371.6 KB)

no gaps yes, I think you solved the problem in 5 minutes hahaha, thank you very much!

1 Like

It can be confusing.

Here is a slightly different approach to @martinsiegrist:


Problem 01_v2.gh (382.2 KB)

1 Like

Thank you very much, Adam! Your approach is also very interesting. If someone wanted to delve a bit deeper into the problem, I continued the script so that they align based on the choice of letters, but they still remain disconnected. @martinsiegrist @Adam_M
Problem02.gh


(470.1 KB)

You messed with the logic.

To have the letters go downwards, align the characters below the X axis.

Problem02.gh (477.8 KB)

Ah, ok ok, now it’s much clearer. Let me ask you a question: why do you think the letters in the movement are not centered? As shown in the picture red for how they are now, blue for how they should be.

You can extract the center of the bounding boxes of the stacked letters and move those to an axis / calculate the distance to an axis. Then use that transformation to move the letters.

Thank you so much for your help! I really appreciate it.

1 Like

Here we are with problem number 3 :joy: : I need to assign a specific distance to uppercase letters and a different distance to lowercase letters. Any ideas or suggestions on how to do it? I need the script to recognize which letters are uppercase and which are lowercase

Use the width of your bounding box to find them. Uppercase all have a wider box.