chiark / gitweb /
nook-case: wip
[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 module SideMainProfile() {
29   rectfromto(spp7, spp0);
30   rectfromto(spp7, spp8 + nook_cnr_rad * [1,0]);
31 }
32
33 module SideTapeCutout1(y0,y1) {
34   rectfromto([ spp7[0]-1, y0 ],
35              [ spp8[0]+1, y1 ]);
36 }
37
38 module SideTapeCutout() {
39   SideTapeCutout1(spp6y, spp5y);
40   SideTapeCutout1(spp3y, spp2y);
41   SideTapeCutout1(spp3y, spp2y);
42   SideTapeCutout1(spp11y, spp1[1] + 1);
43 }
44
45 module Demo(){
46   translate([0,0,-2]) color("red") SideMainProfile();
47   difference(){
48     SideMainProfile();
49     SideTapeCutout();
50   }
51   //%SideTapeCutout();
52 }
53
54 Demo();