# 6-23-2001 @myt=localtime(time); $ts=$myt[4]+1; #create time string $ts.="/$myt[3]/0"; $ts.=($myt[5]-100); #year, this will fail in 2010 print "(--------- G-code generated by DRL-REC.pl on $ts ------ )\n"; print "(THIS PROGRAM CREATES A RECTANGULAR PATTERN OF HOLES) \n"; #SIZE OF THE DRILL, and how deep $drillsize=0.092; $zdepth=0.25; #SIZE OF THE RECTANGLE $xholes=18; $yholes=10; #OFFSET $xoff=0.53;$yoff=-0.030; #this is for TIV $xoff=0.0;$yoff=0.0; $xoff=0.550; $yoff=-0.010; $xmax=$xholes*$drillsize; $ymax=$yholes*$drillsize; print "(OffsetX=$xoff, OffsetY=$yoff)\n"; print "(Drill $xholes across X, $yholes across Y)\n"; print "(",$xholes*2+$yholes*2-4," holes total)\n"; print "(Spacing=$drillsize, Zdepth=$zdepth) \n"; print "(xMax=$xmax, yMax=$ymax) \n"; print "F99\n"; print "G01\n\n"; print "X $xoff Y $yoff\n"; print "G81 z-$zdepth \n\n"; for ($i=1;$i<$xholes;$i++) { $x+=$drillsize; $xa=$x+$xoff; print "X$xa \nG81 \n"; } print "\n(DOWN Y...) \n"; for ($j=1;$j<$yholes;$j++) { $y+=$drillsize; $ya=$y+$yoff; print "Y$ya \nG81 \n"; } print "\n(BACK X...) \n"; for ($i=1;$i<$xholes;$i++) { $x-=$drillsize; if ($x<0.01) {$x=0;} $xa=$x+$xoff; print "X$xa \nG81 \n"; } print "\n(UP Y...) \n"; #we don't have to drill the 1st hole 'again' for ($j=2;$j<$yholes;$j++) { $y-=$drillsize; if ($y<0.01) {$y=0;} $ya=$y+$yoff; print "Y$ya \nG81 \n"; } #print "x0 y0 \n"; optional! print "(--------------- end of DRL-REC.PL -------- )\n"; end;