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

More
19 Nov 2017 21:12 #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 or Create an account to join the conversation.

More
24 Nov 2017 14:55 #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)
#!/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 or Create an account to join the conversation.

Moderators: Skullworks
Time to create page: 0.075 seconds
Powered by Kunena Forum