PistonDevelopers / wavefront_obj

A parser written in rust for the wavefront .obj file format.
MIT License
27 stars 18 forks source link

Parser loads forever #56

Closed doxxx closed 7 years ago

doxxx commented 7 years ago

I'm trying to load a simple obj file of the Suzanne monkey head exported from Blender. wavefront::obj::parse loads forever -- I gave up after a few minutes with the process at 7GB of memory.

I've tried with both debug and release mode binaries.

Here's the obj file: monkey.zip

Using wavefront_obj 5.1.0 with rust 1.19.

doxxx commented 7 years ago

I tried again after ensuring that the quads in the object were converted to triangles, but it still loaded forever.

monkey2.zip

hadronized commented 7 years ago

I had the same issue with a mesh exported from Cinema4D. Issue was #54.

themasch commented 7 years ago

I always got a "out of memory" for .obj files containing mtl references, even a simple cube with 8 vertices and 12 triangles. when I remove the mtl references, it works.

doxxx commented 7 years ago

Thanks I'll try that.

LaylBongers commented 7 years ago

Perhaps the same parser bug that previously affected .obj files also affects .mtl files? It was related to which newline style was used.

doxxx commented 7 years ago

I tried removing the mtl reference from my object and I still get the same problem.

doxxx commented 7 years ago

My bad, I was being dumb. wavefront_obj::obj::parse(String) doesn't expect the file path, it expects the file contents.