Equilateral Triangle Grid
The points of a grid of equilateral triangles inside an area.
Node id lattice/equilateral-triangle
The Equilateral Triangle Grid node outputs the points of a triangular grid
that fall inside area: every point is size away from its six
neighbours, so they form equilateral triangles (or, taken in groups,
hexagons).
Inputs
| Name | Type | Default | Notes |
|---|---|---|---|
| area | BoundingBox | — | |
| size | number | 100 |
Outputs
Behaviour
- Origin. The grid starts at the area's top-left corner, which is always one of its points.
- Rows. Points are
sizeapart along each row (default 100). The rows aresize× √3 / 2 apart, about 0.866 ×size, and every other row is shifted by half a step. - Order. Points come along slanted columns, from left to right. Points on the area's edges are included.
Errors
areamust be connected.sizecan't be 0.- An area holding more than 100 000 grid positions is an error. Use a larger size or a smaller area.
Example
A triangle grid with size 150 in an 800 × 600 area, drawn as a polyline through its points. The line runs along the grid's slanted columns.
Related nodes
- Orthogonal Grid: a rectangular grid.
- Lattice: a grid along any two directions.