How to get a mesh from a Unity Terrain (editor script)

I have an editor script that writes the whole scene to a wavefront object file, but only GameObjects with normal mesh data are captured. It'll have to work with terrains, too. If nothing else helps I will sample the terrain myself (using its collider), but before doing that I wanted to ask if anyone knows if there is a way to extract the render mesh directly.

FYI: I need the geometry of the scene for further automatic processing and extraction of game relevant data.

This should do the trick.

Damn.. Sometimes you need to ask a question aloud to find the answer yourself:

This IS what I was searching for:

I googled about two hours before and was actually giving up on that..