add clear faces option in roughing. bump rev 2.3.D10

This commit is contained in:
Stewart Allen 2020-11-15 15:32:15 -05:00
commit dc7705878e
7 changed files with 31 additions and 4 deletions

View file

@ -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

View file

@ -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 <sa@grid.space>",
"license": "MIT",

View file

@ -404,6 +404,7 @@
camRoughPlunge: 250,
camRoughStock: 0,
camRoughVoid: false,
camRoughFlat: false,
camRoughIn: false,
camRoughOn: true,
camOutlineTool: 1000,

View file

@ -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}),

View file

@ -3,7 +3,7 @@
let terms = {
COPYRIGHT: "Copyright (C) Stewart Allen <sa@grid.space> - 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') {

View file

@ -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<indices.length-1; i++) {
const prev = indices[i-1];
const curr = indices[i];
const next = indices[i+1];
if (!flats.contains(curr) && flats.contains(next)) {
console.log('move',curr,'up toward',prev,'b/c next',next,'is flat');
indices[i] = next + ((prev - next) / 2);
}
}
}
// console.log('indices', ...indices);
slicer.slice(indices, { each: (data, index, total) => {
shadow = POLY.union(shadow.appendAll(data.tops), 0.01, true);
data.shadow = shadow.clone(true);

View file

@ -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",