Periodic curves and translation/rotation
I am trying to create a puzzle-piece like mesh for which the right curves are periodic copies of the left curves, and the top curves are periodic copies of the bottom curves. Getting the line-curves to be periodic is a straightforward call to Translate
; however, I am having difficulty with the ellipses curves resulting from the boolean difference of the rectangle and disk planes. In my attempt, I have tried getting the top ellipse to be a periodic copy of the bottom ellipse by doing an affine transformation that translates the ellipse 1 unit in the y-direction and rotates it 180 degrees, but I get this error: Info: Error in transformation from curve 1 (1-2) to 8 (8-9) (minimal transformed node distances 0.5 1.5, tolerance 1.41421e-08)
. And I also don't know how to get the desired periodicity for the left and right ellipses curves since the left side is made up of two ellipses but the right is only a single ellipse.
//+
SetFactory("OpenCASCADE");
Rectangle(1) = {0, 0, 0, 1, 1, 0};
//+
Disk(2) = {1, 0.5, 0, 0.25, 0.25};
//+
Disk(3) = {-0, 0.5, 0, 0.25, 0.25};
//+
Disk(4) = {0.5, 1, 0, 0.25, 0.25};
//+
Disk(5) = {0.5, -0, 0, 0.25, 0.25};
//+
BooleanDifference{ Surface{1}; Delete; }{ Surface{3}; Surface{4}; Surface{2}; Surface{5}; Delete; }
// Right-side lines are periodic copy of left-side lines
Periodic Curve {10} = {6} Translate {1, 0, 0};
Periodic Curve {12} = {3} Translate {1, 0, 0};
// ----------------------------------------------------
// NEED HELP IN THE SECTIONS FOLLOWING THIS COMMENT!!!!!
// -----------------------------------------------------
// Top-ellipse is periodic copy of bottom-ellipse
// Affine transformation is translate 1 unit in y dir and rotate 180 deg
Periodic Curve {8} = {1} Affine { -1, 0, 0, 0,
0, 1, 0, 1,
0, 0, -1, 0,
0, 0, 0, 1};
// The left ellipse is made up of two different curves but the right
// ellipse is made up of only curve... how to impose periodicity??
// TODO
Visually, here is what I am having trouble with: