- 规则:铜层 2→4,差分 0.28/0.18,间距 0.15,过孔 0.3/0.2(rules_base) - 几何:98×98 板框 + 4×M3,槽阵居中,L1 12V 大铜 + 指头(pcb_base) - 摆位:五插槽留 L1,其余 133 件翻到 L4;背面镜像规则实测;Hub 放走廊 2、 东移 2.5 mm;扇出圈 / 小件间距 1.5(去耦例外)/ 9 A 过孔阵禁区(place_base) - 叠层按用户决定改为 L1 槽面 / L2 整层 +3V3 / L3 整层 GND / L4 器件面 - 布线:D± 七对按构造布通(USB3 掉头、USB1/2 北去掉头、USB4/5 东绕、 J23 桥),+3V3 / GND / +12V 平面网每脚一孔,0.125 网格 + PathFinder 开关(route_base、remote_route.ps1);剩 37 个网待手工补 - 铺铜:4 层重写,入口链自南向北切段 + 断面校核(pour_base); 已下发布线 / 缝合孔 / 铜面轮廓,填铜未成功(待查) - 工具:plot_base / plot_routes / shot_base,board_check 通孔两层都算 Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_0168Bu6SEx3cXXCJLkdnE6zB
33 行
1.1 KiB
Python
33 行
1.1 KiB
Python
# -*- coding: utf-8 -*-
|
|
u"""截底板 PCB 的当前渲染:python .claude/r2/shot_base.py <out.png>
|
|
|
|
`.claude/shot.py` 是原理图版(读 dmt_Schematic 的页名),PCB 页上会抛错,所以另起这一份。
|
|
"""
|
|
import base64
|
|
import json
|
|
import os
|
|
import sys
|
|
|
|
HERE = os.path.dirname(os.path.abspath(__file__))
|
|
sys.path.insert(0, os.path.dirname(HERE))
|
|
sys.path.insert(0, HERE)
|
|
from eda import run # noqa: E402
|
|
import pcb_base as B # noqa: E402
|
|
|
|
out = sys.argv[1]
|
|
js = """
|
|
const sleep = ms => new Promise(r => setTimeout(r, ms));
|
|
await eda.dmt_EditorControl.openDocument('%s');
|
|
await sleep(1500);
|
|
await eda.dmt_EditorControl.zoomToAllPrimitives();
|
|
await sleep(1500);
|
|
const img = await eda.dmt_EditorControl.getCurrentRenderedAreaImage();
|
|
const bytes = new Uint8Array(await new Response(img).arrayBuffer());
|
|
let s=''; for (let i=0;i<bytes.length;i++) s += String.fromCharCode(bytes[i]);
|
|
return btoa(s);
|
|
""" % B.PCB
|
|
r = run(js, timeout=300)
|
|
assert r.get('success'), json.dumps(r, ensure_ascii=False)[:400]
|
|
open(out, 'wb').write(base64.b64decode(r['result']))
|
|
print('->', out)
|