{"action":"created","comment":{"url":"https://api.github.com/repos/Ultimaker/CuraEngine/pulls/comments/70435101","id":70435101,"diff_hunk":"@@ -156,6 +156,89 @@ Polygons PolygonRef::offset(int distance, ClipperLib::JoinType joinType, double\n     return ret;\n }\n \n+Polygon Polygons::convexHull() const\n+{\n+    // Implements Andrew's monotone chain convex hull algorithm\n+    // See https://en.wikibooks.org/wiki/Algorithm_Implementation/Geometry/Convex_hull/Monotone_chain\n+\n+    using IntPoint = ClipperLib::IntPoint;\n+\n+    std::vector<IntPoint> all_points;\n+    for (const ClipperLib::Path &path : paths)\n+    {\n+        // Reserve big enough for result, but also maintain O(1)\n+        // amortized resize cost\n+        size_t reserve_size = std::max(all_points.size() + path.size(),\n+                                       2*all_points.size());","path":"src/utils/polygon.cpp","position":17,"original_position":17,"commit_id":"db79eb7ececc4a88a0531f07677e1f64975c7b88","original_commit_id":"db79eb7ececc4a88a0531f07677e1f64975c7b88","user":{"login":"scottlenser","id":16857203,"avatar_url":"https://avatars.githubusercontent.com/u/16857203?v=3","gravatar_id":"","url":"https://api.github.com/users/scottlenser","html_url":"https://github.com/scottlenser","followers_url":"https://api.github.com/users/scottlenser/followers","following_url":"https://api.github.com/users/scottlenser/following{/other_user}","gists_url":"https://api.github.com/users/scottlenser/gists{/gist_id}","starred_url":"https://api.github.com/users/scottlenser/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/scottlenser/subscriptions","organizations_url":"https://api.github.com/users/scottlenser/orgs","repos_url":"https://api.github.com/users/scottlenser/repos","events_url":"https://api.github.com/users/scottlenser/events{/privacy}","received_events_url":"https://api.github.com/users/scottlenser/received_events","type":"User","site_admin":false},"body":"I didn't think of the separate loop to compute the size.  I like that solution.  I'll change it.","created_at":"2016-07-12T13:16:39Z","updated_at":"2016-07-12T13:16:39Z","html_url":"https://github.com/Ultimaker/CuraEngine/pull/372#discussion_r70435101","pull_request_url":"https://api.github.com/repos/Ultimaker/CuraEngine/pulls/372","_links":{"self":{"href":"https://api.github.com/repos/Ultimaker/CuraEngine/pulls/comments/70435101"},"html":{"href":"https://github.com/Ultimaker/CuraEngine/pull/372#discussion_r70435101"},"pull_request":{"href":"https://api.github.com/repos/Ultimaker/CuraEngine/pulls/372"}}},"pull_request":{"url":"https://api.github.com/repos/Ultimaker/CuraEngine/pulls/372","id":76799512,"html_url":"https://github.com/Ultimaker/CuraEngine/pull/372","diff_url":"https://github.com/Ultimaker/CuraEngine/pull/372.diff","patch_url":"https://github.com/Ultimaker/CuraEngine/pull/372.patch","issue_url":"https://api.github.com/repos/Ultimaker/CuraEngine/issues/372","number":372,"state":"open","locked":false,"title":"Added convexHull function for Polygons.","user":{"login":"scottlenser","id":16857203,"avatar_url":"https://avatars.githubusercontent.com/u/16857203?v=3","gravatar_id":"","url":"https://api.github.com/users/scottlenser","html_url":"https://github.com/scottlenser","followers_url":"https://api.github.com/users/scottlenser/followers","following_url":"https://api.github.com/users/scottlenser/following{/other_user}","gists_url":"https://api.github.com/users/scottlenser/gists{/gist_id}","starred_url":"https://api.github.com/users/scottlenser/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/scottlenser/subscriptions","organizations_url":"https://api.github.com/users/scottlenser/orgs","repos_url":"https://api.github.com/users/scottlenser/repos","events_url":"https://api.github.com/users/scottlenser/events{/privacy}","received_events_url":"https://api.github.com/users/scottlenser/received_events","type":"User","site_admin":false},"body":"This is 1 of 3 split / cleaned up PRs that replace PR #368. The combination of the 3 new PRs (PR #370, PR #371, PR #372) produces the same net effect as PR #368, but with easier to following history.\r\n\r\nThis branch has only the addition of the convex hull function, convexHull().  The old function was renamed to approxConvexHull().\r\n","created_at":"2016-07-08T19:04:59Z","updated_at":"2016-07-12T13:16:40Z","closed_at":null,"merged_at":null,"merge_commit_sha":"4c98280046889e1a247cd4bf67bb6c187ecd8826","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/Ultimaker/CuraEngine/pulls/372/commits","review_comments_url":"https://api.github.com/repos/Ultimaker/CuraEngine/pulls/372/comments","review_comment_url":"https://api.github.com/repos/Ultimaker/CuraEngine/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Ultimaker/CuraEngine/issues/372/comments","statuses_url":"https://api.github.com/repos/Ultimaker/CuraEngine/statuses/db79eb7ececc4a88a0531f07677e1f64975c7b88","head":{"label":"scottlenser:add-convex-hull","ref":"add-convex-hull","sha":"db79eb7ececc4a88a0531f07677e1f64975c7b88","user":{"login":"scottlenser","id":16857203,"avatar_url":"https://avatars.githubusercontent.com/u/16857203?v=3","gravatar_id":"","url":"https://api.github.com/users/scottlenser","html_url":"https://github.com/scottlenser","followers_url":"https://api.github.com/users/scottlenser/followers","following_url":"https://api.github.com/users/scottlenser/following{/other_user}","gists_url":"https://api.github.com/users/scottlenser/gists{/gist_id}","starred_url":"https://api.github.com/users/scottlenser/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/scottlenser/subscriptions","organizations_url":"https://api.github.com/users/scottlenser/orgs","repos_url":"https://api.github.com/users/scottlenser/repos","events_url":"https://api.github.com/users/scottlenser/events{/privacy}","received_events_url":"https://api.github.com/users/scottlenser/received_events","type":"User","site_admin":false},"repo":{"id":62677914,"name":"CuraEngine","full_name":"scottlenser/CuraEngine","owner":{"login":"scottlenser","id":16857203,"avatar_url":"https://avatars.githubusercontent.com/u/16857203?v=3","gravatar_id":"","url":"https://api.github.com/users/scottlenser","html_url":"https://github.com/scottlenser","followers_url":"https://api.github.com/users/scottlenser/followers","following_url":"https://api.github.com/users/scottlenser/following{/other_user}","gists_url":"https://api.github.com/users/scottlenser/gists{/gist_id}","starred_url":"https://api.github.com/users/scottlenser/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/scottlenser/subscriptions","organizations_url":"https://api.github.com/users/scottlenser/orgs","repos_url":"https://api.github.com/users/scottlenser/repos","events_url":"https://api.github.com/users/scottlenser/events{/privacy}","received_events_url":"https://api.github.com/users/scottlenser/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/scottlenser/CuraEngine","description":"CuraEngine is a powerful, fast and robust engine for processing 3D models into 3D printing instruction for Ultimaker and other GCode based 3D printers. It is part of the larger open source project called \"Cura\".","fork":true,"url":"https://api.github.com/repos/scottlenser/CuraEngine","forks_url":"https://api.github.com/repos/scottlenser/CuraEngine/forks","keys_url":"https://api.github.com/repos/scottlenser/CuraEngine/keys{/key_id}","collaborators_url":"https://api.github.com/repos/scottlenser/CuraEngine/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/scottlenser/CuraEngine/teams","hooks_url":"https://api.github.com/repos/scottlenser/CuraEngine/hooks","issue_events_url":"https://api.github.com/repos/scottlenser/CuraEngine/issues/events{/number}","events_url":"https://api.github.com/repos/scottlenser/CuraEngine/events","assignees_url":"https://api.github.com/repos/scottlenser/CuraEngine/assignees{/user}","branches_url":"https://api.github.com/repos/scottlenser/CuraEngine/branches{/branch}","tags_url":"https://api.github.com/repos/scottlenser/CuraEngine/tags","blobs_url":"https://api.github.com/repos/scottlenser/CuraEngine/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/scottlenser/CuraEngine/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/scottlenser/CuraEngine/git/refs{/sha}","trees_url":"https://api.github.com/repos/scottlenser/CuraEngine/git/trees{/sha}","statuses_url":"https://api.github.com/repos/scottlenser/CuraEngine/statuses/{sha}","languages_url":"https://api.github.com/repos/scottlenser/CuraEngine/languages","stargazers_url":"https://api.github.com/repos/scottlenser/CuraEngine/stargazers","contributors_url":"https://api.github.com/repos/scottlenser/CuraEngine/contributors","subscribers_url":"https://api.github.com/repos/scottlenser/CuraEngine/subscribers","subscription_url":"https://api.github.com/repos/scottlenser/CuraEngine/subscription","commits_url":"https://api.github.com/repos/scottlenser/CuraEngine/commits{/sha}","git_commits_url":"https://api.github.com/repos/scottlenser/CuraEngine/git/commits{/sha}","comments_url":"https://api.github.com/repos/scottlenser/CuraEngine/comments{/number}","issue_comment_url":"https://api.github.com/repos/scottlenser/CuraEngine/issues/comments{/number}","contents_url":"https://api.github.com/repos/scottlenser/CuraEngine/contents/{+path}","compare_url":"https://api.github.com/repos/scottlenser/CuraEngine/compare/{base}...{head}","merges_url":"https://api.github.com/repos/scottlenser/CuraEngine/merges","archive_url":"https://api.github.com/repos/scottlenser/CuraEngine/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/scottlenser/CuraEngine/downloads","issues_url":"https://api.github.com/repos/scottlenser/CuraEngine/issues{/number}","pulls_url":"https://api.github.com/repos/scottlenser/CuraEngine/pulls{/number}","milestones_url":"https://api.github.com/repos/scottlenser/CuraEngine/milestones{/number}","notifications_url":"https://api.github.com/repos/scottlenser/CuraEngine/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/scottlenser/CuraEngine/labels{/name}","releases_url":"https://api.github.com/repos/scottlenser/CuraEngine/releases{/id}","deployments_url":"https://api.github.com/repos/scottlenser/CuraEngine/deployments","created_at":"2016-07-06T00:13:23Z","updated_at":"2016-07-06T00:13:25Z","pushed_at":"2016-07-12T13:14:01Z","git_url":"git://github.com/scottlenser/CuraEngine.git","ssh_url":"git@github.com:scottlenser/CuraEngine.git","clone_url":"https://github.com/scottlenser/CuraEngine.git","svn_url":"https://github.com/scottlenser/CuraEngine","homepage":"https://ultimaker.com/en/products/cura-software","size":40174,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"Ultimaker:master","ref":"master","sha":"a18b05f3472fd84d5592330ae1ae19deb0d50ea4","user":{"login":"Ultimaker","id":499557,"avatar_url":"https://avatars.githubusercontent.com/u/499557?v=3","gravatar_id":"","url":"https://api.github.com/users/Ultimaker","html_url":"https://github.com/Ultimaker","followers_url":"https://api.github.com/users/Ultimaker/followers","following_url":"https://api.github.com/users/Ultimaker/following{/other_user}","gists_url":"https://api.github.com/users/Ultimaker/gists{/gist_id}","starred_url":"https://api.github.com/users/Ultimaker/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Ultimaker/subscriptions","organizations_url":"https://api.github.com/users/Ultimaker/orgs","repos_url":"https://api.github.com/users/Ultimaker/repos","events_url":"https://api.github.com/users/Ultimaker/events{/privacy}","received_events_url":"https://api.github.com/users/Ultimaker/received_events","type":"Organization","site_admin":false},"repo":{"id":8556864,"name":"CuraEngine","full_name":"Ultimaker/CuraEngine","owner":{"login":"Ultimaker","id":499557,"avatar_url":"https://avatars.githubusercontent.com/u/499557?v=3","gravatar_id":"","url":"https://api.github.com/users/Ultimaker","html_url":"https://github.com/Ultimaker","followers_url":"https://api.github.com/users/Ultimaker/followers","following_url":"https://api.github.com/users/Ultimaker/following{/other_user}","gists_url":"https://api.github.com/users/Ultimaker/gists{/gist_id}","starred_url":"https://api.github.com/users/Ultimaker/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Ultimaker/subscriptions","organizations_url":"https://api.github.com/users/Ultimaker/orgs","repos_url":"https://api.github.com/users/Ultimaker/repos","events_url":"https://api.github.com/users/Ultimaker/events{/privacy}","received_events_url":"https://api.github.com/users/Ultimaker/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Ultimaker/CuraEngine","description":"CuraEngine is a powerful, fast and robust engine for processing 3D models into 3D printing instruction for Ultimaker and other GCode based 3D printers. It is part of the larger open source project called \"Cura\".","fork":false,"url":"https://api.github.com/repos/Ultimaker/CuraEngine","forks_url":"https://api.github.com/repos/Ultimaker/CuraEngine/forks","keys_url":"https://api.github.com/repos/Ultimaker/CuraEngine/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Ultimaker/CuraEngine/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Ultimaker/CuraEngine/teams","hooks_url":"https://api.github.com/repos/Ultimaker/CuraEngine/hooks","issue_events_url":"https://api.github.com/repos/Ultimaker/CuraEngine/issues/events{/number}","events_url":"https://api.github.com/repos/Ultimaker/CuraEngine/events","assignees_url":"https://api.github.com/repos/Ultimaker/CuraEngine/assignees{/user}","branches_url":"https://api.github.com/repos/Ultimaker/CuraEngine/branches{/branch}","tags_url":"https://api.github.com/repos/Ultimaker/CuraEngine/tags","blobs_url":"https://api.github.com/repos/Ultimaker/CuraEngine/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Ultimaker/CuraEngine/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Ultimaker/CuraEngine/git/refs{/sha}","trees_url":"https://api.github.com/repos/Ultimaker/CuraEngine/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Ultimaker/CuraEngine/statuses/{sha}","languages_url":"https://api.github.com/repos/Ultimaker/CuraEngine/languages","stargazers_url":"https://api.github.com/repos/Ultimaker/CuraEngine/stargazers","contributors_url":"https://api.github.com/repos/Ultimaker/CuraEngine/contributors","subscribers_url":"https://api.github.com/repos/Ultimaker/CuraEngine/subscribers","subscription_url":"https://api.github.com/repos/Ultimaker/CuraEngine/subscription","commits_url":"https://api.github.com/repos/Ultimaker/CuraEngine/commits{/sha}","git_commits_url":"https://api.github.com/repos/Ultimaker/CuraEngine/git/commits{/sha}","comments_url":"https://api.github.com/repos/Ultimaker/CuraEngine/comments{/number}","issue_comment_url":"https://api.github.com/repos/Ultimaker/CuraEngine/issues/comments{/number}","contents_url":"https://api.github.com/repos/Ultimaker/CuraEngine/contents/{+path}","compare_url":"https://api.github.com/repos/Ultimaker/CuraEngine/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Ultimaker/CuraEngine/merges","archive_url":"https://api.github.com/repos/Ultimaker/CuraEngine/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Ultimaker/CuraEngine/downloads","issues_url":"https://api.github.com/repos/Ultimaker/CuraEngine/issues{/number}","pulls_url":"https://api.github.com/repos/Ultimaker/CuraEngine/pulls{/number}","milestones_url":"https://api.github.com/repos/Ultimaker/CuraEngine/milestones{/number}","notifications_url":"https://api.github.com/repos/Ultimaker/CuraEngine/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Ultimaker/CuraEngine/labels{/name}","releases_url":"https://api.github.com/repos/Ultimaker/CuraEngine/releases{/id}","deployments_url":"https://api.github.com/repos/Ultimaker/CuraEngine/deployments","created_at":"2013-03-04T14:12:08Z","updated_at":"2016-07-10T14:23:53Z","pushed_at":"2016-07-12T13:14:01Z","git_url":"git://github.com/Ultimaker/CuraEngine.git","ssh_url":"git@github.com:Ultimaker/CuraEngine.git","clone_url":"https://github.com/Ultimaker/CuraEngine.git","svn_url":"https://github.com/Ultimaker/CuraEngine","homepage":"https://ultimaker.com/en/products/cura-software","size":43212,"stargazers_count":373,"watchers_count":373,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":317,"mirror_url":null,"open_issues_count":71,"forks":317,"open_issues":71,"watchers":373,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Ultimaker/CuraEngine/pulls/372"},"html":{"href":"https://github.com/Ultimaker/CuraEngine/pull/372"},"issue":{"href":"https://api.github.com/repos/Ultimaker/CuraEngine/issues/372"},"comments":{"href":"https://api.github.com/repos/Ultimaker/CuraEngine/issues/372/comments"},"review_comments":{"href":"https://api.github.com/repos/Ultimaker/CuraEngine/pulls/372/comments"},"review_comment":{"href":"https://api.github.com/repos/Ultimaker/CuraEngine/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Ultimaker/CuraEngine/pulls/372/commits"},"statuses":{"href":"https://api.github.com/repos/Ultimaker/CuraEngine/statuses/db79eb7ececc4a88a0531f07677e1f64975c7b88"}}}}
{"actor":{"display_login":"scottlenser"}}