gkjohnson / three-bvh-csg

A flexible, memory compact, fast and dynamic CSG implementation on top of three-mesh-bvh

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

TriangleSplitter: Enable symmetrical clipping along connected edges

gkjohnson opened this issue · comments

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

Hey, we are offering a bounty of $500 for this issue. Whoever solves it, will get that money. 😎

See approach from paper in #97 which may help limit the amount of unnecessary inserted edge vertices on clipping.