pyembree ray casting acceleration
See original GitHub issueHi @mikedh and thanks for the nice work with trimesh
. I am quite new with it but it really gets in hand.
My question now is related with the ray casting approach based on the pyembree
acceleration. I need to ray cast quite a few rays in a 3D scene, approx. 18060108 rays and maybe even more. Imagine that I have a scene with 16676 faces and from each face center I need to cast 1083 rays (i.e. 16676x1083 = 18060108).
As you understand I want to avoid for
loops and I cast all the rays at once. Also I am using the pyembree
based solution, as it states to accelerate the casting procedure in comparison to normal version, as follows:
import trimesh
import numpy as np
mesh = trimesh.Trimesh(vertices=vertices, faces=faces, face_normals=normals, process=False, use_embree=True) # create mesh from given data
intersection_points, index_ray, index_tri = mesh.ray.intersects_location(origins, drays, multiple_hits=False) # where origins are my triangle centers and drays my rays direction vectors
but this seems to perform quite slow as well, even though I am using pyembree
acceleration. Is this the best I can get or I am doing something wrong?
Issue Analytics
- State:
- Created 3 years ago
- Comments:14 (4 by maintainers)
Top GitHub Comments
Thanks for sharing @aluo-x. In my case though using v2.17.7 instead of v2.14 did not provide any significant acceleration.
So basically, embree 2.17.7 is as far as I know the latest compatible version with the embree python package. To use it:
git clone --recursive https://github.com/conda-forge/embree-feedstock.git
conda build .
conda install NEW_PKG_PATH
where you put in the location of the packagepython setup.py develop
or conda build
depending on if it has a recipe.