chiark / gitweb /
brompton-computer-guard: wip, after rename coords
[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 = -10;
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_total_len =
24   attach_inrad + attach_tube_dia + attach_hole_dist + attach_hole_dia/2;
25
26 module RearSideTemplate(){
27   polygon([[0.1,0],
28            [-base_len,0],
29            [-base_len,-cover_ysz],
30            [0.1,      -cover_ysz]]);
31   translate([-base_len, -cover_ysz + cover_lcircle_r])
32     circle(r=cover_lcircle_r);
33 }
34
35 module AttachTemplate(){
36   hull(){
37 //    polygon([[0,   0],
38 //           [-0.1, 0],
39 //           [-0.1, -cover_ysz],
40 //           [0,    -cover_ysz]]);
41     translate([attach_cx, -attach_cdy]) rotate([0,0,-attach_ang]) {
42       polygon([[-attach_cx,       attach_w/2],
43                [0,                -attach_w/2],
44                [attach_total_len, -attach_w/2],
45                [attach_total_len, attach_w/2]]);
46       translate([attach_total_len, 0])
47         circle(r=attach_w/2);
48     }
49   }
50 }
51
52 //module Tube(){
53 //  translate(
54
55 color("blue") RearSideTemplate();
56 AttachTemplate();