[vtkusers] Interpolating point on a surface

Bill Lorensen bill.lorensen at gmail.com
Thu Jan 21 14:13:06 EST 2010


Ken,

I enhanced David D's example:
http://www.vtk.org/Wiki/VTK/Examples/InterpolateTerrain
to use the vtkCellLocator as well as the vtkProbeFilter. If your data
is uniformly spaced in a grid, then the ProbeFilter is appropriate. If
it is not uniform in x,y, then the CellLocator is what you want.

Bill

On Thu, Jan 21, 2010 at 11:13 AM, Bill Lorensen <bill.lorensen at gmail.com> wrote:
> Ken,
>
> I think you want:
> Filtering/vtkCellLocator. It has a method:
>  // Description:
>  // Return intersection point (if any) AND the cell which was intersected by
>  // the finite line. The cell is returned as a cell id and as a generic cell.
>  // For other IntersectWithLine signatures, see vtkAbstractCellLocator
>  virtual int IntersectWithLine(double a0[3], double a1[3], double tol,
>                                double& t, double x[3], double pcoords[3],
>                                int &subId, vtkIdType &cellId,
>                                vtkGenericCell *cell);
>
> Just specify a large positive and negative Z for your lines.
>
> BTW, the sample looks like a golf green It it is, you may enjoy this
> paper I wrote with a colleague in 1992.
>
> Lorensen, W. E. and B. Yamrom, Golf Green Visualization, IEEE Computer
> Graphics and Applications, vol. 12, no. 4, pp. 35-44, 1992.
> http://marchingcubes.org/images/6/6f/GolfGreenVisualization.pdf
>
> Bill
>
> 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.
>> _______________________________________________
>> 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