Show Action on finding cards and inject PCB geometry into AI context.
Layout and AI findings always get action (fallback recommendation). The card renders that sentence in the body. PCB review context now includes vias under the footprint, copper thickness, nearby widths, courtyard, and keepout polygons.
This commit is contained in:
@@ -193,12 +193,20 @@ def _pts_xy(node: object) -> list[tuple[float, float]]:
|
||||
|
||||
def _parse_zone(node: object, nets: dict[str, int]) -> list[LayoutZone]:
|
||||
net = str(_val(node, "net_name") or "") or _net_name(node, nets)
|
||||
keepout = _kid(node, "keepout") is not None
|
||||
name = str(_val(node, "name") or "")
|
||||
layer_default = str(_val(node, "layer") or "")
|
||||
layers_el = _kid(node, "layers")
|
||||
if not layer_default and layers_el and len(layers_el) > 1:
|
||||
layer_default = " ".join(str(x) for x in layers_el[1:] if not isinstance(x, list))
|
||||
zones: list[LayoutZone] = []
|
||||
for poly in _kids(node, "filled_polygon"):
|
||||
layer = _val(poly, "layer")
|
||||
for poly in list(_kids(node, "filled_polygon")) + list(_kids(node, "polygon")):
|
||||
layer = str(_val(poly, "layer") or layer_default)
|
||||
pts = _pts_xy(poly)
|
||||
if layer and len(pts) >= 3:
|
||||
zones.append(LayoutZone(net=net, layer=layer, outlines=[pts]))
|
||||
if len(pts) >= 3:
|
||||
zones.append(LayoutZone(
|
||||
net=net, layer=layer, outlines=[pts], keepout=keepout, name=name,
|
||||
))
|
||||
return zones
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user