From edf0a8ceb884cf648a52799ca700f110c44081ed Mon Sep 17 00:00:00 2001 From: bakedpotatolord Date: Sun, 13 Jul 2025 20:26:32 -0600 Subject: [PATCH] make bottom clear configurable --- src/cli/kiri-cam-process.json | 1 + src/kiri/core/conf.js | 1 + src/kiri/mode/cam/cl-ops.js | 10 ++++++---- src/kiri/mode/cam/op-helical.js | 30 ++++++++++++++---------------- web/kiri/lang/en.js | 2 ++ 5 files changed, 24 insertions(+), 20 deletions(-) diff --git a/src/cli/kiri-cam-process.json b/src/cli/kiri-cam-process.json index aafaa030..4b4db740 100644 --- a/src/cli/kiri-cam-process.json +++ b/src/cli/kiri-cam-process.json @@ -59,6 +59,7 @@ "camHelicalDownSpeed": 250, "camHelicalSpeed": 1000, "camHelicalDown": 5, + "camHelicalBottomFinish":true, "camHelicalThru": 0, "camHelicalOffset": "auto", "camHelicalForceStartAngle": false, diff --git a/src/kiri/core/conf.js b/src/kiri/core/conf.js index e054bcb5..e69c247b 100644 --- a/src/kiri/core/conf.js +++ b/src/kiri/core/conf.js @@ -522,6 +522,7 @@ export const conf = { camHelicalDownSpeed: 250, camHelicalSpeed: 1000, camHelicalDown: 5, + camHelicalBottomFinish: true, camHelicalThru: 0, camHelicalOffset: "auto", camHelicalForceStartAngle: false, diff --git a/src/kiri/mode/cam/cl-ops.js b/src/kiri/mode/cam/cl-ops.js index e8e75cf8..0cbf2aec 100644 --- a/src/kiri/mode/cam/cl-ops.js +++ b/src/kiri/mode/cam/cl-ops.js @@ -525,15 +525,16 @@ export function createPopOps() { createPopOp('helical', { tool: 'camHelicalTool', + offset: 'camHelicalOffset', spindle: 'camHelicalSpindle', rate: 'camHelicalDownSpeed', feed: 'camHelicalSpeed', down: 'camHelicalDown', - thru: 'camHelicalThru', - offset: 'camHelicalOffset', - forceStartAng:'camHelicalForceStartAngle', + finish: 'camHelicalBottomFinish', startAng:'camHelicalStartAngle', offOver: 'camHelicalOffsetOverride', + thru: 'camHelicalThru', + forceStartAng:'camHelicalForceStartAngle', fromTop: 'camHelicalFromStockTop', }).inputs = { tool: UC.newSelect(LANG.cc_tool, {}, "tools"), @@ -546,7 +547,8 @@ export function createPopOps() { startAng: UC.newInput(LANG.ch_stra_s, {title:LANG.ch_stra_l, convert:UC.toDegsFloat, bound:UC.bound(-360,360),show:() => env.poppedRec.forceStartAng}), offOver: UC.newInput(LANG.cc_offd_s, {title:LANG.cc_offd_l, convert:UC.toFloat, units:true, bound:UC.bound(0,Infinity)}), sep: UC.newBlank({class:"pop-sep"}), - forceStartAng: UC.newBoolean(LANG.ch_fsta_s, undefined, {title:LANG.ch_fsta_l, }), + finish: UC.newBoolean(LANG.ch_fini_s,undefined, { title:LANG.ch_fini_l }), + forceStartAng: UC.newBoolean(LANG.ch_fsta_s, undefined, {title:LANG.ch_fsta_l }), fromTop: UC.newBoolean(LANG.cd_ftop_s,undefined, {title:LANG.cd_ftop_l}), sep: UC.newBlank({class:"pop-sep"}), thru: UC.newInput(LANG.cd_thru_s, {title:LANG.cd_thru_l, convert:UC.toFloat, units:true}), diff --git a/src/kiri/mode/cam/op-helical.js b/src/kiri/mode/cam/op-helical.js index 0045fe3d..5ecd4103 100644 --- a/src/kiri/mode/cam/op-helical.js +++ b/src/kiri/mode/cam/op-helical.js @@ -24,6 +24,7 @@ export class OpHelical extends CamOp { offset, down, thru, + finish, } = op; let {stock} = settings @@ -139,22 +140,19 @@ export class OpHelical extends CamOp { }) ); - // poly.addPoints([ - // newPoint(0,0,0) - // ]) - - //do a full circle at the bottom - poly.addPoints( - arcToPath(finalEnd, finalEnd, numSegs, { - clockwise, - radius, - center, - }), - ); - - poly.append( - finalEnd.clone().setZ(zBottom), - ) + //if settings dictate, do a full circle at the bottom + if(finish){ + poly.addPoints( + arcToPath(finalEnd, finalEnd, numSegs, { + clockwise, + radius, + center, + }), + ); + poly.append( + finalEnd.clone().setZ(zBottom), + ) + } break; } currentZ = bottom; diff --git a/web/kiri/lang/en.js b/web/kiri/lang/en.js index 7a3b2ced..db0776cd 100644 --- a/web/kiri/lang/en.js +++ b/web/kiri/lang/en.js @@ -617,6 +617,8 @@ self.lang['en-us'] = { ch_stra_s: "start angle", ch_stra_l: ["start angle of helix","in degrees ccw of +x axis"], ch_selc_l: ["select a cylinder face", "inner holes that are too small","will be ignored."], + ch_fini_s: "bottom finish pass", + ch_fini_l: ["trace a circle at bottom of helix","used for hole clearing"], // CNC FLIP