{"action":"created","issue":{"url":"https://api.github.com/repos/pioneerspacesim/pioneer/issues/3319","labels_url":"https://api.github.com/repos/pioneerspacesim/pioneer/issues/3319/labels{/name}","comments_url":"https://api.github.com/repos/pioneerspacesim/pioneer/issues/3319/comments","events_url":"https://api.github.com/repos/pioneerspacesim/pioneer/issues/3319/events","html_url":"https://github.com/pioneerspacesim/pioneer/pull/3319","id":54181330,"number":3319,"title":"Faster deduplication of collision data","user":{"login":"fluffyfreak","id":825083,"avatar_url":"https://avatars.githubusercontent.com/u/825083?v=3","gravatar_id":"","url":"https://api.github.com/users/fluffyfreak","html_url":"https://github.com/fluffyfreak","followers_url":"https://api.github.com/users/fluffyfreak/followers","following_url":"https://api.github.com/users/fluffyfreak/following{/other_user}","gists_url":"https://api.github.com/users/fluffyfreak/gists{/gist_id}","starred_url":"https://api.github.com/users/fluffyfreak/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fluffyfreak/subscriptions","organizations_url":"https://api.github.com/users/fluffyfreak/orgs","repos_url":"https://api.github.com/users/fluffyfreak/repos","events_url":"https://api.github.com/users/fluffyfreak/events{/privacy}","received_events_url":"https://api.github.com/users/fluffyfreak/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/pioneerspacesim/pioneer/labels/in+progress","name":"in progress","color":"ededed"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-01-13T11:32:45Z","updated_at":"2015-01-14T07:53:52Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/pioneerspacesim/pioneer/pulls/3319","html_url":"https://github.com/pioneerspacesim/pioneer/pull/3319","diff_url":"https://github.com/pioneerspacesim/pioneer/pull/3319.diff","patch_url":"https://github.com/pioneerspacesim/pioneer/pull/3319.patch"},"body":"What took the longer when generating the collision data was the deduplication of vertices from the collision mesh.\r\n\r\nFor example:\r\n> CreateCollisionMesh for : (orbital_station_2-10k)\r\n>  -- GeomTree::GeomTree took: 101175.531197 milliseconds\r\n> Compiling \"orbital_station_2-10k\" took: 125375.918620\r\n\r\nThis is a simple perfect weld operation so I went looking for faster options and have used the `public domain` welding code from [https://code.google.com/p/nvidia-mesh-tools/](https://code.google.com/p/nvidia-mesh-tools/) with some modifications to only use `std::vector` etc.\r\n\r\nThe result is:\r\n> CreateCollisionMesh for : (orbital_station_2-10k)\r\n> ---   43370 vertices welded\r\n>  -- GeomTree::GeomTree took: 1881.504192 milliseconds\r\n> Compiling \"orbital_station_2-10k\" took: 24707.535703\r\n\r\nThe actual welding operation is therefore (101175.53 / 1881.50) = **53.77** times faster.\r\n\r\nThere's still overhead from other operations, compressing the sgm files for example but with the largest files like `orbital_station_2-10k` it does make it about 5 times faster overall.\r\n\r\nAndy"},"comment":{"url":"https://api.github.com/repos/pioneerspacesim/pioneer/issues/comments/69880473","html_url":"https://github.com/pioneerspacesim/pioneer/pull/3319#issuecomment-69880473","issue_url":"https://api.github.com/repos/pioneerspacesim/pioneer/issues/3319","id":69880473,"user":{"login":"impaktor","id":619390,"avatar_url":"https://avatars.githubusercontent.com/u/619390?v=3","gravatar_id":"","url":"https://api.github.com/users/impaktor","html_url":"https://github.com/impaktor","followers_url":"https://api.github.com/users/impaktor/followers","following_url":"https://api.github.com/users/impaktor/following{/other_user}","gists_url":"https://api.github.com/users/impaktor/gists{/gist_id}","starred_url":"https://api.github.com/users/impaktor/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/impaktor/subscriptions","organizations_url":"https://api.github.com/users/impaktor/orgs","repos_url":"https://api.github.com/users/impaktor/repos","events_url":"https://api.github.com/users/impaktor/events{/privacy}","received_events_url":"https://api.github.com/users/impaktor/received_events","type":"User","site_admin":false},"created_at":"2015-01-14T07:53:52Z","updated_at":"2015-01-14T07:53:52Z","body":"Compiled it.\r\nTried it.\r\nRuns.\r\nNice."}}