Semi random surface pattern, deformation towards edges

Hey everyone!
I’m very new to grasshopper and I’m trying to generate a grasshopper definition, where I can select a Surface on which a pattern like in this post on pinterest gets generated:

As you can see, the pattern is kind of randomized but the pill shape stays consistent, unless close to the edges, then it deforms and shrinks to kind of fade out a bit.

Any ideas on how to tackle this?
Thanks in advance and best regards