[vtk-developers] Bad Point IDs being picked with vtkCellPicker?

Will Schroeder will.schroeder at kitware.com
Wed Feb 6 10:06:12 EST 2019


Can you share data with an example to demonstrate the issue?

On Wed, Feb 6, 2019 at 10:00 AM Patrick Bergeron <pbergeron at spiria.com>
wrote:

> Hi folks.
>
>
> Does the below ring a bell to anyone?
>
>
> I am running an older version of VTK that I forked some time last summer
> (june or july or so), and vtkCellPicker behaves oddly sometimes.
>
>
> Basically my application loads a triangle mesh, and I use the mouse to
> pick the cell and nearest point ID, and I will put a marker on the
> nearest point ID.
>
>
> This works 99% of the time. But, in some rare circumstances, the cell I
> pick returns a point ID that is out of range, eg, larger than the number of
> points in my triangle mesh.
>
>
> - I have verified the number of points that I put in my PolyData's
> vtkPoints array has the correct count.
>
> - I have verified that I never create any triangle with invalid point IDs.
>
>
> Yet, when I pick certain cells, the picked Point ID is incorrect. For
> example, if I have 49,229 points, the picked cell will say the nearest
> point ID is 56,223, which is impossible, given that
> m_PolyData->GetPoints()->GetNumberOfPoints() returns 49,229.
>
>
> When tracing into vtk, I notice these symptoms when I reach
> *vtkCellPicker::IntersectActorWithLine()*
>
>
> One of the first thing this method does is to call
>
> *this->IntersectDataSetWithLine(data, p1, p2, t1, t2, tol, locator,
> minCellId, minSubId, tMin, pDistMin, minXYZ, minPCoords);*
>
> (and I get a minCellId that mighbe suspicious? not sure at this point)
>
> Later:
>
> if (minCellId >= 0 && tMin < this->GlobalTMin)
> {
>      ...
>         data->GetCell(minCellId, cell);
> }
>
> If I look at this cell, and its point IDs, I see that 2 out of 3 point IDs
> is larger than my total point count for my mesh.
>
> And then of course, later:
>
> if (iMaxWeight != -1)
> {
>     this->PointId = cell->PointIds->GetId(iMaxWeight);   // <---- PointId
> is out of range.
> }
>
>
> How could this be? Any clues? Rings a bell?
>
> Thanks
> Patrick Bergeron
>
>
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Search the list archives at: http://markmail.org/search/?q=vtk-developers
>
> Follow this link to subscribe/unsubscribe:
> https://vtk.org/mailman/listinfo/vtk-developers
>
>

-- 
William J. Schroeder, PhD
Kitware, Inc. - Building the World's Technical Computing Software
28 Corporate Drive
Clifton Park, NY 12065
will.schroeder at kitware.com
http://www.kitware.com
(518) 881-4902
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://vtk.org/pipermail/vtk-developers/attachments/20190206/7f077d7c/attachment-0001.html>


More information about the vtk-developers mailing list