blob: d45a026a6d71ec369e29edae759bb93fae308d38 [file] [log] [blame]
caryclark@google.comc6825902012-02-03 22:07:47 +00001#include "CurveIntersection.h"
caryclark@google.com639df892012-01-10 21:46:10 +00002#include "CubicIntersection_TestData.h"
caryclark@google.com27accef2012-01-25 18:57:23 +00003#include "Intersection_Tests.h"
caryclark@google.com639df892012-01-10 21:46:10 +00004
caryclark@google.com27accef2012-01-25 18:57:23 +00005void CubicBezierClip_Test() {
caryclark@google.com639df892012-01-10 21:46:10 +00006 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}