apparentlymart / python-stl

Python library for parsing and producing STL files, in both ASCII and binary formats. No longer maintained.
MIT License
9 stars 13 forks source link

Implements reading a binary STL's header #2

Closed zachwick closed 9 years ago

zachwick commented 9 years ago

For binary STLs, the header is an 80 byte string of the form:

solid NameOfTheSolidHere

This library now parses that header and sets the Solid.name property accordingly. The original documentation read that binary STLs have no concept of an object name. However, Wikipedia[0] suggests that some binary STL files still use a header that begins 'solid '. In fact, exporting from FreeCAD[1] results in a binary STL that has a fleshed out header.

[0] https://en.wikipedia.org/wiki/STL_%28file_format%29#Binary_STL [1] http://freecadweb.org/

Signed-off-by: zachwick zach@zachwick.com