I am trying to create geometric shapes by joining closed paths together, as shown in this example

[![enter image description here](https://i.stack.imgur.com/Fb0xk.png)](https://i.stack.imgur.com/Fb0xk.png)

However, when adding stroke to the paths, each object create its own corners:

[![enter image description here](https://i.stack.imgur.com/lyhva.png)](https://i.stack.imgur.com/lyhva.png)

I tried creating a compound path with the 3 objects selected but I had no luck. How can I avoid this?