separate pocket only into roughing and finishing options

This commit is contained in:
Stewart Allen 2020-02-15 11:30:02 -05:00
commit 9dbc925fd1
3 changed files with 29 additions and 14 deletions

View file

@ -703,15 +703,20 @@ var gs_kiri_cam = exports;
procFacing = proc.roughingOn && proc.camZTopOffset,
procDrill = proc.drillingOn && proc.drillDown && proc.drillDownSpeed,
sliceDepth = MAX(0.1, MIN(proc.roughingDown, proc.finishingDown) / 3),
pocketOnly = outp.camPocketOnly,
addTabs = proc.camTabsOn && !pocketOnly,
// pocketOnly = outp.camPocketOnly,
pocketOnlyRough = outp.camPocketOnlyRough,
pocketOnlyFinish = outp.camPocketOnlyFinish,
// addTabs = proc.camTabsOn && !pocketOnly,
addTabsRough = proc.camTabsOn && !pocketOnlyRough,
addTabsFinish = proc.camTabsOn && !pocketOnlyFinish,
tabWidth = proc.camTabsWidth,
tabHeight = proc.camTabsHeight,
mesh = widget.mesh,
bounds = widget.getBoundingBox(),
zMin = MAX(bounds.min.z, outp.camZBottom),
shellRough,
shellFinish;
shellFinish,
facePolys;
if (sliceDepth <= 0.05) {
return ondone("invalid slice depth");
@ -778,14 +783,18 @@ var gs_kiri_cam = exports;
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
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);
}
@ -879,15 +888,15 @@ var gs_kiri_cam = exports;
slice.index = index;
switch (slice.camMode) {
case CPRO.FACING:
createFacingSlices(slice, shellRough, roughToolDiam, proc.roughingOver, pocketOnly);
createFacingSlices(slice, facePolys, roughToolDiam, proc.roughingOver, pocketOnlyRough);
break;
case CPRO.ROUGH:
createRoughingSlices(slice, shellRough, roughToolDiam, proc.roughingStock, proc.roughingOver, pocketOnly);
if (addTabs) addCutoutTabs(slice, roughToolDiam);
createRoughingSlices(slice, shellRough, roughToolDiam, proc.roughingStock, proc.roughingOver, pocketOnlyRough);
if (addTabsRough) addCutoutTabs(slice, roughToolDiam);
break;
case CPRO.FINISH:
createFinishingSlices(slice, shellFinish, finishToolDiam, pocketOnly);
if (addTabs) addCutoutTabs(slice, finishToolDiam);
createFinishingSlices(slice, shellFinish, finishToolDiam, pocketOnlyFinish);
if (addTabsFinish) addCutoutTabs(slice, finishToolDiam);
break;
}
onupdate(0.40 + (index / sliceAll.length) * 0.10, "finishing")

View file

@ -138,6 +138,7 @@ self.kiri.license = exports.LICENSE;
roughingSpeed: 1,
roughingPlunge: 1,
roughingStock: 1,
camPocketOnlyRough: 1,
roughingOn: 1,
finishingTool: 1,
finishingSpindle: 1,
@ -150,6 +151,7 @@ self.kiri.license = exports.LICENSE;
finishingXOn: 1,
finishingYOn: 1,
finishCurvesOnly: 1,
camPocketOnlyFinish: 1,
drillTool: 1,
drillSpindle: 1,
drillDownSpeed: 1,
@ -354,6 +356,7 @@ self.kiri.license = exports.LICENSE;
roughingSpeed: 1000,
roughingPlunge: 250,
roughingStock: 0,
camPocketOnlyRough: false,
roughingOn: true,
finishingTool: 1000,
@ -367,6 +370,7 @@ self.kiri.license = exports.LICENSE;
finishingXOn: true,
finishingYOn: true,
finishCurvesOnly: false,
camPocketOnlyFinish: false,
drillTool: 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}),
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}),
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}),
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}),
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}),
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}),
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}),
@ -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}),
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}),
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}),
outputClockwise: UC.newBoolean("clockwise", onBooleanClick, {title:"waterline milling direction", modes:CAM}),

View file

@ -1,7 +1,7 @@
var exports = {
COPYRIGHT:"Copyright (C) 2014-2019 Stewart Allen <sa@grid.space> - All Rights Reserved",
LICENSE:"See the license.md file included with the source distribution",
VERSION:"1.5.9"
VERSION:"1.6.0"
};
if (!module) var module = {};
module.exports = exports;