{"action":"created","issue":{"url":"https://api.github.com/repos/paperjs/paper.js/issues/795","labels_url":"https://api.github.com/repos/paperjs/paper.js/issues/795/labels{/name}","comments_url":"https://api.github.com/repos/paperjs/paper.js/issues/795/comments","events_url":"https://api.github.com/repos/paperjs/paper.js/issues/795/events","html_url":"https://github.com/paperjs/paper.js/issues/795","id":109784308,"number":795,"title":"Fat-line clipping algorithm sometimes finds intersections and wrong parameters.","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},"labels":[{"url":"https://api.github.com/repos/paperjs/paper.js/labels/boolean","name":"boolean","color":"fef2c0"},{"url":"https://api.github.com/repos/paperjs/paper.js/labels/clipping","name":"clipping","color":"d4c5f9"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":63,"created_at":"2015-10-05T12:19:25Z","updated_at":"2015-10-06T15:45:48Z","closed_at":"2015-10-05T15:21:14Z","body":"This is probably the reason why example 23 fails in #784:\r\n[Demo Sketch](http://sketch.paperjs.org/#S/lVTfa9swEP5XRF7sUE/ot2SXPXUb9GEw6GNaiusoiakrD9lJByX/+05y0thtOjrbBHT33d13353yMnPlk50Vs5tH21ebWTar2mU472r7jO+fyt7Xf9BX5Owz+hkP6YIZLBjVJBecCHiJzhCJ3znPF6qF4VgQo43RTKocbEoTiZUUVOZMa6X53fzy1t26XelRtfU7Sw81r8IhVZCYcCkAaATNc0jBBAeTMlITajTnlGUowogQTDElNRMKYJJjzTgVDOIl0QEGGTDTJgejkYRQIMmVABPRWgptJNdGfxIWaL+SZlPSEC8Z8OFSEa1yA2wYxUZLTYmQRFJjAulPwkJv0JUGJhKKg4lxhhURBiDSMNBRHmD/Ukrlmg1ar7au6uvWocrbsre/yn6TxjYyVLVN6+fo5dYheLztt97FziLoYA5PZ9dP1vVdgRYxFB8MNEOTM7vLRkG9bx/tVahRDKXeOW+qsqndukCrsuns4N0H2vszzK9qXzU2rV1vT6TDUH4DWxhJdOBwuBx8Veu6trG4addpElpC198KlKCLGIHr5YnOBUoysHq4JJBkAB3zHYxvwS34J8BgmF+e1RIfuI8krayLlUbBI3l8uay3IDfB9CNFYw8jy3+KexQu3MC3mwFjTbxdJsetDzh2BgfLmTw0W5ucbnVsp7Nxbh2ExBJ4bfvrsSONGUPUZEY/2q1bniQ9onFj3RqmB7pPHUUsPMWuWv+9rDbpcXmGfclQ/boyk5JjWkPlUGZIHMHvV+9DDx4ziUKHH/ivfQDoYxxxNysWd/u/)\r\n\r\nOutput:\r\n```\r\nFound 2 intersections:\r\nIntersection 0:\r\nPath ID: 1, parameter: 0, point: { x: 628.03547, y: 243.03686 }\r\nPath ID: 3, parameter: 1, point: { x: 628.03547, y: 243.03686 }\r\nIntersection 1:\r\nPath ID: 1, parameter: 5.668521207979893e-13, point: { x: 628.03547, y: 243.03686 }\r\nPath ID: 3, parameter: 0.9434552849029103, point: { x: 628.035, y: 242.8367 }\r\n```\r\n\r\nNotice how in the second intersection, the first location on Path 1 is basically the same as in the first intersection, while the location on Path 3 varies. And there is definitely no intersection at  parameter 0.9434552849029103 on Path 3!\r\n\r\n@iconexperience let me know if you feel like debugging this one, since you have some experience with the fat-line clipping code. This may well be the source of some of the other failing edge cases too.\r\n\r\nCode:\r\n\r\n```js\r\nview._matrix = new Matrix([28.421709430404007, 0, 0, 28.421709430404007, -17483.40878872569, -6705.654159277673]);\r\n\r\nvar curve1 = new Curve(628.0354673841999, 243.03685701873312, 628.0044262657246, 253.72314203550712, 419.2789142850017, 364.27077547853787, 419.2789142850017, 364.27077547853787);\r\nvar curve2 = new Curve(619.5200435607698, 221.87571045051882, 619.5200435607698, 221.87571045051882, 628.0657700157852, 232.60480515822775, 628.0354673841999, 243.03685701876972);\r\n\r\nfunction createPath(curve, color) {\r\n    return new Path({\r\n        segments: [curve.segment1, curve.segment2],\r\n        strokeColor: color,\r\n        strokeScaling: false\r\n    });\r\n}\r\n\r\nfunction createCircle(inter) {\r\n    var path = inter.path;\r\n    console.log('Path ID: ' + path.id\r\n        + ', parameter: ' + inter.parameter\r\n        + ', point: ' + inter.point);\r\n    return new Path.Circle({\r\n        center: inter.point,\r\n        radius: 0.1,\r\n        strokeColor: path.strokeColor,\r\n        strokeScaling: false\r\n    });\r\n}\r\n\r\nvar path1 = createPath(curve1, 'red');\r\nvar path2 = createPath(curve2, 'blue');\r\n\r\nvar intersections = path1.getIntersections(path2);\r\nconsole.log('Found ' + intersections.length + ' intersections:');\r\nintersections.forEach(function(inter, i) {\r\n    console.log('Intersection ' + i + ':');\r\n    createCircle(inter);\r\n    createCircle(inter.intersection);\r\n});\r\n```"},"comment":{"url":"https://api.github.com/repos/paperjs/paper.js/issues/comments/145905969","html_url":"https://github.com/paperjs/paper.js/issues/795#issuecomment-145905969","issue_url":"https://api.github.com/repos/paperjs/paper.js/issues/795","id":145905969,"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},"created_at":"2015-10-06T15:45:48Z","updated_at":"2015-10-06T15:45:48Z","body":"That sounds just incredible. Keep going, Jürg!"}}