Multi-line text engraving g-code generator
In desperation I thought I would have alook at the single line version and noticed a comment about QCAD 3 fonts being incompatible - so downloaded from the link which was helpfully supplied to the compatible fonts, and it now works, wahoo
Didn't need to add the variable declarations either - I commented these out and it still seems to work so I will have to try and work out why I got error messages at some point
You are right, not very intuitive but still a helpful utlility, pity the message about using the older fonts and link to them was not repeated, would have saved me a lot of time but I got there in the end, thanks
Chris
Please Log in or Create an account to join the conversation.
You are right, not very intuitive but still a helpful utlility, pity the message about using the older fonts and link to them was not repeated,......
At the time it was written and the instructions prepared, there were no older fonts, QCad used .cxf fonts.
It throws an error if it cannot find the default romanc.cxf font, you should have had that.
As usual, the next version of QCad broke backward compatibility when they started using different fonts
As for intuitive, it is a command line program, if you want the options you either put in -h or --help, one of them will always work.
Glad you got there eventually
regards
Please Log in or Create an account to join the conversation.
I did add this around line 469 to make it show the help file if no arguments are passed.
if len(sys.argv[1:]) == 0: help_message() sys.exit(0)
Makes it a little more intuitive.
JT
I have added your test and the resultant code plus the man file is in this new zip
There is also a zip of the earlier versions of the qcad fonts available on my site.
www.mgware.co.uk/LinuxCNC/qcad-fonts.zip
Hopefully that will prevent similar problems
regards
Please Log in or Create an account to join the conversation.
As soon as a space in encountered in a line the gcode generation stops - and will not generate the subsequent lines?
For instance
0 Hello World
1 Line1
2 Line2
Results in the gcode to engrave 'Hello'
This may have been the case all along but at the back of my mind I am sure I have managed to do this in the version I had in the past?
Of course I can have each word in it's own line and space them accordingly but don't remember having to do this before?
Regards
Chris
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
-0'"Hello World"'
-1'Line1'
etc
Maybe something to do with character sets or something? (wild guess!)
Without the extra double quotes the header message in the ngc file said
( Line 0 )
( Code generated by engrave-lines.py )
( by ArcEye 2012, based on work by <Lawrence Glaister>)
( Engraving: "'Hello") << note the double quote followed by single quote, but closed with just a double quote
( Fontfile: fonts/romanc.cxf )
Not an issue (now) but I am curious why I get this? (I am running this from Windows 7 32bit in the office, Python 2.7)
Chris
Please Log in or Create an account to join the conversation.
Not an issue (now) but I am curious why I get this? (I am running this from Windows 7 32bit in the office, Python 2.7)
I have no idea, it works fine on Jessie amd64 with python 2.7.
If you want to use programs written for linux on windoze, you will have to fix your own problems I'm afraid.
Please Log in or Create an account to join the conversation.
When I have a minute I am going to rebuild my LinuxCNC machine with 2.7.5 so hopefully this won't be an issue (I had a HDD crash)
I also noticed some messages about 'Features' that appeared to run your code, this looks like a very interesting development - LinuxCNC seems to be ever moving upwards/forwards thanks to a lot of hard work, wish I knew enough to be able to help myself
Best wishes
Chris
Please Log in or Create an account to join the conversation.
Yes, of course - it wasn't a complaint, just curiosity, I am learning Python and thought it was fairly portable
Python is fairly portable but there are some things that work differently and if the program doesn't detect the OS and use those things that are different for Windoze then it will not work in Windoze. To start google python differences between windows and linux
JT
Please Log in or Create an account to join the conversation.
I lean towards the latter.
Quoting is often used to ensure that blocks of text are seen as an entity.
That is the purpose of the -1`text here` quoting, to prevent only the section until the 0x20 char (space) being seen as the argument
shells will treat `text here` differently from "text here" in some situations, as will other programs
bash will usually accept either, but in some circumstances requires one of them
eg
echo $STRING will produce the string held in the variable, but if you want to compare it, it needs to be quoted.
if [ $STRING == "yes" ] will fail
needs to be
if [ "$STRING" == "yes" ]
I would experiment, you may find that simply using quotation marks instead of apostrophes or back ticks may work
Please Log in or Create an account to join the conversation.