# Speed up point and cell locators

**URL:** https://discourse.vtk.org/t/speed-up-point-and-cell-locators/14791
**Category:** Development
**Tags:** proposal
**Created:** [October 30, 2024, 8:37pm UTC](https://discourse.vtk.org/t/speed-up-point-and-cell-locators/14791 "2024-10-30T20:37:23Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![Jens\_Munk\_Hansen](https://discourse.vtk.org/user_avatar/discourse.vtk.org/jens_munk_hansen/32/1215_2.png) [@Jens\_Munk\_Hansen](https://discourse.vtk.org/u/Jens_Munk_Hansen)
#### Post date: [October 30, 2024, 8:37pm UTC](https://discourse.vtk.org/t/speed-up-point-and-cell-locators/14791/1 "2024-10-30T20:37:23Z")

</div>

Hi Developers.

I am in a situation where I update around 5% of the mesh very frequently. For this purpose, I generated faster cell and point locators. For the point locator, I modified the `vtkIncrementalOctreeLocator` to support removal and repositioning of points. Updating 5% of the mesh was 10x faster than rebuilding the locator. It is fairly simple to add this functionality. Would this be an idea. It is easy to test, when repositioning, I locate the Node, check bounds, if inside, I just update the point. If outside, I remove and add the point.

For the cell locator, I have done something terrible. I assume all cells are Triangles (a template). This is for sure general enough to be part of VTK. Here I get similar speedups, but the cell locator is more complex to test properly.

What are your thoughts. It still passes the old test and a new test case could be added by comparing consistency between moving many points and rebuilding the locator.

What are your thoughts?
