fixes to allow cam processing with engine.html
This commit is contained in:
parent
f41db779fc
commit
7ea9f2a7ef
4 changed files with 30 additions and 4 deletions
|
|
@ -82,6 +82,21 @@ class Engine {
|
|||
return this;
|
||||
}
|
||||
|
||||
setTools(tools) {
|
||||
this.settings.tools = tools;
|
||||
return this;
|
||||
}
|
||||
|
||||
setStock(stock) {
|
||||
this.settings.stock = stock;
|
||||
return this;
|
||||
}
|
||||
|
||||
setOrigin(x,y,z) {
|
||||
this.settings.origin = { x, y, z };
|
||||
return this;
|
||||
}
|
||||
|
||||
moveTo(x, y, z) {
|
||||
this.widget.move(x, y, z, true);
|
||||
return this;
|
||||
|
|
|
|||
|
|
@ -761,6 +761,16 @@ console.log/** Copyright Stewart Allen <sa@grid.space> -- All Rights Reserved */
|
|||
return this.bounds;
|
||||
};
|
||||
|
||||
PRO.getPositionBox = function() {
|
||||
let bounds = this.getBoundingBox().clone();
|
||||
let pos = this.track.pos;
|
||||
bounds.min.x += pos.x;
|
||||
bounds.max.x += pos.x;
|
||||
bounds.min.y += pos.y;
|
||||
bounds.max.y += pos.y;
|
||||
return bounds;
|
||||
};
|
||||
|
||||
PRO.isModified = function() {
|
||||
return this.modified;
|
||||
};
|
||||
|
|
|
|||
|
|
@ -29,6 +29,7 @@
|
|||
settings = print.settings,
|
||||
device = settings.device,
|
||||
gcodes = settings.device || {},
|
||||
origin = settings.origin || { x: 0, y: 0, z: 0 },
|
||||
tools = settings.tools,
|
||||
space = gcodes.gcodeSpace ? ' ' : '',
|
||||
isRML = device.gcodeFExt.toLowerCase() === 'rml',
|
||||
|
|
@ -57,8 +58,8 @@
|
|||
min: { x:Infinity, y:Infinity, z:Infinity}
|
||||
},
|
||||
offset = {
|
||||
x: -settings.origin.x,
|
||||
y: settings.origin.y
|
||||
x: -origin.x,
|
||||
y: origin.y
|
||||
},
|
||||
consts = {
|
||||
tool: 0,
|
||||
|
|
|
|||
|
|
@ -54,8 +54,8 @@
|
|||
|
||||
let device = settings.device,
|
||||
process = settings.process,
|
||||
stock = settings.stock,
|
||||
outer = settings.bounds,
|
||||
stock = settings.stock || {},
|
||||
outer = settings.bounds || widget.getPositionBox(),
|
||||
outerz = outer.max.z,
|
||||
slices = widget.slices,
|
||||
hasStock = stock.x && stock.y && stock.z && process.camStockOn,
|
||||
|
|
|
|||
Loading…
Reference in a new issue