Enforce net clearance when packing route candidates

This commit is contained in:
Jan Petykiewicz 2026-11-30 09:25:27 -08:00
commit 26b12e33a2

View file

@ -12,8 +12,7 @@ from typing import TYPE_CHECKING
import shapely
from shapely.geometry import box
from inire.constants import TOLERANCE_LINEAR
from inire.geometry.collision import RoutingWorld
from inire.geometry.collision import RoutingWorld, _violates_net_clearance
from inire.model import FixedRoute, resolve_bend_geometry
from inire.results import AutomaticRoutingReport, RoutingStage, RoutingTiming, _planner_for_mode
from inire.router._bundle import ordered_bundle_terminal_headings, plan_ordered_bundle
@ -335,7 +334,7 @@ class _AutomaticRun:
pairs = chain(pairs, reserved_pairs)
for (first_seed, first_shape), (second_seed, second_shape) in pairs:
if first_shape.distance(second_shape) < problem.clearance - TOLERANCE_LINEAR:
if _violates_net_clearance(first_shape, second_shape, problem.clearance):
continue
plan = replace(problem, initial_paths={first.net_id: first_seed, second.net_id: second_seed})
trial = self._verify(plan, "paired-perimeter")