#!/usr/bin/perl

use cog;
use gdcode; 
use gcode; 
$VERSION=0.01; 


$c=newcogpair cog(3.0,7,16); # Creates a pair of meshing wheels, with teeth module 3.0 (mm) one with 7 teeth, one with 16. 

$c->{wheel}->{holesize}=0.15;       # set some parameters about the wheel 
$c->{wheel}->{cuttersize}=0.125;  
$c->{wheel}->{passdepth}=-0.025; 
$c->{wheel}->{passes}=3; 

$c->{pinion}->{holesize}=0.15;      # set some parameters about the pinion. 
$c->{pinion}->{cuttersize}=0.125;  
$c->{pinion}->{passdepth}=-0.025; 
$c->{pinion}->{passes}=3; 

my $feed=3;                         # feed rate for cut. 

# use one of these 2 lines, not both 
 my $g=new gdcode("test.png",3,1950,1950);   # this uses the GD module to generate a .png file size 1950 pixels square. 
#my  $g=new gcode("test.ngc",$feed);         # and this produces gcode in the file test.ngc. 


$c->{wheel}->trepan(5,0.4,0.25,0.35,0.1,1.0,0.05);
#		$spoken, # number of spokes
#		$wos,	 # total width of spokes
#		$bsf,    # boss radius as a factor of pitch radius
#		$rsf,    # rim size facter as proportion of pitch radius. 
#		$roe,     # radius of window edge
#		$wobf,    # width at base factor, > 1 for wider at spoke rim 
#       $rot,    # rotation factor for inside of spokes relative to outside 1= 1 revolution  0 to 0.2 are good. 

$c->{pinion}->cutwheel($g,-0.9,-0.95,$feed); # this determines where on the media the wheel will be placed. 
$c->{wheel}->cutwheel($g,0.25,0.35,$feed);   # call multiply for copies in different places. 
