Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/347.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 使用Axes3D打印类似修剪的对象。Plot_trisurf()_Python_3d_Mplot3d_Trimesh - Fatal编程技术网

Python 使用Axes3D打印类似修剪的对象。Plot_trisurf()

Python 使用Axes3D打印类似修剪的对象。Plot_trisurf(),python,3d,mplot3d,trimesh,Python,3d,Mplot3d,Trimesh,我有一个Trimesh对象,我不知道如何绘制它。我的目标类似于mplot3d中的Axes3D.plot_trisurf()函数(见下文)。Trimesh对象甚至有一个包含面的属性,但我不知道从哪里获取网格点的坐标 谢谢你的建议 您可以这样做,其中mesh是Trimesh对象: import matplotlib.pyplot as plt from mpl_toolkits.mplot3d import Axes3D fig = plt.figure() ax = fig.add_subplot

我有一个Trimesh对象,我不知道如何绘制它。我的目标类似于mplot3d中的Axes3D.plot_trisurf()函数(见下文)。Trimesh对象甚至有一个包含面的属性,但我不知道从哪里获取网格点的坐标

谢谢你的建议


您可以这样做,其中
mesh
是Trimesh对象:

import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
fig = plt.figure()
ax = fig.add_subplot(111, projection='3d')
ax.plot_trisurf(mesh.vertices[:, 0], mesh.vertices[:,1], triangles=mesh.faces, Z=mesh.vertices[:,2]) 
plt.show()

你可能要玩的规模,方面,旋转等