--
-- Text Engraving Demo
--
-- General Settings

TEXT_HEIGHT = 20                 -- Text height

TEXT_DISCR  = 10                 -- Text discretization

-- Space factor between characters in a string
-- if < 1.0 the string will be narrow and wider if > 1.0

TEXT_SPACING = 1.0              

-- Font to use to machine text.
-- In theory every Windows compliant TTF font could be used.

TEXT_FONT = "C:\\windows\\Fonts\\arial.ttf"   

movetool(10,60,0)                       -- text starting point

milltext("Hello", 1)                    -- create text engraving motions

movetool(10,CTPY - (2 * TEXT_HEIGHT),0) -- engrave another string..

milltext("NCCL", 1)                     -- create text engraving motions

OUTPUT_FILE = "text.nc"
post().
With NCCL you can engrave text using standard Windows fonts and in this tutorial, we will explore the command that make this job done.

Type the following instructions using the text editor of your choice and save them in a file. If you want, you can skip the comments (lines beginning with "--". Call the file, for example,  textmill.cnc.
Open a dos command prompt. Go to the directory where the file has been saved and type this command  :

C:\NCCL>NCCL textmill.cnc

Assuming the file has been saved in C:\nccl folder, you will find a file called text.nc. Open CNC simulator and load the file. Then run the simulation. You should see a nice animation of a tool engraving the strings Hello NCCL  !" and "How are you ?" milled with the Arial Windows font.

Let's examine the script. TEXT_HEIGTH TEXT_SPACING and TEXT_FONT are Nccl sysem variables whose meaning should be obvious but are the height of the text, the distance between characters in single string and the font to be used to engrave the text.

A special mention for  TEXT_DISCR : changing the value of this variable modify the accuracy used internally by milltext command to create the toolpath following the contour of each character. The higher the value, the best is the accuracy. The following images show the same text engraved with different values of TEXT_DISCR.
NCCL Text engraving tutorial
Home Page

Copyright © 2010 by Exgenia"   E-Mail: info@exgenia.com
We already know the movetool command from the first tutorial . It set the engraving starting point along X Y and Z axis.

The command that actually create the motions is milltext("string to be milled", Depth). This command only takes two parameters. The text to be milled and the depth. That's all.

Then the script create the GCODE but it fisrt set the output file to be "text.nc". I think it's easy.

To mill more than one text string, simply move the tool with the usual command movetool to the new text starting point and reissue the milltext command-
Using the looping features of NCCL (that is the same of LUA) it'e easy to create a custom command that can mill all the text in an ascii file.
Other system variables such as ZSTEP can be used in order to mill to the desiderd depth in more than one pass.
Text can also be rotated setting the ANGLE system variable before the milltext command.

Some notes
The milltext command can only use TTF fonts and not bitmaps fonts. It can only engrave the contour of  text. It cannot mill the inside area.  Keep this in mind if you use this command and use appropriate sized tools. Even in the simulator remember to set the tool table to match the size of the tools you used in NCCL in order to have a meaningful simulation.

Although you can use all the TTF fonts, not all of them will give good results to engrave text. Remember that windows fonts has been designed for other kind of devices. Some test needs to be done in order to verify which fonts can give good results. Internet is full of free TTF fonts and dingbats. May be that trying some of them is fun.