8 nook_th = 12.41 + 0.50 - 1.50 + 1.35 - .25;
9 nook_w = 127.12 + 0.75 - .95 - .50;
10 nook_h = 123.44 + 21.88 + 21.05 + 0.75 - 1.90 - 0.50 - 0.50;
13 edge_ledge_h = 2.44 - .25;
14 edge_ledge_inc_ang = 10; // degrees
22 open_recess_2_len = 15;
23 open_recess_2_d_tooth = 30;
42 tooth_inward = gap[0] * 1.0 + 0.25 + 0.25;
45 diag_near_hinge_slope = 0.5;
50 $fs = $test ? 0.1 : 1;
54 tooth_height = nook_th;
60 spp1 = spp0 + case_th * [-1,0];
61 spp9 = spp0 + ledge_h * [0,-1];
62 spp8 = spp9 + nook_th * [0,-1];
63 spp7 = spp8 + case_th * [-1,-1];
65 spp11y = spp1[1] - tape_th;
66 spp4y = 0.5 * (spp0[1] + spp7[1]);
67 spp3y = spp4y + tape_inside/2; spp5y = spp4y - tape_inside/2;
68 spp2y = spp3y + tape_th; spp6y = spp5y - tape_th;
70 spp20 = spp8 + nook_cnr_rad * [1,0];
74 tppB = spp1 + [0, gap[1]];
75 tppC = tppB + lid_th * [0,1];
76 tppD = [ spp20x, tppC[1] ];
77 tppE = [ spp20x, tppB[1] ];
78 tppF = tppA + ledge_w * [1,0];
79 tppG = tppF + ledge_h * [0,-1];
80 tppH = [ tppA[0], tppG[1] ];
82 tppJx = tppA[0] + tape_th;
84 tppK = [ tppC[0], tppG[1] ];
85 spp31 = tppK - [0, gap[1]];
86 spp30 = [ spp8[0], spp31[1] ];
88 nom_cnr = 0.5 * [nook_w, nook_h, 0] - nook_cnr_rad * [1,1,0];
90 tooth_y = nom_cnr[1] - tooth_w/2;
92 etxa = nom_cnr[0] - engage_l2;
93 etxb = etxa - engage_l1;
94 etxc = -(nom_cnr[0] - engage_l2);
96 tapa = nom_cnr[1] - engage_l2;
99 opra = nom_cnr[1] - engage_l2;
100 oprb = opra - open_recess_w;
102 opqa = tooth_y - open_recess_2_d_tooth + open_recess_2_len/2;
103 opqb = opqa - open_recess_2_len;
105 tppS = tppB + [-gap[0], 0];
106 tppP = [ tppS[0] - tooth_th, tppC[1] ];
107 tppQ = tppP + tooth_height * [0,-1] + tooth_inward * [1,0];
108 tppR = [ tppS[0] + tooth_inward, tppQ[1] ];
109 tppM = (tppQ + tppR) * 0.5 + tooth_th * 0.5 * [0,1];
111 edge_ledge_rad = edge_ledge_h;
113 module RightSideMainProfile() {
114 rectfromto(spp7, spp0);
115 rectfromto(spp7, spp20);
119 module LeftSideMainProfile() {
120 rectfromto(spp7, spp30);
121 rectfromto(spp7, spp20);
125 module EdgeLedgeProfile() {
128 for (t=[[0,0], [-20,0], [0,-10]]) {
130 + [edge_ledge_w, edge_ledge_h]
131 + edge_ledge_rad * [ -sin(edge_ledge_inc_ang),
132 -cos(edge_ledge_inc_ang) ]
134 circle(edge_ledge_rad);
142 module TopTapeCutout() {
146 [ tppJx, tppH[1]-1 ],
147 [ tppJx, tppC[1]+1 ],
148 [ tppA[0], tppC[1]+1 ]]);
151 module RightTopMainProfile() {
152 l = [ tppA, tppB, tppC, tppD, tppE, tppF, tppG, tppH ];
156 module LeftTopMainProfile() {
157 l = [ tppC, tppD, tppE, tppF, tppG, tppK ];
161 module SideTapeCutout1(y0,y1) {
162 rectfromto([ spp7[0]-1, y0 ],
166 module SideTapeCutout() {
167 SideTapeCutout1(spp6y, spp5y);
168 SideTapeCutout1(spp3y, spp2y);
169 SideTapeCutout1(spp3y, spp2y);
170 SideTapeCutout1(spp11y, spp1[1] + 1); // obsolete I think
173 module ToothProfile(){
184 circle(r= tooth_th/2);
188 module Demo(){ ////toplevel
189 translate([-1,0,0]) {
190 translate([0,0,-2]) LeftSideMainProfile();
191 translate([0,0,-2]) color("yellow") LeftTopMainProfile();
192 color("red") difference(){
193 LeftSideMainProfile();
196 translate([0,0,-4]) color("brown") EdgeLedgeProfile();
197 translate(concat(spp8 + [edge_ledge_w, edge_ledge_h], [2]))
198 rotate(-edge_ledge_inc_ang) {
199 color("blue") square(3);
200 color("lightblue") mirror([1,0]) square(3);
203 translate([0,0,0]) color("purple") difference(){
204 LeftTopMainProfile();
207 translate([nook_cnr_rad*2 + 5, 0,0]) mirror([1,0,0]) {
208 color("red") RightSideMainProfile();
209 color("purple") RightTopMainProfile();
210 color("grey") translate([0,0,-2]) ToothProfile();
215 module FaceCore(z0,z1, extra_left, extra_right){
217 for (mx=[0,1]) mirror([mx,0,0]) {
218 for (my=[0,1]) mirror([0,my,0]) {
219 translate(-nom_cnr) {
220 rotate_extrude(angle=90, convexity=10) {
222 translate(-[1,0,0] * nook_cnr_rad)
224 rectfromto([-100,-100], [0,100]);
229 translate([nook_w/2, 0,0])
230 linextr_y_xz(-nom_cnr[1]-0.1, nom_cnr[1]+0.1)
233 for (my=[0,1]) mirror([0,my,0]) {
234 translate([-nook_w/2, 0,0])
236 linextr_y_xz(tapb, tapa)
240 for (my=[0,1]) mirror([0,my,0]) {
241 translate([0, -nook_h/2, 0]) {
242 linextr_x_yz(-nom_cnr[0]-0.1, etxc + extra_left) children(0);
243 linextr_x_yz(etxc - extra_right, etxb + extra_right) children(1);
244 linextr_x_yz(etxb - extra_left, etxa + extra_left) children(0);
245 linextr_x_yz(etxa - extra_right, nom_cnr[0]+0.1) children(1);
250 rectfromto(-nom_cnr, nom_cnr);
254 module DiagonaliseNearHinge(wider){
255 sz = spp0[1] - spp30[1] + gap[1];
257 for (my=[0,1]) mirror([0,my,0]) {
258 translate([-etxa, -nook_h/2, 0])
260 linextr_y_xz(spp31[0] - wider, spp30[0] + gap[0] + 0.1)
261 translate([ 0, spp30[1] ])
264 [ sz/diag_near_hinge_slope, sz ],
265 [ sz/diag_near_hinge_slope, sz + 0.1 ],
270 module Base(){ ////toplevel
272 FaceCore(spp7[1],spp8[1], 0.3, 0) {
273 LeftSideMainProfile();
274 RightSideMainProfile();
277 translate([0, -nook_h/2, 0])
279 linextr_x_yz(-usb_w/2, usb_w/2)
280 rectfromto(spp8 + [-40, usb_below], [40, 40]);
281 translate([ gap[0], 0,0 ])
282 DiagonaliseNearHinge(10);
284 translate([nook_w/2, 0, 0])
285 linextr_y_xz(oprb, opra)
287 rectfromto([-40, -open_recess_h], [40, 1]);
291 linextr(spp7[1], spp8[1]) {
295 translate(nom_cnr + -1 * nook_cnr_rad*[1,1])
302 module Top(){ ////toplevel
304 FaceCore(tppE[1],tppD[1], -gap[0], gap[0] + 0.3) {
305 LeftTopMainProfile();
306 RightTopMainProfile();
309 translate([nook_w/2, 0,0])
310 linextr_y_xz(opqb, opqa)
311 rectfromto(spp8, tppC + [-1,1]);
313 translate([0,0, gap[1]])
314 DiagonaliseNearHinge(0);
315 translate([nook_w/2, tooth_y, 0])
316 linextr_y_xz(-tooth_w/2, +tooth_w/2)
319 module TopPrint(){ ////toplevel
320 rotate([0,0,90]) rotate([180,0,0]) Top();
322 module BasePrint(){ ////toplevel
323 rotate([0,0,90]) Base();
326 module TestExtrude(){
328 linextr_y_xz(-test_pillar, tape_w+test_pillar) children(0);
329 linextr_y_xz( 0, tape_w ) children(1);
333 module BaseTestRest(){ ////toplevel
334 cube([30,15, spp8[1]-spp7[1]]);
337 module Demo3(){ ////toplevel
338 color("purple") Top();
342 module TestSide(){ ////toplevel
343 TestExtrude() { LeftSideMainProfile(); SideTapeCutout(); }
346 module TestTop(){ ////toplevel
347 TestExtrude() { LeftTopMainProfile(); TopTapeCutout(); }
349 module TestTopPrint(){ ////toplevel
350 rotate([180,0,0]) TestTop();