three-bvh-csg
three-bvh-csg copied to clipboard
Investigate fast bool paper
https://twitter.com/Xelatihy/status/1597995979105787905
See this image specifically as it relates to #51
TODO
- Project points into a z+ frame with horizontal planet at zero.
- Insert all points (based on edge intersect with plane and triangle extension beyond tri edge) in the triangle set and set some kind of connectivity. Ensure close point intersections are deduped.
- Store all "required" edges for triangle intersection edges. Split external triangle edges where needed - internal edges should not need to be split.
- Find which triangle each new point is contained in and make new connections - preferring the "required" edge orientation if possible. Save which required edges can't be included.
- If a required edge is crossing another we need to invert the crossing triangle edge.
Questions
- Can we retain half edge connectivity here?
- How do we deal with intersecting, co-planar triangles?
- Triangle edges are just treated as edge and point values / intersection lines
Using "Constrained Delaunay Triangulation" may be the simplest way to get this working. See js implementation:
https://github.com/savithru-j/cdt-js
Additionally - a more effective way to deal with coplanar patches is to just remove the unnecessary ones without having to perform raycasts. This may require matching the trimmed patches between the clipped triangles.