properly select dx or dy based on contour type
This commit is contained in:
parent
f30865c60a
commit
d3ed594130
1 changed files with 2 additions and 2 deletions
|
|
@ -154,8 +154,8 @@
|
||||||
if (curvesOnly && lastP) {
|
if (curvesOnly && lastP) {
|
||||||
// maxangle
|
// maxangle
|
||||||
const dz = Math.abs(lastP.z - z);
|
const dz = Math.abs(lastP.z - z);
|
||||||
const dxy = Math.max(Math.abs(lastP.x - x), Math.abs(lastP.y - y));
|
const dv = contourX ? Math.abs(lastP.x - x) : Math.abs(lastP.y - y);
|
||||||
const angle = Math.atan2(dz, dxy) * RAD2DEG;
|
const angle = Math.atan2(dz, dv) * RAD2DEG;
|
||||||
// if (lastP.z < 0.1) console.log('pp', {dz, dxy, angle});
|
// if (lastP.z < 0.1) console.log('pp', {dz, dxy, angle});
|
||||||
if (angle > maxangle) {
|
if (angle > maxangle) {
|
||||||
lastP = newP;
|
lastP = newP;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue