[230] Ear-Clipping: Toleranz Ausdehnung·1e-7 (feine Kreise behalten ihre Ecken); Test prüft Abdeckung statt Dreieckszahl

This commit is contained in:
Claude committed 2026-11-13 03:10:09 +00:00
1 parent 769ea2f687
commit 1bf89b53e2
3 files changed
+7 -5

No files matched your search

+4 -2
View File
@@ -168,8 +168,10 @@ describe('triangulate', () => {
const t0 = performance.now();
const idx = triangulate(big);
const ms = performance.now() - t0;
expect(idx.length).toBe((n - 2) * 3);
expect(triArea(big, idx)).toBeCloseTo(polyArea(big), 0);
// [230] (fast) flache Ecken fallen ohne Dreieck weg — es zählt, dass die Fläche ganz gedeckt ist.
expect(idx.length).toBeGreaterThan((n - 10) * 3);
expect(idx.length).toBeLessThanOrEqual((n - 2) * 3);
expect(triArea(big, idx)).toBeCloseTo(polyArea(big), 3);
expect(ms).toBeLessThan(1000);
});
});