misc cleanup (mostly type-related)

This commit is contained in:
jan 2026-02-16 17:58:34 -08:00
commit ebfe1b559c
16 changed files with 57 additions and 21 deletions

View file

@ -311,6 +311,7 @@ class Pather(Builder, PatherMixin):
# Fallback for dead pather: manually update the port instead of plugging
port = self.pattern[portspec]
port_rot = port.rotation
assert port_rot is not None
if ccw is None:
out_rot = pi
elif bool(ccw):
@ -414,6 +415,7 @@ class Pather(Builder, PatherMixin):
# Fallback for dead pather: manually update the port instead of plugging
port = self.pattern[portspec]
port_rot = port.rotation
assert port_rot is not None
out_port = Port((length, jog), rotation=pi, ptype=in_ptype)
out_port.rotate_around((0, 0), pi + port_rot)
out_port.translate(port.offset)

View file

@ -520,7 +520,7 @@ class RenderPather(PatherMixin):
ccw0 = jog > 0
kwargs_no_out = (kwargs | {'out_ptype': None})
try:
t_port0, _ = tool.planL( ccw0, length / 2, in_ptype=in_ptype, **kwargs_no_out) # TODO length/2 may fail with asymmetric ptypes
t_port0, _ = tool.planL( ccw0, length / 2, in_ptype=in_ptype, **kwargs_no_out) # TODO length/2 may fail w/asymmetric ptypes
jog0 = Port((0, 0), 0).measure_travel(t_port0)[0][1]
t_port1, _ = tool.planL(not ccw0, abs(jog - jog0), in_ptype=t_port0.ptype, **kwargs)
jog1 = Port((0, 0), 0).measure_travel(t_port1)[0][1]

View file

@ -643,6 +643,7 @@ class AutoTool(Tool, metaclass=ABCMeta):
if out_transition is not None:
out_ptype_actual = out_transition.their_port.ptype
elif ccw is not None:
assert bend is not None
out_ptype_actual = bend.out_port.ptype
elif not numpy.isclose(straight_length, 0):
out_ptype_actual = straight.ptype