Add comprehensive triangle splitting tests#248
Open
TheBeachLab wants to merge 4 commits into
Open
Conversation
Replaces CDTTriangleSplitter with a polygon-aware approach that groups split sub-triangles into regions for bulk classification, reducing raycasts and enabling symmetric edge matching across CSG boundaries.
5-task TDD plan: create PolygonSplitter with flood-fill polygon grouping, wire into Evaluator, update split triangle operations for bulk classification, add canonical edge sharing, verify with benchmarks.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Parameterized test suite validates both LegacyTriangleSplitter and CDTTriangleSplitter against 8 edge cases (coplanar, identical, vertex-on-edge, clean bisection, etc.) plus a seeded fuzz test with 100 random triangle pairs checking area conservation, coplanarity, and degenerate triangle invariants.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Addresses #73 — adds comprehensive tests for validating triangle splitting correctness.
LegacyTriangleSplitterandCDTTriangleSplitterTest Cases
Test Plan
npx vitest run tests/TriangleSplitter.test.js— 18 tests passnpx vitest run— full suite passes (48 tests)npm run lint— 0 errors