Get the distance to the nearest point.
(self, rr)
| 794 | return inside |
| 795 | |
| 796 | def query(self, rr): |
| 797 | """Get the distance to the nearest point.""" |
| 798 | if not hasattr(self, "_tree"): # compute on the fly only when needed |
| 799 | from scipy.spatial import KDTree |
| 800 | |
| 801 | self._tree = KDTree(self.surf["rr"]) |
| 802 | return self._tree.query(rr) |
| 803 | |
| 804 | def _call_pyvista(self, rr): |
| 805 | pdata = _surface_to_polydata(dict(rr=rr)) |