5 nook_th = 12.41 + 0.50 - 1.50;
6 nook_w = 127.12 + 0.75 - .95;
7 nook_h = 123.44 + 21.88 + 21.05 + 0.75 - 1.90;
11 edge_ledge_inc_ang = 10; // degrees
19 open_recess_2_len = 15;
20 open_recess_2_d_tooth = 30;
39 tooth_inward = gap[0] * 1.0 + 0.25;
45 $fs = $test ? 0.1 : 1;
49 tooth_height = nook_th;
55 spp1 = spp0 + case_th * [-1,0];
56 spp9 = spp0 + ledge_h * [0,-1];
57 spp8 = spp9 + nook_th * [0,-1];
58 spp7 = spp8 + case_th * [-1,-1];
60 spp11y = spp1[1] - tape_th;
61 spp4y = 0.5 * (spp0[1] + spp7[1]);
62 spp3y = spp4y + tape_inside/2; spp5y = spp4y - tape_inside/2;
63 spp2y = spp3y + tape_th; spp6y = spp5y - tape_th;
65 spp20 = spp8 + nook_cnr_rad * [1,0];
69 tppB = spp1 + [0, gap[1]];
70 tppC = tppB + lid_th * [0,1];
71 tppD = [ spp20x, tppC[1] ];
72 tppE = [ spp20x, tppB[1] ];
73 tppF = tppA + ledge_w * [1,0];
74 tppG = tppF + ledge_h * [0,-1];
75 tppH = [ tppA[0], tppG[1] ];
77 tppJx = tppA[0] + tape_th;
79 tppK = [ tppC[0], tppG[1] ];
80 spp31 = tppK - [0, gap[1]];
81 spp30 = [ spp8[0], spp31[1] ];
83 nom_cnr = 0.5 * [nook_w, nook_h, 0] - nook_cnr_rad * [1,1,0];
85 tooth_y = nom_cnr[1] - tooth_w/2;
87 etxa = nom_cnr[0] - engage_l2;
88 etxb = etxa - engage_l1;
89 etxc = -(nom_cnr[0] - engage_l2);
91 tapa = nom_cnr[1] - engage_l2;
94 opra = nom_cnr[1] - engage_l2;
95 oprb = opra - open_recess_w;
97 opqa = tooth_y - open_recess_2_d_tooth + open_recess_2_len/2;
98 opqb = opqa - open_recess_2_len;
100 tppS = tppB + [-gap[0], 0];
101 tppP = [ tppS[0] - tooth_th, tppC[1] ];
102 tppQ = tppP + tooth_height * [0,-1] + tooth_inward * [1,0];
103 tppR = [ tppS[0] + tooth_inward, tppQ[1] ];
104 tppM = (tppQ + tppR) * 0.5 + tooth_th * 0.5 * [0,1];
106 edge_ledge_rad = edge_ledge_h;
108 module RightSideMainProfile() {
109 rectfromto(spp7, spp0);
110 rectfromto(spp7, spp20);
114 module LeftSideMainProfile() {
115 rectfromto(spp7, spp30);
116 rectfromto(spp7, spp20);
120 module EdgeLedgeProfile() {
123 for (t=[[0,0], [-20,0], [0,-10]]) {
125 + [edge_ledge_w, edge_ledge_h]
126 + edge_ledge_rad * [ -sin(edge_ledge_inc_ang),
127 -cos(edge_ledge_inc_ang) ]
129 circle(edge_ledge_rad);
137 module TopTapeCutout() {
141 [ tppJx, tppH[1]-1 ],
142 [ tppJx, tppC[1]+1 ],
143 [ tppA[0], tppC[1]+1 ]]);
146 module RightTopMainProfile() {
147 l = [ tppA, tppB, tppC, tppD, tppE, tppF, tppG, tppH ];
151 module LeftTopMainProfile() {
152 l = [ tppC, tppD, tppE, tppF, tppG, tppK ];
156 module SideTapeCutout1(y0,y1) {
157 rectfromto([ spp7[0]-1, y0 ],
161 module SideTapeCutout() {
162 SideTapeCutout1(spp6y, spp5y);
163 SideTapeCutout1(spp3y, spp2y);
164 SideTapeCutout1(spp3y, spp2y);
165 SideTapeCutout1(spp11y, spp1[1] + 1); // obsolete I think
168 module ToothProfile(){
179 circle(r= tooth_th/2);
183 module Demo(){ ////toplevel
184 translate([-1,0,0]) {
185 translate([0,0,-2]) LeftSideMainProfile();
186 translate([0,0,-2]) color("yellow") LeftTopMainProfile();
187 color("red") difference(){
188 LeftSideMainProfile();
191 translate([0,0,-4]) color("brown") EdgeLedgeProfile();
192 translate(concat(spp8 + [edge_ledge_w, edge_ledge_h], [2]))
193 rotate(-edge_ledge_inc_ang) {
194 color("blue") square(3);
195 color("lightblue") mirror([1,0]) square(3);
198 translate([0,0,0]) color("purple") difference(){
199 LeftTopMainProfile();
202 translate([nook_cnr_rad*2 + 5, 0,0]) mirror([1,0,0]) {
203 color("red") RightSideMainProfile();
204 color("purple") RightTopMainProfile();
205 color("grey") translate([0,0,-2]) ToothProfile();
210 module FaceCore(z0,z1, extra_left, extra_right){
212 for (mx=[0,1]) mirror([mx,0,0]) {
213 for (my=[0,1]) mirror([0,my,0]) {
214 translate(-nom_cnr) {
215 rotate_extrude(angle=90, convexity=10) {
217 translate(-[1,0,0] * nook_cnr_rad)
219 rectfromto([-100,-100], [0,100]);
224 translate([nook_w/2, 0,0])
225 linextr_y_xz(-nom_cnr[1]-0.1, nom_cnr[1]+0.1)
228 for (my=[0,1]) mirror([0,my,0]) {
229 translate([-nook_w/2, 0,0])
231 linextr_y_xz(tapb, tapa)
235 for (my=[0,1]) mirror([0,my,0]) {
236 translate([0, -nook_h/2, 0]) {
237 linextr_x_yz(-nom_cnr[0]-0.1, etxc + extra_left) children(0);
238 linextr_x_yz(etxc - extra_right, etxb + extra_right) children(1);
239 linextr_x_yz(etxb - extra_left, etxa + extra_left) children(0);
240 linextr_x_yz(etxa - extra_right, nom_cnr[0]+0.1) children(1);
245 rectfromto(-nom_cnr, nom_cnr);
249 module Base(){ ////toplevel
251 FaceCore(spp7[1],spp8[1], 0.3, 0) {
252 LeftSideMainProfile();
253 RightSideMainProfile();
256 translate([0, -nook_h/2, 0])
258 linextr_x_yz(-usb_w/2, usb_w/2)
259 rectfromto(spp8 + [-40, usb_below], [40, 40]);
261 translate([nook_w/2, 0, 0])
262 linextr_y_xz(oprb, opra)
264 rectfromto([-40, -open_recess_h], [40, 1]);
269 module Top(){ ////toplevel
271 FaceCore(tppE[1],tppD[1], -gap[0], gap[0] + 0.3) {
272 LeftTopMainProfile();
273 RightTopMainProfile();
276 translate([nook_w/2, 0,0])
277 linextr_y_xz(opqb, opqa)
278 rectfromto(spp8, tppC + [-1,1]);
280 translate([nook_w/2, tooth_y, 0])
281 linextr_y_xz(-tooth_w/2, +tooth_w/2)
284 module TopPrint(){ ////toplevel
285 rotate([0,0,90]) rotate([180,0,0]) Top();
287 module BasePrint(){ ////toplevel
288 rotate([0,0,90]) Base();
291 module TestExtrude(){
293 linextr_y_xz(-test_pillar, tape_w+test_pillar) children(0);
294 linextr_y_xz( 0, tape_w ) children(1);
298 module BaseTestRest(){ ////toplevel
299 cube([30,15, spp8[1]-spp7[1]]);
302 module Demo3(){ ////toplevel
303 color("purple") Top();
307 module TestSide(){ ////toplevel
308 TestExtrude() { LeftSideMainProfile(); SideTapeCutout(); }
311 module TestTop(){ ////toplevel
312 TestExtrude() { LeftTopMainProfile(); TopTapeCutout(); }
314 module TestTopPrint(){ ////toplevel
315 rotate([180,0,0]) TestTop();