Hi,
I am implementing some point picking on a mesh with 127000 triangles. I’d love to pick points on the mesh while the user is interacting, but picking can take up to 300ms.
I tried with a mesh of similar size in three.js and there picking only takes 30ms.
Is there something I do wrong in the code? How can I improve performance?
function cellPickOnActors(renderer, actorsToPickOn, point) {
// Caching the picker has no performance gain
// Ephemeral, short lived, picker
let pointPicker = pointPicker = vtkCellPicker.newInstance(); // Alternative: vtkPointPicker
pointPicker.setPickFromList(1);
pointPicker.initializePickList();
pointPicker.setTolerance(0) // https://discourse.vtk.org/t/cellpicker-example-glitch/1852
console.assert(Array.isArray(actorsToPickOn))
actorsToPickOn.forEach(actor => {
pointPicker.addPickList(actor);
});
pointPicker.pick(point, renderer);
return pointPicker;
}
Warm greetings,
Emile Sonneveld