Minimum Bounding Box to fit Geometry to Printbed




I have a lot of geometry I need to fit in a printbed.
So its not possible over the solved over the volume, since i need to fit it to certain values of length width and height.
I tried it with ocotpus, but I am not even sure if it is possible.
Someone knows? (627.9 KB)

Thanks for any hint!


I think i will just set up the box and rotate the geometry until it not intersects.
Probably easier.

(qythium) #3

Hi Baris,
I don’t have Octopus to try out your code with, but it sounds like all you need is a properly defined fitness function which tells you how close you are from your desired fixed values.

David Rutten’s blog (linked to in Galapagos) has a great introduction to these issues and more:


thanks! That did it, no need for octopus.


Internalize your geometry? Use longest edge of brep as basis of plane for BBox:


yep, I noticed I forgot to save the file before uploading it.
I cant upload the original geometry , so I made an arbitrary shape.

I solved it define the fitness like this:

#7 (17.9 KB)

Providing geometry with a question lke this is really essential!


I solved thanks to @qythium comment. Without Geometry.

I agree its better with geometry but as I mentioned before I didnt noticed when uploading.

Thanks for looking at it!

#9 (21.3 KB)

Version ‘c’ (below) replaces slow Area with Srf EL cluster that sorts surfaces by the sum of their edge lengths. Profiler shows ~five seconds for 4422 geometry oriented BBox results - too many to see anyway, even zooming in: (24.9 KB)


Since it is quite cheap/fast to calculate the bounding box, a sampling approach might be preferable to the stochastic search approach (especially if you need to calculate it for many objects). Something like this: