add clear faces option in roughing. bump rev 2.3.D10
This commit is contained in:
parent
533b8035eb
commit
dc7705878e
7 changed files with 31 additions and 4 deletions
1
notes.md
1
notes.md
|
|
@ -1,7 +1,6 @@
|
||||||
# Kiri:Moto todo
|
# Kiri:Moto todo
|
||||||
|
|
||||||
## 2.3 remaining
|
## 2.3 remaining
|
||||||
* add clear flats to roughing
|
|
||||||
* path arrows, retracts, and engages
|
* path arrows, retracts, and engages
|
||||||
* cap path ends
|
* cap path ends
|
||||||
* help dialog
|
* help dialog
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "grid-apps",
|
"name": "grid-apps",
|
||||||
"version": "2.3.9D",
|
"version": "2.3.10.D",
|
||||||
"description": "grid.space 3d slice & modeling tools",
|
"description": "grid.space 3d slice & modeling tools",
|
||||||
"author": "Stewart Allen <sa@grid.space>",
|
"author": "Stewart Allen <sa@grid.space>",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
|
|
|
||||||
|
|
@ -404,6 +404,7 @@
|
||||||
camRoughPlunge: 250,
|
camRoughPlunge: 250,
|
||||||
camRoughStock: 0,
|
camRoughStock: 0,
|
||||||
camRoughVoid: false,
|
camRoughVoid: false,
|
||||||
|
camRoughFlat: false,
|
||||||
camRoughIn: false,
|
camRoughIn: false,
|
||||||
camRoughOn: true,
|
camRoughOn: true,
|
||||||
camOutlineTool: 1000,
|
camOutlineTool: 1000,
|
||||||
|
|
|
||||||
|
|
@ -1469,6 +1469,7 @@
|
||||||
camRoughPlunge: UC.newInput(LANG.cc_plng_s, {title:LANG.cc_plng_l, convert:UC.toInt, modes:CAM, units:true}),
|
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}),
|
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}),
|
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}),
|
camRoughIn: UC.newBoolean(LANG.cr_olin_s, onBooleanClick, {title:LANG.cr_olin_l, modes:CAM}),
|
||||||
camRoughSep: UC.newBlank({class:"pop-sep"}),
|
camRoughSep: UC.newBlank({class:"pop-sep"}),
|
||||||
camRoughOn: UC.newBoolean(LANG.enable, onBooleanClick, {modes:CAM}),
|
camRoughOn: UC.newBoolean(LANG.enable, onBooleanClick, {modes:CAM}),
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@
|
||||||
let terms = {
|
let terms = {
|
||||||
COPYRIGHT: "Copyright (C) Stewart Allen <sa@grid.space> - All Rights Reserved",
|
COPYRIGHT: "Copyright (C) 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: "2.3.D9"
|
VERSION: "2.3.D10"
|
||||||
};
|
};
|
||||||
|
|
||||||
if (typeof(module) === 'object') {
|
if (typeof(module) === 'object') {
|
||||||
|
|
|
||||||
|
|
@ -165,7 +165,31 @@
|
||||||
maxToolDiam = Math.max(maxToolDiam, roughToolDiam);
|
maxToolDiam = Math.max(maxToolDiam, roughToolDiam);
|
||||||
let shadow = [];
|
let shadow = [];
|
||||||
let slices = [];
|
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) => {
|
slicer.slice(indices, { each: (data, index, total) => {
|
||||||
shadow = POLY.union(shadow.appendAll(data.tops), 0.01, true);
|
shadow = POLY.union(shadow.appendAll(data.tops), 0.01, true);
|
||||||
data.shadow = shadow.clone(true);
|
data.shadow = shadow.clone(true);
|
||||||
|
|
|
||||||
|
|
@ -274,6 +274,8 @@ kiri.lang['en-us'] = {
|
||||||
cr_ease_l: "plunge cuts will\nspiral down or ease\nalong a linear path",
|
cr_ease_l: "plunge cuts will\nspiral down or ease\nalong a linear path",
|
||||||
cr_clrp_s: "clear voids",
|
cr_clrp_s: "clear voids",
|
||||||
cr_clrp_l: "mill out through pockets\ninstead of just the outline",
|
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_s: "inside only",
|
||||||
cr_olin_l: "limit cutting to\ninside part boundaries",
|
cr_olin_l: "limit cutting to\ninside part boundaries",
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue