fixup! [Tool / AutoTool / Pather / RenderPather / PatherMixin] add support for S-bends

This commit is contained in:
Jan Petykiewicz 2025-11-18 22:11:59 -08:00
parent 049098ade5
commit 982304bd10

View File

@ -278,14 +278,6 @@ class PatherMixin(metaclass=ABCMeta):
angle = (port_dst.rotation - port_src.rotation) % (2 * pi) angle = (port_dst.rotation - port_src.rotation) % (2 * pi)
def get_jog(ccw: SupportsBool, length: float) -> float:
tool = self.tools.get(portspec_src, self.tools[None])
in_ptype = 'unk' # Could use port_src.ptype, but we're assuming this is after one bend already...
tree2 = tool.path(ccw, length, in_ptype=in_ptype, port_names=('A', 'B'), out_ptype=out_ptype, **kwargs)
top2 = tree2.top_pattern()
jog = rotation_matrix_2d(top2['A'].rotation) @ (top2['B'].offset - top2['A'].offset)
return jog[1] * [-1, 1][int(bool(ccw))]
dst_extra_args = {'out_ptype': out_ptype} dst_extra_args = {'out_ptype': out_ptype}
if plug_destination: if plug_destination:
dst_extra_args['plug_into'] = portspec_dst dst_extra_args['plug_into'] = portspec_dst