NEWS
LinuxCNC 2.5.2 Release
There are no translations available.

LinuxCNC 2.5.2 Update Released (changelog).
 
LinuxCNC 2.5.1 Release
There are no translations available.

LinuxCNC 2.5.1 Update Released (changelog). If the Package Manager does not prompt you to upgrade see this page.

 
LinuxCNC 2.5.0 Release
There are no translations available.

New major release (changelog). See the instructions to update your system from EMC 2.4 to LinuxCNC 2.5.
 
Home Forum Using LinuxCNC G Code Multi-line text engraving g-code generator

Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1

TOPIC: Multi-line text engraving g-code generator

Multi-line text engraving g-code generator 11 Jun 2012 09:39 #20816

  • ArcEye
  • ArcEye's Avatar
  • OFFLINE
  • Moderator
  • Posts: 1418
  • Thank you received: 114
  • Karma: 130
Hi

I have recently been using my small CNC mill to do a large batch of drag engraving of small brass trophy plaques.

Each plaque requires 3 lines of different text, and each plaque differs from the last.

Lawrence Glaister's engrave.py program is excellent, but for this sort of work very time consuming because it only outputs one line at a time.
This requires you to cut and paste several files, each of one line of text, remove unwanted bits and ensure that the text line offsets produce the required output.

I don't normally program in python, but saw no merit in re-writing a perfectly good python font parsing routine into C, just for the sake of it, so slithered into my limited python mode.

The result is a command-line program (yes, old habits die hard, but they are the most flexible and powerful) which takes a plethora of switches (nearly all of which have sensible defaults) which will automatically generate code for engraving up to 10 lines of text

There is built in help
Just invoke engrave-lines.py -h
and get
engrave-lines.py G-Code Engraving Generator for command-line usage
(C) ArcEye <2012>
based upon code from engrave-11.py
Copyright (C) <2008> <Lawrence Glaister> <ve7it at shaw dot ca>
engrave-lines.py -X -x -Y -y -S -s -Z -D -C -W -M -F -P -p -0 -1 -2 -3 ..............
Options:
-h Display this help message
-X Start X value Defaults to 0
-x X offset between lines Defaults to 0
-Y Start Y value Defaults to 0
-y Y offset between lines Defaults to 0
-S X Scale Defaults to 1
-s Y Scale Defaults to 1
-Z Safe Z for moves Defaults to 2mm
-D Z depth for engraving Defaults to 0.1mm
-C Charactor Space % Defaults to 25%
-W Word Space % Defaults to 100%
-M Mirror Defaults to 0 (No)
-F Flip Defaults to 0 (No)
-P Preamble g code Defaults to "G17 G21 G40 G90 G64 P0.003 F50"
-p Postamble g code Defaults to "M2"
-0 Line0 string follow this
-1 Line1 string follow this
-2 Line2 string follow this
-3 Line3 string follow this
-4 Line4 string follow this
-5 Line5 string follow this
-6 Line6 string follow this
-7 Line7 string follow this
-8 Line8 string follow this
-9 Line9 string follow this
Example
engrave-lines.py -X7.5 -x0 -Y12.75 -y5.25 -S0.4 -s0.5 -Z2 -D0.1 -0'Line0' -1'Line1' -2'Line2' -3'Line3' > test.ngc


So run the example
engrave-lines.py -X7.5 -x0 -Y12.75 -y5.25 -S0.4 -s0.5 -Z2 -D0.1 -0'Line0' -1'Line1' -2'Line2' -3'Line3' > test.ngc

and test.ngc will look like this in Axis



It takes a bit of time to work out what your line offsets need to be and the best starting point X and Y to balance the text on the workpiece, but once you have that sorted you can fly through
I generated all the code required to engrave a further 19 plaques, whilst the mill was engraving the first one!

If it helps you - enjoy

regards
Attachments:
  • Attachment This attachment is hidden for guests. Please log in or register to see it.
Last Edit: 12 Jun 2012 01:23 by ArcEye.
The administrator has disabled public write access.

Re:Multi-line text engraving g-code generator 11 Jun 2012 09:47 #20817

  • ArcEye
  • ArcEye's Avatar
  • OFFLINE
  • Moderator
  • Posts: 1418
  • Thank you received: 114
  • Karma: 130
Attachments:
  • Attachment This attachment is hidden for guests. Please log in or register to see it.
Last Edit: 21 Jun 2012 04:41 by ArcEye.
The administrator has disabled public write access.

Re:Multi-line text engraving g-code generator 20 Jun 2012 09:10 #21154

  • ArcEye
  • ArcEye's Avatar
  • OFFLINE
  • Moderator
  • Posts: 1418
  • Thank you received: 114
  • Karma: 130
Hi

AMENDED - see subsequent posts for new downloads

