Union Jack type mesh

Hi everyone!
I have a question about how to generate a Union Jack type mesh in the domain [0, 1] ^ 2.

Thank you in advance!
Shasha

Hi Shasha,

you can use the spline goemetry class, see here, by defining the appropriate points and connect them.

The CSG2D class can also be used, see here, by adding/subtracting the rectangles.

Attached there is a small example with the CSG2D class which you can use as starting point.

Best
Michael

https://ngsolve.org/media/kunena/attachments/889/union_jack.py

Attachment: union_jack.py