wolph / numpy-stl

Simple library to make working with STL files (and 3D objects in general) fast and easy.
http://numpy-stl.readthedocs.org/
BSD 3-Clause "New" or "Revised" License
605 stars 103 forks source link

AUTOMATIC mode does not work, if header is in ascii #191

Closed lucazechner closed 1 year ago

lucazechner commented 2 years ago

An solidworks exported stl file contains a header in ascii and the mesh in binary mode. If the stl mesh gets imported (from_file method) with automatic mode, an exception is thrown. Workaround: manually set the mode to binary, with disadvantage to loose support for ascii files. Attached is the used sample file from solidworks: solidworks sample file.zip

I hadn't much time yet to deep dive into the source, but i assume the issue is somewhere in the bin/ascii detection. Thanks in advance

wolph commented 1 year ago

I've had a look at the file but (at least in this case) the issue is that there's no content to the file. It only contains the ascii header and nothing else. Do you have an STL file with a basic mesh perhaps?