This wiki page gives a overview about the Intention of different section and variable names which allows configuration of the postprocessor. It is possible to have more then one postprocessor configuration file.
While the tool is not directly integrated it is possible to have different postprocessor configuration files. You can choose between all valid postprocessor configuration files stored in the \postpro_config directory.
This description is valid for the dxf2gcode pyQt4 Version starting with svn rev. 417 dated August 2013.
Do not edit any section or variable names, this will result in Import errors while dxf2gcode is initialising.
# Section and variable names must be valid Python identifiers # do not use whitespace in names # do not edit the following section name:
This is the introduction of the postprocessor file. There is no Need to Change it.
[Version] # do not edit the following value: config_version = 4
This section is intended for changes of the prostprocessor file itself. While the tool evolves over time this counter will be increased to indicate that the configuration of the postprocessor was changed.
[General] output_format = .ngx output_text = G-CODE for EMC2 output_type = g-code
This three configurations are shown in the save file dialog and are used by the user to differentiate between the possibly different postprocessor configurations.
abs_export = True cancel_cc_for_depth = False cc_outside_the_piece = True export_ccw_arcs_only = False max_arc_radius = 10000.0 export_arcs_as_lines = False
code_begin_mm = G21 (Unit in mm) code_begin_in = G20 (Units in inches) code_begin = G90 (Absolute distance mode) G64 P0.001 (Exact Path 0.001 tol.) G17 G40 (Cancel diameter comp.) G49 (Cancel length comp.) code_end = M2 (Prgram end)
This is code which will be written at the very begin and end of the exported file.
[Number_Format] pre_decimals = 4 post_decimals = 3 decimal_seperator = . pre_decimal_zero_padding = False post_decimal_zero_padding = True signed_values = False
This is the section which enables the user to change the formatting of the eported numbers. This example has a fixed length for the numbers: e.g. ' 100.000' ' 10.000' ' 1.000'
[Line_Numbers] use_line_nrs = False line_nrs_begin = 10 line_nrs_step = 10
Enables the user to have lines numbers for the exported G-Code.
[Program] tool_change = T%tool_nr M6%nlS%speed%nl feed_change = F%feed%nl rap_pos_plane = G0 X%XE Y%YE%nl rap_pos_depth = G0 Z%ZE %nl lin_mov_plane = G1 X%XE Y%YE%nl lin_mov_depth = G1 Z%ZE%nl arc_int_cw = G2 X%XE Y%YE I%I J%J%nl arc_int_ccw = G3 X%XE Y%YE I%I J%J%nl cutter_comp_off = G40%nl cutter_comp_left = G41%nl cutter_comp_right = G42%nl pre_shape_cut = M3 M8%nl post_shape_cut = M9 M5%nl comment = %nl(%comment)%nl
This section gives the format how different actions of the export have to be interpreted. These actions will be done for each export of a shape, line, arc, tool change, feed change etc.
The following section gives the possible key words which may be used in the actions explained above.
"%feed"
The feed rate used
"%speed"
The tool speed used
"%tool_nr"
The tool Nr.used
"%nl"
New line to be included
"%XE"
The X position at the end
"%-XE"
The negative X position at the end
"%XS"
The X position at the begin
"%-XE"
The negative X position at the end
"%YE"
The Y position at the end
"%-YE"
The negative Y position at the end
"%YS"
The Y position at the begin
"%-YS"
The negative Y position at the end
"%ZE"
The Z position at the end
"%-ZE"
The negative Z position at the end
"%I"
The distance between Start and Centre in X
"%-I"
The neg. dis. between Start and Centre in X
"%J"
The distance between Start and Centre in Y
"%-J"
The neg. dis. between Start and Centre in Y
"%XO"
The X Centre of an Arc
"%-XO"
The negative X Centre of an Arc
"%YO"
The Y Centre of an Arc
"%-YO"
The negative Y Centre of an Arc
"%R"
The radius of an Arc
"%AngS"
The starting angle of an Arc in deg.
"%-AngS"
The negative starting angle of an Arc in deg.
"%AngE"
The end angle of an Arc in deg.
"%-AngE"
The negative end angle of an Arc in deg.
"%ext"
The positiv extend angle of an Arc in deg.
"%-ext"
The negative extend angle of an Arc in deg.
"%comment"
The given comment in the code
[Postprocessor-Example China Laser Cutter] Example configuration for laser cutter
[Postprocessor-Example Python] Example configuration of export to python classes
[Postprocessor-Example Styrofoam] Example configuration of styrofoam cutters
[Postprocessor-Example Lathe] Example configuration of a lathe
This is a configuration that will ignore the Z-Axis and turn "the spindle" (i.e. the heat of the hot wire) on before any movement and turn turn it off right before the end of the program. You will find it in a seperate Wiki Page.
For using different Axis just replace the leading letters. e.g. replace axes Y by Z:
rap_pos_plane = G0 X%XE Y%YE%nl rap_pos_plane = G0 X%XE Z%YE%nl
For using radius instead of incremental I and J Axis distance to center of radius use the following:
arc_int_cw = G2 X%XE Y%YE R%R%nl arc_int_ccw = G3 X%XE Y%YE R%R%nl
In order to remove all the comments at the begin of the code you need to change the output format to dxf type.
[General] output_type = dxf
All other comments in between the code can be removed by an option in the Program section.
[Program] comment = ""
if you want to reverse the axis just put an addition negative sign there in the Postprocessor:
You need to do it on all positions where you find X and I values if you want to switch the X axis only. If you want to do it for the Y Axis do it for Y and J also. Therefor you need to change the followowing 4 lines to the following:
[Program] rap_pos_plane = G0 X%-XE Y%-YE%nl lin_mov_plane = G1 X%-XE Y%-YE%nl arc_int_cw = G2 X%-XE Y%-YE I%-I J%-J%nl arc_int_ccw = G3 X%-XE Y%-YE I%-I J%-J%nl
This may be required if you want to use DXF2GCODE to generate code for Laser cutting or styrofoam cutting. You can do the change in the GUI or also in the postprocessor file itself. Both ways are explained below
You will find it in the postroprocessor configuration Graphical User Interface (GUI) in the left list >>G-code codes
Here you can see how it should look like in the GUI.
Within the configuration files its in the [Program] - Section
The following two lines / parameters needs to be changed
[Program] # This will be done between each shape to cut. rap_pos_depth = G0 Z%ZE %nl # This will be used for shape cutting. lin_mov_depth = G1 Z%ZE%nl
Just remove all the content of the line and you will not have anything in the outputed g-code.
[Program] # This will be done between each shape to cut. rap_pos_depth = # This will be used for shape cutting. lin_mov_depth =
Wiki: Home
Wiki: Postprocessor-Example China Laser Cutter
Wiki: Postprocessor-Example Lathe
Wiki: Postprocessor-Example Python
Wiki: Postprocessor-Example Styrofoam
Feel free to comment here.
Nice tool.
Linux CNC (EMC2) need O{number} in front of the IF command in the G-Code.
I use a Plasma-Cutter. This need the spindle start after positioning the Z axis in the workposition and spindle stop before retraction Z axis.
Temporary I solve the problem with the following in "Linear feed move for Z plane":
This generates the code:
At the start:
I removed M3 in "Placed in front of any shape".
And add M5 in "Rapid positioning for Z plane":
Maybe someone knows a better solution.
Last edit: spicer 2019-02-17