three-bvh-csg icon indicating copy to clipboard operation
three-bvh-csg copied to clipboard

Investigate fast bool paper

Open gkjohnson opened this issue 2 years ago • 3 comments

https://twitter.com/Xelatihy/status/1597995979105787905

gkjohnson avatar Dec 20 '22 10:12 gkjohnson

See this image specifically as it relates to #51

image

gkjohnson avatar Jan 22 '23 09:01 gkjohnson

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

gkjohnson avatar Oct 15 '23 10:10 gkjohnson

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.

gkjohnson avatar Mar 09 '24 03:03 gkjohnson