Eastsheng's Wiki

Ovito高质量图片渲染Python模块

2023-04-13 18:11:28

安装ovito

安装OVITO Python Module

1
pip install -U ovito

测试

1
2
import ovito
print("Hello, this is OVITO %i.%i.%i" % ovito.version)

渲染脚本

1
2
3
4
5
6
7
8
9
10
11
12
from ovito.io import import_file
from ovito.vis import Viewport,TachyonRenderer
#读入data文件
d = "1_nvt_-0.07"
pipeline = import_file(d+'.data')
pipeline.add_to_scene()
vp = Viewport(type = Viewport.Type.FRONT, camera_dir = (0, 0, 0)) #(0, 1, 0))
vp.zoom_all()
#配置输出
vp.render_image(filename=d+'.png',
size=(3200, 2400),
renderer=TachyonRenderer(shadows=False, direct_light_intensity=1.1))
  • 1_nvt_-0

参考