diff --git a/mesh_to_points.py b/mesh_to_points.py new file mode 100644 index 0000000..a367aff --- /dev/null +++ b/mesh_to_points.py @@ -0,0 +1,20 @@ + +import open3d as o3d +import trimesh +import matplotlib.pyplot as plt +from PIL import Image +import numpy as np + +# 读取 OBJ 模型文件 +mesh = trimesh.load('output.obj') + +colors = mesh.visual.to_color().vertex_colors +points = mesh.vertices +print(colors.shape) +print(colors) +print(points.shape) + +np.save('colors.npy', colors) +np.save('points.npy', points) + +mesh.show()