separate pocket only into roughing and finishing options
This commit is contained in:
parent
674bb48689
commit
9dbc925fd1
3 changed files with 29 additions and 14 deletions
|
|
@ -703,15 +703,20 @@ var gs_kiri_cam = exports;
|
||||||
procFacing = proc.roughingOn && proc.camZTopOffset,
|
procFacing = proc.roughingOn && proc.camZTopOffset,
|
||||||
procDrill = proc.drillingOn && proc.drillDown && proc.drillDownSpeed,
|
procDrill = proc.drillingOn && proc.drillDown && proc.drillDownSpeed,
|
||||||
sliceDepth = MAX(0.1, MIN(proc.roughingDown, proc.finishingDown) / 3),
|
sliceDepth = MAX(0.1, MIN(proc.roughingDown, proc.finishingDown) / 3),
|
||||||
pocketOnly = outp.camPocketOnly,
|
// pocketOnly = outp.camPocketOnly,
|
||||||
addTabs = proc.camTabsOn && !pocketOnly,
|
pocketOnlyRough = outp.camPocketOnlyRough,
|
||||||
|
pocketOnlyFinish = outp.camPocketOnlyFinish,
|
||||||
|
// addTabs = proc.camTabsOn && !pocketOnly,
|
||||||
|
addTabsRough = proc.camTabsOn && !pocketOnlyRough,
|
||||||
|
addTabsFinish = proc.camTabsOn && !pocketOnlyFinish,
|
||||||
tabWidth = proc.camTabsWidth,
|
tabWidth = proc.camTabsWidth,
|
||||||
tabHeight = proc.camTabsHeight,
|
tabHeight = proc.camTabsHeight,
|
||||||
mesh = widget.mesh,
|
mesh = widget.mesh,
|
||||||
bounds = widget.getBoundingBox(),
|
bounds = widget.getBoundingBox(),
|
||||||
zMin = MAX(bounds.min.z, outp.camZBottom),
|
zMin = MAX(bounds.min.z, outp.camZBottom),
|
||||||
shellRough,
|
shellRough,
|
||||||
shellFinish;
|
shellFinish,
|
||||||
|
facePolys;
|
||||||
|
|
||||||
if (sliceDepth <= 0.05) {
|
if (sliceDepth <= 0.05) {
|
||||||
return ondone("invalid slice depth");
|
return ondone("invalid slice depth");
|
||||||
|
|
@ -778,14 +783,18 @@ var gs_kiri_cam = exports;
|
||||||
onupdate(0.25 + update * 0.15, "shelling");
|
onupdate(0.25 + update * 0.15, "shelling");
|
||||||
});
|
});
|
||||||
|
|
||||||
const camShellPolys = shellRough = camShell.gatherTopPolys([]);
|
const camShellPolys = shellRough = facePolys = camShell.gatherTopPolys([]);
|
||||||
|
|
||||||
if (procRough && !pocketOnly) {
|
if (procRough && !pocketOnlyRough) {
|
||||||
// expand shell by half tool diameter + stock to leave
|
// expand shell by half tool diameter + stock to leave
|
||||||
shellRough = POLY.expand(shellRough, (roughToolDiam / 2) + proc.roughingStock, 0);
|
shellRough = facePolys = POLY.expand(shellRough, (roughToolDiam / 2) + proc.roughingStock, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (anyFinish && pocketOnly) {
|
if (anyFinish && pocketOnlyRough && !pocketOnlyFinish) {
|
||||||
|
facePolys = POLY.expand(shellRough, (roughToolDiam / 2) + proc.roughingStock, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (anyFinish && pocketOnlyFinish) {
|
||||||
shellFinish = POLY.expand(camShellPolys, -finishToolDiam/2, 0);
|
shellFinish = POLY.expand(camShellPolys, -finishToolDiam/2, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -879,15 +888,15 @@ var gs_kiri_cam = exports;
|
||||||
slice.index = index;
|
slice.index = index;
|
||||||
switch (slice.camMode) {
|
switch (slice.camMode) {
|
||||||
case CPRO.FACING:
|
case CPRO.FACING:
|
||||||
createFacingSlices(slice, shellRough, roughToolDiam, proc.roughingOver, pocketOnly);
|
createFacingSlices(slice, facePolys, roughToolDiam, proc.roughingOver, pocketOnlyRough);
|
||||||
break;
|
break;
|
||||||
case CPRO.ROUGH:
|
case CPRO.ROUGH:
|
||||||
createRoughingSlices(slice, shellRough, roughToolDiam, proc.roughingStock, proc.roughingOver, pocketOnly);
|
createRoughingSlices(slice, shellRough, roughToolDiam, proc.roughingStock, proc.roughingOver, pocketOnlyRough);
|
||||||
if (addTabs) addCutoutTabs(slice, roughToolDiam);
|
if (addTabsRough) addCutoutTabs(slice, roughToolDiam);
|
||||||
break;
|
break;
|
||||||
case CPRO.FINISH:
|
case CPRO.FINISH:
|
||||||
createFinishingSlices(slice, shellFinish, finishToolDiam, pocketOnly);
|
createFinishingSlices(slice, shellFinish, finishToolDiam, pocketOnlyFinish);
|
||||||
if (addTabs) addCutoutTabs(slice, finishToolDiam);
|
if (addTabsFinish) addCutoutTabs(slice, finishToolDiam);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
onupdate(0.40 + (index / sliceAll.length) * 0.10, "finishing")
|
onupdate(0.40 + (index / sliceAll.length) * 0.10, "finishing")
|
||||||
|
|
|
||||||
|
|
@ -138,6 +138,7 @@ self.kiri.license = exports.LICENSE;
|
||||||
roughingSpeed: 1,
|
roughingSpeed: 1,
|
||||||
roughingPlunge: 1,
|
roughingPlunge: 1,
|
||||||
roughingStock: 1,
|
roughingStock: 1,
|
||||||
|
camPocketOnlyRough: 1,
|
||||||
roughingOn: 1,
|
roughingOn: 1,
|
||||||
finishingTool: 1,
|
finishingTool: 1,
|
||||||
finishingSpindle: 1,
|
finishingSpindle: 1,
|
||||||
|
|
@ -150,6 +151,7 @@ self.kiri.license = exports.LICENSE;
|
||||||
finishingXOn: 1,
|
finishingXOn: 1,
|
||||||
finishingYOn: 1,
|
finishingYOn: 1,
|
||||||
finishCurvesOnly: 1,
|
finishCurvesOnly: 1,
|
||||||
|
camPocketOnlyFinish: 1,
|
||||||
drillTool: 1,
|
drillTool: 1,
|
||||||
drillSpindle: 1,
|
drillSpindle: 1,
|
||||||
drillDownSpeed: 1,
|
drillDownSpeed: 1,
|
||||||
|
|
@ -354,6 +356,7 @@ self.kiri.license = exports.LICENSE;
|
||||||
roughingSpeed: 1000,
|
roughingSpeed: 1000,
|
||||||
roughingPlunge: 250,
|
roughingPlunge: 250,
|
||||||
roughingStock: 0,
|
roughingStock: 0,
|
||||||
|
camPocketOnlyRough: false,
|
||||||
roughingOn: true,
|
roughingOn: true,
|
||||||
|
|
||||||
finishingTool: 1000,
|
finishingTool: 1000,
|
||||||
|
|
@ -367,6 +370,7 @@ self.kiri.license = exports.LICENSE;
|
||||||
finishingXOn: true,
|
finishingXOn: true,
|
||||||
finishingYOn: true,
|
finishingYOn: true,
|
||||||
finishCurvesOnly: false,
|
finishCurvesOnly: false,
|
||||||
|
camPocketOnlyFinish: false,
|
||||||
|
|
||||||
drillTool: 1000,
|
drillTool: 1000,
|
||||||
drillSpindle: 1000,
|
drillSpindle: 1000,
|
||||||
|
|
@ -2703,6 +2707,7 @@ self.kiri.license = exports.LICENSE;
|
||||||
roughingSpeed: UC.newInput("feed rate", {title:"max speed while cutting\nmillimeters / minute", convert:UC.toInt, modes:CAM}),
|
roughingSpeed: UC.newInput("feed rate", {title:"max speed while cutting\nmillimeters / minute", convert:UC.toInt, modes:CAM}),
|
||||||
roughingPlunge: UC.newInput("plunge rate", {title:"max speed on z axis\nmillimeters / minute", convert:UC.toInt, modes:CAM}),
|
roughingPlunge: UC.newInput("plunge rate", {title:"max speed on z axis\nmillimeters / minute", convert:UC.toInt, modes:CAM}),
|
||||||
roughingStock: UC.newInput("leave stock", {title:"horizontal offset from vertical faces\nstock to leave for finishing pass\nin millimeters", convert:UC.toFloat, modes:CAM}),
|
roughingStock: UC.newInput("leave stock", {title:"horizontal offset from vertical faces\nstock to leave for finishing pass\nin millimeters", convert:UC.toFloat, modes:CAM}),
|
||||||
|
camPocketOnlyRough: UC.newBoolean("pocket only", onBooleanClick, {title:"constrain to\npart boundaries", modes:CAM}),
|
||||||
camEaseDown: UC.newBoolean("ease down", onBooleanClick, {title:"plunge cuts will\nspiral down or ease\nalong a linear path\nas they cut downward", modes:CAM}),
|
camEaseDown: UC.newBoolean("ease down", onBooleanClick, {title:"plunge cuts will\nspiral down or ease\nalong a linear path\nas they cut downward", modes:CAM}),
|
||||||
roughingOn: UC.newBoolean("enable", onBooleanClick, {modes:CAM}),
|
roughingOn: UC.newBoolean("enable", onBooleanClick, {modes:CAM}),
|
||||||
|
|
||||||
|
|
@ -2714,6 +2719,7 @@ self.kiri.license = exports.LICENSE;
|
||||||
finishingAngle: UC.newInput("max angle", {title:"angles greater than this\nare considered vertical", convert:UC.toFloat, bound:UC.bound(45,90), modes:CAM}),
|
finishingAngle: UC.newInput("max angle", {title:"angles greater than this\nare considered vertical", convert:UC.toFloat, bound:UC.bound(45,90), modes:CAM}),
|
||||||
finishingSpeed: UC.newInput("feed rate", {title:"max speed while cutting\nmillimeters / minute", convert:UC.toInt, modes:CAM}),
|
finishingSpeed: UC.newInput("feed rate", {title:"max speed while cutting\nmillimeters / minute", convert:UC.toInt, modes:CAM}),
|
||||||
finishingPlunge: UC.newInput("plunge rate", {title:"max speed on z axis\nmillimeters / minute", convert:UC.toInt, modes:CAM}),
|
finishingPlunge: UC.newInput("plunge rate", {title:"max speed on z axis\nmillimeters / minute", convert:UC.toInt, modes:CAM}),
|
||||||
|
camPocketOnlyFinish: UC.newBoolean("pocket only", onBooleanClick, {title:"constrain to\npart boundaries", modes:CAM}),
|
||||||
finishingOn: UC.newBoolean("waterline", onBooleanClick, {title:"contour finishing\ndisabled when pocketing", modes:CAM}),
|
finishingOn: UC.newBoolean("waterline", onBooleanClick, {title:"contour finishing\ndisabled when pocketing", modes:CAM}),
|
||||||
finishingXOn: UC.newBoolean("linear x", onBooleanClick, {title:"linear x-axis finishing", modes:CAM}),
|
finishingXOn: UC.newBoolean("linear x", onBooleanClick, {title:"linear x-axis finishing", modes:CAM}),
|
||||||
finishingYOn: UC.newBoolean("linear y", onBooleanClick, {title:"linear y-axis finishing", modes:CAM}),
|
finishingYOn: UC.newBoolean("linear y", onBooleanClick, {title:"linear y-axis finishing", modes:CAM}),
|
||||||
|
|
@ -2758,7 +2764,7 @@ self.kiri.license = exports.LICENSE;
|
||||||
camZTopOffset: UC.newInput("z top offset", {title:"offset from stock surface\nto top face of part\nin millimeters", convert:UC.toFloat, modes:CAM}),
|
camZTopOffset: UC.newInput("z top offset", {title:"offset from stock surface\nto top face of part\nin millimeters", convert:UC.toFloat, modes:CAM}),
|
||||||
camZBottom: UC.newInput("z bottom", {title:"offset from part bottom\nto limit cutting depth\nin millimeters", convert:UC.toFloat, modes:CAM}),
|
camZBottom: UC.newInput("z bottom", {title:"offset from part bottom\nto limit cutting depth\nin millimeters", convert:UC.toFloat, modes:CAM}),
|
||||||
camZClearance: UC.newInput("z clearance", {title:"travel offset from z top\nin millimeters", convert:UC.toFloat, bound:UC.bound(1,100), modes:CAM}),
|
camZClearance: UC.newInput("z clearance", {title:"travel offset from z top\nin millimeters", convert:UC.toFloat, bound:UC.bound(1,100), modes:CAM}),
|
||||||
camPocketOnly: UC.newBoolean("pocket only", onBooleanClick, {title:"constrain to\npart boundaries", modes:CAM}),
|
// camPocketOnly: UC.newBoolean("pocket only", onBooleanClick, {title:"constrain to\npart boundaries", modes:CAM}),
|
||||||
camDepthFirst: UC.newBoolean("depth first", onBooleanClick, {title:"optimize pocket cuts\nwith depth priority", modes:CAM}),
|
camDepthFirst: UC.newBoolean("depth first", onBooleanClick, {title:"optimize pocket cuts\nwith depth priority", modes:CAM}),
|
||||||
outputClockwise: UC.newBoolean("clockwise", onBooleanClick, {title:"waterline milling direction", modes:CAM}),
|
outputClockwise: UC.newBoolean("clockwise", onBooleanClick, {title:"waterline milling direction", modes:CAM}),
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
var exports = {
|
var exports = {
|
||||||
COPYRIGHT:"Copyright (C) 2014-2019 Stewart Allen <sa@grid.space> - All Rights Reserved",
|
COPYRIGHT:"Copyright (C) 2014-2019 Stewart Allen <sa@grid.space> - All Rights Reserved",
|
||||||
LICENSE:"See the license.md file included with the source distribution",
|
LICENSE:"See the license.md file included with the source distribution",
|
||||||
VERSION:"1.5.9"
|
VERSION:"1.6.0"
|
||||||
};
|
};
|
||||||
if (!module) var module = {};
|
if (!module) var module = {};
|
||||||
module.exports = exports;
|
module.exports = exports;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue