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

@ -2,7 +2,7 @@ from __future__ import annotations
from typing import TYPE_CHECKING
from inire.geometry.components import build_component
from inire.geometry.components import bend_fits_width, build_component
from inire.model import resolve_bend_geometry
from inire.seeds import Bend90Seed, SBendSeed, StraightSeed
@ -20,7 +20,10 @@ def materialize_path_seed(
net_width: float,
search: SearchOptions,
clearance: float,
) -> tuple[ComponentResult, ...]:
) -> tuple[ComponentResult, ...] | None:
if any(isinstance(segment, (Bend90Seed, SBendSeed)) and not bend_fits_width(segment.radius, net_width) for segment in seed.segments):
return None
path: list[ComponentResult] = []
current = start
dilation = clearance / 2.0