Pattern Generation

Hello Community,

I am looking for assistance in generating a fill pattern like this (pattern1.png).
This was produced by manually creating one curve and offsetting it.

As you can see it created some errors in the offset shown here (pattern2.png)

I would like to explore the use of grasshopper to test options and randomly generate this pattern that fills a boundary curve (planar rectangle).

In my attempt which I am sure is not efficient; I am running into some issues of point alignment but I am assuming there is also a way more efficient way to go about this.

My thought process went a little like this-

  1. Use a grid to arbitrarily and manually draw the “path” (pattern3.png) to allow show the alignment of the start and end points of each break in the line.
  2. In this example, there are 9 breaks/steps in the line. (pattern4.png)
  3. I recreated the total number of divisions, in this instance 68 (arbitrary number) (pattern5.png)
  4. I applied a random reduce to leave the number horizontal sections I wanted (pattern6.png)
  5. I thought I would then divide the curves into x number of points and random reduce to leave 2 points (pattern7.png)
  6. As you can see, I need help in aligning/copying the start and end points for each segment so they align (pattern8.png)

question 1: How do I align my points?
question 2: Is there a more efficient way to do this than the way I am heading?
question 3: Is it possible to lessen the chance of the lines being close together or do I just keep changing the seed until I get the desired spacing?

I wanted to try this first and then deal with the offset and the fill.

Thank you in advance for any insight you may be able to provide.

root (15.1 KB)


You can make a straight sequence of points, and make a polyline with those.
Then explode the polyline and move every segment by a random X vector.
Then re-connect the curves by using the “Connect Curves” component.

root (16.2 KB)

About offsets not being perfect… you are hitting a weak point here.

Maybe you can try using this:


Thank you Riccardo,
This is interesting, thank you. It’s definitely more streamlined than the way I was heading.
Thanks again