From d23521852ffd8ca2753fdd0f1c66bb78022dc652 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Fri, 30 Dec 2016 16:03:58 +0000 Subject: [PATCH 1/1] sewing-table: TestPiece1 --- sewing-table.scad | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/sewing-table.scad b/sewing-table.scad index 4d27528..e94ee12 100644 --- a/sewing-table.scad +++ b/sewing-table.scad @@ -64,12 +64,11 @@ module RoundEdge(left_post, right_post) { [ 0, 0, 1, 0, ], [ 0, 0, 0, 1, ] ]; tlength = length + thehd[1] * 2; - echo(m); multmatrix(m) { translate([-thehd[1], -thehd[0], -round_edge_rad]){ difference(){ rotate([0,90,0]) - cylinder(r= round_edge_rad, h= tlength, $fn=30); + cylinder(r= round_edge_rad, h= tlength, $fn=50); translate([-1, 0, -20]) cube([tlength+2, 20, 20]); } @@ -78,13 +77,29 @@ module RoundEdge(left_post, right_post) { } module RoundLeftCorner(this_post, right_post) { + length_vec = right_post - this_post; + length_uvec = length_vec - dist2d([0,0], length_vec); + ortho_uvec = [ -length_uvec[1], length_uvec[0] ]; + m = [ [ length_uvec[0], ortho_uvec[0], 0, this_post[0], ], + [ length_uvec[1], ortho_uvec[1], 0, this_post[1], ], + [ 0, 0, 1, 0, ], + [ 0, 0, 0, 1, ] ]; + multmatrix(m) { + translate([-thehd[1], -thehd[0], -round_edge_rad]){ + difference(){ + sphere(r= round_edge_rad, $fn=60); + translate([0,0, -20]) + cube([20,20,20]); + } + } + } } module TestPiece1(){ holes = [ [-100, 0], [ 0, 0] ]; - %TileBase(holes[0], holes[1]); + TileBase(holes[0], holes[1]); Posts(holes); RoundEdge(holes[0], holes[1]); RoundEdge(holes[0] + [ 0, 0.1 ], holes[0]); -- 2.30.2