how to create a mesh that fits into a 2d shape

i have a vector2 array describing a closed convex shape and i would like to create a flat mesh that fits into this shape. so if for example the array has 4 points describing a quad the mesh should be a plane, and if the points in the array are describing a circle, the mesh should look like the cap of a cylinder mesh…
now if i were just dealing with circles, i guess the way to do it would be to project a plane over the circle and delete the vertices that are outside of the circle. but with more complex shapes i don’t know how to approach the problem.
maybe someone can point me in the right direction.

if the shape is guaranteed to be convex, you could just sort the array by increasing x or y values, then make triangle strips from top to bottom/left to right like this

But this will proably fail if there are any concave sections

thanks a lot hpjohn. this looks like a solution.

http://forum.unity3d.com/threads/27223-Polygon-triangulation-code

Or use unity4, I think it has this feature built in.

thanks. as soon as i recalled that the thing i was looking for is called polygon triangulation it was easy to find alogorithms and scripts.