# findDetachedTerminals

Canonical: https://docs.shumoku.dev/en/library/api/findDetachedTerminals
Language: en

@shumoku/core · 0.4.0 · function

# findDetachedTerminals

[Source](https://github.com/konoe-akitoshi/shumoku/blob/main/libs/@shumoku/core/src/layout/invariants.ts#L399)

Find wires whose polyline does not terminate ON its ports in from→to order (port-attachment constraint). Checks both the position (each terminal within \`epsilon\` of its port) and the direction contract (\`points\[0\]\` is the FROM port specifically — a reversed but touching polyline is reported as detached at both ends). Lines with fewer than two points are skipped: there is no path to check.

```
findDetachedTerminals(lines: readonly AttachedLineSpec[], epsilon?: number): TerminalDetachment[]
```

## Parameters

| Parameter | Type | Description | Default |
| --- | --- | --- | --- |
| `lines` | `readonly AttachedLineSpec[]` | No additional description. | `—` |
| `epsilon` | `number` | No additional description. | `0.5` |

## Returns

```
TerminalDetachment[]
```

[`libs/@shumoku/core/src/layout/invariants.ts:399`](https://github.com/konoe-akitoshi/shumoku/blob/main/libs/@shumoku/core/src/layout/invariants.ts#L399)
