Skip to content

Commit

Permalink
FIX #2245: perform the same input validations as in intersects_id to …
Browse files Browse the repository at this point in the history
…ensure uniform behavior
  • Loading branch information
mokrueger committed Jul 2, 2024
1 parent 136f67c commit 9de6956
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 9de6956

Please sign in to comment.