fixup! [AutoTool] Use more dataclasses to clarify internal code
This commit is contained in:
parent
41bbfee80b
commit
de534a755f
@ -576,7 +576,7 @@ class AutoTool(Tool, metaclass=ABCMeta):
|
||||
def _itransition2dxy(in_transition: Transition | None) -> NDArray[numpy.float64]:
|
||||
if in_transition is None:
|
||||
return numpy.zeros(2)
|
||||
irot = in_transition.our_port.rotation
|
||||
irot = in_transition.their_port.rotation
|
||||
assert irot is not None
|
||||
itrans_dxy = rotation_matrix_2d(-irot) @ (in_transition.our_port.offset - in_transition.their_port.offset)
|
||||
return itrans_dxy
|
||||
@ -617,8 +617,8 @@ class AutoTool(Tool, metaclass=ABCMeta):
|
||||
otrans_dxy = self._otransition2dxy(out_transition, bend_angle)
|
||||
|
||||
b_transition = None
|
||||
if ccw is not None and bend.out_port.ptype != straight.ptype:
|
||||
b_transition = self.transitions.get((bend.out_port.ptype, straight.ptype), None)
|
||||
if ccw is not None and bend.in_port.ptype != straight.ptype:
|
||||
b_transition = self.transitions.get((bend.in_port.ptype, straight.ptype), None)
|
||||
btrans_dxy = self._itransition2dxy(b_transition)
|
||||
|
||||
straight_length = length - bend_dxy[0] - itrans_dxy[0] - btrans_dxy[0] - otrans_dxy[0]
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user