[vtkusers] Interpolating point on a surface

David Doria daviddoria+vtk at gmail.com
Wed Jan 20 11:48:35 EST 2010


On Wed, Jan 20, 2010 at 11:30 AM, David Doria
<daviddoria+vtk at gmail.com<daviddoria%2Bvtk at gmail.com>
> wrote:

> On Tue, Jan 19, 2010 at 7:02 PM, Kenneth Porter <shiva at sewingwitch.com>wrote:
>
>> --On Tuesday, January 19, 2010 1:21 AM -0500 Darshan Pai <
>> darshanpai at gmail.com> wrote:
>>
>>  I am not exactly sure what you are asking .
>>> maybe you can try the FindPoint() function in vtkPolyData....
>>>
>>
>> Imagine that I'm given a topo map and know latitude and longitude, and
>> need to calculate the altitude.
>>
>> It looks like FindCell might do what I need:
>>
>> <
>> http://www.vtk.org/doc/nightly/html/classvtkDataSet.html#a2221c10d3c4cca44e82c5ef70e4e1cbd
>> >
>>
>> I need to find the triangle that contains an X/Y point, where the Z is
>> unknown, so that I can compute the Z.
>>
>>
>>
> If you have a function of (x,y) (a terrain map), you are probably better
> off interpolating on a 2D grid with the z values stored as scalars of the 2D
> points.
>
> I tried to make a demo here:
> http://www.vtk.org/Wiki/VTK/Examples/InterpolateTerrain
>
> but the only interpolation class I know of, vtkShepardMethod, doesn't want
> to let me sample at a single point. Anyone know how to, given a field of
> points with scalars, interpolate the value at a specific point (x,y,z)?
>
> Thanks,
>
> David
>

Ah, I believe this is a perfect demo of vtkProbeFilter (that I've been
looking for for a while now). I've updated the example, but it still doesn't
work - if you can figure out how to get the data out of the probe you should
be good to go. Please let us know if you do.
http://www.vtk.org/Wiki/VTK/Examples/InterpolateTerrain
<http://www.vtk.org/Wiki/VTK/Examples/InterpolateTerrain>
Thanks,

David
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20100120/d7936eb2/attachment.htm>


More information about the vtkusers mailing list