Fix core geometry snapping, A* target lookahead, and test configurations

This commit is contained in:
Jan Petykiewicz 2026-03-15 21:14:42 -07:00
commit d438c5b7c7

View file

@ -26,8 +26,8 @@ class Port:
y: float,
orientation: float,
) -> None:
self.x = x
self.y = y
self.x = snap_nm(x)
self.y = snap_nm(y)
self.orientation = float(orientation % 360)
def __repr__(self) -> str:
@ -59,7 +59,7 @@ def rotate_port(port: Port, angle: float, origin: tuple[float, float] = (0, 0))
px, py = port.x, port.y
rad = numpy.radians(angle)
qx = ox + numpy.cos(rad) * (px - ox) - numpy.sin(rad) * (py - oy)
qy = oy + numpy.sin(rad) * (px - ox) + numpy.cos(rad) * (py - oy)
qx = snap_nm(ox + numpy.cos(rad) * (px - ox) - numpy.sin(rad) * (py - oy))
qy = snap_nm(oy + numpy.sin(rad) * (px - ox) + numpy.cos(rad) * (py - oy))
return Port(qx, qy, port.orientation + angle)