В качестве простого примера я попробовал вычислить пересечение двух блоков, смещенных от друг друга.
Код: Выделить всё
# Create offset transformation matrix
T = np.eye(4)
T[:3, 3] = np.array([0.5, 0.5, 0.5])
# Form basic box meshes
mesh1 = trimesh.creation.box(extents=[1.0, 1.0, 1.0])
mesh2 = trimesh.creation.box(extents=[1.0, 1.0, 1.0], transform=T)
# Calculate intersection
test_intersection = mesh1.intersection(mesh2)
print(test_intersection)
print(test_intersection.volume)
# Visualize
scene = trimesh.Scene([mesh1, mesh2])
scene.show()
Код: Выделить всё
0.0
блоки
Почему пересечение сетки пусто ? Я неправильно понимаю использование метода .intersection()?
(я использую Python 3.12.7, Trimesh 4.5.2 установлен из pip)
Подробнее здесь: https://stackoverflow.com/questions/791 ... ng-trimesh