chiark / gitweb /
sewing-table: TestPiece1
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Fri, 30 Dec 2016 16:03:58 +0000 (16:03 +0000)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Fri, 30 Dec 2016 16:03:58 +0000 (16:03 +0000)
sewing-table.scad

index 4d275286d03fa0ed66bd4108939d410739c17271..e94ee126b6ecd8912f2584e97ec8ca1727463f23 100644 (file)
@@ -64,12 +64,11 @@ module RoundEdge(left_post, right_post) {
        [ 0,              0,              1,            0, ],
        [ 0,              0,              0,            1, ] ];
   tlength = length + thehd[1] * 2;
        [ 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])
   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]);
       }
        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) {
 }
 
 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]
            ];
 }
 
 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]);
   Posts(holes);
   RoundEdge(holes[0], holes[1]);
   RoundEdge(holes[0] + [ 0, 0.1 ], holes[0]);