chiark / gitweb /
sewing-table: RoundCorner: move INREFFRAME into selector (nfc)
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Sat, 3 Jun 2017 18:59:15 +0000 (19:59 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sat, 3 Jun 2017 18:59:15 +0000 (19:59 +0100)
sewing-table.scad.m4

index 68ec6ed8e5facfadee538ad33712589bb859b4d6..4befae1df03c4003c787e3f9f587f348e8fce5a7 100644 (file)
@@ -246,16 +246,18 @@ m4_define(`ROUNDCORNER_VARS',`
 
 module RoundCorner_selector(ci, adj) {
   ROUNDCORNER_VARS;
-  cube(bigr*2 + adj, center=true);
+  INREFFRAME(this_cnr, right_cnr) INREFFRAME_EDGE {
+    cube(bigr*2 + adj, center=true);
+  }
 }
 
 module RoundCornerCut(ci) {
   // ci should be [this_cnr, right_cnr, left_cnr]
   // where right_cnr is to the right (ie, anticlockwise)
   ROUNDCORNER_VARS;
-  INREFFRAME(this_cnr, right_cnr) INREFFRAME_EDGE {
-    difference(){
-      RoundCorner_selector(ci, -0.1);
+  difference(){
+    RoundCorner_selector(ci, -0.1);
+    INREFFRAME(this_cnr, right_cnr) INREFFRAME_EDGE {
       translate([bigr, bigr, 0])
        cylinder(center=true, h=20, r= bigr);
     }
@@ -264,9 +266,9 @@ module RoundCornerCut(ci) {
 
 module RoundCornerAdd(ci) {
   ROUNDCORNER_VARS;
-  INREFFRAME(this_cnr, right_cnr) INREFFRAME_EDGE {
-    intersection(){
-      RoundCorner_selector(ci, +0.1);
+  intersection(){
+    RoundCorner_selector(ci, +0.1);
+    INREFFRAME(this_cnr, right_cnr) INREFFRAME_EDGE {
       translate([bigr, bigr, 0])
        rotate_extrude(convexity=10, $fn=50)
        translate([bigr, 0])