pcb_trim_extend_track
Trim or extend a PCB track endpoint along its existing line by projecting it toward a target point, keeping the track collinear and the opposite end fixed.
Instructions
Trim or extend one track endpoint along the track's own slope.
Finds the track endpoint nearest (from_x, from_y), then slides it to the perpendicular projection of (to_x, to_y) onto that track's line. The track stays collinear (no bend introduced) and the opposite end stays put, so this cleanly lengthens a track up to a target or pulls it back. All coordinates in mils.
Args: from_x, from_y: Picks which endpoint moves (nearest one wins). to_x, to_y: Target the moving end is projected toward. tolerance_mils: How close (from_x, from_y) must be to a real endpoint (default 5).
Returns: {"moved_end", "old_x", "old_y", "new_x", "new_y", "layer"}.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| to_x | Yes | ||
| to_y | Yes | ||
| from_x | Yes | ||
| from_y | Yes | ||
| tolerance_mils | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||