Hi. To make a fence with a straight meshes and correct corners you have to calculate the tangents properly as well as the amount of spline meshes between the corners so that the mesh ends exactly at the corner. If you want to save time and effort here is an asset that does it all and much more.