Minimum Bounding Box to fit Geometry to Printbed

unhandled

#1

Hi,

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?

Bbox.gh (627.9 KB)

Thanks for any hint!


#2

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:
https://ieatbugsforbreakfast.wordpress.com/?s=fitness


#4

thanks! That did it, no need for octopus.


#5

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


#6

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


bbox_2018Mar2a.gh (17.9 KB)

Providing geometry with a question lke this is really essential!


#8

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


bbox_2018Mar2b.gh (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:


bbox_2018Mar2c.gh (24.9 KB)


#11

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: