Closed stuartpb closed 5 years ago
Thank you for the detailed description of the issue. I could reproduce the issue and think it's a file issue. I've imported it into Cura (3.4.0) and I could autorotate it via the autorotation plugin and when I exported the same model from Cura into a binary STL, then i was also able to autorotate it.
python3 Tweaker.py -i UM2_gauntlet.stl
Do you know from which software this file origins?
Please try also to import and save the file again with your slicing program.
As it seems that the issue is caused by a corrupt binary STL format, I close this issue. If there is any problem in the tweaker, please re-open it.
I stumbled on this and it seems like it's a problem with reading some binary STL files in general. I try to Tweak binary .stl exported from Rhinoceros, and I get this:
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/ubuntu/Scripts/Tweaker-3/Tweaker.py", line 121, in <module>
objs = FileHandler.load_mesh(args.inputfile)
File "/home/ubuntu/Scripts/Tweaker-3/FileHandler.py", line 30, in load_mesh
objs = self.load_binary_stl(f)
File "/home/ubuntu/Scripts/Tweaker-3/FileHandler.py", line 91, in load_binary_stl
f.read(80 - 5)
File "/usr/lib/python3.8/codecs.py", line 322, in decode
(result, consumed) = self._buffer_decode(data, self.errors, final)
UnicodeDecodeError: 'utf-8' codec can't decode byte 0x9e in position 76: invalid start byte
But when I convert this binary STL to ASCII STL with this Python script Binary STL to ASCII it runs just fine. I run Tweaker with Python 3 (3.8.5). Linked script works for me only when run with Python 2 (2.7.18) though.
I can reproduce this error with quite a few files, from different sources. If it helps, I can send you other files that doesn't work. I'm no expert in coding, but can it be just some UTF-8 encoding error in Python 3? Tweaker Binary-ASCII.zip
I tried running
python Tweaker.py -i gauntlet.stl -x -p -r
with this file and I got this error: