Skip to main content

Grid Fill

Use the grid fill transform to fill a polygon with evenly-spaced points on a grid.

Written by Holly Conrad Smith

Use this when you want to fill a polygon with a regular grid of points within a flow, for example generating a structural column layout.

Grid Fill is a more complex transform. Grid Fill can be used to create structural column grids, or anything that is evenly spaced on a grid. Use Random Fill for “natural” use cases, like a forest.

Inputs

This node runs in Transform mode by default, so its settings come from the paired Transform node through the T connector. You can't wire a value straight into a single setting. To drive one setting from your flow, override it with a Write Property node between the Transform node and T, or switch this node to Exposed Inputs to get a connector for each setting.

Name

Abbreviation

Type

Access

Description

Input

I

Feature

Item

The input data

Transform

T

Object

Item

Transform controls (overridden by individual parameters)

Outputs

Name

Abbreviation

Type

Access

Description

X Line

X

Object

List

The xline output

Y Line

Y

Object

List

The yline output

Outline

O

Object

List

The outline output

Point

P

Object

List

The point output

Merged

M

Object

List

The merged output

How To

  1. Draw a polygon or rectangle

  2. Add the grid fill

    1. Add the Grid Fill Transform node and connect its output to the Grid Fill node's T connector.

    2. Click “edit defaults’ to set the starting values

  3. Adjust the grid fill settings in the Properties Palette

  4. Attach a write features to the outputs you want.

    You may need to further process the outputs by adding offset polygon or Usages to the geometries.

Here, an offset polygon is added to the points to turn them into a column-like model:

Connect the Grid Fill Transform node

The Grid Fill node needs the Grid Fill Transform node connected to its T connector to use your settings. Without it, the Grid Fill node runs on Giraffe's built-in default settings, and you can't change any of them in Edit Defaults or the Properties Palette.

OR

Use the exposed inputs version of the Grid Fill node, which has its own connector for each setting and needs no transform node.

Grid Fill Transform settings object

The Grid Fill Transform node creates a set of inputs in the Properties Palette for anyone using the flow to fill out. It converts those inputs into a plain JSON object and sends it to the Grid Fill node through the T connector. The object has type set to gridFill and the settings inside parameters. The values below are the built-in defaults.

{
"type": "gridFill",
"parameters": {
"inset": 5,
"xPattern": [
10
],
"yPattern": [
10
],
"xOffset": 0,
"yOffset": 0,
"edgeIndex": 0,
"generatePoints": true,
"pointsOnBoundary": true,
"pointsOnExclusionBoundary": true,
"pointRadius": 1,
"generateLines": false,
"breakLines": false
}
}

The Grid Fill Transform settings in the Properties Palette show lengths, areas, and volumes in your project units. The JSON always stores them in meters, square meters, and cubic meters, so a value you write into it with Write Property must use those units too.

To drive one setting from elsewhere in your flow, override it with a Write Property node. Put Write Property between the Grid Fill Transform node and the T connector, and set Property to a path like parameters.xPattern.

Grid Fill Settings

The Grid Fill Transform automatically adds a collection of necessary properties to the properties palette. Edit the values to create different results in the flow.

  • Points

    • Toggle point generation (for output)

    • Toggle points generation on the boundary

    • Toggle points on an exclusion boundary

  • Lines

    • Toggle generate Lines (for output)

    • Toggle break lines

  • Spacing

    • Set side to side (X) spacing

    • Set top to bottom (Y) spacing

    • Add additional rows in either direction at another spacing

  • Offset

    • Set side to side (X) offset

    • Set top to bottom (Y) offset

  • Reference

    • Set Offset from the boundary (set to 0 if no offset)

    • Select a reference edge to control which direction the algorithm solves from

Use the Grid Fill node with exposed inputs

The exposed inputs version of the Grid Fill node has its own connector for each setting, so you can wire values straight in without a Grid Fill Transform node.

  1. Right-click the Grid Fill node and choose Expose inputs. Giraffe replaces it with the exposed inputs version.

  2. Connect your input to the Feature connector.

  3. Type a value into each setting on the node, or connect a value to its connector. A Number node, a value from another node, or an Input Parameter all work.

  4. To let people using the flow change a setting in the Properties Palette, connect an Input Parameter to it. Settings without an Input Parameter stay hidden.

To get the exposed inputs version every time you add a node, turn on Show exposed inputs when creating new nodes (the gearbox icon) in the flow editor toolbar. Settings don't carry over when you switch between versions.

Grid Fill exposed inputs

Connector

What it does

Feature

Feature to fill.

X Spacing

Spacing in x direction.

Y Spacing

Spacing in y direction.

X Offset

Offset in x direction.

Y Offset

Offset in y direction.

Boundary Offset

Distance to offset grid from boundary.

Reference Edge Index

Index of edge to align grid to.

Points On Boundary

Whether to place points on the boundary.

Point Radius

Closest distance between points.

Break Lines

Whether to break lines at intersections.

Exclusions

Features to exclude from the grid fill.

The exposed inputs version has four outputs: Points, X Lines, Y Lines and Outline. It has no Merged output.

Grid Fill Outputs

Grid Fill is a more complex transform. It can have multiple outputs depending on what you’ve toggled on.

  • X[ ] - horizontal lines

  • Y[ ] - vertical lines

  • O[ ] - input shape boundary (outline)

  • P[ ] - generated point grid

  • M[ ] - merged output

Did this answer your question?