five-on-it / packages/world/src/audit/coplanar
packages/world/src/audit/coplanar
The search for z-fighting: two faces in one plane, facing the same way, in different colours, which the renderer flickers between (a roof and the cornice round it, a pad flush with the ground). coplanarOverlaps searches a soup of triangles; levelZFighting searches a whole level cheaply, each distinct mesh once in its own frame (a placement's pose and scale keep a plane a plane) and across pieces only the planes two pieces' faces share.