diff --git a/test/tests/Path_Intersections.js b/test/tests/Path_Intersections.js index f36bf2a7..a7eca7b3 100644 --- a/test/tests/Path_Intersections.js +++ b/test/tests/Path_Intersections.js @@ -154,25 +154,29 @@ test('#1074', function() { }); test('#1088', function() { - var path1 = new Path({ - segments: [ - [314.48576574722523, 308.77472829145444, 8.651222275575492, -2.220498935022104, -8.651222275575492, 2.220498935022105], - [290.40724577164383, 302.0497467665447, 6.2486166726329975, 6.3819316872198515, -0.012648799703259704, -0.012918663419550348] - ], - closed: false - }); - var path2 = new Path({ - segments: [ - [328.02746577749963, 300.1256389868014, 7.902769748335459, -10.046794724901815, -2.5352164811920375e-11, 3.2230218494078144e-11], - [309.7443037372522, 309.63202128991924, 5.4001247917767614e-11, -2.9558577807620168e-12, -6.666656713343759, 0.3629571641783996] - ], - closed: false - }); + var path1 = new Path([ + [314.48576574722523, 308.77472829145444, 8.651222275575492, -2.220498935022104, -8.651222275575492, 2.220498935022105], + [290.40724577164383, 302.0497467665447, 6.2486166726329975, 6.3819316872198515, -0.012648799703259704, -0.012918663419550348] + ]); + var path2 = new Path([ + [328.02746577749963, 300.1256389868014, 7.902769748335459, -10.046794724901815, -2.5352164811920375e-11, 3.2230218494078144e-11], + [309.7443037372522, 309.63202128991924, 5.4001247917767614e-11, -2.9558577807620168e-12, -6.666656713343759, 0.3629571641783996] + ]); testIntersection(path1.getIntersections(path2), [ { point: { x: 309.99726, y: 309.5004975367957 }, index: 0, time: 0.17182, crossing: true } ]); }); +test('#1165', function() { + var curve1 = new Curve([163.04000000000002, 335.67999999999995, 163.04000000000002, 357.68330000000003, 145.2033, 375.52, 123.2, 375.52]); + var curve2 = new Curve([300, 335.67999999999995, 184.90805, 335.67999999999995, 171.89195, 335.67999999999995, 56.80000000000001, 335.67999999999995]); + var path1 = new Path([curve1.segment1, curve1.segment2]); + var path2 = new Path([curve2.segment1, curve2.segment2]); + testIntersection(path1.getIntersections(path2), [ + { point: { x: 163.04, y: 335.68 }, index: 0, time: 0, crossing: false } + ]); +}); + test('#1174', function() { var path1 = new paper.Path({ segments: [