The if/else statesments here don't cover the full range of possibilites, so the function often returns a None
def way(vec):
if vec[1] != 0:
if abs(vec[0] / vec[1]) < 1e-2:
if vec[1] > 0:
return Vector(0, 1)
elif vec[1] < 0:
return Vector(0, -1)
if vec[0] != 0:
if abs(vec[1] / vec[0]) < 1e-2:
if vec[0] > 0:
return Vector(1, 0)
elif vec[0] < 0:
return Vector(-1, 0)
Hence in working_points (line 413) in working_p_start = A + vec * min_dist / 2 vec is None and the programs raises an error.
How te reproduce the error : draw a horizontal port, then a (1,1)-slanted one and connect them. If you change the orientation of ports & the order of the ports, the error alway occures at some point.