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




-- 
atp
The idea that there is no such thing as objective truth is, quite simply, wrong.

------------------------------------------------------------------------------
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

Reply via email to