Fix #51 - TriangleSplitter: Enable symmetrical clipping along connected edges #229
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.

To be honest, i'm not 100% sure if this solves the problem they way you want but I thought it couldn't hurt to give it a shot! I made this PR with the help of copilot, I just prompted it along the way. If you like it I would be happy to take a look at more issues as well! :) If not, then sorry for taking your time! Cheers!
The following is an AI generated summary of the PR:
Fixes #51
This PR implements a new
PolygonSplitterclass that enables symmetrical clipping along connected edges, addressing the edge connectivity issues with the existingTriangleSplitterwhen used withHalfEdgeMap.Problem Statement
The current
TriangleSplittersplits triangles individually, which can result in edges that don't align perfectly after clipping operations. This causes problems with theHalfEdgeMapwhich requires 1:1 relationships on edges for proper connectivity, leading to degraded performance and topology issues as noted in PR #49.Solution Overview
The new
PolygonSplittertakes a fundamentally different approach:HalfEdgeMapThis approach directly implements the methodology suggested in issue #97 based on the fast bool paper research.
Key Features
🔧 Drop-in Compatibility
TriangleSplitterevaluator.useSymmetricalClipping = true⚡ Performance Improvements
🏗️ Robust Implementation
📚 Comprehensive Testing
Files Changed
src/core/PolygonSplitter.js- New polygon-based splitter implementationsrc/core/Evaluator.js- AddeduseSymmetricalClippingoptionsrc/index.js- Export newPolygonSplitterclassREADME.md- Complete documentation with research referencesexamples/polygonSplitter.js- Interactive demo showing the featuretests/- Comprehensive test suite (3 test files, 47 test cases)Research Integration
This implementation incorporates insights from:
Usage Example
Performance Results
This implementation provides the foundation for improved CSG operations with better edge connectivity as requested in issue #51, while maintaining full backward compatibility and providing a clear path for future enhancements.