From 9dbc925fd1b164be7ad01cd56f9cb1b837aa6809 Mon Sep 17 00:00:00 2001 From: Stewart Allen Date: Sat, 15 Feb 2020 11:30:02 -0500 Subject: [PATCH] separate pocket only into roughing and finishing options --- js/kiri-driver-cam.js | 33 +++++++++++++++++++++------------ js/kiri.js | 8 +++++++- js/license.js | 2 +- 3 files changed, 29 insertions(+), 14 deletions(-) diff --git a/js/kiri-driver-cam.js b/js/kiri-driver-cam.js index a6728000..3993e651 100644 --- a/js/kiri-driver-cam.js +++ b/js/kiri-driver-cam.js @@ -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") diff --git a/js/kiri.js b/js/kiri.js index 6ff4afcc..95ff65e6 100644 --- a/js/kiri.js +++ b/js/kiri.js @@ -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}), diff --git a/js/license.js b/js/license.js index 438d7570..0c46ec48 100644 --- a/js/license.js +++ b/js/license.js @@ -1,7 +1,7 @@ var exports = { COPYRIGHT:"Copyright (C) 2014-2019 Stewart Allen - 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;