On Sunday, January 15, 2012 08:51:58 PM andy pugh did opine: > On 15 January 2012 20:50, gene heskett <ghesk...@wdtv.com> wrote: > > Now, what do most of you folks use for converting an eagle's > > 'excellon' drill file to gcode? > > If you install Octave, you could use this that I wrote for the job: > > function Excellon2Gcode(filename) > i = 1; > C = []; > > f = fopen(filename, 'r'); > o = fopen([filename '.ngc'],'w'); > do > buffer = fgetl(f); > if buffer != -1 > [coords count] = sscanf(buffer,'X%fY%f'); > if count == 2 > C = [C,coords]; > end > end > until feof(f) > > xfactor = -25.4/1000 > yfactor = -25.4/1000 > > fprintf(o,'G90\nF20\nS1000\nM3\n') > > for i = 1:length(C) > fprintf(o,'G98 G81 R0.2 X%4.4f Y%4.4f > Z-3\n',C(1,i)*xfactor,C(2,i)*yfactor) end > fprintf(o,'M2\n') > fclose(f); > fclose(o); > [num2str(length(C)) ' Holes written to file ' filename '.ngc'] > > end
Off the top of my head this looks good, but YALTL* :) *YALTL, Yet Another Language To Learn. Installed Ocatve & friends & reading docs... Thanks Andy. Cheers, Gene -- "There are four boxes to be used in defense of liberty: soap, ballot, jury, and ammo. Please use in that order." -Ed Howdershelt (Author) My web page: <http://coyoteden.dyndns-free.com:85/gene> Very few profundities can be expressed in less than 80 characters. ------------------------------------------------------------------------------ RSA(R) Conference 2012 Mar 27 - Feb 2 Save $400 by Jan. 27 Register now! http://p.sf.net/sfu/rsa-sfdev2dev2 _______________________________________________ Emc-users mailing list Emc-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/emc-users