Verify route continuity and simplify automatic search setup

This commit is contained in:
Jan Petykiewicz 2026-11-27 15:21:37 -08:00
commit def1e4ea1d

View file

@ -87,6 +87,8 @@ def _candidate_jogs(
for before in _shift_positions(problem, start.y, direction, radius, span, available):
for exit_x in turns:
for lateral in (offset, -offset):
if not search.allows_sbend_offset(direction * lateral):
continue
lead = exit_x + lateral - start.x - radius
if lead < 0:
continue
@ -139,7 +141,7 @@ def _verified_candidates(
) -> Iterator[tuple[PathSeed, BaseGeometry, tuple[ComponentResult, ...]]]:
for seed in seeds:
path = materialize_path_seed(seed, start=net.start, net_width=net.width, search=search, clearance=world.clearance)
if path[-1].end_port != net.target or not world.verify_path_report(net.net_id, path).is_valid:
if not path or path[-1].end_port != net.target or not world.verify_path_report(net.net_id, path).is_valid:
continue
footprint = union_all([polygon for component in path for polygon in component.physical_geometry])
if board.covers(footprint):
@ -174,7 +176,7 @@ def _shift_seeds(forward: int, offset: int, search: SearchOptions) -> Iterator[P
if minimum <= forward <= maximum:
yield _path(forward)
return
if search.sbend_offsets is not None and offset not in {round(value) for value in search.sbend_offsets}:
if not search.allows_sbend_offset(offset):
return
for radius in search.sbend_radii:
if not isfinite(radius) or not 0 < abs(offset) < 2 * radius: