mjolnir

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Aug 27, 2023 License: Unlicense Imports: 9 Imported by: 0

Documentation

Overview

package mjolnir implements a driver for the MarkingWay engraving machine.

Index

Constants

View Source
const (
	// StrokeWidth in millimeters.
	StrokeWidth = 0.3
	// Step is the step distance in millimeters per machine unit.
	Step = 0.00796
	// Millimeters is machine units per millimeter.
	Millimeter = 1 / Step
)

Variables

View Source
var ErrCancelled = errors.New("cancelled")

Functions

func Engrave

func Engrave(dev io.ReadWriter, prog *Program, progress chan float32, quit <-chan struct{}) (eerr error)

func Open

func Open(dev string) (io.ReadWriteCloser, error)

Types

type Cmd

type Cmd struct {
	Type CmdType
	X, Y uint32
}

type CmdType

type CmdType int
const (
	MoveTo CmdType = iota
	LineTo
)

type Program

type Program struct {
	DryRun     bool
	MoveSpeed  float32
	PrintSpeed float32
	End        image.Point
	// contains filtered or unexported fields
}

func (*Program) Line

func (p *Program) Line(to image.Point)

func (*Program) Move

func (p *Program) Move(to image.Point)

func (*Program) Prepare

func (p *Program) Prepare()

type Simulator

type Simulator struct {
	Cmds []Cmd
	// contains filtered or unexported fields
}

func NewSimulator

func NewSimulator() *Simulator

func (*Simulator) Close

func (s *Simulator) Close() error

func (*Simulator) Read

func (s *Simulator) Read(data []byte) (int, error)

func (*Simulator) Write

func (s *Simulator) Write(data []byte) (int, error)

Jump to

Keyboard shortcuts

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