caryclark@google.com | c682590 | 2012-02-03 22:07:47 +0000 | [diff] [blame^] | 1 | #include "CurveIntersection.h" |
caryclark@google.com | 639df89 | 2012-01-10 21:46:10 +0000 | [diff] [blame] | 2 | #include "CubicIntersection_TestData.h" |
caryclark@google.com | 27accef | 2012-01-25 18:57:23 +0000 | [diff] [blame] | 3 | #include "Intersection_Tests.h" |
caryclark@google.com | 639df89 | 2012-01-10 21:46:10 +0000 | [diff] [blame] | 4 | |
caryclark@google.com | 27accef | 2012-01-25 18:57:23 +0000 | [diff] [blame] | 5 | void CubicBezierClip_Test() { |
caryclark@google.com | 639df89 | 2012-01-10 21:46:10 +0000 | [diff] [blame] | 6 | for (size_t index = 0; index < tests_count; ++index) { |
| 7 | const Cubic& cubic1 = tests[index][0]; |
| 8 | const Cubic& cubic2 = tests[index][1]; |
| 9 | Cubic reduce1, reduce2; |
| 10 | int order1 = reduceOrder(cubic1, reduce1, kReduceOrder_NoQuadraticsAllowed); |
| 11 | int order2 = reduceOrder(cubic2, reduce2, kReduceOrder_NoQuadraticsAllowed); |
| 12 | if (order1 < 4) { |
| 13 | printf("%s [%d] cubic1 order=%d\n", __FUNCTION__, (int) index, order1); |
| 14 | } |
| 15 | if (order2 < 4) { |
| 16 | printf("%s [%d] cubic2 order=%d\n", __FUNCTION__, (int) index, order2); |
| 17 | } |
| 18 | if (order1 == 4 && order2 == 4) { |
| 19 | double minT = 0; |
| 20 | double maxT = 1; |
| 21 | bezier_clip(reduce1, reduce2, minT, maxT); |
| 22 | } |
| 23 | } |
| 24 | } |