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) |
Parameters
| Param | Type | Default | Description |
|---|---|---|---|
radius | scalar | 100 | Normalization distance for the scalar field. At radius pixels from the nearest point the field reaches 1.0 |
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.
Scan is O(N) per sample; for point counts in the low thousands (typical Grid / Line / emitter output) this is comfortable. Spatial acceleration can come later if it becomes a bottleneck.
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.
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)