23 lines
526 B
Python
23 lines
526 B
Python
import os
|
|
import open3d as o3d
|
|
import trimesh
|
|
import matplotlib.pyplot as plt
|
|
from PIL import Image
|
|
import numpy as np
|
|
|
|
# 读取 OBJ 模型文件
|
|
for d in os.listdir('models'):
|
|
print(d)
|
|
mesh = trimesh.load('models/{}/0/output.obj'.format(d))
|
|
|
|
colors = mesh.visual.to_color().vertex_colors
|
|
points = mesh.vertices
|
|
print(colors.shape)
|
|
print(colors)
|
|
print(points.shape)
|
|
|
|
np.save('models/{}/0/colors.npy'.format(d), colors)
|
|
np.save('models/{}/0/points.npy'.format(d), points)
|
|
|
|
# mesh.show()
|