Call repair() before trying to export object (because it tries to generate shared vertices and that method is apparently fragile).

This commit is contained in:
Joseph Lenox 2019-12-04 19:58:20 -06:00
parent a829b0f98a
commit 510ba4eda4

View File

@ -156,6 +156,9 @@ bool
OBJ::write(const Model& model, std::string output_file)
{
TriangleMesh mesh = model.mesh();
// pre-emptively repair because object write can break
// output
mesh.repair();
return OBJ::write(mesh, output_file);
}