From c71786e56a420db3cf81b2cce4283eeca78356fe Mon Sep 17 00:00:00 2001 From: Stewart Allen Date: Tue, 14 Feb 2023 11:03:06 -0500 Subject: [PATCH] add support for tab additions in lathe mode --- src/kiri-mode/cam/topo4.js | 14 ++++++++++++-- src/kiri/widget.js | 16 ++++++++++++++++ 2 files changed, 28 insertions(+), 2 deletions(-) diff --git a/src/kiri-mode/cam/topo4.js b/src/kiri-mode/cam/topo4.js index 2336ff80..19d1f22d 100644 --- a/src/kiri-mode/cam/topo4.js +++ b/src/kiri-mode/cam/topo4.js @@ -62,7 +62,8 @@ class Topo4 { this.zBottom = state.zBottom; this.resolution = resolution; - this.vertices = widget.getGeoVertices().toShared(); + this.vertices = widget.getGeoVertices(); + this.tabverts = widget.getTabVertices(); this.tool = tool.generateProfile(resolution).profile; this.maxo = tool.profileDim.maxo * resolution; this.diam = tool.fluteDiameter(); @@ -87,7 +88,7 @@ class Topo4 { } async slice(onupdate) { - const { vertices, resolution } = this; + const { vertices, resolution, tabverts } = this; const range = this.range = { min: Infinity, max: -Infinity }; const box = this.box = new THREE.Box2(); @@ -106,6 +107,15 @@ class Topo4 { range.min -= this.diam / 2; range.max += this.diam / 2; + // merge in tab vertices (so they don't affect slice range / dimensions) + for (let i=0, l=tabverts.length; i