Verify whole-layer exports against current profiles
This commit is contained in:
parent
8e8c8a7ba0
commit
aac0353382
1 changed files with 306 additions and 6 deletions
|
|
@ -779,6 +779,35 @@ class RoutingWorld:
|
|||
component_conflicts=tuple(sorted(component_conflicts)),
|
||||
)
|
||||
|
||||
def verify_fixed_footprint(self, net_id: str, polygons: Sequence[Polygon]) -> RoutingReport:
|
||||
"""Check an imported owner's geometry against the board and other owners."""
|
||||
self._ensure_static_raw_tree()
|
||||
index = self._static_obstacles
|
||||
tree = index.raw_tree
|
||||
clearance = self.clearance
|
||||
static_collisions = dynamic_collisions = 0
|
||||
for polygon in polygons:
|
||||
peers = {
|
||||
owner for owner, _, other in self._physical_candidates(net_id, polygon)
|
||||
if _violates_net_clearance(polygon, other, clearance)
|
||||
}
|
||||
if tree is not None:
|
||||
xmin, ymin, xmax, ymax = polygon.bounds
|
||||
candidates = tree.query(box(xmin - clearance, ymin - clearance, xmax + clearance, ymax + clearance))
|
||||
for hit in candidates:
|
||||
owner = index.raw_owners[hit]
|
||||
other = tree.geometries[hit]
|
||||
if owner is None:
|
||||
static_collisions += int(_violates_clearance(polygon, other, clearance))
|
||||
elif owner != net_id and _violates_net_clearance(polygon, other, clearance):
|
||||
peers.add(owner)
|
||||
dynamic_collisions += len(peers)
|
||||
return RoutingReport(
|
||||
static_collision_count=static_collisions,
|
||||
dynamic_collision_count=dynamic_collisions,
|
||||
out_of_bounds=self.board is not None and any(not self.board.covers(polygon) for polygon in polygons),
|
||||
)
|
||||
|
||||
def verify_path_report(self, net_id: str, components: Sequence[ComponentResult]) -> RoutingReport:
|
||||
return self.verify_path_details(net_id, components).report
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue