You could also implement the GHPython script I link to here:
Or the terrain analysis components from Gismo:
These both work with meshes.