#!/usr/bin/perl -w
# $URL: svn+ssh://mrwhat@ssh.boim.com/home/mrwhat/svn/Walker/trunk/XD20_22_212x400.pl $
# $Id: XD20_22_212x400.pl 398 2014-02-13 14:44:15Z mrwhat $
#
# script to draw Walker parts which can be cut from 2.5mm (0.100") stock
#
#  It appears that the supplier in Tucson has 0.098" stock which is actually 2.2mm thick.
#  (This may be the same thing as the "2mm" stock at Ponoko)
#  This is a good thickness (<~= 4.5mm/2) for cranklinks, EF, BH, D-fork, and gear side plates

$preview = $#ARGV < 0;  # set to 0 for actual size code generation... will generate REAL code if given any argument

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

# ponoko laser cutting sheets come in 181x181mm, 384x384mm, 384 wide x 790mm long
($wPx,$hPx) = &parseSizeFromFileName($0);  # get this from file name to make SURE it matches

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

&drawEFgroup(10,10,0); ### EF
&drawBHgroup(81, 8,0); ### BH
&drawBEDforkGroup(145,7,0,8); ### forks for CD on BED, need a total of 8

&drawCrankLinkGroup(  8,259,0,$CH);
&drawCrankLinkGroup(105,254,0,$CD);

print "\n<desc>Outer plates for drive gear</desc>\n";
local $x = 158;
local $y = 116;
local $ra = $irA-$fuzz*.3; # let plates be tight on A-axle standoffs
local $rGear=16;
local $dy = 2*($drivePlateOR+.15);
&printGearSide($x,$y,$ra,$rGear,$drivePlateOR);   $y+=$dy;
&printGearSide($x,$y,$ra,$rGear,$drivePlateOR);   $y+=$dy;
&printGearSide($x,$y,$ra,$rGear,$drivePlateOR);   $y+=$dy;
&printGearSide($x,$y,$ra,$rGear,$drivePlateOR);   $y-=$dy/2; $x+=$dy*.87;
&printGearSide($x,$y,$ra,$rGear,$drivePlateOR);   $y-=$dy;
&printGearSide($x,$y,$ra,$rGear,$drivePlateOR);   $y-=$dy;
&printGearSide($x,$y,$ra,$rGear,$drivePlateOR);

# Have pleanty of 2.5 (2.2mm) stackers from "shims" cut.
# may not even be using them anymore anyway.
#print "<g transform=\"translate(0,257)\">";
#for (local $i=0; $i<9;$i++) { &stackerRow(4,10*$i,$i?1:0); }
#print "</g>\n";

&printCatchBar(43,372);
&printCatchBar(66,387);
#&printCatchBar(43,402);
&printCatchBar(192,271,-90);
#&printCatchBar(192,356,-90);

&printCatchTab(109,367,180,1);
&printCatchTab(127,367);

&printCatchTab(139,385,180,1);
&printCatchTab(157,385);

&printCatchTab(168,367,180,1);
&printCatchTab(186,367);

#&printCatchTab(190,332,-90,1);
#&printCatchTab(190,350, 90);

print "</g></svg>\n"; # end of drawing
