Raster map: THT pad barrels get their own marker and legend entry
Every barrel was drawn with the same green dot under one 'vias' legend label, making through-hole pads read as vias. Pad barrels (kind='pad') now draw violet with a 'THT pad barrels' entry; the legend lists only the barrel kinds present. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
@@ -50,6 +50,7 @@ _COPPER = "#c98b4e"
|
|||||||
_E1_COLOR = "#c8385a"
|
_E1_COLOR = "#c8385a"
|
||||||
_E2_COLOR = "#2f6fb0"
|
_E2_COLOR = "#2f6fb0"
|
||||||
_VIA_COLOR = "#2d6b45"
|
_VIA_COLOR = "#2d6b45"
|
||||||
|
_PAD_COLOR = "#5b4a8a" # THT pad barrels (kind='pad'), violet-ink
|
||||||
_SOLDER = "#9aa3ad" # tin-gray: solder buildup areas
|
_SOLDER = "#9aa3ad" # tin-gray: solder buildup areas
|
||||||
_MESH = "#a56c33" # darker copper: adaptive leaf boundaries
|
_MESH = "#a56c33" # darker copper: adaptive leaf boundaries
|
||||||
_INK = "#3a3a3a"
|
_INK = "#3a3a3a"
|
||||||
@@ -187,10 +188,14 @@ def _electrode_labels(ax, stack, e1_l, e2_l):
|
|||||||
|
|
||||||
|
|
||||||
def _via_markers(ax, problem, layer):
|
def _via_markers(ax, problem, layer):
|
||||||
xs = [v.x * 1e-6 for v in problem.vias if v.spans(layer.z_nm)]
|
"""One dot per barrel spanning the layer: vias green, THT pad
|
||||||
ys = [v.y * 1e-6 for v in problem.vias if v.spans(layer.z_nm)]
|
barrels violet (same joint markers, different physics)."""
|
||||||
if xs:
|
for kind, color in (("via", _VIA_COLOR), ("pad", _PAD_COLOR)):
|
||||||
ax.plot(xs, ys, ".", ms=2.5, color=_VIA_COLOR, alpha=0.7)
|
pts = [(v.x * 1e-6, v.y * 1e-6) for v in problem.vias
|
||||||
|
if v.kind == kind and v.spans(layer.z_nm)]
|
||||||
|
if pts:
|
||||||
|
xs, ys = zip(*pts)
|
||||||
|
ax.plot(xs, ys, ".", ms=2.5, color=color, alpha=0.7)
|
||||||
|
|
||||||
|
|
||||||
def area_tag(sign: str, index: int) -> str:
|
def area_tag(sign: str, index: int) -> str:
|
||||||
@@ -243,8 +248,12 @@ def fig_raster(stack, e1, e2, problem, result=None):
|
|||||||
_electrode_labels(ax, stack, e1[li], e2[li])
|
_electrode_labels(ax, stack, e1[li], e2[li])
|
||||||
|
|
||||||
def finalize(fig, rows):
|
def finalize(fig, rows):
|
||||||
handles = [Patch(fc=_COPPER, label="copper"),
|
kinds = {v.kind for v in problem.vias}
|
||||||
Patch(fc=_VIA_COLOR, label="vias")]
|
handles = [Patch(fc=_COPPER, label="copper")]
|
||||||
|
if "via" in kinds or not kinds:
|
||||||
|
handles.append(Patch(fc=_VIA_COLOR, label="vias"))
|
||||||
|
if "pad" in kinds:
|
||||||
|
handles.append(Patch(fc=_PAD_COLOR, label="THT pad barrels"))
|
||||||
if has_mesh:
|
if has_mesh:
|
||||||
handles.append(Patch(fc=_MESH,
|
handles.append(Patch(fc=_MESH,
|
||||||
label="adaptive mesh (coarse leaves)"))
|
label="adaptive mesh (coarse leaves)"))
|
||||||
|
|||||||
Reference in New Issue
Block a user