4 include <commitid.scad>
10 ply_hole_dia_real = 12;
26 interlock_fine = 0.66;
28 interlock_fine_slope = 1.0;
29 interlock_fine_lenslop = 1.0;
35 leg_hole_dia = 5 + 0.75;
43 leg_fin_bot_flat_z = 5;
51 machine_rear_to_front = 84 + 0.25 - 1.4;
53 cutout_l_end_y_front_slop = 0.5;
54 cutout_l_end_y_rear_slop = 0.5;
57 cutout_l_end_y = machine_rear_to_front;
58 cutout_l_end_new_x_slop = 1.4 - 1.95;
59 cutout_l_end_y_total = cutout_l_end_y
60 + cutout_l_end_y_front_slop + cutout_l_end_y_rear_slop;
62 tile02_tr = [-250, 0];
65 cutout_tile01_y = 170 - 147 + cutout_l_end_y_front_slop;
66 cutout_tile11_y = cutout_l_end_y_total - cutout_tile01_y;
68 // front and rear curves
70 rearedge_len = 170 + 0.70;
73 rearcurve_strt_len = 52;
75 rearcurve_z_slop = -0.50;
77 rearcurve_avoid_y = 35;
79 rearcurve_double_inrad = 26.10 + 8.04;
85 frontcurve_side_skew = 3.5 / 72;
86 frontcurve_avoid_y = 70;
87 frontcurve_z_slop = 0.75;
89 frontcurve_strt_len = 50;
90 frontcurve_dualcurve_angle = 30;
92 teststrapslots_at = [ [ 110, 70 ], [ 110, -35 ],
94 [ 190, -80 ], // do not change index of this one
95 [ 0, 70 ], [ 0, -35 ],
99 teststrap_peg = [7.5, 3.5];
101 ply_edge_hole_dist_real = 14;
108 ply_edge_hole_dist = ply_edge_min + ply_hole_dia/2;
110 echo(str("HOLES IN PLY ctr dist from PLY edge = ", ply_edge_hole_dist));
112 hole_slop = (ply_hole_dia - post_dia)/2;
113 tile_hard_edge_hole_dist = ply_edge_hole_dist + hole_slop;
115 echo(str("HOLES IN PLY ctr dist from TILE HARD edge = ",
116 tile_hard_edge_hole_dist));
118 echo(str("HOLES IN PLY ctr dist from TILE ROUND edge = ",
119 tile_hard_edge_hole_dist + round_edge_rad));
121 thehd = [ tile_hard_edge_hole_dist, tile_hard_edge_hole_dist ];
123 thehd_tl = [ -thehd_tr[0], thehd_tr[1] ];
124 thehd_bl = -thehd_tr;
125 thehd_br = -thehd_tl;
127 tablet_z_slop = 1.00;
129 interlock_rad = interlock_dia/2;
130 interlock_negative_rad = interlock_rad + 0.125;
132 interlock_sq_adj = 0.2; // arbitrary
134 leg_fin_top_rad = sqrt( pow(leg_big_dia/2,2) -
135 pow(leg_fin_top_w/2,2) );
137 leg_tubule_pos_rad = leg_big_dia/2 * 0.6;
139 m4_define(`POST_TCROSSSZ',
140 `2*( tile_hard_edge_hole_dist - test_edge + 1 )')
146 cylinder(r= post_dia/2, h= tile_th + ply_th - post_shorter);
147 translate([0,0, tile_th]) {
148 cylinder(r= screw_big_dia/2, h= screw_big_len);
149 cylinder(r= screw_dia/2, h= ply_th, $fn=20);
154 translate([0,0, tile_th/2]) {
155 cube([post_dia, POST_TCROSSSZ, tile_th], center=true);
156 cube([POST_TCROSSSZ, post_dia, tile_th], center=true);
160 translate([0,0, tile_th/2]) {
161 cube([POST_TCROSSSZ, POST_TCROSSSZ, tile_th], center=true);
170 cylinder(r= post_dia/2 + jig_post_hole_slop, h=10);
171 translate([0,0, -jig_min_th])
172 cylinder(r= ply_hole_dia_real/2, h = 5);
173 for (rot=[0:90:270]) rotate(rot) {
174 translate([ ply_edge_hole_dist_real, 0, 0 ])
175 cube([ jig_pencil_rad*2, jig_pencil_slotlen, 20 ], center=true);
180 module Posts(posts) {
182 translate(concat(p, [0]))
186 module PostHoles(posts) {
188 translate(concat(p, [0]))
193 module TileBase(botleft, topright){
194 size = topright - botleft;
195 botleft_post = botleft + thehd_tr;
196 topright_post = topright + thehd_bl;
199 translate(concat(botleft, [0]))
200 cube(concat(size, [tile_th]));
201 if (!(TEST || JIG)) {
202 cidsz = topright_post-botleft_post
203 + [-post_dia,-post_dia]
205 cidszr = [ min(cidsz[0],50), min(cidsz[1],50) ];
206 echo("CID",cidsz,cidszr);
207 translate( concat(botleft_post, [ -tile_th ])
208 + 0.5 * [ post_dia, post_dia, 0 ]
209 + 0.5 * concat( cidsz - cidszr, [ 0 ]) )
210 Commitid_BestCount_M(cidszr);
213 crossoff = tile_hard_edge_hole_dist + POST_TCROSSSZ/2;
214 cidsz = [ thehd[0], size[1] - 2*crossoff ];
215 cidszr = [ cidsz[0], min(cidsz[1], 50) ];
217 translate( concat(botleft + [0, crossoff] + (cidsz-cidszr)/2, [0]) )
218 Commitid_BestCount(cidszr);
221 translate(concat(botleft + [test_edge,test_edge], [test_tile_th]))
222 cube(concat(size - [test_edge,test_edge]*2, [tile_th*2]));
223 translate(concat(botleft_post, [-1]))
224 cube(concat(topright_post-botleft_post, [tile_th+2]));
226 shufflesz = max(test_edge, tile_hard_edge_hole_dist)*2;
229 cube(shufflesz, center=true);
232 translate([0,0,-20]) linear_extrude(height=20) {
233 for (diag=[[ +1, botleft ],
234 [ -1, [topright[0], botleft[1]] ]]) {
236 rotate(atan2(size[1], diag[0] * size[0]))
237 translate([0, -test_edge/2])
238 square([vectorlen2d(size), test_edge]);
248 m4_dnl c is from Rectangle_corners and
249 m4_dnl ix is a corner number
250 m4_dnl expands to two comma-separated corners:
251 m4_dnl that denoted by ix, and the next one anticlockwise
252 m4_define(`R_EDGE',`$1[$2], $1[(($2)+1)%4]')
255 m4_dnl c is from Rectangle_corners and
256 m4_dnl ix is a corner number
257 m4_dnl expands to an array of corners as for RoundCorner
258 m4_define(`R_CNR',`[ $1[$2], $1[(($2)+1)%4], $1[(($2)+3)%4] ]')
260 m4_dnl INREFFRAME(left_cnr, right_cnr, morevars) { body; }
261 m4_define(`INREFFRAME',`
262 length_vec = ($2) - ($1);
263 length = dist2d([0,0], length_vec);
264 length_uvec = length_vec / length;
265 ortho_uvec = [ -length_uvec[1], length_uvec[0] ];
266 m = [ [ length_uvec[0], ortho_uvec[0], 0, ($1)[0], ],
267 [ length_uvec[1], ortho_uvec[1], 0, ($1)[1], ],
274 m4_dnl INREFFRAME(left_cnr, right_cnr, morevars)
275 m4_dnl INREFFRAME_EDGE { body; }
276 m4_define(`INREFFRAME_EDGE',`
277 translate([0,0, -round_edge_rad])
280 module RoundEdge(left_cnr, right_cnr) {
281 INREFFRAME(left_cnr, right_cnr)
285 cylinder(r= round_edge_rad, h= length, $fn=50);
286 translate([-1, 0, -20])
287 cube([length+2, 20, 20]);
292 m4_define(`ROUNDCORNER_VARS',`
296 bigr= round_cnr_rad - round_edge_rad;
297 l_uvec = unitvector2d(left_cnr - this_cnr);
298 r_uvec = unitvector2d(right_cnr - this_cnr);
299 lp1 = left_cnr + clockwise2d(l_uvec) * bigr;
300 lp2 = this_cnr + clockwise2d(l_uvec) * bigr;
301 lp3 = this_cnr - clockwise2d(r_uvec) * bigr;
302 lp4 = right_cnr - clockwise2d(r_uvec) * bigr;
303 ctr = line_intersection_2d(lp1,lp2,lp3,lp4);
304 ctr3 = concat(ctr,[0])
307 module RoundCorner_selector(ci, adj) {
311 INREFFRAME(ctr3,concat(lp1,[4])){
312 translate([0,0,-bigr]) linear_extrude(height=bigr*2) {
313 translate([-bigr*2 + adj, -bigr])
314 square([bigr*2, bigr*3]);
319 INREFFRAME(ctr3,concat(lp4,[0])){
320 translate([0,0,-bigr]) linear_extrude(height=bigr*2) {
321 translate([-bigr*2, -bigr*2])
322 square([bigr*2 + adj, bigr*3]);
329 module RoundCornerCut(ci) {
330 // ci should be [this_cnr, right_cnr, left_cnr]
331 // where right_cnr is to the right (ie, anticlockwise)
334 RoundCorner_selector(ci, -0.1);
336 cylinder(center=true, h=20, r= bigr);
340 module RoundCornerAdd(ci) {
343 RoundCorner_selector(ci, +0.1);
346 rotate_extrude(convexity=10, $fn=50)
349 circle(r= round_edge_rad, $fn=50);
358 module InterlockLobePlan(negative) {
359 r = negative ? interlock_negative_rad : interlock_rad;
360 ymir = negative ? 0 : 1;
364 translate([thehd[0], 0]){
368 translate([-dx, -0.1])
369 square([ dx*2, r/2 + 0.1 ]);
371 translate([ xi*dx, r ])
379 module InterlockEdgePlan(negative, nlobes, length, dosquare=true) {
380 for (lobei = [ 0 : nlobes-1 ]) {
381 lobex = (length - thehd[0]*2) * (lobei ? lobei / (nlobes-1) : 0);
382 translate([lobex, 0, 0]) {
383 InterlockLobePlan(negative);
389 slotshorter = negative ? -0.1 : interlock_fine_lenslop;
390 mirror([0, negative])
391 translate([slotshorter, iadj])
392 square([length - slotshorter*2, interlock_fine + iadj*2]);
396 module InterlockEdge(left_cnr, right_cnr, negative=0, nlobes=2) {
397 plusth = negative * 1.0;
398 protr = interlock_fine + interlock_sq_adj;
401 z1 = -tile_th/2 - protr / interlock_fine_slope;
402 z3 = -tile_th/2 + protr / interlock_fine_slope;
404 negsign = negative ? -1 : +1;
405 yprotr = negsign * protr;
407 INREFFRAME(left_cnr, right_cnr) {
408 for (vsect = [ // zs0 zs1 ys0, ys1
409 [ -tile_th-plusth, plusth, 0, 0],
410 [ z1, z2, 0, yprotr],
411 [ z2, z3, yprotr, 0],
421 [ 0,1, -sl, -ys0 + negsign*interlock_sq_adj ],
425 linear_extrude(height=zsd, convexity=10)
426 InterlockEdgePlan(negative, nlobes, length, !!ysd);
431 function TestPiece_holes2corners(holes) =
432 [ holes[0] + thehd_bl,
435 holes[0] + thehd_tl ];
437 module TestPiece1(){ ////toplevel
441 corners = TestPiece_holes2corners(holes);
442 rcs = R_CNR(corners,0);
445 TileBase(corners[0], corners[2]);
447 RoundEdge(corners[0], corners[1]);
448 RoundEdge(corners[3], corners[0]);
450 InterlockEdge(corners[1], corners[2], 1, nlobes=1);
457 module TestPiece2(){ ////toplevel
461 corners = TestPiece_holes2corners(holes);
464 TileBase(corners[0], corners[2]);
466 RoundEdge(corners[0], corners[1]);
467 InterlockEdge(corners[3], corners[0], 0, nlobes=1);
473 module TestDemo(){ ////toplevel
474 translate([ -thehd[0], 0 ])
477 translate([ +thehd[0] + demo_slop, 0 ])
481 module Machine_NewRearProfile(){
482 // figures copied out of xfig edit boxes
483 // best not to edit the posbox size if poss - just move it
484 posbox = 10 * ([7.2333,-14.1267] - [-16.2289,40.0289]); // box, Green
485 sideline = -10 * ([-6.2400,13.5600] - [-2.4467,28.2556]); // line, Blue
486 scaleline = 10 * dist2d([-1.1911,-20.4800], [-11.2600,4.0578]); // Green2
487 scaleline_mm = 12+5+10+5+3;
488 sh = -[abs(posbox[0]), abs(posbox[1])];
489 rot = atan2(-sideline[0], sideline[1]);
490 sc = scaleline_mm / scaleline;
491 //echo("SH",sh,rot,sc);
492 scale(sc) rotate(rot) translate(sh){
493 import("sewing-table-rear-profile.dxf", convexity=10); // spline, Pink3
497 module Machine_NewFrontProfile(){
498 // figures copied out of xfig edit boxes
499 // best not to edit the posbox size if poss - just move it
500 posbox = 10 * ([11.8022,8.0600] - [4.2044,19.1867]); // box, Green
501 refline = 10 * ([7.6778,16.7222] - [27.8689,17.6578]); // line, Blue
502 refline_mm = (11-1)*10;
503 sh = -[abs(posbox[0]), abs(posbox[1])];
504 rot = atan2(-refline[0], refline[1]);
505 sc = refline_mm / vectorlen2d(refline);
506 //echo("SH",sh,rot,sc);
507 mirror([1,0]) scale(sc) rotate(rot+90) translate(sh){
508 import("sewing-table-front-profile.dxf", convexity=10); // spline, Pink3
512 module Machine_NewEndProfile(){
513 // figures copied out of xfig edit boxes
514 // NB that y coords are reversed - xfig origin is at bottom left
515 posboxs = 10 * [[4.0400,17.7956], [11.6622,32.5511]]; // box, Pink3
516 refline = 10 * ([8.4000,22.6000] - [50.3000,22.2000]); // line, Blue
517 refline_mm = 10 * (11 - 2.5);
518 sidelines = 10 * [[[9.0889,20.6178], [8.9644,14.6889]],
519 [[50.3800,21.9578], [50.1933,14.4933]]]; // lines, Blue3
520 baseline = 10 * [[8.4000,18.0822], [50.3000,17.6822]]; // line, Green2
524 posbox = [min(posboxs[0][0],posboxs[1][0]),
525 max(posboxs[0][1],posboxs[1][1])];
527 m4_define(`MNEP_ELP',
528 `line_intersection_2d(baseline[0],baseline[1],
529 sidelines[$1][0],sidelines[$1][1])')
530 endline = [MNEP_ELP(0),MNEP_ELP(1)];
532 rot = atan2(-refline[1], -refline[0]);
533 sc = refline_mm / vectorlen2d(refline);
534 sh = (0.5 * (endline[0] + endline[1])) - posbox;
536 ellen = sc * dist2d(endline[0],endline[1]);
537 scy = cutout_l_end_y_total / ellen;
539 scale([scy,1]) scale(sc) rotate(rot + rot_adj) translate(-[sh[0],-sh[1]]){
542 //%translate(1 * (posboxs[0] - posbox)) square(50);
543 //%translate(1 * (posboxs[1] - posbox)) square(50);
544 // %translate(1 * (baseline[0] - posbox)) square([50,10]);
546 // %translate(1 * (endline[0] - posbox)) square([50,10]);
547 // %translate(1 * (endline[1] - posbox)) square([50,10]);
549 // %translate(1 * (sidelines[0][0] - posbox)) square([10,50]);
550 // %translate(1 * (sidelines[0][1] - posbox)) square([10,50]);
551 // %translate(1 * (sidelines[1][0] - posbox)) square([10,50]);
552 // %translate(1 * (sidelines[1][1] - posbox)) square([10,50]);
555 import("sewing-table-end-profile.dxf", convexity=10); // spline, Pink3
559 module Machine_NewEndProfileDemo(){ ////toplevel
560 translate([0,5,0]) Machine_NewEndProfile();
561 translate([0,5,1]) color("blue") mirror([1,0]) Machine_NewEndProfile();
563 translate([0,5, 0]) Machine_NewEndProfile();
564 translate([0,5,-1]) color("blue") mirror([1,0]) Machine_NewEndProfile();
568 module Machine_NewArm(){
569 translate([0,0,-30]) linear_extrude(height=60) {
570 translate(tile01_tr + [ -cutout_l_end_x - cutout_l_end_new_x_slop,
571 (-cutout_tile01_y + cutout_tile11_y)/2 ]){
575 translate([0,d]) Machine_NewEndProfile();
582 module Machine_NewRearCurve(){
583 slant = atan2(4,210-10);
585 translate([0,0, rearcurve_double_inrad]) rotate([slant,0,0]){
586 translate([ rearcurve_double_inrad,
588 -rearcurve_double_inrad + 10 ]){
589 rotate([180,0,0]) rotate([0,0,90]) linear_extrude(height=30){
591 Machine_NewRearProfile();
592 translate([0,-100]) Machine_NewRearProfile();
596 rotate([0,90,0]) rotate([90,0,0]) {
598 rotate_extrude(convexity=10, $fn=64)
600 translate([ 0, -rearcurve_double_inrad ])
601 Machine_NewRearProfile();
602 translate([0,0,-500])
603 cube([500,500,1000]);
606 translate([1,0,-rearcurve_double_inrad])
607 rotate([0,-90,0]) rotate([0,0,-90])
608 linear_extrude(height= rearcurve_strt_len + 1)
609 Machine_NewRearProfile();
613 module Machine_Curves(){ ////toplevel
614 translate([ tile01_tr[0] - cutout_l_end_x + rearedge_len,
618 translate([ -reartablet_x,
620 -reartablet_z + tablet_z_slop])
622 cube([ reartablet_x+1,
626 translate([ tile01_tr[0] - cutout_l_end_x + frontedge_len,
628 frontcurve_z_slop ]){
629 translate([0, -machine_rear_to_front, 0])
630 multmatrix([[1, -frontcurve_side_skew, 0, 0],
634 mirror([1,0,0]) rotate([0,-90,0])rotate([0,0,-90])
635 linear_extrude(height= 200)
636 Machine_NewFrontProfile();
638 translate([ tile01_tr[0] - cutout_l_end_x + rearedge_len,
640 frontcurve_z_slop ]){
641 translate([ rearcurve_strt_len,
644 Machine_NewRearCurve();
649 module TestStrapSlots(){
650 pegwidth = teststrap_peg[0];
651 for (pos = teststrapslots_at) {
653 translate(concat(pos,[0]))
654 for (mx = [0,1]) mirror([mx,0,0]) {
655 translate([ pegwidth/2, -teststrap[1]/2, -20 ])
656 cube(concat(teststrap,[40]));
661 module TestStrapPeg_any(l){ cube(concat([l],teststrap_peg)); }
663 module TestStrapPeg_Short(){ ////toplevel
664 TestStrapPeg_any(35);
667 module TestStrapPeg_Long(){ ////toplevel
668 TestStrapPeg_any(60);
671 module Machine(){ ////toplevel
678 module MachineEnvelope(){
680 p_arm_bl = [-cutout_l_end_x, -cutout_tile01_y];
681 y_arm_t = cutout_tile11_y;
682 p_crv_fl = p_arm_bl + [frontedge_len, -frontcurve_avoid_y];
683 y_crv_b = y_arm_t + rearcurve_avoid_y;
685 translate([0,0,-50]) linear_extrude(height= 100){
686 translate(p_arm_bl) square([400, y_arm_t] - p_arm_bl);
687 translate(p_crv_fl) square([400, y_crv_b] - p_crv_fl);
691 module Leg(){ ////toplevel
696 cylinder(r= leg_big_dia/2, height=leg_top_flat_z, $fn=100);
697 translate([0,0, -leg_height])
698 cylinder(r= leg_bot_dia/2, height=1, $fn=100);
700 for (rot=[0: 360/leg_n_fins : 359]) rotate(rot) {
702 mirror([0,0,1]) translate([0, -leg_fin_top_w/2, 0])
703 cube([ leg_fin_top_rad - 0.1,
707 translate([0, -leg_fin_bot_w/2, -leg_height])
708 cube([ leg_fin_bot_rad,
710 leg_fin_bot_flat_z ]);
714 mirror([0,0,1]) translate([0,0,-1])
715 cylinder(r= leg_hole_dia/2, h=leg_height+2, $fn=30);
716 for (rot=[45: 360/leg_n_tubules : 359]) rotate(rot) {
717 mirror([0,0,1]) translate([ leg_tubule_pos_rad, 0, -1])
718 cylinder(r= leg_tubule_dia/2, h=leg_height+2, $fn=20);
723 function Rectangle_corners(c0, sz) =
724 // returns the corners of a rectangle from c0 to c0+sz
725 // if sz is positive, the corners are anticlockwise starting with c0
728 c0 + [ sz[0], sz[1] ],
731 function Rectangle_corners2posts(c) =
737 module Rectangle_TileBase(c) { TileBase(c[0], c[2]); }
739 function Posts_interpolate_one(c0,c1) = [c0, (c0+c1)/2, c1];
741 module Tile02(){ ////toplevel
743 c0 = tile02_tr + -sz;
744 c = Rectangle_corners(c0, sz);
745 posts = Rectangle_corners2posts(c);
749 Rectangle_TileBase(c);
751 RoundEdge(R_EDGE(c,0));
752 RoundEdge(R_EDGE(c,3));
753 InterlockEdge(R_EDGE(c,2), 0);
755 InterlockEdge(R_EDGE(c,1), 1);
762 module Tile12(){ ////toplevel
764 c0 = tile02_tr + [-sz[0], 0];
765 c = Rectangle_corners(c0, sz);
766 posts = Rectangle_corners2posts(c);
770 Rectangle_TileBase(c);
772 RoundEdge(R_EDGE(c,2));
773 RoundEdge(R_EDGE(c,3));
775 InterlockEdge(R_EDGE(c,0), 1);
776 InterlockEdge(R_EDGE(c,1), 1);
783 tile_01_11_cnr = tile01_tr + [-cutout_l_end_x, 0];
784 tile_11_10_cnr = tile01_tr + [0, cutout_tile11_y];
785 tile_01_00_cnr = tile01_tr - [0, cutout_tile01_y];
787 module Tile11(){ ////toplevel
789 c0 = tile01_tr + [-sz[0],0];
790 c = Rectangle_corners(c0, sz);
791 cnr_posts = Rectangle_corners2posts(c);
793 Posts_interpolate_one(cnr_posts[0],
794 cnr_posts[1] - [cutout_l_end_x, 0]),
795 [ cnr_posts[1] + [0, cutout_tile11_y],
801 Rectangle_TileBase(c);
803 RoundEdge(R_EDGE(c,2));
804 InterlockEdge(R_EDGE(c,3));
806 InterlockEdge(c[0], tile_01_11_cnr, 1);
807 InterlockEdge(tile_11_10_cnr, c[2], 1);
813 module Tile01(){ ////toplevel
815 c0 = tile01_tr + -sz;
816 c = Rectangle_corners(c0, sz);
817 cnr_posts = Rectangle_corners2posts(c);
819 Posts_interpolate_one(R_EDGE(cnr_posts,0)),
820 [ cnr_posts[2] + [0, -cutout_tile01_y] ],
821 Posts_interpolate_one(cnr_posts[2] - [cutout_l_end_x, 0],
826 Rectangle_TileBase(c);
828 RoundEdge(R_EDGE(c,0));
829 InterlockEdge(tile_01_11_cnr, c[3]);
830 InterlockEdge(R_EDGE(c,3));
833 InterlockEdge(c[1], tile_01_00_cnr, 1);
838 module Tile10(){ ////toplevel
840 c0 = tile01_tr + [0,0];
841 c = Rectangle_corners(c0, sz);
842 cnr_posts = Rectangle_corners2posts(c);
843 cty = cutout_tile11_y;
844 rcy = cty + rearcurve_avoid_y;
845 posts = [ cnr_posts[0] + [ 0, cty ],
846 cnr_posts[1] + [ -sz[0] + rearedge_len - cutout_l_end_x, cty ],
847 cnr_posts[1] + [ 0, rcy ],
853 Rectangle_TileBase(c);
855 RoundEdge(R_EDGE(c,1));
856 RoundEdge(R_EDGE(c,2));
857 InterlockEdge(c[3], tile_11_10_cnr);
866 module Tile00(){ ////toplevel
868 c0 = tile01_tr + [0,-sz[1]];
869 c = Rectangle_corners(c0, sz);
871 // the edge c[1]..c[2] needs a diagonal chunk, from c1bis to c2bis
872 c2bis = [ -cutout_l_end_x + frontedge_len + frontcurve_strt_len, c[2][1] ];
875 (c[2][0] - c2bis[0]) * tan(90 - frontcurve_dualcurve_angle) ];
877 cnr_posts = Rectangle_corners2posts(c);
878 cty = cutout_tile01_y;
879 rcy = cty + frontcurve_avoid_y;
880 posts = [ cnr_posts[0],
882 0.5 * (cnr_posts[0] + cnr_posts[1]),
883 cnr_posts[2] + [ 0, -rcy ],
884 cnr_posts[2] + [ -sz[0] + frontedge_len - cutout_l_end_x, -cty ],
885 cnr_posts[3] + [ 0, -cty ]
888 rc2 = [c1bis,c2bis,c[1]];
893 Rectangle_TileBase(c);
895 RoundEdge(R_EDGE(c,0));
896 RoundEdge(c[1], c1bis);
897 InterlockEdge(tile_01_00_cnr, c[0]);
900 translate([0,0,-20]) linear_extrude(height=40) {
901 polygon([ c1bis, c1bis + [50,0], c2bis + [50,0], c2bis ]);
904 RoundEdge(c1bis, c2bis);
914 module FitTest_general(c0,sz, dobrace=false, bracexx=0){
915 c = Rectangle_corners(c0, sz);
917 bsz = sz + [bracexx,0,0];
920 Rectangle_TileBase(c);
922 translate(concat(c0, [-brace[2] + 0.1])){
924 cube(concat(bsz, [brace[2]]) - [5,0,0]);
925 translate(brace + [0,0, -25])
926 cube(concat(bsz, [50]) - brace*2 + [10,0,0]);
930 RoundEdge(R_EDGE(c,1));
936 module FitTest_PairLink(cut=false){ ////toplevel
937 cy0=-55; cy1=85; cx=132;
940 footrad_min = 1; footrad_max = 4; footrad_depth = 5;
946 straphole_x_max = legrad/sqrt(2) + footrad_max;
947 dz = cut ? adj_neg_slop : 0;
949 translate([cx - bar[0]/2, cy0, dz + bar_z_slop])
950 cube([bar[0], cy1-cy0, bar[1] - bar_z_slop]);
952 for (endy=[cy0,cy1]) {
954 translate([cx,endy,dz]){
956 for (rot=[45:90:315]) rotate(rot) {
957 translate([legrad,0,0]){
959 cylinder(r= footrad_max, h=1);
960 translate([0,0,-footrad_depth])
961 cylinder(r= footrad_min, h=1);
965 cylinder(r= footrad_min +
966 adj_neg_slop * (footrad_max-footrad_min)/footrad_depth,
971 for (rot=[45,135]) rotate(rot) {
974 translate([s*legrad,0,0])
975 cylinder(r= footrad_max, h=bar[1]);
981 for (rot=[0,180]) rotate(rot) {
982 translate([ straphole_x_max - strap[0]/2, 0,0 ])
983 cube(concat(strap,[20]), center=true);
990 module FitTest_RearCurve(){ ////toplevel
992 FitTest_general([100,0], [180,100]);
993 FitTest_PairLink(true);
998 module FitTest_FrontCurve(){ ////toplevel
1004 translate([0,0,-8]) linear_extrude(height=18) {
1005 translate(p0) square(sz);
1006 translate(teststrapslots_at[3])
1007 scale(2* [ teststrap_peg[0], teststrap[1] ])
1008 circle(r=1, $fn=20);
1011 FitTest_PairLink(true);
1016 module FitTest_Entire(){ ////toplevel
1019 szfront = [243,szrear[1]];
1021 FitTest_general(p0, szrear, dobrace=true, bracexx=0);
1022 FitTest_PairLink(true);
1023 translate(concat(p0,[0]) + [szfront[0],-10,-40])
1024 cube([100, -p0[1], 80]);
1028 FitTest_RearCurve();
1029 translate(concat(p0,[-20])) cube(concat(szrear,[40]));
1031 FitTest_FrontCurve();
1034 module FitTest_EntireDemo(){ ////toplevel
1039 module FitTest_EndEnd(){ ////toplevel
1042 sz2 = [136,68] - p0;
1044 FitTest_general(p0, sz);
1045 translate([ p0[0] -1, p0[1]+sz2[1], -10])
1046 cube([ sz2[0] +1, 50, 20 ]);
1050 module FitTest_PairDemo(){ ////toplevel
1054 %FitTest_FrontCurve();
1055 %FitTest_RearCurve();
1061 FitTest_FrontCurve();
1062 FitTest_RearCurve();
1064 #FitTest_PairLink(true);
1070 module RoundCornerDemo_plat(cnr){
1071 mirror([0,0,1]) linear_extrude(height=1) polygon(cnr);
1074 module RoundCornerDemo(){ ////toplevel
1075 cnr = [ [-2,-3], [13,-3], [-12,9] ];
1076 translate([0,25,0]) RoundCornerDemo_plat(cnr);
1077 translate([25,0,0]) RoundCornerAdd(cnr);
1078 translate([-25,0,0]) RoundCornerCut(cnr);
1079 translate([0,-25,0]) RoundCorner_selector(cnr, 0);
1081 RoundCornerDemo_plat(cnr);
1082 RoundCornerCut(cnr);
1084 RoundCornerAdd(cnr);
1087 module Demo(){ ////toplevel
1088 translate(demo_slop*[-2,1]) color("blue") Tile12();
1089 translate(demo_slop*[-2,0]) color("red") Tile02();
1090 translate(demo_slop*[-2,1]) color("orange") Tile11();
1091 translate(demo_slop*[-2,0]) color("purple") Tile01();
1092 translate(demo_slop*[-3,1]) color("blue") Tile10();
1093 translate(demo_slop*[-3,0]) color("red") Tile00();
1095 // Can also do this, to print reference sheet:
1096 // load this into openscad
1097 // select Ctrl-4 view, view all, scale appropriately
1098 // import sewing-table,Demo-flat.png
1099 // pngtopnm <sewing-table,Demo-flat.png | ppmbrighten -s -50 -v +100 >t.pnm
1107 //Machine_NewRearProfile();
1108 //Machine_NewRearCurve();
1109 //Machine_NewFrontProfile();
1110 //Machine_NewEndProfile();
1111 //Machine_NewEndProfileDemo();
1115 //MachineEnvelope();