# vtkStaticCellLocator FindClosestPoint?

**URL:** <https://discourse.vtk.org/t/vtkstaticcelllocator-findclosestpoint/1091>\
**Category:** Development\
**Created:** [June 6, 2019, 8:57pm UTC](https://discourse.vtk.org/t/vtkstaticcelllocator-findclosestpoint/1091 "2019-06-06T20:57:33Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![michal.wozniak](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/m/848f3c/32.png) [@michal.wozniak](https://discourse.vtk.org/u/michal.wozniak)\
**Post date:** [June 6, 2019, 8:57pm UTC](https://discourse.vtk.org/t/vtkstaticcelllocator-findclosestpoint/1091/1 "2019-06-06T20:57:33Z")

</div>

Hi,

the standard vtkCellLocator contains the method FindClosestPoint, but with a bigger dataset, it’s getting slow. I thought I could parallelize my call to Locator::FindClosestPoint(…) but this method use QueryNumber and CellHasBeenVisited

> // NOTE: This method is not thread safe (i.e., when invoking this method on  
> // the same instance of vtkCellLocator). This is the due to the use of the  
> // data members QueryNumber and CellHasBeenVisited.

vtkStaticCellLocator doesn’t have the method, therefore I will try to implement it.

- In vtkStaticCellLocator, I see that dataset is split in bins, but the pos coordinate must already be on the surface of the dataset.

Is there an easy way to find the closest bin to random point x?

---

<div class="post-metadata">

**Author:** ![Tharun](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/t/67e7ee/32.png) [@Tharun](https://discourse.vtk.org/u/Tharun)\
**Post date:** [June 28, 2019, 8:20am UTC](https://discourse.vtk.org/t/vtkstaticcelllocator-findclosestpoint/1091/2 "2019-06-28T08:20:06Z")

</div>

I also encountered the same issue. Did you find the solution?

---

<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:** [June 28, 2019, 9:40am UTC](https://discourse.vtk.org/t/vtkstaticcelllocator-findclosestpoint/1091/3 "2019-06-28T09:40:09Z")

</div>

vtkStaticCellLocator do have FindClosestPoint:

[https://vtk.org/doc/nightly/html/classvtkStaticCellLocator.html#a2e011cb4cd36d07f1e00a656c45a3d09](https://vtk.org/doc/nightly/html/classvtkStaticCellLocator.html#a2e011cb4cd36d07f1e00a656c45a3d09)

---

<div class="post-metadata">

**Author:** ![Tharun](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/t/67e7ee/32.png) [@Tharun](https://discourse.vtk.org/u/Tharun)\
**Post date:** [June 28, 2019, 9:59am UTC](https://discourse.vtk.org/t/vtkstaticcelllocator-findclosestpoint/1091/4 "2019-06-28T09:59:42Z")

</div>

oops. I missed it. Thank you

---

<div class="post-metadata">

**Author:** ![michal.wozniak](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/m/848f3c/32.png) [@michal.wozniak](https://discourse.vtk.org/u/michal.wozniak)\
**Post date:** [June 28, 2019, 4:03pm UTC](https://discourse.vtk.org/t/vtkstaticcelllocator-findclosestpoint/1091/5 "2019-06-28T16:03:01Z")

</div>

Will it be available in the next ParaView 5.7? ( the VTK linked to that release )

We are keeping our vtk’s version compatible with the currently released ParaView in case there is some discrepancy.

---

<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:** [June 28, 2019, 4:28pm UTC](https://discourse.vtk.org/t/vtkstaticcelllocator-findclosestpoint/1091/6 "2019-06-28T16:28:53Z")

</div>

Yes it will be.
