This repository has been archived by the owner on Sep 28, 2019. It is now read-only.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This adds some initial support for quad faces, as well as textures and normals for quad meshes. These features are supported:
write_obj
prioritizes f4, fn4, and ft4 over the triangulated faces.keep_vertices
operates correctly on either f and f4, though you need todel
the one you don't want updated.This approach worked for my application, though it is probably not the right thing to do in a legacy context. (2) and (3) would yield new behavior in certain workflows, for example reading a quad mesh, mutating f, and then writing to OBJ, or reading a quad mesh and then using
keep_vertices
.Ideally we'd provide the legacy behavior by default, while also providing an upgrade path that gives first-class support to quad meshes. One way to do that would be a separate
QuadMesh
class with mostly shared mixins. By usingQuadMesh
you indicate you want to act on quads, and then loading operations and all manipulations would happen on the quads, while the triangulated faces would not be loaded. The same could be accomplished by passing a new parameter likewith_quads=True
to theMesh
constructor.QuadMesh
is nice because it'll be a bit easier to troubleshoot down the line. When you log the mesh you'll see that you've got the wrong thing. Though that could be handled in__repr__
just as easily. I guess it depends whether we want to hang different mixins on quad and triangle classes, or share them all.The mesh loading code works, though it's not covered by any tests. The existing mesh-loading tests are disabled because of missing assets.