How to distribute a solid on a surface with equal distances?

Hello everyone, 

I've been trying to figure out how to array my solid on a surface to create sort of patterns. The script I'm using is not giving the result I like to have.. I'm wondering if it would be possibile to ask grasshopper to array my solids with equal distances from one another so that I get a more regular result?

This is the algorhytm i use

and this is the result I get..

However my aim is to create a pattern more like this one

Any ideas? 

Thanks in advance