added helical to UIs

This commit is contained in:
bakedpotatolord 2025-06-29 12:45:13 -06:00
commit b014d694b2
6 changed files with 68 additions and 14 deletions

View file

@ -54,6 +54,16 @@
"camDrillLift": 2,
"camDrillingOn": false,
"camRegisterSpeed": 1000,
"camHelicalTool": 1000,
"camHelicalSpindle": 1000,
"camHelicalDownSpeed": 250,
"camHelicalSpeed": 1000,
"camHelicalDown": 5,
"camHelicalThru": 0,
"camHelicalOffset": "auto",
"camHelicalForceStartAngle": false,
"camHelicalStartAngle": 0,
"camHelicalOffsetOverride": 0,
"camFlipAxis": "X",
"camFlipOther": "",
"camTabsWidth": 20,

View file

@ -1835,28 +1835,37 @@ CAM.init = function(kiri, api) {
sep: UC.newBlank({class:"pop-sep"}),
thru: UC.newInput(LANG.cd_thru_s, {title:LANG.cd_thru_l, convert:UC.toFloat, units:true}),
};
createPopOp('helical', {
tool: 'camHelicalTool',
mode: 'camHelicalMode',
offset: 'camHelicalOffset',
spindle: 'camHelicalSpindle',
down: 'camHelicalDown',
rate: 'camHelicalDownSpeed',
feed: 'camHelicalSpeed',
thru: 'camRegisterThru'
down: 'camHelicalDown',
thru: 'camHelicalThru',
offset: 'camHelicalOffset',
forceStartAng:'camHelicalForceStartAngle',
startAng:'camHelicalStartAngle',
offOver: 'camHelicalOffsetOverride',
fromTop: 'camHelicalFromStockTop',
}).inputs = {
tool: UC.newSelect(LANG.cc_tool, {}, "tools"),
mode: UC.newSelect(LANG.cc_offs_s, {title: LANG.cc_offs_l,}, "helicalmode"),
offset: UC.newSelect(LANG.cc_offs_s, {title: LANG.cc_offs_l,}, "helicaloff"),
sep: UC.newBlank({class:"pop-sep"}),
spindle: UC.newInput(LANG.cc_spnd_s, {title:LANG.cc_spnd_l, convert:UC.toInt, show:hasSpindle}),
rate: UC.newInput(LANG.cc_plng_s, {title:LANG.cc_plng_l, convert:UC.toInt, units:true}),
feed: UC.newInput(LANG.cc_feed_s, {title:LANG.cc_feed_l, convert:UC.toInt, units:true}),
sep: UC.newBlank({class:"pop-sep"}),
down: UC.newInput(LANG.cc_sdwn_s, {title:LANG.cc_sdwn_l, convert:UC.toFloat, units:true}),
rate: UC.newInput(LANG.cc_plng_s, {title:LANG.cc_plng_l, convert:UC.toFloat, units:true}),
feed: UC.newInput(LANG.cc_feed_s, {title:LANG.cc_feed_l, convert:UC.toFloat, units:true}),
down: UC.newInput(LANG.ch_sdwn_s, {title:LANG.ch_sdwn_l, convert:UC.toFloat, units:true}),
startAng: UC.newInput(LANG.ch_stra_s, {title:LANG.ch_stra_l, convert:UC.toDegsFloat, bound:UC.bound(-360,360),show:() => 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, }),
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}),
actions: UC.newRow([
UC.newButton(LANG.select, ()=>func.selectHoles(true), {title:LANG.cd_seli_l}),
], {class:"ext-buttons f-col"})
};
createPopOp('flip', {

View file

@ -525,6 +525,16 @@ const conf = exports({
camDrillingOn: false,
camRegisterSpeed: 1000,
camRegisterThru: 5,
camHelicalTool: 1000,
camHelicalSpindle: 1000,
camHelicalDownSpeed: 250,
camHelicalSpeed: 1000,
camHelicalDown: 5,
camHelicalThru: 0,
camHelicalOffset: "auto",
camHelicalForceStartAngle: false,
camHelicalStartAngle: 0,
camHelicalOffsetOverride: 0,
camFlipAxis: "X",
camFlipOther: "",
camLaserEnable: ["M321"],

View file

@ -89,16 +89,13 @@ const LISTS = {
{ name: "follow" },
{ name: "clear" }
],
helicalmode: [
{ name: "clear" },
{ name: "threadCutting" }
],
traceoff: [
{ name: "none" },
{ name: "inside" },
{ name: "outside" }
],
helicaloff:[
{ name: "auto" },
{ name: "inside" },
{ name: "outside" },
],

View file

@ -45,6 +45,7 @@ gapp.register("kiri.ui", [], (root, exports) => {
bound,
toInt,
toFloat,
toDegsFloat,
isSticky,
setSticky,
newBoolean,
@ -342,6 +343,18 @@ gapp.register("kiri.ui", [], (root, exports) => {
return nv;
}
function toDegsFloat(){
let nv = this.value !== '' ? parseFloat(this.value) : null;
if (nv !== null && this.bound) nv = this.bound(nv);
nv = (nv+360)% 360; // bound the val to 0-359.99
if (this.setv) {
return this.setv(nv);
} else {
this.value = nv;
}
return nv;
}
function raw() {
return this.value !== '' ? this.value : null;
}

View file

@ -608,6 +608,17 @@ self.kiri.lang['en-us'] = {
cd_sela_s: "Select Matching Diameter",
cd_sela_l: ["select all holes that", "match selected tool diameter"],
// CNC HELICAL tolpath
ch_menu: "helical",
ch_sdwn_s: "step down (pitch)",
ch_sdwn_l: ["z-distance","per revolution","in workspace units","(inverse of threads per unit)", "0 to disable"],
ch_fsta_s: "force start angle",
ch_fsta_l: ["override start angle","defaults to closest point to tool"],
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."],
// CNC FLIP
cf_menu: "flip",
cf_nvrt_s: "z bottom",
@ -643,6 +654,10 @@ self.kiri.lang['en-us'] = {
cl_maxz_s: "max z height",
cl_maxz_l: ["highest Z band position. when set to 0, uses the highest Z point of the workspace"],
// CNC CUTOUT TABS
ct_menu: "tabs",
ct_angl_s: "angle",