From dc7705878ebad095a83ecb351e4b0d737819c62f Mon Sep 17 00:00:00 2001 From: Stewart Allen Date: Sun, 15 Nov 2020 15:32:15 -0500 Subject: [PATCH] add clear faces option in roughing. bump rev 2.3.D10 --- notes.md | 1 - package.json | 2 +- src/kiri/conf.js | 1 + src/kiri/init.js | 1 + src/license.js | 2 +- src/mode/cam/slice.js | 26 +++++++++++++++++++++++++- web/kiri/lang/en.js | 2 ++ 7 files changed, 31 insertions(+), 4 deletions(-) diff --git a/notes.md b/notes.md index 2ff3d3b3..18aa3d9c 100644 --- a/notes.md +++ b/notes.md @@ -1,7 +1,6 @@ # Kiri:Moto todo ## 2.3 remaining -* add clear flats to roughing * path arrows, retracts, and engages * cap path ends * help dialog diff --git a/package.json b/package.json index 03085056..5dfcd91a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "grid-apps", - "version": "2.3.9D", + "version": "2.3.10.D", "description": "grid.space 3d slice & modeling tools", "author": "Stewart Allen ", "license": "MIT", diff --git a/src/kiri/conf.js b/src/kiri/conf.js index 9c487ef8..257ac9d8 100644 --- a/src/kiri/conf.js +++ b/src/kiri/conf.js @@ -404,6 +404,7 @@ camRoughPlunge: 250, camRoughStock: 0, camRoughVoid: false, + camRoughFlat: false, camRoughIn: false, camRoughOn: true, camOutlineTool: 1000, diff --git a/src/kiri/init.js b/src/kiri/init.js index db29e41b..4eed1640 100644 --- a/src/kiri/init.js +++ b/src/kiri/init.js @@ -1469,6 +1469,7 @@ camRoughPlunge: UC.newInput(LANG.cc_plng_s, {title:LANG.cc_plng_l, convert:UC.toInt, modes:CAM, units:true}), camRoughStock: UC.newInput(LANG.cr_lsto_s, {title:LANG.cr_lsto_l, convert:UC.toFloat, modes:CAM, units:true}), camRoughVoid: UC.newBoolean(LANG.cr_clrp_s, onBooleanClick, {title:LANG.cr_clrp_l, modes:CAM}), + camRoughFlat: UC.newBoolean(LANG.cr_clrf_s, onBooleanClick, {title:LANG.cr_clrf_l, modes:CAM}), camRoughIn: UC.newBoolean(LANG.cr_olin_s, onBooleanClick, {title:LANG.cr_olin_l, modes:CAM}), camRoughSep: UC.newBlank({class:"pop-sep"}), camRoughOn: UC.newBoolean(LANG.enable, onBooleanClick, {modes:CAM}), diff --git a/src/license.js b/src/license.js index c0836bcd..4cf89890 100644 --- a/src/license.js +++ b/src/license.js @@ -3,7 +3,7 @@ let terms = { COPYRIGHT: "Copyright (C) Stewart Allen - All Rights Reserved", LICENSE: "See the license.md file included with the source distribution", - VERSION: "2.3.D9" + VERSION: "2.3.D10" }; if (typeof(module) === 'object') { diff --git a/src/mode/cam/slice.js b/src/mode/cam/slice.js index b22bef9f..764b2960 100644 --- a/src/mode/cam/slice.js +++ b/src/mode/cam/slice.js @@ -165,7 +165,31 @@ maxToolDiam = Math.max(maxToolDiam, roughToolDiam); let shadow = []; let slices = []; - const indices = slicer.interval(roughDown, { down: true, min: zBottom, fit: true }); + let indices = slicer.interval(roughDown, { down: true, min: zBottom, fit: true }); + // add flats + if (proc.camRoughFlat) { + let flats = Object.keys(slicer.zFlat).map(v => parseFloat(v).round(4)); + flats.forEach(v => { + if (!indices.contains(v)) { + indices.push(v); + } + }); + indices = indices.sort((a,b) => { return b - a }); + // if layer is not on a flat and next one is, + // then move this layer up to mid-point to previous layer + // this is not perfect. the best method is to interpolate + // between flats so that each step is < step down. on todo list + for (let i=1; i { shadow = POLY.union(shadow.appendAll(data.tops), 0.01, true); data.shadow = shadow.clone(true); diff --git a/web/kiri/lang/en.js b/web/kiri/lang/en.js index 5f6a321b..3f533ed6 100644 --- a/web/kiri/lang/en.js +++ b/web/kiri/lang/en.js @@ -274,6 +274,8 @@ kiri.lang['en-us'] = { cr_ease_l: "plunge cuts will\nspiral down or ease\nalong a linear path", cr_clrp_s: "clear voids", cr_clrp_l: "mill out through pockets\ninstead of just the outline", + cr_clrf_s: "clear faces", + cr_clrf_l: "interpolate step down to\nclear any detected flat areas", cr_olin_s: "inside only", cr_olin_l: "limit cutting to\ninside part boundaries",