بنقرة واحدة
mol-3d-viewer
将 SMILES 或化学名称转换为分子 3D 结构。支持生成 SDF 文件、3D 分子图片和可交互 HTML 网页(可旋转观察)。
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
القائمة
将 SMILES 或化学名称转换为分子 3D 结构。支持生成 SDF 文件、3D 分子图片和可交互 HTML 网页(可旋转观察)。
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
استنادا إلى تصنيف SOC المهني
Extract structured chemical compound characterization data from chemistry supplementary material documents (PDF/Markdown). 从化学论文补充材料(PDF/Markdown)中提取结构化化合物表征数据。 Use when Kimi needs to extract compound properties including NMR spectra, HRMS, HPLC data, melting points, optical rotation, and yield information from chemistry research papers or supplementary materials. 支持提取NMR谱图、HRMS、HPLC数据、熔点、旋光度、产率等信息。 Supports both single compound extraction and batch extraction of all compounds. 支持单个化合物提取和批量提取所有化合物。
Convert Gaussian gjf input files to XYZ format. 将Gaussian gjf输入文件转换为XYZ格式。 Use when agent needs to convert molecular structure files from Gaussian input format (.gjf) to XYZ format for visualization or use with other computational chemistry software. 当智能体需要将Gaussian输入格式(.gjf)的分子结构文件转换为XYZ格式用于可视化或其他计算化学软件时使用。
Convert PDF files to Markdown using MinerU API. 使用MinerU API将PDF文件转换为Markdown格式。 Use when Kimi needs to extract structured text, images, tables, and formulas from PDF documents while preserving document layout and formatting. 适用于需要提取结构化文本、图片、表格和公式并保留文档布局的场景。 Supports batch conversion and outputs full.md with images/, JSON metadata, and other extracted assets. 支持批量转换,输出full.md、images/目录、JSON元数据等。 Now supports large PDFs (600+ pages) by automatic splitting and merging. 现已支持大文件(600+页)自动拆分和合并处理。
Extract DFT calculation coordinates from PDF files and generate Gaussian gjf files. 从PDF文件中提取DFT计算坐标并生成Gaussian gjf输入文件。 Supports batch processing with separate output folders for each PDF. 支持批量处理,每个PDF单独生成输出文件夹。
Predict and visualize MS/MS spectra from a single SMILES using the fioRa online app. Use when the user wants a mass spectrum, MGF/MSP output, or a plotted stick spectrum from SMILES, with optional custom Name, precursor type, collision energy, and instrument settings.
Predict liquid-phase ¹H and ¹³C NMR chemical shifts from a SMILES string using NMRNet (deep learning, SE(3)-Transformer). Outputs per-atom shift values (ppm) and Lorentzian-broadened spectrum PNG files.
| name | mol-3d-viewer |
| description | 将 SMILES 或化学名称转换为分子 3D 结构。支持生成 SDF 文件、3D 分子图片和可交互 HTML 网页(可旋转观察)。 |
| trigger | ["3D 分子","分子 3D","3D 结构","3D visualization","rotate molecule","交互分子","3D model","分子模型"] |
将 SMILES 字符串或化学名称转换为分子 3D 结构,支持生成 SDF 文件、3D 分子图片和 可交互 HTML 网页(可用鼠标旋转观察)。
生成 ethanol 的 3D 分子结构
SMILES: CCO,创建 3D 可交互网页
可视化 aspirin 的 3D 结构,保存为 HTML
poly[oxy(1-methylethylene)] 生成 3D 模型
从文件 molecule.sdf 生成 3D 展示
批量生成 3D:CCO,C1=CC=CC=C1
# 生成全部三种输出(SDF + 3D 图片 + HTML)
python3 scripts/mol_3d_viewer.py --smiles "CCO" --output ethanol
# 只生成 SDF 文件
python3 scripts/mol_3d_viewer.py --smiles "CCO" --output ethanol --sdf-only
# 只生成 3D 图片
python3 scripts/mol_3d_viewer.py --smiles "CCO" --output ethanol --image-only
# 只生成 HTML
python3 scripts/mol_3d_viewer.py --smiles "CCO" --output ethanol --html-only
# 从名称生成
python3 scripts/mol_3d_viewer.py --name "aspirin" --output aspirin
# 自定义渲染样式
python3 scripts/mol_3d_viewer.py --smiles "CCO" --output ethanol --style ball_stick
# 批量生成
python3 scripts/mol_3d_viewer.py --smiles "CCO,C1=CC=CC=C1" --output-dir ./3d_molecules
| 参数 | 简写 | 说明 | 默认值 |
|---|---|---|---|
--smiles | -s | SMILES 字符串(可多个) | - |
--name | -n | IUPAC 名称 | - |
--input | -i | 输入分子文件 | - |
--output | -o | 输出文件基础路径 | 自动生成 |
--output-dir | -d | 输出目录(批量模式) | ~/.openclaw/media/mol-3d-viewer |
--sdf-only | 只生成 SDF 文件 | false | |
--image-only | 只生成 3D 图片 | false | |
--html-only | 只生成 HTML | false | |
--style | -S | 渲染样式 | ball_stick |
--width | -W | 宽度(像素) | 800 |
--height | -H | 高度(像素) | 600 |
--bg-color | -b | 背景颜色 | white |
--show-labels | -l | 显示原子标签 | true |
--hide-labels | 隐藏原子标签 | false | |
--auto-rotate | -r | HTML 自动旋转 | false |
--force-field | 力场类型 | mmff94 | |
--max-steps | 优化最大步数 | 200 |
| 样式 | 说明 | 适用场景 |
|---|---|---|
stick | 棍状模型 | 清晰展示化学键 |
sphere | 空间填充模型 | 展示分子体积和形状 |
ball_stick | 球棍模型(默认) | 平衡结构和原子 |
surface | 分子表面 | 展示静电势、疏水性 |
line | 线状模型 | 快速预览大分子 |
$ python3 mol_3d_viewer.py -s "CCO" -o ethanol
✓ 已生成 3D 优化结构
📄 SDF: ethanol.sdf
🖼️ 3D 图片:ethanol_3d.png
🌐 HTML: ethanol.html (可交互,支持旋转)
$ python3 mol_3d_viewer.py -n "caffeine" -o caffeine
✓ 已生成 3D 优化结构
📄 SDF: caffeine.sdf
🖼️ 3D 图片:caffeine_3d.png
🌐 HTML: caffeine.html (可交互,支持旋转)
$ python3 mol_3d_viewer.py -s "*OCC*" -o peo
✓ 已生成 3D 优化结构 [聚合物]
📄 SDF: peo.sdf
🖼️ 3D 图片:peo_3d.png
🌐 HTML: peo.html (可交互,支持旋转)
$ python3 mol_3d_viewer.py -s "CCO,C1=CC=CC=C1,CC(=O)O" -d ./3d_molecules
✓ 已生成:./3d_molecules/mol_1/ (3 files)
✓ 已生成:./3d_molecules/mol_2/ (3 files)
✓ 已生成:./3d_molecules/mol_3/ (3 files)
完成:3/3 成功
生成的 HTML 网页支持:
pip install rdkit requests numpy
可选依赖(用于更高级的 3D 优化):
pip install openbabel # 支持更多文件格式
# 一键生成(自动转换名称 + 3D 优化 + 三种输出)
python3 scripts/mol_3d_viewer.py --name "aspirin" --output aspirin
# 从 SDF 文件生成
python3 scripts/mol_3d_viewer.py --input molecule.sdf --output molecule_3d
# 从 PDB 文件生成(蛋白质等生物大分子)
python3 scripts/mol_3d_viewer.py --input protein.pdb --output protein_3d --style surface
# 创建聚合物列表
cat > polymers.txt << EOF
poly[oxyethylene]
poly[methyl methacrylate]
poly[styrene]
EOF
# 批量转换并生成 3D
python3 scripts/iupac_to_smiles.py --input polymers.txt --output polymers.json
# 提取 SMILES 并批量生成 3D
python3 scripts/mol_3d_viewer.py --smiles "*OCC*,*CC(C)(C(=O)OC)*,*CC(C1=CC=CC=C1)*" \
--output-dir ./polymer_3d
# 1. 转换名称为 SMILES
python3 scripts/iupac_to_smiles.py --name "poly[oxy(1-methylethylene)]" -o result.json
# 2. 生成 3D 三种输出
SMILES=$(cat result.json | jq -r '.results[0].polymer_smiles')
python3 scripts/mol_3d_viewer.py --smiles "$SMILES" --output ppo_3d
# 2D 结构图 + 3D 可交互模型一起生成
python3 scripts/mol_visualizer.py --smiles "CCO" --output ethanol_2d.png
python3 scripts/mol_3d_viewer.py --smiles "CCO" --output ethanol_3d
| 格式 | 扩展名 | 说明 |
|---|---|---|
| SDF | .sdf, .sd | Structure Data File,支持多个分子 |
| MOL | .mol | MDL Molfile,单个分子 |
| PDB | .pdb | Protein Data Bank,生物大分子 |
| XYZ | .xyz | 简单坐标格式 |
| 错误 | 说明 | 解决方案 |
|---|---|---|
Invalid SMILES | SMILES 格式错误 | 检查语法,确保括号匹配 |
3D generation failed | 3D 坐标生成失败 | 简化分子或检查价态 |
Force field error | 力场优化失败 | 尝试 UFF 力场(--force-field uff) |
Name not found | 名称无法识别 | OPSIN 无法识别,使用 SMILES 直接输入 |
File format error | 文件格式不支持 | 检查文件格式,转换为 SDF/MOL |
| 分子大小 | 3D 生成时间 | HTML 生成时间 |
|---|---|---|
| 小分子 (<20 原子) | <0.5s | <0.1s |
| 中等分子 (20-50 原子) | 0.5-2s | <0.1s |
| 大分子 (50-100 原子) | 2-5s | <0.2s |
| 聚合物/蛋白 (>100 原子) | 5-20s | 0.2-1s |
默认输出目录:~/.openclaw/media/mol-3d-viewer/
可以在技能目录创建输出目录:
mkdir -p ~/.openclaw/media/mol-3d-viewer
# 使用 UFF 力场(适合含金属的分子)
python3 mol_3d_viewer.py -s "CCO" -o ethanol --force-field uff
# 增加优化步数(更精确但更慢)
python3 mol_3d_viewer.py -s "CCO" -o ethanol --max-steps 500
# 球棍模型
python3 mol_3d_viewer.py -s "CCO" -o ethanol --style ball_stick
# 空间填充模型
python3 mol_3d_viewer.py -s "CCO" -o ethanol --style sphere