fix use of flatness to drop points in gpu contour

This commit is contained in:
Stewart Allen 2025-12-23 10:39:36 -05:00
commit 15acdcfcba

View file

@ -252,11 +252,11 @@ export class Topo {
for (let i=2; i<points.length; i++) { for (let i=2; i<points.length; i++) {
let np = points[i]; let np = points[i];
let ndz = np.z - lp.z; let ndz = np.z - lp.z;
if (Math.abs(dz - ndz) > epsilon) { if (Math.abs(dz - ndz) > flatness) {
// slope changed // slope changed
merged.push(lp); merged.push(lp);
dz = ndz; dz = ndz;
} else if (curvesOnly && Math.abs(ndz) < epsilon) { } else if (curvesOnly && Math.abs(ndz) < flatness) {
// add empty points as path separators // add empty points as path separators
merged.push(undefined); merged.push(undefined);
} }