Help making a grid system work better

Trying to make a grid system to get a layout of a general area (this will be using raycasts) but i am trying to make a small beta but dont know how i would go about doing it

General idea on what i want to make
image
One of the two

a general expanding raycast grid that will check for parts