Points Field
Given a Points stream, generate three fields that describe the local neighborhood: distance to nearest point, direction to nearest point, and the color of the nearest point. Point-cloud SDF + attraction vectors + color-from-source.
Category: Fields Menu path: Fields > Points Field
Ports
| Port | Type | Direction | Description |
|---|---|---|---|
in | points | input | Source point cloud (also accepts shape — shape vertices are used) |
scalarField | scalarField | output | Normalized distance to the nearest point (0 at a point, 1 at radius or beyond) |
vectorField | vectorField | output | Unit direction toward the nearest point. Zero at coincident samples |
colorField | colorField | output | RGBA from the nearest point's color attribute (white fallback) |
density | scalarField | output | How crowded a position is: points within radius, divided by densityFull, clamped to 0–1 |
flow | vectorField | output | The local average velocity of the cloud, in px per second, scaled by flowRange. Zero where the stream carries no velocity |
Parameters
| Param | Type | Default | Description |
|---|---|---|---|
radius | scalar | 100 | The neighbourhood size. scalarField reaches 1.0 at this distance from the nearest point, and it is also the radius density and flow survey |
densityFull (UI: "Full At") | scalar | 8 | Neighbour count that reads as density 1.0. Lower it to saturate sooner |
flowRange | scalar | 500 | Speed in px per second that reads as flow magnitude 1.0, same convention as Point Attributes' Speed range |
How It Works
For every sample position, Points Field runs a nearest-neighbor scan across the source points and returns three derived quantities: the normalized distance, the unit direction to the winner, and the winner's color attribute. A single evaluator is shared across all three outputs via Arc, so the per-sample cost is one scan regardless of how many of the three fields a consumer reads.
All four queries run against a uniform neighbour grid built once per evaluation, so a sample costs the points near it rather than the whole cloud. Nearest-neighbour uses an expanding radius, which keeps it exact for a sample far outside the cloud.
The vectorField points toward the nearest point — useful for attraction/snap behaviours. Invert via FieldMath Multiply by -1 for repulsion.
Empty inputs return sensible defaults: distance 1.0, direction zero vector, color white.
Usage Examples
Basic: Point-cloud SDF visualisation
Grid → PointsField → DrawField (scalar mode). You'll see dark disks at each grid point fading to 1.0 outside radius.
Colour particles by how crowded they are
Solver Out → PointsField (the particles of a particle system), then PointsField.density → PointAttributes (field, target Color) with a ramp, and the same solver's points into Draw Points. Dense clumps take one end of the ramp and lonely particles the other. Swap the target to Scale for size-by-crowding.
See the flow a cloud is moving in
Solver Out → PointsField, then flow → DrawField to look at it, or into a second population's PointDeform so a separate set of points drifts along with the first. Size flowRange against the speeds you actually have — Point Attributes shows the live range under its Speed row.
Creative: Attract particles to a grid
Grid → PointsField → vectorField → PointAdvect ← (some other Points source). The drifting points get pulled toward the nearest grid vertex.
Creative: Color bleed from nearest
Give the Grid a per-point color via PointAttributes target=Color, then wire PointsField.colorField → DrawField (color mode). Every pixel takes the color of the nearest grid point — a Voronoi-cell colouring.
Creative: Radius-based masks
Wire PointsField.scalarField → Colorize with a ramp that's opaque near 0 and transparent at 1. Produces a mask of points with soft falloff, useful for glow or density overlays.
Tips
radiusdoesn't affect direction or color — only the distance field normalization. Change it to control how sharp or soft the falloff looks when visualised.- To get distance in raw pixels instead of normalized, set
radiusto 1.0 — the scalar field won't saturate until you're a single pixel away. (But downstream consumers usually expect [0, 1] ranges, so this is rare.) - Combine with
PointsField.vectorFieldandFieldMath Addagainst a Noise vectorField for jittery attraction — points drift toward the grid but never quite converge. - When feeding a shape input, the shape's vertex points are used. Strokes sample vertices, not along the curve — use
ResampleShapefirst if you want along-curve sampling.
Related Nodes
- DistanceField — same fields but for shape outlines (SDF from boundary), not point clouds
- Grid / Line — natural upstream point producers
- PointAdvect — consumes the
vectorFieldto pull particles toward the points - AttributeToField — scalar-attribute nearest-neighbor lookup from points (related; Points Field is a superset in output kinds, AttributeToField samples arbitrary scalar attributes)