X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=reprap-play.git;a=blobdiff_plain;f=sewing-table.scad.m4;h=64f144bce908fa5eec60b873cf500b54d725f599;hp=9a091699d37c244106368363f463faf8f903cd3c;hb=715c4586a63f2ca8c259db72161bc4de51a17472;hpb=457cf6af6a0931a6baef7c51e49f2ca6dd02c135 diff --git a/sewing-table.scad.m4 b/sewing-table.scad.m4 index 9a09169..64f144b 100644 --- a/sewing-table.scad.m4 +++ b/sewing-table.scad.m4 @@ -210,7 +210,13 @@ m4_dnl c is from Rectangle_corners and m4_dnl ix is a corner number m4_dnl expands to two comma-separated corners: m4_dnl that denoted by ix, and the next one anticlockwise -m4_define(`R_EDGE',`$1[$2],$1[(($2)+1)%4]') +m4_define(`R_EDGE',`$1[$2], $1[(($2)+1)%4]') + +m4_dnl R_CNR(c,ix) +m4_dnl c is from Rectangle_corners and +m4_dnl ix is a corner number +m4_dnl expands to an array of corners as for RoundCorner +m4_define(`R_CNR',`[ $1[$2], $1[(($2)+1)%4], $1[(($2)+3)%4] ]') m4_dnl INREFFRAME(left_cnr, right_cnr, morevars) { body; } m4_define(`INREFFRAME',` @@ -261,12 +267,6 @@ m4_define(`ROUNDCORNER_VARS',` module RoundCorner_selector(ci, adj) { ROUNDCORNER_VARS; - echo("RCS",l_uvec,ctr); - %union(){ - INREFFRAME(this_cnr, right_cnr) { - cube(bigr*2 + adj, center=true); - } - } intersection(){ union(){ INREFFRAME(ctr3,concat(lp1,[4])){ @@ -400,7 +400,7 @@ module TestPiece1(){ ////toplevel [ 0, 0] ]; corners = TestPiece_holes2corners(holes); - rcs = [corners[0], corners[1]]; + rcs = R_CNR(corners,0); difference(){ union(){ TileBase(corners[0], corners[2]); @@ -644,7 +644,7 @@ module Tile02(){ ////toplevel c0 = tile02_tr + -sz; c = Rectangle_corners(c0, sz); posts = Rectangle_corners2posts(c); - rcs = [R_EDGE(c,0)]; + rcs = R_CNR(c,0); difference(){ union(){ Rectangle_TileBase(c); @@ -664,7 +664,7 @@ module Tile12(){ ////toplevel c0 = tile02_tr + [-sz[0], 0]; c = Rectangle_corners(c0, sz); posts = Rectangle_corners2posts(c); - rcs = [R_EDGE(c,3)]; + rcs = R_CNR(c,3); difference(){ union(){ Rectangle_TileBase(c); @@ -744,7 +744,7 @@ module Tile10(){ ////toplevel cnr_posts[1] + [ 0, rcy ], cnr_posts[2], cnr_posts[3] ]; - rcs = [R_EDGE(c,2)]; + rcs = R_CNR(c,2); difference(){ union(){ Rectangle_TileBase(c); @@ -779,7 +779,8 @@ module Tile00(){ ////toplevel cnr_posts[2] + [ -sz[0] + rearedge_len - cutout_l_end_x, -cty ], cnr_posts[3] + [ 0, -cty ] ]; - rcs = [R_EDGE(c,1)]; + rcs = R_CNR(c,1); + rc2 = [c1bis,c2bis,c[1]]; difference(){ union(){ difference(){ @@ -798,9 +799,10 @@ module Tile00(){ ////toplevel RoundEdge(c1bis, c2bis); } Machine(); + RoundCornerCut(rc2); } RoundCornerAdd(rcs); - RoundCornerAdd([c1bis,c2bis,c[1]]); + RoundCornerAdd(rc2); } module FitTest_FrontCurve(){ ////toplevel @@ -819,7 +821,7 @@ module RoundCornerDemo_plat(cnr){ } module RoundCornerDemo(){ ////toplevel - cnr = [ [0,0], [15,0], [-10,12] ]; + cnr = [ [-2,-3], [13,-3], [-12,9] ]; translate([0,25,0]) RoundCornerDemo_plat(cnr); translate([25,0,0]) RoundCornerAdd(cnr); translate([-25,0,0]) RoundCornerCut(cnr);