go-gcode

module
v0.0.0-...-0bf14c3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 31, 2026 License: Apache-2.0

README

go-gcode

go-gcode is an experimental fun project to generate G-Code for CNC machines and 3D printers, written in Go.

It is loosely based on Mecode and gcmc.

Make sure to check out gocnc which should be able to interpret the G-Code generated by this package.

Status

This project is just getting started but is usable to generate G-Code for controlling your CNC machine.

Usage

The easiest way to use this package is to use a "dot import" to bring all the GCode functions into your main program's namespace, then call the functions as if you were drawing each segment.

package main

import (
  "fmt"

  . "github.com/gmlewis/go-gcode/gcode"
)

func main() {
  g := New()
  g.GotoXYZ(XYZ(0,0,0))
  g.MoveX(X(1))
  fmt.Printf("%v", g)
}

Examples

See the examples directory for some examples.

To run all the demos at once, type:

$ ./run-examples.sh

Enjoy!


License

Copyright 2021 Glenn M. Lewis. All Rights Reserved.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Directories

Path Synopsis
examples
ball-in-cube command
ball-in-cube generates a design based on the example here: https://gitlab.com/gcmc/gcmc/blob/master/example/ball-in-cube.gcmc
ball-in-cube generates a design based on the example here: https://gitlab.com/gcmc/gcmc/blob/master/example/ball-in-cube.gcmc
bezier command
bezier generates a design based on the example here: https://gitlab.com/gcmc/gcmc/blob/master/example/bezier.gcmc
bezier generates a design based on the example here: https://gitlab.com/gcmc/gcmc/blob/master/example/bezier.gcmc
canned command
canned generates a design based on the example here: https://gitlab.com/gcmc/gcmc/blob/master/example/canned.gcmc
canned generates a design based on the example here: https://gitlab.com/gcmc/gcmc/blob/master/example/canned.gcmc
cc-hole command
cc-hole generates a design based on the example here: https://gitlab.com/gcmc/gcmc/blob/master/example/cc_hole.gcmc
cc-hole generates a design based on the example here: https://gitlab.com/gcmc/gcmc/blob/master/example/cc_hole.gcmc
colors command
colors generates a design based on the example here: https://gitlab.com/gcmc/gcmc/blob/master/example/colors.gcmc
colors generates a design based on the example here: https://gitlab.com/gcmc/gcmc/blob/master/example/colors.gcmc
cutter command
cutter generates a design based on the example here: https://gitlab.com/gcmc/gcmc/blob/master/example/cutter.gcmc
cutter generates a design based on the example here: https://gitlab.com/gcmc/gcmc/blob/master/example/cutter.gcmc
cycloids command
cycloids generates a design based on the example here: https://gitlab.com/gcmc/gcmc/blob/master/example/cycloids.gcmc
cycloids generates a design based on the example here: https://gitlab.com/gcmc/gcmc/blob/master/example/cycloids.gcmc
edm-pro-box command
edm-pro-box generates a design based on the example here: https://gitlab.com/gcmc/gcmc/blob/master/example/edm-pro-box.gcmc
edm-pro-box generates a design based on the example here: https://gitlab.com/gcmc/gcmc/blob/master/example/edm-pro-box.gcmc
floret-vodel command
floret-vogel generates a design based on the example here: https://gitlab.com/gcmc/gcmc/blob/master/example/floret-vogel.gcmc
floret-vogel generates a design based on the example here: https://gitlab.com/gcmc/gcmc/blob/master/example/floret-vogel.gcmc
involute-gear command
involute-gear generates two gears and is based on the example here: https://gitlab.com/gcmc/gcmc/blob/master/example/involute-gear.gcmc
involute-gear generates two gears and is based on the example here: https://gitlab.com/gcmc/gcmc/blob/master/example/involute-gear.gcmc
ivi-simple-circle command
ivi-simple-circle generates a simple design to cut a hole on the IVI Closed-Loop 3D Printer/CNC/Laser-Engraver: https://ivi3d.com
ivi-simple-circle generates a simple design to cut a hole on the IVI Closed-Loop 3D Printer/CNC/Laser-Engraver: https://ivi3d.com
ivi-spool-cut command
ivi-spool-cut generates a simple design to cut two slits in a spool on the IVI Closed-Loop 3D Printer/CNC/Laser-Engraver: https://ivi3d.com
ivi-spool-cut generates a simple design to cut two slits in a spool on the IVI Closed-Loop 3D Printer/CNC/Laser-Engraver: https://ivi3d.com
text-fonts command
text-fonts generates a design based on the example here: https://gitlab.com/gcmc/gcmc/blob/master/example/text-fonts.gcmc
text-fonts generates a design based on the example here: https://gitlab.com/gcmc/gcmc/blob/master/example/text-fonts.gcmc
text-on-circle command
text-on-circle generates text and is based on the example here: https://gitlab.com/gcmc/gcmc/blob/master/example/text-on-circle.gcmc
text-on-circle generates text and is based on the example here: https://gitlab.com/gcmc/gcmc/blob/master/example/text-on-circle.gcmc
tool-compensate command
tool-compensate generates a design based on the example here: https://gitlab.com/gcmc/gcmc/blob/master/example/tool-compensate.gcmc
tool-compensate generates a design based on the example here: https://gitlab.com/gcmc/gcmc/blob/master/example/tool-compensate.gcmc
trochoidal command
trochoidal generates a design based on the example here: https://gitlab.com/gcmc/gcmc/blob/master/example/trochoidal.gcmc
trochoidal generates a design based on the example here: https://gitlab.com/gcmc/gcmc/blob/master/example/trochoidal.gcmc
varcs command
varcs generates vectorized arcs and is based on the example here: https://gitlab.com/gcmc/gcmc/blob/master/example/varcs.gcmc
varcs generates vectorized arcs and is based on the example here: https://gitlab.com/gcmc/gcmc/blob/master/example/varcs.gcmc
wheels command
wheels generates wheel paths and is based on the example here: https://gitlab.com/gcmc/gcmc/blob/master/example/wheels.gcmc
wheels generates wheel paths and is based on the example here: https://gitlab.com/gcmc/gcmc/blob/master/example/wheels.gcmc
Package gcode provides methods used to generate G-Code.
Package gcode provides methods used to generate G-Code.
Package utils implements several helpful methods.
Package utils implements several helpful methods.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL