Particles node

Find Nearest Endpoint

The Rope System's matchmaker. Free cable ends automatically grab nearby points from a point cloud, hold them, and let go when pulled too far — with per-endpoint capacity, physics-honest attach and break rules, and live gizmos so the system's decisions are visible instead of mysterious. Track hands with Vision and cables leap between fingertips on their own.

Inputs

PortTypeDefault
EnableOff stops any new grabbing and matching; cables already attached report their last state.booltrue
ShowDraws markers at the candidate endpoints and their zones in the viewport. A guide only — matching works either way.booltrue
EndpointsThe candidate points free cable ends may grab — hand landmarks, tracked points, any point cloud. The first 1024 points are used.structure—
Attach ShapeThe capture zone around each endpoint: Circle uses Attach Distance, Rectangle uses the two Attach Size values. Anything above the halfway point counts as Rectangle.int0
Attach DistanceHow close a free cable end must come to a point before it grabs, in Grafit units. Lifted to at least 0.005; keep it under the break range or cables chatter. Circle shape only.float0.12
Attach Size XFull width of the rectangular capture zone around each endpoint, in Grafit units. Rectangle shape only.float0.3
Attach Size YFull height of the rectangular capture zone around each endpoint, in Grafit units. Rectangle shape only.float0.6
Break ShapeThe hold zone a grabbed cable may be pulled through: Circle scales with the cable's own length, Rectangle uses the two Break Size values.int0
Break StretchHow far past its own rest length a cable may be stretched before it lets go — 1.2 means twenty percent over. Lifted to at least 1, since below that it would snap instantly. Circle shape only.float1.2
Break Size XFull width of the rectangular hold zone; leaving it lets the cable go. In Grafit units, Rectangle shape only.float2.0
Break Size YFull height of the rectangular hold zone, in Grafit units. Rectangle shape only.float2.0
CapacityHow many cables one endpoint may hold at once. 0 means unlimited and 1 makes each point exclusive; negatives are treated as 0.int1

Outputs

PortType
Configstructure
Attachedstructure
Attachbool
Detachbool

How It Works

Find Nearest Endpoint lives inside a Rope System and runs once per frame for the whole system. It considers every free cable end — a Rope with Attach End off, or a cable that has torn loose — and tries to match it against the Endpoints point cloud (up to 1024 points; a full multi-person body plus hands and several faces fits comfortably). If the system contains more than one matcher, the first one wins.

The governing rule is physical, not arbitrary. A cable may only attach to a point it can actually hold: the distance from the cable's anchor to the candidate endpoint must be within its own rest length × Break Stretch. And it lets go when it is stretched past that same limit. That single rule kills the classic failure modes — no cable grabs something it would immediately snap off, no grab-release oscillation, no stealing.

Assignment is deterministic. Candidate pairs are sorted purely by (distance, cable index, endpoint index) and assigned greedily — a pure function of the data, never a GPU race. The same scene always produces the same matching, so nothing flickers between frames. After a break, that specific pair cannot re-attach until the end genuinely leaves the zone (hysteresis), so a strike is a strike, not a stutter.

Capacity decides how many cables one endpoint may hold: 1 is exclusive (one cable per hook — the visually strongest setting), N allows N, and 0 means unlimited.

Two zones, independently shaped. The attach zone and the break zone each choose Circle or Rectangle:

ZoneShape 0 (Circle)Shape 1 (Rectangle)
AttachAttach Distance radius around the endpointAttach Size X × Attach Size Y box
BreakRest length × Break Stretch from the anchorBreak Size X × Break Size Y box at the anchor

A wide, short break rectangle is the interesting case: it tolerates a lot of sideways swing but breaks the moment the endpoint is pulled vertically out of the box.

Visible decisions. With Show on, the render viewport draws endpoint occupancy — a mint ring for a free endpoint, a warm ring with a dot for a taken one — plus the ranges themselves: blue for the attach range, red for the break range at the cable's anchor.

