chiark / gitweb /
filamentspool: CupSecuringClip four handles
[reprap-play.git] / pawn.scad
index 7e62f7cd940eeca51d71ded7aabdbc5f9d080570..62baa7c2b6542c446d126f1f3dc6941021a421fd 100644 (file)
--- a/pawn.scad
+++ b/pawn.scad
@@ -2,12 +2,12 @@
 
 // shape parameters
 
-r1 =  3;
-r2 =  6; a2 = 30;
+r1 =  2.85;
+r2 =  4; a2 = 27;
 r3 = r2;
-r4 =  8; a4 = 30;
-r5 = 12;
-h6 =  5; a6 = 5;
+r4 =  4; a4 = 18;
+r5 = 30;
+h6 = 7; a6 = 4;
 
 // coordinates
 
@@ -29,11 +29,16 @@ x5 = xc5 - r5 * cos(a6);
 
 x6 = x5 - h6 * tan(a6);
 
-$fa=1;
-$fs=0.1;
+htotal = r1 - z6;
+echo("height", htotal);
+
+d = 0.01;
+
+$fa=2;
+$fs=0.2;
 
 module SegmentBasisSquare(zmin, zmax, xmin){
-  translate([xmin, zmin-0.01]) square([-xmin+0.01, zmax-zmin+0.02]);
+  translate([xmin, zmin-d]) square([-xmin+d, zmax-zmin+d*2]);
 }
 module ConvexSegment(xc, zc, r, zmin, zmax){
   intersection(){
@@ -55,9 +60,20 @@ module PawnTemplate(){
   ConcaveSegment( x3 - r4,  z3,   r4, z4, z3);
   ConvexSegment(  xc5,      zc5,  r5, z5, z4);
   polygon([[x6, z6],
-          [x5, z5+0.01],
-          [0.01, z5],
-          [0.01, z6]]);
+          [x5, z5+d],
+          [d, z5+d],
+          [d, z6]]);
+}
+
+module Pawn(h=htotal){
+  scale(h/htotal) {
+    rotate_extrude(convexity=10, $fn=50){
+      assign($fn=undef){
+       PawnTemplate();
+      }
+    }
+  }
 }
 
-PawnTemplate();
+Pawn(h=30);
+//PawnTemplate();