diff --git a/src/kiri-mode/cam/ops.js b/src/kiri-mode/cam/ops.js index 7834ae2d..ee1f4b8c 100644 --- a/src/kiri-mode/cam/ops.js +++ b/src/kiri-mode/cam/ops.js @@ -841,7 +841,7 @@ class OpLathe extends CamOp { this.topo = await CAM.Topo4({ op, - state: state, + state, onupdate: (pct, msg) => { progress(pct, msg); }, diff --git a/src/kiri-mode/cam/topo4.js b/src/kiri-mode/cam/topo4.js index 5e76b2fb..8d82242a 100644 --- a/src/kiri-mode/cam/topo4.js +++ b/src/kiri-mode/cam/topo4.js @@ -53,6 +53,7 @@ class Topo4 { console.log(widget.id, 'topo4 auto tolerance', resolution.round(4)); } + this.zBottom = state.zBottom; this.resolution = resolution; this.vertices = widget.getGeoVertices().toShared(); this.tool = tool.generateProfile(resolution).profile; @@ -188,7 +189,7 @@ class Topo4 { } lathePath(slices, tool) { - const { resolution, step } = this; + const { resolution, step, zBottom } = this; const tlen = tool.length; const slen = slices.length; @@ -254,7 +255,7 @@ class Topo4 { } } } - heights.push(rx, 0, mz); + heights.push(rx, 0, Math.max(zBottom, mz)); } return heights;