6 nook_th = 12.41 + 0.50 - 1.50 + 1.35 - .25;
7 nook_w = 127.12 + 0.75 - .95 - .50;
8 nook_h = 123.44 + 21.88 + 21.05 + 0.75 - 1.90 - 0.50 - 0.50;
11 edge_ledge_h = 2.44 - .25;
12 edge_ledge_inc_ang = 10; // degrees
20 open_recess_2_len = 15;
21 open_recess_2_d_tooth = 30;
40 tooth_inward = gap[0] * 1.0 + 0.25 + 0.25;
43 diag_near_hinge_slope = 0.5;
48 $fs = $test ? 0.1 : 1;
52 tooth_height = nook_th;
58 spp1 = spp0 + case_th * [-1,0];
59 spp9 = spp0 + ledge_h * [0,-1];
60 spp8 = spp9 + nook_th * [0,-1];
61 spp7 = spp8 + case_th * [-1,-1];
63 spp11y = spp1[1] - tape_th;
64 spp4y = 0.5 * (spp0[1] + spp7[1]);
65 spp3y = spp4y + tape_inside/2; spp5y = spp4y - tape_inside/2;
66 spp2y = spp3y + tape_th; spp6y = spp5y - tape_th;
68 spp20 = spp8 + nook_cnr_rad * [1,0];
72 tppB = spp1 + [0, gap[1]];
73 tppC = tppB + lid_th * [0,1];
74 tppD = [ spp20x, tppC[1] ];
75 tppE = [ spp20x, tppB[1] ];
76 tppF = tppA + ledge_w * [1,0];
77 tppG = tppF + ledge_h * [0,-1];
78 tppH = [ tppA[0], tppG[1] ];
80 tppJx = tppA[0] + tape_th;
82 tppK = [ tppC[0], tppG[1] ];
83 spp31 = tppK - [0, gap[1]];
84 spp30 = [ spp8[0], spp31[1] ];
86 nom_cnr = 0.5 * [nook_w, nook_h, 0] - nook_cnr_rad * [1,1,0];
88 tooth_y = nom_cnr[1] - tooth_w/2;
90 etxa = nom_cnr[0] - engage_l2;
91 etxb = etxa - engage_l1;
92 etxc = -(nom_cnr[0] - engage_l2);
94 tapa = nom_cnr[1] - engage_l2;
97 opra = nom_cnr[1] - engage_l2;
98 oprb = opra - open_recess_w;
100 opqa = tooth_y - open_recess_2_d_tooth + open_recess_2_len/2;
101 opqb = opqa - open_recess_2_len;
103 tppS = tppB + [-gap[0], 0];
104 tppP = [ tppS[0] - tooth_th, tppC[1] ];
105 tppQ = tppP + tooth_height * [0,-1] + tooth_inward * [1,0];
106 tppR = [ tppS[0] + tooth_inward, tppQ[1] ];
107 tppM = (tppQ + tppR) * 0.5 + tooth_th * 0.5 * [0,1];
109 edge_ledge_rad = edge_ledge_h;
111 module RightSideMainProfile() {
112 rectfromto(spp7, spp0);
113 rectfromto(spp7, spp20);
117 module LeftSideMainProfile() {
118 rectfromto(spp7, spp30);
119 rectfromto(spp7, spp20);
123 module EdgeLedgeProfile() {
126 for (t=[[0,0], [-20,0], [0,-10]]) {
128 + [edge_ledge_w, edge_ledge_h]
129 + edge_ledge_rad * [ -sin(edge_ledge_inc_ang),
130 -cos(edge_ledge_inc_ang) ]
132 circle(edge_ledge_rad);
140 module TopTapeCutout() {
144 [ tppJx, tppH[1]-1 ],
145 [ tppJx, tppC[1]+1 ],
146 [ tppA[0], tppC[1]+1 ]]);
149 module RightTopMainProfile() {
150 l = [ tppA, tppB, tppC, tppD, tppE, tppF, tppG, tppH ];
154 module LeftTopMainProfile() {
155 l = [ tppC, tppD, tppE, tppF, tppG, tppK ];
159 module SideTapeCutout1(y0,y1) {
160 rectfromto([ spp7[0]-1, y0 ],
164 module SideTapeCutout() {
165 SideTapeCutout1(spp6y, spp5y);
166 SideTapeCutout1(spp3y, spp2y);
167 SideTapeCutout1(spp3y, spp2y);
168 SideTapeCutout1(spp11y, spp1[1] + 1); // obsolete I think
171 module ToothProfile(){
182 circle(r= tooth_th/2);
186 module Demo(){ ////toplevel
187 translate([-1,0,0]) {
188 translate([0,0,-2]) LeftSideMainProfile();
189 translate([0,0,-2]) color("yellow") LeftTopMainProfile();
190 color("red") difference(){
191 LeftSideMainProfile();
194 translate([0,0,-4]) color("brown") EdgeLedgeProfile();
195 translate(concat(spp8 + [edge_ledge_w, edge_ledge_h], [2]))
196 rotate(-edge_ledge_inc_ang) {
197 color("blue") square(3);
198 color("lightblue") mirror([1,0]) square(3);
201 translate([0,0,0]) color("purple") difference(){
202 LeftTopMainProfile();
205 translate([nook_cnr_rad*2 + 5, 0,0]) mirror([1,0,0]) {
206 color("red") RightSideMainProfile();
207 color("purple") RightTopMainProfile();
208 color("grey") translate([0,0,-2]) ToothProfile();
213 module FaceCore(z0,z1, extra_left, extra_right){
215 for (mx=[0,1]) mirror([mx,0,0]) {
216 for (my=[0,1]) mirror([0,my,0]) {
217 translate(-nom_cnr) {
218 rotate_extrude(angle=90, convexity=10) {
220 translate(-[1,0,0] * nook_cnr_rad)
222 rectfromto([-100,-100], [0,100]);
227 translate([nook_w/2, 0,0])
228 linextr_y_xz(-nom_cnr[1]-0.1, nom_cnr[1]+0.1)
231 for (my=[0,1]) mirror([0,my,0]) {
232 translate([-nook_w/2, 0,0])
234 linextr_y_xz(tapb, tapa)
238 for (my=[0,1]) mirror([0,my,0]) {
239 translate([0, -nook_h/2, 0]) {
240 linextr_x_yz(-nom_cnr[0]-0.1, etxc + extra_left) children(0);
241 linextr_x_yz(etxc - extra_right, etxb + extra_right) children(1);
242 linextr_x_yz(etxb - extra_left, etxa + extra_left) children(0);
243 linextr_x_yz(etxa - extra_right, nom_cnr[0]+0.1) children(1);
248 rectfromto(-nom_cnr, nom_cnr);
252 module DiagonaliseNearHinge(wider){
253 sz = spp0[1] - spp30[1] + gap[1];
255 for (my=[0,1]) mirror([0,my,0]) {
256 translate([-etxa, -nook_h/2, 0])
258 linextr_y_xz(spp31[0] - wider, spp30[0] + gap[0] + 0.1)
259 translate([ 0, spp30[1] ])
262 [ sz/diag_near_hinge_slope, sz ],
263 [ sz/diag_near_hinge_slope, sz + 0.1 ],
268 module Base(){ ////toplevel
270 FaceCore(spp7[1],spp8[1], 0.3, 0) {
271 LeftSideMainProfile();
272 RightSideMainProfile();
275 translate([0, -nook_h/2, 0])
277 linextr_x_yz(-usb_w/2, usb_w/2)
278 rectfromto(spp8 + [-40, usb_below], [40, 40]);
279 translate([ gap[0], 0,0 ])
280 DiagonaliseNearHinge(10);
282 translate([nook_w/2, 0, 0])
283 linextr_y_xz(oprb, opra)
285 rectfromto([-40, -open_recess_h], [40, 1]);
289 linextr(spp7[1], spp8[1]) {
293 translate(nom_cnr + -1 * nook_cnr_rad*[1,1])
300 module Top(){ ////toplevel
302 FaceCore(tppE[1],tppD[1], -gap[0], gap[0] + 0.3) {
303 LeftTopMainProfile();
304 RightTopMainProfile();
307 translate([nook_w/2, 0,0])
308 linextr_y_xz(opqb, opqa)
309 rectfromto(spp8, tppC + [-1,1]);
311 translate([0,0, gap[1]])
312 DiagonaliseNearHinge(0);
313 translate([nook_w/2, tooth_y, 0])
314 linextr_y_xz(-tooth_w/2, +tooth_w/2)
317 module TopPrint(){ ////toplevel
318 rotate([0,0,90]) rotate([180,0,0]) Top();
320 module BasePrint(){ ////toplevel
321 rotate([0,0,90]) Base();
324 module TestExtrude(){
326 linextr_y_xz(-test_pillar, tape_w+test_pillar) children(0);
327 linextr_y_xz( 0, tape_w ) children(1);
331 module BaseTestRest(){ ////toplevel
332 cube([30,15, spp8[1]-spp7[1]]);
335 module Demo3(){ ////toplevel
336 color("purple") Top();
340 module TestSide(){ ////toplevel
341 TestExtrude() { LeftSideMainProfile(); SideTapeCutout(); }
344 module TestTop(){ ////toplevel
345 TestExtrude() { LeftTopMainProfile(); TopTapeCutout(); }
347 module TestTopPrint(){ ////toplevel
348 rotate([180,0,0]) TestTop();