binary-stl-toASCII
binary-stl-toASCII copied to clipboard
couldn't convert binary stl file to ascii stl file
Hey, I tried to convert a binary stl file to ascii stl file, but I received an error message stating, that in some line it wasn't possible to resolve the binary part to an ascii symbol. If you want to look into that problem, I can send you the stl file I am talking about.
The terminal output:
File "C:\Users\myname\Documents\Eclipse Workspace\STL_Converter\binary-stl-toASCII\BinaryToASCII.py", line 7, in
C:\Users\myname\Documents\Eclipse Workspace\STL_Converter\binary-stl-toASCII>
Best regards Dezzard
Hi! I have the same problem:
Traceback (most recent call last):
File "C:\D\arduino\projects\cnc\binary-stl-toASCII-6f4e46c21ad33b19d0b99a6e1b40003e45ac8f0b\BinaryToASCII.py", line 7, in
Hi! I have the same problem:
Traceback (most recent call last): File "C:\D\arduino\projects\cnc\binary-stl-toASCII-6f4e46c21ad33b19d0b99a6e1b40003e45ac8f0b\BinaryToASCII.py", line 7, in data = infile.read() File "C:\Users\FireWing\AppData\Local\Programs\Python\Python39\lib\encodings\cp1250.py", line 23, in decode return codecs.charmap_decode(input,self.errors,decoding_table)[0] UnicodeDecodeError: 'charmap' codec can't decode byte 0x88 in position 472: character maps to undefined
Hi! I wasn't able to fix the code. Sorry. Have a nice day!
Ok, no problem, modifying this line:
infile = open('binary.stl') #import file
to this:
infile = open('binary.stl', encoding="utf8") #import file
has solved the problem for me. :)
If @FireWingHu's method did not work for you, you can also try explicitly opening the file as read-only and binary, as follows:
infile = open('binary.stl', 'rb') #import file
im getting an xrange not defined error, someone please help
If @FireWingHu's method did not work for you, you can also try explicitly opening the file as read-only and binary, as follows:
infile = open('binary.stl', 'rb') #import file
I did this and it stopped the other errors