add tool diameter to slice range to full carve part

This commit is contained in:
Stewart Allen 2023-02-13 15:47:39 -05:00
commit ff50f110dd

View file

@ -58,6 +58,7 @@ class Topo4 {
this.resolution = resolution; this.resolution = resolution;
this.vertices = widget.getGeoVertices().toShared(); this.vertices = widget.getGeoVertices().toShared();
this.tool = tool.generateProfile(resolution).profile; this.tool = tool.generateProfile(resolution).profile;
this.diam = tool.fluteDiameter();
onupdate(0, "lathe"); onupdate(0, "lathe");
@ -94,6 +95,10 @@ class Topo4 {
range.max = Math.max(range.max, x); range.max = Math.max(range.max, x);
} }
// add tool radius to slice min/max range ot fully carve part
range.min -= this.diam / 2;
range.max += this.diam / 2;
const shards = Math.ceil(Math.min(25, vertices.length / 27000)); const shards = Math.ceil(Math.min(25, vertices.length / 27000));
const step = (range.max - range.min) / shards; const step = (range.max - range.min) / shards;