<div dir="ltr"><div>Hi Santosh,</div><div><br></div><div>I cannot say for sure what is going wrong in the probe filter without more information. Looking at your code it looks like all you want to do is to find a cell that contains a given point and get its cell attribute. An easier way to achieve that would be:</div><div><br></div><div><span style="font-family:monospace,monospace">tol2 = 1e-6;<br>double pcoords[3];<br>double weights[8]; // size based on the max number of points in any of "input's" cells<br>double pt[3] = { x, y, z };<br>auto cellId = input->FindCell(pt, NULL, -1, tol2, 0, pcoords, weights);<br>auto attr = vtkDataArray::SafeDownCast(input->GetCellData().GetAbstractArray("T"));<br>double val = 0.0;<br>attr->GetTuple(cellId, &val);</span><br></div><div><br></div><div>Hope this helps</div><div><br></div><div></div><div>-Sujin</div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Aug 14, 2018 at 7:54 AM, Santosh Biradar <span dir="ltr"><<a href="mailto:scbiradar@gmail.com" target="_blank">scbiradar@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi VTKers,<div><br></div><div>I am trying to use the vtkProbeFilter on an unstructured data set. I am using a cell to point filter on my input dataset and trying to probe the output of the cell to point filter</div><div><br></div><div>I have a snippet for what I am doing:</div><div><br></div><div>#picker for getting the point</div><div><div>picker = vtk.vtkCellPicker()</div><div>picker.PickFromListOn()</div><div>picker.AddPickList(c2pactor)</div><div>picker.SetTolerance(0.000001*<wbr>reader.GetOutput().GetLength()<wbr>)</div><div>picker.Pick(x, y, 0, renderer)</div><div>points = picker.GetPickedPositions()</div><div>numPoints = points.GetNumberOfPoints()</div><div>print numPoints</div><div>if numPoints < 1: </div><div> return</div><div>pnt = points.GetPoint(0)</div></div><div><br></div><div>#probe filter</div><div><div>pt = vtk.vtkPoints()</div><div>pt.InsertPoint(0, x, y, z)</div><div>polydata = vtk.vtkPolyData()</div><div>polydata.SetPoints(pt)</div><div>probe = vtk.vtkProbeFilter()</div><div>probe.SetInputData(polydata)</div><div>probe.SetSourceData(c2p.<wbr>GetOutput())</div><div> </div><div>probe.Update()</div><div><br></div><div>val = probe.GetPolyDataOutput().<wbr>GetPointData().GetScalars("T")<wbr>.GetRange(0)[0]</div></div><div><br></div><div>Now, I am getting inconsistent behavior of the probe filter. </div><div>Sometimes, I get the values of all the point data arrays as 0.0 for the probed location.</div><div>I dont understand this behavior. It does work correctly but not always. </div><div><br></div><div><br></div><div>Alternately, I tried using the picker.GetCellId() and picker.GetPointId() to directly fetch the value from the actor's input dataset (in this case, output of cell to point filter). Again here, the point id obtained always seems to be only a particular point in the cell irresepctive of whether probed location is near that point or any other point in that cell. So, I end up getting point data of a particular point in that cell no matter where I probe in that cell. </div><div>Is using a vtkPointPicker the correct option here?<br></div><div><br></div><div>Also, should I explore using vtkPointLocator/vtkCellLocator ?</div><div><br></div><div>I hope the question is clear. I am using VTK-6.3 on Windows.</div><div><br></div><div>Thanks,</div><div>Santosh</div><div><br></div><div><br></div></div>
<br>______________________________<wbr>_________________<br>
Powered by <a href="http://www.kitware.com" rel="noreferrer" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" rel="noreferrer" target="_blank">http://www.kitware.com/<wbr>opensource/opensource.html</a><br>
<br>
Please keep messages on-topic and check the VTK FAQ at: <a href="http://www.vtk.org/Wiki/VTK_FAQ" rel="noreferrer" target="_blank">http://www.vtk.org/Wiki/VTK_<wbr>FAQ</a><br>
<br>
Search the list archives at: <a href="http://markmail.org/search/?q=vtkusers" rel="noreferrer" target="_blank">http://markmail.org/search/?q=<wbr>vtkusers</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="https://public.kitware.com/mailman/listinfo/vtkusers" rel="noreferrer" target="_blank">https://public.kitware.com/<wbr>mailman/listinfo/vtkusers</a><br>
<br></blockquote></div><br></div>