如何在python中获得管的三角形网格?

2024-06-17 15:18:37 发布

您现在位置:Python中文网/ 问答频道 /正文

我想得到一个由三维空间中的一系列点和半径定义的“管状体”的顶点和三角形。我可以使用Mayavi渲染这样的管:

from mayavi import mlab
import numpy as np
t = np.linspace(0, 20, 200)
mlab.plot3d(np.sin(t), np.cos(t), 0.1*t, t, tube_radius=0.1, tube_sides=20)

enter image description here

但是如何得到曲面顶点和三角形的列表呢? 对于用Python实现这一点的其他方法,也欢迎提出任何建议! 提前谢谢。你知道吗


Tags: fromimportnumpy定义asnp半径mayavi