linuxcnc python 简单的图形界面

Simple EMC G-Code Generators Written in Python

1. Drilling Speeds-n-Feeds
2. Arc Buddy
3. Facing Software
4. Bolt Circle Array Software
5. Counterbore Software
6. Grill Drilling Software
7. Bezel Engraving Software
8. Text Engraving Software
9. Pycam - Drop Cutter Surfacing Software
10. Dxf2gcode - import a 2D DXF file and produce G-code
11. Rectangulare-Circulare Pocketing Generator
12. Grid Rectangular Circular SpiderNet G-code Generator
13. Other G Code Generators
14. Using Python scripts with Axis
15. Using Python scripts with Windows
16. Using Python scripts online
17. mGcodeGenerator
From the official Python web site "Python is a dynamic object-oriented programming language that can be used for many kinds of software development." Python is powerful,open source, cross platform compatible and easy to learn and use. It has become one of the favorite languages of the EMC development group. A tutorial for Python can be found here

This page contains links to Python scrips that generate simple G-Codes for EMC. For me to fire up a high dollar CAD program and the use the POST processor to generate simple routines is a time waster. So I'm writing a series of Python programs to do this. If you did an EMC install with Ubuntu you are good to go you have all you need. Make sure you make the mods to your ini file so you can open these up from Axis and paste the generated code directly into Axis... as shown at the bottom of the page.

The programs will do Facing, Pockets, Slots, Drill Patterns etc. When they are all finished I'll package them all up into one.

1. Drilling Speeds-n-Feeds

This one helps you to calculate the speeds and feeds for drilling
upload:Drill00.png Version 0.1
Some interesting reading on chip loading upload:Chip%20Load%20on%20Drills.odt
2. Arc Buddy

This one takes the center of an arc, the diameter, the start and end angle and spits out the G-Code
The start point for the arc and the G2/3 code for the arc are generated.
There might be a couple of bugs left in the code. If you find one e-mail me and I'll fix it.
upload:Arc%20Buddy.odt A very short tutorial on Arc Buddy
upload:Arc%20Tutorial%202.odt A more advanced tutorial on making arcs.
upload:Arcbuddy12.png Version 1.1
This is a slightly different version of Arc Buddy that was modified by Sebastian Jardi Estadella for use in gEdit to insert the gcodes. The instructions for use with gEdit are in the comments section.

3. Facing Software

The facing software is super simple. You input a few things and press a button and your code is saved to your NC directory ready to open in EMC2! Version 1.3.4 Last Updated on Jan 6, 2010 License is GNU license.
for windows users download and rename to face-134.pyw, download and install python2.4 [from]
Lead-in, lead-out value can now be changed - version 1.3.4
Now has a radio button to set the X0-Y0 (Home) position: Left-Rear or Left-Front - version 1.3.3b
To change the default, see the comments in the file
Now has a radio button for Inch/MM Version 1.3.2
Now accepts fractions in any field where this is appropriate. Version 1.3.1
One step file save after setting the NC File Directory Option.
Vertical Scroll Bar added to text box.
Added Spindle Speed setting that automaticly adds M2 and M5 if you specify a value
Can leave Depth of Cut, Spindle Speed and Stepover blank.
Added a menu!
NC File Directory is saved to an .ini file!
If you open in Axis you can directly save the g code to Axis!!!
Undocumented Features
Assumes that the top of the material is Z0 and nothing is above Z0
4. Bolt Circle Array Software
This program generates a circular array for canned drill cycles in a mill (ie 'bolt circle'). This program used as a template, so it looks very similar. Some of the entry widgets have predefined values in them. Look carefully at these before pressing the 'Generate G-code' button (-Dan Falck).
5. Counterbore Software
Version 1.3.1
This software generates the G-code for counterbores for socket head cap screws.
If you have any comments just e mail me Big John T.
Pick a SHCS from one of the three lists and it puts the standard diameter and depth in for you.
Minimum entrys needed are hole diameter/depth, tool diameter and location of the hole.
M2 end of file option if you have to generate several size holes only use it on the last hole.
Editing of X & Y list with mouse clicks on item. Maintains order if one is edited and put back.
Speedy entry using number key pad and the key pad enter key for locations.
At this time there is a bug if you have a path that does not require a spiral... working on it

6. Grill Drilling Software

