Я хочу удалить из сетки некоторые вершины, хранящиеся в массиве 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
Программы на Python
1736737225
Anonymous
Я хочу удалить из сетки некоторые вершины, хранящиеся в массиве 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()
Подробнее здесь: [url]https://stackoverflow.com/questions/68417158/how-to-select-an-array-of-vertices-in-pymeshlab[/url]
Ответить
1 сообщение
• Страница 1 из 1
Перейти
- Кемерово-IT
- ↳ Javascript
- ↳ C#
- ↳ JAVA
- ↳ Elasticsearch aggregation
- ↳ Python
- ↳ Php
- ↳ Android
- ↳ Html
- ↳ Jquery
- ↳ C++
- ↳ IOS
- ↳ CSS
- ↳ Excel
- ↳ Linux
- ↳ Apache
- ↳ MySql
- Детский мир
- Для души
- ↳ Музыкальные инструменты даром
- ↳ Печатная продукция даром
- Внешняя красота и здоровье
- ↳ Одежда и обувь для взрослых даром
- ↳ Товары для здоровья
- ↳ Физкультура и спорт
- Техника - даром!
- ↳ Автомобилистам
- ↳ Компьютерная техника
- ↳ Плиты: газовые и электрические
- ↳ Холодильники
- ↳ Стиральные машины
- ↳ Телевизоры
- ↳ Телефоны, смартфоны, плашеты
- ↳ Швейные машинки
- ↳ Прочая электроника и техника
- ↳ Фототехника
- Ремонт и интерьер
- ↳ Стройматериалы, инструмент
- ↳ Мебель и предметы интерьера даром
- ↳ Cантехника
- Другие темы
- ↳ Разное даром
- ↳ Давай меняться!
- ↳ Отдам\возьму за копеечку
- ↳ Работа и подработка в Кемерове
- ↳ Давай с тобой поговорим...
Мобильная версия