Uh oh!
There was an error while loading. Please reload this page.
Add binary option to stl codec - #45
Conversation
cd5a346 to
a89ee51Comparejmwright
commented
Apr 12, 2026
@Charlie-83 This test has a method of checking binary file content, in case it's relevant here. https://github.com/CadQuery/cq-cli/blob/main/tests/test_glb_codec.py#L46 |
Charlie-83
commented
Apr 12, 2026
@jmwright Yeah, I did a very similar thing here. Just checking that the first 5 bytes aren't "solid" which would mean it was an ASCII stl. Wikipedia says that the binary format should never start with "solid". Of course, the binary file could just be a load of nonsense. But, I'm guessing that actually parsing the contents to check it's cube is overkill. I could check that the number of triangles is correct or something since that's near the start of the file. |
a89ee51 to
7f11181Comparejmwright
commented
Apr 13, 2026
@Charlie-83 Is this ready for review? |
Charlie-83
commented
Apr 13, 2026
@jmwright Yes, thanks |
jmwright
commented
Apr 14, 2026
Thanks for this @Charlie-83 ! |
Uh oh!
There was an error while loading. Please reload this page.
Relevant issue: #29
I have added a
binaryoption to thestlcodec. This should beTrueorFalseDefault encoding is still ASCII for reasons discussed in the issue.
I have added a relevant test.