fit_clearance = 0.1;
+support_thickness = 0.4;
+
width = 50;
height = 50;
depth = 100;
};
}
-module rail(depth, thickness)
+module rail_bottom_left_base(thickness)
+{
+ union()
+ {
+ polygon([[0, 0], [0, thickness], [thickness, 0]]);
+ square([support_thickness, 3 * thickness]);
+ square([3 * thickness, support_thickness]);
+ }
+}
+
+module rail_bottom_left(length, thickness)
+{
+ linear_extrude(length)
+ rail_bottom_left_base(thickness);
+}
+
+module rail_top_left_base(thickness)
{
- linear_extrude(depth)
+ union()
+ {
polygon([[0, 0], [0, thickness], [thickness, 0]]);
+ square([support_thickness, 3 * thickness]);
+ translate([0.5 * thickness, - support_thickness])
+ square([2.5 * thickness, support_thickness]);
+ }
+}
+
+module rail_top_left(length, thickness)
+{
+ linear_extrude(length)
+ rail_top_left_base(thickness);
+}
+
+module rail_bottom_right(length, thickness)
+{
+ linear_extrude(length)
+ difference()
+ {
+ union()
+ {
+ polygon([[0, 0], [0, thickness], [thickness, 0]]);
+ translate([0, -2 * thickness])
+ square([support_thickness, 3 * thickness]);
+ translate([-2 * thickness, 0])
+ square([2.5 * thickness, support_thickness]);
+ }
+ offset(r = fit_clearance)
+ translate([thickness, thickness])
+ mirror([1, 1])
+ rail_bottom_left_base(thickness);
+ };
+}
+
+module rail_top_right(length, thickness)
+{
+ linear_extrude(length)
+ difference()
+ {
+ polygon([[-2 * thickness, thickness], [0, thickness], [thickness, 0], [-2 * thickness, 0]]);
+ offset(r = fit_clearance)
+ translate([thickness, thickness])
+ mirror([1, 1])
+ rail_top_left_base(thickness);
+ }
}
module rails(dims, thickness, fit_clearance)
{
+ rail_length = dims.z - thickness - fit_clearance;
+ rail_thickness = thickness;
translate([dims.x / 2, dims.y / 2])
mirror([1, 1, 0])
- rail(dims.z - thickness - fit_clearance, thickness - fit_clearance);
+ rail_bottom_left(rail_length, rail_thickness);
translate([- (dims.x / 2 - thickness), - (dims.y / 2 - thickness)])
mirror([1, 1, 0])
- rail(dims.z - thickness - fit_clearance, thickness - fit_clearance);
+ rail_top_right(rail_length, rail_thickness);
translate([dims.x / 2, - dims.y / 2])
mirror([1, 0, 0])
- rail(dims.z - thickness - fit_clearance, thickness - fit_clearance);
+ rail_top_left(rail_length, rail_thickness);
translate([- (dims.x / 2 - thickness), dims.y / 2 - thickness])
mirror([1, 0, 0])
- rail(dims.z - thickness - fit_clearance, thickness - fit_clearance);
+ rail_bottom_right(rail_length, rail_thickness);
}
module half_cage()