--- /dev/null
+fit_clearance = 0.5;
+
+width = 50;
+height = 50;
+depth = 100;
+
+thickness = 2;
+
+ring_height = thickness;
+ring_pos = thickness;
+
+ring_clearance = ring_height + ring_pos;
+ring_thickness = thickness / 2;
+
+module face(width, height, thickness, ring_clearance)
+{
+ linear_extrude(thickness)
+ difference()
+ {
+ square([width, height], center = true);
+ square([width - 2 * thickness, height - 2 * thickness], center = true);
+ translate([0, - (height / 2 - ring_clearance / 2)])
+ square([width, ring_clearance], center = true);
+ };
+ translate([0, - (height / 2 - (ring_clearance + thickness) / 2), ring_thickness])
+ linear_extrude(thickness - ring_thickness)
+ difference()
+ {
+ square([width - 2 * ring_thickness, ring_clearance + thickness], center = true);
+ translate([0, thickness / 2])
+ square([width - 2 * thickness, ring_clearance], center = true);
+ };
+}
+
+module ring(width, depth, ring_thickness, ring_height)
+{
+ linear_extrude(ring_height)
+ difference()
+ {
+ square([width, depth], center=true);
+ square([width - 2 * ring_thickness, depth - 2 * ring_thickness], center = true);
+ };
+}
+
+module rail(depth, thickness)
+{
+ linear_extrude(depth)
+ polygon([[0, 0], [0, thickness], [thickness, 0]]);
+}
+
+module rails(dims, thickness, fit_clearance)
+{
+ translate([dims.x / 2, dims.y / 2])
+ mirror([1, 1, 0])
+ rail(dims.z - thickness, thickness - fit_clearance);
+ translate([- (dims.x / 2 - thickness), - (dims.y / 2 - thickness)])
+ mirror([1, 1, 0])
+ rail(dims.z - thickness, thickness - fit_clearance);
+ translate([dims.x / 2, - dims.y / 2])
+ mirror([1, 0, 0])
+ rail(dims.z - thickness, thickness - fit_clearance);
+ translate([- (dims.x / 2 - thickness), dims.y / 2 - thickness])
+ mirror([1, 0, 0])
+ rail(dims.z - thickness, thickness - fit_clearance);
+}
+
+module half_cage()
+{
+ face(width, height, thickness, ring_clearance);
+ translate([0, ring_clearance / 2, thickness])
+ rails([width, height - ring_clearance, depth - thickness], thickness, fit_clearance);
+}
+
+half_cage();
+translate([0, 0, depth])
+ rotate(180, [0, 1, 0])
+ half_cage();
+translate([0, - (height / 2 - ring_clearance + fit_clearance / 2), depth / 2])
+ rotate(90, [1, 0, 0])
+ ring(width, depth, ring_thickness - fit_clearance, ring_height - fit_clearance);