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
|
|
@ -566,7 +566,7 @@ const conf = exports({
|
|||
camDepthFirst: false,
|
||||
camEaseDown: false,
|
||||
camOriginTop: true,
|
||||
camZAnchor: "top",
|
||||
camZAnchor: "middle",
|
||||
camZOffset: 0,
|
||||
camZBottom: 0,
|
||||
camZClearance: 1,
|
||||
|
|
@ -578,14 +578,13 @@ const conf = exports({
|
|||
camContourBridge: 0,
|
||||
camStockX: 5,
|
||||
camStockY: 5,
|
||||
camStockZ: 0,
|
||||
camStockZ: 5,
|
||||
camStockOffset: true,
|
||||
camStockClipTo: false,
|
||||
camStockIndexed: false,
|
||||
camStockIndexGrid: false,
|
||||
camIndexAxis: 0,
|
||||
camIndexAbs: true,
|
||||
camStockOn: true,
|
||||
camConventional: false, // outputClockwise
|
||||
camOriginCenter: false,
|
||||
camOriginOffX: 0,
|
||||
|
|
|
|||
|
|
@ -1912,7 +1912,7 @@ gapp.register("kiri.init", [], (root, exports) => {
|
|||
(ui.tabClr = uc.newButton(undefined, onButtonClick, {icon:'<i class="fas fa-trash-alt"></i>'}))
|
||||
], {modes:CAM, class:"ext-buttons f-row"}),
|
||||
|
||||
camStock: uc.newGroup(LANG.cs_menu, null, {modes:CAM, marker: true}),
|
||||
camStock: uc.newGroup(LANG.cs_menu, null, {modes:CAM}),
|
||||
camStockX: uc.newInput(LANG.cs_wdth_s, {title:LANG.cs_wdth_l, convert:uc.toFloat, bound:uc.bound(0,9999), modes:CAM, units:true}),
|
||||
camStockY: uc.newInput(LANG.cs_dpth_s, {title:LANG.cs_dpth_l, convert:uc.toFloat, bound:uc.bound(0,9999), modes:CAM, units:true}),
|
||||
camStockZ: uc.newInput(LANG.cs_hght_s, {title:LANG.cs_hght_l, convert:uc.toFloat, bound:uc.bound(0,9999), modes:CAM, units:true}),
|
||||
|
|
@ -1920,13 +1920,12 @@ gapp.register("kiri.init", [], (root, exports) => {
|
|||
camStockOffset: uc.newBoolean(LANG.cs_offs_s, onBooleanClick, {title:LANG.cs_offs_l, modes:CAM}),
|
||||
camStockClipTo: uc.newBoolean(LANG.cs_clip_s, onBooleanClick, {title:LANG.cs_clip_l, modes:CAM}),
|
||||
camSep: uc.newBlank({class:"pop-sep"}),
|
||||
camStockIndexGrid: uc.newBoolean(LANG.cs_ishg_s, onBooleanClick, {title:LANG.cs_ishg_l, modes:CAM, show:() => ui.camStockOn.checked && ui.camStockIndexed.checked}),
|
||||
camStockIndexed: uc.newBoolean(LANG.cs_indx_s, onBooleanClick, {title:LANG.cs_indx_l, modes:CAM, show:() => ui.camStockOn.checked}),
|
||||
camStockOn: uc.newBoolean(LANG.cs_offe_s, onBooleanClick, {title:LANG.cs_offe_l, modes:CAM}),
|
||||
camStockIndexGrid: uc.newBoolean(LANG.cs_ishg_s, onBooleanClick, {title:LANG.cs_ishg_l, modes:CAM, show:() => ui.camStockIndexed.checked}),
|
||||
camStockIndexed: uc.newBoolean(LANG.cs_indx_s, onBooleanClick, {title:LANG.cs_indx_l, modes:CAM}),
|
||||
|
||||
camCommon: uc.newGroup(LANG.cc_menu, null, {modes:CAM}),
|
||||
camZAnchor: uc.newSelect(LANG.ou_zanc_s, {title: LANG.ou_zanc_l, action:zAnchorSave, modes:CAM, trace:true, show:() => ui.camStockOn.checked && !ui.camStockIndexed.checked}, "zanchor"),
|
||||
camSep: uc.newBlank({class:"pop-sep", show:() => ui.camStockOn.checked && !ui.camStockIndexed.checked}),
|
||||
camZAnchor: uc.newSelect(LANG.ou_zanc_s, {title: LANG.ou_zanc_l, action:zAnchorSave, modes:CAM, trace:true, show:() => !ui.camStockIndexed.checked}, "zanchor"),
|
||||
camSep: uc.newBlank({class:"pop-sep", show:() => !ui.camStockIndexed.checked}),
|
||||
camZOffset: uc.newInput(LANG.ou_ztof_s, {title:LANG.ou_ztof_l, convert:uc.toFloat, modes:CAM, units:true}),
|
||||
camZBottom: uc.newInput(LANG.ou_zbot_s, {title:LANG.ou_zbot_l, convert:uc.toFloat, modes:CAM, units:true, trigger: true}),
|
||||
camZThru: uc.newInput(LANG.ou_ztru_s, {title:LANG.ou_ztru_l, convert:uc.toFloat, bound:uc.bound(0.0,100), modes:CAM, units:true, show:() => { return ui.camZBottom.value == 0 }}),
|
||||
|
|
|
|||
|
|
@ -45,8 +45,7 @@ function platformUpdateOrigin(update_bounds = true) {
|
|||
|
||||
let ruler = controller.showRulers;
|
||||
let stockCenter = stock.center || { x: 0, y: 0, z: 0 };
|
||||
let hasStock = stock.x && stock.y && stock.z;
|
||||
let isIndexed = process.camStockIndexed && process.camStockOn;
|
||||
let isIndexed = process.camStockIndexed;
|
||||
let isBelt = device.bedBelt;
|
||||
let origin = settings.origin = { x: 0, y: 0, z: 0 };
|
||||
let center = MODE === MODES.FDM ? device.originCenter || device.bedRound :
|
||||
|
|
@ -55,11 +54,11 @@ function platformUpdateOrigin(update_bounds = true) {
|
|||
device.originCenter || process.outputOriginCenter;
|
||||
|
||||
if (MODE === MODES.CAM && process.camOriginTop) {
|
||||
origin.z = (hasStock ? stock.z : topZ) + 0.01;
|
||||
origin.z = stock.z + 0.01;
|
||||
}
|
||||
|
||||
if (!center) {
|
||||
if (hasStock) {
|
||||
if (MODE === MODES.CAM) {
|
||||
origin.x = (-stock.x / 2) + stockCenter.x;
|
||||
origin.y = (stock.y / 2) - stockCenter.y;
|
||||
} else {
|
||||
|
|
@ -72,7 +71,7 @@ function platformUpdateOrigin(update_bounds = true) {
|
|||
origin.y = device.bedDepth / 2;
|
||||
}
|
||||
}
|
||||
} else if (hasStock) {
|
||||
} else if (MODE === MODES.CAM) {
|
||||
origin.x = stockCenter.x;
|
||||
origin.y = -stockCenter.y;
|
||||
} else if (isBelt) {
|
||||
|
|
@ -92,7 +91,7 @@ function platformUpdateOrigin(update_bounds = true) {
|
|||
space.platform.setRulers(ruler, ruler, 1 / api.view.unit_scale(), 'X', isBelt ? 'Z' : 'Y');
|
||||
|
||||
let { x, y, z } = origin;
|
||||
let oz = process.camStockIndexed && process.camStockOn ? z / 2 : z;
|
||||
let oz = process.camStockIndexed ? z / 2 : z;
|
||||
if (controller.showOrigin && MODE !== MODES.SLA) {
|
||||
space.platform.setOrigin(x, y, oz, true);
|
||||
} else {
|
||||
|
|
@ -150,10 +149,9 @@ function platformUpdateMidZ() {
|
|||
|
||||
function platformUpdateTopZ(zdelta) {
|
||||
const { process, stock } = current();
|
||||
const hasStock = stock.x && stock.y && stock.z;
|
||||
const MODE = get_mode();
|
||||
api.widgets.each(widget => {
|
||||
if (MODE === MODES.CAM && hasStock) {
|
||||
if (MODE === MODES.CAM) {
|
||||
const bounds = widget.getBoundingBox();
|
||||
const wzmax = bounds.max.z;
|
||||
const zdelta = process.camZOffset || 0;
|
||||
|
|
@ -177,14 +175,15 @@ function platformUpdateTopZ(zdelta) {
|
|||
function platformUpdateStock() {
|
||||
const settings = current();
|
||||
const { bounds, process, mode } = settings;
|
||||
const { camStockOn, camStockX, camStockY, camStockZ, camStockOffset, camStockIndexed } = process;
|
||||
if (mode === 'CAM' && camStockOn) {
|
||||
const { camStockX, camStockY, camStockZ, camStockOffset, camStockIndexed } = process;
|
||||
if (mode === 'CAM') {
|
||||
let stock = settings.stock = {
|
||||
x: camStockX,
|
||||
y: camStockY,
|
||||
z: camStockZ
|
||||
};
|
||||
if (camStockOffset) {
|
||||
// drop back to offset mode if any stock dimension is 0
|
||||
if (camStockOffset || (stock.x * stock.y * stock.z === 0)) {
|
||||
stock.x += bounds.max.x - bounds.min.x;
|
||||
stock.y += bounds.max.y - bounds.min.y;
|
||||
stock.z += bounds.max.z - bounds.min.z;
|
||||
|
|
|
|||
Loading…
Reference in a new issue