How to join lines to get a shape

Are you looking for something like this?