I am given a right rectangular prism (i.e. a box) and an arbitrary convex solid within it, such that the box matches the AABB (axis-aligned bounding box) of the aforementioned solid.
I would like to "carve out" the solid from the box and, in doing so, split the box into several convex segments around the solid's faces (hopefully, if the solid has n faces, then n segments). Basically, make a solid-shaped hole in the box. Here's a picture of what I mean:
However, this would also have to work for shapes like this:
The problem is, I think, much easier with axially symmetric shapes like right prisms and pyramids than with centrally symmetric shapes like spheres (as you can see, the spheres aren't proper spheres; they have a finite number of flat sides). I'm looking for a general algorithm that would work with any solid, no matter how complex or rotated or tilted it may be.