Having used my program for a while, I decided that something needed to be done with the X offset value.
As it stood, if this value was applied, each line would be indented by XLineOffset from the previous one
which started to lose usefulness after 2 lines unless engraving on a slanted face.

When engraving several lines of text, the generally most useful thing to be able to do is to indent lines.

Accordingly I have added functionality which allows any lines specified in a string
eg -i'1357'
to be indented by the -x X offset

The built in help now covers these options
engrave-lines.py G-Code Engraving Generator for command-line usage
            (C) ArcEye <2012> 
            based upon code from engrave-11.py
            Copyright (C) <2008>  <Lawrence Glaister> <ve7it at shaw dot ca>
engrave-lines.py -X -x -i -Y -y -S -s -Z -D -C -W -M -F -P -p -0 -1 -2 -3 ..............
       Options: 
       -h   Display this help message
       -X   Start X value                              Defaults to 0
       -x   X offset between lines              Defaults to 0
       -i   X indent line list                          String of lines to indent in single quotes
       -Y   Start Y value                              Defaults to 0
       -y   Y offset between lines              Defaults to 0
       -S   X Scale                                      Defaults to 1
       -s   Y Scale                                       Defaults to 1       
       -Z   Safe Z for moves                      Defaults to 2mm
       -D   Z depth for engraving              Defaults to 0.1mm
       -C   Charactor Space %                 Defaults to 25%
       -W   Word Space %                        Defaults to 100%
       -M   Mirror                                         Defaults to 0 (No)
       -F   Flip                                             Defaults to 0 (No)
       -P   Preamble g code                     Defaults to "G17 G21 G40 G90 G64 P0.003 F50"
       -p   Postamble g code                    Defaults to "M2"
       -0   Line0 string follow this
       -1   Line1 string follow this
       -2   Line2 string follow this        
       -3   Line3 string follow this
       -4   Line4 string follow this
       -5   Line5 string follow this
       -6   Line6 string follow this
       -7   Line7 string follow this                                
       -8   Line8 string follow this
       -9   Line9 string follow this
      Example      engrave-lines.py -X7.5 -x5 -i'123' -Y12.75 -y5.25 -S0.4 -s0.5 -Z2 -D0.1 -0'Line0' -1'Line1' -2'Line2' -3'Line3' > test.ngc

Examples are shown in screenshot

Indent 234567 -i'234567' - Indent only line 2 -i'2' - Indent lines 2,5 -i'25'



regards
Attachments:
  • Attachment This attachment is hidden for guests. Please log in or register to see it.
Last Edit: 21 Jun 2012 03:14 by ArcEye.
The administrator has disabled public write access.

Re:Multi-line text engraving g-code generator 21 Jun 2012 03:15 #21168

  • ArcEye
  • ArcEye's Avatar
  • OFFLINE
  • Moderator
  • Posts: 1418
  • Thank you received: 114
  • Karma: 130
New download here This attachment is hidden for guests. Please log in or register to see it.

Also from updated wiki entry
http://wiki.linuxcnc.org/cgi-bin/wiki.pl?Simple_LinuxCNC_G-Code_Generators#Multi_line_Text_Engraving_Software
Attachments:
  • Attachment This attachment is hidden for guests. Please log in or register to see it.
Last Edit: 21 Jun 2012 03:30 by ArcEye.
The administrator has disabled public write access.

Re:Multi-line text engraving g-code generator 21 Jun 2012 03:19 #21169

  • ArcEye
  • ArcEye's Avatar
  • OFFLINE
  • Moderator
  • Posts: 1418
  • Thank you received: 114
  • Karma: 130
Man file for engrave-lines.py here ( rename it /usr/share/man/man3/engrave-lines.3) This attachment is hidden for guests. Please log in or register to see it.
Attachments:
  • Attachment This attachment is hidden for guests. Please log in or register to see it.
Last Edit: 21 Jun 2012 03:20 by ArcEye.
The administrator has disabled public write access.

Re:Multi-line text engraving g-code generator 21 Jun 2012 05:30 #21174

  • BigJohnT
  • BigJohnT's Avatar
  • OFFLINE
  • Administrator
  • Posts: 5082
  • Thank you received: 102
  • Karma: 136
ArcEye,

I made this a sticky... nice work.

John
The administrator has disabled public write access.

Re:Multi-line text engraving g-code generator 21 Jan 2013 09:56 #28910

  • ArcEye
  • ArcEye's Avatar
  • OFFLINE
  • Moderator
  • Posts: 1418
  • Thank you received: 114
  • Karma: 130
See also this thread for an example of how to use a script to automate G Code output for engraving incrementing serial numbers

www.linuxcnc.org/index.php/english/forum...gram-possible-#28879
The administrator has disabled public write access.
  • Page:
  • 1
Time to create page: 1.121 seconds
Powered by Kunena Forum
© 2013 LinuxCNC.org
Joomla! is Free Software released under the GNU General Public License.