chiark / gitweb /
ksafe-base: introduce AtTwoCorners (nfc)
[reprap-play.git] / ksafe-base.scad
index 973ec8d3bd49478493628caf3a4558351e539874..1d4048b5a78bd3cbbc6fc8925e8e54dc0e559d73 100644 (file)
@@ -151,11 +151,15 @@ module WebProfile(){
   }
 }
 
+module SomeBaseProfile(I, F){
+  polygon([ I,
+           F,
+           [ hsz+1, F[1] ],
+           [ hsz+1, I[1] ] ]);
+}
+
 module BaseProfile(){
-  polygon([ $xppI,
-           $xppF,
-           [ hsz+1, $xppF[1] ],
-           [ hsz+1, $xppI[1] ] ]);
+  SomeBaseProfile($xppI, $xppF);
 }
 
 module SWalls(ymin, ymax, t_bevel) {
@@ -171,19 +175,27 @@ module SWalls(ymin, ymax, t_bevel) {
   }
 }
 
-module KsafeBase(){
-  /// corners
-  for (xm=[0,1]) for (ym=[0,1]) {
-    mirror([xm,0,0]) mirror([0,ym,0])
+module AtTwoCorners(){
+  for (xm=[0,1]) {
+    mirror([xm,0,0]) 
     translate((hsz - cnr_rad) * [1,1])
     intersection(){
       rotate_extrude(convexity=10)
        translate([-cnr_rad,0])
-       UsualProfile();
+       children();
       translate([0,0,-250])
        cube([50,50,500]);
     }
   }
+}
+
+module KsafeBase(){
+  /// corners
+  for (ym=[0,1]) mirror([0,ym,0]) {
+    AtTwoCorners(){
+      UsualProfile();
+    }
+  }
 
   // side walls and base
   SWalls(yw6 , yw4 , bevel  ) { UsualProfile();      BaseProfile(); }
@@ -192,6 +204,7 @@ module KsafeBase(){
   SWalls(yw3 , yw2 , a_bevel) { AnchorProfile();     BaseProfile(); }
   SWalls(yw11, yw12, a_bevel) { AnchorWallProfile(); BaseProfile(); }
   SWalls(yw11, yw13, bevel  ) { UsualProfile();      BaseProfile(); }
+  SWalls(yw1,  yw10, a_bevel) { WebProfile(); SomeBaseProfile($gppS, $xppF); }
 }
 
 module DemoProfiles(){