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