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

The number of lines is odd #57

Closed
Raffael1998 opened this issue Feb 28, 2024 · 1 comment
Closed

The number of lines is odd #57

Raffael1998 opened this issue Feb 28, 2024 · 1 comment

Comments

@Raffael1998
Copy link

Hi, I'm having an error when running this code :

import stltovoxel
iges_file_path = r'..\data\3D-file\Hood-inner2-Output.stl'
stltovoxel.convert_file(iges_file_path, 'output.png')

First I'm getting several warnings:
[Warning] The number of lines is odd
and the process doesn't finish :

[21](file:///C:/Users/Raffael%20GROS/dieface_design/.venv/Lib/site-packages/stltovoxel/convert.py:21) for mesh_ind, org_mesh in enumerate(meshes):
     [22](file:///C:/Users/Raffael%20GROS/dieface_design/.venv/Lib/site-packages/stltovoxel/convert.py:22)     slice.scale_and_shift_mesh(org_mesh, scale, shift)
---> [23](file:///C:/Users/Raffael%20GROS/dieface_design/.venv/Lib/site-packages/stltovoxel/convert.py:23)     cur_vol = slice.mesh_to_plane(org_mesh, shape, parallel)
     [24](file:///C:/Users/Raffael%20GROS/dieface_design/.venv/Lib/site-packages/stltovoxel/convert.py:24)     vol[cur_vol] = mesh_ind + 1
     [25](file:///C:/Users/Raffael%20GROS/dieface_design/.venv/Lib/site-packages/stltovoxel/convert.py:25) return vol, scale, shift
...
---> [40](file:///C:/Users/Raffael%20GROS/dieface_design/.venv/Lib/site-packages/stltovoxel/perimeter.py:40)     min_idx = -min((x, -i) for i, x in enumerate(distances))[1]
     [41](file:///C:/Users/Raffael%20GROS/dieface_design/.venv/Lib/site-packages/stltovoxel/perimeter.py:41)     del target_ys[min_idx]
     [43](file:///C:/Users/Raffael%20GROS/dieface_design/.venv/Lib/site-packages/stltovoxel/perimeter.py:43) yi = 0

ValueError: min() iterable argument is empty

Do you know why ? My stl file is fine, I can display it no problem in a stl viewer online for example.
Thanks.

@cpederkoff
Copy link
Owner

Hi Rafel,
I encountered this issue while writing #62. Could you try again with the new code?
If the issue persists, would you be able to share an STL and command line arguments that reproduce the issue so I can debug?
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