I think you can do that with MeshDataTool
, a helper class that you build from a mesh to access its attributes (vertices, UVs etc) http://docs.godotengine.org/en/stable/classes/class_meshdatatool.html?highlight=MeshDataTool
I never used this and its not well documented, but from what I see, it doesn't look complicated to use.
This is a guess on how to use it:
func do_stuff_with_mesh(mesh):
var tool = MeshDataTool.new()
# Initialize the tool from the mesh and a surface index.
# Meshes contain surfaces, which in turn contain vertices.
# I guess you want the first surface, but keep that in mind
# in case you have multi-material meshes
tool.create_from_surface(mesh, 0)
# Then iterate all vertices and whatever
for i in range(0, tool.get_vertex_count()):
var position = tool.get_vertex(i)
# ...
# Delete the tool once you're done with it, because it only inherits Object
# (or use .clear() if you want to re-use it for another mesh)
tool.free()
(not tested)