gcmc - G-Code Meta Compiler
IntroductionGcmc is a front-end language for generating G-code, SVG and DXF for CNC mills, lathes, laser cutters and other numerical controlled machines employing G-code, SVG or DXF. The language is a context-free grammar created to overcome the archaic format of G-code programming and aims to be more readable and understandable. Gcmc makes extensive use of vector mathematics to support the 3D nature of CNC machining.
An introduction document is available. The introduction goes through basic syntax and program outline and describes an example to create involute gears in under 200 lines of code (under 100 lines when excluding source code comments).
Getting and building gcmcYou can get the source from the link below. The windows executable is a 32bit MinGW cross-compiled command-line version.
Please note: the git repository has been moved from gitorious.org to gitlab.com. You should rebase your local repository if you have cloned it.
Older sources are available and a SHA1 sum and/or SHA256 sum may be used to verify the archives.
Building from source is straight forward and should function on Linux, *BSD, MinGW/MSYS and Cygwin:
$ tar xzf gcmc-1.7.0.tar.gz
$ cd gcmc-1.7.0
After 'make' you should have an executable in the 'src' directory named 'gcmc'. For a MinGW cross-compile you should use 'configure --host i686-w64-mingw32' or whatever your cross-target-host specifier is and it should result in 'gcmc.exe'.
Running gcmcRunning gcmc, assuming you are in the src directory, is as simple as:
$ ./gcmc -o output.ngc input.gcmc
This will convert the input file "input.gcmc" into a G-code file "output.ngc". The output is written to stdout if no -o option is given. Stdin is used if no input file is given.
You may compile and inspect the examples by running (from the top or the example directory):
$ make examples
This will give you G-code, SVG and DXF versions of the examples, which can be inspected with the appropriate programs.
The gcmc man-page gives you a complete summary of all option.
gcmc-1.7.0 - 2015-07-02
gcmc-1.6.0 - 2015-05-14
Bugs reports and feature requestsPlease report any bugs you may encounter to gcmc _at_ vagrearg.org. Please include an example that triggers the bug.
If you want more/extra/different features included, then write me an email with the request and a description what you want to add and want to achieve with the change or addition.
Gcmc examples and screenshots(click on images to enlarge)
Text fonts (source: text-fonts.gcmc)
Text on a circle path (source: text-on-circle.gcmc)
Involute gears (sources: involute-gear.gcmc and involute-gear.inc.gcmc)
Cycloids (source: cycloids.gcmc)
Ball-in-a-Cube (source: ball-in-cube.gcmc)
Continuous curvature pocketing (sources: cc_hole.gcmc and cc_hole.inc.gcmc)
Sunflower floret arrangement of 500 holes (source: floret-vogel.gcmc)
Rapid path is about 55.5 meters without sorting the individual holes:
Sorting the holes with a simple nearest neighbor algorithm shortens the rapid path to about 4.1 meters:
Using a bin-sorting algorithm shortens the rapid path to about 3.7 meters using 20 bins:
Tool-size compensation of an open or closed path on either left or right side (source: tool-compensate.gcmc)
High-speed milling using trochoidal movement (source: trochoidal.gcmc)
|Overengineering @ request||Prutsen & Pielen since 1982|