Finding Part Bounding Box by Largest Area and Longest Edge

I want to assign a bounding box to my components on the largest surface and the longest edge. My components are always free-standing in space. How can I also take the longest curve into account when assigning the bounding box?

Stueckliste_support.gh (18.8 KB)


Stueckliste_support VR 01.gh (19.7 KB)

Hope you have an enjoyable Sunday!

Thank you Volker, it works near by perfect. If i have groups it doesnt works and i dont know why… Have also a wonderfull Sunday :wink: You have any idea to solve it?

Stueckliste_support.gh (146.2 KB)

Yes, if it needs to work with a tree of data (i.e. multiple members) the script will need a little bit of alteration. Could you please give me some example geometry for me to work with?

I am busy. Maybe this evening.

Thank you for you support, i will be happy if it works :slight_smile:

What’s grouped in this data set?

Hi, all objects

He simply means he has a data set of BReps instead of a single item, not grouped geometry.

Ok in that case the parts would need to be in a data tree. One branch could contain multiple parts. The file provided does not contain this information.

But sometimes also grouped objects from rhino…

Oh. That I was not aware of. But it doesn’t matter for the first step, I don’t think. My initial plan was to flatten the BReps, work with that flattened list logic, then Unflatten back to the original tree structure. This is possible because there will ever only be one bounding box per BRep. The logic around ungrouping and regrouping exists outside of that, i.e. before and after. Maybe @martinsiegrist has time. Right now, I do not.

This boils down to how grouped geometry is referenced in Grasshopper in an efficient way. It requires a script, unless I’m missing something.

@michael.haertlein maybe you can provide a Rhino file with grouped and ungrouped geometry?

Thank you so much. It is working perfect :slight_smile: @martinsiegrist thank you too for your support.

2 Likes

Sorry @martinsiegrist but now i have also a problem with this file. I hope you can help me two objects are wrong with the boundingbox.

Stueckliste_support.gh (423.1 KB)

Stueckliste_support VR 02.gh (162.1 KB)

See if this works?


Yes, it does:

2 Likes

Looks like this here

However I don’t see anything grouped nor a data tree with multiple objects in a branch

2 Likes

Boys its perfect. You save my sunday :smiley: Thank you so much.

I have additionally exposed the world boxes, as this is good for when you you want to lay them out in the plane:

Stueckliste_support VR 03.gh (166.6 KB)

1 Like

Let’s just consider that a question for another thread. :sweat_smile: I did test the cluster out on a data set randomly split into branches, so at least for a data tree, it will work.

Prost Jungs!

@michael.haertlein Just a tip: with the OpenNest plugin, you can tile these boxes out in the plane for an overview of the pieces. I don’t have any experience with this plug-in, but I know it exists.

1 Like

Thank for the input, i know about that plugin but i never used. I will test it thank you :wink: