You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to run an example from https://trimsh.org/examples/ray.html. I'm using Python 3.7.3 on Raspberry Pi 4 with the newest RPi OS. This snippet:
import numpy as np
import trimesh
mesh = trimesh.creation.icosphere()
ray_origins = np.array([[0, 0, -3], [2, 2, -3]])
ray_directions = np.array([[0, 0, 1], [0, 0, 1]])
locations, index_ray, index_tri = mesh.ray.intersects_location(
ray_origins=ray_origins,
ray_directions=ray_directions)
print('The rays hit the mesh at coordinates:\n', locations)
produces:
Traceback (most recent call last):
File "/home/pi/pick/old/test-trimesh.py", line 10, in <module>
ray_directions=ray_directions)
File "/home/pi/.local/lib/python3.7/site-packages/trimesh/ray/ray_triangle.py", line 107, in intersects_location
**kwargs)
File "/home/pi/.local/lib/python3.7/site-packages/trimesh/ray/ray_triangle.py", line 64, in intersects_id
tree=self.mesh.triangles_tree,
File "/home/pi/.local/lib/python3.7/site-packages/trimesh/caching.py", line 109, in get_cached
value = function(*args, **kwargs)
File "/home/pi/.local/lib/python3.7/site-packages/trimesh/base.py", line 823, in triangles_tree
tree = triangles.bounds_tree(self.triangles)
File "/home/pi/.local/lib/python3.7/site-packages/trimesh/triangles.py", line 344, in bounds_tree
tree = util.bounds_tree(triangle_bounds)
File "/home/pi/.local/lib/python3.7/site-packages/trimesh/util.py", line 1756, in bounds_tree
import rtree
File "/home/pi/.local/lib/python3.7/site-packages/rtree/__init__.py", line 9, in <module>
from .index import Rtree, Index # noqa
File "/home/pi/.local/lib/python3.7/site-packages/rtree/index.py", line 6, in <module>
from . import core
File "/home/pi/.local/lib/python3.7/site-packages/rtree/core.py", line 77, in <module>
rt.Error_GetLastErrorNum.restype = ctypes.c_int
File "/usr/lib/python3.7/ctypes/__init__.py", line 369, in __getattr__
func = self.__getitem__(name)
File "/usr/lib/python3.7/ctypes/__init__.py", line 374, in __getitem__
func = self._FuncPtr((name_or_ordinal, self))
AttributeError: /usr/bin/python3: undefined symbol: Error_GetLastErrorNum
What is wrong?
The text was updated successfully, but these errors were encountered:
I tried this example on Ubuntu 20.04, and it works just fine. I vaguely recall that one of the dependencies of trimesh could not be satisfied on 32-bit Raspberry Pi OS. Perhaps this is the source of this error.
No worries, yeah this error is in rtree which is what trimesh's slow built-in ray checks (i.e. vs embree) use for broad-phase checking. It looks like this error is related to a) no rtree wheels bundling libspatialindex are built for ARM and b) no libspatialindex installed. If it exists on a Rasberry Pi you might try an apt-get install libspatialindex-dev.
I'm trying to run an example from https://trimsh.org/examples/ray.html. I'm using Python 3.7.3 on Raspberry Pi 4 with the newest RPi OS. This snippet:
produces:
What is wrong?
The text was updated successfully, but these errors were encountered: