Houdini 20.5 Nodes Geometry nodes

Proximity geometry node

Finds the nearest points to one or more “target” points.

On this page

Overview

You can specify the “target” points in one of two ways:

  • If all the points are in one input, connect the first input and specify the selected points in the Target Group field. The node will find the closest points in the input to the points listed in the Target Group field.

    or

  • You can connect the “candidate” points to the first input, and the “target” points to the second input. The node will find the closest points in the second input to the points in the first input.

Output attributes

This node creates various new attributes on the candidate points to let you work with the nearest points in subsequent nodes, such as a point attribute containing each point’s distance to the closest target.

By default, the node only creates a nearestpoint point attribute (containing the point number of the closest point to each point, or -1 if there are no candidate points within the Search Radius). You can turn on creation of other useful attributes.

See the output attributes parameters below for more information.

For example, you could create the nearestdistance point attribute, and then in a later Copy to Points node, only copy geometry onto the points that were within the Search Radius by using @nearestdistance>-1 in the Group field of the Copy to Points node.

Target points as spheres

Instead of measuring from the point location of the “target” points, you can specify a radius attribute on the points to treat the targets as spheres, and find the nearest points to the virtual surface of the sphere instead of the point.

The conventional name for this attribute is pscale. Various nodes, as well as the renderers, can create a pscale point attribute or treat it specially (if it exists on a point, in many contexts in Houdini the point is treated like a sphere centered on the point with a radius of the pscale attribute value).

If the given attribute does not exist, or you set the radius scale to 0, the node falls back to comparing as points.

Inputs

Input Geometry

If only the first input is connected, the node finds points in this input closest to the points listed in the Target Group field.

If both inputs are connected, the node finds points in the second input’s Target Group closest to the points in this input.

Optional Comparison Geometry

If both inputs are connected, the node uses the second inupt for the target points.

Parameters

Group

The points to compute proximity on. If this is blank, the node writes to all points.

Target Group

The points to test for proximity against. If blank, all points will be targets for proximity computation.

A point will not be considered close to itself, even if it

is in both groups.

Search Radius

The longest distance to search for nearby points. Limiting this can speed up the node.

Maximum Points

Find a maximum of this number of the closest points. Limiting this can speed up the node.

Treat Points as Spheres

Use a point attribute on each “target” point (specified below in Point Radius Attribute) as a radius to treat the target points as target spheres, and find the closest points to each target sphere surface.

Point Radius Attribute

When Treat points as spheres is on, this is the name of a point attribute on the target points that contains the radius of the sphere centered on each point. The conventional name for this attribute is pscale, which may be created or used by various other nodes.

Radius Scale

When Treat points as spheres is on, the node multiplies the value in the Point radius attribute by this value when measuring distance to the virtual sphere. For example, depending on the application, it may be useful to scale up by a small amount to prevent touching, or down by a small amount to create overlap.

Output Attributes

Nearest Point

If this is turned on, the node creates an integer point attribute with this name, containing the point number of the closest point to this point, or -1 if no point is within the Maximum distance

Nearest Distance

If this is turned on, the node creates a point attribute with this name, containing the point’s distance to the closest target. The value is -1.0 if the point is outside the Search Radius, or if the point is not one of the Maximum points number of closest points, or if the point was a target.

Proximity Count

If this is turned on, the node creates an integer point attribute with this name, containing (for target points) the number of candidate points within Search Radius of the target. The value will never be more than the number of Maximum points.

Nearest Points

If this is turned on, the node creates an integer attray attribute with this name, containing (for target points) a list of point numbers of points within Search Radius of the target. The points are sorted from nearest to farthest. The length of this array will never be more than the number of Maximum points.

Nearest Distances

If this is turned on, the node creates an float attray attribute with this name, containing (for target points) a list of the distances of the points within the Search Radius of the target. The distances are sorted from nearest to farthest, so you can get the point number at the corresponding index of the Nearest neighbor array on the same target point. hTe length of this array will never be more than the number of Maximum points.

Nearby Group

If this is turned on, this point group is created and any points with at least threshold nearby points will be added to the group. Points without this number will be removed from any existing group.

Group Threshold

How many points need to be nearby to be included in the nearby group.

See also

Geometry nodes