{"action":"created","issue":{"url":"https://api.github.com/repos/Pomax/bezierjs/issues/37","repository_url":"https://api.github.com/repos/Pomax/bezierjs","labels_url":"https://api.github.com/repos/Pomax/bezierjs/issues/37/labels{/name}","comments_url":"https://api.github.com/repos/Pomax/bezierjs/issues/37/comments","events_url":"https://api.github.com/repos/Pomax/bezierjs/issues/37/events","html_url":"https://github.com/Pomax/bezierjs/issues/37","id":156889241,"number":37,"title":"reduce (or extrema or split?) breaks as soon as control point and start are the same","user":{"login":"Zylindermann","id":1769906,"avatar_url":"https://avatars.githubusercontent.com/u/1769906?v=3","gravatar_id":"","url":"https://api.github.com/users/Zylindermann","html_url":"https://github.com/Zylindermann","followers_url":"https://api.github.com/users/Zylindermann/followers","following_url":"https://api.github.com/users/Zylindermann/following{/other_user}","gists_url":"https://api.github.com/users/Zylindermann/gists{/gist_id}","starred_url":"https://api.github.com/users/Zylindermann/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Zylindermann/subscriptions","organizations_url":"https://api.github.com/users/Zylindermann/orgs","repos_url":"https://api.github.com/users/Zylindermann/repos","events_url":"https://api.github.com/users/Zylindermann/events{/privacy}","received_events_url":"https://api.github.com/users/Zylindermann/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-05-26T02:14:55Z","updated_at":"2016-05-26T04:02:57Z","closed_at":null,"body":"First of all thanks for that library, saved me a lot of time :-).\r\nApparently the reduce function fails as soon as a control point and the start/ end are the same. I did some further investigations and found out that this is connected to the extrema function yielding 0 two times and therefore \"confusing\" the split function (which seems to be broken for input 0,0 as well).\r\nMinimal example below:\r\n```\r\n      var curve = new Bezier(100,25 , 100,25 , 110,100 , 150,195);\r\n      var draw = function() {\r\n        drawSkeleton(curve);\r\n        drawCurve(curve);\r\n        setColor(\"red\");\r\n        curve.extrema().values.forEach(function(t) {\r\n          drawCircle(curve.get(t),3);\r\n          console.log(t);\r\n        });\r\n\r\n        curve.reduce().forEach( (curve) => {\r\n          drawCurve(curve);\r\n        } );\r\n\r\n      }\r\n```"},"comment":{"url":"https://api.github.com/repos/Pomax/bezierjs/issues/comments/221772133","html_url":"https://github.com/Pomax/bezierjs/issues/37#issuecomment-221772133","issue_url":"https://api.github.com/repos/Pomax/bezierjs/issues/37","id":221772133,"user":{"login":"Pomax","id":177243,"avatar_url":"https://avatars.githubusercontent.com/u/177243?v=3","gravatar_id":"","url":"https://api.github.com/users/Pomax","html_url":"https://github.com/Pomax","followers_url":"https://api.github.com/users/Pomax/followers","following_url":"https://api.github.com/users/Pomax/following{/other_user}","gists_url":"https://api.github.com/users/Pomax/gists{/gist_id}","starred_url":"https://api.github.com/users/Pomax/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Pomax/subscriptions","organizations_url":"https://api.github.com/users/Pomax/orgs","repos_url":"https://api.github.com/users/Pomax/repos","events_url":"https://api.github.com/users/Pomax/events{/privacy}","received_events_url":"https://api.github.com/users/Pomax/received_events","type":"User","site_admin":false},"created_at":"2016-05-26T04:02:57Z","updated_at":"2016-05-26T04:02:57Z","body":"Yeah there is currently no logic in place for checking curves that are obviously degenerate (exact overlapping coordinates, curves that are actually straight lines, etc)"}}
{"actor":{"display_login":"Pomax"}}