chiark / gitweb /
sewing-table: RoundCorner rework: promote R_EDGE (nfc)
[reprap-play.git] / sewing-table.scad.m4
index 57f9f3d978d6d3aba91548d8dfd9957d9c5666ea..9a091699d37c244106368363f463faf8f903cd3c 100644 (file)
@@ -205,6 +205,13 @@ module TileBase(botleft, topright){
   }
 }
 
+m4_dnl   R_EDGE(c,ix)
+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_dnl  INREFFRAME(left_cnr, right_cnr, morevars) { body; }
 m4_define(`INREFFRAME',`
   length_vec = ($2) - ($1);
@@ -255,25 +262,29 @@ m4_define(`ROUNDCORNER_VARS',`
 module RoundCorner_selector(ci, adj) {
   ROUNDCORNER_VARS;
   echo("RCS",l_uvec,ctr);
-  union(){
+  %union(){
     INREFFRAME(this_cnr, right_cnr) {
       cube(bigr*2 + adj, center=true);
     }
   }
-  %translate(concat(ctr,[0])) circle(1);
-  if(0){
-  union(){
-    INREFFRAME(this_cnr, right_cnr) {
-//      %translate([ -bigr,-bigr,0 ])
-//     cube([bigr*2 + adj, bigr*3, bigr*2]);
+  intersection(){
+    union(){
+      INREFFRAME(ctr3,concat(lp1,[4])){
+       translate([0,0,-bigr]) linear_extrude(height=bigr*2) {
+         translate([-bigr*2 + adj, -bigr])
+           square([bigr*2, bigr*3]);
+       }
+      }
     }
-  }
-  union(){
-    INREFFRAME(this_cnr, left_cnr) {
-      %translate([ -bigr,-bigr,0 ])
-      cube(bigr*2 + adj);
+    union(){
+      INREFFRAME(ctr3,concat(lp4,[0])){
+       translate([0,0,-bigr]) linear_extrude(height=bigr*2) {
+         translate([-bigr*2, -bigr*2])
+           square([bigr*2 + adj, bigr*3]);
+       }
+      }
     }
-  }}
+  }
 }
 
 module RoundCornerCut(ci) {
@@ -599,13 +610,6 @@ module Rectangle_TileBase(c) { TileBase(c[0], c[2]); }
 
 function Posts_interpolate_one(c0,c1) = [c0, (c0+c1)/2, c1];
 
-m4_dnl   R_EDGE(c,ix)
-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]')
-
 module FitTest_general(c0,sz, dobrace=false){
   c = Rectangle_corners(c0, sz);
   brace = [7,7,9];