Minimum Bounding Box for Rhino 6? (wouldn't work)

Hey guys, here is the script Minimum Bounding Box which worked fine in Rhino 5.

MinBoundBox3d(RhV4).rvb (15.2 KB)

Seems it doesn’t work anymore in v6, even I need it badly. Thanks for your ideas to get it working again. Hannes

What is it supposed to do and how does it differ from the bounding box command?

Here you go (it had some obsolete version check method that just needed to be removed from Line 52.
I also changed progress from printing each to command line to prompt update.
MinBoundBox3d(RhV6).rvb (16.5 KB)

3 Likes

@Jarek you are a genius! I can’t live without it, such a timesaver in many cases! THANK YOU

@siemen similar to this one, the script calculates the smallest possible volume of the bounding box. Good for nesting and rotating or aligning things. There are many more situations where this comes in really handy.

@siemen
Just a quick reminder of the versitality of the Minimum Bounding Box command which I bound to alias “MB”
I need the aligned bounding box of the ellipse (but with Rhino sometimes it won’t be a perfect ellipse). So for construction purposes I used the MB command to build the welded top plates later to mount the metal tubes on that (bottom of my Cozy Chair currently build) Every leg has quite a different angle.

Interesting! Thanks for the example.

1 Like

This script, together with other like geargen, was already modified in Feb 2018

1 Like

I’ve removed version checking from all of these old scripts.

They can be found here: scripts

1 Like

thanks a lot for the update! i used it quite a lot in V5.
still i have a small problem using the script on 2d-objects:
i have a planar curve, the script fails and reports “Script unsuccessful (Improper attempt for minimum Volume calculation on planar object(s) )”
after dragging one controlpoint (making the curve 3d) the script runs as expected. now i undo the minBB and the dragging, run the script again and this time it works!
any suggestion on how to make it work right from the start?

You can also try this one and let me know how it works…

MinimumBoundingBox.py (17.5 KB)

3 Likes

hi mitch,
i get this error message when strting the script in rhino 6:
ss01

It’s not a vb script, it’s a Python script. To run it: save it somewhere, then use

_NoEcho ! _-RunPythonScript "full path to scriptfile"

(either as an alias or toolbar button)

perfect, and very quick!
thanks for the help.

and also works in 3D !!
: ))

You’re a hero man.

@ThomasAn_ thank you! your updated version works perfectly.
Mitch! @Helvetosaur your python script fails in WIP7 and is not working with meshes, whereas Thomas’ version does.

Dunno, seems to work OK here with a couple of quick tests and it does accept meshes - however it was not designed for Sub-D, so maybe that’s this issue? I haven’t updated any of my scripts for those (as I’m not a user of them for the moment). I suppose I will have to get to it one of these days.

If you have a specific object (not Sub-D) that fails you can send it to me via PM and I will test if you wish.

Mitch! thank you for your reply, the default script works. I’m in another project, will send you the file once at hand. Thank you for your help!

Hannes

@Helvetosaur

Hello. Thank you for posting your script. It is great and work perfectly.
I’ve modify it for my purposes but the core is the same.
I’ve got question, maybe someone will have some idea…
For what reason, exactly the same code work differently when it is called from the EditPythonScript command and differently when it is called from the icon with custom command ?

Example below.
BB_Test.py (18.4 KB) BB_Test_cmd.py (20.2 KB) Test 004.3dm (146.0 KB)

Hey. I debug two versions of code line by line and found reason why Code is working differently when it is runned from EditPyhonScript console and differently when it is runned from icon.

I’m posting my conclusions here -maybe someone will face the same problem and find this solution useful.

It turned out that problem was with decimal places in float number.
In the “icon version” of the code Rhino is rounding float number and algorithm started to be lot less precise.

When i forced decimal places just by writing “90.0000000” insted of “90” everythin stared to work Ok.