caryclark@google.com | 27accef | 2012-01-25 18:57:23 +0000 | [diff] [blame^] | 1 | #include "CubicIntersection.h" |
| 2 | #include "Intersection_Tests.h" |
| 3 | #include "QuadraticIntersection_TestData.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 QuadraticBezierClip_Test() { |
| 6 | for (size_t index = 0; index < quadraticTests_count; ++index) { |
| 7 | const Quadratic& quad1 = quadraticTests[index][0]; |
| 8 | const Quadratic& quad2 = quadraticTests[index][1]; |
| 9 | Quadratic reduce1, reduce2; |
| 10 | int order1 = reduceOrder(quad1, reduce1); |
| 11 | int order2 = reduceOrder(quad2, reduce2); |
| 12 | if (order1 < 3) { |
| 13 | printf("%s [%d] quad1 order=%d\n", __FUNCTION__, (int)index, order1); |
| 14 | } |
| 15 | if (order2 < 3) { |
| 16 | printf("%s [%d] quad2 order=%d\n", __FUNCTION__, (int)index, order2); |
| 17 | } |
| 18 | if (order1 == 3 && order2 == 3) { |
| 19 | double minT = 0; |
| 20 | double maxT = 1; |
| 21 | bezier_clip(reduce1, reduce2, minT, maxT); |
| 22 | } |
| 23 | } |
| 24 | } |