Kevin,
Ok, that makes sense.
You're going to have a couple of problems using TerrainMesh for that,
though.
One is actually getting your hands on a TerrainMesh. They're created
by the terrain engine, but they exist only transiently. Once the mesh
has been uploaded to the GPU as a vertex buffer, the TerrainMesh is
discarded.
Another is bounding the mesh by a polygon. You'll presumably have to
walk through the mesh, testing each vertex to determine if it is
inside or outside the polygon. And I'm guessing you'll want to
interpolate new vertices for the perimeter of your polygon as well.
This will be especially tricky (read: slow) because the mesh vertices
are expressed in a Cartesian space and your polygon is probably
defined using lat/long points.
You might be better off working with the heightmap terrain data
(HeightmapTerrainData) rather than the mesh representation of it.
I was looking at HeightmapTerrainData, and from the usage example in the
documentation, or from looking at references in the cesium source code,
it's not immediately clear to how to use it
what is actually not
clear: how would I specify the area for which I'd like to have height
map data for?
the actual documentation says:
var buffer = ...
var heightBuffer = new Uint16Array(buffer, 0, that._heightmapWidth *
that._heightmapWidth);
var childTileMask = new Uint8Array(buffer, heightBuffer.byteLength, 1)[0];
var waterMask = new Uint8Array(buffer, heightBuffer.byteLength + 1,
buffer.byteLength - heightBuffer.byteLength - 1);
var structure = HeightmapTessellator.DEFAULT_STRUCTURE;
var terrainData = new HeightmapTerrainData({
buffer : heightBuffer,
width : 65,
height : 65,
childTileMask : childTileMask,
structure : structure,
waterMask : waterMask
});
without elaborating on 'buffer'. the use cases are see, for example in
EllipsoidTerrainProvider:
var width = 16;
var height = 16;
this._terrainData = new HeightmapTerrainData({
buffer : new Uint8Array(width * height),
width : 16,
height : 16
});
doesn't seem to specify any particular area.
CesiumTerrainProvider uses a buffer that is created by loadArrayBuffer:
var heightBuffer = new Uint16Array(buffer, 0,
that._heightmapWidth * that._heightmapWidth);
return new HeightmapTerrainData({
buffer : heightBuffer,
childTileMask : new Uint8Array(buffer,
heightBuffer.byteLength, 1)[0],
waterMask : new Uint8Array(buffer,
heightBuffer.byteLength + 1, buffer.byteLength - heightBuffer.byteLength
- 1),
width : that._heightmapWidth,
height : that._heightmapWidth,
structure : that._terrainDataStructure
});
where it's not immediately clear what that buffer would contain?
thus, can you please explain, or provide an example / more details on
how to use HeightmapTerrainData to get terrain info for a particular area?
sorry for not being more clever on this 
Akos