Blog: Mouse Trap replacement seesaw: mousetrap-seesaw.scad

File mousetrap-seesaw.scad, 2.2 KB (added by retracile, 9 months ago)

mousetrap-seesaw.scad

Line 
1
2length = 4.25;
3width = 0.96;
4bar_slot_diameter = 0.190;
5slot_to_surface = 0.165;
6slab_thickness = 0.132;
7slab_end_thickness = 0.190;
8slab_end_depth = 0.077;
9slot_support_height = 0.425;
10slot_support_length = 2.065;
11slot_support_face = 0.450;
12slot_support_width = 0.547;
13slot_support_side_thickness = 1/16;
14slot_support_inner_width = slot_support_width - 2*slot_support_side_thickness;
15
16cut_margin = 0.0001;
17
18module seesaw() {
19    difference() {
20        union() {
21            // main slab
22            translate([-length/2, 0, 0]) {
23                cube([length, width, slab_thickness]);
24            }
25            // slot support
26            hull() {
27                translate([-slot_support_face/2, (width-slot_support_width)/2, 0]) {
28                    cube([slot_support_face, slot_support_width, slot_support_height]);
29                }
30                translate([-slot_support_length/2, (width-slot_support_width)/2, 0]) {
31                    cube([slot_support_length, slot_support_width, slab_thickness]);
32                }
33            }
34            // ends
35            translate([length/2-slab_end_depth, 0, 0]) {
36                cube([slab_end_depth , width, slab_end_thickness]);
37            }
38            translate([-length/2, 0, 0]) {
39                cube([slab_end_depth , width, slab_end_thickness]);
40            }
41        }
42        union() {
43            // turn the support into a pair of walls
44            translate([-slot_support_length/2, (width-slot_support_inner_width)/2, slab_thickness]) {
45                cube([slot_support_length, slot_support_inner_width, slot_support_height-slab_thickness+cut_margin]);
46            }
47            // straight part of the slot the bar passses by
48            translate([-bar_slot_diameter/2, -cut_margin, slot_support_height + slot_to_surface + bar_slot_diameter/2]) {
49                rotate([-90, 0, 0]) {
50                    cube([bar_slot_diameter, slot_support_height, width+2*cut_margin]);
51                }
52            }
53            // round part of the slot that rests on the bar
54            translate([0, 0, slot_to_surface + bar_slot_diameter/2]) {
55                rotate([-90, 0, 0]) {
56                    cylinder(d=bar_slot_diameter, h=width+2*cut_margin, $fn=64);
57                }
58            }
59        }
60    }
61}
62
63seesaw();