Try inner lanes for westward perimeter returns
This commit is contained in:
parent
2bc8cead6e
commit
2b9d7886fd
2 changed files with 12 additions and 1 deletions
|
|
@ -252,7 +252,7 @@ def _return_detours(
|
||||||
pivots.update((floor(left - margin), ceil(right + margin)))
|
pivots.update((floor(left - margin), ceil(right + margin)))
|
||||||
departures = sorted(x for x in pivots if start.x + radius <= x <= right_edge)
|
departures = sorted(x for x in pivots if start.x + radius <= x <= right_edge)
|
||||||
arrivals = sorted((x for x in pivots if left_edge <= x <= target.x - radius), reverse=True)
|
arrivals = sorted((x for x in pivots if left_edge <= x <= target.x - radius), reverse=True)
|
||||||
for y in (bottom, top):
|
for y in dict.fromkeys((bottom, top, low, high)):
|
||||||
if not ymin + half_width <= y <= ymax - half_width:
|
if not ymin + half_width <= y <= ymax - half_width:
|
||||||
continue
|
continue
|
||||||
for first, last in product(departures, arrivals):
|
for first, last in product(departures, arrivals):
|
||||||
|
|
|
||||||
|
|
@ -104,6 +104,17 @@ def test_return_detours_snap_board_pivots_inward_before_generating_seeds() -> No
|
||||||
assert result.path[-1].end_port == net.target
|
assert result.path[-1].end_port == net.target
|
||||||
|
|
||||||
|
|
||||||
|
def test_return_detours_try_inner_lanes_when_keepouts_reach_board_edges() -> None:
|
||||||
|
net = NetSpec("return", Port(100, 50, 0), Port(20, 50, 0))
|
||||||
|
obstacles = (box(40, 0, 50, 4), box(40, 96, 50, 100))
|
||||||
|
problem = RoutingProblem((0, 0, 120, 100), (net,), obstacles, clearance=0)
|
||||||
|
|
||||||
|
run = route(problem, options=OPTIONS)
|
||||||
|
|
||||||
|
assert run.automatic.selected_planner == "perimeter"
|
||||||
|
assert run.results_by_net[net.net_id].is_valid
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.parametrize(("forward", "needs_short_straight"), [(43, True), (60, False)])
|
@pytest.mark.parametrize(("forward", "needs_short_straight"), [(43, True), (60, False)])
|
||||||
def test_residual_doglegs_prefer_the_lattice_minimum_but_can_relax_it(forward, needs_short_straight) -> None:
|
def test_residual_doglegs_prefer_the_lattice_minimum_but_can_relax_it(forward, needs_short_straight) -> None:
|
||||||
trunk = NetSpec("trunk", Port(20, 50, 0), Port(20 + forward, 50, 0))
|
trunk = NetSpec("trunk", Port(20, 50, 0), Port(20 + forward, 50, 0))
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue