Bug in `vtkQuad::IntersectWithLine`
If you look at vtkQuad::IntersectWithLine
, you should notice that d1 == 0
and d2 == 0
because the distance is computed between 2 points sharing the same memory address. Indeed, vtkPoints::GetPoint
returns an internal buffer that always points to the same address.
I fixed this bug in a branch, but it turns out that it breaks a test. Fixing this bug only impacts non-planar quads.
Looking at that, it makes me wonder why should non-planar quads be treated in this algorithm, because there are 2 ways to tesselate it, and choosing the tesselation strategy is very much arbitrary. If one wants non-planar quads, one should probably use a vtkNonLinearCell
. At least the user would know beforehand what its cell looks like.
Should we fix the code keeping the same tesselation strategy and update the failing baseline, or should we simplify the intersection detection assuming that a vtkQuad
is always planar?