The matcher's status outputs read the parent system's simulator state, which means they describe the state produced by the previous simulation step (a one-frame lag) — exactly what you want for event-driven patching.

Parameters in Depth

PortTypeDefaultMeaning
EnableBooltrueOff stops all matching; existing attachments release and the outputs go quiet.
ShowBooltrueDraws endpoint occupancy markers and both range gizmos in the render viewport.
EndpointsStructure—The candidate point cloud (max 1024 points). Only read when a cable is really connected.
Attach ShapeInt00 = Circle, 1 = Rectangle. Dropdown; switches which attach ports are shown.
Attach DistanceFloat0.12Circle mode: capture radius in Grafit units (minimum 0.005). Hidden in Rectangle mode.
Attach Size XFloat0.3Rectangle mode: full width of the capture box. Hidden in Circle mode.
Attach Size YFloat0.6Rectangle mode: full height of the capture box.
Break ShapeInt00 = Circle, 1 = Rectangle. Dropdown; switches which break ports are shown.
Break StretchFloat1.2Circle mode: multiple of the cable's own rest length at which it releases (minimum 1.0). Also governs what a cable is allowed to grab in the first place.
Break Size XFloat2.0Rectangle mode: full width of the hold box around the anchor.
Break Size YFloat2.0Rectangle mode: full height of the hold box.
CapacityInt1Cables per endpoint. 1 = exclusive, N = N cables, 0 = unlimited.

Outputs: Config (structure, consumed by the parent system), Attached (structure — the endpoint index per cable, −1 when free), Attach (a one-frame Bool pulse on every new grab) and Detach (a one-frame Bool pulse on every release).

Use Cases

  • Cables between fingertips — Vision (Hands, Hand Tips Only) → Landmarks to Points → system wildcard + → Endpoints, with a Rope whose Attach End is off: cables leap from hand to hand as fingers come within Attach Distance, one cable per fingertip at Capacity 1.
  • Constellation wiring — a static Geometry to Points cloud as Endpoints, cables hanging from the top edge, Capacity 0: every point can hold several strands and the whole grid wires itself.
  • Grab-and-release performance — Mouse-driven point → Endpoints, Break Shape Rectangle with a wide, short box: the cable follows sideways sweeps but snaps free when you drag downward.
  • Event sound design — Attach → Audio Player Restart for a click on every grab, and Detach → a Counter for a live tally of breaks.
  • Body-driven cables — Vision (Body) landmarks as Endpoints with Capacity 2: each joint carries two cables, and occluded joints keep their identity so cables reclaim them on return.
  • Visual debugging — Show on during design: watch mint rings turn warm as capacity fills, and compare the blue attach ring with the red break ring to tune the hysteresis gap.

Tips

  • Keep Attach Distance comfortably smaller than the break limit — the gap between the blue and red gizmos is the hysteresis, and a tiny gap means chatter.
  • Break Stretch is a multiplier of the cable's own rest length, so long and short cables in the same bundle get proportionate, physically sensible limits automatically. Its minimum is 1.0 (a cable can never break before it is straight).
  • Attach Size X/Y and Break Size X/Y are full dimensions (halved internally); Attach Distance is a true radius.
  • Attach and break shapes are independent by design: a circular capture with a rectangular hold zone is the combination that feels most like real hooks.
  • Endpoints is only read from a genuinely connected cable, so an unconnected port never resurrects stale points.
  • Vision endpoints are identity-stable: the Landmarks to Points bridge keeps landmarks in permanent named slots, so a briefly occluded hand keeps its cables instead of reshuffling IDs.
  • One matcher per Rope System — additional Find Nearest Endpoint nodes inside the same container are ignored.

Open Find Nearest Endpoint in the interactive catalog →

Find Nearest Endpoint is one of 381 nodes in Grafit Pro.

Free download. Every feature for 7 days, no card. Then €99.99 once — or keep playing your projects as a Player.

More Particles nodes