0

嘿伙计们,有没有比在 python 中使用 trimesh 更快的方法来获得光线和网格之间的交叉点?

所以现在我正在做这种方法: Stackoverflow: Python Intersections ray and mesh

我的代码片段:

import numpy as np
import trimesh

# load mesh
mesh = trimesh.load_mesh('test.ply')


# create some rays
ray_origins = np.load('origins.npy') # Shape = (100'000, 3)
ray_directions = np.array('directions.npy') #Shape = (100'000, 3)


# Get the intersections
locations, index_ray, index_tri = mesh.ray.intersects_location(
ray_origins=ray_origins, ray_directions=ray_directions)

但是对于很多光线来说真的很慢。有没有更快的方法?

4

0 回答 0