Dear All,
Let's say I have a Voronoi diagram of some points:
voronoidata=VoronoiMesh[0.5+{{9,86},{89,64},{28,49},{21,47},{31,70},{6,36},{3,24},{68,75},{25,55},{47,21}}]
this will get me the Voronoi mesh:
I know I can do MeshCoordinates[voronoidata]
to get the coordinates of the mesh. How do I get the indices to make the polygons:
basically what I want are the indices:
ToExpression[StringReplace[ToString[voronoidata//FullForm],"MeshRegion"->"List"]][[2]]
{Polygon[{{11, 6, 10, 2}, {18, 4, 13, 22}}],
Polygon[{{16, 9, 17, 20, 21}, {1, 3, 7, 2, 10}, {5, 1, 10, 6,8}, {15, 11, 2, 7, 14}, {13, 4, 5, 8, 12}, {14, 7, 3, 9, 16}}],
Polygon[{{19, 12, 8, 6, 11, 15}}],
Polygon[{{17, 9, 3, 1, 5, 4, 18}}]}
I would consider this to be a 'hack' as voronoidata is an atom, however the data can still be seen by FullForm(?) This procedure is however a bit cumbersome as you understand...