gradientspace / geometry3Sharp

C# library for 2D/3D geometric computation, mesh algorithms, and so on. Boost license.
http://www.gradientspace.com
Boost Software License 1.0
1.71k stars 384 forks source link

OBJWriter doesn't flush material stream writer #154

Open GeoSpark opened 3 years ago

GeoSpark commented 3 years ago

When exporting materials, each material is printed to a StreamWriter. Once all materials are written the stream is closed. However if the writer has written less than 1024 characters (modulo 1024), the buffer doesn't get flushed and the material file is truncated. A simple fix is to add w.Flush() on line 303 of OBJWriter.cs