calculate max tool slice offset once
This commit is contained in:
parent
ff50f110dd
commit
e1c1da746e
2 changed files with 7 additions and 6 deletions
|
|
@ -58,6 +58,7 @@ class Topo4 {
|
|||
this.resolution = resolution;
|
||||
this.vertices = widget.getGeoVertices().toShared();
|
||||
this.tool = tool.generateProfile(resolution).profile;
|
||||
this.maxo = tool.profileDim.maxo * resolution;
|
||||
this.diam = tool.fluteDiameter();
|
||||
|
||||
onupdate(0, "lathe");
|
||||
|
|
@ -196,17 +197,14 @@ class Topo4 {
|
|||
}
|
||||
|
||||
lathePath(slices, tool) {
|
||||
const { resolution, step, zBottom } = this;
|
||||
const { resolution, step, zBottom, maxo } = this;
|
||||
|
||||
const tlen = tool.length;
|
||||
const slen = slices.length;
|
||||
const sinc = Math.max(1, Math.ceil(step / resolution));
|
||||
const heights = [];
|
||||
|
||||
// console.log({ slen, step, resolution, sinc });
|
||||
|
||||
// cull slice lines to only the ones in range (5x faster)
|
||||
const maxo = Math.max(...tool) * resolution;
|
||||
const oslices = [];
|
||||
for (let slice of slices) {
|
||||
const lines = slice.lines;
|
||||
|
|
|
|||
Loading…
Reference in a new issue