Skip to main content

Random Fill

Randomly fill the polygon with a specified number of points.

Written by Holly Conrad Smith

Use this when you want to randomly distribute a specified number of points within a polygon within a flow, for example scattering trees or planting within a landscape area.

Random numbers generated by computers are not truly random, but rather pseudo-random. They are produced by algorithms that, while appearing random, are deterministic and predictable. This means the same algorithm will generate the same sequence of numbers if given the same starting conditions.

In random number generation, a seed is a starting number used to initialize a random number generator (RNG). It's essentially a point within a predetermined sequence of "random" numbers where the generator starts producing values.

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

Primary

P

Object

List

The primary output

How to

  1. Draw a Rectangle or Polygon

  2. Click “Open flow builder”

  3. Add the Random Fill node and the Random Fill Transform node. Connect the transform's output to the Random Fill node's T connector.

  4. Click “edit defaults” to set the starting values

  5. Edit the settings and outputs in Properties

Connect the Random Fill Transform node

The Random Fill node needs the Random Fill Transform node connected to its T connector to use your settings. Without it, the Random 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 Random Fill node, which has its own connector for each setting and needs no transform node.

Random Fill Transform settings object

The Random 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 Random Fill node through the T connector. The object has type set to randomFill and the settings inside parameters. The values below are the built-in defaults.

{
"type": "randomFill",
"parameters": {
"count": 20,
"seed": "",
"scaleRangePct": 20
}
}

The Random 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 Random Fill Transform node and the T connector, and set Property to a path like parameters.count.

Random Fill Settings

The Random Fill Transform node adds a set of pre-defined properties to the properties palette. Edit the settings here to adjust the output of the flow.

  • Input the number of points

  • Select a randomization seed

    • The seed is just a way to help the computer simulate randomization. Type anything here: random text, a single number, or even your name! See what happens 😃

    • click the Dice for the computer to suggest a seed

  • Allow the output geometry to scale by +/- a percentage. Set to 0 to get an exact count of points

Use the Random Fill node with exposed inputs

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

  1. Right-click the Random 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.

Random Fill exposed inputs

Connector

What it does

Feature

Feature to fill.

Count

Number of points to generate.

Seed

Random seed.

Random Scale

Amount to randomize scale property.

Random Fill Output

  • The single output is the list of random points

  • Apply any point-based usage, like tree

Did this answer your question?