Input: body and some closed space. Body and space are represented as meshes(or BReps, if you like). Initially body doesn’t intersect the boundary of the space.
The problem is to find all possible directions in which body can move. For example, in following picture, body can move only in directions from (-1,0) to (0,1). If body has a circle(or sphere) surface – it is ok to return directions with some step (for example, for picture below, output can be (-1,0), (-pi/4,pi/4), (0,1) with step = 3).

Output: set of directions in which body can move.
Problem must be solved in 2d and 3d space.
You want to work in the configuration space. Basically increase the size of your boundary based on the shape of your body, then treat the body as a point object. What’s left are all the valid positions of the body. Of course, if your body is not a circle and can rotate, then your configuration space is no longer 2D or 3D. It has as many dimensions as your body has degrees of freedom, so 6 for a rigid body that can translate and rotate.
This is a well known problem in robotic motion planning. Google for “configuration space” or “c-space”, and “motion planning”.
This is a good set of slides from a class at Carnegie Mellon:
Configuration Space Lecture