feat: display.txt 传递原子半径数组,draw.py 读取 per-atom 半径

之前所有原子使用统一的 ball_radius(来自 input.txt),
现在 display.txt header 包含 atom_radii 字段(逗号分隔
的半径数组),draw.py 据此为每个原子设置独立半径。
fallback:若没有 atom_radii 字段,仍使用 ball_radius。
This commit is contained in:
2026-06-12 07:46:28 +08:00
parent 466a301d34
commit 757a891a43
3 changed files with 10 additions and 3 deletions
+6 -1
View File
@@ -67,7 +67,12 @@ DISP_T = DISP_STEP * DT
# 原子信息
ATOM_IDS = disp_data["atom_ids"]
ATOM_RADII = np.full(N_ATOMS, float(h.get("ball_radius", 0.5)))
# 优先使用 per-atom 半径,否则用统一的 ball_radius
_raw_radii = h.get("atom_radii", "")
if _raw_radii.strip():
ATOM_RADII = np.array([float(x) for x in _raw_radii.split(",")])
else:
ATOM_RADII = np.full(N_ATOMS, float(h.get("ball_radius", 0.5)))
PLOT_ATOM_ROW = 0
PLOT_ATOM_ID = int(ATOM_IDS[0])
BOND_PAIRS = [] # display 格式不含成键信息,从原始数据加载