Merge branch 'rel-4.0' into dev-4.0-refactor-mesh
This commit is contained in:
commit
e44716e5b9
1 changed files with 2 additions and 5 deletions
|
|
@ -1200,10 +1200,8 @@ class Polygon {
|
||||||
// Machine will travel from "fromPoint" to "nearest point x, y, z' => with z' = point z + rampZ",
|
// Machine will travel from "fromPoint" to "nearest point x, y, z' => with z' = point z + rampZ",
|
||||||
// then start the ease down along path.
|
// then start the ease down along path.
|
||||||
const rampZ = 2.0;
|
const rampZ = 2.0;
|
||||||
|
|
||||||
while (true) {
|
while (true) {
|
||||||
next = points[index % length];
|
next = points[index % length];
|
||||||
|
|
||||||
if (last && next.z < fromZ) {
|
if (last && next.z < fromZ) {
|
||||||
// When "in Ease-Down" (ie. while target Z not yet reached) - follow path while slowly decreasing Z.
|
// When "in Ease-Down" (ie. while target Z not yet reached) - follow path while slowly decreasing Z.
|
||||||
let deltaZ = fromZ - next.z;
|
let deltaZ = fromZ - next.z;
|
||||||
|
|
@ -1225,7 +1223,6 @@ class Polygon {
|
||||||
} else if (offset === 0 && next.z < fromZ) {
|
} else if (offset === 0 && next.z < fromZ) {
|
||||||
// First point, move to rampZ height above next.
|
// First point, move to rampZ height above next.
|
||||||
let deltaZ = fromZ - next.z;
|
let deltaZ = fromZ - next.z;
|
||||||
|
|
||||||
fromZ = next.z + Math.min(deltaZ, rampZ)
|
fromZ = next.z + Math.min(deltaZ, rampZ)
|
||||||
next = next.clone().setZ(fromZ);
|
next = next.clone().setZ(fromZ);
|
||||||
}
|
}
|
||||||
|
|
@ -1237,7 +1234,7 @@ class Polygon {
|
||||||
if (touch < 0 && next.z <= targetZ) {
|
if (touch < 0 && next.z <= targetZ) {
|
||||||
// Save touch-down index so as to be able to "complete" the full cut at target Z,
|
// Save touch-down index so as to be able to "complete" the full cut at target Z,
|
||||||
// i.e. keep following the path loop until the touch down point is reached again.
|
// i.e. keep following the path loop until the touch down point is reached again.
|
||||||
touch = ((index - 1) % length);
|
touch = ((index + length) % length);
|
||||||
}
|
}
|
||||||
index++;
|
index++;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue