{"action":"created","issue":{"url":"https://api.github.com/repos/mrdoob/three.js/issues/13966","repository_url":"https://api.github.com/repos/mrdoob/three.js","labels_url":"https://api.github.com/repos/mrdoob/three.js/issues/13966/labels{/name}","comments_url":"https://api.github.com/repos/mrdoob/three.js/issues/13966/comments","events_url":"https://api.github.com/repos/mrdoob/three.js/issues/13966/events","html_url":"https://github.com/mrdoob/three.js/issues/13966","id":319011965,"number":13966,"title":"PLYLoader fails to parse PLYExporter output","user":{"login":"dbkaplun","id":1765130,"avatar_url":"https://avatars2.githubusercontent.com/u/1765130?v=4","gravatar_id":"","url":"https://api.github.com/users/dbkaplun","html_url":"https://github.com/dbkaplun","followers_url":"https://api.github.com/users/dbkaplun/followers","following_url":"https://api.github.com/users/dbkaplun/following{/other_user}","gists_url":"https://api.github.com/users/dbkaplun/gists{/gist_id}","starred_url":"https://api.github.com/users/dbkaplun/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dbkaplun/subscriptions","organizations_url":"https://api.github.com/users/dbkaplun/orgs","repos_url":"https://api.github.com/users/dbkaplun/repos","events_url":"https://api.github.com/users/dbkaplun/events{/privacy}","received_events_url":"https://api.github.com/users/dbkaplun/received_events","type":"User","site_admin":false},"labels":[{"id":58674,"url":"https://api.github.com/repos/mrdoob/three.js/labels/Bug","name":"Bug","color":"b60205","default":false},{"id":854373772,"url":"https://api.github.com/repos/mrdoob/three.js/labels/Loaders","name":"Loaders","color":"5ecee5","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/mrdoob/three.js/milestones/6","html_url":"https://github.com/mrdoob/three.js/milestone/6","labels_url":"https://api.github.com/repos/mrdoob/three.js/milestones/6/labels","id":3188630,"number":6,"title":"r93","description":"","creator":{"login":"mrdoob","id":97088,"avatar_url":"https://avatars0.githubusercontent.com/u/97088?v=4","gravatar_id":"","url":"https://api.github.com/users/mrdoob","html_url":"https://github.com/mrdoob","followers_url":"https://api.github.com/users/mrdoob/followers","following_url":"https://api.github.com/users/mrdoob/following{/other_user}","gists_url":"https://api.github.com/users/mrdoob/gists{/gist_id}","starred_url":"https://api.github.com/users/mrdoob/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mrdoob/subscriptions","organizations_url":"https://api.github.com/users/mrdoob/orgs","repos_url":"https://api.github.com/users/mrdoob/repos","events_url":"https://api.github.com/users/mrdoob/events{/privacy}","received_events_url":"https://api.github.com/users/mrdoob/received_events","type":"User","site_admin":false},"open_issues":57,"closed_issues":66,"state":"open","created_at":"2018-03-14T20:56:07Z","updated_at":"2018-05-09T18:30:06Z","due_on":"2018-05-16T07:00:00Z","closed_at":null},"comments":5,"created_at":"2018-04-30T19:47:18Z","updated_at":"2018-05-10T19:34:36Z","closed_at":null,"author_association":"CONTRIBUTOR","body":"The [error](https://travis-ci.org/CustomOrthopaedics/vff-loader/builds/373189892#L1954-L1970):\r\n```js\r\n    TypeError: Cannot read property 'properties' of undefined\r\n      33 |       .toEqual(plyData.toString('utf8'));\r\n      34 | \r\n    > 35 |     const plyGeom = new THREE.PLYLoader().parse(plyData);\r\n      36 |     expect(plyGeom.getAttribute('position').count)\r\n      37 |       .toEqual(geom.vertices.length);\r\n      38 |   });\r\n      \r\n      at parseASCII (node_modules/three/examples/js/loaders/PLYLoader.js:273:72)\r\n      at Object.<anonymous>.THREE.PLYLoader.parse (node_modules/three/examples/js/loaders/PLYLoader.js:471:15)\r\n      at _callee2$ (test/VFFLoader.test.js:35:43)\r\n```\r\n\r\nHere's the [repro](https://github.com/CustomOrthopaedics/vff-loader/blob/766457227c9a152e2e58d9de4cea703a38172f49/test/VFFLoader.test.js#L31-L37).\r\n```js\r\n    const plyData = await fixture('airway.vff.ply');\r\n    expect(new THREE.PLYExporter().parse(exportMesh))\r\n      .toEqual(plyData.toString('utf8'));\r\n\r\n    const plyGeom = new THREE.PLYLoader().parse(plyData); // throws error\r\n    expect(plyGeom.getAttribute('position').count)\r\n      .toEqual(geom.vertices.length);\r\n```\r\n\r\nTo test: (sorry for the annoying repro steps)\r\n```sh\r\ngit clone git@github.com:CustomOrthopaedics/vff-loader.git\r\ncd vff-loader\r\ngit checkout 766457\r\nnpm install\r\nnpm test\r\n```\r\n"},"comment":{"url":"https://api.github.com/repos/mrdoob/three.js/issues/comments/388161157","html_url":"https://github.com/mrdoob/three.js/issues/13966#issuecomment-388161157","issue_url":"https://api.github.com/repos/mrdoob/three.js/issues/13966","id":388161157,"user":{"login":"gkjohnson","id":734200,"avatar_url":"https://avatars0.githubusercontent.com/u/734200?v=4","gravatar_id":"","url":"https://api.github.com/users/gkjohnson","html_url":"https://github.com/gkjohnson","followers_url":"https://api.github.com/users/gkjohnson/followers","following_url":"https://api.github.com/users/gkjohnson/following{/other_user}","gists_url":"https://api.github.com/users/gkjohnson/gists{/gist_id}","starred_url":"https://api.github.com/users/gkjohnson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gkjohnson/subscriptions","organizations_url":"https://api.github.com/users/gkjohnson/orgs","repos_url":"https://api.github.com/users/gkjohnson/repos","events_url":"https://api.github.com/users/gkjohnson/events{/privacy}","received_events_url":"https://api.github.com/users/gkjohnson/received_events","type":"User","site_admin":false},"created_at":"2018-05-10T19:34:36Z","updated_at":"2018-05-10T19:34:36Z","author_association":"CONTRIBUTOR","body":"Hey @dbkaplun! It sounds like VFF is a point cloud format, which the ply exporter doesn't currently handle. I'd be happy to help with updating the exporter so it does, though.\r\n\r\nI'm not able to run the repro steps at the moment, but it looks like the error on import might be because the [face count is exported as a fractional number](https://raw.githubusercontent.com/CustomOrthopaedics/vff-loader/766457227c9a152e2e58d9de4cea703a38172f49/test/fixtures/airway.vff.ply), which is obviously bad (and should probably throw an error when exporting).\r\n\r\nUltimately the exporter should be updated to handle point data export by omitting the element and face property fields in the header. I think the right solution would be to exclude the face list completely when exporting geometry with no index array, but that gets a bit more complicated when exporting an Object3D hierarchy with multiple meshes of different types. At the very least I can add that to the list of limitations of the exporter.\r\n\r\nI'll have to think about how to handle multiple meshes a bit more and look into what the PLY format offers to support that. I'll add a couple issues in the PLY exporter repo when I get a chance, as well.\r\n\r\nThanks!\r\nGarrett"}}
{"actor":{"display_login":"gkjohnson"}}