{"action":"created","issue":{"url":"https://api.github.com/repos/mikedh/trimesh/issues/135","repository_url":"https://api.github.com/repos/mikedh/trimesh","labels_url":"https://api.github.com/repos/mikedh/trimesh/issues/135/labels{/name}","comments_url":"https://api.github.com/repos/mikedh/trimesh/issues/135/comments","events_url":"https://api.github.com/repos/mikedh/trimesh/issues/135/events","html_url":"https://github.com/mikedh/trimesh/issues/135","id":296235150,"number":135,"title":"Texture indices not aligned to face indices","user":{"login":"feketeimre","id":15861028,"avatar_url":"https://avatars3.githubusercontent.com/u/15861028?v=4","gravatar_id":"","url":"https://api.github.com/users/feketeimre","html_url":"https://github.com/feketeimre","followers_url":"https://api.github.com/users/feketeimre/followers","following_url":"https://api.github.com/users/feketeimre/following{/other_user}","gists_url":"https://api.github.com/users/feketeimre/gists{/gist_id}","starred_url":"https://api.github.com/users/feketeimre/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/feketeimre/subscriptions","organizations_url":"https://api.github.com/users/feketeimre/orgs","repos_url":"https://api.github.com/users/feketeimre/repos","events_url":"https://api.github.com/users/feketeimre/events{/privacy}","received_events_url":"https://api.github.com/users/feketeimre/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":7,"created_at":"2018-02-11T23:00:31Z","updated_at":"2018-04-14T21:43:03Z","closed_at":null,"author_association":"NONE","body":"While parsing an OBJ file, the texture coordinates are indexed immediately: https://github.com/mikedh/trimesh/blob/952d3807849646595fb892d39d75ec8010c3b157/trimesh/io/wavefront.py#L87-L89\r\nand then put in the metadata:\r\nhttps://github.com/mikedh/trimesh/blob/952d3807849646595fb892d39d75ec8010c3b157/trimesh/io/wavefront.py#L44-L46\r\nThe vertex coordinates and the faces are passed to Trimesh object. Later _validate_face_normals and update_faces are called that mixes up the face indices. Due to this the face indices not match the texture indices (that has been already indexed), obviously it renders a bad texture:\r\n![bug](https://user-images.githubusercontent.com/15861028/36079625-80949478-0f85-11e8-853b-1aca666aae6b.png)\r\n\r\nNot sure what would be an easy way to keep the changes of the face indices the same with the texture coordinate indices. It could start by storing the texture coordinates and texture coordinate indices separately in metadata.\r\n"},"comment":{"url":"https://api.github.com/repos/mikedh/trimesh/issues/comments/381362642","html_url":"https://github.com/mikedh/trimesh/issues/135#issuecomment-381362642","issue_url":"https://api.github.com/repos/mikedh/trimesh/issues/135","id":381362642,"user":{"login":"mikedh","id":1403074,"avatar_url":"https://avatars2.githubusercontent.com/u/1403074?v=4","gravatar_id":"","url":"https://api.github.com/users/mikedh","html_url":"https://github.com/mikedh","followers_url":"https://api.github.com/users/mikedh/followers","following_url":"https://api.github.com/users/mikedh/following{/other_user}","gists_url":"https://api.github.com/users/mikedh/gists{/gist_id}","starred_url":"https://api.github.com/users/mikedh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mikedh/subscriptions","organizations_url":"https://api.github.com/users/mikedh/orgs","repos_url":"https://api.github.com/users/mikedh/repos","events_url":"https://api.github.com/users/mikedh/events{/privacy}","received_events_url":"https://api.github.com/users/mikedh/received_events","type":"User","site_admin":false},"created_at":"2018-04-14T21:43:03Z","updated_at":"2018-04-14T21:43:03Z","author_association":"OWNER","body":"Thanks that’s helpful!"}}
{"actor":{"display_login":"mikedh"}}