#!/usr/bin/perl -w
#
# drawing of some spare parts for 3mm stock, 20mm-crank config D walker
# 140122

$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 = 181;  # width of drawing, pixels?!?? -- most programs seem to ignore units, use mm
$hPx = 181;  # height of drawing, pixels?!??

require 'laserCutPartsGroups.pl';
require 'JansenDefs.pl';
require 'motorMount.pl';

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

local $x = 31;
local $y = $x;
local $dy = 56;
local $dx = 5;
&printMotorGear($x,$y); $x+=$dx;  $y+=$dy;
&printMotorGear($x,$y); $x+=$dx;  $y+=$dy;
&printMotorGear($x,$y); $x+=$dy-7; $y-=$dy/2+5;
&printMotorGear($x,$y);

&printMotorTabGA16( 79,164, -30,3,$rad4,6);
&printMotorTabGA16(114,147,   0,3,$rad4,6);
&printMotorTabGA16(131,113, -90,3,$rad4,6);

&printMotorStacker( 75, 60,75,$rad4);
&printMotorStacker(117,168, 0,$rad4);
&printMotorStacker(174, 53,90,$rad4);

local $ra = $irA-$fuzz*.3; # let plates be tight on A-axle standoffs
local $rGear=16;
$x = 80; $y = 20;
$dx = 37.3;
&printGearSide($x,$y,$ra,$rGear,$drivePlateOR);   $x+=$dx;
&printGearSide($x,$y,$ra,$rGear,$drivePlateOR);   $x+=$dx;
&printGearSide($x,$y,$ra,$rGear,$drivePlateOR);   $x-=$dx/2; $y += 0.87*$dx;
&printGearSide($x,$y,$ra,$rGear,$drivePlateOR);   $x-=$dx;
&printGearSide($x,$y,$ra,$rGear,$drivePlateOR);   $x+=$dx*1.5; $y += 0.87*$dx;
&printGearSide($x,$y,$ra,$rGear,$drivePlateOR);

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

