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++) {
let np = points[i];
let ndz = np.z - lp.z;
if (Math.abs(dz - ndz) > epsilon) {
if (Math.abs(dz - ndz) > flatness) {
// slope changed
merged.push(lp);
dz = ndz;
} else if (curvesOnly && Math.abs(ndz) < epsilon) {
} else if (curvesOnly && Math.abs(ndz) < flatness) {
// add empty points as path separators
merged.push(undefined);
}