--
-- Dxf engraving Demo
--
cutdxf("star.dxf",1) -- load the file and process it
OUTPUT_FILE = "dxfout.nc" -- set the output file name
post() -- create GCODE
NCCL has a command that with a single instruction allow to load a DXF file and mill the contours that the file contains.
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, dxfeng.cnc.
DXF import and engraving tutorial
Home Page
Copyright © 2010 by Exgenia" E-Mail: info@exgenia.com
The file star.dxf contain simple geometry. IT can be created with Autocad or other software that support the popular DXF format. DXF is a de facto standard in the CAD market and in the years is evolved to support many different entities.
the cutdxf command can read dxf but only lines, arcs and circles will be considered. All other entities will be ignored if present. Polylines and splines should be exploded to chain of segments before processing with the cutdxf command.
Beside the kind of supported entities, there are no special restrictions.
The cutdxf command will create a tool path following the entities it will find. So it's easy to engrave profiles or even cut them. The depth of the machining is the second parameter of the command. Profiles inside the file can be both open or closed.
If a file contain profiles that need to be machined in a specific order, split the file in many sub-files repeatedly calling cutdxf command in the order you like.
In the above example, the star.dxf command will be opended and the profiles found inside it will be machined to a depth of 1 mm. The origin of the reference system inside the DXF file will be considered like a local origin on the workpiece. In other words the point X=0 Y=0 Z=0 of the dxf file will be placed onto the workpiece in the position set by the last call to movetool command. In the example, no call to movetool has been made, so the file will be machined at position X=0 Y=0 Z=0 on the workpiece.
You can also set the system variable ANGLE to a specific value to get a rotated toolpath. The rotation point will be the origin of the DXF file.

--
-- Dxf engraving Demo # 2
--
y_incr = 40 -- distance in Y between copies
movetool(10,10,0) -- first instance starting point..
-- create 4 copied of the profiles described in "star_demo.dxf"
-- each copy will be at 40 mm in y from the previous one..
for var = 1,4 do
cutdxf("star_demo.dxf",1)
movetool(10, CTPY + y_incr, 0)
end
OUTPUT_FILE = "multiple.nc"
post()