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
| Port | Type | Default |
|---|---|---|
| EnableOff stops any new grabbing and matching; cables already attached report their last state. | bool | true |
| ShowDraws markers at the candidate endpoints and their zones in the viewport. A guide only — matching works either way. | bool | true |
| 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. | int | 0 |
| 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. | float | 0.12 |
| Attach Size XFull width of the rectangular capture zone around each endpoint, in Grafit units. Rectangle shape only. | float | 0.3 |
| Attach Size YFull height of the rectangular capture zone around each endpoint, in Grafit units. Rectangle shape only. | float | 0.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. | int | 0 |
| 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. | float | 1.2 |
| Break Size XFull width of the rectangular hold zone; leaving it lets the cable go. In Grafit units, Rectangle shape only. | float | 2.0 |
| Break Size YFull height of the rectangular hold zone, in Grafit units. Rectangle shape only. | float | 2.0 |
| CapacityHow many cables one endpoint may hold at once. 0 means unlimited and 1 makes each point exclusive; negatives are treated as 0. | int | 1 |
Outputs
| Port | Type |
|---|---|
| Config | structure |
| Attached | structure |
| Attach | bool |
| Detach | bool |
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:
| Zone | Shape 0 (Circle) | Shape 1 (Rectangle) |
|---|---|---|
| Attach | Attach Distance radius around the endpoint | Attach Size X × Attach Size Y box |
| Break | Rest length × Break Stretch from the anchor | Break 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
| Port | Type | Default | Meaning |
|---|---|---|---|
Enable | Bool | true | Off stops all matching; existing attachments release and the outputs go quiet. |
Show | Bool | true | Draws endpoint occupancy markers and both range gizmos in the render viewport. |
Endpoints | Structure | — | The candidate point cloud (max 1024 points). Only read when a cable is really connected. |
Attach Shape | Int | 0 | 0 = Circle, 1 = Rectangle. Dropdown; switches which attach ports are shown. |
Attach Distance | Float | 0.12 | Circle mode: capture radius in Grafit units (minimum 0.005). Hidden in Rectangle mode. |
Attach Size X | Float | 0.3 | Rectangle mode: full width of the capture box. Hidden in Circle mode. |
Attach Size Y | Float | 0.6 | Rectangle mode: full height of the capture box. |
Break Shape | Int | 0 | 0 = Circle, 1 = Rectangle. Dropdown; switches which break ports are shown. |
Break Stretch | Float | 1.2 | Circle 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 X | Float | 2.0 | Rectangle mode: full width of the hold box around the anchor. |
Break Size Y | Float | 2.0 | Rectangle mode: full height of the hold box. |
Capacity | Int | 1 | Cables 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 whoseAttach Endis off: cables leap from hand to hand as fingers come withinAttach Distance, one cable per fingertip atCapacity1. - Constellation wiring — a static Geometry to Points cloud as
Endpoints, cables hanging from the top edge,Capacity0: every point can hold several strands and the whole grid wires itself. - Grab-and-release performance — Mouse-driven point →
Endpoints,Break ShapeRectangle with a wide, short box: the cable follows sideways sweeps but snaps free when you drag downward. - Event sound design —
Attach→ Audio PlayerRestartfor a click on every grab, andDetach→ a Counter for a live tally of breaks. - Body-driven cables — Vision (Body) landmarks as
EndpointswithCapacity2: each joint carries two cables, and occluded joints keep their identity so cables reclaim them on return. - Visual debugging —
Showon 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 Distancecomfortably smaller than the break limit — the gap between the blue and red gizmos is the hysteresis, and a tiny gap means chatter. Break Stretchis 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/YandBreak Size X/Yare full dimensions (halved internally);Attach Distanceis 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.
Endpointsis 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.