karl- / pb_Stl

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

Update Importer.cs #19

Closed janthiede closed 3 years ago

janthiede commented 3 years ago

When using the runtime importer to import STL files exported from CATIA V5 (ASCII), the resulting geometry was incorrect for the most part.

After reading https://stackoverflow.com/questions/16954216/system-string-splitnull-doesnt-remove-whitespace-c , I replaced string[] split = str.Trim().Split(null); by string[] split = str.Trim().Split((char[])null, StringSplitOptions.RemoveEmptyEntries); and now it works like a charm.