feat: transform mesh to cloud points

This commit is contained in:
Ting-Jun Wang 2023-12-17 18:57:09 +08:00
parent 1e40d4c5b7
commit 3ad49bfe20
Signed by: snsd0805
GPG Key ID: 48D331A3D6160354

20
mesh_to_points.py Normal file
View File

@ -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()