# Why would vtkCellPicker pick different points?

**URL:** https://discourse.vtk.org/t/why-would-vtkcellpicker-pick-different-points/12950
**Category:** Support
**Created:** [December 21, 2023, 4:57pm UTC](https://discourse.vtk.org/t/why-would-vtkcellpicker-pick-different-points/12950 "2023-12-21T16:57:08Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![Sean\_Meath](https://discourse.vtk.org/user_avatar/discourse.vtk.org/sean_meath/32/8179_2.png) [@Sean\_Meath](https://discourse.vtk.org/u/Sean_Meath)
#### Post date: [December 21, 2023, 4:57pm UTC](https://discourse.vtk.org/t/why-would-vtkcellpicker-pick-different-points/12950/1 "2023-12-21T16:57:08Z")

</div>

Good day, kinda new to VTK so I apologize if I’m not too too clear.

I have a cellPicker picking on a specific location. Rerunning the same code multiple times can cause a different actor to be picked. I used the printself command to output the state of the picker, picking list as well as the picked points.

Based on the output it appears that some portion of the time the pick will successfully find a graphic that other times it doesn’t.

Looking into this I don’t think it’s a coincidental graphic issue but could be wrong. Is there anything that might come to mind that could be causing this issue?

---

<div class="post-metadata">

### Author: ![Sean\_Meath](https://discourse.vtk.org/user_avatar/discourse.vtk.org/sean_meath/32/8179_2.png) [@Sean\_Meath](https://discourse.vtk.org/u/Sean_Meath)
#### Post date: [December 21, 2023, 4:58pm UTC](https://discourse.vtk.org/t/why-would-vtkcellpicker-pick-different-points/12950/2 "2023-12-21T16:58:38Z")

</div>

It appears that I can’t attach any documents as a new user, not sure when I can but I’ll try to update in the near future.

---

<div class="post-metadata">

### Author: ![dgobbi](https://discourse.vtk.org/user_avatar/discourse.vtk.org/dgobbi/32/18_2.png) [@dgobbi](https://discourse.vtk.org/u/dgobbi)
#### Post date: [December 21, 2023, 10:26pm UTC](https://discourse.vtk.org/t/why-would-vtkcellpicker-pick-different-points/12950/3 "2023-12-21T22:26:42Z")

</div>

The code in the vtkCellPicker itself is deterministic, and it is expected to always give the same answer. But if the actors aren’t added in exactly the same order for each run, then coincidence could be an issue. Also, depending on the mappers, filters, and datasets you are using, there could be small differences from run to run depending on how the filters split things up for multithreading, but those differences would be so small that they would be unlikely to impact the picking.

---

<div class="post-metadata">

### Author: ![mwestphal](https://discourse.vtk.org/user_avatar/discourse.vtk.org/mwestphal/32/19_2.png) [@mwestphal](https://discourse.vtk.org/u/mwestphal)
#### Post date: [January 2, 2024, 8:26am UTC](https://discourse.vtk.org/t/why-would-vtkcellpicker-pick-different-points/12950/4 "2024-01-02T08:26:19Z")

</div>

> [@Sean\_Meath](#):
>
> It appears that I can’t attach any documents as a new user, not sure when I can but I’ll try to update in the near future.

you can now.

---

<div class="post-metadata">

### Author: ![Sean\_Meath](https://discourse.vtk.org/user_avatar/discourse.vtk.org/sean_meath/32/8179_2.png) [@Sean\_Meath](https://discourse.vtk.org/u/Sean_Meath)
#### Post date: [January 3, 2024, 2:02pm UTC](https://discourse.vtk.org/t/why-would-vtkcellpicker-pick-different-points/12950/5 "2024-01-03T14:02:51Z")

</div>

Sorry for the delay, this is the output of the prints:  
[VtkDump.txt](https://discourse.vtk.org/uploads/short-url/80lQ1IZFHYdrUdAvxoGcZHQxclz.txt) (32.3 KB)  
[VtkDump2.txt](https://discourse.vtk.org/uploads/short-url/86oZjtBBNpcErMO9yt92p2O4ghg.txt) (32.1 KB)

Trying to export the vtk scene using vtkOBJExporter and I’m currently getting a File or Directory not found when setting a file prefix to my desktop as follows:

```auto
vtkSmartPointer<vtkOBJExporter> Exporter = vtkSmartPointer<vtkOBJExporter>::New();
Exporter->SetRenderWindow(RenderWindow);
Exporter->SetFilePrefix("C:/Users/smeath/Desktop/this_is_a_file");
Exporter->Update();

```

Weirdly enough I grabbed a VTK example and using the same file prefix it works no issues.
