I've seen you post a few threads about the implementation of thick polylines with round corners.
Your approach to use circle shapes and rectangle shapes can quickly begin to add up when it comes to draw calls and could significantly slow down the drawing. Removing the rectangles (and replacing with a single vertex array representing all of the rectangles) would halve those draw calls. That said, it would still have all of the circles. If you are also interpolating each line (whether that be linear, Bezier or something else), you multiple the number of circles (and therefore draw calls) exponentially.
The solution, therefore, is to use a single vertex array - one draw call - and combine all of the rectangles and circles into it.
As I've mentioned previously, Selba Ward's
Spline class does this all for you. You don't even have to use the entire collection; you can just drop the Spline files (and the common header) into your project and build it inside.
It was created for the very reason to supply a solution to this sort of problem. If you find it's not quite suitable for some reason, let me know and I'll investigate why not.
That said, even if you absolutely don't want to use
Selba Ward, feel free to have a look through its code to see if it inspires your own solution:
https://github.com/Hapaxia/SelbaWard/tree/master/src/SelbaWard