Code:
geo = geom2d.SplineGeometry()
p1,p2,p3,p4, p5 ,p6, p7,p8,p9,p10= [ geo.AppendPoint(x,y) for x,y in [(0,0), (1,0), (1.5,1), (1.5,1.1), (1.5,1.2), (0,3), (-1,3), (0.5,1.2), (0.5,1.1), (0.5,1)] ]
#c #c
geo.Append(["line", p1,p2])
geo.Append(["line", p2,p3])
geo.Append(["spline3", p3,p4,p5])
geo.Append(["line", p5,p6])
geo.Append(["line", p6,p7])
geo.Append(["spline3", p7,p8, p9])
geo.Append(["line", p9,p10])
geo.Append(["line", p10, p1])
mesh = geo.GenerateMesh(maxh = 0.1)
However, i need to aggregate a rectangle segment after a spline (spline is used to soft the corners), in the example image, there is only 2 rectangles and a spline, so, there is a way to do it in an easier way ?