chiark / gitweb /
digispark-with-cable: from v1
[reprap-play.git] / digispark-with-cable.scad
1 // -*- C -*-
2
3 include <utils.scad>
4
5 //tongue_w = 11.92 + 0.4;
6
7 usb_w = 12.01 - 0.3;
8 usb_wall_w = 0.51;
9 usb_tongue_d = 8.97 - 0.2;
10 usb_wall_h = 4.54 - 2.04;
11 usb_ceil_th = 0.425;
12
13 side_wall_th = 1.5;
14
15 board_l = 17.56 + 0.2;
16 board_w = 19.14 + 0.2;
17 board_th = 1.92 + 0.1;
18
19 sw_to_edge = board_w/2 + 0.1;
20
21 front_wall_th = 0.4;
22 egress_w = 8.0;
23
24 wall_y_min = -board_l - side_wall_th;;
25 ceil_y_min = wall_y_min - 5;;
26
27 small_walls = [
28                [ [0, 0], [-sw_to_edge, -1.0] ],
29                [ [sw_to_edge-4.5, -4.5], [sw_to_edge, -5.7] ],
30                [ [3.0, -11.72] ,[sw_to_edge, -13.38] ],
31                [ [-sw_to_edge+3.85, -14.90], [sw_to_edge, -13.38] ],
32                ];
33 chip_cutout = [[ -sw_to_edge + 4.20,    -4.50 ],
34                [ -sw_to_edge + 11.95,  -11.90 ]];
35
36 module BothSides(){
37   for (m=[0,1]) {
38     mirror([m,0]) {
39       children();
40     }
41   }
42 }
43 module TopSmallWallsPlan() {
44   for (m=[0,1]) {
45     mirror([m,0]) {
46       rectfromto([ -usb_w/2,              -0.01        ],
47                  [ -usb_w/2 + usb_wall_w, usb_tongue_d ]);
48     }
49   }
50   for (w=small_walls) {
51     rectfromto(w[0], w[1]);
52   }
53 }
54 module TopCeilPlan() {
55   difference(){
56     BothSides(){
57       rectfromto([ -usb_w/2,              -0.01        ],
58                  [ 0.1,                   usb_tongue_d ]);
59       rectfromto([ -board_w/2 - side_wall_th, 0            ],
60                  [ 0.1,                       ceil_y_min   ]);
61     }
62     rectfromto(chip_cutout[0], chip_cutout[1]);
63   }
64 }
65 module TopMainWallsPlan() {
66   BothSides(){
67     rectfromto([ -board_w/2 - side_wall_th, 0          ],
68                [ -board_w/2,                wall_y_min ]);
69     rectfromto([ -board_w/2 - side_wall_th, 0             ],
70                [ -usb_w/2,                  front_wall_th ]);
71   }
72   rectfromto([ -board_w/2 - side_wall_th + egress_w, -board_l   ],
73              [ +board_w/2 + side_wall_th,            wall_y_min ]);
74 }
75
76 module Top(){
77   linextr(0, usb_wall_h)
78     TopSmallWallsPlan();
79   linextr(usb_wall_h - usb_ceil_th, usb_wall_h)
80     TopCeilPlan();
81   linextr(-board_th, usb_wall_h)
82     TopMainWallsPlan();
83 }
84
85 Top();