<div><div class="gmail_quote">On Thu, Jan 21, 2010 at 2:13 PM, Bill Lorensen <span dir="ltr"><<a href="mailto:bill.lorensen@gmail.com">bill.lorensen@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
Ken,<br>
<br>
I enhanced David D's example:<br>
<a href="http://www.vtk.org/Wiki/VTK/Examples/InterpolateTerrain" target="_blank">http://www.vtk.org/Wiki/VTK/Examples/InterpolateTerrain</a><br>
to use the vtkCellLocator as well as the vtkProbeFilter. If your data<br>
is uniformly spaced in a grid, then the ProbeFilter is appropriate. If<br>
it is not uniform in x,y, then the CellLocator is what you want.<br>
<font color="#888888"><br>
Bill<br>
</font><div><div></div><div class="h5"><br>
On Thu, Jan 21, 2010 at 11:13 AM, Bill Lorensen <<a href="mailto:bill.lorensen@gmail.com">bill.lorensen@gmail.com</a>> wrote:<br>
> Ken,<br>
><br>
> I think you want:<br>
> Filtering/vtkCellLocator. It has a method:<br>
> // Description:<br>
> // Return intersection point (if any) AND the cell which was intersected by<br>
> // the finite line. The cell is returned as a cell id and as a generic cell.<br>
> // For other IntersectWithLine signatures, see vtkAbstractCellLocator<br>
> virtual int IntersectWithLine(double a0[3], double a1[3], double tol,<br>
> double& t, double x[3], double pcoords[3],<br>
> int &subId, vtkIdType &cellId,<br>
> vtkGenericCell *cell);<br>
><br>
> Just specify a large positive and negative Z for your lines.<br>
><br>
> BTW, the sample looks like a golf green It it is, you may enjoy this<br>
> paper I wrote with a colleague in 1992.<br>
><br>
> Lorensen, W. E. and B. Yamrom, Golf Green Visualization, IEEE Computer<br>
> Graphics and Applications, vol. 12, no. 4, pp. 35-44, 1992.<br>
> <a href="http://marchingcubes.org/images/6/6f/GolfGreenVisualization.pdf" target="_blank">http://marchingcubes.org/images/6/6f/GolfGreenVisualization.pdf</a><br>
><br>
> Bill<br>
><br>
> On Tue, Jan 19, 2010 at 7:02 PM, Kenneth Porter <<a href="mailto:shiva@sewingwitch.com">shiva@sewingwitch.com</a>> wrote:<br>
>> --On Tuesday, January 19, 2010 1:21 AM -0500 Darshan Pai<br>
>> <<a href="mailto:darshanpai@gmail.com">darshanpai@gmail.com</a>> wrote:<br>
>><br>
>>> I am not exactly sure what you are asking .<br>
>>> maybe you can try the FindPoint() function in vtkPolyData....<br>
>><br>
>> Imagine that I'm given a topo map and know latitude and longitude, and need<br>
>> to calculate the altitude.<br>
>><br>
>> It looks like FindCell might do what I need:<br>
>><br>
>> <<a href="http://www.vtk.org/doc/nightly/html/classvtkDataSet.html#a2221c10d3c4cca44e82c5ef70e4e1cbd" target="_blank">http://www.vtk.org/doc/nightly/html/classvtkDataSet.html#a2221c10d3c4cca44e82c5ef70e4e1cbd</a>><br>
>><br>
>> I need to find the triangle that contains an X/Y point, where the Z is<br>
>> unknown, so that I can compute the Z.<br>
>> _______________________________________________<br>
>> Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
>><br>
>> Visit other Kitware open-source projects at<br>
>> <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
>><br>
</div><div class="h5"><br></div></div></blockquote><div><br></div><div>Why does the data have to be uniformly spaced on a grid for the vtkProbeFilter? The documentation (<a href="http://www.vtk.org/doc/nightly/html/classvtkProbeFilter.html#_details">http://www.vtk.org/doc/nightly/html/classvtkProbeFilter.html#_details</a>) says </div>
<span class="Apple-style-span" style="font-family: 'Lucida Grande', Verdana, Geneva, Arial, sans-serif; font-size: 12px; ">"For example, an unstructured grid (<a class="el" href="classvtkUnstructuredGrid.html" title="dataset represents arbitrary combinations of all possible cell types" style="color: rgb(27, 119, 197); font-weight: bold; text-decoration: none; ">vtkUnstructuredGrid</a>) can be probed with a volume (three-dimensional<a class="el" href="classvtkImageData.html" title="topologically and geometrically regular array of data" style="color: rgb(27, 119, 197); font-weight: bold; text-decoration: none; ">vtkImageData</a>)"</span><div>
<font class="Apple-style-span" face="'Lucida Grande', Verdana, Geneva, Arial, sans-serif" size="3"><span class="Apple-style-span" style="font-size: 12px; "><br clear="all"></span></font>Thanks,<br><br></div><div>David</div>
</div></div>