Fix core geometry snapping, A* target lookahead, and test configurations
This commit is contained in:
parent
24ca402f67
commit
d438c5b7c7
1 changed files with 1463 additions and 476 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Reference in a new issue