{"action":"created","issue":{"url":"https://api.github.com/repos/paperjs/paper.js/issues/777","labels_url":"https://api.github.com/repos/paperjs/paper.js/issues/777/labels{/name}","comments_url":"https://api.github.com/repos/paperjs/paper.js/issues/777/comments","events_url":"https://api.github.com/repos/paperjs/paper.js/issues/777/events","html_url":"https://github.com/paperjs/paper.js/issues/777","id":106016200,"number":777,"title":"Third intersection found on partially overlapping linear curves.","user":{"login":"iconexperience","id":2122773,"avatar_url":"https://avatars.githubusercontent.com/u/2122773?v=3","gravatar_id":"","url":"https://api.github.com/users/iconexperience","html_url":"https://github.com/iconexperience","followers_url":"https://api.github.com/users/iconexperience/followers","following_url":"https://api.github.com/users/iconexperience/following{/other_user}","gists_url":"https://api.github.com/users/iconexperience/gists{/gist_id}","starred_url":"https://api.github.com/users/iconexperience/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/iconexperience/subscriptions","organizations_url":"https://api.github.com/users/iconexperience/orgs","repos_url":"https://api.github.com/users/iconexperience/repos","events_url":"https://api.github.com/users/iconexperience/events{/privacy}","received_events_url":"https://api.github.com/users/iconexperience/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":11,"created_at":"2015-09-11T13:55:41Z","updated_at":"2015-09-11T15:22:28Z","closed_at":null,"body":"In the following example, a third intersection is found between the two paths, where there should be only two intersections.\r\n\r\n<pre>\r\nvar path1 = new Path({segments:[[160.6075323767809, 330.85756555128285, 0, 0, 62.78549052923406, -23.18549160066485], [261.8383465819905, 262.07470247937476, -9.74481985788454, 21.733682765729938, 3.313092486907278, -7.389125928860111], [263.88935325438945, 244.19550800619407, 1.651523249297087, 4.207420633192619, 0, 0], [274.75095370188933, 239.93204418180093, 0, 0, 0, 0], [294.3629794398194, 193.7001742601214, 0, 0, 7.563190712050676, 3.2083818187949973], [319.740729241553, 222.27237409836766, -6.410840321333732, -16.33225681537532, 5.912463018702233, 15.062590798200258], [316.5868988511627, 286.622533838371, 11.8608907350936, -26.453114610111264, -13.413920693759984, 29.916807211880812], [181.3924676232191, 387.14243444871715, 86.42536270145004, -31.915248317855713, 0, 0]], closed:true});\r\nvar path2 = new Path({segments:[[268.3009827109457, 193.43046881012646, 0, 0, 7.359037047450392, -3.0624266286574136], [294.3629794398184, 193.70017426012097, -9.725038248996666, -4.12545935876628, 0, 0], [281.2635766386479, 224.57969147308265, 0, 0, 0, 0]], closed:true});\r\n\r\npath1.fullySelected = true;\r\npath2.fullySelected = true;\r\n\r\nvar ints = path1.getIntersections(path2);\r\nconsole.log(ints.length);\r\nfor (var i = 0; i < ints.length; i++) {\r\n  var p = new Path.Circle({radius: 2, fillColor: 'red'});\r\n  p.position = ints[i].point;\r\n}\r\n</pre>\r\n\r\nSee the Sketch <a href=\"http://sketch.paperjs.org/#S/dVRNbxtHDP0rC13iIMqAH0MOKSennHorkKPigyutbSEbyZDkFoXh/943UtQ6aAJI0IpDPpLvvdnn2fb22zhbzD5/HY+rh9l8ttqt+/8/b/fD4+3xgYePw3b8a/gdz1fPh/H+27g9HhbLJTsVp2Yq2rwF5XxQpRLWzM2MJSRsPtDp41JaWE0ySdFKPh/eixbuMQCRew27mQ9LcS6hodUtOJE/HwTF1GojqS0VD704S6sVGWgXUa0ijUtT9ZDm1iRTAwMVZaWUGp7UpCH0vhWNZLGUCCdmPrfVEpGKbazivPa+tRZOMwrMx1mpzQcubmyiUlOyUSBUi2A6IVflxPh53vmE2mppRmnaiDu8AlWzpArVysFATr1w9G9V1qIO+KyaWBG7cWppRIw+GFm4XgpaMUdbaixk5J0axTxgsKMDIbNpB0USGAMHIIPN+iAiRRrEq5ShKO20eqlMUUmFVbWpIMZeVEXMg7GI9ZgVMFhdsRVkkb4XWyEHq9QyhEgszm29WHhkhDG7gC8JLw441a5zY5RCcqdAqYIsPXkDg5gyV+cukXjtgyim0wTVsIFlRlcdbLIHFmMwTMHS22L5gsSKraAVJ5potMJVqlb4pnFjKIxJKgbBWMTViHoTZQAaHKMMx1rj7/rcAHc17Q7jenHcP40vb6+/7L9sL7dEfnVLxKMoVIYtmWCrdhazKlWPwHJYzf9TU0EgzFIbxsECfZ5OK2R38GYN+/tPPBL/9whlO18TAVJgn0z3k8ZwNUxuMHu0DvvKeaANN8EQ1nDctu6SWqylJ9emFOL2g11/Skr/nl4d5e5pmv7+PE7j6jiuQVFPur4cy6+PL9RuQCLiZ7D78fjb9jjuD0jf7LaHqxPIueUK/3fTWKbd/VUvKtO4vT8+nA/vdvvh6gQHLLrGz4fhVRIC7969HZ576jCcFH2lZvm02a+m8ep5f7vePB0WA0S520zTp9202y+GN/tx/eb73sPwWB53h02fDgi9xXJzgxCeTgkveL3+sR9vv55Ch9liefPyDw==\">here.</a>\r\n\r\nOne linear segment of path2 is part of a linear segment of path1. Only the start and end point of the segment on path2 should be found as intersections, but a third intersection inbetween is found, too.\r\n\r\nI think this problem may be the root cause for the majority of issues that I still see in the boolean operations."},"comment":{"url":"https://api.github.com/repos/paperjs/paper.js/issues/comments/139574517","html_url":"https://github.com/paperjs/paper.js/issues/777#issuecomment-139574517","issue_url":"https://api.github.com/repos/paperjs/paper.js/issues/777","id":139574517,"user":{"login":"lehni","id":213275,"avatar_url":"https://avatars.githubusercontent.com/u/213275?v=3","gravatar_id":"","url":"https://api.github.com/users/lehni","html_url":"https://github.com/lehni","followers_url":"https://api.github.com/users/lehni/followers","following_url":"https://api.github.com/users/lehni/following{/other_user}","gists_url":"https://api.github.com/users/lehni/gists{/gist_id}","starred_url":"https://api.github.com/users/lehni/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lehni/subscriptions","organizations_url":"https://api.github.com/users/lehni/orgs","repos_url":"https://api.github.com/users/lehni/repos","events_url":"https://api.github.com/users/lehni/events{/privacy}","received_events_url":"https://api.github.com/users/lehni/received_events","type":"User","site_admin":false},"created_at":"2015-09-11T15:22:28Z","updated_at":"2015-09-11T15:22:28Z","body":"I was using this:\r\n\r\n    var line1 = new Line(path1.firstSegment.point, path1.lastSegment.point);\r\n    var line2 = new Line(path1.firstSegment.point, path1.lastSegment.point);\r\n\r\nConstructing the lines in this way I get the same distance. That's weird!\r\n\r\n    var v1 = path1.firstCurve.getValues(),\r\n        v2 = path2.firstCurve.getValues(),\r\n        line1 = new Line(v1[0], v1[1], v1[6], v1[7]),\r\n        line2 = new Line(v2[0], v2[1], v2[6], v2[7]);\r\n"}}