{"action":"created","issue":{"url":"https://api.github.com/repos/sabresaurus/SabreCSG/issues/36","repository_url":"https://api.github.com/repos/sabresaurus/SabreCSG","labels_url":"https://api.github.com/repos/sabresaurus/SabreCSG/issues/36/labels{/name}","comments_url":"https://api.github.com/repos/sabresaurus/SabreCSG/issues/36/comments","events_url":"https://api.github.com/repos/sabresaurus/SabreCSG/issues/36/events","html_url":"https://github.com/sabresaurus/SabreCSG/pull/36","id":295337243,"number":36,"title":"Fixed T-Junctions using a simple custom algorithm I came up with.","user":{"login":"Henry00IS","id":7905726,"avatar_url":"https://avatars3.githubusercontent.com/u/7905726?v=4","gravatar_id":"","url":"https://api.github.com/users/Henry00IS","html_url":"https://github.com/Henry00IS","followers_url":"https://api.github.com/users/Henry00IS/followers","following_url":"https://api.github.com/users/Henry00IS/following{/other_user}","gists_url":"https://api.github.com/users/Henry00IS/gists{/gist_id}","starred_url":"https://api.github.com/users/Henry00IS/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Henry00IS/subscriptions","organizations_url":"https://api.github.com/users/Henry00IS/orgs","repos_url":"https://api.github.com/users/Henry00IS/repos","events_url":"https://api.github.com/users/Henry00IS/events{/privacy}","received_events_url":"https://api.github.com/users/Henry00IS/received_events","type":"User","site_admin":false},"labels":[{"id":461632668,"url":"https://api.github.com/repos/sabresaurus/SabreCSG/labels/help%20wanted","name":"help wanted","color":"128A0C","default":true},{"id":867489920,"url":"https://api.github.com/repos/sabresaurus/SabreCSG/labels/status:%20difficult","name":"status: difficult","color":"fbca04","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":15,"created_at":"2018-02-07T23:56:34Z","updated_at":"2018-04-19T19:55:27Z","closed_at":null,"author_association":"COLLABORATOR","pull_request":{"url":"https://api.github.com/repos/sabresaurus/SabreCSG/pulls/36","html_url":"https://github.com/sabresaurus/SabreCSG/pull/36","diff_url":"https://github.com/sabresaurus/SabreCSG/pull/36.diff","patch_url":"https://github.com/sabresaurus/SabreCSG/pull/36.patch"},"body":"**Quite slow, no optimizations have been done. This may need some more love and attention.**\r\n\r\nThis algorithm should take care of most if not all of these shimmering pixel artifacts: #19\r\n\r\n![image](https://user-images.githubusercontent.com/7905726/30781822-6efdf222-a126-11e7-9c82-971d513ab818.png)\r\n\r\nI could really use those fancy benchmark scenes. Please let me know if you find any issues with this algorithm. Sorry about the code quality. This algorithm came to me during a toilet session and I had to code it all before I forgot the solution. ;)"},"comment":{"url":"https://api.github.com/repos/sabresaurus/SabreCSG/issues/comments/382861065","html_url":"https://github.com/sabresaurus/SabreCSG/pull/36#issuecomment-382861065","issue_url":"https://api.github.com/repos/sabresaurus/SabreCSG/issues/36","id":382861065,"user":{"login":"Henry00IS","id":7905726,"avatar_url":"https://avatars3.githubusercontent.com/u/7905726?v=4","gravatar_id":"","url":"https://api.github.com/users/Henry00IS","html_url":"https://github.com/Henry00IS","followers_url":"https://api.github.com/users/Henry00IS/followers","following_url":"https://api.github.com/users/Henry00IS/following{/other_user}","gists_url":"https://api.github.com/users/Henry00IS/gists{/gist_id}","starred_url":"https://api.github.com/users/Henry00IS/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Henry00IS/subscriptions","organizations_url":"https://api.github.com/users/Henry00IS/orgs","repos_url":"https://api.github.com/users/Henry00IS/repos","events_url":"https://api.github.com/users/Henry00IS/events{/privacy}","received_events_url":"https://api.github.com/users/Henry00IS/received_events","type":"User","site_admin":false},"created_at":"2018-04-19T19:55:27Z","updated_at":"2018-04-19T19:55:27Z","author_association":"COLLABORATOR","body":"It's not that simple. You can try out this PR, the algorithm works now. There's a whole bunch of foreach loops and LINQ queries that may be too slow and there's probably more room for optimization beyond that. The \"is vertex on an edge\" check uses several square roots which are slow. It's all just slow.\r\n\r\nLike you can see [in this image](https://user-images.githubusercontent.com/7905726/38975090-cfbd2bfe-43ac-11e8-97b0-3a2efbba84cd.png) the highlighted vertex isn't connected to anything, it's just kinda close to the edge, you can't weld it to anything, you have to split that edge and then weld the vertex onto it - which is easier said than done because all polygons are triangulated individually in 2D space... yeah. But I found a way and it works so all that's left is optimization.\r\n\r\nSadly SabreCSG, especially subtractive brushes, will often create invalid geometry INSIDE of the brushes where you don't see it. 5px thin faces, little ears sticking out of the floor into the walls in random places. It's ugly and those invalid faces will show up as flickering pixel artefacts too. Not because they aren't connected properly, because they are- after my algorithm is done, but because [Unity's MSAA causes white outlines on all objects](http://i.imgur.com/le7jJ.jpg&hash=a46c30a4dc3f7c3f9f82ef0e1a184afe) because Unity. Those odd random faces sticking out will cause outlines throughout the mesh.\r\n\r\nSo if you see them, disable MSAA and they will disappear. Sadly this was very misleading and led me to painstakingly fiddling with my algorithm without realizing it wasn't even my fault."}}
{"actor":{"display_login":"Henry00IS"}}