looking for a CLI-tool: convert plain text to gerber

More
8 years 11 months ago #102038 by moony
Hi there,

I hope I'm in the right place to ask for something like this: I'm looking for a commandline-tool, that can convert plain-text into coordinates of a vector font, preferably in gerber file fomat. Is there anything like that out there?

Please Log in to join the conversation.

More
8 years 11 months ago #102290 by andypugh
It looks like nobody here knows of one.
For a one-off I have used a spreadsheet for this. Text-to-columns then insert columns full of G-codes and coordinates, then re-export as space-delimited.

It's probably easy in Perl too. Or create a little Python file, something like this. (untested, just to give a feel)
Code:
#!/usr/bin/python import re import sys import shutil filename = sys.argv[1:]: if not os.path.isfile(opt): {Error message here} sys.exit() file = open(filename,'r').read() file=re.sub("(\d*\.*\d*),(\d*\.*\d*)", "G0 X$1 Y$2", file,flags=re.M) newfile = open("filename"+& ".ngc") newfile.write(file) filename.close() newfile.close()

You can experiment with the RegEx I used here: regexr.com/3h8md

Please Log in to join the conversation.

Time to create page: 0.068 seconds
Powered by Kunena Forum