stock is now always on in CAM mode
This commit is contained in:
parent
8580307661
commit
6c67c93988
10 changed files with 40 additions and 50 deletions
|
|
@ -366,7 +366,7 @@ kiri.load(() => {
|
|||
const { process } = settings;
|
||||
const print = worker.print;
|
||||
const density = parseInt(settings.controller.animesh) * 1000;
|
||||
const isIndexed = process.camStockOn && process.camStockIndexed;
|
||||
const isIndexed = process.camStockIndexed;
|
||||
|
||||
pathIndex = 0;
|
||||
path = print.output.flat();
|
||||
|
|
|
|||
|
|
@ -66,8 +66,8 @@ CAM.init = function(kiri, api) {
|
|||
API = api;
|
||||
|
||||
function updateAxisMode(refresh) {
|
||||
const { camStockIndexGrid, camStockIndexed, camStockOn } = current.process;
|
||||
let newIndexed = camStockIndexed && camStockOn;
|
||||
const { camStockIndexGrid, camStockIndexed } = current.process;
|
||||
let newIndexed = camStockIndexed;
|
||||
let changed = refresh || isIndexed !== newIndexed;
|
||||
isIndexed = newIndexed;
|
||||
if (!isIndexed || !isCamMode) {
|
||||
|
|
@ -94,7 +94,7 @@ CAM.init = function(kiri, api) {
|
|||
return;
|
||||
}
|
||||
for (let widget of api.widgets.all()) {
|
||||
widget.setIndexed(camStock && isIndexed ? true : false);
|
||||
widget.setIndexed(isIndexed ? true : false);
|
||||
}
|
||||
api.platform.update_bounds();
|
||||
// add or remove clock op depending on indexing
|
||||
|
|
@ -116,7 +116,7 @@ CAM.init = function(kiri, api) {
|
|||
api.event.on("widget.add", widget => {
|
||||
if (isCamMode && !Array.isArray(widget)) {
|
||||
updateAxisMode(true);
|
||||
widget.setIndexed(camStock && isIndexed ? true : false);
|
||||
widget.setIndexed(isIndexed ? true : false);
|
||||
api.platform.update_bounds();
|
||||
}
|
||||
});
|
||||
|
|
@ -126,11 +126,8 @@ CAM.init = function(kiri, api) {
|
|||
if (isAnimate) {
|
||||
return;
|
||||
}
|
||||
if (isCamMode && !camStock) {
|
||||
return api.show.alert("animation requires stock to be enabled");
|
||||
}
|
||||
api.function.prepare(() => {
|
||||
if (isCamMode && camStock) {
|
||||
if (isCamMode) {
|
||||
animate();
|
||||
}
|
||||
});
|
||||
|
|
@ -193,7 +190,6 @@ CAM.init = function(kiri, api) {
|
|||
}
|
||||
// show/hide dots in enabled process pop buttons
|
||||
api.ui.camTabs.marker.style.display = hasTabs ? 'flex' : 'none';
|
||||
api.ui.camStock.marker.style.display = proc.camStockOn ? 'flex' : 'none';
|
||||
api.platform.update_bounds();
|
||||
updateIndex();
|
||||
updateStock();
|
||||
|
|
@ -1653,8 +1649,8 @@ function createTabBox(iw, ic, n) {
|
|||
const { track } = iw;
|
||||
const { stock, bounds, process } = API.conf.get();
|
||||
const { camTabsWidth, camTabsHeight, camTabsDepth, camTabsMidline } = process;
|
||||
const { camZBottom, camStockOn, camStockIndexed } = process;
|
||||
const isIndexed = camStockOn && camStockIndexed;
|
||||
const { camZBottom, camStockIndexed } = process;
|
||||
const isIndexed = camStockIndexed;
|
||||
const sz = stock.z || bounds.max.z;
|
||||
const zto = sz - iw.track.top;
|
||||
const zp = (camZBottom || isIndexed ? camZBottom : sz - track.box.d - zto) + (camTabsMidline ? 0 : camTabsHeight / 2);
|
||||
|
|
|
|||
|
|
@ -60,10 +60,9 @@ CAM.export = function(print, online) {
|
|||
lasering = false,
|
||||
laserOp,
|
||||
stock = settings.stock || { },
|
||||
hasStock = spro.camStockOn && stock.x && stock.y && stock.z,
|
||||
ztOff = hasStock ? stock.z - widget.track.top : 0,
|
||||
ztOff = stock.z - widget.track.top,
|
||||
bounds = widget.getBoundingBox(),
|
||||
zmax = hasStock ? stock.z : bounds.max.z,
|
||||
zmax = stock.z,
|
||||
runbox = {
|
||||
max: { x:-Infinity, y:-Infinity, z:-Infinity},
|
||||
min: { x:Infinity, y:Infinity, z:Infinity}
|
||||
|
|
@ -372,9 +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);
|
||||
if (hasStock) {
|
||||
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) {
|
||||
|
|
|
|||
|
|
@ -68,24 +68,23 @@ function prepEach(widget, settings, print, firstPoint, update) {
|
|||
outer = settings.bounds || widget.getPositionBox(),
|
||||
outerz = outer.max.z,
|
||||
slices = widget.slices,
|
||||
hasStock = stock.x && stock.y && stock.z && process.camStockOn,
|
||||
isIndexed = hasStock && process.camStockIndexed,
|
||||
isIndexed = process.camStockIndexed,
|
||||
startCenter = process.camOriginCenter,
|
||||
alignTop = settings.controller.alignTop,
|
||||
zclear = (process.camZClearance || 1),
|
||||
zmax_force = process.camForceZMax || false,
|
||||
zmax_outer = hasStock ? stock.z + zclear : outerz + zclear,
|
||||
zmax_outer = stock.z + zclear,
|
||||
wztop = widget.track.top,
|
||||
ztOff = hasStock ? stock.z - wztop : 0,
|
||||
ztOff = stock.z - wztop,
|
||||
bounds = widget.getBoundingBox(),
|
||||
boundsz = bounds.max.z + ztOff,
|
||||
zadd = hasStock && !isIndexed ? stock.z - boundsz : alignTop ? outerz - boundsz : 0,
|
||||
zadd = !isIndexed ? stock.z - boundsz : alignTop ? outerz - boundsz : 0,
|
||||
zmax = outerz + zclear + process.camOriginOffZ,
|
||||
wmpos = widget.track.pos,
|
||||
wmx = wmpos.x,
|
||||
wmy = wmpos.y,
|
||||
originx = (startCenter ? 0 : hasStock ? -stock.x / 2 : bounds.min.x) + process.camOriginOffX,
|
||||
originy = (startCenter ? 0 : hasStock ? -stock.y / 2 : bounds.min.y) + process.camOriginOffY,
|
||||
originx = (startCenter ? 0 : -stock.x / 2) + process.camOriginOffX,
|
||||
originy = (startCenter ? 0 : -stock.y / 2) + process.camOriginOffY,
|
||||
origin = newPoint(originx + wmx, originy + wmy, zmax),
|
||||
output = print.output,
|
||||
easeDown = process.camEaseDown,
|
||||
|
|
|
|||
|
|
@ -31,8 +31,7 @@ CAM.slice = async function(settings, widget, onupdate, ondone) {
|
|||
let mesh = widget.mesh,
|
||||
proc = settings.process,
|
||||
stock = settings.stock || {},
|
||||
hasStock = stock.x && stock.y && stock.z && proc.camStockOn,
|
||||
isIndexed = hasStock && proc.camStockIndexed,
|
||||
isIndexed = proc.camStockIndexed,
|
||||
camOps = widget.camops = [],
|
||||
sliceAll = widget.slices = [],
|
||||
bounds = widget.getBoundingBox(),
|
||||
|
|
@ -40,9 +39,9 @@ CAM.slice = async function(settings, widget, onupdate, ondone) {
|
|||
// widget top z as defined by setTopz()
|
||||
wztop = track.top,
|
||||
// distance between top of part and top of stock
|
||||
ztOff = isIndexed ? 0 : (hasStock ? stock.z - wztop : 0),
|
||||
ztOff = isIndexed ? 0 : (stock.z - wztop),
|
||||
// distance between bottom of part and bottom of stock
|
||||
zbOff = isIndexed ? 0 : (hasStock ? wztop - track.box.d : 0),
|
||||
zbOff = isIndexed ? 0 : (wztop - track.box.d),
|
||||
// defined z bottom offset by distance to stock bottom
|
||||
// keeps the z bottom relative to the part when z align changes
|
||||
zBottom = isIndexed ? proc.camZBottom : proc.camZBottom - zbOff,
|
||||
|
|
|
|||
Loading…
Reference in a new issue