Diagrid Gradient Grasshopper pattern: diagonal members between horizontal bars, leaning less toward one edge

Diagrid Gradient

Diagrid pattern with gradient

A diagonal grid of members between horizontal bars that leans most at one edge of the panel and straightens up toward the other, so the diagrid fades into upright members.

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 diagrid is built on. It must be a planar (flat) surface.

Main Sliders

SliderWhat it changesDefault
DivisionsThe number of levels between the horizontal bars.7
Grid SpacingThe spacing of the members along each bar, as a percentage of the surface width. Lower values give more members.5
Extent of ‘spreading’How strongly the members lean at the start of the gradient. At 0 every member is upright; at 1 neighbouring members meet on the first bar.0.7
Grid thicknessThe thickness of the horizontal bars.0.06
Element ThicknessThe thickness of the diagonal members.0.15

Also try: set the end (B) of the Construct Domain in the spreading group to a value above 0, so the members still lean at the far end instead of standing upright.

Notes

  • Balance Element Thickness and Grid Spacing. With thick members and a small spacing, neighbouring members merge where they meet on the bars.
  • Bars and members come out as separate surfaces that meet edge to edge.
  • To see how far each point moves, preview the Vector Display in the optional visualisation group. It draws an arrow for every shift.

Design Logic

How the script builds the pattern, step by step.

Diagrid Gradient Grasshopper script on the canvas
The whole script on the Grasshopper canvas. Open full size ↗
StepHow the script does it
1. Draw the horizontal barsDivide Surface, Flip Matrix and Nurbs Curve draw a line across the surface at every level. Two Offset Curve components copy each line to either side by half the Grid thickness, and End Points, Line and Join Curves close them into bars.
2. Place evenly spaced points on every barLine and Length measure the width of the surface, and an Expression turns Grid Spacing into a distance. Divide Length puts a point at that spacing along each line.
3. Alternate the direction of movementTwo Duplicate Data components and Weave make a list of 1, −1, 1, −1…, and Shortest List trims it to the number of points. Dispatch, Tree Branch and Multiplication flip the signs on every other level, so neighbouring points move in opposite directions and the rhythm swaps from level to level.
4. Fade the movement across the levelsAn Expression turns Extent of ‘spreading’ into a share of half the spacing. Construct Domain and Range fade it from that amount on the first level to nothing on the last, one value per level.
5. Move the points along the barsMultiplication combines the signs with the fade, and Amplitude and Move slide each point that far along its bar.
6. Connect the levels with diagonalsRelative Item pairs each point with the matching point on the next level, and Line joins them. Because the points move in opposite directions on neighbouring levels, the lines lean and form a diagrid.
7. Give the members thicknessTwo Offset Curve components copy each line to either side by half the Element Thickness, and End Points, Line and Join Curves close them into outlines.
8. Cut the members at the barsTrim Tree, Shift List and Duplicate Data pair each member with the bars it touches, and Region Difference cuts the bars out of it. Region Intersection trims the members to the surface, and a Surface parameter turns bars and members into surfaces.

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 →