trimesh icon indicating copy to clipboard operation
trimesh copied to clipboard

No `binvox_path` provided

Open yingzhang1109 opened this issue 4 years ago • 5 comments

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

yingzhang1109 avatar Mar 03 '21 16:03 yingzhang1109

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.

mikedh avatar Mar 03 '21 16:03 mikedh

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.

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 avatar Mar 03 '21 16:03 yingzhang1109

@yingzhang1109 @mikedh Hi, I also have the problem. I try two methods.

  1. 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

  2. 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 avatar May 18 '22 10:05 zjusxh

@zjusxh This work for me! You need put the executable file of binvox to a folder, and export PATH='.../folder:'$PATH

SongYupei avatar Jul 15 '22 06:07 SongYupei

@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.

SongYupei avatar Jul 15 '22 06:07 SongYupei