add expand option to pockets

This commit is contained in:
Stewart Allen 2022-04-07 17:07:10 -04:00
commit 4ac00b92a5
5 changed files with 11 additions and 3 deletions

View file

@ -1037,6 +1037,7 @@ CAM.init = function(kiri, api) {
down: 'camPocketDown',
rate: 'camPocketSpeed',
plunge: 'camPocketPlunge',
expand: 'camPocketExpand'
}).inputs = {
tool: UC.newSelect(LANG.cc_tool, {}, "tools"),
sep: UC.newBlank({class:"pop-sep"}),
@ -1045,6 +1046,7 @@ CAM.init = function(kiri, api) {
down: UC.newInput(LANG.cc_sdwn_s, {title:LANG.cc_sdwn_l, convert:UC.toFloat, units:true}),
rate: UC.newInput(LANG.cc_feed_s, {title:LANG.cc_feed_l, convert:UC.toInt, units:true}),
plunge: UC.newInput(LANG.cc_plng_s, {title:LANG.cc_plng_l, convert:UC.toInt, units:true}),
expand: UC.newInput(LANG.cp_xpnd_s, {title:LANG.cp_xpnd_l, convert:UC.toFloat, units:true}),
sep: UC.newBlank({class:"pop-sep"}),
menu: UC.newRow([
UC.newButton(undefined, func.surfaceAdd, {icon:'<i class="fas fa-plus"></i>'}),

View file

@ -87,7 +87,7 @@ kiri.load(api => {
CAM.surface_find = function(widget, faces) {
CAM.surface_prep(widget);
return widget.tool.findConnectedSurface(faces, 0.1, 0.001);
return widget.tool.findConnectedSurface(faces, 0.1, 0.1);
};
kiri.worker.cam_surfaces = function(data, send) {

View file

@ -924,7 +924,7 @@ class OpPocket extends CamOp {
slice(progress) {
let { op, state } = this;
let { tool, rate, down, plunge } = op;
let { tool, rate, down, plunge, expand } = op;
let { settings, widget, sliceAll, zMax, zTop, zThru, tabs } = state;
let { updateToolDiams, cutTabs, cutPolys, healPolys } = state;
let { process, stock } = settings;
@ -968,6 +968,7 @@ class OpPocket extends CamOp {
}
function clearZ(polys, z, down) {
let zs = down ? base.util.lerp(zTop, z, down) : [ z ];
if (expand) polys = POLY.offset(polys, expand);
for (let poly of polys) {
genShadows(zs);
for (let z of zs) {

View file

@ -498,6 +498,7 @@ const conf = exports({
camPocketDown: 1,
camPocketSpeed: 250,
camPocketPlunge: 200,
camPocketExpand: 0,
camDrillTool: 1000,
camDrillSpindle: 1000,
camDrillDownSpeed: 250,

View file

@ -498,6 +498,10 @@ self.kiri.lang['en-us'] = {
cu_type_s: "type",
cu_type_l: ["clear = clear a closed-line pocket","follow = tool tip follows line","with offset option when closed"],
// CNC POCKET
cp_xpnd_s: "expand",
cp_xpnd_l: ["grow selected area to","encompass corners"],
// CNC DRILLING
cd_menu: "drill",
cd_axis: "axis",