Given a Point p one can do
p
p1 = mesh.closest_cell(p)
How can I find the closest vertex to a point?
min((p.distance(v.point()), v) for v in vertices(Cell(mesh, mesh.closest_cell(p))))[1]
Hello, how would you update the answer given that closest_cell() does no longer exist? Thank you!
There are methods to do this in the BoundingBoxTree class.
BoundingBoxTree