add outline outside-only option for doing cutouts

This commit is contained in:
Stewart Allen 2020-11-28 19:20:21 -05:00
commit 079a8ad37d
4 changed files with 13 additions and 2 deletions

View file

@ -424,6 +424,7 @@
camOutlineSpeed: 800,
camOutlinePlunge: 250,
camOutlineWide: false,
camOutlineOut: false,
camOutlineIn: false,
camOutlineOn: false,
camContourTool: 1000,

View file

@ -1580,8 +1580,9 @@
camOutlineDown: UC.newInput(LANG.cc_sdwn_s, {title:LANG.cc_sdwn_l, convert:UC.toFloat, modes:CAM, units:true}),
camOutlineSpeed: UC.newInput(LANG.cc_feed_s, {title:LANG.cc_feed_l, convert:UC.toInt, modes:CAM, units:true}),
camOutlinePlunge: UC.newInput(LANG.cc_plng_s, {title:LANG.cc_plng_l, convert:UC.toInt, modes:CAM, units:true}),
camOutlineIn: UC.newBoolean(LANG.co_olin_s, onBooleanClick, {title:LANG.co_olin_l, modes:CAM, show:() => { return !UI.camOutlineOut.checked }}),
camOutlineOut: UC.newBoolean(LANG.co_olot_s, onBooleanClick, {title:LANG.co_olot_l, modes:CAM, show:() => { return !UI.camOutlineIn.checked }}),
camOutlineWide: UC.newBoolean(LANG.co_wide_s, onBooleanClick, {title:LANG.co_wide_l, modes:CAM, show:() => { return !UI.camOutlineIn.checked }}),
camOutlineIn: UC.newBoolean(LANG.co_olin_s, onBooleanClick, {title:LANG.co_olin_l, modes:CAM}),
camOutlineSep: UC.newBlank({class:"pop-sep"}),
camOutlineOn: UC.newBoolean(LANG.co_olen_s, onBooleanClick, {title:LANG.co_olen_l, modes:CAM}),
camContour: UC.newGroup(LANG.cn_menu, null, {modes:CAM, marker:true}),

View file

@ -35,9 +35,10 @@
procFacing = proc.camRoughOn && proc.camZTopOffset && hasStock,
procRough = proc.camRoughOn && proc.camRoughDown,
procRoughIn = proc.camRoughIn,
procOutlineWide = proc.camOutlineWide,
procOutlineOut = proc.camOutlineOut,
procOutlineIn = proc.camOutlineIn,
procOutlineOn = proc.camOutlineOn,
procOutlineWide = proc.camOutlineWide,
procOutline = procOutlineOn && proc.camOutlineDown,
procContourX = proc.camContourXOn && proc.camOutlinePlunge,
procContourY = proc.camContourYOn && proc.camOutlinePlunge,
@ -404,6 +405,12 @@
slices.forEach(slice => {
let tops = slice.shadow;
// outside only (use tshadow for entire cut)
if (procOutlineOut) {
tops = tshadow;
}
let offset = POLY.expand(tops, outlineToolDiam / 2, slice.z);
if (!(offset && offset.length)) {
return;

View file

@ -309,6 +309,8 @@ kiri.lang['en-us'] = {
co_wide_l: "widen outside cutout paths\nfor deep cuts in hard material",
co_olin_s: "inside only",
co_olin_l: "limit cutting to\ninside part boundaries",
co_olot_s: "outside only",
co_olot_l: "limit cutting to\exterior part boundaries\nwhich can be thought of\nas the shadow outline",
co_olen_s: "enable",
co_olen_l: "enabled outline cutting",