TriangleSplitter: Enable symmetrical clipping along connected edges
gkjohnson opened this issue · comments
Garrett Johnson commented
Related to #49
Requirements
- Add a variation of TriangleSplitter that will clip triangles such that edges are symmetrically split so the edges line up and can be connected in the
HalfEdgeMap
.
Approach
- When clipping triangles construct polygons from connected loops of edges from the edges derived from triangle intersections.
- Once all polygons have been found from the split determine whether they're inside or outside the model using the existing determination method (raycasting).
- For the polygons to keep run the three.js built-in Earcut method to triangulate the polygon to add to the final geometry.
Notes
- Alternatively the half edge structure could be redesigned to not require a 1:1 relationship on edges. Instead if triangles connect at T-junctions the relationships can be 1 to many, though this would be significantly more complicated and require ensuring the full length of the edge is accounted for.
- Polygon triangulation:
Antonio González Viegas commented
Hey, we are offering a bounty of $500 for this issue. Whoever solves it, will get that money. 😎
Garrett Johnson commented
See approach from paper in #97 which may help limit the amount of unnecessary inserted edge vertices on clipping.