Documentation
¶
Overview ¶
Package gcoder builds up g-code step sequences, referred to as an Image. The package includes native support for the Snapmaker A350 3-in-1 system (Laser, CNC, 3D printer).
Index ¶
- Variables
- func MakeRGBA(g *Image, width, height int) (*image.RGBA, error)
- type BBox
- type Bound
- type Command
- type HeadType
- type Image
- func (im *Image) A350CNC(wr io.Writer, pngImage []byte) error
- func (im *Image) A350Laser(ht HeadType, wr io.Writer, pngImage []byte) error
- func (im *Image) BBox() *BBox
- func (im *Image) Drill(dz float64, power float64) error
- func (im *Image) LineXY(x, y, power float64) error
- func (im *Image) MoveXY(x, y float64) error
- func (im *Image) Note(note string)
- func (im *Image) Plot(plotter Plotter) error
- func (im *Image) Raise(dz float64) error
- func (im *Image) SetOrigin() error
- func (im *Image) SetSpeed(active bool, speed int)
- type Plotter
- type Step
Constants ¶
This section is empty.
Variables ¶
var ( ErrInvalidTool = errors.New("invalid tool selection") ErrInvalidPower = errors.New("invalid tool power") )
ErrInvalidTool etc are the error return values for the gcoder package.
var LaserWattage = map[string]HeadType{ "1.6": Laser1pt6W, "2": Laser2W, "10": Laser10W, }
var LaserWidth = map[HeadType]float64{ Laser1pt6W: 0.1, Laser2W: 0.01, Laser10W: 0.1, }
LaserWidth is the mm width of the laser beam.
var ToolName = map[HeadType]string{ Laser1pt6W: "levelOneLaserToolheadForSM2", Laser2W: "2W Laser Module", Laser10W: "levelTwoLaserToolheadForSM2", }
var ToolType = map[HeadType]string{ Laser1pt6W: "laser", Laser2W: "laser", Laser10W: "laser", }
Functions ¶
Types ¶
type Image ¶
Image holds a series of (*Step) values.
func (*Image) A350CNC ¶
A350CNC writes the gcode formatted for a Snapmaker 2 A350 standard CNC head. The work origin is an important feature, as all X,Y moves are absolute.
func (*Image) A350Laser ¶
A350Laser writes the gcode formatted for a Snapmaker 2 A350 level one laser tool head.
func (*Image) Drill ¶
Drill increases the relative Z value while drawing. To lower while drilling provide a negative value for dz.
func (*Image) MoveXY ¶
MoveXY relocates the tool head to a specific location. This move is accomplished without the tool being active.