SmartGrid is a custom Grasshopper component that generates a rectangular grid of points on the XY-plane, with two selectable modes:
- All – use all grid points
- Border – use only the outer frame of the grid
It is implemented as a Grasshopper plugin in C# (.NET Framework) and compiled as a .gha library.
All interior and boundary points are generated.
Only the outer border points (first/last row and first/last column) are generated.
- Generates a grid of points over a rectangular area.
- Grid is centered at the world origin on the XY plane.
- Supports two modes:
All– every grid pointBorder– only frame points
- Outputs:
- P – list of
Point3dgrid points - Info – a short summary string, e.g.
“15 points, mode = Border”
- P – list of
| Name | Type | Default | Description |
|---|---|---|---|
| Width | Number | 10.0 | Total width of the grid in X direction |
| Height | Number | 6.0 | Total height of the grid in Y direction |
| Cols | Integer | 5 | Number of columns (points along X) |
| Rows | Integer | 3 | Number of rows (points along Y) |
| Mode | Text | "All" | "All" for full grid, "Border" for frame-only grid points |
| Name | Type | Description |
|---|---|---|
| P | Point List | List of generated grid points (Point3d) |
| Info | Text | Info string, e.g. "15 points, mode = All" |
- The rectangle is centered at
(0,0,0)on the XY plane. - Step sizes are computed as:
xStep = width / (cols - 1)yStep = height / (rows - 1)
- The bottom-left starting point is:
xStart = -width / 2yStart = -height / 2
- Nested loops over
rowsandcolsgenerate each point:x = xStart + i * xStepy = yStart + j * yStep
- In Border mode, only points where:
i == 0,i == cols - 1,j == 0, orj == rows - 1are kept.
-
Build the project in Visual Studio as a
Class Library (.NET Framework) targeting .NET Framework 4.8. -
Ensure you reference:
RhinoCommon.dllGrasshopper.dll
-
After building, rename the output
.dllto.ghaif needed, or configure the project to output.ghadirectly. -
Copy the
.ghafile to your Grasshopper Libraries folder:Windows:
%AppData%\Grasshopper\Libraries

