add roughing option to clear all stock to aid lathe mode

This commit is contained in:
Stewart Allen 2023-02-14 11:23:23 -05:00
commit 8580307661
6 changed files with 17 additions and 2 deletions

View file

@ -9,6 +9,7 @@ Full docs @ https://docs.grid.space/projects/kiri-moto
* CAM add open poly-line offsetting with trace op
* CAM clearly delineate ops reachable or not on timeline
* CAM add 4th axis lathe operation for debug and testing (can be optimized)
* CAM add rough all stock to aid lathe mode
- add auto-disable for ops mismatched to axis indexed state
- remove clear top (always on)
- add z top (like z bottom)

View file

@ -1212,6 +1212,10 @@ CAM.init = function(kiri, api) {
SPACE.update();
}
function hasIndexing() {
return isIndexed;
}
function hasSpindle() {
return current.device.spindleMax > 0;
}
@ -1245,6 +1249,7 @@ CAM.init = function(kiri, api) {
rate: 'camRoughSpeed',
plunge: 'camRoughPlunge',
leave: 'camRoughStock',
all: 'camRoughAll',
voids: 'camRoughVoid',
flats: 'camRoughFlat',
inside: 'camRoughIn',
@ -1260,6 +1265,7 @@ CAM.init = function(kiri, api) {
step: UC.newInput(LANG.cc_sovr_s, {title:LANG.cc_sovr_l, convert:UC.toFloat, bound:UC.bound(0.01,1.0)}),
leave: UC.newInput(LANG.cr_lsto_s, {title:LANG.cr_lsto_l, convert:UC.toFloat, units:true}),
sep: UC.newBlank({class:"pop-sep"}),
all: UC.newBoolean(LANG.cr_clst_s, undefined, {title:LANG.cr_clst_l, show:hasIndexing}),
voids: UC.newBoolean(LANG.cr_clrp_s, undefined, {title:LANG.cr_clrp_l}),
flats: UC.newBoolean(LANG.cr_clrf_s, undefined, {title:LANG.cr_clrf_l}),
top: UC.newBoolean(LANG.cr_clrt_s, undefined, {title:LANG.cr_clrt_l}),

View file

@ -180,6 +180,7 @@ class OpRough extends CamOp {
let roughTop = op.top;
let roughDown = op.down;
let roughLeave = op.leave;
let roughStock = op.all && state.isIndexed;
let toolDiam = new CAM.Tool(settings, op.tool).fluteDiameter();
let trueShadow = process.camTrueShadow === true;
@ -306,7 +307,9 @@ class OpRough extends CamOp {
// shell = shadow expanded by half tool diameter + leave stock
const sadd = roughIn ? toolDiam / 2 : toolDiam / 2;
const shell = POLY.offset(shadow, sadd + roughLeave);
const shell = roughStock ?
[ newPolygon().centerRectangle(stock.center, stock.x, stock.y) ] :
POLY.offset(shadow, sadd + roughLeave);
slices.forEach((slice, index) => {
let offset = [shell.clone(true),slice.shadow.clone(true)].flat();

View file

@ -107,13 +107,15 @@ class Topo4 {
range.min -= this.diam / 2;
range.max += this.diam / 2;
// merge in tab vertices (so they don't affect slice range / dimensions)
// merge in tab vertices here so they don't affect slice range / dimensions
for (let i=0, l=tabverts.length; i<l; i += 3) {
const x = tabverts[i];
const z = tabverts[i + 2];
tabverts[i] = z;
tabverts[i + 2] = x;
}
// re-create shared vertex array for workers
this.vertices = [].appendAll(vertices).appendAll(tabverts).toFloat32().toShared();
const shards = Math.ceil(Math.min(25, vertices.length / 27000));

View file

@ -470,6 +470,7 @@ const conf = exports({
camRoughSpeed: 1000,
camRoughPlunge: 250,
camRoughStock: 0,
camRoughAll: false,
camRoughVoid: false,
camRoughFlat: true,
camRoughTop: true,

View file

@ -480,6 +480,8 @@ self.kiri.lang['en-us'] = {
cr_lsto_l: ["horizontal offset from vertical faces","stock to leave for finishing pass","in workspace units"],
cr_ease_s: "ease down",
cr_ease_l: ["plunge cuts will","spiral down or ease","along a linear path"],
cr_clst_s: "clear stock",
cr_clst_l: ["in indexed mode, clear entire stock area, not just to part periemter"],
cr_clrt_s: "clear top",
cr_clrt_l: ["run a clearing pass over","the bounding area of the part","at z = 0"],
cr_clrp_s: "clear voids",