I’ve made some prints fit in my printer by printing them at a diagonal. I work it out by spinning it until I don’t get an error from the slicer.
I’d rather be able to calculate exactly what will fit beforehand instead of spinning the model around in CAD or the slicer.
Has anyone found/used a calculator that can do this?
HelloRoot@lemy.lol 4 weeks ago
You won’t believe it but thats actually a very hard problem to solve algorithmically.
The best methods we have (afaik) basically randomly position the object and then nudge it until it fits or give up after doing lots of tries.
tal@lemmy.today 4 weeks ago
I’m skeptical. I can think of some problems that do work like that, like graphviz’s node-cluster-and-fit-to-a-plane layout stuff. But here, you should just need to be working with the convex hull. It should be possible to eliminate a lot of classes of potential solutions by reducing it to looking at edge cases, like some face of the convex hull is in-plane with the bounding box or something.
kagis
Yeah.
en.wikipedia.org/…/Minimum_bounding_box_algorithm…
HelloRoot@lemy.lol 4 weeks ago
Have you read the algo?
It basically takes the global minimum over all edge pairs (and their zero-curves) and return the orientation and extents with the smallest encountered volume. Which is basically like trying every possible position along the edges of the convex hull around your obect.
But I edited my comment to remove that part, because that bit is honestly irrelevant for OPs question.
Blue_Morpho@lemmy.world 4 weeks ago
That’s what supports are for. :) In my case I made a custom sprue because autogen supports sagged unless it was 0 clearance.
I was just looking for something like a rectangular prism or cylinder to fit in a cube. I was surprised by the replies that it’s mathematically hard. I expected it to be a geometry problem with a bit of calculus to find the convergence.
MysteriousSophon21@lemmy.world 3 weeks ago
trimesh is actually perfect for this - i’ve used it to auto-rotate models for optimal print orientation without supports and it works great for volume fitting too!