Are you sure? All I see is a determinant check, which is really just a degeneracy check.John McCutchan wrote:I never used closest_is_internal() because my construct_triangle function will return NULL if that is the case and I quit.
I think you need the non-internal triangles because they may be traversed while building the sillouette. This may only come up with complex polytopes.
It seems very tricky to get the correct initial simplex, especially if you have a margin of zero. This can often lead to case 2 and 3 for aligned boxes.
So if we know the orientation of triangles, can't we simplify the origin in tetrahedron test?
I think you need to be more careful about case 2. It is possible that both origin in tetrahedron tests return false when the origin is close to the mid-plane. First we should test the mid-plane, then test the two halves accordingly.
Here's a question (maybe Gino and/or Erwin can chime in). EPA places a lot of importance on enclosing the origin. Can we modify EPA to find the minimum separating axis in both the overlapped and non-overlapped case? Perhaps we can use the signed distance of the origin from each triangle of the embedded polytope. By starting with a tetrahedron, we should be able to avoid local minima in both overlapped and non-overlapped cases. If this is true, we can just initialize EPA in a generic way. Just try to find a tetrahedron inside the CSO, starting from scratch or from some cached features from the previous EPA solution.