Verify route continuity and simplify automatic search setup
This commit is contained in:
parent
c200d0f7c1
commit
def1e4ea1d
1 changed files with 489 additions and 103 deletions
|
|
@ -7,7 +7,7 @@ import numpy
|
|||
from shapely.geometry import LineString, box
|
||||
|
||||
from inire.geometry.component_overlap import components_overlap
|
||||
from inire.geometry.components import path_within_board
|
||||
from inire.geometry.components import check_path_geometry, path_within_board
|
||||
from inire.geometry.dynamic_path_index import DynamicPathIndex
|
||||
from inire.geometry.index_helpers import grid_cell_span
|
||||
from inire.results import RoutingReport
|
||||
|
|
@ -165,6 +165,8 @@ class RoutingWorld:
|
|||
)
|
||||
|
||||
def install_path(self, net_id: str, path: Sequence[ComponentResult]) -> None:
|
||||
if any(not component.physical_checks[0] for component in path):
|
||||
return
|
||||
proxies: list[Polygon] = []
|
||||
dilated_proxies: list[Polygon] = []
|
||||
physical_geometry: list[tuple[int, Polygon]] = []
|
||||
|
|
@ -656,6 +658,9 @@ class RoutingWorld:
|
|||
dynamic_collision_count = 0
|
||||
self_collision_count = 0
|
||||
total_length = sum(component.length for component in components)
|
||||
valid_geometry, continuous = check_path_geometry(components)
|
||||
if not valid_geometry:
|
||||
return PathVerificationDetail(RoutingReport(total_length=total_length, invalid_geometry=True))
|
||||
conflicting_net_ids: set[str] = set()
|
||||
component_conflicts: set[tuple[int, str, int]] = set()
|
||||
|
||||
|
|
@ -722,6 +727,7 @@ class RoutingWorld:
|
|||
self_collision_count=self_collision_count,
|
||||
total_length=total_length,
|
||||
out_of_bounds=self.board is not None and not path_within_board(components, self.board),
|
||||
discontinuous=not continuous,
|
||||
),
|
||||
conflicting_net_ids=tuple(sorted(conflicting_net_ids)),
|
||||
component_conflicts=tuple(sorted(component_conflicts)),
|
||||
|
|
|
|||
Loading…
Reference in a new issue