[vtk-developers] Adding IntersectWithRay function to CellLocator?

David Doria daviddoria+vtk at gmail.com
Thu Jan 21 19:35:19 EST 2010


Often I use the IntersectWithLine function when I really want to intersect
an infinite ray. I'll do something like this:

P2 = P1 + 1e5 * V (unit vector)
IntersectWithLine(..., P1, P2, ....)

Can we hide this "hack" from users with something like:

IntersectWithRay(P1, V)
{
double inf = std::numeric_limits<double>::infinity();
//clearly not actually infinity, but some very large number
//or we could compute the maximum projection along the line of the object to
be intersected, and use this value + epsilon
P2 = P1 + inf * V (unit vector)
IntersectWithLine(P1, P2)
}

Thoughts?

David
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtk-developers/attachments/20100121/dee30ff3/attachment.html>


More information about the vtk-developers mailing list