# Periodic Voronoi Mesh in a box

Is it possible to generate a periodic Voronoi Mesh inside a rectangular domain? I would also like to obtain the coordinates of each cell separately so that I can perform further operations on each cell.

Edit: The following code as mentioned in this post seems to work fine to generate a periodic pattern.

(* Initial Data *)
SeedRandom[1];
pts = RandomReal[{-1, 1}, {10, 2}];
(* Augment data and find the larger Voronoi Mesh *)

pts2 = Flatten[
Table[TranslationTransform[{2 i, 2 j}][pts], {i, -1, 1}, {j, -1,
1}], 2];
vor1 = VoronoiMesh[pts2, {{-3, 3}, {-3, 3}}]
vor2 = VoronoiMesh[pts2, {{-1, 1}, {-1, 1}}];
coord = MeshCoordinates[vor2];
Show[vor2, Graphics[{Red, PointSize[0.01], Point[coord]}]]


Getting all the coordinates is easily done with MeshCoordinates. However, getting the group of coordinates separately for each cell is what I am looking for.

• The expensive way is to periodically pad your data, compute the usual Voronoi diagram, and crop back. – J. M.'s ennui May 26 '20 at 4:02
• How about the second part of the question? How do I go about obtaining the coordinates of each cell separately?Eventually, I would like to perform a self-similar contraction of each cell so as to create parallel gaps between each cell. I guess if I have coordinates of each cell, perform the self-similar transformation would be easy. – Pinkesh May 26 '20 at 12:54
• That depends. Are you fine with a cell near a corner of the rectangular domain being split into four different polygons? Also, have you seen this already? – J. M.'s ennui May 26 '20 at 12:56
• Yes, the splitting should be fine. I have seen the post, the first part of the question seems to work but extracting the coordinates separately for each cell is where I am stuck at. – Pinkesh May 26 '20 at 19:03
• MeshPrimitives maybe? – Chip Hurst May 26 '20 at 23:28