Placing objects inside a volume/on a surface

How do I place a Geometry (surf, random brep, curve etc) inside a closed volume (for example a box), so they are completely inside the box?
How do I place the same Geometry on a surface (on a plane, but with defined borders)?

Since it might not fit, there is no obvious one-step solution. You will have to run intersection tests to find out whether a specific transformation results in what you are after. Sometimes you may be able to simplify the problem by switching to bounding boxes, but that depends on the specifics of your shapes.

Since there are also probably many different ways to fit one objects inside another (assuming it fits at all), you may also have to think about a rating system for solutions, otherwise the one you get may not be the one you like best.

Since you posted this in the Developer category I’m assuming you’re looking for code. C#? Python?