aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar caryclark@google.com <caryclark@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2013-03-14 16:24:30 +0000
committerGravatar caryclark@google.com <caryclark@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2013-03-14 16:24:30 +0000
commit996d78b7cf9863a5b574fc1b64b1715cad4d0a23 (patch)
tree653783d10c8f0b00902f6b4268886cd599aed2da
parentbda74d33f6947b91648a650cd89d53eee408214d (diff)
shape ops work in progress
cubic tests pass git-svn-id: http://skia.googlecode.com/svn/trunk@8161 2bbb7eff-a529-9590-31e7-b0007b416f81
-rw-r--r--experimental/Intersection/CubicIntersection.cpp9
-rw-r--r--experimental/Intersection/CubicIntersection_Test.cpp16
-rw-r--r--experimental/Intersection/DataTypes.h4
-rw-r--r--experimental/Intersection/Intersections.cpp2
-rw-r--r--experimental/Intersection/Simplify.cpp12
-rw-r--r--experimental/Intersection/SimplifyNew_Test.cpp32
-rw-r--r--experimental/Intersection/as.htm174
-rw-r--r--experimental/Intersection/op.htm24
8 files changed, 255 insertions, 18 deletions
diff --git a/experimental/Intersection/CubicIntersection.cpp b/experimental/Intersection/CubicIntersection.cpp
index dc534e06c4..a773c4098e 100644
--- a/experimental/Intersection/CubicIntersection.cpp
+++ b/experimental/Intersection/CubicIntersection.cpp
@@ -14,9 +14,14 @@
#include "QuadraticUtilities.h"
#include "TSearch.h"
+#if 0
+#undef ONE_OFF_DEBUG
+#define ONE_OFF_DEBUG 0
+#endif
+
#if ONE_OFF_DEBUG
-static const double tLimits1[2][2] = {{0.328432751, 0.328433132}, {0.556114578, 0.55611496}};
-static const double tLimits2[2][2] = {{-0.83051487, -0.830515252}, {-0.860977985, -0.860978367}};
+static const double tLimits1[2][2] = {{0.865205808, 0.865215212}, {0.865207696, 0.865208078}};
+static const double tLimits2[2][2] = {{-0.865211397, -0.865215212}, {-0.865207696, -0.865208078}};
#endif
#define DEBUG_QUAD_PART 0
diff --git a/experimental/Intersection/CubicIntersection_Test.cpp b/experimental/Intersection/CubicIntersection_Test.cpp
index a11c1c9467..9662eb8379 100644
--- a/experimental/Intersection/CubicIntersection_Test.cpp
+++ b/experimental/Intersection/CubicIntersection_Test.cpp
@@ -136,6 +136,9 @@ static const Cubic testSet[] = {
const size_t testSetCount = sizeof(testSet) / sizeof(testSet[0]);
static const Cubic newTestSet[] = {
+{{1,3}, {5,6}, {5,3}, {5,4}},
+{{3,5}, {4,5}, {3,1}, {6,5}},
+
{{0,5}, {0,5}, {5,4}, {6,4}},
{{4,5}, {4,6}, {5,0}, {5,0}},
@@ -703,12 +706,13 @@ static void intersectionFinder(int index0, int index1, double t1Seed, double t2S
void CubicIntersection_IntersectionFinder() {
- double t1Seed = 0.5;
- double t2Seed = 0.3;
- double t1Step = 0.1;
- double t2Step = 0.1;
- if (false) intersectionFinder(0, 1, t1Seed, t2Seed, t1Step, t2Step);
- intersectionFinder(1, 0, .3, .5, t1Step, t2Step);
+ // double t1Seed = 0.87;
+ // double t2Seed = 0.87;
+ double t1Step = 0.000001;
+ double t2Step = 0.000001;
+ intersectionFinder(0, 1, 0.855895664, 0.864850875, t1Step, t2Step);
+ intersectionFinder(0, 1, 0.865207906, 0.865207887, t1Step, t2Step);
+ intersectionFinder(0, 1, 0.865213351, 0.865208087, t1Step, t2Step);
}
static void coincidentTest() {
diff --git a/experimental/Intersection/DataTypes.h b/experimental/Intersection/DataTypes.h
index 40ed61a983..7d749afc13 100644
--- a/experimental/Intersection/DataTypes.h
+++ b/experimental/Intersection/DataTypes.h
@@ -12,7 +12,7 @@
#include "SkPoint.h"
-#define FORCE_RELEASE 0 // set force release to 1 for multiple thread -- no debugging
+#define FORCE_RELEASE 1 // set force release to 1 for multiple thread -- no debugging
#define ONE_OFF_DEBUG 0
#define ONE_OFF_DEBUG_MATHEMATICA 0
@@ -43,7 +43,7 @@ const double FLT_EPSILON_SQUARED = FLT_EPSILON * FLT_EPSILON;
const double FLT_EPSILON_SQRT = sqrt(FLT_EPSILON);
const double FLT_EPSILON_INVERSE = 1 / FLT_EPSILON;
const double DBL_EPSILON_ERR = DBL_EPSILON * 4; // tune -- allow a few bits of error
-const double ROUGH_EPSILON = FLT_EPSILON * 32;
+const double ROUGH_EPSILON = FLT_EPSILON * 64;
const double MORE_ROUGH_EPSILON = FLT_EPSILON * 256;
inline bool approximately_zero(double x) {
diff --git a/experimental/Intersection/Intersections.cpp b/experimental/Intersection/Intersections.cpp
index c5ff0ca23b..1877bd40e2 100644
--- a/experimental/Intersection/Intersections.cpp
+++ b/experimental/Intersection/Intersections.cpp
@@ -90,7 +90,7 @@ void Intersections::insertCoincidentPair(double s1, double e1, double s2, double
}
int Intersections::insert(double one, double two, const _Point& pt) {
- SkASSERT(fUsed <= 1 || fT[0][0] < fT[0][1]);
+ SkASSERT(fUsed <= 1 || fT[0][0] <= fT[0][1]);
int index;
for (index = 0; index < fUsed; ++index) {
double oldOne = fT[0][index];
diff --git a/experimental/Intersection/Simplify.cpp b/experimental/Intersection/Simplify.cpp
index 6b2ca98a0a..d99cdf315e 100644
--- a/experimental/Intersection/Simplify.cpp
+++ b/experimental/Intersection/Simplify.cpp
@@ -2907,7 +2907,17 @@ public:
SkASSERT(!done());
int firstT = -1;
/* SkPoint topPt = */ activeLeftTop(onlySortable, &firstT);
- SkASSERT(firstT >= 0);
+ if (firstT < 0) {
+ unsortable = true;
+ firstT = 0;
+ while (fTs[firstT].fDone) {
+ SkASSERT(firstT < fTs.count());
+ ++firstT;
+ }
+ tIndex = firstT;
+ endIndex = nextExactSpan(firstT, 1);
+ return this;
+ }
// sort the edges to find the leftmost
int step = 1;
int end = nextSpan(firstT, step);
diff --git a/experimental/Intersection/SimplifyNew_Test.cpp b/experimental/Intersection/SimplifyNew_Test.cpp
index 1d5d375b99..de59cfd5e8 100644
--- a/experimental/Intersection/SimplifyNew_Test.cpp
+++ b/experimental/Intersection/SimplifyNew_Test.cpp
@@ -4585,12 +4585,40 @@ static void cubicOp61d() {
testShapeOp(path, pathB, kDifference_Op);
}
-static void (*firstTest)() = cubicOp61d;
+static void cubicOp62d() {
+ SkPath path, pathB;
+ path.setFillType(SkPath::kWinding_FillType);
+ path.moveTo(1,3);
+ path.cubicTo(5,6, 5,3, 5,4);
+ path.close();
+ pathB.setFillType(SkPath::kWinding_FillType);
+ pathB.moveTo(3,5);
+ pathB.cubicTo(4,5, 3,1, 6,5);
+ pathB.close();
+ testShapeOp(path, pathB, kDifference_Op);
+}
+
+static void cubicOp63d() {
+ SkPath path, pathB;
+ path.setFillType(SkPath::kWinding_FillType);
+ path.moveTo(2,3);
+ path.cubicTo(0,4, 3,2, 5,3);
+ path.close();
+ pathB.setFillType(SkPath::kWinding_FillType);
+ pathB.moveTo(2,3);
+ pathB.cubicTo(3,5, 3,2, 4,0);
+ pathB.close();
+ testShapeOp(path, pathB, kDifference_Op);
+}
+
+static void (*firstTest)() = cubicOp63d;
static struct {
void (*fun)();
const char* str;
} tests[] = {
+ TEST(cubicOp63d),
+ TEST(cubicOp62d),
TEST(cubicOp61d),
TEST(cubicOp60d),
TEST(cubicOp59d),
@@ -5035,7 +5063,7 @@ static void (*firstSubTest)() = 0;
static bool skipAll = false;
static bool runSubTestsFirst = false;
-static bool runReverse = false;
+static bool runReverse = true;
static void (*stopTest)() = 0;
void SimplifyNew_Test() {
diff --git a/experimental/Intersection/as.htm b/experimental/Intersection/as.htm
index 7488c0965b..f5f6250ec1 100644
--- a/experimental/Intersection/as.htm
+++ b/experimental/Intersection/as.htm
@@ -3447,11 +3447,177 @@ debugShowActiveSpans id=3 (2,3 1,6 2,1 5,0) t=0 (2,3) tEnd=0.5 other=4 otherT=1
debugShowActiveSpans id=3 (2,3 1,6 2,1 5,0) t=0 (2,3) tEnd=0.5 other=1 otherT=0.5 otherIndex=1 windSum=? windValue=1 oppValue=0
</div>
+<div id="cubicOp62d">
+ SimplifyNew_Test [cubicOp62d]
+{{1,3}, {5,6}, {5,3}, {5,4}},
+{{5,4}, {1,3}},
+op difference
+{{3,5}, {4,5}, {3,1}, {6,5}},
+{{6,5}, {3,5}},
+debugShowCubicIntersection no self intersect {{1,3}, {5,6}, {5,3}, {5,4}}
+debugShowCubicLineIntersection wtTs[0]=0 {{1,3}, {5,6}, {5,3}, {5,4}} {{1,3}} wtTs[1]=0.666666667 {{4.8518518518518512,3.9629629629629628}} wtTs[2]=1 {{5,4}} wnTs[0]=1 {{5,4}, {1,3}} wnTs[1]=0.037037037 wnTs[2]=0
+debugShowCubicIntersection wtTs[0]=0.278899971 {{1,3}, {5,6}, {5,3}, {5,4}} {{3.5001544800676263,4.3269091333431628}} wtTs[1]=0.855895664 {{4.9880300830066844,3.7869549154423883}} wtTs[2]=0.865207906 {{4.9902038991416013,3.7891603690182212}} wtTs[3]=0.865213351 {{4.9902050861407137,3.789162057358868}} wnTs[0]=0.2789 {{3,5}, {4,5}, {3,1}, {6,5}} wnTs[1]=0.864850875 wnTs[2]=0.865207887 wnTs[3]=0.865208087
+debugShowCubicLineIntersection wtTs[0]=0.448187637 {{3,5}, {4,5}, {3,1}, {6,5}} {{3.6795004703683416,3.6698751175920856}} wnTs[0]=0.330125 {{5,4}, {1,3}}
+debugShowCubicIntersection no self intersect {{3,5}, {4,5}, {3,1}, {6,5}}
+debugShowCubicLineIntersection wtTs[0]=0 {{3,5}, {4,5}, {3,1}, {6,5}} {{3,5}} wtTs[1]=1 {{6,5}} wnTs[0]=1 {{6,5}, {3,5}} wnTs[1]=0
+debugShowActiveSpans id=1 (1,3 5,6 5,3 5,4) t=0 (1,3) tEnd=0.278899971 other=2 otherT=1 otherIndex=3 windSum=? windValue=1 oppValue=0
+debugShowActiveSpans id=1 (1,3 5,6 5,3 5,4) t=0.278899971 (3.5001545,4.32690907) tEnd=0.666666667 other=3 otherT=0.278899971 otherIndex=1 windSum=? windValue=1 oppValue=0
+debugShowActiveSpans id=1 (1,3 5,6 5,3 5,4) t=0.666666667 (4.85185194,3.96296287) tEnd=0.855895664 other=2 otherT=0.037037037 otherIndex=1 windSum=? windValue=1 oppValue=0
+debugShowActiveSpans id=1 (1,3 5,6 5,3 5,4) t=0.855895664 (4.98802996,3.78695488) tEnd=0.865207906 other=3 otherT=0.864850875 otherIndex=3 windSum=? windValue=1 oppValue=0
+debugShowActiveSpans id=1 (1,3 5,6 5,3 5,4) t=0.865207906 (4.99020386,3.78916025) tEnd=0.865213351 other=3 otherT=0.865207887 otherIndex=4 windSum=? windValue=1 oppValue=0
+debugShowActiveSpans id=1 (1,3 5,6 5,3 5,4) t=0.865213351 (4.99020529,3.78916216) tEnd=1 other=3 otherT=0.865208087 otherIndex=5 windSum=? windValue=1 oppValue=0
+debugShowActiveSpans id=2 (5,4 1,3) t=0 (5,4) tEnd=0.037037037 other=1 otherT=1 otherIndex=6 windSum=? windValue=1 oppValue=0
+debugShowActiveSpans id=2 (5,4 1,3) t=0.037037037 (4.85185194,3.96296287) tEnd=0.330124882 other=1 otherT=0.666666667 otherIndex=2 windSum=? windValue=1 oppValue=0
+debugShowActiveSpans id=2 (5,4 1,3) t=0.330124882 (3.67950058,3.66987514) tEnd=1 other=3 otherT=0.448187637 otherIndex=2 windSum=? windValue=1 oppValue=0
+debugShowActiveSpans id=3 (3,5 4,5 3,1 6,5) t=0 (3,5) tEnd=0.278899971 other=4 otherT=1 otherIndex=1 windSum=? windValue=1 oppValue=0
+debugShowActiveSpans id=3 (3,5 4,5 3,1 6,5) t=0.278899971 (3.5001545,4.32690907) tEnd=0.448187637 other=1 otherT=0.278899971 otherIndex=1 windSum=? windValue=1 oppValue=0
+debugShowActiveSpans id=3 (3,5 4,5 3,1 6,5) t=0.448187637 (3.67950058,3.66987514) tEnd=0.864850875 other=2 otherT=0.330124882 otherIndex=2 windSum=? windValue=1 oppValue=0
+debugShowActiveSpans id=3 (3,5 4,5 3,1 6,5) t=0.864850875 (4.98802996,3.78695488) tEnd=0.865207887 other=1 otherT=0.855895664 otherIndex=3 windSum=? windValue=1 oppValue=0
+debugShowActiveSpans id=3 (3,5 4,5 3,1 6,5) t=0.865207887 (4.99020386,3.78916025) tEnd=0.865208087 other=1 otherT=0.865207906 otherIndex=4 windSum=? windValue=1 oppValue=0
+debugShowActiveSpans id=3 (3,5 4,5 3,1 6,5) t=0.865208087 (4.99020529,3.78916216) tEnd=1 other=1 otherT=0.865213351 otherIndex=5 windSum=? windValue=1 oppValue=0
+debugShowActiveSpans id=4 (6,5 3,5) t=0 (6,5) tEnd=1 other=3 otherT=1 otherIndex=6 windSum=? windValue=1 oppValue=0
+findTop debugShowSort contourWinding=0 oppContourWinding=0 sign=-1
+debugShowSort [0] {{1,3}, {5,6}, {5,3}, {5,4}} tStart=0 tEnd=0.278899971 sign=-1 windValue=1 windSum=? 0->1 (max=1) done=0 tiny=0 opp=0
+debugShowSort [1] {{5,4}, {1,3}} tStart=1 tEnd=0.330124882 sign=1 windValue=1 windSum=? 1->0 (max=1) done=0 tiny=0 opp=0
+markWinding id=1 (1,3 5,6 5,3 5,4) t=0 [0] (1,3) tEnd=0.278899971 newWindSum=1 newOppSum=0 oppSum=? windSum=? windValue=1
+markWinding id=2 (5,4 1,3) t=0.330124882 [2] (3.67950058,3.66987514) tEnd=1 newWindSum=1 newOppSum=0 oppSum=? windSum=? windValue=1
+markWinding id=1 (1,3 5,6 5,3 5,4) t=0 [0] (1,3) tEnd=0.278899971 newWindSum=1 newOppSum=0 oppSum=0 windSum=1 windValue=1
+activeOp op=diff miFrom=1 miTo=0 suFrom=0 suTo=0 result=1
+findNextOp simple
+markDoneBinary id=1 (1,3 5,6 5,3 5,4) t=0 [0] (1,3) tEnd=0.278899971 newWindSum=1 newOppSum=0 oppSum=0 windSum=1 windValue=1
+bridgeOp current id=1 from=(3.5001545,4.32690907) to=(1,3)
+path.moveTo(3.5001545,4.32690907);
+path.cubicTo(2.92005897,4.20668888, 2.11559987,3.83669996, 1,3);
+findNextOp debugShowSort contourWinding=0 oppContourWinding=0 sign=-1
+debugShowSort [1] {{5,4}, {1,3}} tStart=0.330124882 tEnd=1 sign=-1 windValue=1 windSum=1 0->1 (max=1) done=0 tiny=0 opp=0
+debugShowSort [2] {{3,5}, {4,5}, {3,1}, {6,5}} tStart=0.448187637 tEnd=0.278899971 sign=1 windValue=1 windSum=? 0->-1 (max=-1) done=0 tiny=0 opp=1
+debugShowSort [3] {{5,4}, {1,3}} tStart=0.330124882 tEnd=0.037037037 sign=1 windValue=1 windSum=? 1->0 (max=1) done=0 tiny=0 opp=0
+debugShowSort [0] {{3,5}, {4,5}, {3,1}, {6,5}} tStart=0.448187637 tEnd=0.864850875 sign=-1 windValue=1 windSum=? -1->0 (max=-1) done=0 tiny=0 opp=1
+findNextOp firstIndex=[1] sign=-1
+activeOp op=diff miFrom=1 miTo=1 suFrom=0 suTo=1 result=1
+markWinding id=3 (3,5 4,5 3,1 6,5) t=0.278899971 [1] (3.5001545,4.32690907) tEnd=0.448187637 newWindSum=-1 newOppSum=1 oppSum=? windSum=? windValue=1
+findNextOp chase.append id=3
+activeOp op=diff miFrom=1 miTo=0 suFrom=1 suTo=1 result=0
+markDoneBinary id=2 (5,4 1,3) t=0.037037037 [1] (4.85185194,3.96296287) tEnd=0.330124882 newWindSum=1 newOppSum=-1 oppSum=? windSum=? windValue=1
+findNextOp chase.append id=2
+activeOp op=diff miFrom=0 miTo=0 suFrom=1 suTo=0 result=0
+markDoneBinary id=3 (3,5 4,5 3,1 6,5) t=0.448187637 [2] (3.67950058,3.66987514) tEnd=0.864850875 newWindSum=-1 newOppSum=0 oppSum=? windSum=? windValue=1
+findNextOp chase.append id=3
+markDoneBinary id=2 (5,4 1,3) t=0.330124882 [2] (3.67950058,3.66987514) tEnd=1 newWindSum=1 newOppSum=0 oppSum=0 windSum=1 windValue=1
+findNextOp from:[2] to:[3] start=2 end=1
+bridgeOp current id=2 from=(1,3) to=(3.67950058,3.66987514)
+findNextOp debugShowSort contourWinding=-1 oppContourWinding=1 sign=-1
+debugShowSort [0] {{3,5}, {4,5}, {3,1}, {6,5}} tStart=0.278899971 tEnd=0.448187637 sign=-1 windValue=1 windSum=-1 -1->0 (max=-1) done=0 tiny=0 opp=0
+debugShowSort [1] {{1,3}, {5,6}, {5,3}, {5,4}} tStart=0.278899971 tEnd=0 sign=1 windValue=1 windSum=1 1->0 (max=1) done=1 tiny=0 opp=1
+debugShowSort [2] {{3,5}, {4,5}, {3,1}, {6,5}} tStart=0.278899971 tEnd=0 sign=1 windValue=1 windSum=? 0->-1 (max=-1) done=0 tiny=0 opp=0
+debugShowSort [3] {{1,3}, {5,6}, {5,3}, {5,4}} tStart=0.278899971 tEnd=0.666666667 sign=-1 windValue=1 windSum=? 0->1 (max=1) done=0 tiny=0 opp=1
+findNextOp firstIndex=[0] sign=-1
+activeOp op=diff miFrom=1 miTo=0 suFrom=0 suTo=0 result=1
+activeOp op=diff miFrom=0 miTo=0 suFrom=0 suTo=1 result=0
+markDoneBinary id=3 (3,5 4,5 3,1 6,5) t=0 [0] (3,5) tEnd=0.278899971 newWindSum=-1 newOppSum=0 oppSum=? windSum=? windValue=1
+markDoneBinary id=4 (6,5 3,5) t=0 [0] (6,5) tEnd=1 newWindSum=-1 newOppSum=0 oppSum=? windSum=? windValue=1
+markDoneBinary id=3 (3,5 4,5 3,1 6,5) t=0.865208087 [5] (4.99020529,3.78916216) tEnd=1 newWindSum=-1 newOppSum=0 oppSum=? windSum=? windValue=1
+findNextOp chase.append id=3
+activeOp op=diff miFrom=0 miTo=1 suFrom=1 suTo=1 result=0
+markDoneBinary id=1 (1,3 5,6 5,3 5,4) t=0.278899971 [1] (3.5001545,4.32690907) tEnd=0.666666667 newWindSum=1 newOppSum=-1 oppSum=? windSum=? windValue=1
+findNextOp chase.append id=1
+markDoneBinary id=3 (3,5 4,5 3,1 6,5) t=0.278899971 [1] (3.5001545,4.32690907) tEnd=0.448187637 newWindSum=-1 newOppSum=1 oppSum=1 windSum=-1 windValue=1
+findNextOp from:[3] to:[1] start=1 end=0
+bridgeOp current id=3 from=(3.67950058,3.66987514) to=(3.5001545,4.32690907)
+path.lineTo(3.67950058,3.66987514);
+path.cubicTo(3.60967231,3.86879396, 3.5595932,4.10721159, 3.5001545,4.32690907);
+path.close();
+findChaseOp debugShowSort contourWinding=? oppContourWinding=? sign=-1
+debugShowSort [0] {{1,3}, {5,6}, {5,3}, {5,4}} tStart=0.666666667 tEnd=0.855895664 sign=-1 windValue=1 windSum=? ?->? (max=?) done=0 tiny=0 opp=0
+debugShowSort [1] {{5,4}, {1,3}} tStart=0.037037037 tEnd=0.330124882 sign=-1 windValue=1 windSum=1 ?->? (max=?) done=1 tiny=0 opp=0
+debugShowSort [2] {{1,3}, {5,6}, {5,3}, {5,4}} tStart=0.666666667 tEnd=0.278899971 sign=1 windValue=1 windSum=1 ?->? (max=?) done=1 tiny=0 opp=0
+debugShowSort [3] {{5,4}, {1,3}} tStart=0.037037037 tEnd=0 sign=1 windValue=1 windSum=? ?->? (max=?) done=0 tiny=0 opp=0
+findChaseOp debugShowSort contourWinding=0 oppContourWinding=-1 sign=-1
+debugShowSort [1] {{5,4}, {1,3}} tStart=0.037037037 tEnd=0.330124882 sign=-1 windValue=1 windSum=1 0->1 (max=1) done=1 tiny=0 opp=0
+debugShowSort [2] {{1,3}, {5,6}, {5,3}, {5,4}} tStart=0.666666667 tEnd=0.278899971 sign=1 windValue=1 windSum=1 1->0 (max=1) done=1 tiny=0 opp=0
+debugShowSort [3] {{5,4}, {1,3}} tStart=0.037037037 tEnd=0 sign=1 windValue=1 windSum=? 0->-1 (max=-1) done=0 tiny=0 opp=0
+debugShowSort [0] {{1,3}, {5,6}, {5,3}, {5,4}} tStart=0.666666667 tEnd=0.855895664 sign=-1 windValue=1 windSum=? -1->0 (max=-1) done=0 tiny=0 opp=0
+markWinding id=2 (5,4 1,3) t=0 [0] (5,4) tEnd=0.037037037 newWindSum=-1 newOppSum=-1 oppSum=? windSum=? windValue=1
+markWinding id=1 (1,3 5,6 5,3 5,4) t=0.865213351 [5] (4.99020529,3.78916216) tEnd=1 newWindSum=-1 newOppSum=-1 oppSum=? windSum=? windValue=1
+markWinding id=1 (1,3 5,6 5,3 5,4) t=0.666666667 [2] (4.85185194,3.96296287) tEnd=0.855895664 newWindSum=-1 newOppSum=-1 oppSum=? windSum=? windValue=1
+debugShowActiveSpans id=1 (1,3 5,6 5,3 5,4) t=0.666666667 (4.85185194,3.96296287) tEnd=0.855895664 other=2 otherT=0.037037037 otherIndex=1 windSum=-1 windValue=1 oppValue=0
+debugShowActiveSpans id=1 (1,3 5,6 5,3 5,4) t=0.855895664 (4.98802996,3.78695488) tEnd=0.865207906 other=3 otherT=0.864850875 otherIndex=3 windSum=? windValue=1 oppValue=0
+debugShowActiveSpans id=1 (1,3 5,6 5,3 5,4) t=0.865207906 (4.99020386,3.78916025) tEnd=0.865213351 other=3 otherT=0.865207887 otherIndex=4 windSum=? windValue=1 oppValue=0
+debugShowActiveSpans id=1 (1,3 5,6 5,3 5,4) t=0.865213351 (4.99020529,3.78916216) tEnd=1 other=3 otherT=0.865208087 otherIndex=5 windSum=-1 windValue=1 oppValue=0
+debugShowActiveSpans id=2 (5,4 1,3) t=0 (5,4) tEnd=0.037037037 other=1 otherT=1 otherIndex=6 windSum=-1 windValue=1 oppValue=0
+debugShowActiveSpans id=3 (3,5 4,5 3,1 6,5) t=0.864850875 (4.98802996,3.78695488) tEnd=0.865207887 other=1 otherT=0.855895664 otherIndex=3 windSum=? windValue=1 oppValue=0
+debugShowActiveSpans id=3 (3,5 4,5 3,1 6,5) t=0.865207887 (4.99020386,3.78916025) tEnd=0.865208087 other=1 otherT=0.865207906 otherIndex=4 windSum=? windValue=1 oppValue=0
+activeOp op=diff miFrom=0 miTo=1 suFrom=1 suTo=1 result=0
+markDoneBinary id=2 (5,4 1,3) t=0 [0] (5,4) tEnd=0.037037037 newWindSum=-1 newOppSum=-1 oppSum=-1 windSum=-1 windValue=1
+markDoneBinary id=1 (1,3 5,6 5,3 5,4) t=0.865213351 [5] (4.99020529,3.78916216) tEnd=1 newWindSum=-1 newOppSum=-1 oppSum=-1 windSum=-1 windValue=1
+findChaseOp debugShowSort contourWinding=? oppContourWinding=? sign=1
+debugShowSort [0] {{1,3}, {5,6}, {5,3}, {5,4}} tStart=0.865213351 tEnd=0.865207906 sign=1 windValue=1 windSum=? ?->? (max=?) done=0 tiny=0 opp=0
+debugShowSort [1] {{3,5}, {4,5}, {3,1}, {6,5}} tStart=0.865208087 tEnd=0.865207887 sign=1 windValue=1 windSum=? ?->? (max=?) done=0 tiny=0 opp=1
+debugShowSort [2] {{1,3}, {5,6}, {5,3}, {5,4}} tStart=0.865213351 tEnd=1 sign=-1 windValue=1 windSum=-1 ?->? (max=?) done=1 tiny=0 opp=0
+debugShowSort [3] {{3,5}, {4,5}, {3,1}, {6,5}} tStart=0.865208087 tEnd=1 sign=-1 windValue=1 windSum=-1 ?->? (max=?) done=1 tiny=0 opp=1
+findChaseOp debugShowSort contourWinding=-1 oppContourWinding=-1 sign=-1
+debugShowSort [2] {{1,3}, {5,6}, {5,3}, {5,4}} tStart=0.865213351 tEnd=1 sign=-1 windValue=1 windSum=-1 -1->0 (max=-1) done=1 tiny=0 opp=0
+debugShowSort [3] {{3,5}, {4,5}, {3,1}, {6,5}} tStart=0.865208087 tEnd=1 sign=-1 windValue=1 windSum=-1 -1->0 (max=-1) done=1 tiny=0 opp=1
+debugShowSort [0] {{1,3}, {5,6}, {5,3}, {5,4}} tStart=0.865213351 tEnd=0.865207906 sign=1 windValue=1 windSum=? 0->-1 (max=-1) done=0 tiny=0 opp=0
+debugShowSort [1] {{3,5}, {4,5}, {3,1}, {6,5}} tStart=0.865208087 tEnd=0.865207887 sign=1 windValue=1 windSum=? 0->-1 (max=-1) done=0 tiny=0 opp=1
+markWinding id=1 (1,3 5,6 5,3 5,4) t=0.865207906 [4] (4.99020386,3.78916025) tEnd=0.865213351 newWindSum=-1 newOppSum=0 oppSum=? windSum=? windValue=1
+markWinding id=3 (3,5 4,5 3,1 6,5) t=0.865207887 [4] (4.99020386,3.78916025) tEnd=0.865208087 newWindSum=-1 newOppSum=-1 oppSum=? windSum=? windValue=1
+debugShowActiveSpans id=1 (1,3 5,6 5,3 5,4) t=0.666666667 (4.85185194,3.96296287) tEnd=0.855895664 other=2 otherT=0.037037037 otherIndex=1 windSum=-1 windValue=1 oppValue=0
+debugShowActiveSpans id=1 (1,3 5,6 5,3 5,4) t=0.855895664 (4.98802996,3.78695488) tEnd=0.865207906 other=3 otherT=0.864850875 otherIndex=3 windSum=? windValue=1 oppValue=0
+debugShowActiveSpans id=1 (1,3 5,6 5,3 5,4) t=0.865207906 (4.99020386,3.78916025) tEnd=0.865213351 other=3 otherT=0.865207887 otherIndex=4 windSum=-1 windValue=1 oppValue=0
+debugShowActiveSpans id=3 (3,5 4,5 3,1 6,5) t=0.864850875 (4.98802996,3.78695488) tEnd=0.865207887 other=1 otherT=0.855895664 otherIndex=3 windSum=? windValue=1 oppValue=0
+debugShowActiveSpans id=3 (3,5 4,5 3,1 6,5) t=0.865207887 (4.99020386,3.78916025) tEnd=0.865208087 other=1 otherT=0.865207906 otherIndex=4 windSum=-1 windValue=1 oppValue=0
+activeOp op=diff miFrom=0 miTo=1 suFrom=0 suTo=0 result=1
+findNextOp debugShowSort contourWinding=-1 oppContourWinding=0 sign=-1
+debugShowSort [2] {{1,3}, {5,6}, {5,3}, {5,4}} tStart=0.865207906 tEnd=0.865213351 sign=-1 windValue=1 windSum=-1 -1->0 (max=-1) done=0 tiny=0 opp=0
+debugShowSort [3] {{3,5}, {4,5}, {3,1}, {6,5}} tStart=0.865207887 tEnd=0.865208087 sign=-1 windValue=1 windSum=-1 0->1 (max=1) done=0 tiny=0 opp=1
+debugShowSort [0] {{1,3}, {5,6}, {5,3}, {5,4}} tStart=0.865207906 tEnd=0.855895664 sign=1 windValue=1 windSum=? 0->-1 (max=-1) done=0 tiny=0 opp=0
+debugShowSort [1] {{3,5}, {4,5}, {3,1}, {6,5}} tStart=0.865207887 tEnd=0.864850875 sign=1 windValue=1 windSum=? 1->0 (max=1) done=0 tiny=0 opp=1
+findNextOp firstIndex=[2] sign=-1
+activeOp op=diff miFrom=0 miTo=0 suFrom=0 suTo=1 result=0
+activeOp op=diff miFrom=0 miTo=1 suFrom=1 suTo=1 result=0
+markDoneBinary id=1 (1,3 5,6 5,3 5,4) t=0.855895664 [3] (4.98802996,3.78695488) tEnd=0.865207906 newWindSum=-1 newOppSum=1 oppSum=? windSum=? windValue=1
+findNextOp chase.append id=1
+activeOp op=diff miFrom=1 miTo=1 suFrom=1 suTo=0 result=1
+markWinding id=3 (3,5 4,5 3,1 6,5) t=0.864850875 [3] (4.98802996,3.78695488) tEnd=0.865207887 newWindSum=1 newOppSum=-1 oppSum=? windSum=? windValue=1
+findNextOp chase.append id=3
+markDoneBinary id=1 (1,3 5,6 5,3 5,4) t=0.865207906 [4] (4.99020386,3.78916025) tEnd=0.865213351 newWindSum=-1 newOppSum=0 oppSum=0 windSum=-1 windValue=1
+findNextOp from:[1] to:[3] start=4 end=3
+bridgeOp current id=1 from=(4.99020529,3.78916216) to=(4.99020386,3.78916025)
+path.moveTo(4.99020529,3.78916216);
+path.cubicTo(4.99020433,3.78916144, 4.99020433,3.78916097, 4.99020386,3.78916025);
+findNextOp debugShowSort contourWinding=0 oppContourWinding=-1 sign=-1
+debugShowSort [2] {{3,5}, {4,5}, {3,1}, {6,5}} tStart=0.864850875 tEnd=0.865207887 sign=-1 windValue=1 windSum=1 0->1 (max=1) done=0 tiny=0 opp=0
+debugShowSort [3] {{1,3}, {5,6}, {5,3}, {5,4}} tStart=0.855895664 tEnd=0.865207906 sign=-1 windValue=1 windSum=-1 -1->0 (max=-1) done=1 tiny=0 opp=1
+debugShowSort [0] {{3,5}, {4,5}, {3,1}, {6,5}} tStart=0.864850875 tEnd=0.448187637 sign=1 windValue=1 windSum=-1 1->0 (max=1) done=1 tiny=0 opp=0
+debugShowSort [1] {{1,3}, {5,6}, {5,3}, {5,4}} tStart=0.855895664 tEnd=0.666666667 sign=1 windValue=1 windSum=-1 0->-1 (max=-1) done=0 tiny=0 opp=1
+findNextOp firstIndex=[2] sign=-1
+activeOp op=diff miFrom=1 miTo=0 suFrom=1 suTo=1 result=0
+activeOp op=diff miFrom=0 miTo=0 suFrom=1 suTo=0 result=0
+activeOp op=diff miFrom=0 miTo=1 suFrom=0 suTo=0 result=1
+markDoneBinary id=3 (3,5 4,5 3,1 6,5) t=0.864850875 [3] (4.98802996,3.78695488) tEnd=0.865207887 newWindSum=1 newOppSum=-1 oppSum=-1 windSum=1 windValue=1
+findNextOp from:[3] to:[1] start=3 end=2
+bridgeOp current id=3 from=(4.99020386,3.78916025) to=(4.98802996,3.78695488)
+path.cubicTo(4.98947859,3.78842425, 4.98875427,3.78768921, 4.98802996,3.78695488);
+findNextOp debugShowSort contourWinding=-1 oppContourWinding=-1 sign=-1
+debugShowSort [0] {{1,3}, {5,6}, {5,3}, {5,4}} tStart=0.666666667 tEnd=0.855895664 sign=-1 windValue=1 windSum=-1 -1->0 (max=-1) done=0 tiny=0 opp=0
+debugShowSort [1] {{5,4}, {1,3}} tStart=0.037037037 tEnd=0.330124882 sign=-1 windValue=1 windSum=1 0->1 (max=1) done=1 tiny=0 opp=0
+debugShowSort [2] {{1,3}, {5,6}, {5,3}, {5,4}} tStart=0.666666667 tEnd=0.278899971 sign=1 windValue=1 windSum=1 1->0 (max=1) done=1 tiny=0 opp=0
+debugShowSort [3] {{5,4}, {1,3}} tStart=0.037037037 tEnd=0 sign=1 windValue=1 windSum=-1 0->-1 (max=-1) done=1 tiny=0 opp=0
+findNextOp firstIndex=[0] sign=-1
+activeOp op=diff miFrom=0 miTo=1 suFrom=1 suTo=1 result=0
+activeOp op=diff miFrom=1 miTo=0 suFrom=1 suTo=1 result=0
+activeOp op=diff miFrom=0 miTo=1 suFrom=1 suTo=1 result=0
+markDoneBinary id=1 (1,3 5,6 5,3 5,4) t=0.666666667 [2] (4.85185194,3.96296287) tEnd=0.855895664 newWindSum=-1 newOppSum=-1 oppSum=-1 windSum=-1 windValue=1
+path.cubicTo(4.97231197,3.77658033, 4.93595362,3.85783577, 4.85185194,3.96296287);
+</div>
+
</div>
<script type="text/javascript">
var testDivs = [
+ cubicOp62d,
cubicOp61d,
cubicOp58da,
cubicOp58d,
@@ -3707,8 +3873,8 @@ function construct_regexp2(pattern) {
escape = escape.replace(/QUAD_VAL/g, "\\(P_VAL P_VAL P_VAL\\)");
escape = escape.replace(/LINE_VAL/g, "\\(P_VAL P_VAL\\)");
escape = escape.replace(/PT_VAL/g, "\\(P_VAL\\)");
- escape = escape.replace(/P_VAL/g, "(-?\\d+\\.?\\d*e?-?\\d*),(-?\\d+\\.?\\d*e?-?\\d*)");
- escape = escape.replace(/T_VAL/g, "(-?\\d+\\.?\\d*e?-?\\d*)");
+ escape = escape.replace(/P_VAL/g, "(-?\\d+\\.?\\d*(?:e-?\\d+)?),(-?\\d+\\.?\\d*(?:e-?\\d+)?)");
+ escape = escape.replace(/T_VAL/g, "(-?\\d+\\.?\\d*(?:e-?\\d+)?)");
escape = escape.replace(/IDX/g, "(\\d+)");
escape = escape.replace(/NUM/g, "(-?\\d+)");
escape = escape.replace(/OPT/g, "(\\?|-?\\d+)");
@@ -3722,8 +3888,8 @@ function construct_regexp2c(pattern) {
escape = escape.replace(/QUAD_VAL/g, "(?:\\$\\d = )?\\{\\{P_VAL\\}, \\{P_VAL\\}, \\{P_VAL\\}\\}");
escape = escape.replace(/LINE_VAL/g, "(?:\\$\\d = )?\\{\\{P_VAL\\}, \\{P_VAL\\}\\}");
escape = escape.replace(/PT_VAL/g, "\\{\\{P_VAL\\}\\}");
- escape = escape.replace(/P_VAL/g, "(?:f?[xX] = )?(-?\\d+\\.?\\d*e?-?\\d*),(?: f?[yY] = )?(-?\\d+\\.?\\d*e?-?\\d*)");
- escape = escape.replace(/T_VAL/g, "(-?\\d+\\.?\\d*e?-?\\d*)");
+ escape = escape.replace(/P_VAL/g, "(?:f?[xX] = )?(-?\\d+\\.?\\d*(?:e-?\\d+)?),(?: f?[yY] = )?(-?\\d+\\.?\\d*(?:e-?\\d+)?)");
+ escape = escape.replace(/T_VAL/g, "(-?\\d+\\.?\\d*(?:e-?\\d+)?)");
escape = escape.replace(/IDX/g, "(\\d+)");
escape = escape.replace(/NUM/g, "(-?\\d+)");
escape = escape.replace(/OPT/g, "(\\?|-?\\d+)");
diff --git a/experimental/Intersection/op.htm b/experimental/Intersection/op.htm
index 9059e1fc0c..75dd92e6a9 100644
--- a/experimental/Intersection/op.htm
+++ b/experimental/Intersection/op.htm
@@ -4051,11 +4051,35 @@ path.addRect(4, 13, 13, 16, SkPath::kCCW_Direction);
pathB.close();
</div>
+<div id="cubicOp62d">
+ path.setFillType(SkPath::kWinding_FillType);
+ path.moveTo(1,3);
+ path.cubicTo(5,6, 5,3, 5,4);
+ path.close();
+ pathB.setFillType(SkPath::kWinding_FillType);
+ pathB.moveTo(3,5);
+ pathB.cubicTo(4,5, 3,1, 6,5);
+ pathB.close();
+</div>
+
+<div id="cubicOp63d">
+ path.setFillType(SkPath::kWinding_FillType);
+ path.moveTo(2,3);
+ path.cubicTo(0,4, 3,2, 5,3);
+ path.close();
+ pathB.setFillType(SkPath::kWinding_FillType);
+ pathB.moveTo(2,3);
+ pathB.cubicTo(3,5, 3,2, 4,0);
+ pathB.close();
+</div>
+
</div>
<script type="text/javascript">
var testDivs = [
+ cubicOp63d,
+ cubicOp62d,
cubicOp61d,
cubicOp60d,
cubicOp59d,