Creating gcode with ‘laserengraver’ extension in Inkscape sometimes makes gcode with very large values of IJKR that make tgfx go crazy and chilipeppr wont display it.
Here’s a short python script to weed out those lines and produce working gcode like this: http://swigerco.com/IsingRegime_2_0001_e1.nc
short and simple version:
___________________________________
infile = open(“IsingRegime_2_0001.nc”,“r”)
lines = [line.strip(’\n’) for line in infile]
infile.close()
outfile = open("/home/chuck/IsingRegime_2_0001_e1.nc",“w”)
for line in lines:
DROPLINE=False
for token in line.split(’ ‘):
if len(token) > 1:
if (token[0] == ‘I’) | (token[0] == ‘J’) | (token[0] == ‘K’) | (token[0] == ‘R’):
val = float(token[1:len(token)])
if (val > 200) | (val < -200):
DROPLINE=True
if (DROPLINE != True):
outfile.write(line+’\n’)
outfile.close()