diff --git a/package.json b/package.json index 700ab8b6..a0b67cd1 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "grid-apps", - "version": "3.8.13D", + "version": "3.8.14D", "description": "grid.space 3d slice & modeling tools", "author": "Stewart Allen ", "license": "MIT", diff --git a/release.md b/release.md index 9ad6ee95..b40df653 100644 --- a/release.md +++ b/release.md @@ -27,6 +27,7 @@ Full docs @ https://docs.grid.space/projects/kiri-moto * CAM add omit pocket option to outline op * CAM add trace support for taper tip diameter * CAM add trace offset override +* CAM add leave stock to contour # Release 3.7 (2022-11-12) diff --git a/src/kiri-mode/cam/animate.js b/src/kiri-mode/cam/animate.js index ec2f496a..13d57a71 100644 --- a/src/kiri-mode/cam/animate.js +++ b/src/kiri-mode/cam/animate.js @@ -382,6 +382,7 @@ kiri.load(() => { let renderSpeed = 0; let skipMove = null; let toolUpdate; + let depth = 0; // send latest tool position and progress bar function renderUpdate(send) { @@ -488,8 +489,8 @@ kiri.load(() => { deformMesh(pos, send); toolUpdate = { mesh_move: { id, pos }}; // pause renderer at specified offsets - if (renderSpeed && renderDist >= renderSpeed) { - renderDist = 0; + if ((renderSpeed && renderDist >= renderSpeed) || (depth > 600)) { + renderDist = depth = 0; renderUpdate(send); setTimeout(() => { renderMoves(id, moves, send, index); @@ -497,6 +498,7 @@ kiri.load(() => { return; } } + depth++; renderPath(send); } diff --git a/src/kiri-mode/cam/client.js b/src/kiri-mode/cam/client.js index d9681ea7..405701c4 100644 --- a/src/kiri-mode/cam/client.js +++ b/src/kiri-mode/cam/client.js @@ -1295,6 +1295,7 @@ CAM.init = function(kiri, api) { step: 'camContourOver', rate: 'camContourSpeed', angle: 'camContourAngle', + leave: 'camContourLeave', tolerance: 'camTolerance', flatness: 'camFlatness', bridging: 'camContourBridge', @@ -1311,6 +1312,7 @@ CAM.init = function(kiri, api) { sep: UC.newBlank({class:"pop-sep"}), step: UC.newInput(LANG.cc_sovr_s, {title:LANG.cc_sovr_l, convert:UC.toFloat, bound:UC.bound(0.01,2.0)}), angle: UC.newInput(LANG.cf_angl_s, {title:LANG.cf_angl_l, convert:UC.toFloat, bound:UC.bound(45,90)}), + leave: UC.newInput(LANG.cf_leav_s, {title:LANG.cf_leav_l, convert:UC.toFloat, bound:UC.bound(0,100)}), sep: UC.newBlank({class:"pop-sep"}), flatness: UC.newInput(LANG.ou_flat_s, {title:LANG.ou_flat_l, convert:UC.toFloat, bound:UC.bound(0,1.0), units:true, round:4}), tolerance: UC.newInput(LANG.ou_toll_s, {title:LANG.ou_toll_l, convert:UC.toFloat, bound:UC.bound(0,10.0), units:true, round:4}), diff --git a/src/kiri-mode/cam/ops.js b/src/kiri-mode/cam/ops.js index 329d5ba5..f6db3dac 100644 --- a/src/kiri-mode/cam/ops.js +++ b/src/kiri-mode/cam/ops.js @@ -658,7 +658,7 @@ class OpOutline extends CamOp { // project empty up and render for (let slice of slices) { - if (true) slice.output() + if (false) slice.output() .setLayer("slice", {line: 0xaaaa00}, false) .addPolys(slice.topPolys()) slice.output() diff --git a/src/kiri-mode/cam/topo.js b/src/kiri-mode/cam/topo.js index 1605e5aa..c57faa32 100644 --- a/src/kiri-mode/cam/topo.js +++ b/src/kiri-mode/cam/topo.js @@ -36,7 +36,7 @@ class Topo { contourY = axis === "y", bounds = widget.getBoundingBox().clone(), tolerance = contour.tolerance, - flatness = contour.flatness || 0.001, + flatness = contour.flatness || (tolerance / 100), shadow = tshadow, minX = bounds.min.x, maxX = bounds.max.x, @@ -53,6 +53,7 @@ class Topo { toolDiameter = tool.fluteDiameter(), toolStep = toolDiameter * contour.step, traceJoin = toolDiameter / 2, + leave = contour.leave || 0, maxangle = contour.angle, curvesOnly = contour.curves, bridge = contour.bridging || 0, @@ -180,6 +181,7 @@ class Topo { clipTab, tabHeight, newslices, + leave, color }, (i, l, p) => { onupdate(l / 2 + i / 2, l, p); @@ -302,7 +304,7 @@ class Topo { const { minX, maxX, minY, maxY, boundsX, boundsY, stepsX, stepsY } = params; const { gridDelta, resolution, partOff, toolStep, contourX, contourY } = params; - const { clipTo, clipTab, tabHeight, newslices, color } = params; + const { clipTo, clipTab, tabHeight, newslices, color, leave } = params; let stepsTaken = 0, stepsTotal = 0; @@ -325,6 +327,7 @@ class Topo { trace.init({ box, + leave, clipTo, clipTab, tabHeight, @@ -474,7 +477,7 @@ class Trace { constructor(probe, params) { - const { curvesOnly, maxangle, flatness, bridge, contourX } = params; + const { curvesOnly, maxangle, flatness, bridge, contourX, leave } = params; this.params = params; this.probe = probe; @@ -609,7 +612,7 @@ class Trace { crossY_sync(params, then) { const { push_point, end_poly, newtrace, newslice, inClip } = this.object; - const { clipTab, tabHeight, clipTo, box, resolution } = this.cross; + const { clipTab, tabHeight, clipTo, box, resolution, leave } = this.cross; const { toolAtZ } = this.probe; let { from, to, x, gridx, gridy } = params; const checkr = newPoint(0,0); @@ -636,7 +639,7 @@ class Trace { gridy++; continue; } - push_point(x, y, tv); + push_point(x, y, tv + leave); gridy++; } end_poly(); @@ -645,9 +648,10 @@ class Trace { crossX_sync(params, then) { const { push_point, end_poly, newtrace, newslice, inClip } = this.object; - const { clipTab, tabHeight, clipTo, box, resolution } = this.cross; + const { clipTab, tabHeight, clipTo, box, resolution, leave } = this.cross; const { toolAtZ } = this.probe; let { from, to, y, gridx, gridy } = params; + const checkr = newPoint(0,0); newslice(); newtrace(); @@ -672,7 +676,7 @@ class Trace { gridx++; continue; } - push_point(x, y, tv); + push_point(x, y, tv + leave); gridx++; } end_poly(); diff --git a/src/kiri/conf.js b/src/kiri/conf.js index 92c10422..5476155c 100644 --- a/src/kiri/conf.js +++ b/src/kiri/conf.js @@ -493,6 +493,7 @@ const conf = exports({ camContourOver: 0.5, camContourSpeed: 1000, camContourAngle: 85, + camContourLeave: 0, camContourBottom: false, camContourCurves: false, camContourIn: false, diff --git a/src/main/kiri.js b/src/main/kiri.js index 43042105..1028dbd2 100644 --- a/src/main/kiri.js +++ b/src/main/kiri.js @@ -15,7 +15,7 @@ gapp.main("main.kiri", [], (root) => { const modfns = root.kirimod = ( root.kirimod || [] ); const kiri = root.kiri = { - beta: 3813, + beta: 3814, driver: {}, // driver modules load(fn) { modfns.push(fn); diff --git a/src/moto/license.js b/src/moto/license.js index c59c96e1..92570433 100644 --- a/src/moto/license.js +++ b/src/moto/license.js @@ -5,7 +5,7 @@ let terms = { COPYRIGHT: "Copyright (C) Stewart Allen - All Rights Reserved", LICENSE: "See the license.md file included with the source distribution", - VERSION: (is_self ? self : this).debug_version || "3.8.D13" + VERSION: (is_self ? self : this).debug_version || "3.8.D14" }; if (typeof(module) === 'object') { diff --git a/web/kiri/lang/en.js b/web/kiri/lang/en.js index 332d41bd..456547ba 100644 --- a/web/kiri/lang/en.js +++ b/web/kiri/lang/en.js @@ -510,6 +510,8 @@ self.kiri.lang['en-us'] = { cn_menu: "contour", cf_angl_s: "max angle", cf_angl_l: ["angles greater than this","are considered vertical"], + cf_leav_s: "leave stock", + cf_leav_l: ["amount of stock to leave above part surface"], cf_botm_s: "z bottom", cf_botm_l: ["obey z bottom limit"], cf_curv_s: "curves only",