chiark / gitweb /
nook-case: wip, some dimensions
[reprap-play.git] / nook-case.scad
1 // -*- C -*-
2
3 include <utils.scad>
4
5 nook_th = 12.41 + 0.50;
6 nook_w = 127.12 + 0.75;
7 nook_h = 123.44 + 21.88 + 21.05 + 0.75;
8
9 nook_cnr_rad = 10;
10
11 case_th = 2.5;
12 ledge_w = 4;
13 tape_th = 1.75;
14 tape_inside = 2.0;
15
16 gap = 0.5 * [1,1];
17
18 tape_w = 15;
19
20 test_pillar = 4;
21
22 // calculated
23
24 ledge_h = case_th;
25 lid_th = case_th;
26
27 spp0 = [0,0];
28 spp1 = spp0 + case_th * [-1,0];
29 spp9 = spp0 + ledge_h * [0,-1];
30 spp8 = spp9 + nook_th * [0,-1];
31 spp7 = spp8 + case_th * [-1,-1];
32
33 spp11y = spp1[1] - tape_th;
34 spp4y  = 0.5 * (spp0[1] + spp7[1]);
35 spp3y = spp4y + tape_inside/2;  spp5y = spp4y - tape_inside/2;
36 spp2y = spp3y + tape_th;        spp6y = spp5y - tape_th;
37
38 spp20 = spp8 + nook_cnr_rad * [1,0];
39 spp20x = spp20[0];
40
41 tppA = spp0 + gap;
42 tppB = spp1 + [0, gap[1]];
43 tppC = tppB + lid_th * [0,1];
44 tppD = [ spp20x, tppC[1] ];
45 tppE = [ spp20x, tppB[1] ];
46 tppF = tppA + ledge_w * [1,0];
47 tppG = tppF + ledge_h * [0,-1];
48 tppH = [ tppA[0], tppG[1] ];
49
50 tppJx = tppA[0] + tape_th;
51
52 module SideMainProfile() {
53   rectfromto(spp7, spp0);
54   rectfromto(spp7, spp20);
55 }
56
57 module TopTapeCutout() {
58   polygon([ tppA,
59             tppA + [-1,-1],
60             tppH + [-1,-1],
61             [ tppJx, tppH[1]-1 ],
62             [ tppJx, tppC[1]+1 ],
63             [ tppA[0], tppC[1]+1 ]]);
64 }
65
66 module TopMainProfile() {
67   l = [ tppA, tppB, tppC, tppD, tppE, tppF, tppG, tppH ];
68   echo(l);
69   polygon(l);
70 }
71
72 module SideTapeCutout1(y0,y1) {
73   rectfromto([ spp7[0]-1, y0 ],
74              [ spp8[0]+1, y1 ]);
75 }
76
77 module SideTapeCutout() {
78   SideTapeCutout1(spp6y, spp5y);
79   SideTapeCutout1(spp3y, spp2y);
80   SideTapeCutout1(spp3y, spp2y);
81   SideTapeCutout1(spp11y, spp1[1] + 1);
82 }
83
84 module Demo(){ ////toplevel
85   translate([0,0,-2]) SideMainProfile(); 
86   translate([0,0,-2]) color("yellow") TopMainProfile();
87   color("red") difference(){
88     SideMainProfile();
89     SideTapeCutout();
90   }
91   translate([0,0,0]) color("purple") difference(){
92     TopMainProfile();
93     TopTapeCutout();
94   }
95   //%SideTapeCutout();
96 }
97
98 module TestExtrude(){
99   difference(){
100     linextr_y_xz(-test_pillar, tape_w+test_pillar) children(0);
101     linextr_y_xz(           0, tape_w            ) children(1);
102   }
103 }
104
105 module TestSide(){ ////toplevel
106   TestExtrude() { SideMainProfile(); SideTapeCutout(); }
107 }
108
109 module TestTop(){ ////toplevel
110   TestExtrude() { TopMainProfile(); TopTapeCutout(); }
111 }
112 module TestTopPrint(){ ////toplevel
113   rotate([180,0,0]) TestTop();
114 }