{"action":"created","issue":{"url":"https://api.github.com/repos/boostorg/geometry/issues/531","repository_url":"https://api.github.com/repos/boostorg/geometry","labels_url":"https://api.github.com/repos/boostorg/geometry/issues/531/labels{/name}","comments_url":"https://api.github.com/repos/boostorg/geometry/issues/531/comments","events_url":"https://api.github.com/repos/boostorg/geometry/issues/531/events","html_url":"https://github.com/boostorg/geometry/pull/531","id":385453305,"node_id":"MDExOlB1bGxSZXF1ZXN0MjM0NDIxMjM4","number":531,"title":"Feature/get turn info add retrieve policy","user":{"login":"barendgehrels","id":334849,"node_id":"MDQ6VXNlcjMzNDg0OQ==","avatar_url":"https://avatars3.githubusercontent.com/u/334849?v=4","gravatar_id":"","url":"https://api.github.com/users/barendgehrels","html_url":"https://github.com/barendgehrels","followers_url":"https://api.github.com/users/barendgehrels/followers","following_url":"https://api.github.com/users/barendgehrels/following{/other_user}","gists_url":"https://api.github.com/users/barendgehrels/gists{/gist_id}","starred_url":"https://api.github.com/users/barendgehrels/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/barendgehrels/subscriptions","organizations_url":"https://api.github.com/users/barendgehrels/orgs","repos_url":"https://api.github.com/users/barendgehrels/repos","events_url":"https://api.github.com/users/barendgehrels/events{/privacy}","received_events_url":"https://api.github.com/users/barendgehrels/received_events","type":"User","site_admin":false},"labels":[{"id":24728272,"node_id":"MDU6TGFiZWwyNDcyODI3Mg==","url":"https://api.github.com/repos/boostorg/geometry/labels/enhancement","name":"enhancement","color":"84b6eb","default":true}],"state":"open","locked":false,"assignee":{"login":"barendgehrels","id":334849,"node_id":"MDQ6VXNlcjMzNDg0OQ==","avatar_url":"https://avatars3.githubusercontent.com/u/334849?v=4","gravatar_id":"","url":"https://api.github.com/users/barendgehrels","html_url":"https://github.com/barendgehrels","followers_url":"https://api.github.com/users/barendgehrels/followers","following_url":"https://api.github.com/users/barendgehrels/following{/other_user}","gists_url":"https://api.github.com/users/barendgehrels/gists{/gist_id}","starred_url":"https://api.github.com/users/barendgehrels/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/barendgehrels/subscriptions","organizations_url":"https://api.github.com/users/barendgehrels/orgs","repos_url":"https://api.github.com/users/barendgehrels/repos","events_url":"https://api.github.com/users/barendgehrels/events{/privacy}","received_events_url":"https://api.github.com/users/barendgehrels/received_events","type":"User","site_admin":false},"assignees":[{"login":"barendgehrels","id":334849,"node_id":"MDQ6VXNlcjMzNDg0OQ==","avatar_url":"https://avatars3.githubusercontent.com/u/334849?v=4","gravatar_id":"","url":"https://api.github.com/users/barendgehrels","html_url":"https://github.com/barendgehrels","followers_url":"https://api.github.com/users/barendgehrels/followers","following_url":"https://api.github.com/users/barendgehrels/following{/other_user}","gists_url":"https://api.github.com/users/barendgehrels/gists{/gist_id}","starred_url":"https://api.github.com/users/barendgehrels/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/barendgehrels/subscriptions","organizations_url":"https://api.github.com/users/barendgehrels/orgs","repos_url":"https://api.github.com/users/barendgehrels/repos","events_url":"https://api.github.com/users/barendgehrels/events{/privacy}","received_events_url":"https://api.github.com/users/barendgehrels/received_events","type":"User","site_admin":false}],"milestone":{"url":"https://api.github.com/repos/boostorg/geometry/milestones/10","html_url":"https://github.com/boostorg/geometry/milestone/10","labels_url":"https://api.github.com/repos/boostorg/geometry/milestones/10/labels","id":3785661,"node_id":"MDk6TWlsZXN0b25lMzc4NTY2MQ==","number":10,"title":"1.70","description":null,"creator":{"login":"vissarion","id":3660366,"node_id":"MDQ6VXNlcjM2NjAzNjY=","avatar_url":"https://avatars3.githubusercontent.com/u/3660366?v=4","gravatar_id":"","url":"https://api.github.com/users/vissarion","html_url":"https://github.com/vissarion","followers_url":"https://api.github.com/users/vissarion/followers","following_url":"https://api.github.com/users/vissarion/following{/other_user}","gists_url":"https://api.github.com/users/vissarion/gists{/gist_id}","starred_url":"https://api.github.com/users/vissarion/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vissarion/subscriptions","organizations_url":"https://api.github.com/users/vissarion/orgs","repos_url":"https://api.github.com/users/vissarion/repos","events_url":"https://api.github.com/users/vissarion/events{/privacy}","received_events_url":"https://api.github.com/users/vissarion/received_events","type":"User","site_admin":false},"open_issues":4,"closed_issues":1,"state":"open","created_at":"2018-10-31T14:23:52Z","updated_at":"2018-12-11T13:18:25Z","due_on":null,"closed_at":null},"comments":37,"created_at":"2018-11-28T20:56:27Z","updated_at":"2018-12-14T21:02:23Z","closed_at":null,"author_association":"COLLABORATOR","pull_request":{"url":"https://api.github.com/repos/boostorg/geometry/pulls/531","html_url":"https://github.com/boostorg/geometry/pull/531","diff_url":"https://github.com/boostorg/geometry/pull/531.diff","patch_url":"https://github.com/boostorg/geometry/pull/531.patch"},"body":"This PR (actually my first) adds a retrieve policy, and passes it to get_turn_info.\r\n\r\nThis policy retrieves a point known as \"k\" (pk / qk), the first non-duplicate point coming consecutively after the points \"i\" and \"j\" (two points from two segments p and q, part of the intersection of two segments, so these points are pi,pj and qi,qj).\r\n\r\nIn the past points pk/qk were just passed. But now we need another point (pl/ql) and it is not convenient to add that. Therefore the policy is introduced.\r\n\r\nAn additional advantage is that point \"k\" is now retrieved lazily, on demand. Often that point is not necessary. It is actually only necessary if there are collinearies. And often that is not the case. So in all those cases, performance should increase just a little bit.\r\n\r\nThis PR adds the policy and retrieves point \"k\" using the method .get(). In another PR I will add an argument to get, to be able to retrieve also the subsequente point, as described above. But for now this PR is large enough.\r\n\r\nIt is also related to side calculation, the place where that point is used, to check whether it is located left/right or collinear to a segment.\r\n\r\nTo my surprise, also non-typical usage of side calculation were introduced in the implementations for linear intersections, and the typical order is changed there. Therefore I copied the originals there - they cannot use the policy because they don't use the \"k\" point. Actually there should be looked at, because it is looking suspicious, but we can do that afterwards.\r\n\r\nI'm curious to your findings."},"comment":{"url":"https://api.github.com/repos/boostorg/geometry/issues/comments/447478483","html_url":"https://github.com/boostorg/geometry/pull/531#issuecomment-447478483","issue_url":"https://api.github.com/repos/boostorg/geometry/issues/531","id":447478483,"node_id":"MDEyOklzc3VlQ29tbWVudDQ0NzQ3ODQ4Mw==","user":{"login":"awulkiew","id":1226951,"node_id":"MDQ6VXNlcjEyMjY5NTE=","avatar_url":"https://avatars3.githubusercontent.com/u/1226951?v=4","gravatar_id":"","url":"https://api.github.com/users/awulkiew","html_url":"https://github.com/awulkiew","followers_url":"https://api.github.com/users/awulkiew/followers","following_url":"https://api.github.com/users/awulkiew/following{/other_user}","gists_url":"https://api.github.com/users/awulkiew/gists{/gist_id}","starred_url":"https://api.github.com/users/awulkiew/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/awulkiew/subscriptions","organizations_url":"https://api.github.com/users/awulkiew/orgs","repos_url":"https://api.github.com/users/awulkiew/repos","events_url":"https://api.github.com/users/awulkiew/events{/privacy}","received_events_url":"https://api.github.com/users/awulkiew/received_events","type":"User","site_admin":false},"created_at":"2018-12-14T21:02:23Z","updated_at":"2018-12-14T21:02:23Z","author_association":"MEMBER","body":"I'm playing with the code in develop and replacing the second parameter of `side_calc` at line 432 (`first1`) from `ri1` to `rj2` and at line 485 (`last1`) from `rj1` to `rj2` doesn't change the results for me. At least all of the set operations tests pass. So in case of the first segment (`first1`) the **P'** is changed from `ri2, ri1, rj1` to `ri2, rj2, rj1`, or in the new notation from `rng2.at(0), rng1.at(0), rng1.at(1)` to `rng2.at(0), rng2.at(1), rng1.at(1)`\r\n\r\nAnyway, I also tried to remove `side_calculator` at all and at line 428 put this:\r\n\r\n    auto side = inters.get_side_strategy();\r\n\r\n    int const side_pj_q2 = side.apply(rj2, rk2, rj1);\r\n    int const side_pj_q1 = side.apply(ri2, rj2, rj1);\r\n    int const side_qk_q1 = side.apply(ri2, rj2, rk2);\r\n\r\n    std::pair<operation_type, operation_type>\r\n        operations = operations_of_equal(side_pj_q2, side_pj_q1, side_qk_q1);\r\n\r\nand at line 482:\r\n\r\n    auto side = inters.get_side_strategy();\r\n\r\n    int const side_pi_q2 = side.apply(rj2, rk2, ri1);\r\n    int const side_pi_q1 = side.apply(ri2, rj2, ri1);\r\n    int const side_qk_q1 = side.apply(ri2, rj2, rk2);\r\n\r\n    std::pair<operation_type, operation_type>\r\n        operations = operations_of_equal(side_pi_q2, side_pi_q1, side_qk_q1);\r\n\r\nof course in `operations_of_equal` take `(int side_px_q2, int side_px_q1, int side_qk_q1)`, where `px` means that it's either `pi` or `pj` so the endpoint of the segment P which is not the intersection point. After this change `get_turns_linear_linear` test passes as well."}}
{"actor":{"display_login":"awulkiew"}}