feat: transform mesh to cloud points
This commit is contained in:
parent
1e40d4c5b7
commit
3ad49bfe20
20
mesh_to_points.py
Normal file
20
mesh_to_points.py
Normal 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()
|
||||||
Loading…
Reference in New Issue
Block a user