Rip every user of a shared via, and judge vias round at the outline
Two connections of a net can share a via. The grid kept one owner per via cell next to the claim list, and the search and rip-up read only that owner: a route of another net through the via ripped the first user and left the second's via under the new trace. The exact check then threw one of them out. The search and rip-up now read the claim list, and the single owner is gone. The exact check also tested a via against the outline as its square box, whose corner reaches past a 45-degree chamfer where the round via does not. The grid keeps the via's centre its radius plus the edge clearance from the outline, as KiCad measures it; the exact check now does the same. kitspace_minisumo_v3 seed 4: 4 rejected connections to 0, 11 failed to 7.
This commit is contained in:
@@ -207,7 +207,9 @@ def route_board_exact(
|
||||
for i, (box, box_layers) in enumerate(boxes)
|
||||
for layer in box_layers
|
||||
) or _end_in_rule_area(tree, wires, wire_half) or (
|
||||
outline is not None and not all(outline.box_clear(b, edge) for b, _ in boxes)
|
||||
outline is not None and not _inside_outline(
|
||||
outline, boxes[:wire_count], vias, (via_half or wire_half) + edge, edge
|
||||
)
|
||||
):
|
||||
rejected.append((net_no, *ends))
|
||||
continue # exact-clearance conflict -> drop (may be recovered by shove)
|
||||
@@ -670,6 +672,15 @@ def _copper_boxes(wires, vias, half_width, via_layers, via_half=None):
|
||||
return boxes
|
||||
|
||||
|
||||
def _inside_outline(outline, wire_boxes, vias, via_reach, edge) -> bool:
|
||||
"""Copper inside the board, ``edge`` from its outline. A via is round, as
|
||||
the grid and KiCad take it: its square box would reach past a chamfered
|
||||
corner where the via itself does not."""
|
||||
return all(outline.box_clear(b, edge) for b, _ in wire_boxes) and all(
|
||||
outline.point_clear(v, via_reach) for v in vias
|
||||
)
|
||||
|
||||
|
||||
def _is_rotated(shape) -> bool:
|
||||
return isinstance(shape, Simplex) and not shape.is_int_box()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user