fix kiri engine cam var settings
This commit is contained in:
parent
10a107e518
commit
fcba17c428
3 changed files with 15 additions and 5 deletions
|
|
@ -371,7 +371,7 @@ CAM.export = function(print, online) {
|
|||
append(`; Generated by Kiri:Moto ${kiri.version}`);
|
||||
append(`; ${new Date().toString()}`);
|
||||
filterEmit(["; Bed left:{left} right:{right} top:{top} bottom:{bottom}"], consts);
|
||||
append(`; Stock X:${stock.x.round(2)} Y:${stock.y.round(2)} Z:${stock.z.round(2)}`);
|
||||
append(`; Stock X:${stock.x?.round(2)} Y:${stock.y?.round(2)} Z:${stock.z?.round(2)}`);
|
||||
append(`; Target: ${settings.filter[settings.mode]}`);
|
||||
append("; --- process ---");
|
||||
for (let pk in spro) {
|
||||
|
|
|
|||
|
|
@ -79,12 +79,12 @@ function prepEach(widget, settings, print, firstPoint, update) {
|
|||
bounds = widget.getBoundingBox(),
|
||||
boundsz = isIndexed ? stock.z / 2 : bounds.max.z + ztOff,
|
||||
zadd = !isIndexed ? stock.z - boundsz : alignTop ? outerz - boundsz : 0,
|
||||
zmax = outerz + zclear + process.camOriginOffZ,
|
||||
zmax = outerz + zclear + (process.camOriginOffZ || 0),
|
||||
wmpos = widget.track.pos,
|
||||
wmx = wmpos.x,
|
||||
wmy = wmpos.y,
|
||||
originx = (startCenter ? 0 : -stock.x / 2) + process.camOriginOffX,
|
||||
originy = (startCenter ? 0 : -stock.y / 2) + process.camOriginOffY,
|
||||
originx = (startCenter ? 0 : -stock.x / 2) + (process.camOriginOffX || 0),
|
||||
originy = (startCenter ? 0 : -stock.y / 2) + (process.camOriginOffY || 0),
|
||||
origin = newPoint(originx + wmx, originy + wmy, zmax),
|
||||
output = print.output,
|
||||
easeDown = process.camEaseDown,
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@
|
|||
// dep: kiri.client
|
||||
// dep: kiri.widget
|
||||
// use: add.three
|
||||
// use: add.array
|
||||
gapp.register("kiri-run.engine", [], (root, exports) => {
|
||||
|
||||
const { kiri } = root;
|
||||
|
|
@ -105,10 +106,19 @@ class Engine {
|
|||
}
|
||||
|
||||
setStock(stock) {
|
||||
this.settings.stock = stock;
|
||||
let { settings } = this;
|
||||
let { process } = settings;
|
||||
settings.stock = stock;
|
||||
process.camStockX = stock.x;
|
||||
process.camStockY = stock.y;
|
||||
process.camStockZ = stock.z;
|
||||
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);
|
||||
|
|
|
|||
Loading…
Reference in a new issue