#!/usr/bin/perl -w
# $URL: svn+ssh://mrwhat@ssh.boim.com/home/mrwhat/svn/Walker/trunk/lc20_45_1x2.pl $
# $Id: lc20_45_1x2.pl 310 2013-11-04 22:05:25Z mrwhat $
#
# script to draw thick Jansen walker parts for laser cutting in SVG
#    This version is for 3/16" axle and 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

# pololu laser cutting sheets come in 1x1', 1x2'... minus .25 inches for border
$wPx = 23.75 * 25.4;
$hPx = 11.75 * 25.4;

require 'laserCutPartsPrimitives.pl';
require 'laserCutPartsGroups.pl';
require 'JansenDefs.pl';

# cab be tweaked for use with pololu drawings too:
&printPonokoHeader($wPx,$hPx,$preview);
#&drawPololuFiducial(11.75*25.4,1); # add Pololu fiducial (at ~1' boundary)
&drawPololuFiducial(293,53); # open space in drawing to be safe

&drawPayloadMountSet(114.8,93.9,90); # ULC
#&drawFootOct(388,158,63+90);   ##### feet  -- $FH $GH $FG $FGleft $FGperp 
&drawFootOct(330,145,-30);   ##### feet  -- $FH $GH $FG $FGleft $FGperp 
&drawBEDoct(208,68,30);    ### BED

# need 4 crank arms.  TEMPORARY:  print more to experiment with
&drawCrankArms(266,207.5,180,$AC,3,1);  ### AC
&drawCrankArms(188,207.5,180,$AC,2,1);
&drawCrankArms(168.8,160,-90,$AC,1,1);
&drawCrankArms(168.8,100,-90,$AC,1,1);


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

#&drawMainQuadFlat(400,138,0);
local $rb = $irB - 0.2 * $fuzz;  # make B-axle connection a little tight
local $ra = $irA;
print "<desc>main bars</desc>";
&drawMainPairFlat(215,221, 0 ,$Bx,$rb,$Ay,$ra);
&drawMainPairFlat(344, 42,180,$Bx,$rb,$Ay,$ra);

## main pulleys (inside part)
# drive gear (smaller gear, for 30rpm motor)
&printGear(293,194,$gearPitch,$teethDrive,$irS);
&printGear(290,108,$gearPitch,$teethDrive,$irS);
&printGear(402, 72,$gearPitch,$teethDrive,$irS); # TEMPORARY: spare!

# Change motor pulley to a single 3mm gear
#&roundSpacer(168,261,7.2,1.5,1);
#&roundSpacer(172,300,7.2,1.5,1);

&braceB(25,258,-90,12);
&braceBH(8,230,-90,16);

# Foot fork and BED-B forks use single wide spacer, perhaps a 2+3 to be slightly more than 4.5mm wide

# BED d-fork is special, long and thin, even 1.5 width multiplier
# if it gets a spacer, it will be special, 0.5-1mm thin

# main will need 4-6 spacers, plus 2-4 for motor mounts

#print "<g transform=\"translate(187.5,3.5) rotate(90)\">";
#  for (local $i=0; $i<3;$i++) { &spacerRow(9,10*$i,2); }
#print "</g>\n";


#&startPart(196,96,-90);
#for (local $i=0; $i<3; $i++) { drawSquareSpacerRow(0,$i*15,$radS,7.5,6,1); }
#print "$endPart";

=comment try to start using proper nylon spacers, likely cheaper than cutting them
&roundSpacer(232,252,6.3,$irB);
&roundSpacer(243.4,257.8,6.3,$irD);
&roundSpacer(305,252,6.3,$irD);
&roundSpacer(316,259,6.3,$irD);
&roundSpacer(208,252,6.3,$irD);
&roundSpacer(196,247,6.3,$irD);
&roundSpacer(184,252,6.3,$irD);
&roundSpacer(181,266,6.3,$irD);
&roundSpacer(194,269,6.3,$irD);
&roundSpacer(55,242,6.3,$irB);
&roundSpacer(68,242,6.3,$irB);
&roundSpacer(81,242,6.3,$irB);
&roundSpacer(7,265,6.3,$irB);
&roundSpacer(7,312,6.3,$irB);
&roundSpacer(7,325,6.3,$irB);
&roundSpacer(7,338,6.3,$irB);
=cut

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

