Я хочу удалить из сетки некоторые вершины, хранящиеся в массиве NumPy. Как я могу выбрать эти вершины в pymeshlab на основе индекса вершины или координат? Спасибо!
import pymeshlab
from scipy.spatial import KDTree
def remove_background(subdir, ms):
# load joint points
joint_arr = load_joint_points(subdir)
# get a reference to the current mesh
m = ms.current_mesh()
# get numpy arrays of vertices of the current mesh
vertex_array_matrix = m.vertex_matrix()
print(f'total # of vertices: {m.vertex_number()}')
# create a KD tree of the joint points
tree = KDTree(joint_arr)
selected_vertices = []
for vertex in vertex_array_matrix:
# if the closest joint pt is farther than 500mm from the vertex, add the vertex to list
dd, ii = tree.query(vertex, k=1)
if(dd > 500):
selected_vertices.append(vertex)
print(f"delete {len(selected_vertices)} vertices")
#how to select 'selected vertices' in pymeshlab?
ms.delete_selected_vertices()
Подробнее здесь: https://stackoverflow.com/questions/684 ... -pymeshlab
Как выбрать массив вершин в pymeshlab? ⇐ Python
-
- Похожие темы
- Ответы
- Просмотры
- Последнее сообщение
-
-
Проблема «Матрица вершин пуста» в pymeshlab во время «логической» операции
Anonymous » » в форуме Python - 0 Ответы
- 18 Просмотры
-
Последнее сообщение Anonymous
-