Make the grid and the exact check agree on rotated pads, shared vias and wide nets
Rotated oval pads were built from padded corners that are not in outline order, so they fell back to their bounding box; neighbouring boxes of a rotated socket overlap, and the grid's own-pad exemption opened the overlap to the pin's net, which the exact check then refused. Pads are now the convex hull of their corners, the exact tree checks a rotated pad against that outline, and the grid blocks cells against the same outline. A via reused by a second connection of its net left that connection with no claim on the via's footprint, so ripping the first owner freed cells around a via still on the board. Footprint cells now keep every claimant. A net class wider than the default was searched as a default trace: its spread was empty below half a cell, halos were circular while the exact check compares boxes, and a rip-up route only counted what its centre crossed. The spread now covers the extra width in whole cells, halos are square, and rip-up victims include what the spread crosses. bench/diagnose.py now routes with net-class widths and hole spacing, as the CLI does.
This commit is contained in:
@@ -38,6 +38,7 @@ from freeroute.geometry import (
|
||||
IntPoint,
|
||||
Polyline,
|
||||
PolylineShape,
|
||||
Simplex,
|
||||
segment_box,
|
||||
segment_octagon,
|
||||
shove_segment,
|
||||
@@ -154,7 +155,9 @@ def route_board_exact(
|
||||
net = pin.net_nos[0] if pin.net_nos else -1
|
||||
pin_layers = frozenset(layer for layer in pin.layers if layer in signal_layers)
|
||||
if pin_layers:
|
||||
tree.insert(TreeShape(next(owner), net, pin_layers, box))
|
||||
# a rotated pad is checked against its outline, not its box
|
||||
exact = pin.shape if _is_rotated(pin.shape) else None
|
||||
tree.insert(TreeShape(next(owner), net, pin_layers, box, exact=exact))
|
||||
for net, copper_layers, box in board.get_fixed_copper():
|
||||
on = frozenset(layer for layer in copper_layers if layer in signal_layers)
|
||||
if on and not box.is_empty():
|
||||
@@ -667,6 +670,10 @@ def _copper_boxes(wires, vias, half_width, via_layers, via_half=None):
|
||||
return boxes
|
||||
|
||||
|
||||
def _is_rotated(shape) -> bool:
|
||||
return isinstance(shape, Simplex) and not shape.is_int_box()
|
||||
|
||||
|
||||
def _net_pins(board: BasicBoard, net_no: int, signal_layers) -> list[Pin]:
|
||||
return [
|
||||
pin
|
||||
|
||||
Reference in New Issue
Block a user