Version 1.3
Version 1.2
This software peck drills a circular array of holes typically used as a speaker grill or
as ventilation holes in a chassis panel.
Can drill circular, elliptical, rectangular or oval shaped arrays of holes
Usable as an axis filter program (see below)
Gcode can be copied to the clipboard for easy insertion into other gcode programs

7. Bezel Engraving Software
Version 1.1
This software engraves a bezel like you would see on the front panel of a stereo around the volume control knobs.
adjustable number of minor and major ticks
adjustable start and stop positions
center position is marked with a dot for later drilling operations
usable as an axis filter program (see below)
gcode can be copied to the clipboard for easy insertion into other gcode programs
use of variables for center point and Z values for easy code block reuse

8. Text Engraving Software Version 1.2
upload:cxf-fonts.tgz Old format cxf fonts
This software engraves a text string.
uses Qcad font files (nice stroked font definitions)
NOTE: As of 12Sept2014 this version of engrave only knows how to parse Version 1 .cxf font files.
You can open the font file with a text editor and look at line 3 to see if the font file is compatible.
Also, if you see the font path highlighted in RED, you probably do not have a correct path to a .cxf font file.
You will need to obtain .cxf font files from the link above or use the ones from the qcad V2 package (Qcad V3 fonts do NOT parse properly)
supports flipped(about x axis) or mirrored(about y axis) text
mirrored text is useful for back cutting on Plexiglas panels
usable as an axis filter program (see below)
independent X and Y scaling so the look of a font can be modified
adjustable character and word spacing
string can be plotted at any arbitrary angle
gcode can be copied to the clipboard for easy insertion into other gcode programs
use of gcode variables for start point, scaling, rotation and Z values for easy code block reuse or tweaking
Version 1.2 adds variable for linear arc conversion precision

9. Pycam - Drop Cutter Surfacing Software


A GPL 3D CNC Toolpath Generation program written by Lode Leroy
Requires python, pyopengl, and togl to run under linux
Download from here:
10. Dxf2gcode - import a 2D DXF file and produce G-code


Written by Christian Kohloeffel.

Url translated to English by Google:|en&u=
Original URL:

Download from here: old dead url(
This program seems to work pretty well with DXF files from QCAD.

11. Rectangulare-Circulare Pocketing Generator

This is for Generating simple Pocket Style Toolpathes with Differnt depth/stepover
Version 1 does only support Zero Path but you can simply edit the final path to G41 new spiral depth mode (04 2011)
Screenshot :
Written by Sammel Lothar Germany
12. Grid Rectangular Circular SpiderNet? G-code Generator

This wars written to test the speed and the acurathy of a milling mashine,
  with the grid alot of moves are taken and you can see the accurate by,
  checking Zero Border on the grid if it not harming the outside Shape!
  Now all shapes and functions are includet Aug_2010!
Written by Sammel Lothar Germany
13. Other G Code Generators CP1 is a conversational machining program written by Ray Henry and Matt Shaver with additional MOP's by Lawrence Glaister. A TrueType? tracer with DXF and G-Code output
14. Using Python scripts with Axis

To download a file right click on it and select "Save link as"
Do the following...

Place the .py files in your nc directory so it is easy to find
Right click on the .py file in your file browser and select Properties. On the Permissions tab check Execute on the Owner line.
Add the following lines to the [FILTER] section of the Axis ini file
PROGRAM_EXTENSION = .py Python Script
py = python
If you don't have a [FILTER] section just add it
Now use File Open in AXIS to open and after you generate the g-code select Write to AXIS and Quit
15. Using Python scripts with Windows

Rename the file from .py to .pyw
Download and install the python program
16. Using Python scripts online

upload:online_python.png Here are some python generators that can be used from emc and online too. They are simple, but you can easily make new ones for yourself... using the hugomatic library, that abstracts the user interface. This is beta software, so please provide feedback.
17. mGcodeGenerator

It is a script for Blender. It can generate gcode ideal for emc^2 :) it export from mesh ( vertex / edge / edges (outlines) / objects ) to 2d, 2.5d and full 3d for (3axis mill).
LinuxCNCKnowledgeBase | RecentChanges | PageIndex | Preferences |
This page is read-only. Follow the BasicSteps to edit pages. | View other revisions
Last edited September 14, 2014 6:50 pm by LawrenceG (diff)
Search: Published under a Creative Commons License

想对作者说点什么? 我来说一句


2015年12月09日 348KB 下载



linuxcnc python 简单的图形界面