connect#

connect(z, w, pos)#

Return a short polyline connecting z (left) to w (right) by H/V/diag segments.

Heuristic that prefers diagonal+horizontal or diagonal+vertical depending on geometry and whether we connect along the “north” or “south” side.

Parameters:
  • z (complex) – Left endpoint (complex).

  • w (complex) – Right endpoint (complex).

  • pos (str) – “N” or “S” — the side we are connecting across.

Returns:

list[complex] – 2 or 3 points forming the connection polyline.

Return type:

list[complex]