chiark / gitweb /
brompton-computer-guard: wip
[reprap-play.git] / brompton-computer-guard.scad
1 // -*- C -*-
2
3 cover_ysz = 45;
4 cover_len = 70;
5
6 attach_tube_dia = 18;
7
8 attach_cx = -15;
9 attach_cdy = -5;
10 attach_w = 25;
11
12 attach_inrad = 25; ///
13 attach_hole_dist = 5; ///
14 attach_hole_dia = 4 + 0.5; ///
15 attach_ang = 45;
16
17 // calculated
18
19 cover_lcircle_r = cover_ysz / (1 + 1/sqrt(2));
20
21 base_len = cover_len - cover_lcircle_r;
22
23 attach_straight_len =
24   attach_inrad + attach_tube_dia + attach_hole_dist + attach_hole_dia/2
25   - attach_w / 2 + attach_hole_dist;
26
27 module RearSideTemplate(){
28   polygon([[0.1,0],
29            [-base_len,0],
30            [-base_len,-cover_ysz],
31            [0.1,      -cover_ysz]]);
32   translate([-base_len, -cover_ysz + cover_lcircle_r])
33     circle(r=cover_lcircle_r);
34 }
35
36 module AttachTemplate(){
37   hull(){
38     polygon([[0,   0],
39              [-0.1, 0],
40              [-0.1, -cover_ysz],
41              [0,    -cover_ysz]]);
42     translate([attach_cx, -attach_cdy]) rotate([0,0,-attach_ang]) {
43       polygon([[-attach_cx,          attach_w/2],
44                [0,                   -attach_w/2],
45                [attach_straight_len, -attach_w/2],
46                [attach_straight_len, attach_w/2]]);
47       translate([attach_straight_len, 0])
48         circle(r=attach_w/2);
49     }
50   }
51 }
52
53 module Tube(){
54   %translate([attach_cx, -attach_cdy, -20]) {
55     rotate_extrude(convexity=10) {
56       translate([attach_inrad + attach_tube_dia/2, 0])
57         circle(r=attach_tube_dia/2);
58     }
59   }
60 }
61
62 module Bolt(){
63   %translate([0,0,-50]) linear_extrude(height=80) {
64     circle(r=attach_hole_dia/2, $fn=20);
65   }
66   %translate([0,0,10]) linear_extrude(height=20) {
67     circle(r=attach_hole_dia/2 * 2, $fn=20);
68   }
69 }
70
71 module Bolts(){
72   translate([attach_cx, -attach_cdy]) rotate([0,0,-attach_ang]) {
73     translate([attach_inrad - attach_hole_dist - attach_hole_dia/2, 0])
74       Bolt();
75     translate([attach_inrad + attach_tube_dia
76                +attach_hole_dist + attach_hole_dia/2, 0])
77       Bolt();
78   }
79 }
80
81 color("blue") RearSideTemplate();
82 AttachTemplate();
83 Tube();
84 Bolts();