X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=reprap-play.git;a=blobdiff_plain;f=pawn.scad;h=6f1bf992d1135d329acca796f8c01718a6cde050;hp=7e62f7cd940eeca51d71ded7aabdbc5f9d080570;hb=e94b783e6ed98e7922daa8c4c3025c9c8f42be63;hpb=0af14d8ca23ad6e142c4aa6e6690ce7a5bff6421 diff --git a/pawn.scad b/pawn.scad index 7e62f7c..6f1bf99 100644 --- 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); +htotal = r1 - z6; +echo("height", htotal); + +d = 0.01; + $fa=1; $fs=0.1; 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=20); +//PawnTemplate();