Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions src/job_engine/core/gcode.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
globalThis.Gcode = class Gcode{
static print_gcode_line_when_run = true
static scale = .001 //units are mm, convert to meters
static offset = [0,100,80] //xyz offset in mm

static state = {
Y_offset: 0.1,
X: 0,
Expand Down Expand Up @@ -64,8 +67,11 @@ globalThis.Gcode = class Gcode{
let y_pos = this.state.Y
y_pos += this.state.Y_offset
if(y_pos === 0) { y_pos = 1e-10 }//to avoid singularity
let xyz = [this.state.X, y_pos, this.state.Z]

let xyz = [
( this.state.X + this.offset[0] ) * this.scale,
( y_pos + this.offset[1] ) * this.scale,
( this.state.Z + this.offset[2] ) * this.scale
]
return [ function() { Gcode.extrude()},
Dexter.move_to(xyz)
]
Expand Down