Here's is a result of a "Ball in a cage" trial I once made with OpenSCAD. Some eleven lines of code only (!).
NOTE: In my printed piece (see the photo) the ball had only 60 faces i.e. $fn=60 and hence the polygons show way too clearly. In the attached STL, $fn=180 has been used for smoother surfaces.
Update: OpenSCAD source added.
ball_in_a_cage.scad | 258.0B | |
Ball_in_a_cage.stl | 10.1MB |