vtkCellPicker not working correctly

The vtkCellPicker example allows for creating spheres at the picked position. It works well on the side triangles of the cone (cell ID = 2):

However, right clicking on the bottom cell of the cone results in some spheres being created at the bottom (cell ID = 0) and some at the sides (cell IDs = 1 to 6):

Is there some sort of clipping plane that divides the spheres?

Cell picking currently works only with triangle cells.

See cellPicker randomly picks backfaces with cubeSource · Issue #1122 · Kitware/vtk-js · GitHub

A quick fix is to “triangulate” your mesh before picking.
A better fix is to implement picking for all cell types.

Please let us know if you need our support to implement the “better fix”.

Regards,
Julien.

Thank you for clarifying. Using triangles works just fine.

I was curious if anyone has a solution for this yet that doesn’t involve triangulating the mesh before hand?

Yes, now (as of v25.7.0), cellPicker supports picking quads in addition to triangles.

Isn’t it working for you ? Do you have a cell type different from triangle or quad ?

I just noticed that this was all the JavaScript version of VTK. Do these changes also apply to the C++ version of VTK?

I’m not aware of any limitation with vtkCellPicker in VTK C++.
VTK C+++ has a more abstracted implementation of cell types, so it should work for any cell types.