Metaballs
Draws gooey blobs around charges that melt together when they're close.
Node id field/metaballs
The Metaballs node treats each PointScalar in
charges as a charge, its value a radius, and draws the outline of the
region where their combined influence reaches threshold. A charge on
its own draws a circle of its radius; nearby charges merge into one blob.
Inputs
| Name | Type | Default | Notes |
|---|---|---|---|
| charges | Array<PointScalar> | — | |
| bounds | BoundingBox | — | |
| threshold | number | 1 | |
| cellSize | number | 4 | |
| falloff | MetaballFalloff | "inverse-square" | |
| smooth | boolean | false |
Outputs
Behaviour
- Merging. Charges add up, so two blobs grow towards each other and
join when they're close enough. A higher
thresholdshrinks every blob and splits them sooner; a lower one fattens and merges them. - Negative charges subtract: one at a blob's edge dents it, one inside a big blob cuts a hole. The hole comes out as a separate shape (filled like the others), so give it the background color or leave it out to show the hole.
- Falloff.
falloff(MetaballFalloff) picks how a charge's influence fades:inverse-squarereaches everywhere,wyvillstops at twice the radius and blends more softly. - Resolution. The field is sampled on a grid of
cellSizeunits (default 4) overbounds: smaller cells follow the outline more closely but take longer. - Bounds. Blobs reaching the edge of
boundsare cut off along it, so they stay closed shapes. - Smooth. Off, each blob is a Polygon through the outline; on, a ClosedSpline through the same points, which hides the grid's corners.
- Shapes are filled mid gray, positioned at their center. Restyle them with Map or a Set node.
Errors
boundsmust be connected (for example from Page).- A non-finite charge or
threshold, acellSizethat isn't positive, and a grid of more than 250 000 cells (bounds ÷cellSize, across × down) are node errors. - Providing more than 1 000 charges is a node error.
Example
Three charges: two close enough to merge into one blob, one on its own.
Related nodes
- Metaballs and contour lines: worked example.
- Zip Point Scalars: makes the charges from points and radii.
- Isolines: the same field as contour lines at several levels.