#!/usr/bin/perl -w
# $URL: svn+ssh://mrwhat@ssh.boim.com/home/mrwhat/svn/Walker/trunk/XD20_30_230x350.pl $
# $Id: XD20_30_230x350.pl 398 2014-02-13 14:44:15Z mrwhat $
#
# script to draw thin Jansen walker parts for laser cutting in SVG
$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);

&printPayloadBox(6,4,0);  # top/bot/front/back plates

#&drawWideForkGroup(180,40,0,$irB,8); ### B-forks for BED, and H-forks for foot
&drawWideForkGroup(179, 68,-90,$irB,4); ### B-forks for BED, and H-forks for foot
&drawWideForkGroup(179,143,-90,$irB,4); ### B-forks for BED, and H-forks for foot

# back brace tabs for motor mounts
#&drawMotorMountPair(147,20,90);
local $ri = $rad4 + 0.5*$fuzz;
&printMotorTabGA16(192,242,180,3,$ri,6);
&printMotorTabGA16(201,264,  0,3,$ri,6);
&printMotorStacker(171,278,-80,$ri);
#&printMotorStacker(206,284,195,$ri);
&printMotorStacker(192,223,180,$ri);

### motor gears, at least two, perhaps some spares?
&printMotorGear( 31,316);
&printMotorGear( 86,316);
&printMotorGear(141,316);
&printMotorGear(196,316);

# move to 4.5mm ? --> &braceBH(250,288,0,8);

# current design might need 16 3mm stackers. One on each BED and foot
print "<g transform=\"translate(219,151) rotate(90)\">";
&stackerRow(5,0,0);
for (local $i=1; $i<5;$i++) { &stackerRow(3,10*$i,1); }
print "</g>\n";


### Diagnostic only:  Overlay these 4.5mm payload side drawings to check alignment
#&printPayloadSide(170-75-5,82,0);  # check alignment of bottom holes
#&printPayloadSide(170.5,78.9,-90);  # check alignment of side holes
#&printPayloadSide(6,78.9,-90);  # check alignment of side holes

### Diagnostic : to check/compare catchBar and tab
#&printCatchBar(128.6+160,182.3);
#&printCatchTab(128.6+122.5-37.5*0,182.3+70);

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