karl- / pb_Stl

STL import/export for Unity, supporting both ASCII and Binary.
MIT License
179 stars 43 forks source link

Fixed an issue for detecting binary files #1

Closed ZdravkoN closed 7 years ago

ZdravkoN commented 7 years ago

Binary files were detected based on the header. The current implementation assumes that those 80 bytes will be always NIL (0x0). This fix proposes that a file is binary if:

This change is made so that compatibility is increased. For example, support STL files that are exported from Blender, or other applications. These files contain information in the header about the app that did the export.

karl- commented 7 years ago

This looks good to me, I'll go ahead an merge the change. As a followup, do you have an STL file with a non-zero header that could be added as a unit test?