chiark / gitweb /
nook-case: wip, spp20
[reprap-play.git] / nook-case.scad
1 // -*- C -*-
2
3 include <utils.scad>
4
5 nook_th = 8; // xxx
6 nook_cnr_rad = 10;
7
8 case_th = 2.5;
9 ledge_w = 4;
10 tape_th = 1.5;
11 tape_inside = 2.0;
12
13 // calculated
14
15 ledge_h = case_th;
16
17 spp0 = [0,0];
18 spp1 = spp0 + case_th * [-1,0];
19 spp9 = spp0 + ledge_h * [0,-1];
20 spp8 = spp9 + nook_th * [0,-1];
21 spp7 = spp8 + case_th * [-1,-1];
22
23 spp11y = spp1[1] - tape_th;
24 spp4y  = 0.5 * (spp0[1] + spp8[1]);
25 spp3y = spp4y + tape_inside/2;  spp5y = spp4y - tape_inside/2;
26 spp2y = spp3y + tape_th;        spp6y = spp5y - tape_th;
27
28 spp20 = spp8 + nook_cnr_rad * [1,0];
29 spp20x = spp20[0];
30
31 module SideMainProfile() {
32   rectfromto(spp7, spp0);
33   rectfromto(spp7, spp20);
34 }
35
36 module SideTapeCutout1(y0,y1) {
37   rectfromto([ spp7[0]-1, y0 ],
38              [ spp8[0]+1, y1 ]);
39 }
40
41 module SideTapeCutout() {
42   SideTapeCutout1(spp6y, spp5y);
43   SideTapeCutout1(spp3y, spp2y);
44   SideTapeCutout1(spp3y, spp2y);
45   SideTapeCutout1(spp11y, spp1[1] + 1);
46 }
47
48 module Demo(){
49   translate([0,0,-2]) color("red") SideMainProfile();
50   difference(){
51     SideMainProfile();
52     SideTapeCutout();
53   }
54   //%SideTapeCutout();
55 }
56
57 Demo();