Mesh generation for perforated Torus

I am interested in running simulations on a perforated torus, however I am having trouble with the mesh generation. Currently, I create boundaries corresponding to a square and then another set of boundaries coming from circular obstacles via a poisson point process and use buildmesh to generate the resulting mesh. I then use periodic finite element spaces to identify the correct sides of the square.

However the meshing will not work when the obstacle intersect the boundaries of the square. Is there a clean way of doing this in FreeFem? Has anyone else already dealt with this problem?

I include some sample code with specifically chosen values for the obstacle positions however the goal is to have code robust against any given input, provided that none of the obstacles intersect each other and have centers in the square \[0,1\]\\times\[0,1\].

real r = 0.05; // Obstacle radius
real eps = 0.01; // epsilon for mesh
// Set obstacle configuration
int NumPart = 3;
real[int] xC(NumPart),yC(NumPart); 
// (Does not work) wish to be robust against this
xC[0] = 0.5; yC[0]=0.0; 
xC[1] = 0.0; yC[1]=0.05; 
xC[2] = 0.5; yC[2]=0.5; 

// Example points which will mesh
// xC[0] = 0.25; yC[0]=0.25; 
// xC[1] = 0.75; yC[1]=0.75; 
// xC[2] = 0.5; yC[2]=0.5; 

// Borders definition for obstacles
border obst(t=0, 2*pi; i)
{
    x = r*cos(t) + xC[i];	
    y = r*sin(t) + yC[i];
    label = 4;
}
// Discretisation level for obstacles
int[int] nMesh(NumPart);
for(int i  = 0; i < NumPart; i++){
    nMesh[i] = -2*pi*r/eps ;
}
// Create borders for square
border a(t=0,1){x=t;y=0;label=0;};
border b(t=0,1){x=1;y=t;label=1;};
border c(t=0,1){x=t;y=1;label=2;};
border d(t=0,1){x=0;y=t;label=3;};
int nBorder = 1/eps; 
// Build mesh
mesh Th = buildmesh(a(nBorder) + b(nBorder) + c(-nBorder) + d(-nBorder) + obst(nMesh),fixedborder=1 );
plot(Th,cmm = "Mesh");
fespace VhPeriodic(Th,P1,periodic=[[0,x],[2,x],[1,y],[3,y]]);