Wave Network Grasshopper pattern: horizontal wavy lines splitting and merging

Wave Network

Branching wave line pattern

Horizontal wavy lines that split and merge into one another, forming a flowing network.

Want all 53 patterns? Get them in one zip →


Price

Free

Plugins

None, native components only

Works with

Rhino 7 & 8, Mac and Windows

Level

Beginner

Inputs

Reference in Rhino

Surface

The surface the waves run across. The rows are straight lines from one side to the other, so a rectangle works best. It must be a planar (flat) surface.

Main Sliders

SliderWhat it changesDefault
DivisionsThe number of rows, and so the number of waves stacked up the surface.40
Wave FrequencyHow many times each wave rises and falls across the surface.4
IrregularityHow far the wave points shift sideways at random. At 0 the waves are perfectly regular.0.65
Too-close thresholdHow close two points in a wave can get, as a share of the point spacing. Points closer than this are moved away from their neighbour along the row, which avoids sharp bends.0.35
Curve Bulge ControlHow full and round the waves are between their points.0.23
Wave WidthThe thickness of every wave, in thousandths of the surface width.20

Also try: change the seed of the first Random component in the Shift Points Randomly group. It gives every wave a new set of random shifts and a different network.

Notes

  • Neighbouring waves share their points. Each wave zigzags between two rows, and the next wave starts from the second of those rows. That’s why the waves meet. Irregularity shifts each wave’s copy of a shared point separately, so the higher it is, the more the waves split apart between meeting points.
  • Make sure the waves run past the edge. Extend length lengthens both ends of each wave by a fixed distance in model units before it’s trimmed. On a large surface, raise it so no wave stops short of the edge.
  • Keep Wave Width in proportion to Divisions. With many rows and a large width, the gaps between waves close up and the network turns solid.
  • The result is one piece. Region Union merges all the waves into a single outline, and Boundary Surfaces turns it into one surface.

Design Logic

How the script builds the pattern, step by step.

Wave Network Grasshopper script on the canvas
The whole script on the Grasshopper canvas. Open full size ↗
StepHow the script does it
1. Draw the row linesDivide Surface places points down both sides of the surface. Flip Matrix and Nurbs Curve join each pair into a line across.
2. Alternate the points from row to rowDivide Curve splits each row into as many equal parts as Wave Frequency. Tree Statistics, Dispatch and Tree Branch split the rows into even and odd. Two more Dispatch components keep every other point, starting with the first point on even rows and the second on odd rows, so the points of neighbouring rows sit between each other.
3. Zigzag between neighbouring rowsGroup and Relative Item with the offset {+1}[0] from the Panel pair each row with the next one. Ungroup combines their points and Sort Along Curve puts them in order across the surface, so each wave steps up and down between two rows.
4. Shift the points at randomDistance and Multiplication scale Irregularity by the spacing of the points. Construct Domain and Random pick a shift for every point within that range, and Amplitude and Move move it along its row.
5. Space out crowded points to avoid sharp bendsThis step makes the network more uniform. Closest Points finds each point’s nearest neighbour in its wave, and an Expression with Cull Pattern picks out the ones closer than the Too-close threshold. Move tries shifting each of them both ways along the row by that distance, and Distance, Sort List and List Item keep the copy that ends up further from its neighbour. Merge, Clean Tree, Trim Tree and Sort Along Curve put each wave back together. If Cull Duplicates tolerance is above 0, Cull Duplicates then reduces points that sit closer than that to one.
6. Draw smooth wavesTangent Curve draws a curve through each wave’s points, with the row direction as the tangent at every point and Curve Bulge Control setting the fullness. Extend Curve lengthens both ends by Extend length.
7. Thicken the wavesLength and an Expression turn Wave Width into a distance. Evaluate Surface gives the plane of the surface, and two Offset Curve components copy each wave to both sides by half the width in that plane. End Points, Line and Join Curves close them into outlines.
8. Trim and merge into one networkRegion Intersection trims each outline to the surface, Region Union merges the overlapping waves, and Boundary Surfaces fills the result.

Want to learn how to build scripts like this on your own? Check out the Grasshopper Pro course.

On this page

Related tutorial

Free to use, also commercially

Use and change this script in your own projects, personal or commercial.

Please don't re-upload or redistribute the file. If you share it, link to this page so people always get the latest version.

© Hopific

Something not working?

If a script throws an error or doesn't do what this page describes, tell me and I'll fix it.

Tell me →