diff --git a/notes.md b/notes.md index 00f2e77c..9fc89d0f 100644 --- a/notes.md +++ b/notes.md @@ -1,7 +1,11 @@ # Kiri:Moto todo NEXT -- contour outside part boundaries +- contour tabs support +- path arrows +- help dialog +- full bug reports +- frame rate tracking ## `C` cosmetic, `F` functional, `P` performance, `B` bug fix @@ -46,6 +50,7 @@ NEXT * `B` contouring should extend beyond part boundaries by tool radius * `B` outside cutting direction in roughing mode inverted +* `F` flat and volumetric rendering of paths * `F` z bounded slices (extension of z bottom offset feature) * `F` z planar settings visualizations * `F` use arcs to connect acute angles diff --git a/src/kiri/conf.js b/src/kiri/conf.js index 313078e3..03934d50 100644 --- a/src/kiri/conf.js +++ b/src/kiri/conf.js @@ -420,6 +420,7 @@ camContourSpeed: 1000, camContourAngle: 85, camContourCurves: false, + camContourIn: true, camContourXOn: true, camContourYOn: true, camTraceTool: 1000, diff --git a/src/kiri/init.js b/src/kiri/init.js index 87df41f0..d6d02b9c 100644 --- a/src/kiri/init.js +++ b/src/kiri/init.js @@ -1463,6 +1463,7 @@ camContourSpeed: UC.newInput(LANG.cc_feed_s, {title:LANG.cc_feed_l, convert:UC.toInt, modes:CAM, units:true}), camContourAngle: UC.newInput(LANG.cf_angl_s, {title:LANG.cf_angl_l, convert:UC.toFloat, bound:UC.bound(45,90), modes:CAM}), camContourCurves: UC.newBoolean(LANG.cf_curv_s, onBooleanClick, {title:LANG.cf_curv_l, modes:CAM}), + camContourIn: UC.newBoolean(LANG.cf_olin_s, onBooleanClick, {title:LANG.cf_olin_l, modes:CAM}), camContourSep: UC.newBlank({class:"pop-sep"}), camContourXOn: UC.newBoolean(LANG.cf_linx_s, onBooleanClick, {title:LANG.cf_linx_l, modes:CAM}), camContourYOn: UC.newBoolean(LANG.cf_liny_s, onBooleanClick, {title:LANG.cf_liny_l, modes:CAM}), diff --git a/src/mode/cam/slice.js b/src/mode/cam/slice.js index 3fe2aff9..97dc3325 100644 --- a/src/mode/cam/slice.js +++ b/src/mode/cam/slice.js @@ -343,7 +343,8 @@ }, ondone: (slices) => { sliceAll.appendAll(slices); - } + }, + shadow: shadowTop.tops }); } diff --git a/src/mode/cam/topo.js b/src/mode/cam/topo.js index 8add3c4e..ec950733 100644 --- a/src/mode/cam/topo.js +++ b/src/mode/cam/topo.js @@ -7,7 +7,8 @@ let KIRI = self.kiri, BASE = self.base, CAM = KIRI.driver.CAM, - CPRO = CAM.process, + PRO = CAM.process, + POLY = BASE.polygons, newSlice = KIRI.newSlice, newLine = BASE.newLine, newPoint = BASE.newPoint, @@ -16,10 +17,12 @@ class Topo { constructor(widget, settings, options) { - let opt = options || {}, + const opt = options || {}, ondone = opt.ondone || noop, onupdate = opt.onupdate || noop, + shadow = opt.shadow, proc = settings.process, + inside = proc.camContourIn, resolution = proc.camTolerance, tool = new CAM.Tool(settings, proc.camContourTool), toolOffset = tool.generateProfile(resolution).profile, @@ -52,7 +55,11 @@ widget: widget }, newslices = [], - newlines, + clipTo = inside ? shadow : POLY.expand(shadow, toolDiameter), + partOff = inside ? 0 : toolDiameter / 2, + gridDelta = Math.floor(partOff / resolution); + + let newlines, newtop, newtrace, sliceout, @@ -171,31 +178,37 @@ onupdate(++stepsTaken, stepsTotal, "trace surface"); } + const checkr = newPoint(0,0); + const inClip = clipTo ? function() { + checkr.x = x; + checkr.y = y; + for (let i=0; i