Skip to content

Commit

Permalink
Merge pull request #2246 from mokrueger/main
Browse files Browse the repository at this point in the history
FIX #2245: perform the same input validations as in intersects_id
  • Loading branch information
mikedh authored Jul 8, 2024
2 parents a3d4941 + 9de6956 commit 04158a1
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions trimesh/ray/ray_pyembree.py
Original file line number Diff line number Diff line change
Expand Up @@ -265,8 +265,11 @@ def intersects_first(self, ray_origins, ray_directions):
Index of triangle ray hit, or -1 if not hit
"""

ray_origins = np.asanyarray(deepcopy(ray_origins))
ray_directions = np.asanyarray(ray_directions)
ray_origins = np.array(deepcopy(ray_origins), dtype=np.float64)
ray_directions = np.asanyarray(ray_directions, dtype=np.float64)
if ray_origins.shape != ray_directions.shape:
raise ValueError("Ray origin and direction don't match!")
ray_directions = util.unitize(ray_directions)

triangle_index = self._scene.run(ray_origins, ray_directions)
return triangle_index
Expand Down

0 comments on commit 04158a1

Please sign in to comment.