[Pather/RenderPather] Add U-bend to trace_into
This commit is contained in:
parent
1070815730
commit
0189756df4
2 changed files with 15 additions and 1 deletions
|
|
@ -228,3 +228,15 @@ def test_pather_trace_into() -> None:
|
|||
assert 'F' in p.pattern.ports
|
||||
assert 'E' in p.pattern.ports
|
||||
assert numpy.allclose(p.pattern.ports['E'].offset, (-10000, 2000))
|
||||
|
||||
# 4. U-bend (0 deg angle)
|
||||
p.pattern.ports['G'] = Port((0, 0), rotation=0)
|
||||
p.pattern.ports['H'] = Port((-10000, 2000), rotation=0)
|
||||
p.at('G').trace_into('H', plug_destination=False)
|
||||
assert 'H' in p.pattern.ports
|
||||
assert 'G' in p.pattern.ports
|
||||
# A U-bend with length=-travel=10000 and jog=-2000 from (0,0) rot 0
|
||||
# ends up at (-10000, 2000) rot pi.
|
||||
assert numpy.allclose(p.pattern.ports['G'].offset, (-10000, 2000))
|
||||
assert p.pattern.ports['G'].rotation is not None
|
||||
assert numpy.isclose(p.pattern.ports['G'].rotation, pi)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue