Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ValueError: min() arg is an empty sequence #59

Open
wsyzy opened this issue Jun 15, 2024 · 1 comment
Open

ValueError: min() arg is an empty sequence #59

wsyzy opened this issue Jun 15, 2024 · 1 comment

Comments

@wsyzy
Copy link

wsyzy commented Jun 15, 2024

I've sliced over 4000 stl models with this tool, and all of them have been sliced successfully except for 5 models that failed to slice, and I've confirmed that the 5 models themselves are fine. These 5 models report the following errors:

`multiprocessing.pool.RemoteTraceback:
"""
Traceback (most recent call last):
File "/home/ubuntuuser/anaconda3/lib/python3.10/multiprocessing/pool.py", line 125, in worker
result = (True, func(*args, **kwds))
File "/home/ubuntuuser/anaconda3/lib/python3.10/site-packages/stltovoxel/slice.py", line 54, in paint_z_plane
perimeter.lines_to_voxels(lines, pixels)
File "/home/ubuntuuser/anaconda3/lib/python3.10/site-packages/stltovoxel/perimeter.py", line 10, in lines_to_voxels
paint_y_axis(lines, pixels, x)
File "/home/ubuntuuser/anaconda3/lib/python3.10/site-packages/stltovoxel/perimeter.py", line 40, in paint_y_axis
min_idx = -min((x, -i) for i, x in enumerate(distances))[1]
ValueError: min() arg is an empty sequence
"""

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "/home/ubuntuuser/anaconda3/bin/stltovoxel", line 8, in
sys.exit(main())
File "/home/ubuntuuser/anaconda3/lib/python3.10/site-packages/stltovoxel/main.py", line 46, in main
convert_files(args.input, args.output, color_tuples, args.resolution, args.voxel_size, args.pad, args.parallel)
File "/home/ubuntuuser/anaconda3/lib/python3.10/site-packages/stltovoxel/convert.py", line 41, in convert_files
vol, scale, shift = convert_meshes(meshes, resolution, voxel_size, parallel)
File "/home/ubuntuuser/anaconda3/lib/python3.10/site-packages/stltovoxel/convert.py", line 23, in convert_meshes
cur_vol = slice.mesh_to_plane(org_mesh, shape, parallel)
File "/home/ubuntuuser/anaconda3/lib/python3.10/site-packages/stltovoxel/slice.py", line 37, in mesh_to_plane
results = [r.get() for r in result_ids]
File "/home/ubuntuuser/anaconda3/lib/python3.10/site-packages/stltovoxel/slice.py", line 37, in
results = [r.get() for r in result_ids]
File "/home/ubuntuuser/anaconda3/lib/python3.10/multiprocessing/pool.py", line 774, in get
raise self._value
ValueError: min() arg is an empty sequence
`

@cpederkoff
Copy link
Owner

Hi @wsyzy can you try this again with the new version of the code? I encountered a similar error while writing #62 and think that it may now be fixed.
Thanks,
Christian

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants