<div><div class="gmail_quote">On Thu, Jan 21, 2010 at 2:13 PM, Bill Lorensen <span dir="ltr">&lt;<a href="mailto:bill.lorensen@gmail.com">bill.lorensen@gmail.com</a>&gt;</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&#39;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 &lt;<a href="mailto:bill.lorensen@gmail.com">bill.lorensen@gmail.com</a>&gt; wrote:<br>
&gt; Ken,<br>
&gt;<br>
&gt; I think you want:<br>
&gt; Filtering/vtkCellLocator. It has a method:<br>
&gt;  // Description:<br>
&gt;  // Return intersection point (if any) AND the cell which was intersected by<br>
&gt;  // the finite line. The cell is returned as a cell id and as a generic cell.<br>
&gt;  // For other IntersectWithLine signatures, see vtkAbstractCellLocator<br>
&gt;  virtual int IntersectWithLine(double a0[3], double a1[3], double tol,<br>
&gt;                                double&amp; t, double x[3], double pcoords[3],<br>
&gt;                                int &amp;subId, vtkIdType &amp;cellId,<br>
&gt;                                vtkGenericCell *cell);<br>
&gt;<br>
&gt; Just specify a large positive and negative Z for your lines.<br>
&gt;<br>
&gt; BTW, the sample looks like a golf green It it is, you may enjoy this<br>
&gt; paper I wrote with a colleague in 1992.<br>
&gt;<br>
&gt; Lorensen, W. E. and B. Yamrom, Golf Green Visualization, IEEE Computer<br>
&gt; Graphics and Applications, vol. 12, no. 4, pp. 35-44, 1992.<br>
&gt; <a href="http://marchingcubes.org/images/6/6f/GolfGreenVisualization.pdf" target="_blank">http://marchingcubes.org/images/6/6f/GolfGreenVisualization.pdf</a><br>
&gt;<br>
&gt; Bill<br>
&gt;<br>
&gt; On Tue, Jan 19, 2010 at 7:02 PM, Kenneth Porter &lt;<a href="mailto:shiva@sewingwitch.com">shiva@sewingwitch.com</a>&gt; wrote:<br>
&gt;&gt; --On Tuesday, January 19, 2010 1:21 AM -0500 Darshan Pai<br>
&gt;&gt; &lt;<a href="mailto:darshanpai@gmail.com">darshanpai@gmail.com</a>&gt; wrote:<br>
&gt;&gt;<br>
&gt;&gt;&gt; I am not exactly sure what you are asking .<br>
&gt;&gt;&gt; maybe you can try the FindPoint() function in vtkPolyData....<br>
&gt;&gt;<br>
&gt;&gt; Imagine that I&#39;m given a topo map and know latitude and longitude, and need<br>
&gt;&gt; to calculate the altitude.<br>
&gt;&gt;<br>
&gt;&gt; It looks like FindCell might do what I need:<br>
&gt;&gt;<br>
&gt;&gt; &lt;<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>&gt;<br>

&gt;&gt;<br>
&gt;&gt; I need to find the triangle that contains an X/Y point, where the Z is<br>
&gt;&gt; unknown, so that I can compute the Z.<br>
&gt;&gt; _______________________________________________<br>
&gt;&gt; Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
&gt;&gt;<br>
&gt;&gt; Visit other Kitware open-source projects at<br>
&gt;&gt; <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
&gt;&gt;<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: &#39;Lucida Grande&#39;, Verdana, Geneva, Arial, sans-serif; font-size: 12px; ">&quot;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>)&quot;</span><div>
<font class="Apple-style-span" face="&#39;Lucida Grande&#39;, 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>