[vtkusers] Interpolating point on a surface

Bill Lorensen bill.lorensen at gmail.com
Thu Jan 21 08:31:04 EST 2010


David,

I fixed your example: http://vtk.org/Wiki/VTK/Examples/InterpolateTerrain

You had the input and source reversed. Probe takes points from the
input and samples the source.
// vtkProbeFilter is a filter that computes point attributes (e.g., scalars,
// vectors, etc.) at specified point positions. The filter has two inputs:
// the Input and Source. The Input geometric structure is passed through the
// filter. The point attributes are computed at the Input point positions
// by interpolating into the source data.

I also cleaned it up and replaced the non-portable drand with vtkMath::Random.

Bill

On Wed, Jan 20, 2010 at 11:48 AM, David Doria <daviddoria+vtk at gmail.com> wrote:
> On Wed, Jan 20, 2010 at 11:30 AM, David Doria <daviddoria+vtk 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
> Thanks,
>
> David
>
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the VTK FAQ at:
> http://www.vtk.org/Wiki/VTK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
>
>



More information about the vtkusers mailing list