59 minutes ago, teutoburger said:
something like a winged edge structure, right?
Not sure what that is, but i mean for each edge have indices to left / right triangle. Further The whole mesh needs consistent winding order (each triangle has clockwise vertices. The mesh needs to be closed... the typical requirements).
59 minutes ago, teutoburger said:
I think I get the idea of how the triangle adjacency information allows you to disregard the majority of triangles. Correct me if I'm wrong..
Find a edge that intersects the plane, split it and go to the left trianlge, find the other edge of that triangle that intersects the plane and continue with the other triangle from that edge until you get back to the starting edge. During that add each split point to the volume / plane intersection polygon.
No Set required. Processing any edge just once. Works only for convex meshes (otherwise need to find all starting edges, not just any single one).
It's like cutting a mesh made of paper with a scissor, so just in order vs. poking individual cuts into random triangles like traditional frustum clipping would do.
(I've just implemented tracing a crossfield on mesh surface, which is pretty similar and i used this simple algorithm without issues.)
59 minutes ago, teutoburger said:
*How do you find the very first T, that intersects, without looking up every triangle in the mesh until you hit one that intersects the plane? So the worst case is you check them all, the average case is somewhere around 1/2'N checks? Or is there a much better way that I'm missing here?
Yeah you are right - the need to find a single intersecting edge kinda destroys the advantage we do not walk to triangles not touching the plane while cutting.
But you could speed this up when everything else works as well:
Pick a random vertex and select the edge closest to the plane, continue until you find an intersecting edge.
Again this works only for the convex case (and you may need more adjacency information like vertex knowing all its edges - pretty annoying to maintain