# Does vtkCellPicker conside point size?

**URL:** https://discourse.vtk.org/t/does-vtkcellpicker-conside-point-size/7802
**Category:** Support
**Created:** [February 9, 2022, 9:54am UTC](https://discourse.vtk.org/t/does-vtkcellpicker-conside-point-size/7802 "2022-02-09T09:54:22Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![zhang-qiang-github](https://discourse.vtk.org/user_avatar/discourse.vtk.org/zhang-qiang-github/32/2519_2.png) [@zhang-qiang-github](https://discourse.vtk.org/u/zhang-qiang-github)
#### Post date: [February 9, 2022, 9:54am UTC](https://discourse.vtk.org/t/does-vtkcellpicker-conside-point-size/7802/1 "2022-02-09T09:54:23Z")

</div>

Please have a look for the following code:

```auto

import vtkmodules.all as vtk

polyData = vtk.vtkPolyData()
polyData.SetPoints(vtk.vtkPoints())
polyData.SetVerts(vtk.vtkCellArray())

polyData.GetPoints().InsertNextPoint(1, 1, 1)
polyData.GetVerts().InsertNextCell(1)
polyData.GetVerts().InsertCellPoint(0)

polyData.GetPoints().Modified()
polyData.GetVerts().Modified()
polyData.Modified()

mapper = vtk.vtkPolyDataMapper()
mapper.SetInputData(polyData)
actor = vtk.vtkActor()
actor.SetMapper(mapper)
actor.GetProperty().SetColor(255, 255, 0)
actor.GetProperty().SetPointSize(10) ################### point size

def mousemove(iren, event):
    pos = iren.GetEventPosition()
    picker = vtk.vtkCellPicker()
    picker.SetTolerance(0.01)
    picker.Pick(pos[0], pos[1], 0, render)
    actor = picker.GetProp3D()
    if actor == None:
        print('no actor')
    else:
        print('pick actor')

render = vtk.vtkRenderer()
render.AddActor(actor)
renWin = vtk.vtkRenderWindow()
renWin.AddRenderer(render)
renWin.Render()
iren = vtk.vtkRenderWindowInteractor()
iren.AddObserver('MouseMoveEvent', mousemove)
iren.SetRenderWindow(renWin)
iren.Initialize()
iren.Start()

```

In the above code, I can pick the point as I expect. However, when I change the point size to 50:

```auto
actor.GetProperty().SetPointSize(50)

```

I find that I can pick the actor only when the cursor move inside the red rectangle in the following picture.

![image](https://discourse.vtk.org/uploads/default/original/2X/a/a63780b69866610d2a2f173f6131dcebee839b58.png)

I think it is because the `vtkCellPicker` do not conside the point size. Am I correct?

I have read the source code of `vtkCellPicker` and `vtkPicker`, and I actually do not find where the `vtkCellPicker` conside the point size or line width.

Or is there something wrong with my test code?

---

<div class="post-metadata">

### Author: ![will.schroeder](https://discourse.vtk.org/user_avatar/discourse.vtk.org/will.schroeder/32/233_2.png) [@will.schroeder](https://discourse.vtk.org/u/will.schroeder)
#### Post date: [February 9, 2022, 7:47pm UTC](https://discourse.vtk.org/t/does-vtkcellpicker-conside-point-size/7802/2 "2022-02-09T19:47:40Z")

</div>

VtkCellPicker is a geometric operation that does not consider the graphics representation. So the point size graphics property is ignored. If you want that taken into account, you might try vtkPropPicker.

---

<div class="post-metadata">

### Author: ![zhang-qiang-github](https://discourse.vtk.org/user_avatar/discourse.vtk.org/zhang-qiang-github/32/2519_2.png) [@zhang-qiang-github](https://discourse.vtk.org/u/zhang-qiang-github)
#### Post date: [February 10, 2022, 1:20am UTC](https://discourse.vtk.org/t/does-vtkcellpicker-conside-point-size/7802/3 "2022-02-10T01:20:59Z")

</div>

@will.schroeder Thank you for your reply. In `vtkPropPicker`, the `vtkHardwareSelector` is used. The `vtkHardwareSelector` has a limitation as said in the `.h` file:

```auto
 * Limitations:
 * Antialiasing will break this class. If your graphics card settings force
 * their use this class will return invalid results.

```

If the antialiasing technique is used, what result will be returned? Does it affect `vtkPropPicker`?
