[vtk-developers] Adding IntersectWithRay function to CellLocator?
David Doria
daviddoria+vtk at gmail.com
Mon Feb 1 11:53:59 EST 2010
On Thu, Jan 21, 2010 at 7:35 PM, David Doria
<daviddoria+vtk at gmail.com<daviddoria%2Bvtk at gmail.com>
> wrote:
> 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
>
Any thoughts on this?
Thanks,
David
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtk-developers/attachments/20100201/416ea989/attachment.html>
More information about the vtk-developers
mailing list