question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Bug] AttributeError: module 'trimesh.voxel' has no attribute 'creation'

See original GitHub issue

Trimesh version: 3.9.1

Hi. I discovered that trimesh reports the following error

AttributeError: module 'trimesh.voxel' has no attribute 'creation'

when trying to access the module. However, if a method from it is called, e.g.

m = trimesh.creation.box()
m.voxelized(pitch=.5)

then the module trimesh.voxel.creation can be correctly found by the program.

Issue Analytics

  • State:open
  • Created 3 years ago
  • Comments:8 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
ShunChengWucommented, May 20, 2021

same here. able to solve this by import creation myself

from trimesh.voxel import creation
0reactions
chlongvcommented, Nov 18, 2022

My bad, it’s not exactly the same error, it’s rather related to trimesh.voxel.creation, but it looks very similar.

merlin@L-0219:/workspace$ python3
Python 3.10.6 (main, Nov  2 2022, 18:53:38) [GCC 11.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import trimesh
>>> mesh = trimesh.Trimesh()
>>> n = trimesh.voxel.creation.local_voxelize(mesh, (0, 0, 0), 0.0, 1)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: module 'trimesh.voxel' has no attribute 'creation'
>>> from trimesh.voxel import creation
>>> n = trimesh.voxel.creation.local_voxelize(mesh, (0, 0, 0), 0.0, 1)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python3.10/dist-packages/trimesh/voxel/creation.py", line 120, in local_voxelize
    faces = list(mesh.triangles_tree.intersection(bounds))
  File "/usr/local/lib/python3.10/dist-packages/trimesh/caching.py", line 139, in get_cached
    value = function(*args, **kwargs)
  File "/usr/local/lib/python3.10/dist-packages/trimesh/base.py", line 797, in triangles_tree
    tree = triangles.bounds_tree(self.triangles)
  File "/usr/local/lib/python3.10/dist-packages/trimesh/triangles.py", line 344, in bounds_tree
    tree = util.bounds_tree(triangle_bounds)
  File "/usr/local/lib/python3.10/dist-packages/trimesh/util.py", line 1733, in bounds_tree
    import rtree
ModuleNotFoundError: No module named 'rtree'
>>> 

The call fails in the “working” (i.e. 2nd) case because the missing rtree dependency (as already reported by @alexge233), but we see that the first call fails because trimesh.voxel has no creation attribute.

Read more comments on GitHub >

github_iconTop Results From Across the Web

trimesh.voxel.creation — trimesh 3.17.1 documentation
Voxelize a mesh in the region of a cube around a point. When fill=True, uses proximity.contains to fill the resulting voxels so may...
Read more >
trimesh - Bountysource
Trimesh version: 3.9.1. Hi. I discovered that trimesh reports the following error AttributeError: module 'trimesh.voxel' has no attribute 'creation'.
Read more >
python - How do I convert a 3D point cloud (.ply) into a mesh ...
I solved the problem of generating a trimesh from a point cloud using ... mesh with the vertices and faces from open3d tri_mesh...
Read more >
open3d.geometry.TriangleMesh
The surface reconstruction is done by rolling a ball with a given radius over the point cloud, whenever the ball touches three points...
Read more >
PyMesh Documentation
a mesh attribute where a normal vector is associated with each vertex. ... To remove vertices that is not part of any face...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found