Closed virtualritz closed 4 years ago
I quickly made a file in Wings3D – this is an all quad model. Feel free to use however you want.
Hey @virtualritz , yeah this can be added as an option telling tobj
not to triangulate. Then it can just give you back the face vertex counts of the quads/polygons directly. Thanks for the test model!
Yes, this would be super useful.
I am using tobj
here (have a play).
Very cool! I'll ping you on this issue when I've added support and released and updated crate
Cheers!
Should be done in 1ae79e6d1ada57950e4589b32921b28c704e7140 , I'll cut a release shortly. This is a breaking change for the API since I'm just adding a bool option to load_obj
which will set whether or not to triangulate the loaded faces
The number of indices used by each face are now stored in Mesh::num_face_indices
, check out the print mesh example. This is the same as tinyobjloader, though I named the list of verts/indices used per-face as num_face_indices
instead of num_face_vertices
Let me know if you run into any issues!
Yeah, cool. I am trying this in a few hours. Will let you know.
A two line change. Nice one. The commit only looks big because of Rustfmt stuff.
You should update the README since your crate is actually the only one in the whole Rust universe that doesn't triangulate on import (if not asked to).
That's a good point! I'll update it
Many geometries found in OBJs are not made out of triangles and this is a feature. If I load an OBJ to send to an high end offline renderer, the last thing I want is probably triangles (as such I also do not want the reader to convert the OBJ to triangles, on-the-fly, as tobj does).
Basically the mesh returned would then consist of: