[vtkusers] vtkImageData::FindCell

David Gobbi david.gobbi at gmail.com
Tue Nov 30 11:22:49 EST 2010


On Tue, Nov 30, 2010 at 9:14 AM, David Doria <daviddoria at gmail.com> wrote:

> > FindCell does what it is supposed to.  The documentation says:
> > "Returns cellId >= 0 if inside, < 0 otherwise."
> >   - David
>
> Changing the query point from
>
> double p[3] = {1.0,1.0,1.0};
>
> to
>
> double p[3] = {0.9,0.9,0.9};
>
> returns the cell id of 0 as it should.
>
> I thought the tolerance parameter (which I've set to 10.0) determined
> if the point was "inside"? Since (1.0,1.0,1.0) is less than 10.0 away
> from all of the cells, shouldn't it be considered "inside"?
>

No, that's not what tolerances are for.  The tolerance is only used in
cases where, due to expected roundoff error, the algorithm is uncertain
about whether the point is inside or outside.  If the algorithm is certain
about whether the point is inside or outside, the tolerance is not applied.

Keep all tolerances on the scale of the anticipated roundoff error, i.e.
between 1e-16 and 1e-3 depending on the algorithm.  If you aren't sure
what the expected error is, use the default tolerance.

  David


>
> Also, the documentation for vtkImageData::FindCell is not helpful:
>
> http://www.vtk.org/doc/nightly/html/classvtkImageData.html#a649a10235c8fdf88b110cb763149cabd
>
> should the documentation of vtkDataSet::FindCell
> (
> http://www.vtk.org/doc/nightly/html/classvtkDataSet.html#a2221c10d3c4cca44e82c5ef70e4e1cbd
> )
> be duplicated? Or at  least link directly to vtkDataSet::FindCell from
> vtkImageData::FindCell ?
>
> David
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20101130/c9eead64/attachment.htm>


More information about the vtkusers mailing list