#!/usr/bin/perl -w
# $URL: svn+ssh://mrwhat@ssh.boim.com/home/mrwhat/svn/Walker/trunk/lc20_45_P2.pl $
# $Id: lc20_45_P2.pl 364 2014-01-24 16:27:16Z mrwhat $
#
# script to draw thick Jansen walker parts for laser cutting in SVG
#    This version is for 1/4" standoff hinges, with standoff axle and crank-arm
$preview = $#ARGV < 0;  # set to 0 for actual size code generation... will generate REAL code if given any argument

# ponoko laser cutting sheets come in 181x181mm, 384x384mm, 384 wide x 790mm long
$wPx = 384;  # width of drawing, pixels?!?? -- most programs seem to ignore units, use mm
$hPx = 384;  # height of drawing, pixels?!??

require 'laserCutPartsGroups.pl';
require 'JansenDefs.pl';
require 'payloadBox.pl';

&printPonokoHeader($wPx,$hPx,$preview);

&drawFootOct(112,261,58);   ##### feet  -- $FH $GH $FG $FGleft $FGperp 
&drawBEDoct(276,298,120);    ### BED
#&drawMainQuadFlat(266,136,0);
&printMainQuadFlat(266,134,0);
&drawCrankArms(210,30,0,$AC,8);  ### AC, need only 4, put cutting spares

#&drawPayloadMountSet(114.4,93.9,90); # ULC
&printPayloadSideSet(134,104,-90);

##&drawMotorMountSet(345,216,90,4);
#&drawMotorMountSet(368,292,90,4,1);

## main pulleys (inside part)
# drive gear (smaller gear, for 30rpm motor)
local $rs = $irS - 0.2 * $fuzz;  # make gear hole TIGHT around #4-40 rod
&printGear( 55,226  ,$gearPitch,$teethDrive,$rs);  # only need 2, but cutting spares
&printGear(140,225  ,$gearPitch,$teethDrive,$rs);
&printGear(108,365  ,$gearPitch,$teethDrive,$rs);
&printGear(232,241.5,$gearPitch,$teethDrive,$rs);

&braceB(175,145,0,12);
&braceBH(172,60,0,8);

### new main bar uses round spacers now, not stackers
## Only using 4 thick stackers now.  2 for each motor mount (plus some spares)
#print "<g transform=\"translate(287,230)\">";
#  &stackerRow(2, 0,1);
#  &stackerRow(2,10,1);
#  &stackerRow(2,20,1);
#print "</g>\n";
#&roundSpacer(6.6, 41,6,$rad4+0.5*$fuzz);
#&roundSpacer(6.6, 76,6,$rad4+0.5*$fuzz);
#&roundSpacer(6.6,109,6,$rad4+0.5*$fuzz);
#&roundSpacer(6.6,138,6,$rad4+0.5*$fuzz);
#&roundSpacer(6.6,167,6,$rad4+0.5*$fuzz);
#&roundSpacer(6.6,189,6,$rad4+0.5*$fuzz);
#&roundSpacer(6.6,202,6,$rad4+0.5*$fuzz);
#&roundSpacer(6.6,215,6,$rad4+0.5*$fuzz);
local $ri = $rad4+0.5*$fuzz;
local $ro = 6;  # same radius as fork tyne on main bar
&roundSpacer( 7,215,$ro,$ri);
&roundSpacer(20,215,$ro,$ri);
&roundSpacer(33,215,$ro,$ri);
&roundSpacer(13.5,225.5,$ro,$ri);
&roundSpacer(74,215,$ro,$ri);
&roundSpacer(87,215,$ro,$ri);
&roundSpacer(78,228,$ro,$ri);
&roundSpacer(60,247,$ro,$ri);
&roundSpacer(73,240,$ro,$ri);

print "</g>\n";  # end of mm scale 
print "</g>\n";  # end of cut-line drawing group
print "</svg>\n"; # end of drawing
