trimesh
trimesh copied to clipboard
No `binvox_path` provided
Hey, everyone, I have downloaded binvox, and I am trying to voxelize the mesh by
voxelized_mesh = mesh.voxelized(np.max(mesh.extents) / 128,method='binvox')
However, I get
OSError: No `binvox_path` provided, and no binvox executable found on PATH.
Please go to https://www.patrickmin.com/binvox/ and download the appropriate version.
I am wondering if there is any way to define my binvox path to trimesh? It seems that it cannot properly find the correct binvox path
Hey, if you go to a terminal and type binvox, does it work? You probably need to add it to your environment variable PATH, which in windows you can do in control panel, and in linux you can do with something like export PATH=/path/to/binvox:$PATH.
Hey, if you go to a terminal and type
binvox, does it work? You probably need to add it to your environment variablePATH, which in windows you can do in control panel, and in linux you can do with something likeexport PATH=/path/to/binvox:$PATH.
Yes, I did, I add the path to my environment variable, and then I still get this error
File "C:\Users\Ying Zhang\Research\Voxelization\trimesh_to_vxc.py", line 13, in <module>
voxelized_mesh = mesh.voxelized(np.max(mesh.extents) / 128, method='binvox')
File "C:\Users\Ying Zhang\.conda\envs\research\lib\site-packages\trimesh\base.py", line 2314, in voxelized
return creation.voxelize(
File "C:\Users\Ying Zhang\.conda\envs\research\lib\site-packages\trimesh\voxel\creation.py", line 300, in voxelize
return voxelizers(method, mesh=mesh, pitch=pitch, **kwargs)
File "C:\Users\Ying Zhang\.conda\envs\research\lib\site-packages\trimesh\util.py", line 2332, in __call__
return self[key](*args, **kwargs)
File "C:\Users\Ying Zhang\.conda\envs\research\lib\site-packages\trimesh\constants.py", line 134, in timed
result = method(*args, **kwargs)
File "C:\Users\Ying Zhang\.conda\envs\research\lib\site-packages\trimesh\voxel\creation.py", line 270, in voxelize_binvox
return binvox.voxelize_mesh(mesh, binvoxer)
File "C:\Users\Ying Zhang\.conda\envs\research\lib\site-packages\trimesh\exchange\binvox.py", line 577, in voxelize_mesh
with open(out_path, 'rb') as fp:
FileNotFoundError: [Errno 2] No such file or directory: 'C:\\Users\\YINGZH~1\\AppData\\Local\\Temp\\tmpkiqwkh76\\model.binvox'
@yingzhang1109 @mikedh Hi, I also have the problem. I try two methods.
-
In Linux, step one: I download the binvox file from https://www.patrickmin.com/binvox/ and put it into the /root/install_package/. step two: vim ~/.bashrc , add export PATH=/root/install_package/binvox:$PATH and source ~/.bashrc
-
In Windows, step one: I download the binvox.exe from https://www.patrickmin.com/binvox/ and put it into E:/download/. step two: I can run the binvox.exe in cmd, but when I run the following voxel = mesh.voxelized(pitch=1, method='binvox', bounds=bound_box,binvox_path='E:/download/binvox.exe'), it does not work.
I still get the error:
OSError: No binvox_path provided, and no binvox executable found on PATH.
Please go to https://www.patrickmin.com/binvox/ and download the appropriate version.
How to resolve it ? Thank you very much.
@zjusxh This work for me! You need put the executable file of binvox to a folder, and export PATH='.../folder:'$PATH
@yingzhang1109 This work for me! If you run ./binvox you will get this error: bash: ./binvox: Permission denied run this command: chmod u+x binvox
and the problem will be solved.