How to join lines to get a shape