使用mayavi进行三维数据可视化

tech2022-08-04  145

 

 

import numpy as np from mayavi import mlab import pandas as pd df=pd.read_csv('~/vicon/nexusdata.csv',header=3) #ball1 col_X1 = df['X1'][1:2000].tolist() col_Y1 = df['Y1'][1:2000].tolist() col_Z1 = df['Z1'][1:2000].tolist() pos_X1 = list(map(float,col_X1)) pos_Y1 = list(map(float,col_Y1)) pos_Z1 = list(map(float,col_Z1)) mlab.points3d(pos_X1, pos_Y1, pos_Z1,scale_factor=2.0,color=(1.0, 0.0, 0.0)) #ball2 col_X2 = df['X2'][2:2000].tolist() col_Y2 = df['Y2'][2:2000].tolist() col_Z2 = df['Z2'][2:2000].tolist() pos_X2 = list(map(float,col_X2)) pos_Y2 = list(map(float,col_Y2)) pos_Z2 = list(map(float,col_Z2)) mlab.points3d(pos_X2, pos_Y2, pos_Z2,scale_factor=2.0,color=(0.0, 1.0, 0.0)) #ball3 col_X3 = df['X3'][3:2000].tolist() col_Y3 = df['Y3'][3:2000].tolist() col_Z3 = df['Z3'][3:2000].tolist() pos_X3 = list(map(float,col_X3)) pos_Y3 = list(map(float,col_Y3)) pos_Z3 = list(map(float,col_Z3)) mlab.points3d(pos_X3, pos_Y3, pos_Z3,scale_factor=2.0,color=(0.0, 0.0, 1.0)) #ball4 col_X4 = df['X4'][4:2000].tolist() col_Y4 = df['Y4'][4:2000].tolist() col_Z4 = df['Z4'][4:2000].tolist() pos_X4 = list(map(float,col_X4)) pos_Y4 = list(map(float,col_Y4)) pos_Z4 = list(map(float,col_Z4)) mlab.points3d(pos_X4, pos_Y4, pos_Z4,scale_factor=2.0,color=(0.5, 0.5, 0.5)) mlab.show()

 

https://www.cnblogs.com/dalanjing/p/12289517.html

 

https://docs.enthought.com/mayavi/mayavi/auto/mlab_helper_functions.html

 

 

https://zhuanlan.zhihu.com/p/28077015

最新回复(0)