Plotter code
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

55 lines
1.2 KiB

package cfg
import "math"
// CFG returns the configuration
func CFG() Config {
cfg := Config{
CircleResolution: 30,
MachineWidth: 1225,
MachineHeight: 800,
MachineMmPerRev: 37.7,
MachineStepsPerRev: 200,
MachineMotorAccel: 400,
MachineMotorSpeed: 800,
MachineStepMultiplier: 1,
DrawingArea: Area{
TopLeft: Point{X: 400, Y: 250},
BottomRight: Point{X: 800, Y: 500},
Home: Point{X: 612.44, Y: 217.61},
},
}
cfg.DrawingArea.Width = math.Abs(cfg.DrawingArea.BottomRight.X - cfg.DrawingArea.TopLeft.X)
cfg.DrawingArea.Height = math.Abs(cfg.DrawingArea.BottomRight.Y - cfg.DrawingArea.TopLeft.Y)
return cfg
}
// Point ...
type Point struct {
X float64
Y float64
}
// Area ...
type Area struct {
Home Point
TopLeft Point
BottomRight Point
Width float64
Height float64
}
// Config ...
type Config struct {
DrawingArea Area
MachineWidth float64
MachineHeight float64
MachineMmPerRev float64
MachineStepsPerRev float64
MachineMotorSpeed float64
MachineMotorAccel float64
MachineStepMultiplier float64
CircleResolution float64
}