blob: 392d6926117eeb680cf31a9baad1e6fbe8fd2da5 [file] [log] [blame]
caryclarkdac1d172014-06-17 05:15:38 -07001<html>
2<head>
3<div height="0" hidden="true">
Cary Clark7eb01e02016-12-08 14:36:32 -05004
Cary Clarkff114282016-12-14 11:56:16 -05005Skia UnitTests: --match PathOpsOp$ --resourcePath resources\ -v -V SK_DEBUG
Cary Clark7eb01e02016-12-08 14:36:32 -05006
Cary Clarkff114282016-12-14 11:56:16 -05007<div id="skpeldorado_com_ua1_working">
Cary Clark7eb01e02016-12-08 14:36:32 -05008SkDCubic::ComplexBreak
Cary Clarkff114282016-12-14 11:56:16 -05009{{{1006.69512939453125, 291}, {1023.263671875, 291}, {1033.8402099609375, 304.43145751953125}, {1030.318359375, 321}}},
10maxCurvature[0]=0.474344964 {{{998.1828178832590766, 267.6895845341347808}, {1052.542975701327805, 330.2457181562319306}}},
Cary Clark7eb01e02016-12-08 14:36:32 -050011SkDCubic::ComplexBreak
Cary Clarkff114282016-12-14 11:56:16 -050012{{{259.30487060546875, 561}, {242.7363128662109375, 561}, {232.1598052978515625, 547.56854248046875}, {235.681549072265625, 531}}},
13maxCurvature[0]=0.474343429 {{{267.8173432015576623, 584.3103847404762519}, {213.4569259608067568, 521.7544086132262464}}},
14seg=1 {{{286.695129f, 291}, {229.304855f, 561}}}
15seg=2 {{{229.304855f, 561}, {979.304871f, 561}}}
16seg=3 {{{979.304871f, 561}, {1036.69507f, 291}}}
17seg=4 {{{1036.69507f, 291}, {286.695129f, 291}}}
18op sect
19seg=5 {{{1006.69513f, 291}, {1023.26367f, 291}, {1033.84021f, 304.431458f}, {1030.31836f, 321}}}
20seg=6 {{{1030.31836f, 321}, {985.681519f, 531}}}
21seg=7 {{{985.681519f, 531}, {982.15979f, 547.568542f}, {965.873413f, 561}, {949.304871f, 561}}}
22seg=8 {{{949.304871f, 561}, {259.304871f, 561}}}
23seg=9 {{{259.304871f, 561}, {242.736313f, 561}, {232.159805f, 547.568542f}, {235.681549f, 531}}}
24seg=10 {{{235.681549f, 531}, {280.31842f, 321}}}
25seg=11 {{{280.31842f, 321}, {283.840179f, 304.431458f}, {300.126587f, 291}, {316.695129f, 291}}}
26seg=12 {{{316.695129f, 291}, {1006.69513f, 291}}}
27debugShowLineIntersection wtTs[0]=1 {{{286.695129,291}, {229.304855,561}}} {{229.304855,561}} wnTs[0]=0 {{{229.304855,561}, {979.304871,561}}}
28debugShowLineIntersection wtTs[0]=0 {{{286.695129,291}, {229.304855,561}}} {{286.695129,291}} wnTs[0]=1 {{{1036.69507,291}, {286.695129,291}}}
29debugShowLineIntersection wtTs[0]=0 {{{979.304871,561}, {1036.69507,291}}} {{979.304871,561}} wnTs[0]=1 {{{229.304855,561}, {979.304871,561}}}
30debugShowLineIntersection wtTs[0]=1 {{{979.304871,561}, {1036.69507,291}}} {{1036.69507,291}} wnTs[0]=0 {{{1036.69507,291}, {286.695129,291}}}
31debugShowLineIntersection no intersect {{{286.695129,291}, {229.304855,561}}} {{{949.304871,561}, {259.304871,561}}}
32debugShowCubicLineIntersection wtTs[0]=0.999710227 {{{259.304871,561}, {242.736313,561}, {232.159805,547.568542}, {235.681549,531}}} {{235.678497,531.014404}} wtTs[1]=1 {{235.681549,531}} wnTs[0]=0.888942 {{{286.695129,291}, {229.304855,561}}} wnTs[1]=0.888888891
33SkOpSegment::addT insert t=0.888942232 segID=1 spanID=25
34SkOpSegment::addT insert t=0.999710227 segID=9 spanID=26
35SkOpSegment::addT insert t=0.888888891 segID=1 spanID=27
36debugShowLineIntersection wtTs[0]=0.11111112 {{{286.695129,291}, {229.304855,561}}} {{280.31842,321}} wtTs[1]=0.888888891 {{235.681549,531}} wnTs[0]=1 {{{235.681549,531}, {280.31842,321}}} wnTs[1]=0
37SkOpSegment::addT insert t=0.11111112 segID=1 spanID=28
38debugShowCubicLineIntersection wtTs[0]=0 {{{280.31842,321}, {283.840179,304.431458}, {300.126587,291}, {316.695129,291}}} {{280.31842,321}} wtTs[1]=0.000542504226 {{280.324158,320.973022}} wnTs[0]=0.111111 {{{286.695129,291}, {229.304855,561}}} wnTs[1]=0.111011249
39SkOpSegment::addT insert t=0.111011249 segID=1 spanID=29
40SkOpSegment::addT insert t=0.000542504226 segID=11 spanID=30
41debugShowCubicLineIntersection wtTs[0]=1 {{{985.681519,531}, {982.15979,547.568542}, {965.873413,561}, {949.304871,561}}} {{949.304871,561}} wnTs[0]=0.96 {{{229.304855,561}, {979.304871,561}}}
42SkOpSegment::addT insert t=0.960000001 segID=2 spanID=31
43debugShowLineIntersection wtTs[0]=0 {{{949.304871,561}, {259.304871,561}}} {{949.304871,561}} wtTs[1]=1 {{259.304871,561}} wnTs[0]=0.96 {{{229.304855,561}, {979.304871,561}}} wnTs[1]=0.0400000195
44SkOpSegment::addT insert t=0.0400000195 segID=2 spanID=32
45debugShowCubicLineIntersection wtTs[0]=0 {{{259.304871,561}, {242.736313,561}, {232.159805,547.568542}, {235.681549,531}}} {{259.304871,561}} wnTs[0]=0.04 {{{229.304855,561}, {979.304871,561}}}
46debugShowCubicLineIntersection wtTs[0]=1 {{{1006.69513,291}, {1023.26367,291}, {1033.84021,304.431458}, {1030.31836,321}}} {{1030.31836,321}} wnTs[0]=0.888889 {{{979.304871,561}, {1036.69507,291}}}
47SkOpSegment::addT insert t=0.888888874 segID=3 spanID=33
48debugShowLineIntersection wtTs[0]=0.11111108 {{{979.304871,561}, {1036.69507,291}}} {{985.681519,531}} wtTs[1]=0.888888874 {{1030.31836,321}} wnTs[0]=1 {{{1030.31836,321}, {985.681519,531}}} wnTs[1]=0
49SkOpSegment::addT insert t=0.11111108 segID=3 spanID=34
50debugShowCubicLineIntersection wtTs[0]=0 {{{985.681519,531}, {982.15979,547.568542}, {965.873413,561}, {949.304871,561}}} {{985.681519,531}} wnTs[0]=0.111111 {{{979.304871,561}, {1036.69507,291}}}
51debugShowLineIntersection no intersect {{{979.304871,561}, {1036.69507,291}}} {{{316.695129,291}, {1006.69513,291}}}
52debugShowCubicLineIntersection wtTs[0]=0 {{{1006.69513,291}, {1023.26367,291}, {1033.84021,304.431458}, {1030.31836,321}}} {{1006.69513,291}} wnTs[0]=0.0399999 {{{1036.69507,291}, {286.695129,291}}}
53SkOpSegment::addT insert t=0.0399999219 segID=4 spanID=35
54debugShowCubicLineIntersection wtTs[0]=1 {{{280.31842,321}, {283.840179,304.431458}, {300.126587,291}, {316.695129,291}}} {{316.695129,291}} wnTs[0]=0.96 {{{1036.69507,291}, {286.695129,291}}}
55SkOpSegment::addT insert t=0.959999997 segID=4 spanID=36
56debugShowLineIntersection wtTs[0]=0 {{{316.695129,291}, {1006.69513,291}}} {{316.695129,291}} wtTs[1]=1 {{1006.69513,291}} wnTs[0]=0.96 {{{1036.69507,291}, {286.695129,291}}} wnTs[1]=0.0399999219
57debugShowCubicLineIntersection wtTs[0]=1 {{{1006.69513,291}, {1023.26367,291}, {1033.84021,304.431458}, {1030.31836,321}}} {{1030.31836,321}} wnTs[0]=0 {{{1030.31836,321}, {985.681519,531}}}
58debugShowCubicLineIntersection wtTs[0]=0 {{{1006.69513,291}, {1023.26367,291}, {1033.84021,304.431458}, {1030.31836,321}}} {{1006.69513,291}} wnTs[0]=1 {{{316.695129,291}, {1006.69513,291}}}
59debugShowCubicLineIntersection wtTs[0]=0 {{{985.681519,531}, {982.15979,547.568542}, {965.873413,561}, {949.304871,561}}} {{985.681519,531}} wnTs[0]=1 {{{1030.31836,321}, {985.681519,531}}}
60debugShowCubicLineIntersection wtTs[0]=1 {{{985.681519,531}, {982.15979,547.568542}, {965.873413,561}, {949.304871,561}}} {{949.304871,561}} wnTs[0]=0 {{{949.304871,561}, {259.304871,561}}}
61debugShowCubicLineIntersection wtTs[0]=0 {{{259.304871,561}, {242.736313,561}, {232.159805,547.568542}, {235.681549,531}}} {{259.304871,561}} wnTs[0]=1 {{{949.304871,561}, {259.304871,561}}}
62debugShowCubicLineIntersection wtTs[0]=1 {{{259.304871,561}, {242.736313,561}, {232.159805,547.568542}, {235.681549,531}}} {{235.681549,531}} wnTs[0]=0 {{{235.681549,531}, {280.31842,321}}}
63debugShowCubicLineIntersection wtTs[0]=0 {{{280.31842,321}, {283.840179,304.431458}, {300.126587,291}, {316.695129,291}}} {{280.31842,321}} wnTs[0]=1 {{{235.681549,531}, {280.31842,321}}}
64debugShowCubicLineIntersection wtTs[0]=1 {{{280.31842,321}, {283.840179,304.431458}, {300.126587,291}, {316.695129,291}}} {{316.695129,291}} wnTs[0]=0 {{{316.695129,291}, {1006.69513,291}}}
65-----------------xx--x---------------- addExpanded
6600: coinSeg/Span/PtT=12/23/23 endSpan=24 Fail
6701: coinSeg/Span/PtT=3/34/34 endSpan=33 Fail
6802: coinSeg/Span/PtT=2/32/32 endSpan=31 Fail
6903: coinSeg/Span/PtT=1/29/29 endSpan=28 Fail
7004: coinSeg/Span/PtT=10/19/19 endSpan=20 Fail
7105: coinSeg/Span/PtT=1/27/27 endSpan=25 Fail
7206: seg/base=12/23 seg/base=4/35 MarkCoinStart
7307: seg/base=12/24 seg/base=4/36 MarkCoinEnd
7408: seg/base=3/34 seg/base=6/11 MarkCoinStart
7509: seg/base=3/33 seg/base=6/12 MarkCoinEnd
7610: seg/base=2/32 seg/base=8/15 MarkCoinStart
7711: seg/base=2/31 seg/base=8/16 MarkCoinEnd
7812: seg/base=1/29 seg/base=11/21 MarkCoinStart
7913: seg/base=1/28 seg/base=11/30 MarkCoinEnd
8014: seg/base=10/19 seg/base=1/28 MarkCoinStart
8115: seg/base=10/20 seg/base=1/27 MarkCoinEnd
8216: seg/base=1/27 seg/base=9/26 MarkCoinStart
8317: seg/base=1/25 seg/base=9/18 MarkCoinEnd
84SkOpSegment::debugShowActiveSpans id=1 (286.695129,291 280.324158,320.973022) t=0 tEnd=0.111011249 windSum=? windValue=1
85SkOpSegment::debugShowActiveSpans id=1 (280.324158,320.973022 280.31842,321) t=0.111011249 tEnd=0.11111112 windSum=? windValue=1
86SkOpSegment::debugShowActiveSpans id=1 (280.31842,321 235.681549,531) t=0.11111112 tEnd=0.888888891 windSum=? windValue=1
87SkOpSegment::debugShowActiveSpans id=1 (235.681549,531 235.678497,531.014404) t=0.888888891 tEnd=0.888942232 windSum=? windValue=1
88SkOpSegment::debugShowActiveSpans id=1 (235.678497,531.014404 229.304855,561) t=0.888942232 tEnd=1 windSum=? windValue=1
89SkOpSegment::debugShowActiveSpans id=2 (229.304855,561 259.304871,561) t=0 tEnd=0.0400000195 windSum=? windValue=1
90SkOpSegment::debugShowActiveSpans id=2 (259.304871,561 949.304871,561) t=0.0400000195 tEnd=0.960000001 windSum=? windValue=1
91SkOpSegment::debugShowActiveSpans id=2 (949.304871,561 979.304871,561) t=0.960000001 tEnd=1 windSum=? windValue=1
92SkOpSegment::debugShowActiveSpans id=3 (979.304871,561 985.68158,531) t=0 tEnd=0.11111108 windSum=? windValue=1
93SkOpSegment::debugShowActiveSpans id=3 (985.68158,531 1030.31836,321) t=0.11111108 tEnd=0.888888874 windSum=? windValue=1
94SkOpSegment::debugShowActiveSpans id=3 (1030.31836,321 1036.69507,291) t=0.888888874 tEnd=1 windSum=? windValue=1
95SkOpSegment::debugShowActiveSpans id=4 (1036.69507,291 1006.69513,291) t=0 tEnd=0.0399999219 windSum=? windValue=1
96SkOpSegment::debugShowActiveSpans id=4 (1006.69513,291 316.695129,291) t=0.0399999219 tEnd=0.959999997 windSum=? windValue=1
97SkOpSegment::debugShowActiveSpans id=4 (316.695129,291 286.695129,291) t=0.959999997 tEnd=1 windSum=? windValue=1
98SkOpSegment::debugShowActiveSpans id=5 (1006.69513,291 1023.26367,291 1033.84021,304.431458 1030.31836,321) t=0 tEnd=1 windSum=? windValue=1
99SkOpSegment::debugShowActiveSpans id=6 (1030.31836,321 985.681519,531) t=0 tEnd=1 windSum=? windValue=1
100SkOpSegment::debugShowActiveSpans id=7 (985.681519,531 982.15979,547.568542 965.873413,561 949.304871,561) t=0 tEnd=1 windSum=? windValue=1
101SkOpSegment::debugShowActiveSpans id=8 (949.304871,561 259.304871,561) t=0 tEnd=1 windSum=? windValue=1
102SkOpSegment::debugShowActiveSpans id=9 (259.304871,561 242.741114,561 232.165942,547.576327 235.678497,531.014404) t=0 tEnd=0.999710227 windSum=? windValue=1
103SkOpSegment::debugShowActiveSpans id=9 (235.678497,531.014404 235.679515,531.009604 235.680529,531.004801 235.681549,531) t=0.999710227 tEnd=1 windSum=? windValue=1
104SkOpSegment::debugShowActiveSpans id=10 (235.681549,531 280.31842,321) t=0 tEnd=1 windSum=? windValue=1
105SkOpSegment::debugShowActiveSpans id=11 (280.31842,321 280.320331,320.991011 280.32224,320.982009 280.324158,320.973022) t=0 tEnd=0.000542504226 windSum=? windValue=1
106SkOpSegment::debugShowActiveSpans id=11 (280.324158,320.973022 283.857845,304.416873 300.135575,291 316.695129,291) t=0.000542504226 tEnd=1 windSum=? windValue=1
107SkOpSegment::debugShowActiveSpans id=12 (316.695129,291 1006.69513,291) t=0 tEnd=1 windSum=? windValue=1
108-----------------xx--x---------------- move_multiples
10900: coinSeg/Span/PtT=12/23/23 endSpan=24 Fail
11001: coinSeg/Span/PtT=3/34/34 endSpan=33 Fail
11102: coinSeg/Span/PtT=2/32/32 endSpan=31 Fail
11203: coinSeg/Span/PtT=1/29/29 endSpan=28 Fail
11304: coinSeg/Span/PtT=10/19/19 endSpan=20 Fail
11405: coinSeg/Span/PtT=1/27/27 endSpan=25 Fail
11506: seg/base=12/23 seg/base=4/35 MarkCoinStart
11607: seg/base=12/24 seg/base=4/36 MarkCoinEnd
11708: seg/base=3/34 seg/base=6/11 MarkCoinStart
11809: seg/base=3/33 seg/base=6/12 MarkCoinEnd
11910: seg/base=2/32 seg/base=8/15 MarkCoinStart
12011: seg/base=2/31 seg/base=8/16 MarkCoinEnd
12112: seg/base=1/29 seg/base=11/21 MarkCoinStart
12213: seg/base=1/28 seg/base=11/30 MarkCoinEnd
12314: seg/base=10/19 seg/base=1/28 MarkCoinStart
12415: seg/base=10/20 seg/base=1/27 MarkCoinEnd
12516: seg/base=1/27 seg/base=9/26 MarkCoinStart
12617: seg/base=1/25 seg/base=9/18 MarkCoinEnd
127SkOpSegment::debugShowActiveSpans id=1 (286.695129,291 280.324158,320.973022) t=0 tEnd=0.111011249 windSum=? windValue=1
128SkOpSegment::debugShowActiveSpans id=1 (280.324158,320.973022 280.31842,321) t=0.111011249 tEnd=0.11111112 windSum=? windValue=1
129SkOpSegment::debugShowActiveSpans id=1 (280.31842,321 235.681549,531) t=0.11111112 tEnd=0.888888891 windSum=? windValue=1
130SkOpSegment::debugShowActiveSpans id=1 (235.681549,531 235.678497,531.014404) t=0.888888891 tEnd=0.888942232 windSum=? windValue=1
131SkOpSegment::debugShowActiveSpans id=1 (235.678497,531.014404 229.304855,561) t=0.888942232 tEnd=1 windSum=? windValue=1
132SkOpSegment::debugShowActiveSpans id=2 (229.304855,561 259.304871,561) t=0 tEnd=0.0400000195 windSum=? windValue=1
133SkOpSegment::debugShowActiveSpans id=2 (259.304871,561 949.304871,561) t=0.0400000195 tEnd=0.960000001 windSum=? windValue=1
134SkOpSegment::debugShowActiveSpans id=2 (949.304871,561 979.304871,561) t=0.960000001 tEnd=1 windSum=? windValue=1
135SkOpSegment::debugShowActiveSpans id=3 (979.304871,561 985.68158,531) t=0 tEnd=0.11111108 windSum=? windValue=1
136SkOpSegment::debugShowActiveSpans id=3 (985.68158,531 1030.31836,321) t=0.11111108 tEnd=0.888888874 windSum=? windValue=1
137SkOpSegment::debugShowActiveSpans id=3 (1030.31836,321 1036.69507,291) t=0.888888874 tEnd=1 windSum=? windValue=1
138SkOpSegment::debugShowActiveSpans id=4 (1036.69507,291 1006.69513,291) t=0 tEnd=0.0399999219 windSum=? windValue=1
139SkOpSegment::debugShowActiveSpans id=4 (1006.69513,291 316.695129,291) t=0.0399999219 tEnd=0.959999997 windSum=? windValue=1
140SkOpSegment::debugShowActiveSpans id=4 (316.695129,291 286.695129,291) t=0.959999997 tEnd=1 windSum=? windValue=1
141SkOpSegment::debugShowActiveSpans id=5 (1006.69513,291 1023.26367,291 1033.84021,304.431458 1030.31836,321) t=0 tEnd=1 windSum=? windValue=1
142SkOpSegment::debugShowActiveSpans id=6 (1030.31836,321 985.681519,531) t=0 tEnd=1 windSum=? windValue=1
143SkOpSegment::debugShowActiveSpans id=7 (985.681519,531 982.15979,547.568542 965.873413,561 949.304871,561) t=0 tEnd=1 windSum=? windValue=1
144SkOpSegment::debugShowActiveSpans id=8 (949.304871,561 259.304871,561) t=0 tEnd=1 windSum=? windValue=1
145SkOpSegment::debugShowActiveSpans id=9 (259.304871,561 242.741114,561 232.165942,547.576327 235.678497,531.014404) t=0 tEnd=0.999710227 windSum=? windValue=1
146SkOpSegment::debugShowActiveSpans id=9 (235.678497,531.014404 235.679515,531.009604 235.680529,531.004801 235.681549,531) t=0.999710227 tEnd=1 windSum=? windValue=1
147SkOpSegment::debugShowActiveSpans id=10 (235.681549,531 280.31842,321) t=0 tEnd=1 windSum=? windValue=1
148SkOpSegment::debugShowActiveSpans id=11 (280.31842,321 280.320331,320.991011 280.32224,320.982009 280.324158,320.973022) t=0 tEnd=0.000542504226 windSum=? windValue=1
149SkOpSegment::debugShowActiveSpans id=11 (280.324158,320.973022 283.857845,304.416873 300.135575,291 316.695129,291) t=0.000542504226 tEnd=1 windSum=? windValue=1
150SkOpSegment::debugShowActiveSpans id=12 (316.695129,291 1006.69513,291) t=0 tEnd=1 windSum=? windValue=1
151-----------------xx--x---------------- move_nearby
15200: coinSeg/Span/PtT=12/23/23 endSpan=24 Fail
15301: coinSeg/Span/PtT=3/34/34 endSpan=33 Fail
15402: coinSeg/Span/PtT=2/32/32 endSpan=31 Fail
15503: coinSeg/Span/PtT=1/29/29 endSpan=28 Fail
15604: coinSeg/Span/PtT=10/19/19 endSpan=20 Fail
15705: coinSeg/Span/PtT=1/27/27 endSpan=25 Fail
15806: seg/base=12/23 seg/base=4/35 MarkCoinStart
15907: seg/base=12/24 seg/base=4/36 MarkCoinEnd
16008: seg/base=3/34 seg/base=6/11 MarkCoinStart
16109: seg/base=3/33 seg/base=6/12 MarkCoinEnd
16210: seg/base=2/32 seg/base=8/15 MarkCoinStart
16311: seg/base=2/31 seg/base=8/16 MarkCoinEnd
16412: seg/base=1/29 seg/base=11/21 MarkCoinStart
16513: seg/base=1/28 seg/base=11/30 MarkCoinEnd
16614: seg/base=10/19 seg/base=1/28 MarkCoinStart
16715: seg/base=10/20 seg/base=1/27 MarkCoinEnd
16816: seg/base=1/27 seg/base=9/26 MarkCoinStart
16917: seg/base=1/25 seg/base=9/18 MarkCoinEnd
170SkOpSegment::debugShowActiveSpans id=1 (286.695129,291 280.324158,320.973022) t=0 tEnd=0.111011249 windSum=? windValue=1
171SkOpSegment::debugShowActiveSpans id=1 (280.324158,320.973022 280.31842,321) t=0.111011249 tEnd=0.11111112 windSum=? windValue=1
172SkOpSegment::debugShowActiveSpans id=1 (280.31842,321 235.681549,531) t=0.11111112 tEnd=0.888888891 windSum=? windValue=1
173SkOpSegment::debugShowActiveSpans id=1 (235.681549,531 235.678497,531.014404) t=0.888888891 tEnd=0.888942232 windSum=? windValue=1
174SkOpSegment::debugShowActiveSpans id=1 (235.678497,531.014404 229.304855,561) t=0.888942232 tEnd=1 windSum=? windValue=1
175SkOpSegment::debugShowActiveSpans id=2 (229.304855,561 259.304871,561) t=0 tEnd=0.0400000195 windSum=? windValue=1
176SkOpSegment::debugShowActiveSpans id=2 (259.304871,561 949.304871,561) t=0.0400000195 tEnd=0.960000001 windSum=? windValue=1
177SkOpSegment::debugShowActiveSpans id=2 (949.304871,561 979.304871,561) t=0.960000001 tEnd=1 windSum=? windValue=1
178SkOpSegment::debugShowActiveSpans id=3 (979.304871,561 985.68158,531) t=0 tEnd=0.11111108 windSum=? windValue=1
179SkOpSegment::debugShowActiveSpans id=3 (985.68158,531 1030.31836,321) t=0.11111108 tEnd=0.888888874 windSum=? windValue=1
180SkOpSegment::debugShowActiveSpans id=3 (1030.31836,321 1036.69507,291) t=0.888888874 tEnd=1 windSum=? windValue=1
181SkOpSegment::debugShowActiveSpans id=4 (1036.69507,291 1006.69513,291) t=0 tEnd=0.0399999219 windSum=? windValue=1
182SkOpSegment::debugShowActiveSpans id=4 (1006.69513,291 316.695129,291) t=0.0399999219 tEnd=0.959999997 windSum=? windValue=1
183SkOpSegment::debugShowActiveSpans id=4 (316.695129,291 286.695129,291) t=0.959999997 tEnd=1 windSum=? windValue=1
184SkOpSegment::debugShowActiveSpans id=5 (1006.69513,291 1023.26367,291 1033.84021,304.431458 1030.31836,321) t=0 tEnd=1 windSum=? windValue=1
185SkOpSegment::debugShowActiveSpans id=6 (1030.31836,321 985.681519,531) t=0 tEnd=1 windSum=? windValue=1
186SkOpSegment::debugShowActiveSpans id=7 (985.681519,531 982.15979,547.568542 965.873413,561 949.304871,561) t=0 tEnd=1 windSum=? windValue=1
187SkOpSegment::debugShowActiveSpans id=8 (949.304871,561 259.304871,561) t=0 tEnd=1 windSum=? windValue=1
188SkOpSegment::debugShowActiveSpans id=9 (259.304871,561 242.741114,561 232.165942,547.576327 235.678497,531.014404) t=0 tEnd=0.999710227 windSum=? windValue=1
189SkOpSegment::debugShowActiveSpans id=9 (235.678497,531.014404 235.679515,531.009604 235.680529,531.004801 235.681549,531) t=0.999710227 tEnd=1 windSum=? windValue=1
190SkOpSegment::debugShowActiveSpans id=10 (235.681549,531 280.31842,321) t=0 tEnd=1 windSum=? windValue=1
191SkOpSegment::debugShowActiveSpans id=11 (280.31842,321 280.320331,320.991011 280.32224,320.982009 280.324158,320.973022) t=0 tEnd=0.000542504226 windSum=? windValue=1
192SkOpSegment::debugShowActiveSpans id=11 (280.324158,320.973022 283.857845,304.416873 300.135575,291 316.695129,291) t=0.000542504226 tEnd=1 windSum=? windValue=1
193SkOpSegment::debugShowActiveSpans id=12 (316.695129,291 1006.69513,291) t=0 tEnd=1 windSum=? windValue=1
194-----------------xx--x---------------- correctEnds
19500: coinSeg/Span/PtT=12/23/23 endSpan=24 Fail
19601: coinSeg/Span/PtT=3/34/34 endSpan=33 Fail
19702: coinSeg/Span/PtT=2/32/32 endSpan=31 Fail
19803: coinSeg/Span/PtT=1/29/29 endSpan=28 Fail
19904: coinSeg/Span/PtT=10/19/19 endSpan=20 Fail
20005: coinSeg/Span/PtT=1/27/27 endSpan=25 Fail
20106: seg/base=12/23 seg/base=4/35 MarkCoinStart
20207: seg/base=12/24 seg/base=4/36 MarkCoinEnd
20308: seg/base=3/34 seg/base=6/11 MarkCoinStart
20409: seg/base=3/33 seg/base=6/12 MarkCoinEnd
20510: seg/base=2/32 seg/base=8/15 MarkCoinStart
20611: seg/base=2/31 seg/base=8/16 MarkCoinEnd
20712: seg/base=1/29 seg/base=11/21 MarkCoinStart
20813: seg/base=1/28 seg/base=11/30 MarkCoinEnd
20914: seg/base=10/19 seg/base=1/28 MarkCoinStart
21015: seg/base=10/20 seg/base=1/27 MarkCoinEnd
21116: seg/base=1/27 seg/base=9/26 MarkCoinStart
21217: seg/base=1/25 seg/base=9/18 MarkCoinEnd
213SkOpSegment::debugShowActiveSpans id=1 (286.695129,291 280.324158,320.973022) t=0 tEnd=0.111011249 windSum=? windValue=1
214SkOpSegment::debugShowActiveSpans id=1 (280.324158,320.973022 280.31842,321) t=0.111011249 tEnd=0.11111112 windSum=? windValue=1
215SkOpSegment::debugShowActiveSpans id=1 (280.31842,321 235.681549,531) t=0.11111112 tEnd=0.888888891 windSum=? windValue=1
216SkOpSegment::debugShowActiveSpans id=1 (235.681549,531 235.678497,531.014404) t=0.888888891 tEnd=0.888942232 windSum=? windValue=1
217SkOpSegment::debugShowActiveSpans id=1 (235.678497,531.014404 229.304855,561) t=0.888942232 tEnd=1 windSum=? windValue=1
218SkOpSegment::debugShowActiveSpans id=2 (229.304855,561 259.304871,561) t=0 tEnd=0.0400000195 windSum=? windValue=1
219SkOpSegment::debugShowActiveSpans id=2 (259.304871,561 949.304871,561) t=0.0400000195 tEnd=0.960000001 windSum=? windValue=1
220SkOpSegment::debugShowActiveSpans id=2 (949.304871,561 979.304871,561) t=0.960000001 tEnd=1 windSum=? windValue=1
221SkOpSegment::debugShowActiveSpans id=3 (979.304871,561 985.68158,531) t=0 tEnd=0.11111108 windSum=? windValue=1
222SkOpSegment::debugShowActiveSpans id=3 (985.68158,531 1030.31836,321) t=0.11111108 tEnd=0.888888874 windSum=? windValue=1
223SkOpSegment::debugShowActiveSpans id=3 (1030.31836,321 1036.69507,291) t=0.888888874 tEnd=1 windSum=? windValue=1
224SkOpSegment::debugShowActiveSpans id=4 (1036.69507,291 1006.69513,291) t=0 tEnd=0.0399999219 windSum=? windValue=1
225SkOpSegment::debugShowActiveSpans id=4 (1006.69513,291 316.695129,291) t=0.0399999219 tEnd=0.959999997 windSum=? windValue=1
226SkOpSegment::debugShowActiveSpans id=4 (316.695129,291 286.695129,291) t=0.959999997 tEnd=1 windSum=? windValue=1
227SkOpSegment::debugShowActiveSpans id=5 (1006.69513,291 1023.26367,291 1033.84021,304.431458 1030.31836,321) t=0 tEnd=1 windSum=? windValue=1
228SkOpSegment::debugShowActiveSpans id=6 (1030.31836,321 985.681519,531) t=0 tEnd=1 windSum=? windValue=1
229SkOpSegment::debugShowActiveSpans id=7 (985.681519,531 982.15979,547.568542 965.873413,561 949.304871,561) t=0 tEnd=1 windSum=? windValue=1
230SkOpSegment::debugShowActiveSpans id=8 (949.304871,561 259.304871,561) t=0 tEnd=1 windSum=? windValue=1
231SkOpSegment::debugShowActiveSpans id=9 (259.304871,561 242.741114,561 232.165942,547.576327 235.678497,531.014404) t=0 tEnd=0.999710227 windSum=? windValue=1
232SkOpSegment::debugShowActiveSpans id=9 (235.678497,531.014404 235.679515,531.009604 235.680529,531.004801 235.681549,531) t=0.999710227 tEnd=1 windSum=? windValue=1
233SkOpSegment::debugShowActiveSpans id=10 (235.681549,531 280.31842,321) t=0 tEnd=1 windSum=? windValue=1
234SkOpSegment::debugShowActiveSpans id=11 (280.31842,321 280.320331,320.991011 280.32224,320.982009 280.324158,320.973022) t=0 tEnd=0.000542504226 windSum=? windValue=1
235SkOpSegment::debugShowActiveSpans id=11 (280.324158,320.973022 283.857845,304.416873 300.135575,291 316.695129,291) t=0.000542504226 tEnd=1 windSum=? windValue=1
236SkOpSegment::debugShowActiveSpans id=12 (316.695129,291 1006.69513,291) t=0 tEnd=1 windSum=? windValue=1
237-----------------xx--x---------------- addEndMovedSpans
23800: coinSeg/Span/PtT=12/23/23 endSpan=24 Fail
23901: coinSeg/Span/PtT=3/34/34 endSpan=33 Fail
24002: coinSeg/Span/PtT=2/32/32 endSpan=31 Fail
24103: coinSeg/Span/PtT=1/29/29 endSpan=28 Fail
24204: coinSeg/Span/PtT=10/19/19 endSpan=20 Fail
24305: coinSeg/Span/PtT=1/27/27 endSpan=25 Fail
24406: seg/base=12/23 seg/base=4/35 MarkCoinStart
24507: seg/base=12/24 seg/base=4/36 MarkCoinEnd
24608: seg/base=3/34 seg/base=6/11 MarkCoinStart
24709: seg/base=3/33 seg/base=6/12 MarkCoinEnd
24810: seg/base=2/32 seg/base=8/15 MarkCoinStart
24911: seg/base=2/31 seg/base=8/16 MarkCoinEnd
25012: seg/base=1/29 seg/base=11/21 MarkCoinStart
25113: seg/base=1/28 seg/base=11/30 MarkCoinEnd
25214: seg/base=10/19 seg/base=1/28 MarkCoinStart
25315: seg/base=10/20 seg/base=1/27 MarkCoinEnd
25416: seg/base=1/27 seg/base=9/26 MarkCoinStart
25517: seg/base=1/25 seg/base=9/18 MarkCoinEnd
256SkOpSegment::debugShowActiveSpans id=1 (286.695129,291 280.324158,320.973022) t=0 tEnd=0.111011249 windSum=? windValue=1
257SkOpSegment::debugShowActiveSpans id=1 (280.324158,320.973022 280.31842,321) t=0.111011249 tEnd=0.11111112 windSum=? windValue=1
258SkOpSegment::debugShowActiveSpans id=1 (280.31842,321 235.681549,531) t=0.11111112 tEnd=0.888888891 windSum=? windValue=1
259SkOpSegment::debugShowActiveSpans id=1 (235.681549,531 235.678497,531.014404) t=0.888888891 tEnd=0.888942232 windSum=? windValue=1
260SkOpSegment::debugShowActiveSpans id=1 (235.678497,531.014404 229.304855,561) t=0.888942232 tEnd=1 windSum=? windValue=1
261SkOpSegment::debugShowActiveSpans id=2 (229.304855,561 259.304871,561) t=0 tEnd=0.0400000195 windSum=? windValue=1
262SkOpSegment::debugShowActiveSpans id=2 (259.304871,561 949.304871,561) t=0.0400000195 tEnd=0.960000001 windSum=? windValue=1
263SkOpSegment::debugShowActiveSpans id=2 (949.304871,561 979.304871,561) t=0.960000001 tEnd=1 windSum=? windValue=1
264SkOpSegment::debugShowActiveSpans id=3 (979.304871,561 985.68158,531) t=0 tEnd=0.11111108 windSum=? windValue=1
265SkOpSegment::debugShowActiveSpans id=3 (985.68158,531 1030.31836,321) t=0.11111108 tEnd=0.888888874 windSum=? windValue=1
266SkOpSegment::debugShowActiveSpans id=3 (1030.31836,321 1036.69507,291) t=0.888888874 tEnd=1 windSum=? windValue=1
267SkOpSegment::debugShowActiveSpans id=4 (1036.69507,291 1006.69513,291) t=0 tEnd=0.0399999219 windSum=? windValue=1
268SkOpSegment::debugShowActiveSpans id=4 (1006.69513,291 316.695129,291) t=0.0399999219 tEnd=0.959999997 windSum=? windValue=1
269SkOpSegment::debugShowActiveSpans id=4 (316.695129,291 286.695129,291) t=0.959999997 tEnd=1 windSum=? windValue=1
270SkOpSegment::debugShowActiveSpans id=5 (1006.69513,291 1023.26367,291 1033.84021,304.431458 1030.31836,321) t=0 tEnd=1 windSum=? windValue=1
271SkOpSegment::debugShowActiveSpans id=6 (1030.31836,321 985.681519,531) t=0 tEnd=1 windSum=? windValue=1
272SkOpSegment::debugShowActiveSpans id=7 (985.681519,531 982.15979,547.568542 965.873413,561 949.304871,561) t=0 tEnd=1 windSum=? windValue=1
273SkOpSegment::debugShowActiveSpans id=8 (949.304871,561 259.304871,561) t=0 tEnd=1 windSum=? windValue=1
274SkOpSegment::debugShowActiveSpans id=9 (259.304871,561 242.741114,561 232.165942,547.576327 235.678497,531.014404) t=0 tEnd=0.999710227 windSum=? windValue=1
275SkOpSegment::debugShowActiveSpans id=9 (235.678497,531.014404 235.679515,531.009604 235.680529,531.004801 235.681549,531) t=0.999710227 tEnd=1 windSum=? windValue=1
276SkOpSegment::debugShowActiveSpans id=10 (235.681549,531 280.31842,321) t=0 tEnd=1 windSum=? windValue=1
277SkOpSegment::debugShowActiveSpans id=11 (280.31842,321 280.320331,320.991011 280.32224,320.982009 280.324158,320.973022) t=0 tEnd=0.000542504226 windSum=? windValue=1
278SkOpSegment::debugShowActiveSpans id=11 (280.324158,320.973022 283.857845,304.416873 300.135575,291 316.695129,291) t=0.000542504226 tEnd=1 windSum=? windValue=1
279SkOpSegment::debugShowActiveSpans id=12 (316.695129,291 1006.69513,291) t=0 tEnd=1 windSum=? windValue=1
280-----------------xx--x---------------- expand
28100: coinSeg/Span/PtT=12/23/23 endSpan=24 Fail
28201: coinSeg/Span/PtT=3/34/34 endSpan=33 Fail
28302: coinSeg/Span/PtT=2/32/32 endSpan=31 Fail
28403: coinSeg/Span/PtT=1/29/29 endSpan=28 Fail
28504: coinSeg/Span/PtT=10/19/19 endSpan=20 Fail
28605: coinSeg/Span/PtT=1/27/27 endSpan=25 Fail
28706: seg/base=12/23 seg/base=4/35 MarkCoinStart
28807: seg/base=12/24 seg/base=4/36 MarkCoinEnd
28908: seg/base=3/34 seg/base=6/11 MarkCoinStart
29009: seg/base=3/33 seg/base=6/12 MarkCoinEnd
29110: seg/base=2/32 seg/base=8/15 MarkCoinStart
29211: seg/base=2/31 seg/base=8/16 MarkCoinEnd
29312: seg/base=1/29 seg/base=11/21 MarkCoinStart
29413: seg/base=1/28 seg/base=11/30 MarkCoinEnd
29514: seg/base=10/19 seg/base=1/28 MarkCoinStart
29615: seg/base=10/20 seg/base=1/27 MarkCoinEnd
29716: seg/base=1/27 seg/base=9/26 MarkCoinStart
29817: seg/base=1/25 seg/base=9/18 MarkCoinEnd
299SkOpSegment::debugShowActiveSpans id=1 (286.695129,291 280.324158,320.973022) t=0 tEnd=0.111011249 windSum=? windValue=1
300SkOpSegment::debugShowActiveSpans id=1 (280.324158,320.973022 280.31842,321) t=0.111011249 tEnd=0.11111112 windSum=? windValue=1
301SkOpSegment::debugShowActiveSpans id=1 (280.31842,321 235.681549,531) t=0.11111112 tEnd=0.888888891 windSum=? windValue=1
302SkOpSegment::debugShowActiveSpans id=1 (235.681549,531 235.678497,531.014404) t=0.888888891 tEnd=0.888942232 windSum=? windValue=1
303SkOpSegment::debugShowActiveSpans id=1 (235.678497,531.014404 229.304855,561) t=0.888942232 tEnd=1 windSum=? windValue=1
304SkOpSegment::debugShowActiveSpans id=2 (229.304855,561 259.304871,561) t=0 tEnd=0.0400000195 windSum=? windValue=1
305SkOpSegment::debugShowActiveSpans id=2 (259.304871,561 949.304871,561) t=0.0400000195 tEnd=0.960000001 windSum=? windValue=1
306SkOpSegment::debugShowActiveSpans id=2 (949.304871,561 979.304871,561) t=0.960000001 tEnd=1 windSum=? windValue=1
307SkOpSegment::debugShowActiveSpans id=3 (979.304871,561 985.68158,531) t=0 tEnd=0.11111108 windSum=? windValue=1
308SkOpSegment::debugShowActiveSpans id=3 (985.68158,531 1030.31836,321) t=0.11111108 tEnd=0.888888874 windSum=? windValue=1
309SkOpSegment::debugShowActiveSpans id=3 (1030.31836,321 1036.69507,291) t=0.888888874 tEnd=1 windSum=? windValue=1
310SkOpSegment::debugShowActiveSpans id=4 (1036.69507,291 1006.69513,291) t=0 tEnd=0.0399999219 windSum=? windValue=1
311SkOpSegment::debugShowActiveSpans id=4 (1006.69513,291 316.695129,291) t=0.0399999219 tEnd=0.959999997 windSum=? windValue=1
312SkOpSegment::debugShowActiveSpans id=4 (316.695129,291 286.695129,291) t=0.959999997 tEnd=1 windSum=? windValue=1
313SkOpSegment::debugShowActiveSpans id=5 (1006.69513,291 1023.26367,291 1033.84021,304.431458 1030.31836,321) t=0 tEnd=1 windSum=? windValue=1
314SkOpSegment::debugShowActiveSpans id=6 (1030.31836,321 985.681519,531) t=0 tEnd=1 windSum=? windValue=1
315SkOpSegment::debugShowActiveSpans id=7 (985.681519,531 982.15979,547.568542 965.873413,561 949.304871,561) t=0 tEnd=1 windSum=? windValue=1
316SkOpSegment::debugShowActiveSpans id=8 (949.304871,561 259.304871,561) t=0 tEnd=1 windSum=? windValue=1
317SkOpSegment::debugShowActiveSpans id=9 (259.304871,561 242.741114,561 232.165942,547.576327 235.678497,531.014404) t=0 tEnd=0.999710227 windSum=? windValue=1
318SkOpSegment::debugShowActiveSpans id=9 (235.678497,531.014404 235.679515,531.009604 235.680529,531.004801 235.681549,531) t=0.999710227 tEnd=1 windSum=? windValue=1
319SkOpSegment::debugShowActiveSpans id=10 (235.681549,531 280.31842,321) t=0 tEnd=1 windSum=? windValue=1
320SkOpSegment::debugShowActiveSpans id=11 (280.31842,321 280.320331,320.991011 280.32224,320.982009 280.324158,320.973022) t=0 tEnd=0.000542504226 windSum=? windValue=1
321SkOpSegment::debugShowActiveSpans id=11 (280.324158,320.973022 283.857845,304.416873 300.135575,291 316.695129,291) t=0.000542504226 tEnd=1 windSum=? windValue=1
322SkOpSegment::debugShowActiveSpans id=12 (316.695129,291 1006.69513,291) t=0 tEnd=1 windSum=? windValue=1
323-----------------xx--x---------------- addExpanded
32400: coinSeg/Span/PtT=12/23/23 endSpan=24 Fail
32501: coinSeg/Span/PtT=3/34/34 endSpan=33 Fail
32602: coinSeg/Span/PtT=2/32/32 endSpan=31 Fail
32703: coinSeg/Span/PtT=1/29/29 endSpan=28 Fail
32804: coinSeg/Span/PtT=10/19/19 endSpan=20 Fail
32905: coinSeg/Span/PtT=1/27/27 endSpan=25 Fail
33006: seg/base=12/23 seg/base=4/35 MarkCoinStart
33107: seg/base=12/24 seg/base=4/36 MarkCoinEnd
33208: seg/base=3/34 seg/base=6/11 MarkCoinStart
33309: seg/base=3/33 seg/base=6/12 MarkCoinEnd
33410: seg/base=2/32 seg/base=8/15 MarkCoinStart
33511: seg/base=2/31 seg/base=8/16 MarkCoinEnd
33612: seg/base=1/29 seg/base=11/21 MarkCoinStart
33713: seg/base=1/28 seg/base=11/30 MarkCoinEnd
33814: seg/base=10/19 seg/base=1/28 MarkCoinStart
33915: seg/base=10/20 seg/base=1/27 MarkCoinEnd
34016: seg/base=1/27 seg/base=9/26 MarkCoinStart
34117: seg/base=1/25 seg/base=9/18 MarkCoinEnd
342SkOpSegment::debugShowActiveSpans id=1 (286.695129,291 280.324158,320.973022) t=0 tEnd=0.111011249 windSum=? windValue=1
343SkOpSegment::debugShowActiveSpans id=1 (280.324158,320.973022 280.31842,321) t=0.111011249 tEnd=0.11111112 windSum=? windValue=1
344SkOpSegment::debugShowActiveSpans id=1 (280.31842,321 235.681549,531) t=0.11111112 tEnd=0.888888891 windSum=? windValue=1
345SkOpSegment::debugShowActiveSpans id=1 (235.681549,531 235.678497,531.014404) t=0.888888891 tEnd=0.888942232 windSum=? windValue=1
346SkOpSegment::debugShowActiveSpans id=1 (235.678497,531.014404 229.304855,561) t=0.888942232 tEnd=1 windSum=? windValue=1
347SkOpSegment::debugShowActiveSpans id=2 (229.304855,561 259.304871,561) t=0 tEnd=0.0400000195 windSum=? windValue=1
348SkOpSegment::debugShowActiveSpans id=2 (259.304871,561 949.304871,561) t=0.0400000195 tEnd=0.960000001 windSum=? windValue=1
349SkOpSegment::debugShowActiveSpans id=2 (949.304871,561 979.304871,561) t=0.960000001 tEnd=1 windSum=? windValue=1
350SkOpSegment::debugShowActiveSpans id=3 (979.304871,561 985.68158,531) t=0 tEnd=0.11111108 windSum=? windValue=1
351SkOpSegment::debugShowActiveSpans id=3 (985.68158,531 1030.31836,321) t=0.11111108 tEnd=0.888888874 windSum=? windValue=1
352SkOpSegment::debugShowActiveSpans id=3 (1030.31836,321 1036.69507,291) t=0.888888874 tEnd=1 windSum=? windValue=1
353SkOpSegment::debugShowActiveSpans id=4 (1036.69507,291 1006.69513,291) t=0 tEnd=0.0399999219 windSum=? windValue=1
354SkOpSegment::debugShowActiveSpans id=4 (1006.69513,291 316.695129,291) t=0.0399999219 tEnd=0.959999997 windSum=? windValue=1
355SkOpSegment::debugShowActiveSpans id=4 (316.695129,291 286.695129,291) t=0.959999997 tEnd=1 windSum=? windValue=1
356SkOpSegment::debugShowActiveSpans id=5 (1006.69513,291 1023.26367,291 1033.84021,304.431458 1030.31836,321) t=0 tEnd=1 windSum=? windValue=1
357SkOpSegment::debugShowActiveSpans id=6 (1030.31836,321 985.681519,531) t=0 tEnd=1 windSum=? windValue=1
358SkOpSegment::debugShowActiveSpans id=7 (985.681519,531 982.15979,547.568542 965.873413,561 949.304871,561) t=0 tEnd=1 windSum=? windValue=1
359SkOpSegment::debugShowActiveSpans id=8 (949.304871,561 259.304871,561) t=0 tEnd=1 windSum=? windValue=1
360SkOpSegment::debugShowActiveSpans id=9 (259.304871,561 242.741114,561 232.165942,547.576327 235.678497,531.014404) t=0 tEnd=0.999710227 windSum=? windValue=1
361SkOpSegment::debugShowActiveSpans id=9 (235.678497,531.014404 235.679515,531.009604 235.680529,531.004801 235.681549,531) t=0.999710227 tEnd=1 windSum=? windValue=1
362SkOpSegment::debugShowActiveSpans id=10 (235.681549,531 280.31842,321) t=0 tEnd=1 windSum=? windValue=1
363SkOpSegment::debugShowActiveSpans id=11 (280.31842,321 280.320331,320.991011 280.32224,320.982009 280.324158,320.973022) t=0 tEnd=0.000542504226 windSum=? windValue=1
364SkOpSegment::debugShowActiveSpans id=11 (280.324158,320.973022 283.857845,304.416873 300.135575,291 316.695129,291) t=0.000542504226 tEnd=1 windSum=? windValue=1
365SkOpSegment::debugShowActiveSpans id=12 (316.695129,291 1006.69513,291) t=0 tEnd=1 windSum=? windValue=1
366-----------------xx--x---------------- mark
36700: coinSeg/Span/PtT=12/23/23 endSpan=24 Fail
36801: coinSeg/Span/PtT=3/34/34 endSpan=33 Fail
36902: coinSeg/Span/PtT=2/32/32 endSpan=31 Fail
37003: coinSeg/Span/PtT=1/29/29 endSpan=28 Fail
37104: coinSeg/Span/PtT=10/19/19 endSpan=20 Fail
37205: coinSeg/Span/PtT=1/27/27 endSpan=25 Fail
37306: seg/base=12/23 seg/base=4/35 MarkCoinStart
37407: seg/base=12/24 seg/base=4/36 MarkCoinEnd
37508: seg/base=3/34 seg/base=6/11 MarkCoinStart
37609: seg/base=3/33 seg/base=6/12 MarkCoinEnd
37710: seg/base=2/32 seg/base=8/15 MarkCoinStart
37811: seg/base=2/31 seg/base=8/16 MarkCoinEnd
37912: seg/base=1/29 seg/base=11/21 MarkCoinStart
38013: seg/base=1/28 seg/base=11/30 MarkCoinEnd
38114: seg/base=10/19 seg/base=1/28 MarkCoinStart
38215: seg/base=10/20 seg/base=1/27 MarkCoinEnd
38316: seg/base=1/27 seg/base=9/26 MarkCoinStart
38417: seg/base=1/25 seg/base=9/18 MarkCoinEnd
385SkOpSegment::debugShowActiveSpans id=1 (286.695129,291 280.324158,320.973022) t=0 tEnd=0.111011249 windSum=? windValue=1
386SkOpSegment::debugShowActiveSpans id=1 (280.324158,320.973022 280.31842,321) t=0.111011249 tEnd=0.11111112 windSum=? windValue=1
387SkOpSegment::debugShowActiveSpans id=1 (280.31842,321 235.681549,531) t=0.11111112 tEnd=0.888888891 windSum=? windValue=1
388SkOpSegment::debugShowActiveSpans id=1 (235.681549,531 235.678497,531.014404) t=0.888888891 tEnd=0.888942232 windSum=? windValue=1
389SkOpSegment::debugShowActiveSpans id=1 (235.678497,531.014404 229.304855,561) t=0.888942232 tEnd=1 windSum=? windValue=1
390SkOpSegment::debugShowActiveSpans id=2 (229.304855,561 259.304871,561) t=0 tEnd=0.0400000195 windSum=? windValue=1
391SkOpSegment::debugShowActiveSpans id=2 (259.304871,561 949.304871,561) t=0.0400000195 tEnd=0.960000001 windSum=? windValue=1
392SkOpSegment::debugShowActiveSpans id=2 (949.304871,561 979.304871,561) t=0.960000001 tEnd=1 windSum=? windValue=1
393SkOpSegment::debugShowActiveSpans id=3 (979.304871,561 985.68158,531) t=0 tEnd=0.11111108 windSum=? windValue=1
394SkOpSegment::debugShowActiveSpans id=3 (985.68158,531 1030.31836,321) t=0.11111108 tEnd=0.888888874 windSum=? windValue=1
395SkOpSegment::debugShowActiveSpans id=3 (1030.31836,321 1036.69507,291) t=0.888888874 tEnd=1 windSum=? windValue=1
396SkOpSegment::debugShowActiveSpans id=4 (1036.69507,291 1006.69513,291) t=0 tEnd=0.0399999219 windSum=? windValue=1
397SkOpSegment::debugShowActiveSpans id=4 (1006.69513,291 316.695129,291) t=0.0399999219 tEnd=0.959999997 windSum=? windValue=1
398SkOpSegment::debugShowActiveSpans id=4 (316.695129,291 286.695129,291) t=0.959999997 tEnd=1 windSum=? windValue=1
399SkOpSegment::debugShowActiveSpans id=5 (1006.69513,291 1023.26367,291 1033.84021,304.431458 1030.31836,321) t=0 tEnd=1 windSum=? windValue=1
400SkOpSegment::debugShowActiveSpans id=6 (1030.31836,321 985.681519,531) t=0 tEnd=1 windSum=? windValue=1
401SkOpSegment::debugShowActiveSpans id=7 (985.681519,531 982.15979,547.568542 965.873413,561 949.304871,561) t=0 tEnd=1 windSum=? windValue=1
402SkOpSegment::debugShowActiveSpans id=8 (949.304871,561 259.304871,561) t=0 tEnd=1 windSum=? windValue=1
403SkOpSegment::debugShowActiveSpans id=9 (259.304871,561 242.741114,561 232.165942,547.576327 235.678497,531.014404) t=0 tEnd=0.999710227 windSum=? windValue=1
404SkOpSegment::debugShowActiveSpans id=9 (235.678497,531.014404 235.679515,531.009604 235.680529,531.004801 235.681549,531) t=0.999710227 tEnd=1 windSum=? windValue=1
405SkOpSegment::debugShowActiveSpans id=10 (235.681549,531 280.31842,321) t=0 tEnd=1 windSum=? windValue=1
406SkOpSegment::debugShowActiveSpans id=11 (280.31842,321 280.320331,320.991011 280.32224,320.982009 280.324158,320.973022) t=0 tEnd=0.000542504226 windSum=? windValue=1
407SkOpSegment::debugShowActiveSpans id=11 (280.324158,320.973022 283.857845,304.416873 300.135575,291 316.695129,291) t=0.000542504226 tEnd=1 windSum=? windValue=1
408SkOpSegment::debugShowActiveSpans id=12 (316.695129,291 1006.69513,291) t=0 tEnd=1 windSum=? windValue=1
409-----------------x-------------------- missing_coincidence
41000: coinSeg/Span/PtT=12/23/23 endSpan=24 Fail
41101: coinSeg/Span/PtT=3/34/34 endSpan=33 Fail
41202: coinSeg/Span/PtT=2/32/32 endSpan=31 Fail
41303: coinSeg/Span/PtT=1/29/29 endSpan=28 Fail
41404: coinSeg/Span/PtT=10/19/19 endSpan=20 Fail
41505: coinSeg/Span/PtT=1/27/27 endSpan=25 Fail
416SkOpSegment::debugShowActiveSpans id=1 (286.695129,291 280.324158,320.973022) t=0 tEnd=0.111011249 windSum=? windValue=1
417SkOpSegment::debugShowActiveSpans id=1 (280.324158,320.973022 280.31842,321) t=0.111011249 tEnd=0.11111112 windSum=? windValue=1
418SkOpSegment::debugShowActiveSpans id=1 (280.31842,321 235.681549,531) t=0.11111112 tEnd=0.888888891 windSum=? windValue=1
419SkOpSegment::debugShowActiveSpans id=1 (235.681549,531 235.678497,531.014404) t=0.888888891 tEnd=0.888942232 windSum=? windValue=1
420SkOpSegment::debugShowActiveSpans id=1 (235.678497,531.014404 229.304855,561) t=0.888942232 tEnd=1 windSum=? windValue=1
421SkOpSegment::debugShowActiveSpans id=2 (229.304855,561 259.304871,561) t=0 tEnd=0.0400000195 windSum=? windValue=1
422SkOpSegment::debugShowActiveSpans id=2 (259.304871,561 949.304871,561) t=0.0400000195 tEnd=0.960000001 windSum=? windValue=1
423SkOpSegment::debugShowActiveSpans id=2 (949.304871,561 979.304871,561) t=0.960000001 tEnd=1 windSum=? windValue=1
424SkOpSegment::debugShowActiveSpans id=3 (979.304871,561 985.68158,531) t=0 tEnd=0.11111108 windSum=? windValue=1
425SkOpSegment::debugShowActiveSpans id=3 (985.68158,531 1030.31836,321) t=0.11111108 tEnd=0.888888874 windSum=? windValue=1
426SkOpSegment::debugShowActiveSpans id=3 (1030.31836,321 1036.69507,291) t=0.888888874 tEnd=1 windSum=? windValue=1
427SkOpSegment::debugShowActiveSpans id=4 (1036.69507,291 1006.69513,291) t=0 tEnd=0.0399999219 windSum=? windValue=1
428SkOpSegment::debugShowActiveSpans id=4 (1006.69513,291 316.695129,291) t=0.0399999219 tEnd=0.959999997 windSum=? windValue=1
429SkOpSegment::debugShowActiveSpans id=4 (316.695129,291 286.695129,291) t=0.959999997 tEnd=1 windSum=? windValue=1
430SkOpSegment::debugShowActiveSpans id=5 (1006.69513,291 1023.26367,291 1033.84021,304.431458 1030.31836,321) t=0 tEnd=1 windSum=? windValue=1
431SkOpSegment::debugShowActiveSpans id=6 (1030.31836,321 985.681519,531) t=0 tEnd=1 windSum=? windValue=1
432SkOpSegment::debugShowActiveSpans id=7 (985.681519,531 982.15979,547.568542 965.873413,561 949.304871,561) t=0 tEnd=1 windSum=? windValue=1
433SkOpSegment::debugShowActiveSpans id=8 (949.304871,561 259.304871,561) t=0 tEnd=1 windSum=? windValue=1
434SkOpSegment::debugShowActiveSpans id=9 (259.304871,561 242.741114,561 232.165942,547.576327 235.678497,531.014404) t=0 tEnd=0.999710227 windSum=? windValue=1
435SkOpSegment::debugShowActiveSpans id=9 (235.678497,531.014404 235.679515,531.009604 235.680529,531.004801 235.681549,531) t=0.999710227 tEnd=1 windSum=? windValue=1
436SkOpSegment::debugShowActiveSpans id=10 (235.681549,531 280.31842,321) t=0 tEnd=1 windSum=? windValue=1
437SkOpSegment::debugShowActiveSpans id=11 (280.31842,321 280.320331,320.991011 280.32224,320.982009 280.324158,320.973022) t=0 tEnd=0.000542504226 windSum=? windValue=1
438SkOpSegment::debugShowActiveSpans id=11 (280.324158,320.973022 283.857845,304.416873 300.135575,291 316.695129,291) t=0.000542504226 tEnd=1 windSum=? windValue=1
439SkOpSegment::debugShowActiveSpans id=12 (316.695129,291 1006.69513,291) t=0 tEnd=1 windSum=? windValue=1
440-----------------x-------------------- expand
44100: coinSeg/Span/PtT=12/23/23 endSpan=24 Fail
44201: coinSeg/Span/PtT=3/34/34 endSpan=33 Fail
44302: coinSeg/Span/PtT=2/32/32 endSpan=31 Fail
44403: coinSeg/Span/PtT=1/29/29 endSpan=28 Fail
44504: coinSeg/Span/PtT=10/19/19 endSpan=20 Fail
44605: coinSeg/Span/PtT=1/27/27 endSpan=25 Fail
447SkOpSegment::debugShowActiveSpans id=1 (286.695129,291 280.324158,320.973022) t=0 tEnd=0.111011249 windSum=? windValue=1
448SkOpSegment::debugShowActiveSpans id=1 (280.324158,320.973022 280.31842,321) t=0.111011249 tEnd=0.11111112 windSum=? windValue=1
449SkOpSegment::debugShowActiveSpans id=1 (280.31842,321 235.681549,531) t=0.11111112 tEnd=0.888888891 windSum=? windValue=1
450SkOpSegment::debugShowActiveSpans id=1 (235.681549,531 235.678497,531.014404) t=0.888888891 tEnd=0.888942232 windSum=? windValue=1
451SkOpSegment::debugShowActiveSpans id=1 (235.678497,531.014404 229.304855,561) t=0.888942232 tEnd=1 windSum=? windValue=1
452SkOpSegment::debugShowActiveSpans id=2 (229.304855,561 259.304871,561) t=0 tEnd=0.0400000195 windSum=? windValue=1
453SkOpSegment::debugShowActiveSpans id=2 (259.304871,561 949.304871,561) t=0.0400000195 tEnd=0.960000001 windSum=? windValue=1
454SkOpSegment::debugShowActiveSpans id=2 (949.304871,561 979.304871,561) t=0.960000001 tEnd=1 windSum=? windValue=1
455SkOpSegment::debugShowActiveSpans id=3 (979.304871,561 985.68158,531) t=0 tEnd=0.11111108 windSum=? windValue=1
456SkOpSegment::debugShowActiveSpans id=3 (985.68158,531 1030.31836,321) t=0.11111108 tEnd=0.888888874 windSum=? windValue=1
457SkOpSegment::debugShowActiveSpans id=3 (1030.31836,321 1036.69507,291) t=0.888888874 tEnd=1 windSum=? windValue=1
458SkOpSegment::debugShowActiveSpans id=4 (1036.69507,291 1006.69513,291) t=0 tEnd=0.0399999219 windSum=? windValue=1
459SkOpSegment::debugShowActiveSpans id=4 (1006.69513,291 316.695129,291) t=0.0399999219 tEnd=0.959999997 windSum=? windValue=1
460SkOpSegment::debugShowActiveSpans id=4 (316.695129,291 286.695129,291) t=0.959999997 tEnd=1 windSum=? windValue=1
461SkOpSegment::debugShowActiveSpans id=5 (1006.69513,291 1023.26367,291 1033.84021,304.431458 1030.31836,321) t=0 tEnd=1 windSum=? windValue=1
462SkOpSegment::debugShowActiveSpans id=6 (1030.31836,321 985.681519,531) t=0 tEnd=1 windSum=? windValue=1
463SkOpSegment::debugShowActiveSpans id=7 (985.681519,531 982.15979,547.568542 965.873413,561 949.304871,561) t=0 tEnd=1 windSum=? windValue=1
464SkOpSegment::debugShowActiveSpans id=8 (949.304871,561 259.304871,561) t=0 tEnd=1 windSum=? windValue=1
465SkOpSegment::debugShowActiveSpans id=9 (259.304871,561 242.741114,561 232.165942,547.576327 235.678497,531.014404) t=0 tEnd=0.999710227 windSum=? windValue=1
466SkOpSegment::debugShowActiveSpans id=9 (235.678497,531.014404 235.679515,531.009604 235.680529,531.004801 235.681549,531) t=0.999710227 tEnd=1 windSum=? windValue=1
467SkOpSegment::debugShowActiveSpans id=10 (235.681549,531 280.31842,321) t=0 tEnd=1 windSum=? windValue=1
468SkOpSegment::debugShowActiveSpans id=11 (280.31842,321 280.320331,320.991011 280.32224,320.982009 280.324158,320.973022) t=0 tEnd=0.000542504226 windSum=? windValue=1
469SkOpSegment::debugShowActiveSpans id=11 (280.324158,320.973022 283.857845,304.416873 300.135575,291 316.695129,291) t=0.000542504226 tEnd=1 windSum=? windValue=1
470SkOpSegment::debugShowActiveSpans id=12 (316.695129,291 1006.69513,291) t=0 tEnd=1 windSum=? windValue=1
471-----------------x-------------------- expand
47200: coinSeg/Span/PtT=12/23/23 endSpan=24 Fail
47301: coinSeg/Span/PtT=3/34/34 endSpan=33 Fail
47402: coinSeg/Span/PtT=2/32/32 endSpan=31 Fail
47503: coinSeg/Span/PtT=1/29/29 endSpan=28 Fail
47604: coinSeg/Span/PtT=10/19/19 endSpan=20 Fail
47705: coinSeg/Span/PtT=1/27/27 endSpan=25 Fail
478SkOpSegment::debugShowActiveSpans id=1 (286.695129,291 280.324158,320.973022) t=0 tEnd=0.111011249 windSum=? windValue=1
479SkOpSegment::debugShowActiveSpans id=1 (280.324158,320.973022 280.31842,321) t=0.111011249 tEnd=0.11111112 windSum=? windValue=1
480SkOpSegment::debugShowActiveSpans id=1 (280.31842,321 235.681549,531) t=0.11111112 tEnd=0.888888891 windSum=? windValue=1
481SkOpSegment::debugShowActiveSpans id=1 (235.681549,531 235.678497,531.014404) t=0.888888891 tEnd=0.888942232 windSum=? windValue=1
482SkOpSegment::debugShowActiveSpans id=1 (235.678497,531.014404 229.304855,561) t=0.888942232 tEnd=1 windSum=? windValue=1
483SkOpSegment::debugShowActiveSpans id=2 (229.304855,561 259.304871,561) t=0 tEnd=0.0400000195 windSum=? windValue=1
484SkOpSegment::debugShowActiveSpans id=2 (259.304871,561 949.304871,561) t=0.0400000195 tEnd=0.960000001 windSum=? windValue=1
485SkOpSegment::debugShowActiveSpans id=2 (949.304871,561 979.304871,561) t=0.960000001 tEnd=1 windSum=? windValue=1
486SkOpSegment::debugShowActiveSpans id=3 (979.304871,561 985.68158,531) t=0 tEnd=0.11111108 windSum=? windValue=1
487SkOpSegment::debugShowActiveSpans id=3 (985.68158,531 1030.31836,321) t=0.11111108 tEnd=0.888888874 windSum=? windValue=1
488SkOpSegment::debugShowActiveSpans id=3 (1030.31836,321 1036.69507,291) t=0.888888874 tEnd=1 windSum=? windValue=1
489SkOpSegment::debugShowActiveSpans id=4 (1036.69507,291 1006.69513,291) t=0 tEnd=0.0399999219 windSum=? windValue=1
490SkOpSegment::debugShowActiveSpans id=4 (1006.69513,291 316.695129,291) t=0.0399999219 tEnd=0.959999997 windSum=? windValue=1
491SkOpSegment::debugShowActiveSpans id=4 (316.695129,291 286.695129,291) t=0.959999997 tEnd=1 windSum=? windValue=1
492SkOpSegment::debugShowActiveSpans id=5 (1006.69513,291 1023.26367,291 1033.84021,304.431458 1030.31836,321) t=0 tEnd=1 windSum=? windValue=1
493SkOpSegment::debugShowActiveSpans id=6 (1030.31836,321 985.681519,531) t=0 tEnd=1 windSum=? windValue=1
494SkOpSegment::debugShowActiveSpans id=7 (985.681519,531 982.15979,547.568542 965.873413,561 949.304871,561) t=0 tEnd=1 windSum=? windValue=1
495SkOpSegment::debugShowActiveSpans id=8 (949.304871,561 259.304871,561) t=0 tEnd=1 windSum=? windValue=1
496SkOpSegment::debugShowActiveSpans id=9 (259.304871,561 242.741114,561 232.165942,547.576327 235.678497,531.014404) t=0 tEnd=0.999710227 windSum=? windValue=1
497SkOpSegment::debugShowActiveSpans id=9 (235.678497,531.014404 235.679515,531.009604 235.680529,531.004801 235.681549,531) t=0.999710227 tEnd=1 windSum=? windValue=1
498SkOpSegment::debugShowActiveSpans id=10 (235.681549,531 280.31842,321) t=0 tEnd=1 windSum=? windValue=1
499SkOpSegment::debugShowActiveSpans id=11 (280.31842,321 280.320331,320.991011 280.32224,320.982009 280.324158,320.973022) t=0 tEnd=0.000542504226 windSum=? windValue=1
500SkOpSegment::debugShowActiveSpans id=11 (280.324158,320.973022 283.857845,304.416873 300.135575,291 316.695129,291) t=0.000542504226 tEnd=1 windSum=? windValue=1
501SkOpSegment::debugShowActiveSpans id=12 (316.695129,291 1006.69513,291) t=0 tEnd=1 windSum=? windValue=1
502-------------------------------------- apply
503SkOpSegment::debugShowActiveSpans id=1 (286.695129,291 280.324158,320.973022) t=0 tEnd=0.111011249 windSum=? windValue=1
504SkOpSegment::debugShowActiveSpans id=1 (280.324158,320.973022 280.31842,321) t=0.111011249 tEnd=0.11111112 windSum=? windValue=1
505SkOpSegment::debugShowActiveSpans id=1 (280.31842,321 235.681549,531) t=0.11111112 tEnd=0.888888891 windSum=? windValue=1
506SkOpSegment::debugShowActiveSpans id=1 (235.681549,531 235.678497,531.014404) t=0.888888891 tEnd=0.888942232 windSum=? windValue=1
507SkOpSegment::debugShowActiveSpans id=1 (235.678497,531.014404 229.304855,561) t=0.888942232 tEnd=1 windSum=? windValue=1
508SkOpSegment::debugShowActiveSpans id=2 (229.304855,561 259.304871,561) t=0 tEnd=0.0400000195 windSum=? windValue=1
509SkOpSegment::debugShowActiveSpans id=2 (259.304871,561 949.304871,561) t=0.0400000195 tEnd=0.960000001 windSum=? windValue=1
510SkOpSegment::debugShowActiveSpans id=2 (949.304871,561 979.304871,561) t=0.960000001 tEnd=1 windSum=? windValue=1
511SkOpSegment::debugShowActiveSpans id=3 (979.304871,561 985.68158,531) t=0 tEnd=0.11111108 windSum=? windValue=1
512SkOpSegment::debugShowActiveSpans id=3 (985.68158,531 1030.31836,321) t=0.11111108 tEnd=0.888888874 windSum=? windValue=1
513SkOpSegment::debugShowActiveSpans id=3 (1030.31836,321 1036.69507,291) t=0.888888874 tEnd=1 windSum=? windValue=1
514SkOpSegment::debugShowActiveSpans id=4 (1036.69507,291 1006.69513,291) t=0 tEnd=0.0399999219 windSum=? windValue=1
515SkOpSegment::debugShowActiveSpans id=4 (1006.69513,291 316.695129,291) t=0.0399999219 tEnd=0.959999997 windSum=? windValue=1
516SkOpSegment::debugShowActiveSpans id=4 (316.695129,291 286.695129,291) t=0.959999997 tEnd=1 windSum=? windValue=1
517SkOpSegment::debugShowActiveSpans id=5 (1006.69513,291 1023.26367,291 1033.84021,304.431458 1030.31836,321) t=0 tEnd=1 windSum=? windValue=1
518SkOpSegment::debugShowActiveSpans id=6 (1030.31836,321 985.681519,531) t=0 tEnd=1 windSum=? windValue=1
519SkOpSegment::debugShowActiveSpans id=7 (985.681519,531 982.15979,547.568542 965.873413,561 949.304871,561) t=0 tEnd=1 windSum=? windValue=1
520SkOpSegment::debugShowActiveSpans id=8 (949.304871,561 259.304871,561) t=0 tEnd=1 windSum=? windValue=1
521SkOpSegment::debugShowActiveSpans id=9 (259.304871,561 242.741114,561 232.165942,547.576327 235.678497,531.014404) t=0 tEnd=0.999710227 windSum=? windValue=1
522SkOpSegment::debugShowActiveSpans id=9 (235.678497,531.014404 235.679515,531.009604 235.680529,531.004801 235.681549,531) t=0.999710227 tEnd=1 windSum=? windValue=1
523SkOpSegment::debugShowActiveSpans id=10 (235.681549,531 280.31842,321) t=0 tEnd=1 windSum=? windValue=1
524SkOpSegment::debugShowActiveSpans id=11 (280.31842,321 280.320331,320.991011 280.32224,320.982009 280.324158,320.973022) t=0 tEnd=0.000542504226 windSum=? windValue=1
525SkOpSegment::debugShowActiveSpans id=11 (280.324158,320.973022 283.857845,304.416873 300.135575,291 316.695129,291) t=0.000542504226 tEnd=1 windSum=? windValue=1
526SkOpSegment::debugShowActiveSpans id=12 (316.695129,291 1006.69513,291) t=0 tEnd=1 windSum=? windValue=1
527SkOpSegment::markDone id=4 (1036.69507,291 286.695129,291) t=0.0399999219 [35] (1006.69513,291) tEnd=0.959999997 newWindSum=? newOppSum=? oppSum=? windSum=? windValue=0 oppValue=0
528SkOpSegment::markDone id=6 (1030.31836,321 985.681519,531) t=0 [11] (1030.31836,321) tEnd=1 newWindSum=? newOppSum=? oppSum=? windSum=? windValue=0 oppValue=0
529SkOpSegment::markDone id=8 (949.304871,561 259.304871,561) t=0 [15] (949.304871,561) tEnd=1 newWindSum=? newOppSum=? oppSum=? windSum=? windValue=0 oppValue=0
530SkOpSegment::markDone id=11 (280.31842,321 283.840179,304.431458 300.126587,291 316.695129,291) t=0 [21] (280.31842,321) tEnd=0.000542504226 newWindSum=? newOppSum=? oppSum=? windSum=? windValue=0 oppValue=0
531SkOpSegment::markDone id=1 (286.695129,291 229.304855,561) t=0.11111112 [28] (280.31842,321) tEnd=0.888888891 newWindSum=? newOppSum=? oppSum=? windSum=? windValue=0 oppValue=0
532SkOpSegment::markDone id=9 (259.304871,561 242.736313,561 232.159805,547.568542 235.681549,531) t=0.999710227 [26] (235.678497,531.014404) tEnd=1 newWindSum=? newOppSum=? oppSum=? windSum=? windValue=0 oppValue=0
533-------------------------------------- findOverlaps
534SkOpSegment::debugShowActiveSpans id=1 (286.695129,291 280.324158,320.973022) t=0 tEnd=0.111011249 windSum=? windValue=1
535SkOpSegment::debugShowActiveSpans id=1 (280.324158,320.973022 280.31842,321) t=0.111011249 tEnd=0.11111112 windSum=? oppSum=? windValue=1 oppValue=-1
536SkOpSegment::debugShowActiveSpans id=1 (235.681549,531 235.678497,531.014404) t=0.888888891 tEnd=0.888942232 windSum=? oppSum=? windValue=1 oppValue=-1
537SkOpSegment::debugShowActiveSpans id=1 (235.678497,531.014404 229.304855,561) t=0.888942232 tEnd=1 windSum=? windValue=1
538SkOpSegment::debugShowActiveSpans id=2 (229.304855,561 259.304871,561) t=0 tEnd=0.0400000195 windSum=? windValue=1
539SkOpSegment::debugShowActiveSpans id=2 (259.304871,561 949.304871,561) t=0.0400000195 tEnd=0.960000001 windSum=? oppSum=? windValue=1 oppValue=-1
540SkOpSegment::debugShowActiveSpans id=2 (949.304871,561 979.304871,561) t=0.960000001 tEnd=1 windSum=? windValue=1
541SkOpSegment::debugShowActiveSpans id=3 (979.304871,561 985.68158,531) t=0 tEnd=0.11111108 windSum=? windValue=1
542SkOpSegment::debugShowActiveSpans id=3 (985.68158,531 1030.31836,321) t=0.11111108 tEnd=0.888888874 windSum=? oppSum=? windValue=1 oppValue=-1
543SkOpSegment::debugShowActiveSpans id=3 (1030.31836,321 1036.69507,291) t=0.888888874 tEnd=1 windSum=? windValue=1
544SkOpSegment::debugShowActiveSpans id=4 (1036.69507,291 1006.69513,291) t=0 tEnd=0.0399999219 windSum=? windValue=1
545SkOpSegment::debugShowActiveSpans id=4 (316.695129,291 286.695129,291) t=0.959999997 tEnd=1 windSum=? windValue=1
546SkOpSegment::debugShowActiveSpans id=5 (1006.69513,291 1023.26367,291 1033.84021,304.431458 1030.31836,321) t=0 tEnd=1 windSum=? windValue=1
547SkOpSegment::debugShowActiveSpans id=7 (985.681519,531 982.15979,547.568542 965.873413,561 949.304871,561) t=0 tEnd=1 windSum=? windValue=1
548SkOpSegment::debugShowActiveSpans id=9 (259.304871,561 242.741114,561 232.165942,547.576327 235.678497,531.014404) t=0 tEnd=0.999710227 windSum=? windValue=1
549SkOpSegment::debugShowActiveSpans id=10 (235.681549,531 280.31842,321) t=0 tEnd=1 windSum=? oppSum=? windValue=1 oppValue=1
550SkOpSegment::debugShowActiveSpans id=11 (280.324158,320.973022 283.857845,304.416873 300.135575,291 316.695129,291) t=0.000542504226 tEnd=1 windSum=? windValue=1
551SkOpSegment::debugShowActiveSpans id=12 (316.695129,291 1006.69513,291) t=0 tEnd=1 windSum=? oppSum=? windValue=1 oppValue=1
552-------------------------------------- calc_angles
553SkOpSegment::debugShowActiveSpans id=1 (286.695129,291 280.324158,320.973022) t=0 tEnd=0.111011249 windSum=? windValue=1
554SkOpSegment::debugShowActiveSpans id=1 (280.324158,320.973022 280.31842,321) t=0.111011249 tEnd=0.11111112 windSum=? oppSum=? windValue=1 oppValue=-1
555SkOpSegment::debugShowActiveSpans id=1 (235.681549,531 235.678497,531.014404) t=0.888888891 tEnd=0.888942232 windSum=? oppSum=? windValue=1 oppValue=-1
556SkOpSegment::debugShowActiveSpans id=1 (235.678497,531.014404 229.304855,561) t=0.888942232 tEnd=1 windSum=? windValue=1
557SkOpSegment::debugShowActiveSpans id=2 (229.304855,561 259.304871,561) t=0 tEnd=0.0400000195 windSum=? windValue=1
558SkOpSegment::debugShowActiveSpans id=2 (259.304871,561 949.304871,561) t=0.0400000195 tEnd=0.960000001 windSum=? oppSum=? windValue=1 oppValue=-1
559SkOpSegment::debugShowActiveSpans id=2 (949.304871,561 979.304871,561) t=0.960000001 tEnd=1 windSum=? windValue=1
560SkOpSegment::debugShowActiveSpans id=3 (979.304871,561 985.68158,531) t=0 tEnd=0.11111108 windSum=? windValue=1
561SkOpSegment::debugShowActiveSpans id=3 (985.68158,531 1030.31836,321) t=0.11111108 tEnd=0.888888874 windSum=? oppSum=? windValue=1 oppValue=-1
562SkOpSegment::debugShowActiveSpans id=3 (1030.31836,321 1036.69507,291) t=0.888888874 tEnd=1 windSum=? windValue=1
563SkOpSegment::debugShowActiveSpans id=4 (1036.69507,291 1006.69513,291) t=0 tEnd=0.0399999219 windSum=? windValue=1
564SkOpSegment::debugShowActiveSpans id=4 (316.695129,291 286.695129,291) t=0.959999997 tEnd=1 windSum=? windValue=1
565SkOpSegment::debugShowActiveSpans id=5 (1006.69513,291 1023.26367,291 1033.84021,304.431458 1030.31836,321) t=0 tEnd=1 windSum=? windValue=1
566SkOpSegment::debugShowActiveSpans id=7 (985.681519,531 982.15979,547.568542 965.873413,561 949.304871,561) t=0 tEnd=1 windSum=? windValue=1
567SkOpSegment::debugShowActiveSpans id=9 (259.304871,561 242.741114,561 232.165942,547.576327 235.678497,531.014404) t=0 tEnd=0.999710227 windSum=? windValue=1
568SkOpSegment::debugShowActiveSpans id=10 (235.681549,531 280.31842,321) t=0 tEnd=1 windSum=? oppSum=? windValue=1 oppValue=1
569SkOpSegment::debugShowActiveSpans id=11 (280.324158,320.973022 283.857845,304.416873 300.135575,291 316.695129,291) t=0.000542504226 tEnd=1 windSum=? windValue=1
570SkOpSegment::debugShowActiveSpans id=12 (316.695129,291 1006.69513,291) t=0 tEnd=1 windSum=? oppSum=? windValue=1 oppValue=1
571SkOpSegment::sortAngles [1] tStart=0.111011249 [29]
572SkOpAngle::after [1/1] 5/5 tStart=0.111011249 tEnd=0 < [11/25] 5/1 tStart=0.000542504226 tEnd=1 < [1/2] 21/21 tStart=0.111011249 tEnd=0.11111112 F 12
573SkOpAngle::afterPart {{{280.324158,320.973022}, {286.695129,291}}} id=1
574SkOpAngle::afterPart {{{280.324158,320.973022}, {283.857845,304.416873}, {300.135575,291}, {316.695129,291}}} id=11
575SkOpAngle::afterPart {{{280.324158,320.973022}, {280.31842,321}}} id=1
576SkOpSegment::sortAngles [1] tStart=0.11111112 [28]
577SkOpSegment::sortAngles [1] tStart=0.888888891 [27]
578SkOpSegment::sortAngles [1] tStart=0.888942232 [25]
579SkOpAngle::after [1/5] 5/5 tStart=0.888942232 tEnd=0.888888891 < [9/22] 21/25 tStart=0.999710227 tEnd=0 < [1/6] 21/21 tStart=0.888942232 tEnd=1 F 11
580SkOpAngle::afterPart {{{235.678497,531.014404}, {235.681549,531}}} id=1
581SkOpAngle::afterPart {{{235.678497,531.014404}, {232.165942,547.576327}, {242.741114,561}, {259.304871,561}}} id=9
582SkOpAngle::afterPart {{{235.678497,531.014404}, {229.304855,561}}} id=1
583SkOpSegment::sortAngles [2] tStart=0.0400000195 [32]
584SkOpAngle::after [2/7] 15/15 tStart=0.0400000195 tEnd=0 < [9/21] 14/9 tStart=0 tEnd=0.999710227 < [2/8] 31/31 tStart=0.0400000195 tEnd=0.960000001 F 4
585SkOpAngle::afterPart {{{259.304871,561}, {229.304855,561}}} id=2
586SkOpAngle::afterPart {{{259.304871,561}, {242.741114,561}, {232.165942,547.576327}, {235.678497,531.014404}}} id=9
587SkOpAngle::afterPart {{{259.304871,561}, {949.304871,561}}} id=2
588SkOpSegment::sortAngles [2] tStart=0.960000001 [31]
589SkOpAngle::after [2/9] 15/15 tStart=0.960000001 tEnd=0.0400000195 < [7/20] 0/1 tStart=1 tEnd=0 < [2/10] 31/31 tStart=0.960000001 tEnd=1 F 4
590SkOpAngle::afterPart {{{949.304871,561}, {259.304871,561}}} id=2
591SkOpAngle::afterPart {{{949.304871,561}, {965.873413,561}, {982.15979,547.568542}, {985.681519,531}}} id=7
592SkOpAngle::afterPart {{{949.304871,561}, {979.304871,561}}} id=2
593SkOpSegment::sortAngles [3] tStart=0.11111108 [34]
594SkOpAngle::after [3/11] 21/21 tStart=0.11111108 tEnd=0 < [7/19] 21/17 tStart=0 tEnd=1 < [3/12] 5/5 tStart=0.11111108 tEnd=0.888888874 F 12
595SkOpAngle::afterPart {{{985.681519,531}, {979.30481,561}}} id=3
596SkOpAngle::afterPart {{{985.681519,531}, {982.15979,547.568542}, {965.873413,561}, {949.304871,561}}} id=7
597SkOpAngle::afterPart {{{985.681519,531}, {1030.3183,321}}} id=3
598SkOpSegment::sortAngles [3] tStart=0.888888874 [33]
599SkOpAngle::after [3/13] 21/21 tStart=0.888888874 tEnd=0.11111108 < [5/18] 5/9 tStart=1 tEnd=0 < [3/14] 5/5 tStart=0.888888874 tEnd=1 F 11
600SkOpAngle::afterPart {{{1030.31836,321}, {985.68158,531}}} id=3
601SkOpAngle::afterPart {{{1030.31836,321}, {1033.84021,304.431458}, {1023.26367,291}, {1006.69513,291}}} id=5
602SkOpAngle::afterPart {{{1030.31836,321}, {1036.69507,291}}} id=3
603SkOpSegment::sortAngles [4] tStart=0.0399999219 [35]
604SkOpAngle::after [4/15] 31/31 tStart=0.0399999219 tEnd=0 < [5/17] 30/25 tStart=0 tEnd=1 < [12/28] 15/15 tStart=1 tEnd=0 F 4
605SkOpAngle::afterPart {{{1006.69513,291}, {1036.69507,291}}} id=4
606SkOpAngle::afterPart {{{1006.69513,291}, {1023.26367,291}, {1033.84021,304.431458}, {1030.31836,321}}} id=5
607SkOpAngle::afterPart {{{1006.69513,291}, {316.695129,291}}} id=12
608SkOpSegment::sortAngles [4] tStart=0.959999997 [36]
609SkOpAngle::after [4/16] 15/15 tStart=0.959999997 tEnd=1 < [11/26] 16/17 tStart=1 tEnd=0.000542504226 < [12/27] 31/31 tStart=0 tEnd=1 T 4
610SkOpAngle::afterPart {{{316.695129,291}, {286.695129,291}}} id=4
611SkOpAngle::afterPart {{{316.695129,291}, {300.135575,291}, {283.857845,304.416873}, {280.324158,320.973022}}} id=11
612SkOpAngle::afterPart {{{316.695129,291}, {1006.69513,291}}} id=12
613SkOpSegment::sortAngles [5] tStart=0 [9]
614SkOpSegment::sortAngles [5] tStart=1 [10]
615SkOpSegment::sortAngles [7] tStart=0 [13]
616SkOpSegment::sortAngles [7] tStart=1 [14]
617SkOpSegment::sortAngles [9] tStart=0 [17]
618SkOpSegment::sortAngles [9] tStart=0.999710227 [26]
619SkOpSegment::sortAngles [10] tStart=0 [19]
620SkOpSegment::sortAngles [10] tStart=1 [20]
621SkOpSegment::sortAngles [11] tStart=0.000542504226 [30]
Cary Clark7eb01e02016-12-08 14:36:32 -0500622SkOpSegment::sortAngles [11] tStart=1 [22]
623SkOpSegment::sortAngles [12] tStart=0 [23]
Cary Clarkff114282016-12-14 11:56:16 -0500624SkOpSegment::sortAngles [12] tStart=1 [24]
625coinSpan - id=12 t=0 tEnd=1
626coinSpan + id=4 t=0.959999997 tEnd=0.0399999219
627coinSpan - id=3 t=0.11111108 tEnd=0.888888874
628coinSpan + id=6 t=1 tEnd=0
629coinSpan - id=2 t=0.0400000195 tEnd=0.960000001
630coinSpan + id=8 t=1 tEnd=0
631coinSpan - id=1 t=0.111011249 tEnd=0.11111112
632coinSpan + id=11 t=0.000542504226 tEnd=0
633coinSpan - id=10 t=0 tEnd=1
634coinSpan + id=1 t=0.888888891 tEnd=0.11111112
635coinSpan - id=1 t=0.888888891 tEnd=0.888942232
636coinSpan + id=9 t=1 tEnd=0.999710227
637SkOpSegment::debugShowActiveSpans id=1 (286.695129,291 280.324158,320.973022) t=0 tEnd=0.111011249 windSum=? windValue=1
638SkOpSegment::debugShowActiveSpans id=1 (280.324158,320.973022 280.31842,321) t=0.111011249 tEnd=0.11111112 windSum=? oppSum=? windValue=1 oppValue=-1
639SkOpSegment::debugShowActiveSpans id=1 (235.681549,531 235.678497,531.014404) t=0.888888891 tEnd=0.888942232 windSum=? oppSum=? windValue=1 oppValue=-1
640SkOpSegment::debugShowActiveSpans id=1 (235.678497,531.014404 229.304855,561) t=0.888942232 tEnd=1 windSum=? windValue=1
641SkOpSegment::debugShowActiveSpans id=2 (229.304855,561 259.304871,561) t=0 tEnd=0.0400000195 windSum=? windValue=1
642SkOpSegment::debugShowActiveSpans id=2 (259.304871,561 949.304871,561) t=0.0400000195 tEnd=0.960000001 windSum=? oppSum=? windValue=1 oppValue=-1
643SkOpSegment::debugShowActiveSpans id=2 (949.304871,561 979.304871,561) t=0.960000001 tEnd=1 windSum=? windValue=1
644SkOpSegment::debugShowActiveSpans id=3 (979.304871,561 985.68158,531) t=0 tEnd=0.11111108 windSum=? windValue=1
645SkOpSegment::debugShowActiveSpans id=3 (985.68158,531 1030.31836,321) t=0.11111108 tEnd=0.888888874 windSum=? oppSum=? windValue=1 oppValue=-1
646SkOpSegment::debugShowActiveSpans id=3 (1030.31836,321 1036.69507,291) t=0.888888874 tEnd=1 windSum=? windValue=1
647SkOpSegment::debugShowActiveSpans id=4 (1036.69507,291 1006.69513,291) t=0 tEnd=0.0399999219 windSum=? windValue=1
648SkOpSegment::debugShowActiveSpans id=4 (316.695129,291 286.695129,291) t=0.959999997 tEnd=1 windSum=? windValue=1
649SkOpSegment::debugShowActiveSpans id=5 (1006.69513,291 1023.26367,291 1033.84021,304.431458 1030.31836,321) t=0 tEnd=1 windSum=? windValue=1
650SkOpSegment::debugShowActiveSpans id=7 (985.681519,531 982.15979,547.568542 965.873413,561 949.304871,561) t=0 tEnd=1 windSum=? windValue=1
651SkOpSegment::debugShowActiveSpans id=9 (259.304871,561 242.741114,561 232.165942,547.576327 235.678497,531.014404) t=0 tEnd=0.999710227 windSum=? windValue=1
652SkOpSegment::debugShowActiveSpans id=10 (235.681549,531 280.31842,321) t=0 tEnd=1 windSum=? oppSum=? windValue=1 oppValue=1
653SkOpSegment::debugShowActiveSpans id=11 (280.324158,320.973022 283.857845,304.416873 300.135575,291 316.695129,291) t=0.000542504226 tEnd=1 windSum=? windValue=1
654SkOpSegment::debugShowActiveSpans id=12 (316.695129,291 1006.69513,291) t=0 tEnd=1 windSum=? oppSum=? windValue=1 oppValue=1
655SkOpSpan::sortableTop dir=kLeft seg=1 t=0.0555056246 pt=(283.509644,305.986511)
656SkOpSpan::sortableTop [0] valid=1 operand=0 span=1 ccw=0 seg=1 {{{286.695129f, 291}, {229.304855f, 561}}} t=0.0555056246 pt=(283.509644,305.986511) slope=(-57.390274,270)
657SkOpSegment::markWinding id=1 (286.695129,291 229.304855,561) t=0 [1] (286.695129,291) tEnd=0.111011249 newWindSum=1 newOppSum=0 oppSum=0 windSum=1 windValue=1 oppValue=0
658SkOpSegment::markWinding id=1 (286.695129,291 229.304855,561) t=0 [1] (286.695129,291) tEnd=0.111011249 newWindSum=1 newOppSum=0 oppSum=0 windSum=1 windValue=1 oppValue=0
659SkOpSegment::markWinding id=4 (1036.69507,291 286.695129,291) t=0.959999997 [36] (316.695129,291) tEnd=1 newWindSum=1 newOppSum=0 oppSum=? windSum=? windValue=1 oppValue=0
660SkOpSegment::activeOp id=1 t=0.111011249 tEnd=0 op=sect miFrom=1 miTo=0 suFrom=0 suTo=0 result=0
661SkOpSegment::markDone id=1 (286.695129,291 229.304855,561) t=0 [1] (286.695129,291) tEnd=0.111011249 newWindSum=1 newOppSum=0 oppSum=0 windSum=1 windValue=1 oppValue=0
662SkOpSegment::markDone id=4 (1036.69507,291 286.695129,291) t=0.959999997 [36] (316.695129,291) tEnd=1 newWindSum=1 newOppSum=0 oppSum=0 windSum=1 windValue=1 oppValue=0
663bridgeOp chase.append id=4 windSum=1
664SkOpSegment::markWinding id=11 (280.31842,321 283.840179,304.431458 300.126587,291 316.695129,291) t=0.000542504226 [30] (280.324158,320.973022) tEnd=1 newWindSum=-1 newOppSum=1 oppSum=? windSum=? windValue=1 oppValue=0
665SkOpSegment::markAngle last segment=11 span=30 windSum=-1
666SkOpSegment::markWinding id=12 (316.695129,291 1006.69513,291) t=0 [23] (316.695129,291) tEnd=1 newWindSum=-1 newOppSum=2 oppSum=? windSum=? windValue=1 oppValue=1
667SkOpSegment::markAngle last segment=12 span=24
668SkOpSegment::debugShowActiveSpans id=1 (280.324158,320.973022 280.31842,321) t=0.111011249 tEnd=0.11111112 windSum=? oppSum=? windValue=1 oppValue=-1
669SkOpSegment::debugShowActiveSpans id=1 (235.681549,531 235.678497,531.014404) t=0.888888891 tEnd=0.888942232 windSum=? oppSum=? windValue=1 oppValue=-1
670SkOpSegment::debugShowActiveSpans id=1 (235.678497,531.014404 229.304855,561) t=0.888942232 tEnd=1 windSum=? windValue=1
671SkOpSegment::debugShowActiveSpans id=2 (229.304855,561 259.304871,561) t=0 tEnd=0.0400000195 windSum=? windValue=1
672SkOpSegment::debugShowActiveSpans id=2 (259.304871,561 949.304871,561) t=0.0400000195 tEnd=0.960000001 windSum=? oppSum=? windValue=1 oppValue=-1
673SkOpSegment::debugShowActiveSpans id=2 (949.304871,561 979.304871,561) t=0.960000001 tEnd=1 windSum=? windValue=1
674SkOpSegment::debugShowActiveSpans id=3 (979.304871,561 985.68158,531) t=0 tEnd=0.11111108 windSum=? windValue=1
675SkOpSegment::debugShowActiveSpans id=3 (985.68158,531 1030.31836,321) t=0.11111108 tEnd=0.888888874 windSum=? oppSum=? windValue=1 oppValue=-1
676SkOpSegment::debugShowActiveSpans id=3 (1030.31836,321 1036.69507,291) t=0.888888874 tEnd=1 windSum=? windValue=1
677SkOpSegment::debugShowActiveSpans id=4 (1036.69507,291 1006.69513,291) t=0 tEnd=0.0399999219 windSum=? windValue=1
678SkOpSegment::debugShowActiveSpans id=5 (1006.69513,291 1023.26367,291 1033.84021,304.431458 1030.31836,321) t=0 tEnd=1 windSum=? windValue=1
679SkOpSegment::debugShowActiveSpans id=7 (985.681519,531 982.15979,547.568542 965.873413,561 949.304871,561) t=0 tEnd=1 windSum=? windValue=1
680SkOpSegment::debugShowActiveSpans id=9 (259.304871,561 242.741114,561 232.165942,547.576327 235.678497,531.014404) t=0 tEnd=0.999710227 windSum=? windValue=1
681SkOpSegment::debugShowActiveSpans id=10 (235.681549,531 280.31842,321) t=0 tEnd=1 windSum=? oppSum=? windValue=1 oppValue=1
682SkOpSegment::debugShowActiveSpans id=11 (280.324158,320.973022 283.857845,304.416873 300.135575,291 316.695129,291) t=0.000542504226 tEnd=1 windSum=-1 oppSum=1 windValue=1 oppValue=0
683SkOpSegment::debugShowActiveSpans id=12 (316.695129,291 1006.69513,291) t=0 tEnd=1 windSum=-1 oppSum=2 windValue=1 oppValue=1
684SkOpSegment::activeOp id=11 t=1 tEnd=0.000542504226 op=sect miFrom=1 miTo=1 suFrom=0 suTo=1 result=1
685SkOpSegment::markWinding id=1 (286.695129,291 229.304855,561) t=0.111011249 [29] (280.324158,320.973022) tEnd=0.11111112 newWindSum=1 newOppSum=-1 oppSum=? windSum=? windValue=1 oppValue=-1
686SkOpSegment::markAngle last segment=10 span=20
687SkOpSegment::findNextOp
688SkOpAngle::dumpOne [11/25] next=1/1 sect=5/1 s=0.000542504226 [30] e=1 [22] sgn=-1 windVal=1 windSum=-1 oppVal=0 oppSum=1 operand
689SkOpAngle::dumpOne [1/1] next=1/2 sect=5/5 s=0.111011249 [29] e=0 [1] sgn=1 windVal=1 windSum=1 oppVal=0 oppSum=0 done
690SkOpAngle::dumpOne [1/2] next=11/25 sect=21/21 s=0.111011249 [29] e=0.11111112 [28] sgn=-1 windVal=1 windSum=1 oppVal=-1 oppSum=-1
691SkOpSegment::activeOp id=1 t=0.111011249 tEnd=0 op=sect miFrom=1 miTo=0 suFrom=0 suTo=0 result=0
692SkOpSegment::activeOp id=1 t=0.111011249 tEnd=0.11111112 op=sect miFrom=0 miTo=1 suFrom=0 suTo=1 result=1
693SkOpSegment::findNextOp chase.append segment=10 span=20
694SkOpSegment::markDone id=11 (280.31842,321 283.840179,304.431458 300.126587,291 316.695129,291) t=0.000542504226 [30] (280.324158,320.973022) tEnd=1 newWindSum=-1 newOppSum=1 oppSum=1 windSum=-1 windValue=1 oppValue=0
695SkOpSegment::findNextOp from:[11] to:[1] start=2783944 end=2783752
696bridgeOp current id=11 from=(316.695129,291) to=(280.324158,320.973022)
697path.moveTo(316.695129,291);
698path.cubicTo(300.13559,291, 283.857849,304.41687, 280.324158,320.973022);
699SkOpSegment::markWinding id=10 (235.681549,531 280.31842,321) t=0 [19] (235.681549,531) tEnd=1 newWindSum=-1 newOppSum=-1 oppSum=? windSum=? windValue=1 oppValue=1
700SkOpSegment::markAngle last segment=1 span=27 windSum=?
701SkOpSegment::findNextOp
702SkOpAngle::dumpOne [1/3] next=10/24 sect=5/5 s=0.11111112 [28] e=0.111011249 [29] sgn=1 windVal=1 windSum=1 oppVal=-1 oppSum=-1
703SkOpAngle::dumpOne [10/24] next=1/3 sect=21/21 s=1 [20] e=0 [19] sgn=1 windVal=1 windSum=-1 oppVal=1 oppSum=-1 operand
704SkOpSegment::activeOp id=10 t=1 tEnd=0 op=sect miFrom=0 miTo=1 suFrom=0 suTo=1 result=1
705SkOpSegment::findNextOp chase.append segment=1 span=27 windSum=-2147483647
706SkOpSegment::markDone id=1 (286.695129,291 229.304855,561) t=0.111011249 [29] (280.324158,320.973022) tEnd=0.11111112 newWindSum=1 newOppSum=-1 oppSum=-1 windSum=1 windValue=1 oppValue=-1
707SkOpSegment::findNextOp from:[1] to:[10] start=2782336 end=2782192
708bridgeOp current id=1 from=(280.324158,320.973022) to=(280.31842,321)
709SkOpSegment::markWinding id=1 (286.695129,291 229.304855,561) t=0.888888891 [27] (235.681549,531) tEnd=0.888942232 newWindSum=1 newOppSum=-1 oppSum=? windSum=? windValue=1 oppValue=-1
710SkOpSegment::markAngle last segment=1 span=25 windSum=?
711SkOpSegment::findNextOp
712SkOpAngle::dumpOne [10/23] next=1/4 sect=5/5 s=0 [19] e=1 [20] sgn=-1 windVal=1 windSum=-1 oppVal=1 oppSum=-1 operand
713SkOpAngle::dumpOne [1/4] next=10/23 sect=21/21 s=0.888888891 [27] e=0.888942232 [25] sgn=-1 windVal=1 windSum=1 oppVal=-1 oppSum=-1
714SkOpSegment::activeOp id=1 t=0.888888891 tEnd=0.888942232 op=sect miFrom=0 miTo=1 suFrom=0 suTo=1 result=1
715SkOpSegment::findNextOp chase.append segment=1 span=25 windSum=-2147483647
716SkOpSegment::markDone id=10 (235.681549,531 280.31842,321) t=0 [19] (235.681549,531) tEnd=1 newWindSum=-1 newOppSum=-1 oppSum=-1 windSum=-1 windValue=1 oppValue=1
717SkOpSegment::findNextOp from:[10] to:[1] start=2783416 end=2783128
718bridgeOp current id=10 from=(280.31842,321) to=(235.681549,531)
719path.lineTo(280.31842,321);
720SkOpSegment::markWinding id=1 (286.695129,291 229.304855,561) t=0.888942232 [25] (235.678497,531.014404) tEnd=1 newWindSum=1 newOppSum=0 oppSum=? windSum=? windValue=1 oppValue=0
721SkOpSegment::markWinding id=2 (229.304855,561 979.304871,561) t=0 [3] (229.304855,561) tEnd=0.0400000195 newWindSum=1 newOppSum=0 oppSum=? windSum=? windValue=1 oppValue=0
722SkOpSegment::markAngle last segment=2 span=32 windSum=?
723SkOpSegment::markWinding id=9 (259.304871,561 242.736313,561 232.159805,547.568542 235.681549,531) t=0 [17] (259.304871,561) tEnd=0.999710227 newWindSum=-1 newOppSum=1 oppSum=? windSum=? windValue=1 oppValue=0
724SkOpSegment::markAngle last segment=9 span=17 windSum=-1
725SkOpSegment::findNextOp
726SkOpAngle::dumpOne [1/5] next=1/6 sect=5/5 s=0.888942232 [25] e=0.888888891 [27] sgn=1 windVal=1 windSum=1 oppVal=-1 oppSum=-1
727SkOpAngle::dumpOne [1/6] next=9/22 sect=21/21 s=0.888942232 [25] e=1 [2] sgn=-1 windVal=1 windSum=1 oppVal=0 oppSum=0
728SkOpAngle::dumpOne [9/22] next=1/5 sect=21/25 s=0.999710227 [26] e=0 [17] sgn=1 windVal=1 windSum=-1 oppVal=0 oppSum=1 operand
729SkOpSegment::activeOp id=1 t=0.888942232 tEnd=1 op=sect miFrom=0 miTo=1 suFrom=0 suTo=0 result=0
730SkOpSegment::markDone id=1 (286.695129,291 229.304855,561) t=0.888942232 [25] (235.678497,531.014404) tEnd=1 newWindSum=1 newOppSum=0 oppSum=0 windSum=1 windValue=1 oppValue=0
731SkOpSegment::markDone id=2 (229.304855,561 979.304871,561) t=0 [3] (229.304855,561) tEnd=0.0400000195 newWindSum=1 newOppSum=0 oppSum=0 windSum=1 windValue=1 oppValue=0
732SkOpSegment::findNextOp chase.append segment=2 span=32 windSum=-2147483647
733SkOpSegment::activeOp id=9 t=0.999710227 tEnd=0 op=sect miFrom=1 miTo=1 suFrom=0 suTo=1 result=1
734SkOpSegment::findNextOp chase.append segment=9 span=17 windSum=-1
735SkOpSegment::markDone id=1 (286.695129,291 229.304855,561) t=0.888888891 [27] (235.681549,531) tEnd=0.888942232 newWindSum=1 newOppSum=-1 oppSum=-1 windSum=1 windValue=1 oppValue=-1
736SkOpSegment::findNextOp from:[1] to:[9] start=2783272 end=2781880
737bridgeOp current id=1 from=(235.681549,531) to=(235.678497,531.014404)
738path.lineTo(235.681549,531);
739SkOpSegment::markWinding id=2 (229.304855,561 979.304871,561) t=0.0400000195 [32] (259.304871,561) tEnd=0.960000001 newWindSum=1 newOppSum=-1 oppSum=? windSum=? windValue=1 oppValue=-1
740SkOpSegment::markAngle last segment=2 span=31 windSum=?
741SkOpSegment::findNextOp
742SkOpAngle::dumpOne [9/21] next=2/7 sect=14/9 s=0 [17] e=0.999710227 [26] sgn=-1 windVal=1 windSum=-1 oppVal=0 oppSum=1 operand
743SkOpAngle::dumpOne [2/7] next=2/8 sect=15/15 s=0.0400000195 [32] e=0 [3] sgn=1 windVal=1 windSum=1 oppVal=0 oppSum=0 done
744SkOpAngle::dumpOne [2/8] next=9/21 sect=31/31 s=0.0400000195 [32] e=0.960000001 [31] sgn=-1 windVal=1 windSum=1 oppVal=-1 oppSum=-1
745SkOpSegment::activeOp id=2 t=0.0400000195 tEnd=0 op=sect miFrom=1 miTo=0 suFrom=0 suTo=0 result=0
746SkOpSegment::activeOp id=2 t=0.0400000195 tEnd=0.960000001 op=sect miFrom=0 miTo=1 suFrom=0 suTo=1 result=1
747SkOpSegment::findNextOp chase.append segment=2 span=31 windSum=-2147483647
748SkOpSegment::markDone id=9 (259.304871,561 242.736313,561 232.159805,547.568542 235.681549,531) t=0 [17] (259.304871,561) tEnd=0.999710227 newWindSum=-1 newOppSum=1 oppSum=1 windSum=-1 windValue=1 oppValue=0
749SkOpSegment::findNextOp from:[9] to:[2] start=2784424 end=2784280
750bridgeOp current id=9 from=(235.678497,531.014404) to=(259.304871,561)
751path.lineTo(235.678497,531.014404);
752path.cubicTo(232.165939,547.576355, 242.741119,561, 259.304871,561);
753SkOpSegment::markWinding id=2 (229.304855,561 979.304871,561) t=0.960000001 [31] (949.304871,561) tEnd=1 newWindSum=1 newOppSum=0 oppSum=? windSum=? windValue=1 oppValue=0
754SkOpSegment::markWinding id=3 (979.304871,561 1036.69507,291) t=0 [5] (979.304871,561) tEnd=0.11111108 newWindSum=1 newOppSum=0 oppSum=? windSum=? windValue=1 oppValue=0
755SkOpSegment::markAngle last segment=3 span=34 windSum=?
756SkOpSegment::markWinding id=7 (985.681519,531 982.15979,547.568542 965.873413,561 949.304871,561) t=0 [13] (985.681519,531) tEnd=1 newWindSum=-1 newOppSum=1 oppSum=? windSum=? windValue=1 oppValue=0
757SkOpSegment::markAngle last segment=7 span=13 windSum=-1
758SkOpSegment::findNextOp
759SkOpAngle::dumpOne [2/9] next=2/10 sect=15/15 s=0.960000001 [31] e=0.0400000195 [32] sgn=1 windVal=1 windSum=1 oppVal=-1 oppSum=-1
760SkOpAngle::dumpOne [2/10] next=7/20 sect=31/31 s=0.960000001 [31] e=1 [4] sgn=-1 windVal=1 windSum=1 oppVal=0 oppSum=0
761SkOpAngle::dumpOne [7/20] next=2/9 sect=0/1 s=1 [14] e=0 [13] sgn=1 windVal=1 windSum=-1 oppVal=0 oppSum=1 operand
762SkOpSegment::activeOp id=2 t=0.960000001 tEnd=1 op=sect miFrom=0 miTo=1 suFrom=0 suTo=0 result=0
763SkOpSegment::markDone id=2 (229.304855,561 979.304871,561) t=0.960000001 [31] (949.304871,561) tEnd=1 newWindSum=1 newOppSum=0 oppSum=0 windSum=1 windValue=1 oppValue=0
764SkOpSegment::markDone id=3 (979.304871,561 1036.69507,291) t=0 [5] (979.304871,561) tEnd=0.11111108 newWindSum=1 newOppSum=0 oppSum=0 windSum=1 windValue=1 oppValue=0
765SkOpSegment::findNextOp chase.append segment=3 span=34 windSum=-2147483647
766SkOpSegment::activeOp id=7 t=1 tEnd=0 op=sect miFrom=1 miTo=1 suFrom=0 suTo=1 result=1
767SkOpSegment::findNextOp chase.append segment=7 span=13 windSum=-1
768SkOpSegment::markDone id=2 (229.304855,561 979.304871,561) t=0.0400000195 [32] (259.304871,561) tEnd=0.960000001 newWindSum=1 newOppSum=-1 oppSum=-1 windSum=1 windValue=1 oppValue=-1
769SkOpSegment::findNextOp from:[2] to:[7] start=2781400 end=2781256
770bridgeOp current id=2 from=(259.304871,561) to=(949.304871,561)
771SkOpSegment::markWinding id=3 (979.304871,561 1036.69507,291) t=0.11111108 [34] (985.68158,531) tEnd=0.888888874 newWindSum=1 newOppSum=-1 oppSum=? windSum=? windValue=1 oppValue=-1
772SkOpSegment::markAngle last segment=3 span=33 windSum=?
773SkOpSegment::findNextOp
774SkOpAngle::dumpOne [7/19] next=3/11 sect=21/17 s=0 [13] e=1 [14] sgn=-1 windVal=1 windSum=-1 oppVal=0 oppSum=1 operand
775SkOpAngle::dumpOne [3/11] next=3/12 sect=21/21 s=0.11111108 [34] e=0 [5] sgn=1 windVal=1 windSum=1 oppVal=0 oppSum=0 done
776SkOpAngle::dumpOne [3/12] next=7/19 sect=5/5 s=0.11111108 [34] e=0.888888874 [33] sgn=-1 windVal=1 windSum=1 oppVal=-1 oppSum=-1
777SkOpSegment::activeOp id=3 t=0.11111108 tEnd=0 op=sect miFrom=1 miTo=0 suFrom=0 suTo=0 result=0
778SkOpSegment::activeOp id=3 t=0.11111108 tEnd=0.888888874 op=sect miFrom=0 miTo=1 suFrom=0 suTo=1 result=1
779SkOpSegment::findNextOp chase.append segment=3 span=33 windSum=-2147483647
780SkOpSegment::markDone id=7 (985.681519,531 982.15979,547.568542 965.873413,561 949.304871,561) t=0 [13] (985.681519,531) tEnd=1 newWindSum=-1 newOppSum=1 oppSum=1 windSum=-1 windValue=1 oppValue=0
781SkOpSegment::findNextOp from:[7] to:[3] start=2784760 end=2784616
782bridgeOp current id=7 from=(949.304871,561) to=(985.681519,531)
783path.lineTo(949.304871,561);
784path.cubicTo(965.873413,561, 982.15979,547.568542, 985.681519,531);
785SkOpSegment::markWinding id=3 (979.304871,561 1036.69507,291) t=0.888888874 [33] (1030.31836,321) tEnd=1 newWindSum=1 newOppSum=0 oppSum=? windSum=? windValue=1 oppValue=0
786SkOpSegment::markWinding id=4 (1036.69507,291 286.695129,291) t=0 [7] (1036.69507,291) tEnd=0.0399999219 newWindSum=1 newOppSum=0 oppSum=? windSum=? windValue=1 oppValue=0
787SkOpSegment::markAngle last segment=4 span=35 windSum=?
788SkOpSegment::markWinding id=5 (1006.69513,291 1023.26367,291 1033.84021,304.431458 1030.31836,321) t=0 [9] (1006.69513,291) tEnd=1 newWindSum=-1 newOppSum=1 oppSum=? windSum=? windValue=1 oppValue=0
789SkOpSegment::markAngle last segment=5 span=9 windSum=-1
790SkOpSegment::findNextOp
791SkOpAngle::dumpOne [3/13] next=3/14 sect=21/21 s=0.888888874 [33] e=0.11111108 [34] sgn=1 windVal=1 windSum=1 oppVal=-1 oppSum=-1
792SkOpAngle::dumpOne [3/14] next=5/18 sect=5/5 s=0.888888874 [33] e=1 [6] sgn=-1 windVal=1 windSum=1 oppVal=0 oppSum=0
793SkOpAngle::dumpOne [5/18] next=3/13 sect=5/9 s=1 [10] e=0 [9] sgn=1 windVal=1 windSum=-1 oppVal=0 oppSum=1 operand
794SkOpSegment::activeOp id=3 t=0.888888874 tEnd=1 op=sect miFrom=0 miTo=1 suFrom=0 suTo=0 result=0
795SkOpSegment::markDone id=3 (979.304871,561 1036.69507,291) t=0.888888874 [33] (1030.31836,321) tEnd=1 newWindSum=1 newOppSum=0 oppSum=0 windSum=1 windValue=1 oppValue=0
796SkOpSegment::markDone id=4 (1036.69507,291 286.695129,291) t=0 [7] (1036.69507,291) tEnd=0.0399999219 newWindSum=1 newOppSum=0 oppSum=0 windSum=1 windValue=1 oppValue=0
797SkOpSegment::findNextOp chase.append segment=4 span=35 windSum=-2147483647
798SkOpSegment::activeOp id=5 t=1 tEnd=0 op=sect miFrom=1 miTo=1 suFrom=0 suTo=1 result=1
799SkOpSegment::findNextOp chase.append segment=5 span=9 windSum=-1
800SkOpSegment::markDone id=3 (979.304871,561 1036.69507,291) t=0.11111108 [34] (985.68158,531) tEnd=0.888888874 newWindSum=1 newOppSum=-1 oppSum=-1 windSum=1 windValue=1 oppValue=-1
801SkOpSegment::findNextOp from:[3] to:[5] start=2780712 end=2780568
802bridgeOp current id=3 from=(985.68158,531) to=(1030.31836,321)
803SkOpSegment::findNextOp
804SkOpAngle::dumpOne [5/17] next=4/15 sect=30/25 s=0 [9] e=1 [10] sgn=-1 windVal=1 windSum=-1 oppVal=0 oppSum=1 operand
805SkOpAngle::dumpOne [4/15] next=12/28 sect=31/31 s=0.0399999219 [35] e=0 [7] sgn=1 windVal=1 windSum=1 oppVal=0 oppSum=0 done
806SkOpAngle::dumpOne [12/28] next=5/17 sect=15/15 s=1 [24] e=0 [23] sgn=1 windVal=1 windSum=-1 oppVal=1 oppSum=2 operand
807SkOpSegment::activeOp id=4 t=0.0399999219 tEnd=0 op=sect miFrom=1 miTo=0 suFrom=0 suTo=0 result=0
808SkOpSegment::activeOp id=12 t=1 tEnd=0 op=sect miFrom=0 miTo=1 suFrom=0 suTo=1 result=1
809SkOpSegment::markDone id=5 (1006.69513,291 1023.26367,291 1033.84021,304.431458 1030.31836,321) t=0 [9] (1006.69513,291) tEnd=1 newWindSum=-1 newOppSum=1 oppSum=1 windSum=-1 windValue=1 oppValue=0
810SkOpSegment::findNextOp from:[5] to:[12] start=2782960 end=2782816
811bridgeOp current id=5 from=(1030.31836,321) to=(1006.69513,291)
812path.lineTo(1030.31836,321);
813path.cubicTo(1033.84021,304.431458, 1023.26367,291, 1006.69513,291);
814SkOpSegment::findNextOp
815SkOpAngle::dumpOne [12/27] next=4/16 sect=31/31 s=0 [23] e=1 [24] sgn=-1 windVal=1 windSum=-1 oppVal=1 oppSum=2 operand
816SkOpAngle::dumpOne [4/16] next=11/26 sect=15/15 s=0.959999997 [36] e=1 [8] sgn=-1 windVal=1 windSum=1 oppVal=0 oppSum=0 done
817SkOpAngle::dumpOne [11/26] next=12/27 sect=16/17 s=1 [22] e=0.000542504226 [30] sgn=1 windVal=1 windSum=-1 oppVal=0 oppSum=1 done operand
818SkOpSegment::activeOp id=4 t=0.959999997 tEnd=1 op=sect miFrom=0 miTo=1 suFrom=0 suTo=0 result=0
819SkOpSegment::activeOp id=11 t=1 tEnd=0.000542504226 op=sect miFrom=1 miTo=1 suFrom=0 suTo=1 result=1
820SkOpSegment::markDone id=12 (316.695129,291 1006.69513,291) t=0 [23] (316.695129,291) tEnd=1 newWindSum=-1 newOppSum=2 oppSum=2 windSum=-1 windValue=1 oppValue=1
821SkOpSegment::findNextOp from:[12] to:[11] start=2782648 end=2784088
822bridgeOp current id=12 from=(1006.69513,291) to=(316.695129,291)
823path.lineTo(316.695129,291);
Cary Clark7eb01e02016-12-08 14:36:32 -0500824path.close();
Cary Clarkff114282016-12-14 11:56:16 -0500825</div>
826
827Skia UnitTests: --match PathOpsOp$ --resourcePath resources\ -v -V SK_DEBUG
828
829<div id="skpeldorado_com_ua1_broken">
830SkDCubic::ComplexBreak
831{{{1006.69512939453125, 291}, {1023.263671875, 291}, {1033.8402099609375, 304.43145751953125}, {1030.318359375, 321}}},
832maxCurvature[0]=0.474344964 {{{998.1828178832590766, 267.6895845341347808}, {1052.542975701327805, 330.2457181562319306}}},
833SkDCubic::ComplexBreak
834{{{259.30487060546875, 561}, {242.7363128662109375, 561}, {232.1598052978515625, 547.56854248046875}, {235.681549072265625, 531}}},
835maxCurvature[0]=0.474343429 {{{267.8173432015576623, 584.3103847404762519}, {213.4569259608067568, 521.7544086132262464}}},
836seg=1 {{{286.695129f, 291}, {229.304855f, 561}}}
837seg=2 {{{229.304855f, 561}, {979.304871f, 561}}}
838seg=3 {{{979.304871f, 561}, {1036.69507f, 291}}}
839seg=4 {{{1036.69507f, 291}, {286.695129f, 291}}}
840op sect
841seg=5 {{{1006.69513f, 291}, {1023.26367f, 291}, {1033.84021f, 304.431458f}, {1030.31836f, 321}}}
842seg=6 {{{1030.31836f, 321}, {985.681519f, 531}}}
843seg=7 {{{985.681519f, 531}, {982.15979f, 547.568542f}, {965.873413f, 561}, {949.304871f, 561}}}
844seg=8 {{{949.304871f, 561}, {259.304871f, 561}}}
845seg=9 {{{259.304871f, 561}, {242.736313f, 561}, {232.159805f, 547.568542f}, {235.681549f, 531}}}
846seg=10 {{{235.681549f, 531}, {280.31842f, 321}}}
847seg=11 {{{280.31842f, 321}, {283.840179f, 304.431458f}, {300.126587f, 291}, {316.695129f, 291}}}
848seg=12 {{{316.695129f, 291}, {1006.69513f, 291}}}
849debugShowLineIntersection wtTs[0]=1 {{{286.695129,291}, {229.304855,561}}} {{229.304855,561}} wnTs[0]=0 {{{229.304855,561}, {979.304871,561}}}
850debugShowLineIntersection wtTs[0]=0 {{{286.695129,291}, {229.304855,561}}} {{286.695129,291}} wnTs[0]=1 {{{1036.69507,291}, {286.695129,291}}}
851debugShowLineIntersection wtTs[0]=0 {{{979.304871,561}, {1036.69507,291}}} {{979.304871,561}} wnTs[0]=1 {{{229.304855,561}, {979.304871,561}}}
852debugShowLineIntersection wtTs[0]=1 {{{979.304871,561}, {1036.69507,291}}} {{1036.69507,291}} wnTs[0]=0 {{{1036.69507,291}, {286.695129,291}}}
853debugShowLineIntersection no intersect {{{286.695129,291}, {229.304855,561}}} {{{949.304871,561}, {259.304871,561}}}
854debugShowCubicLineIntersection wtTs[0]=0.999710227 {{{259.304871,561}, {242.736313,561}, {232.159805,547.568542}, {235.681549,531}}} {{235.678497,531.014404}} wtTs[1]=1 {{235.681549,531}} wnTs[0]=0.888942 {{{286.695129,291}, {229.304855,561}}} wnTs[1]=0.888888891
855SkOpSegment::addT insert t=0.888942232 segID=1 spanID=25
856SkOpSegment::addT insert t=0.999710227 segID=9 spanID=26
857SkOpSegment::addT insert t=0.888888891 segID=1 spanID=27
858debugShowLineIntersection wtTs[0]=0.11111112 {{{286.695129,291}, {229.304855,561}}} {{280.31842,321}} wtTs[1]=0.888888891 {{235.681549,531}} wnTs[0]=1 {{{235.681549,531}, {280.31842,321}}} wnTs[1]=0
859SkOpSegment::addT insert t=0.11111112 segID=1 spanID=28
860debugShowCubicLineIntersection wtTs[0]=0 {{{280.31842,321}, {283.840179,304.431458}, {300.126587,291}, {316.695129,291}}} {{280.31842,321}} wtTs[1]=0.000542504226 {{280.324158,320.973022}} wnTs[0]=0.111111 {{{286.695129,291}, {229.304855,561}}} wnTs[1]=0.111011249
861SkOpSegment::addT insert t=0.111011249 segID=1 spanID=29
862SkOpSegment::addT insert t=0.000542504226 segID=11 spanID=30
863debugShowCubicLineIntersection wtTs[0]=1 {{{985.681519,531}, {982.15979,547.568542}, {965.873413,561}, {949.304871,561}}} {{949.304871,561}} wnTs[0]=0.96 {{{229.304855,561}, {979.304871,561}}}
864SkOpSegment::addT insert t=0.960000001 segID=2 spanID=31
865debugShowLineIntersection wtTs[0]=0 {{{949.304871,561}, {259.304871,561}}} {{949.304871,561}} wtTs[1]=1 {{259.304871,561}} wnTs[0]=0.96 {{{229.304855,561}, {979.304871,561}}} wnTs[1]=0.0400000195
866SkOpSegment::addT insert t=0.0400000195 segID=2 spanID=32
867debugShowCubicLineIntersection wtTs[0]=0 {{{259.304871,561}, {242.736313,561}, {232.159805,547.568542}, {235.681549,531}}} {{259.304871,561}} wnTs[0]=0.04 {{{229.304855,561}, {979.304871,561}}}
868debugShowCubicLineIntersection wtTs[0]=1 {{{1006.69513,291}, {1023.26367,291}, {1033.84021,304.431458}, {1030.31836,321}}} {{1030.31836,321}} wnTs[0]=0.888889 {{{979.304871,561}, {1036.69507,291}}}
869SkOpSegment::addT insert t=0.888888874 segID=3 spanID=33
870debugShowLineIntersection wtTs[0]=0.11111108 {{{979.304871,561}, {1036.69507,291}}} {{985.681519,531}} wtTs[1]=0.888888874 {{1030.31836,321}} wnTs[0]=1 {{{1030.31836,321}, {985.681519,531}}} wnTs[1]=0
871SkOpSegment::addT insert t=0.11111108 segID=3 spanID=34
872debugShowCubicLineIntersection wtTs[0]=0 {{{985.681519,531}, {982.15979,547.568542}, {965.873413,561}, {949.304871,561}}} {{985.681519,531}} wnTs[0]=0.111111 {{{979.304871,561}, {1036.69507,291}}}
873debugShowLineIntersection no intersect {{{979.304871,561}, {1036.69507,291}}} {{{316.695129,291}, {1006.69513,291}}}
874debugShowCubicLineIntersection wtTs[0]=0 {{{1006.69513,291}, {1023.26367,291}, {1033.84021,304.431458}, {1030.31836,321}}} {{1006.69513,291}} wnTs[0]=0.0399999 {{{1036.69507,291}, {286.695129,291}}}
875SkOpSegment::addT insert t=0.0399999219 segID=4 spanID=35
876debugShowCubicLineIntersection wtTs[0]=1 {{{280.31842,321}, {283.840179,304.431458}, {300.126587,291}, {316.695129,291}}} {{316.695129,291}} wnTs[0]=0.96 {{{1036.69507,291}, {286.695129,291}}}
877SkOpSegment::addT insert t=0.959999997 segID=4 spanID=36
878debugShowLineIntersection wtTs[0]=0 {{{316.695129,291}, {1006.69513,291}}} {{316.695129,291}} wtTs[1]=1 {{1006.69513,291}} wnTs[0]=0.96 {{{1036.69507,291}, {286.695129,291}}} wnTs[1]=0.0399999219
879debugShowCubicLineIntersection wtTs[0]=1 {{{1006.69513,291}, {1023.26367,291}, {1033.84021,304.431458}, {1030.31836,321}}} {{1030.31836,321}} wnTs[0]=0 {{{1030.31836,321}, {985.681519,531}}}
880debugShowCubicLineIntersection wtTs[0]=0 {{{1006.69513,291}, {1023.26367,291}, {1033.84021,304.431458}, {1030.31836,321}}} {{1006.69513,291}} wnTs[0]=1 {{{316.695129,291}, {1006.69513,291}}}
881debugShowCubicLineIntersection wtTs[0]=0 {{{985.681519,531}, {982.15979,547.568542}, {965.873413,561}, {949.304871,561}}} {{985.681519,531}} wnTs[0]=1 {{{1030.31836,321}, {985.681519,531}}}
882debugShowCubicLineIntersection wtTs[0]=1 {{{985.681519,531}, {982.15979,547.568542}, {965.873413,561}, {949.304871,561}}} {{949.304871,561}} wnTs[0]=0 {{{949.304871,561}, {259.304871,561}}}
883debugShowCubicLineIntersection wtTs[0]=0 {{{259.304871,561}, {242.736313,561}, {232.159805,547.568542}, {235.681549,531}}} {{259.304871,561}} wnTs[0]=1 {{{949.304871,561}, {259.304871,561}}}
884debugShowCubicLineIntersection wtTs[0]=1 {{{259.304871,561}, {242.736313,561}, {232.159805,547.568542}, {235.681549,531}}} {{235.681549,531}} wnTs[0]=0 {{{235.681549,531}, {280.31842,321}}}
885debugShowCubicLineIntersection wtTs[0]=0 {{{280.31842,321}, {283.840179,304.431458}, {300.126587,291}, {316.695129,291}}} {{280.31842,321}} wnTs[0]=1 {{{235.681549,531}, {280.31842,321}}}
886debugShowCubicLineIntersection wtTs[0]=1 {{{280.31842,321}, {283.840179,304.431458}, {300.126587,291}, {316.695129,291}}} {{316.695129,291}} wnTs[0]=0 {{{316.695129,291}, {1006.69513,291}}}
887------------------x--x---------------- addExpanded
88800: seg/base=12/23 seg/base=4/35 MarkCoinStart
88901: seg/base=12/24 seg/base=4/36 MarkCoinEnd
89002: seg/base=3/34 seg/base=6/11 MarkCoinStart
89103: seg/base=3/33 seg/base=6/12 MarkCoinEnd
89204: seg/base=2/32 seg/base=8/15 MarkCoinStart
89305: seg/base=2/31 seg/base=8/16 MarkCoinEnd
89406: seg/base=1/29 seg/base=11/21 MarkCoinStart
89507: seg/base=1/28 seg/base=11/30 MarkCoinEnd
89608: seg/base=10/19 seg/base=1/28 MarkCoinStart
89709: seg/base=10/20 seg/base=1/27 MarkCoinEnd
89810: seg/base=1/27 seg/base=9/26 MarkCoinStart
89911: seg/base=1/25 seg/base=9/18 MarkCoinEnd
900SkOpSegment::debugShowActiveSpans id=1 (286.695129,291 280.324158,320.973022) t=0 tEnd=0.111011249 windSum=? windValue=1
901SkOpSegment::debugShowActiveSpans id=1 (280.324158,320.973022 280.31842,321) t=0.111011249 tEnd=0.11111112 windSum=? windValue=1
902SkOpSegment::debugShowActiveSpans id=1 (280.31842,321 235.681549,531) t=0.11111112 tEnd=0.888888891 windSum=? windValue=1
903SkOpSegment::debugShowActiveSpans id=1 (235.681549,531 235.678497,531.014404) t=0.888888891 tEnd=0.888942232 windSum=? windValue=1
904SkOpSegment::debugShowActiveSpans id=1 (235.678497,531.014404 229.304855,561) t=0.888942232 tEnd=1 windSum=? windValue=1
905SkOpSegment::debugShowActiveSpans id=2 (229.304855,561 259.304871,561) t=0 tEnd=0.0400000195 windSum=? windValue=1
906SkOpSegment::debugShowActiveSpans id=2 (259.304871,561 949.304871,561) t=0.0400000195 tEnd=0.960000001 windSum=? windValue=1
907SkOpSegment::debugShowActiveSpans id=2 (949.304871,561 979.304871,561) t=0.960000001 tEnd=1 windSum=? windValue=1
908SkOpSegment::debugShowActiveSpans id=3 (979.304871,561 985.68158,531) t=0 tEnd=0.11111108 windSum=? windValue=1
909SkOpSegment::debugShowActiveSpans id=3 (985.68158,531 1030.31836,321) t=0.11111108 tEnd=0.888888874 windSum=? windValue=1
910SkOpSegment::debugShowActiveSpans id=3 (1030.31836,321 1036.69507,291) t=0.888888874 tEnd=1 windSum=? windValue=1
911SkOpSegment::debugShowActiveSpans id=4 (1036.69507,291 1006.69513,291) t=0 tEnd=0.0399999219 windSum=? windValue=1
912SkOpSegment::debugShowActiveSpans id=4 (1006.69513,291 316.695129,291) t=0.0399999219 tEnd=0.959999997 windSum=? windValue=1
913SkOpSegment::debugShowActiveSpans id=4 (316.695129,291 286.695129,291) t=0.959999997 tEnd=1 windSum=? windValue=1
914SkOpSegment::debugShowActiveSpans id=5 (1006.69513,291 1023.26367,291 1033.84021,304.431458 1030.31836,321) t=0 tEnd=1 windSum=? windValue=1
915SkOpSegment::debugShowActiveSpans id=6 (1030.31836,321 985.681519,531) t=0 tEnd=1 windSum=? windValue=1
916SkOpSegment::debugShowActiveSpans id=7 (985.681519,531 982.15979,547.568542 965.873413,561 949.304871,561) t=0 tEnd=1 windSum=? windValue=1
917SkOpSegment::debugShowActiveSpans id=8 (949.304871,561 259.304871,561) t=0 tEnd=1 windSum=? windValue=1
918SkOpSegment::debugShowActiveSpans id=9 (259.304871,561 242.741114,561 232.165942,547.576327 235.678497,531.014404) t=0 tEnd=0.999710227 windSum=? windValue=1
919SkOpSegment::debugShowActiveSpans id=9 (235.678497,531.014404 235.679515,531.009604 235.680529,531.004801 235.681549,531) t=0.999710227 tEnd=1 windSum=? windValue=1
920SkOpSegment::debugShowActiveSpans id=10 (235.681549,531 280.31842,321) t=0 tEnd=1 windSum=? windValue=1
921SkOpSegment::debugShowActiveSpans id=11 (280.31842,321 280.320331,320.991011 280.32224,320.982009 280.324158,320.973022) t=0 tEnd=0.000542504226 windSum=? windValue=1
922SkOpSegment::debugShowActiveSpans id=11 (280.324158,320.973022 283.857845,304.416873 300.135575,291 316.695129,291) t=0.000542504226 tEnd=1 windSum=? windValue=1
923SkOpSegment::debugShowActiveSpans id=12 (316.695129,291 1006.69513,291) t=0 tEnd=1 windSum=? windValue=1
924------------------x--x---------------- move_multiples
92500: seg/base=12/23 seg/base=4/35 MarkCoinStart
92601: seg/base=12/24 seg/base=4/36 MarkCoinEnd
92702: seg/base=3/34 seg/base=6/11 MarkCoinStart
92803: seg/base=3/33 seg/base=6/12 MarkCoinEnd
92904: seg/base=2/32 seg/base=8/15 MarkCoinStart
93005: seg/base=2/31 seg/base=8/16 MarkCoinEnd
93106: seg/base=1/29 seg/base=11/21 MarkCoinStart
93207: seg/base=1/28 seg/base=11/30 MarkCoinEnd
93308: seg/base=10/19 seg/base=1/28 MarkCoinStart
93409: seg/base=10/20 seg/base=1/27 MarkCoinEnd
93510: seg/base=1/27 seg/base=9/26 MarkCoinStart
93611: seg/base=1/25 seg/base=9/18 MarkCoinEnd
937------------------x--x---------------- move_nearby
93800: seg/base=12/23 seg/base=4/35 MarkCoinStart
93901: seg/base=12/24 seg/base=4/36 MarkCoinEnd
94002: seg/base=3/34 seg/base=6/11 MarkCoinStart
94103: seg/base=3/33 seg/base=6/12 MarkCoinEnd
94204: seg/base=2/32 seg/base=8/15 MarkCoinStart
94305: seg/base=2/31 seg/base=8/16 MarkCoinEnd
94406: seg/base=1/29 seg/base=11/21 MarkCoinStart
94507: seg/base=1/28 seg/base=11/30 MarkCoinEnd
94608: seg/base=10/19 seg/base=1/28 MarkCoinStart
94709: seg/base=10/20 seg/base=1/27 MarkCoinEnd
94810: seg/base=1/27 seg/base=9/26 MarkCoinStart
94911: seg/base=1/25 seg/base=9/18 MarkCoinEnd
950------------------x--x---------------- correctEnds
95100: seg/base=12/23 seg/base=4/35 MarkCoinStart
95201: seg/base=12/24 seg/base=4/36 MarkCoinEnd
95302: seg/base=3/34 seg/base=6/11 MarkCoinStart
95403: seg/base=3/33 seg/base=6/12 MarkCoinEnd
95504: seg/base=2/32 seg/base=8/15 MarkCoinStart
95605: seg/base=2/31 seg/base=8/16 MarkCoinEnd
95706: seg/base=1/29 seg/base=11/21 MarkCoinStart
95807: seg/base=1/28 seg/base=11/30 MarkCoinEnd
95908: seg/base=10/19 seg/base=1/28 MarkCoinStart
96009: seg/base=10/20 seg/base=1/27 MarkCoinEnd
96110: seg/base=1/27 seg/base=9/26 MarkCoinStart
96211: seg/base=1/25 seg/base=9/18 MarkCoinEnd
963------------------x--x---------------- addEndMovedSpans
96400: seg/base=12/23 seg/base=4/35 MarkCoinStart
96501: seg/base=12/24 seg/base=4/36 MarkCoinEnd
96602: seg/base=3/34 seg/base=6/11 MarkCoinStart
96703: seg/base=3/33 seg/base=6/12 MarkCoinEnd
96804: seg/base=2/32 seg/base=8/15 MarkCoinStart
96905: seg/base=2/31 seg/base=8/16 MarkCoinEnd
97006: seg/base=1/29 seg/base=11/21 MarkCoinStart
97107: seg/base=1/28 seg/base=11/30 MarkCoinEnd
97208: seg/base=10/19 seg/base=1/28 MarkCoinStart
97309: seg/base=10/20 seg/base=1/27 MarkCoinEnd
97410: seg/base=1/27 seg/base=9/26 MarkCoinStart
97511: seg/base=1/25 seg/base=9/18 MarkCoinEnd
976------------------x--x---------------- expand
97700: seg/base=12/23 seg/base=4/35 MarkCoinStart
97801: seg/base=12/24 seg/base=4/36 MarkCoinEnd
97902: seg/base=3/34 seg/base=6/11 MarkCoinStart
98003: seg/base=3/33 seg/base=6/12 MarkCoinEnd
98104: seg/base=2/32 seg/base=8/15 MarkCoinStart
98205: seg/base=2/31 seg/base=8/16 MarkCoinEnd
98306: seg/base=1/29 seg/base=11/21 MarkCoinStart
98407: seg/base=1/28 seg/base=11/30 MarkCoinEnd
98508: seg/base=10/19 seg/base=1/28 MarkCoinStart
98609: seg/base=10/20 seg/base=1/27 MarkCoinEnd
98710: seg/base=1/27 seg/base=9/26 MarkCoinStart
98811: seg/base=1/25 seg/base=9/18 MarkCoinEnd
989------------------x--x---------------- addExpanded
99000: seg/base=12/23 seg/base=4/35 MarkCoinStart
99101: seg/base=12/24 seg/base=4/36 MarkCoinEnd
99202: seg/base=3/34 seg/base=6/11 MarkCoinStart
99303: seg/base=3/33 seg/base=6/12 MarkCoinEnd
99404: seg/base=2/32 seg/base=8/15 MarkCoinStart
99505: seg/base=2/31 seg/base=8/16 MarkCoinEnd
99606: seg/base=1/29 seg/base=11/21 MarkCoinStart
99707: seg/base=1/28 seg/base=11/30 MarkCoinEnd
99808: seg/base=10/19 seg/base=1/28 MarkCoinStart
99909: seg/base=10/20 seg/base=1/27 MarkCoinEnd
100010: seg/base=1/27 seg/base=9/26 MarkCoinStart
100111: seg/base=1/25 seg/base=9/18 MarkCoinEnd
1002------------------x--x---------------- mark
100300: seg/base=12/23 seg/base=4/35 MarkCoinStart
100401: seg/base=12/24 seg/base=4/36 MarkCoinEnd
100502: seg/base=3/34 seg/base=6/11 MarkCoinStart
100603: seg/base=3/33 seg/base=6/12 MarkCoinEnd
100704: seg/base=2/32 seg/base=8/15 MarkCoinStart
100805: seg/base=2/31 seg/base=8/16 MarkCoinEnd
100906: seg/base=1/29 seg/base=11/21 MarkCoinStart
101007: seg/base=1/28 seg/base=11/30 MarkCoinEnd
101108: seg/base=10/19 seg/base=1/28 MarkCoinStart
101209: seg/base=10/20 seg/base=1/27 MarkCoinEnd
101310: seg/base=1/27 seg/base=9/26 MarkCoinStart
101411: seg/base=1/25 seg/base=9/18 MarkCoinEnd
1015-------------------------------------- missing_coincidence
1016-------------------------------------- expand
1017-------------------------------------- expand
1018-------------------------------------- apply
1019SkOpSegment::markDone id=4 (1036.69507,291 286.695129,291) t=0.0399999219 [35] (1006.69513,291) tEnd=0.959999997 newWindSum=? newOppSum=? oppSum=? windSum=? windValue=0 oppValue=0
1020SkOpSegment::markDone id=6 (1030.31836,321 985.681519,531) t=0 [11] (1030.31836,321) tEnd=1 newWindSum=? newOppSum=? oppSum=? windSum=? windValue=0 oppValue=0
1021SkOpSegment::markDone id=8 (949.304871,561 259.304871,561) t=0 [15] (949.304871,561) tEnd=1 newWindSum=? newOppSum=? oppSum=? windSum=? windValue=0 oppValue=0
1022SkOpSegment::markDone id=11 (280.31842,321 283.840179,304.431458 300.126587,291 316.695129,291) t=0 [21] (280.31842,321) tEnd=0.000542504226 newWindSum=? newOppSum=? oppSum=? windSum=? windValue=0 oppValue=0
1023SkOpSegment::markDone id=1 (286.695129,291 229.304855,561) t=0.11111112 [28] (280.31842,321) tEnd=0.888888891 newWindSum=? newOppSum=? oppSum=? windSum=? windValue=0 oppValue=0
1024SkOpSegment::markDone id=9 (259.304871,561 242.736313,561 232.159805,547.568542 235.681549,531) t=0.999710227 [26] (235.678497,531.014404) tEnd=1 newWindSum=? newOppSum=? oppSum=? windSum=? windValue=0 oppValue=0
1025-------------------------------------- findOverlaps
1026SkOpSegment::debugShowActiveSpans id=1 (286.695129,291 280.324158,320.973022) t=0 tEnd=0.111011249 windSum=? windValue=1
1027SkOpSegment::debugShowActiveSpans id=1 (280.324158,320.973022 280.31842,321) t=0.111011249 tEnd=0.11111112 windSum=? oppSum=? windValue=1 oppValue=-1
1028SkOpSegment::debugShowActiveSpans id=1 (235.681549,531 235.678497,531.014404) t=0.888888891 tEnd=0.888942232 windSum=? oppSum=? windValue=1 oppValue=-1
1029SkOpSegment::debugShowActiveSpans id=1 (235.678497,531.014404 229.304855,561) t=0.888942232 tEnd=1 windSum=? windValue=1
1030SkOpSegment::debugShowActiveSpans id=2 (229.304855,561 259.304871,561) t=0 tEnd=0.0400000195 windSum=? windValue=1
1031SkOpSegment::debugShowActiveSpans id=2 (259.304871,561 949.304871,561) t=0.0400000195 tEnd=0.960000001 windSum=? oppSum=? windValue=1 oppValue=-1
1032SkOpSegment::debugShowActiveSpans id=2 (949.304871,561 979.304871,561) t=0.960000001 tEnd=1 windSum=? windValue=1
1033SkOpSegment::debugShowActiveSpans id=3 (979.304871,561 985.68158,531) t=0 tEnd=0.11111108 windSum=? windValue=1
1034SkOpSegment::debugShowActiveSpans id=3 (985.68158,531 1030.31836,321) t=0.11111108 tEnd=0.888888874 windSum=? oppSum=? windValue=1 oppValue=-1
1035SkOpSegment::debugShowActiveSpans id=3 (1030.31836,321 1036.69507,291) t=0.888888874 tEnd=1 windSum=? windValue=1
1036SkOpSegment::debugShowActiveSpans id=4 (1036.69507,291 1006.69513,291) t=0 tEnd=0.0399999219 windSum=? windValue=1
1037SkOpSegment::debugShowActiveSpans id=4 (316.695129,291 286.695129,291) t=0.959999997 tEnd=1 windSum=? windValue=1
1038SkOpSegment::debugShowActiveSpans id=5 (1006.69513,291 1023.26367,291 1033.84021,304.431458 1030.31836,321) t=0 tEnd=1 windSum=? windValue=1
1039SkOpSegment::debugShowActiveSpans id=7 (985.681519,531 982.15979,547.568542 965.873413,561 949.304871,561) t=0 tEnd=1 windSum=? windValue=1
1040SkOpSegment::debugShowActiveSpans id=9 (259.304871,561 242.741114,561 232.165942,547.576327 235.678497,531.014404) t=0 tEnd=0.999710227 windSum=? windValue=1
1041SkOpSegment::debugShowActiveSpans id=10 (235.681549,531 280.31842,321) t=0 tEnd=1 windSum=? oppSum=? windValue=1 oppValue=1
1042SkOpSegment::debugShowActiveSpans id=11 (280.324158,320.973022 283.857845,304.416873 300.135575,291 316.695129,291) t=0.000542504226 tEnd=1 windSum=? windValue=1
1043SkOpSegment::debugShowActiveSpans id=12 (316.695129,291 1006.69513,291) t=0 tEnd=1 windSum=? oppSum=? windValue=1 oppValue=1
1044-------------------------------------- calc_angles
1045SkOpSegment::sortAngles [1] tStart=0.111011249 [29]
1046SkOpAngle::after [1/1] 5/5 tStart=0.111011249 tEnd=0 < [11/25] 5/1 tStart=0.000542504226 tEnd=1 < [1/2] 21/21 tStart=0.111011249 tEnd=0.11111112 F 14
1047SkOpAngle::afterPart {{{280.324158,320.973022}, {286.695129,291}}} id=1
1048SkOpAngle::afterPart {{{280.324158,320.973022}, {283.857845,304.416873}, {300.135575,291}, {316.695129,291}}} id=11
1049SkOpAngle::afterPart {{{280.324158,320.973022}, {280.31842,321}}} id=1
1050SkOpSegment::sortAngles [1] tStart=0.11111112 [28]
1051SkOpSegment::sortAngles [1] tStart=0.888888891 [27]
1052SkOpSegment::sortAngles [1] tStart=0.888942232 [25]
1053SkOpAngle::after [1/5] 5/5 tStart=0.888942232 tEnd=0.888888891 < [9/22] 21/25 tStart=0.999710227 tEnd=0 < [1/6] 21/21 tStart=0.888942232 tEnd=1 F 13
1054SkOpAngle::afterPart {{{235.678497,531.014404}, {235.681549,531}}} id=1
1055SkOpAngle::afterPart {{{235.678497,531.014404}, {232.165942,547.576327}, {242.741114,561}, {259.304871,561}}} id=9
1056SkOpAngle::afterPart {{{235.678497,531.014404}, {229.304855,561}}} id=1
1057SkOpSegment::sortAngles [2] tStart=0.0400000195 [32]
1058SkOpAngle::after [2/7] 15/15 tStart=0.0400000195 tEnd=0 < [9/21] 14/9 tStart=0 tEnd=0.999710227 < [2/8] 31/31 tStart=0.0400000195 tEnd=0.960000001 F 4
1059SkOpAngle::afterPart {{{259.304871,561}, {229.304855,561}}} id=2
1060SkOpAngle::afterPart {{{259.304871,561}, {242.741114,561}, {232.165942,547.576327}, {235.678497,531.014404}}} id=9
1061SkOpAngle::afterPart {{{259.304871,561}, {949.304871,561}}} id=2
1062SkOpSegment::sortAngles [2] tStart=0.960000001 [31]
1063SkOpAngle::after [2/9] 15/15 tStart=0.960000001 tEnd=0.0400000195 < [7/20] 0/1 tStart=1 tEnd=0 < [2/10] 31/31 tStart=0.960000001 tEnd=1 F 4
1064SkOpAngle::afterPart {{{949.304871,561}, {259.304871,561}}} id=2
1065SkOpAngle::afterPart {{{949.304871,561}, {965.873413,561}, {982.15979,547.568542}, {985.681519,531}}} id=7
1066SkOpAngle::afterPart {{{949.304871,561}, {979.304871,561}}} id=2
1067SkOpSegment::sortAngles [3] tStart=0.11111108 [34]
1068SkOpAngle::after [3/11] 21/21 tStart=0.11111108 tEnd=0 < [7/19] 21/17 tStart=0 tEnd=1 < [3/12] 5/5 tStart=0.11111108 tEnd=0.888888874 T 14
1069SkOpAngle::afterPart {{{985.681519,531}, {979.30481,561}}} id=3
1070SkOpAngle::afterPart {{{985.681519,531}, {982.15979,547.568542}, {965.873413,561}, {949.304871,561}}} id=7
1071SkOpAngle::afterPart {{{985.681519,531}, {1030.3183,321}}} id=3
1072SkOpSegment::sortAngles [3] tStart=0.888888874 [33]
1073SkOpAngle::after [3/13] 21/21 tStart=0.888888874 tEnd=0.11111108 < [5/18] 5/9 tStart=1 tEnd=0 < [3/14] 5/5 tStart=0.888888874 tEnd=1 F 13
1074SkOpAngle::afterPart {{{1030.31836,321}, {985.68158,531}}} id=3
1075SkOpAngle::afterPart {{{1030.31836,321}, {1033.84021,304.431458}, {1023.26367,291}, {1006.69513,291}}} id=5
1076SkOpAngle::afterPart {{{1030.31836,321}, {1036.69507,291}}} id=3
1077SkOpSegment::sortAngles [4] tStart=0.0399999219 [35]
1078SkOpAngle::after [4/15] 31/31 tStart=0.0399999219 tEnd=0 < [5/17] 30/25 tStart=0 tEnd=1 < [12/28] 15/15 tStart=1 tEnd=0 F 4
1079SkOpAngle::afterPart {{{1006.69513,291}, {1036.69507,291}}} id=4
1080SkOpAngle::afterPart {{{1006.69513,291}, {1023.26367,291}, {1033.84021,304.431458}, {1030.31836,321}}} id=5
1081SkOpAngle::afterPart {{{1006.69513,291}, {316.695129,291}}} id=12
1082SkOpSegment::sortAngles [4] tStart=0.959999997 [36]
1083SkOpAngle::after [4/16] 15/15 tStart=0.959999997 tEnd=1 < [11/26] 16/17 tStart=1 tEnd=0.000542504226 < [12/27] 31/31 tStart=0 tEnd=1 T 4
1084SkOpAngle::afterPart {{{316.695129,291}, {286.695129,291}}} id=4
1085SkOpAngle::afterPart {{{316.695129,291}, {300.135575,291}, {283.857845,304.416873}, {280.324158,320.973022}}} id=11
1086SkOpAngle::afterPart {{{316.695129,291}, {1006.69513,291}}} id=12
1087SkOpSegment::sortAngles [5] tStart=0 [9]
1088SkOpSegment::sortAngles [5] tStart=1 [10]
1089SkOpSegment::sortAngles [7] tStart=0 [13]
1090SkOpSegment::sortAngles [7] tStart=1 [14]
1091SkOpSegment::sortAngles [9] tStart=0 [17]
1092SkOpSegment::sortAngles [9] tStart=0.999710227 [26]
1093SkOpSegment::sortAngles [10] tStart=0 [19]
1094SkOpSegment::sortAngles [10] tStart=1 [20]
1095SkOpSegment::sortAngles [11] tStart=0.000542504226 [30]
1096SkOpSegment::sortAngles [11] tStart=1 [22]
1097SkOpSegment::sortAngles [12] tStart=0 [23]
1098SkOpSegment::sortAngles [12] tStart=1 [24]
1099coinSpan - id=12 t=0 tEnd=1
1100coinSpan + id=4 t=0.959999997 tEnd=0.0399999219
1101coinSpan - id=3 t=0.11111108 tEnd=0.888888874
1102coinSpan + id=6 t=1 tEnd=0
1103coinSpan - id=2 t=0.0400000195 tEnd=0.960000001
1104coinSpan + id=8 t=1 tEnd=0
1105coinSpan - id=1 t=0.111011249 tEnd=0.11111112
1106coinSpan + id=11 t=0.000542504226 tEnd=0
1107coinSpan - id=10 t=0 tEnd=1
1108coinSpan + id=1 t=0.888888891 tEnd=0.11111112
1109coinSpan - id=1 t=0.888888891 tEnd=0.888942232
1110coinSpan + id=9 t=1 tEnd=0.999710227
1111SkOpSpan::sortableTop dir=kLeft seg=1 t=0.0555056246 pt=(283.509644,305.986511)
1112SkOpSpan::sortableTop [0] valid=1 operand=0 span=1 ccw=0 seg=1 {{{286.695129f, 291}, {229.304855f, 561}}} t=0.0555056246 pt=(283.509644,305.986511) slope=(-57.390274,270)
1113SkOpSegment::markWinding id=1 (286.695129,291 229.304855,561) t=0 [1] (286.695129,291) tEnd=0.111011249 newWindSum=1 newOppSum=0 oppSum=0 windSum=1 windValue=1 oppValue=0
1114SkOpSegment::markWinding id=1 (286.695129,291 229.304855,561) t=0 [1] (286.695129,291) tEnd=0.111011249 newWindSum=1 newOppSum=0 oppSum=0 windSum=1 windValue=1 oppValue=0
1115SkOpSegment::markWinding id=4 (1036.69507,291 286.695129,291) t=0.959999997 [36] (316.695129,291) tEnd=1 newWindSum=1 newOppSum=0 oppSum=? windSum=? windValue=1 oppValue=0
1116SkOpSegment::activeOp id=1 t=0.111011249 tEnd=0 op=sect miFrom=1 miTo=0 suFrom=0 suTo=0 result=0
1117SkOpSegment::markDone id=1 (286.695129,291 229.304855,561) t=0 [1] (286.695129,291) tEnd=0.111011249 newWindSum=1 newOppSum=0 oppSum=0 windSum=1 windValue=1 oppValue=0
1118SkOpSegment::markDone id=4 (1036.69507,291 286.695129,291) t=0.959999997 [36] (316.695129,291) tEnd=1 newWindSum=1 newOppSum=0 oppSum=0 windSum=1 windValue=1 oppValue=0
1119bridgeOp chase.append id=4 windSum=1
1120SkOpSegment::markWinding id=11 (280.31842,321 283.840179,304.431458 300.126587,291 316.695129,291) t=0.000542504226 [30] (280.324158,320.973022) tEnd=1 newWindSum=-1 newOppSum=1 oppSum=? windSum=? windValue=1 oppValue=0
1121SkOpSegment::markAngle last segment=11 span=30 windSum=-1
1122SkOpSegment::markWinding id=12 (316.695129,291 1006.69513,291) t=0 [23] (316.695129,291) tEnd=1 newWindSum=-1 newOppSum=2 oppSum=? windSum=? windValue=1 oppValue=1
1123SkOpSegment::markAngle last segment=12 span=24
1124SkOpSegment::debugShowActiveSpans id=1 (280.324158,320.973022 280.31842,321) t=0.111011249 tEnd=0.11111112 windSum=? oppSum=? windValue=1 oppValue=-1
1125SkOpSegment::debugShowActiveSpans id=1 (235.681549,531 235.678497,531.014404) t=0.888888891 tEnd=0.888942232 windSum=? oppSum=? windValue=1 oppValue=-1
1126SkOpSegment::debugShowActiveSpans id=1 (235.678497,531.014404 229.304855,561) t=0.888942232 tEnd=1 windSum=? windValue=1
1127SkOpSegment::debugShowActiveSpans id=2 (229.304855,561 259.304871,561) t=0 tEnd=0.0400000195 windSum=? windValue=1
1128SkOpSegment::debugShowActiveSpans id=2 (259.304871,561 949.304871,561) t=0.0400000195 tEnd=0.960000001 windSum=? oppSum=? windValue=1 oppValue=-1
1129SkOpSegment::debugShowActiveSpans id=2 (949.304871,561 979.304871,561) t=0.960000001 tEnd=1 windSum=? windValue=1
1130SkOpSegment::debugShowActiveSpans id=3 (979.304871,561 985.68158,531) t=0 tEnd=0.11111108 windSum=? windValue=1
1131SkOpSegment::debugShowActiveSpans id=3 (985.68158,531 1030.31836,321) t=0.11111108 tEnd=0.888888874 windSum=? oppSum=? windValue=1 oppValue=-1
1132SkOpSegment::debugShowActiveSpans id=3 (1030.31836,321 1036.69507,291) t=0.888888874 tEnd=1 windSum=? windValue=1
1133SkOpSegment::debugShowActiveSpans id=4 (1036.69507,291 1006.69513,291) t=0 tEnd=0.0399999219 windSum=? windValue=1
1134SkOpSegment::debugShowActiveSpans id=5 (1006.69513,291 1023.26367,291 1033.84021,304.431458 1030.31836,321) t=0 tEnd=1 windSum=? windValue=1
1135SkOpSegment::debugShowActiveSpans id=7 (985.681519,531 982.15979,547.568542 965.873413,561 949.304871,561) t=0 tEnd=1 windSum=? windValue=1
1136SkOpSegment::debugShowActiveSpans id=9 (259.304871,561 242.741114,561 232.165942,547.576327 235.678497,531.014404) t=0 tEnd=0.999710227 windSum=? windValue=1
1137SkOpSegment::debugShowActiveSpans id=10 (235.681549,531 280.31842,321) t=0 tEnd=1 windSum=? oppSum=? windValue=1 oppValue=1
1138SkOpSegment::debugShowActiveSpans id=11 (280.324158,320.973022 283.857845,304.416873 300.135575,291 316.695129,291) t=0.000542504226 tEnd=1 windSum=-1 oppSum=1 windValue=1 oppValue=0
1139SkOpSegment::debugShowActiveSpans id=12 (316.695129,291 1006.69513,291) t=0 tEnd=1 windSum=-1 oppSum=2 windValue=1 oppValue=1
1140SkOpSegment::activeOp id=11 t=1 tEnd=0.000542504226 op=sect miFrom=1 miTo=1 suFrom=0 suTo=1 result=1
1141SkOpSegment::markWinding id=1 (286.695129,291 229.304855,561) t=0.111011249 [29] (280.324158,320.973022) tEnd=0.11111112 newWindSum=1 newOppSum=-1 oppSum=? windSum=? windValue=1 oppValue=-1
1142SkOpSegment::markAngle last segment=10 span=20
1143SkOpSegment::findNextOp
1144SkOpAngle::dumpOne [11/25] next=1/1 sect=5/1 s=0.000542504226 [30] e=1 [22] sgn=-1 windVal=1 windSum=-1 oppVal=0 oppSum=1 operand
1145SkOpAngle::dumpOne [1/1] next=1/2 sect=5/5 s=0.111011249 [29] e=0 [1] sgn=1 windVal=1 windSum=1 oppVal=0 oppSum=0 done
1146SkOpAngle::dumpOne [1/2] next=11/25 sect=21/21 s=0.111011249 [29] e=0.11111112 [28] sgn=-1 windVal=1 windSum=1 oppVal=-1 oppSum=-1
1147SkOpSegment::activeOp id=1 t=0.111011249 tEnd=0 op=sect miFrom=1 miTo=0 suFrom=0 suTo=0 result=0
1148SkOpSegment::activeOp id=1 t=0.111011249 tEnd=0.11111112 op=sect miFrom=0 miTo=1 suFrom=0 suTo=1 result=1
1149SkOpSegment::findNextOp chase.append segment=10 span=20
1150SkOpSegment::markDone id=11 (280.31842,321 283.840179,304.431458 300.126587,291 316.695129,291) t=0.000542504226 [30] (280.324158,320.973022) tEnd=1 newWindSum=-1 newOppSum=1 oppSum=1 windSum=-1 windValue=1 oppValue=0
1151SkOpSegment::findNextOp from:[11] to:[1] start=5851048 end=5850856
1152bridgeOp current id=11 from=(316.695129,291) to=(280.324158,320.973022)
1153path.moveTo(316.695129,291);
1154path.cubicTo(300.13559,291, 283.857849,304.41687, 280.324158,320.973022);
1155SkOpSegment::markWinding id=10 (235.681549,531 280.31842,321) t=0 [19] (235.681549,531) tEnd=1 newWindSum=-1 newOppSum=-1 oppSum=? windSum=? windValue=1 oppValue=1
1156SkOpSegment::markAngle last segment=1 span=27 windSum=?
1157SkOpSegment::findNextOp
1158SkOpAngle::dumpOne [1/3] next=10/24 sect=5/5 s=0.11111112 [28] e=0.111011249 [29] sgn=1 windVal=1 windSum=1 oppVal=-1 oppSum=-1
1159SkOpAngle::dumpOne [10/24] next=1/3 sect=21/21 s=1 [20] e=0 [19] sgn=1 windVal=1 windSum=-1 oppVal=1 oppSum=-1 operand
1160SkOpSegment::activeOp id=10 t=1 tEnd=0 op=sect miFrom=0 miTo=1 suFrom=0 suTo=1 result=1
1161SkOpSegment::findNextOp chase.append segment=1 span=27 windSum=-2147483647
1162SkOpSegment::markDone id=1 (286.695129,291 229.304855,561) t=0.111011249 [29] (280.324158,320.973022) tEnd=0.11111112 newWindSum=1 newOppSum=-1 oppSum=-1 windSum=1 windValue=1 oppValue=-1
1163SkOpSegment::findNextOp from:[1] to:[10] start=5849408 end=5849264
1164bridgeOp current id=1 from=(280.324158,320.973022) to=(280.31842,321)
1165SkOpSegment::markWinding id=1 (286.695129,291 229.304855,561) t=0.888888891 [27] (235.681549,531) tEnd=0.888942232 newWindSum=1 newOppSum=-1 oppSum=? windSum=? windValue=1 oppValue=-1
1166SkOpSegment::markAngle last segment=1 span=25 windSum=?
1167SkOpSegment::findNextOp
1168SkOpAngle::dumpOne [10/23] next=1/4 sect=5/5 s=0 [19] e=1 [20] sgn=-1 windVal=1 windSum=-1 oppVal=1 oppSum=-1 operand
1169SkOpAngle::dumpOne [1/4] next=10/23 sect=21/21 s=0.888888891 [27] e=0.888942232 [25] sgn=-1 windVal=1 windSum=1 oppVal=-1 oppSum=-1
1170SkOpSegment::activeOp id=1 t=0.888888891 tEnd=0.888942232 op=sect miFrom=0 miTo=1 suFrom=0 suTo=1 result=1
1171SkOpSegment::findNextOp chase.append segment=1 span=25 windSum=-2147483647
1172SkOpSegment::markDone id=10 (235.681549,531 280.31842,321) t=0 [19] (235.681549,531) tEnd=1 newWindSum=-1 newOppSum=-1 oppSum=-1 windSum=-1 windValue=1 oppValue=1
1173SkOpSegment::findNextOp from:[10] to:[1] start=5850664 end=5850288
1174bridgeOp current id=10 from=(280.31842,321) to=(235.681549,531)
1175path.lineTo(280.31842,321);
1176SkOpSegment::markWinding id=1 (286.695129,291 229.304855,561) t=0.888942232 [25] (235.678497,531.014404) tEnd=1 newWindSum=1 newOppSum=0 oppSum=? windSum=? windValue=1 oppValue=0
1177SkOpSegment::markWinding id=2 (229.304855,561 979.304871,561) t=0 [3] (229.304855,561) tEnd=0.0400000195 newWindSum=1 newOppSum=0 oppSum=? windSum=? windValue=1 oppValue=0
1178SkOpSegment::markAngle last segment=2 span=32 windSum=?
1179SkOpSegment::markWinding id=9 (259.304871,561 242.736313,561 232.159805,547.568542 235.681549,531) t=0 [17] (259.304871,561) tEnd=0.999710227 newWindSum=-1 newOppSum=1 oppSum=? windSum=? windValue=1 oppValue=0
1180SkOpSegment::markAngle last segment=9 span=17 windSum=-1
1181SkOpSegment::findNextOp
1182SkOpAngle::dumpOne [1/5] next=1/6 sect=5/5 s=0.888942232 [25] e=0.888888891 [27] sgn=1 windVal=1 windSum=1 oppVal=-1 oppSum=-1
1183SkOpAngle::dumpOne [1/6] next=9/22 sect=21/21 s=0.888942232 [25] e=1 [2] sgn=-1 windVal=1 windSum=1 oppVal=0 oppSum=0
1184SkOpAngle::dumpOne [9/22] next=1/5 sect=21/25 s=0.999710227 [26] e=0 [17] sgn=1 windVal=1 windSum=-1 oppVal=0 oppSum=1 operand
1185SkOpSegment::activeOp id=1 t=0.888942232 tEnd=1 op=sect miFrom=0 miTo=1 suFrom=0 suTo=0 result=0
1186SkOpSegment::markDone id=1 (286.695129,291 229.304855,561) t=0.888942232 [25] (235.678497,531.014404) tEnd=1 newWindSum=1 newOppSum=0 oppSum=0 windSum=1 windValue=1 oppValue=0
1187SkOpSegment::markDone id=2 (229.304855,561 979.304871,561) t=0 [3] (229.304855,561) tEnd=0.0400000195 newWindSum=1 newOppSum=0 oppSum=0 windSum=1 windValue=1 oppValue=0
1188SkOpSegment::findNextOp chase.append segment=2 span=32 windSum=-2147483647
1189SkOpSegment::activeOp id=9 t=0.999710227 tEnd=0 op=sect miFrom=1 miTo=1 suFrom=0 suTo=1 result=1
1190SkOpSegment::findNextOp chase.append segment=9 span=17 windSum=-1
1191SkOpSegment::markDone id=1 (286.695129,291 229.304855,561) t=0.888888891 [27] (235.681549,531) tEnd=0.888942232 newWindSum=1 newOppSum=-1 oppSum=-1 windSum=1 windValue=1 oppValue=-1
1192SkOpSegment::findNextOp from:[1] to:[9] start=5850520 end=5848912
1193bridgeOp current id=1 from=(235.681549,531) to=(235.678497,531.014404)
1194path.lineTo(235.681549,531);
1195SkOpSegment::markWinding id=2 (229.304855,561 979.304871,561) t=0.0400000195 [32] (259.304871,561) tEnd=0.960000001 newWindSum=1 newOppSum=-1 oppSum=? windSum=? windValue=1 oppValue=-1
1196SkOpSegment::markAngle last segment=2 span=31 windSum=?
1197SkOpSegment::findNextOp
1198SkOpAngle::dumpOne [9/21] next=2/7 sect=14/9 s=0 [17] e=0.999710227 [26] sgn=-1 windVal=1 windSum=-1 oppVal=0 oppSum=1 operand
1199SkOpAngle::dumpOne [2/7] next=2/8 sect=15/15 s=0.0400000195 [32] e=0 [3] sgn=1 windVal=1 windSum=1 oppVal=0 oppSum=0 done
1200SkOpAngle::dumpOne [2/8] next=9/21 sect=31/31 s=0.0400000195 [32] e=0.960000001 [31] sgn=-1 windVal=1 windSum=1 oppVal=-1 oppSum=-1
1201SkOpSegment::activeOp id=2 t=0.0400000195 tEnd=0 op=sect miFrom=1 miTo=0 suFrom=0 suTo=0 result=0
1202SkOpSegment::activeOp id=2 t=0.0400000195 tEnd=0.960000001 op=sect miFrom=0 miTo=1 suFrom=0 suTo=1 result=1
1203SkOpSegment::findNextOp chase.append segment=2 span=31 windSum=-2147483647
1204SkOpSegment::markDone id=9 (259.304871,561 242.736313,561 232.159805,547.568542 235.681549,531) t=0 [17] (259.304871,561) tEnd=0.999710227 newWindSum=-1 newOppSum=1 oppSum=1 windSum=-1 windValue=1 oppValue=0
1205SkOpSegment::findNextOp from:[9] to:[2] start=5851528 end=5851384
1206bridgeOp current id=9 from=(235.678497,531.014404) to=(259.304871,561)
1207path.lineTo(235.678497,531.014404);
1208path.cubicTo(232.165939,547.576355, 242.741119,561, 259.304871,561);
1209SkOpSegment::markWinding id=2 (229.304855,561 979.304871,561) t=0.960000001 [31] (949.304871,561) tEnd=1 newWindSum=1 newOppSum=0 oppSum=? windSum=? windValue=1 oppValue=0
1210SkOpSegment::markWinding id=3 (979.304871,561 1036.69507,291) t=0 [5] (979.304871,561) tEnd=0.11111108 newWindSum=1 newOppSum=0 oppSum=? windSum=? windValue=1 oppValue=0
1211SkOpSegment::markAngle last segment=3 span=34 windSum=?
1212SkOpSegment::markWinding id=7 (985.681519,531 982.15979,547.568542 965.873413,561 949.304871,561) t=0 [13] (985.681519,531) tEnd=1 newWindSum=-1 newOppSum=1 oppSum=? windSum=? windValue=1 oppValue=0
1213SkOpSegment::markAngle last segment=7 span=13 windSum=-1
1214SkOpSegment::findNextOp
1215SkOpAngle::dumpOne [2/9] next=2/10 sect=15/15 s=0.960000001 [31] e=0.0400000195 [32] sgn=1 windVal=1 windSum=1 oppVal=-1 oppSum=-1
1216SkOpAngle::dumpOne [2/10] next=7/20 sect=31/31 s=0.960000001 [31] e=1 [4] sgn=-1 windVal=1 windSum=1 oppVal=0 oppSum=0
1217SkOpAngle::dumpOne [7/20] next=2/9 sect=0/1 s=1 [14] e=0 [13] sgn=1 windVal=1 windSum=-1 oppVal=0 oppSum=1 operand
1218SkOpSegment::activeOp id=2 t=0.960000001 tEnd=1 op=sect miFrom=0 miTo=1 suFrom=0 suTo=0 result=0
1219SkOpSegment::markDone id=2 (229.304855,561 979.304871,561) t=0.960000001 [31] (949.304871,561) tEnd=1 newWindSum=1 newOppSum=0 oppSum=0 windSum=1 windValue=1 oppValue=0
1220SkOpSegment::markDone id=3 (979.304871,561 1036.69507,291) t=0 [5] (979.304871,561) tEnd=0.11111108 newWindSum=1 newOppSum=0 oppSum=0 windSum=1 windValue=1 oppValue=0
1221SkOpSegment::findNextOp chase.append segment=3 span=34 windSum=-2147483647
1222SkOpSegment::activeOp id=7 t=1 tEnd=0 op=sect miFrom=1 miTo=1 suFrom=0 suTo=1 result=1
1223SkOpSegment::findNextOp chase.append segment=7 span=13 windSum=-1
1224SkOpSegment::markDone id=2 (229.304855,561 979.304871,561) t=0.0400000195 [32] (259.304871,561) tEnd=0.960000001 newWindSum=1 newOppSum=-1 oppSum=-1 windSum=1 windValue=1 oppValue=-1
1225SkOpSegment::findNextOp from:[2] to:[7] start=5848368 end=5848224
1226bridgeOp current id=2 from=(259.304871,561) to=(949.304871,561)
1227SkOpSegment::markWinding id=3 (979.304871,561 1036.69507,291) t=0.11111108 [34] (985.68158,531) tEnd=0.888888874 newWindSum=2 newOppSum=-1 oppSum=? windSum=? windValue=1 oppValue=-1
1228SkOpSegment::markAngle last segment=3 span=33 windSum=?
1229SkOpSegment::findNextOp
1230SkOpAngle::dumpOne [7/19] next=3/12 sect=21/17 s=0 [13] e=1 [14] sgn=-1 windVal=1 windSum=-1 oppVal=0 oppSum=1 operand
1231SkOpAngle::dumpOne [3/12] next=3/11 sect=5/5 s=0.11111108 [34] e=0.888888874 [33] sgn=-1 windVal=1 windSum=2 oppVal=-1 oppSum=-1
1232SkOpAngle::dumpOne [3/11] next=7/19 sect=21/21 s=0.11111108 [34] e=0 [5] sgn=1 windVal=1 windSum=1 oppVal=0 oppSum=0 done
1233SkOpSegment::activeOp id=3 t=0.11111108 tEnd=0.888888874 op=sect miFrom=1 miTo=0 suFrom=0 suTo=1 result=0
1234SkOpSegment::markDone id=3 (979.304871,561 1036.69507,291) t=0.11111108 [34] (985.68158,531) tEnd=0.888888874 newWindSum=2 newOppSum=-1 oppSum=-1 windSum=2 windValue=1 oppValue=-1
1235SkOpSegment::findNextOp chase.append segment=3 span=33 windSum=-2147483647
1236SkOpSegment::activeOp id=3 t=0.11111108 tEnd=0 op=sect miFrom=0 miTo=1 suFrom=1 suTo=1 result=1
1237SkOpSegment::markDone id=7 (985.681519,531 982.15979,547.568542 965.873413,561 949.304871,561) t=0 [13] (985.681519,531) tEnd=1 newWindSum=-1 newOppSum=1 oppSum=1 windSum=-1 windValue=1 oppValue=0
1238SkOpSegment::findNextOp from:[7] to:[3] start=5851864 end=5846776
1239bridgeOp current id=7 from=(949.304871,561) to=(985.681519,531)
1240path.lineTo(949.304871,561);
1241path.cubicTo(965.873413,561, 982.15979,547.568542, 985.681519,531);
1242SkOpSegment::findNextOp simple
1243SkOpSegment::markWinding id=3 (979.304871,561 1036.69507,291) t=0.888888874 [33] (1030.31836,321) tEnd=1 newWindSum=2 newOppSum=0 oppSum=? windSum=? windValue=1 oppValue=0
1244SkOpSegment::markWinding id=4 (1036.69507,291 286.695129,291) t=0 [7] (1036.69507,291) tEnd=0.0399999219 newWindSum=2 newOppSum=0 oppSum=? windSum=? windValue=1 oppValue=0
1245SkOpSegment::markAngle last segment=4 span=35 windSum=?
1246SkOpSegment::markWinding id=5 (1006.69513,291 1023.26367,291 1033.84021,304.431458 1030.31836,321) t=0 [9] (1006.69513,291) tEnd=1 newWindSum=-1 newOppSum=2 oppSum=? windSum=? windValue=1 oppValue=0
1247SkOpSegment::markAngle last segment=5 span=9 windSum=-1
1248SkOpSegment::debugShowActiveSpans id=3 (1030.31836,321 1036.69507,291) t=0.888888874 tEnd=1 windSum=2 oppSum=0 windValue=1 oppValue=0
1249SkOpSegment::debugShowActiveSpans id=4 (1036.69507,291 1006.69513,291) t=0 tEnd=0.0399999219 windSum=2 oppSum=0 windValue=1 oppValue=0
1250SkOpSegment::debugShowActiveSpans id=5 (1006.69513,291 1023.26367,291 1033.84021,304.431458 1030.31836,321) t=0 tEnd=1 windSum=-1 oppSum=2 windValue=1 oppValue=0
1251SkOpSegment::debugShowActiveSpans id=12 (316.695129,291 1006.69513,291) t=0 tEnd=1 windSum=-1 oppSum=2 windValue=1 oppValue=1
1252SkOpSegment::activeOp id=3 t=0.888888874 tEnd=1 op=sect miFrom=1 miTo=0 suFrom=0 suTo=0 result=0
1253SkOpSegment::markDone id=3 (979.304871,561 1036.69507,291) t=0.888888874 [33] (1030.31836,321) tEnd=1 newWindSum=2 newOppSum=0 oppSum=0 windSum=2 windValue=1 oppValue=0
1254SkOpSegment::markDone id=4 (1036.69507,291 286.695129,291) t=0 [7] (1036.69507,291) tEnd=0.0399999219 newWindSum=2 newOppSum=0 oppSum=0 windSum=2 windValue=1 oppValue=0
1255bridgeOp chase.append id=4 windSum=-2147483647
1256SkOpSegment::debugShowActiveSpans id=5 (1006.69513,291 1023.26367,291 1033.84021,304.431458 1030.31836,321) t=0 tEnd=1 windSum=-1 oppSum=2 windValue=1 oppValue=0
1257SkOpSegment::debugShowActiveSpans id=12 (316.695129,291 1006.69513,291) t=0 tEnd=1 windSum=-1 oppSum=2 windValue=1 oppValue=1
1258SkOpSegment::activeOp id=5 t=0 tEnd=1 op=sect miFrom=0 miTo=0 suFrom=1 suTo=0 result=0
1259SkOpSegment::markDone id=5 (1006.69513,291 1023.26367,291 1033.84021,304.431458 1030.31836,321) t=0 [9] (1006.69513,291) tEnd=1 newWindSum=-1 newOppSum=2 oppSum=2 windSum=-1 windValue=1 oppValue=0
1260bridgeOp chase.append id=5
1261SkOpSegment::debugShowActiveSpans id=12 (316.695129,291 1006.69513,291) t=0 tEnd=1 windSum=-1 oppSum=2 windValue=1 oppValue=1
1262SkOpSegment::activeOp id=12 t=1 tEnd=0 op=sect miFrom=0 miTo=1 suFrom=0 suTo=1 result=1
1263SkOpSegment::findNextOp
1264SkOpAngle::dumpOne [12/27] next=4/16 sect=31/31 s=0 [23] e=1 [24] sgn=-1 windVal=1 windSum=-1 oppVal=1 oppSum=2 operand
1265SkOpAngle::dumpOne [4/16] next=11/26 sect=15/15 s=0.959999997 [36] e=1 [8] sgn=-1 windVal=1 windSum=1 oppVal=0 oppSum=0 done
1266SkOpAngle::dumpOne [11/26] next=12/27 sect=16/17 s=1 [22] e=0.000542504226 [30] sgn=1 windVal=1 windSum=-1 oppVal=0 oppSum=1 done operand
1267SkOpSegment::activeOp id=4 t=0.959999997 tEnd=1 op=sect miFrom=0 miTo=1 suFrom=0 suTo=0 result=0
1268SkOpSegment::activeOp id=11 t=1 tEnd=0.000542504226 op=sect miFrom=1 miTo=1 suFrom=0 suTo=1 result=1
1269SkOpSegment::markDone id=12 (316.695129,291 1006.69513,291) t=0 [23] (316.695129,291) tEnd=1 newWindSum=-1 newOppSum=2 oppSum=2 windSum=-1 windValue=1 oppValue=1
1270SkOpSegment::findNextOp from:[12] to:[11] start=5849744 end=5851192
1271bridgeOp current id=12 from=(1006.69513,291) to=(316.695129,291)
1272path.moveTo(1006.69513,291);
1273path.lineTo(316.695129,291);
Cary Clark7eb01e02016-12-08 14:36:32 -05001274</div>
caryclark26ad22a2015-10-16 09:03:38 -07001275
caryclarkdac1d172014-06-17 05:15:38 -07001276</div>
1277
1278<script type="text/javascript">
1279
caryclark55888e42016-07-18 10:01:36 -07001280 var testDivs = [
Cary Clarkff114282016-12-14 11:56:16 -05001281 skpeldorado_com_ua1_working,
1282 skpeldorado_com_ua1_broken,
caryclark30b9fdd2016-08-31 14:36:29 -07001283 ];
caryclarkdac1d172014-06-17 05:15:38 -07001284
1285var decimal_places = 3; // make this 3 to show more precision
1286
1287var tests = [];
1288var testLines = [];
1289var testTitles = [];
1290var testIndex = 0;
1291var ctx;
1292
1293var xmin, xmax, focusXmin, focusXmax;
1294var ymin, ymax, focusYmin, focusYmax;
1295var scale;
1296var mouseX, mouseY;
1297var srcLeft, srcTop;
1298var screenWidth, screenHeight;
caryclark1049f122015-04-20 08:31:59 -07001299var drawnPts, drawnLines, drawnQuads, drawnConics, drawnCubics;
caryclarkdac1d172014-06-17 05:15:38 -07001300var curveT = 0;
1301
1302var pt_labels = 2;
1303var collect_bounds = false;
1304var control_lines = 0;
1305var curve_t = false;
1306var debug_xy = 1;
1307var focus_enabled = false;
1308var focus_on_selection = false;
1309var step_limit = 0;
1310var draw_active = false;
1311var draw_add = false;
1312var draw_angle = 0;
caryclark624637c2015-05-11 07:21:27 -07001313var draw_coincidence = false;
caryclarkdac1d172014-06-17 05:15:38 -07001314var draw_deriviatives = 0;
Cary Clarkff114282016-12-14 11:56:16 -05001315var draw_direction = false;
caryclarkdac1d172014-06-17 05:15:38 -07001316var draw_hints = false;
caryclarkdac1d172014-06-17 05:15:38 -07001317var draw_id = false;
1318var draw_intersection = 0;
1319var draw_intersectT = false;
1320var draw_legend = true;
1321var draw_log = false;
1322var draw_mark = false;
1323var draw_midpoint = false;
1324var draw_op = 0;
1325var draw_sequence = false;
1326var draw_sort = 0;
caryclark03b03ca2015-04-23 09:13:37 -07001327var draw_top = false;
caryclarkdac1d172014-06-17 05:15:38 -07001328var draw_path = 3;
1329var draw_computed = 0;
1330var retina_scale = !!window.devicePixelRatio;
1331
1332var activeCount = 0;
1333var addCount = 0;
1334var angleCount = 0;
caryclark624637c2015-05-11 07:21:27 -07001335var coinCount = 0;
caryclarkdac1d172014-06-17 05:15:38 -07001336var opCount = 0;
1337var sectCount = 0;
1338var sortCount = 0;
caryclark03b03ca2015-04-23 09:13:37 -07001339var topCount = 0;
caryclarkdac1d172014-06-17 05:15:38 -07001340var markCount = 0;
1341var activeMax = 0;
1342var addMax = 0;
1343var angleMax = 0;
caryclark624637c2015-05-11 07:21:27 -07001344var coinMax = 0;
caryclarkdac1d172014-06-17 05:15:38 -07001345var sectMax = 0;
1346var sectMax2 = 0;
1347var sortMax = 0;
caryclark03b03ca2015-04-23 09:13:37 -07001348var topMax = 0;
caryclarkdac1d172014-06-17 05:15:38 -07001349var markMax = 0;
1350var opMax = 0;
1351var stepMax = 0;
1352var lastIndex = 0;
1353var hasPath = false;
caryclark26ad22a2015-10-16 09:03:38 -07001354var hasAlignedPath = false;
caryclarkdac1d172014-06-17 05:15:38 -07001355var hasComputedPath = false;
caryclark54359292015-03-26 07:52:43 -07001356var angleBetween = false;
1357var afterIndex = 0;
caryclarkdac1d172014-06-17 05:15:38 -07001358
1359var firstActiveSpan = -1;
1360var logStart = -1;
1361var logRange = 0;
1362
1363var SPAN_ID = 0;
1364var SPAN_X1 = SPAN_ID + 1;
1365var SPAN_Y1 = SPAN_X1 + 1;
1366var SPAN_X2 = SPAN_Y1 + 1;
1367var SPAN_Y2 = SPAN_X2 + 1;
caryclark1049f122015-04-20 08:31:59 -07001368
caryclark55888e42016-07-18 10:01:36 -07001369var SPAN_L_TX = SPAN_Y2 + 1;
caryclarkdac1d172014-06-17 05:15:38 -07001370var SPAN_L_TY = SPAN_L_TX + 1;
caryclark55888e42016-07-18 10:01:36 -07001371var SPAN_L_OTHER = SPAN_L_TY + 1;
caryclarkdac1d172014-06-17 05:15:38 -07001372var SPAN_L_OTHERT = SPAN_L_OTHER + 1;
1373var SPAN_L_OTHERI = SPAN_L_OTHERT + 1;
1374var SPAN_L_SUM = SPAN_L_OTHERI + 1;
1375var SPAN_L_VAL = SPAN_L_SUM + 1;
1376var SPAN_L_OPP = SPAN_L_VAL + 1;
1377
1378var SPAN_X3 = SPAN_Y2 + 1;
1379var SPAN_Y3 = SPAN_X3 + 1;
caryclark1049f122015-04-20 08:31:59 -07001380
caryclark55888e42016-07-18 10:01:36 -07001381var SPAN_Q_TX = SPAN_Y3 + 1;
caryclarkdac1d172014-06-17 05:15:38 -07001382var SPAN_Q_TY = SPAN_Q_TX + 1;
caryclark55888e42016-07-18 10:01:36 -07001383var SPAN_Q_OTHER = SPAN_Q_TY + 1;
caryclarkdac1d172014-06-17 05:15:38 -07001384var SPAN_Q_OTHERT = SPAN_Q_OTHER + 1;
1385var SPAN_Q_OTHERI = SPAN_Q_OTHERT + 1;
1386var SPAN_Q_SUM = SPAN_Q_OTHERI + 1;
1387var SPAN_Q_VAL = SPAN_Q_SUM + 1;
1388var SPAN_Q_OPP = SPAN_Q_VAL + 1;
1389
caryclark1049f122015-04-20 08:31:59 -07001390var SPAN_K_W = SPAN_Y3 + 1;
caryclark55888e42016-07-18 10:01:36 -07001391var SPAN_K_TX = SPAN_K_W + 1;
caryclark1049f122015-04-20 08:31:59 -07001392var SPAN_K_TY = SPAN_K_TX + 1;
caryclark55888e42016-07-18 10:01:36 -07001393var SPAN_K_OTHER = SPAN_K_TY + 1;
caryclark1049f122015-04-20 08:31:59 -07001394var SPAN_K_OTHERT = SPAN_K_OTHER + 1;
1395var SPAN_K_OTHERI = SPAN_K_OTHERT + 1;
1396var SPAN_K_SUM = SPAN_K_OTHERI + 1;
1397var SPAN_K_VAL = SPAN_K_SUM + 1;
1398var SPAN_K_OPP = SPAN_K_VAL + 1;
1399
caryclarkdac1d172014-06-17 05:15:38 -07001400var SPAN_X4 = SPAN_Y3 + 1;
1401var SPAN_Y4 = SPAN_X4 + 1;
caryclark1049f122015-04-20 08:31:59 -07001402
caryclark55888e42016-07-18 10:01:36 -07001403var SPAN_C_TX = SPAN_Y4 + 1;
caryclarkdac1d172014-06-17 05:15:38 -07001404var SPAN_C_TY = SPAN_C_TX + 1;
caryclark55888e42016-07-18 10:01:36 -07001405var SPAN_C_OTHER = SPAN_C_TY + 1;
caryclarkdac1d172014-06-17 05:15:38 -07001406var SPAN_C_OTHERT = SPAN_C_OTHER + 1;
1407var SPAN_C_OTHERI = SPAN_C_OTHERT + 1;
1408var SPAN_C_SUM = SPAN_C_OTHERI + 1;
1409var SPAN_C_VAL = SPAN_C_SUM + 1;
1410var SPAN_C_OPP = SPAN_C_VAL + 1;
1411
1412var ACTIVE_LINE_SPAN = 1;
1413var ACTIVE_QUAD_SPAN = ACTIVE_LINE_SPAN + 1;
caryclark1049f122015-04-20 08:31:59 -07001414var ACTIVE_CONIC_SPAN = ACTIVE_QUAD_SPAN + 1;
1415var ACTIVE_CUBIC_SPAN = ACTIVE_CONIC_SPAN + 1;
caryclarkdac1d172014-06-17 05:15:38 -07001416
1417var ADD_MOVETO = ACTIVE_CUBIC_SPAN + 1;
1418var ADD_LINETO = ADD_MOVETO + 1;
1419var ADD_QUADTO = ADD_LINETO + 1;
caryclark1049f122015-04-20 08:31:59 -07001420var ADD_CONICTO = ADD_QUADTO + 1;
1421var ADD_CUBICTO = ADD_CONICTO + 1;
caryclarkdac1d172014-06-17 05:15:38 -07001422var ADD_CLOSE = ADD_CUBICTO + 1;
1423var ADD_FILL = ADD_CLOSE + 1;
1424
1425var PATH_LINE = ADD_FILL + 1;
1426var PATH_QUAD = PATH_LINE + 1;
caryclark1049f122015-04-20 08:31:59 -07001427var PATH_CONIC = PATH_QUAD + 1;
1428var PATH_CUBIC = PATH_CONIC + 1;
caryclarkdac1d172014-06-17 05:15:38 -07001429
1430var INTERSECT_LINE = PATH_CUBIC + 1;
1431var INTERSECT_LINE_2 = INTERSECT_LINE + 1;
1432var INTERSECT_LINE_NO = INTERSECT_LINE_2 + 1;
1433var INTERSECT_QUAD_LINE = INTERSECT_LINE_NO + 1;
1434var INTERSECT_QUAD_LINE_2 = INTERSECT_QUAD_LINE + 1;
1435var INTERSECT_QUAD_LINE_NO = INTERSECT_QUAD_LINE_2 + 1;
1436var INTERSECT_QUAD = INTERSECT_QUAD_LINE_NO + 1;
1437var INTERSECT_QUAD_2 = INTERSECT_QUAD + 1;
1438var INTERSECT_QUAD_NO = INTERSECT_QUAD_2 + 1;
caryclark1049f122015-04-20 08:31:59 -07001439var INTERSECT_CONIC_LINE = INTERSECT_QUAD_NO + 1;
1440var INTERSECT_CONIC_LINE_2 = INTERSECT_CONIC_LINE + 1;
1441var INTERSECT_CONIC_LINE_NO = INTERSECT_CONIC_LINE_2 + 1;
caryclark55888e42016-07-18 10:01:36 -07001442var INTERSECT_CONIC_QUAD = INTERSECT_CONIC_LINE_NO + 1;
1443var INTERSECT_CONIC_QUAD_2 = INTERSECT_CONIC_QUAD + 1;
caryclark6c3b9cd2016-09-26 05:36:58 -07001444var INTERSECT_CONIC_QUAD_3 = INTERSECT_CONIC_QUAD_2 + 1;
1445var INTERSECT_CONIC_QUAD_4 = INTERSECT_CONIC_QUAD_3 + 1;
1446var INTERSECT_CONIC_QUAD_NO = INTERSECT_CONIC_QUAD_4 + 1;
caryclark55888e42016-07-18 10:01:36 -07001447var INTERSECT_CONIC = INTERSECT_CONIC_QUAD_NO + 1;
caryclark1049f122015-04-20 08:31:59 -07001448var INTERSECT_CONIC_2 = INTERSECT_CONIC + 1;
1449var INTERSECT_CONIC_NO = INTERSECT_CONIC_2 + 1;
1450var INTERSECT_SELF_CUBIC = INTERSECT_CONIC_NO + 1;
caryclarkdac1d172014-06-17 05:15:38 -07001451var INTERSECT_SELF_CUBIC_NO = INTERSECT_SELF_CUBIC + 1;
1452var INTERSECT_CUBIC_LINE = INTERSECT_SELF_CUBIC_NO + 1;
1453var INTERSECT_CUBIC_LINE_2 = INTERSECT_CUBIC_LINE + 1;
1454var INTERSECT_CUBIC_LINE_3 = INTERSECT_CUBIC_LINE_2 + 1;
1455var INTERSECT_CUBIC_LINE_NO = INTERSECT_CUBIC_LINE_3 + 1;
1456var INTERSECT_CUBIC_QUAD = INTERSECT_CUBIC_LINE_NO + 1;
1457var INTERSECT_CUBIC_QUAD_2 = INTERSECT_CUBIC_QUAD + 1;
1458var INTERSECT_CUBIC_QUAD_3 = INTERSECT_CUBIC_QUAD_2 + 1;
1459var INTERSECT_CUBIC_QUAD_4 = INTERSECT_CUBIC_QUAD_3 + 1;
1460var INTERSECT_CUBIC_QUAD_NO = INTERSECT_CUBIC_QUAD_4 + 1;
1461var INTERSECT_CUBIC = INTERSECT_CUBIC_QUAD_NO + 1;
1462var INTERSECT_CUBIC_2 = INTERSECT_CUBIC + 1;
1463var INTERSECT_CUBIC_3 = INTERSECT_CUBIC_2 + 1;
1464var INTERSECT_CUBIC_4 = INTERSECT_CUBIC_3 + 1;
1465// FIXME: add cubic 5- 9
1466var INTERSECT_CUBIC_NO = INTERSECT_CUBIC_4 + 1;
1467
1468var SORT_UNARY = INTERSECT_CUBIC_NO + 1;
1469var SORT_BINARY = SORT_UNARY + 1;
1470
1471var OP_DIFFERENCE = SORT_BINARY + 1;
1472var OP_INTERSECT = OP_DIFFERENCE + 1;
1473var OP_UNION = OP_INTERSECT + 1;
1474var OP_XOR = OP_UNION + 1;
1475
1476var MARK_LINE = OP_XOR + 1;
1477var MARK_QUAD = MARK_LINE + 1;
caryclark1049f122015-04-20 08:31:59 -07001478var MARK_CONIC = MARK_QUAD + 1;
1479var MARK_CUBIC = MARK_CONIC + 1;
caryclarkdac1d172014-06-17 05:15:38 -07001480var MARK_DONE_LINE = MARK_CUBIC + 1;
1481var MARK_DONE_QUAD = MARK_DONE_LINE + 1;
caryclark1049f122015-04-20 08:31:59 -07001482var MARK_DONE_CONIC = MARK_DONE_QUAD + 1;
1483var MARK_DONE_CUBIC = MARK_DONE_CONIC + 1;
caryclarkdac1d172014-06-17 05:15:38 -07001484var MARK_UNSORTABLE_LINE = MARK_DONE_CUBIC + 1;
1485var MARK_UNSORTABLE_QUAD = MARK_UNSORTABLE_LINE + 1;
caryclark1049f122015-04-20 08:31:59 -07001486var MARK_UNSORTABLE_CONIC = MARK_UNSORTABLE_QUAD + 1;
1487var MARK_UNSORTABLE_CUBIC = MARK_UNSORTABLE_CONIC + 1;
caryclarkdac1d172014-06-17 05:15:38 -07001488var MARK_SIMPLE_LINE = MARK_UNSORTABLE_CUBIC + 1;
1489var MARK_SIMPLE_QUAD = MARK_SIMPLE_LINE + 1;
caryclark1049f122015-04-20 08:31:59 -07001490var MARK_SIMPLE_CONIC = MARK_SIMPLE_QUAD + 1;
1491var MARK_SIMPLE_CUBIC = MARK_SIMPLE_CONIC + 1;
caryclarkdac1d172014-06-17 05:15:38 -07001492var MARK_SIMPLE_DONE_LINE = MARK_SIMPLE_CUBIC + 1;
1493var MARK_SIMPLE_DONE_QUAD = MARK_SIMPLE_DONE_LINE + 1;
caryclark1049f122015-04-20 08:31:59 -07001494var MARK_SIMPLE_DONE_CONIC = MARK_SIMPLE_DONE_QUAD + 1;
1495var MARK_SIMPLE_DONE_CUBIC = MARK_SIMPLE_DONE_CONIC + 1;
caryclarkdac1d172014-06-17 05:15:38 -07001496var MARK_DONE_UNARY_LINE = MARK_SIMPLE_DONE_CUBIC + 1;
1497var MARK_DONE_UNARY_QUAD = MARK_DONE_UNARY_LINE + 1;
caryclark1049f122015-04-20 08:31:59 -07001498var MARK_DONE_UNARY_CONIC = MARK_DONE_UNARY_QUAD + 1;
1499var MARK_DONE_UNARY_CUBIC = MARK_DONE_UNARY_CONIC + 1;
caryclarkdac1d172014-06-17 05:15:38 -07001500var MARK_ANGLE_LAST = MARK_DONE_UNARY_CUBIC + 1;
1501
1502var COMPUTED_SET_1 = MARK_ANGLE_LAST + 1;
1503var COMPUTED_SET_2 = COMPUTED_SET_1 + 1;
1504
caryclark624637c2015-05-11 07:21:27 -07001505var ANGLE_AFTER = COMPUTED_SET_2 + 1;
caryclark54359292015-03-26 07:52:43 -07001506var ANGLE_AFTERPART = ANGLE_AFTER + 1;
caryclarkdac1d172014-06-17 05:15:38 -07001507
caryclark54359292015-03-26 07:52:43 -07001508var ACTIVE_OP = ANGLE_AFTERPART + 1;
caryclarkdac1d172014-06-17 05:15:38 -07001509
caryclark624637c2015-05-11 07:21:27 -07001510var COIN_MAIN_SPAN = ACTIVE_OP + 1;
1511var COIN_OPP_SPAN = COIN_MAIN_SPAN + 1;
1512
1513var FRAG_TYPE_LAST = COIN_OPP_SPAN;
caryclarkdac1d172014-06-17 05:15:38 -07001514
1515var REC_TYPE_UNKNOWN = -1;
1516var REC_TYPE_PATH = 0;
caryclark54359292015-03-26 07:52:43 -07001517var REC_TYPE_PATH2 = 1;
1518var REC_TYPE_SECT = 2;
1519var REC_TYPE_ACTIVE = 3;
1520var REC_TYPE_ADD = 4;
1521var REC_TYPE_SORT = 5;
1522var REC_TYPE_OP = 6;
1523var REC_TYPE_MARK = 7;
1524var REC_TYPE_COMPUTED = 8;
1525var REC_TYPE_COIN = 9;
1526var REC_TYPE_ANGLE = 10;
1527var REC_TYPE_ACTIVE_OP = 11;
1528var REC_TYPE_AFTERPART = 12;
caryclark03b03ca2015-04-23 09:13:37 -07001529var REC_TYPE_TOP = 13;
caryclark624637c2015-05-11 07:21:27 -07001530var REC_TYPE_COINCIDENCE = 14;
caryclark26ad22a2015-10-16 09:03:38 -07001531var REC_TYPE_ALIGNED = 15;
1532var REC_TYPE_LAST = REC_TYPE_ALIGNED;
caryclarkdac1d172014-06-17 05:15:38 -07001533
1534function strs_to_nums(strs) {
1535 var result = [];
1536 for (var idx = 1; idx < strs.length; ++idx) {
1537 var str = strs[idx];
1538 var num = parseFloat(str);
1539 if (isNaN(num)) {
1540 result.push(str);
1541 } else {
1542 result.push(num);
1543 }
1544 }
1545 return result;
1546}
1547
1548function filter_str_by(id, str, regex, array) {
1549 if (regex.test(str)) {
1550 var strs = regex.exec(str);
1551 var result = strs_to_nums(strs);
1552 array.push(id);
1553 array.push(result);
1554 return true;
1555 }
1556 return false;
1557}
1558
1559function construct_regexp2(pattern) {
1560 var escape = pattern.replace(/[-/\\^$*+?.()|[\]{}]/g, '\\$&');
1561 escape = escape.replace(/UNSORTABLE/g, "\\*\\*\\* UNSORTABLE \\*\\*\\*");
1562 escape = escape.replace(/CUBIC_VAL/g, "\\(P_VAL P_VAL P_VAL P_VAL\\)");
caryclark1049f122015-04-20 08:31:59 -07001563 escape = escape.replace(/CONIC_VAL/g, "\\(P_VAL P_VAL P_VAL W_VAL\\)");
caryclarkdac1d172014-06-17 05:15:38 -07001564 escape = escape.replace(/QUAD_VAL/g, "\\(P_VAL P_VAL P_VAL\\)");
1565 escape = escape.replace(/LINE_VAL/g, "\\(P_VAL P_VAL\\)");
1566 escape = escape.replace(/FILL_TYPE/g, "SkPath::k[a-zA-Z]+_FillType");
caryclark54359292015-03-26 07:52:43 -07001567 escape = escape.replace(/PTR_VAL/g, "0x[0-9A-F]+");
caryclarkdac1d172014-06-17 05:15:38 -07001568 escape = escape.replace(/PT_VAL/g, "\\(P_VAL\\)");
1569 escape = escape.replace(/P_VAL/g, "(-?\\d+\\.?\\d*(?:e-?\\d+)?)[Ff]?, ?(-?\\d+\\.?\\d*(?:e-?\\d+)?)[Ff]?");
1570 escape = escape.replace(/T_VAL/g, "(-?\\d+\\.?\\d*(?:e-?\\d+)?)");
caryclark1049f122015-04-20 08:31:59 -07001571 escape = escape.replace(/W_VAL/g, "(-?\\d+\\.?\\d*(?:e-?\\d+)?)[Ff]?");
caryclarkdac1d172014-06-17 05:15:38 -07001572 escape = escape.replace(/PATH/g, "pathB?");
caryclark1049f122015-04-20 08:31:59 -07001573 escape = escape.replace(/IDX/g, "(-?\\d+)");
caryclarkdac1d172014-06-17 05:15:38 -07001574 escape = escape.replace(/NUM/g, "(-?\\d+)");
1575 escape = escape.replace(/OPT/g, "(\\?|-?\\d+)");
1576 return new RegExp(escape, 'i');
1577}
1578
1579function construct_regexp2c(pattern) {
1580 var escape = pattern.replace(/[-/\\^$*+?.()|[\]{}]/g, '\\$&');
1581 escape = escape.replace(/UNSORTABLE/g, "\\*\\*\\* UNSORTABLE \\*\\*\\*");
caryclark54359292015-03-26 07:52:43 -07001582 escape = escape.replace(/CUBIC_VAL/g, "(?:\\$\\d = )?\\{\\{\\{P_VAL\\}, \\{P_VAL\\}, \\{P_VAL\\}, \\{P_VAL\\}\\}\\}");
caryclark1049f122015-04-20 08:31:59 -07001583 escape = escape.replace(/CONIC_VAL/g, "(?:\\$\\d = )?\\{\\{\\{\\{P_VAL\\}, \\{P_VAL\\}, \\{P_VAL\\}\\}\\}, W_VAL\\}");
caryclark54359292015-03-26 07:52:43 -07001584 escape = escape.replace(/QUAD_VAL/g, "(?:\\$\\d = )?\\{\\{\\{P_VAL\\}, \\{P_VAL\\}, \\{P_VAL\\}\\}\\}");
1585 escape = escape.replace(/LINE_VAL/g, "(?:\\$\\d = )?\\{\\{\\{P_VAL\\}, \\{P_VAL\\}\\}\\}");
caryclarkdac1d172014-06-17 05:15:38 -07001586 escape = escape.replace(/FILL_TYPE/g, "SkPath::k[a-zA-Z]+_FillType");
caryclark54359292015-03-26 07:52:43 -07001587 escape = escape.replace(/PTR_VAL/g, "0x[0-9A-F]+");
caryclarkdac1d172014-06-17 05:15:38 -07001588 escape = escape.replace(/PT_VAL/g, "\\{\\{P_VAL\\}\\}");
caryclark54359292015-03-26 07:52:43 -07001589 escape = escape.replace(/P_VAL/g, "(?:f?[xX] = )?(-?\\d+\\.?\\d*(?:e-?\\d+)?)[Ff]?, *(?: f?[yY] = )?(-?\\d+\\.?\\d*(?:e-?\\d+)?)[Ff]?");
caryclarkdac1d172014-06-17 05:15:38 -07001590 escape = escape.replace(/T_VAL/g, "(-?\\d+\\.?\\d*(?:e-?\\d+)?)");
caryclark1049f122015-04-20 08:31:59 -07001591 escape = escape.replace(/W_VAL/g, "(-?\\d+\\.?\\d*(?:e-?\\d+)?)[Ff]?");
caryclarkdac1d172014-06-17 05:15:38 -07001592 escape = escape.replace(/OPER/g, "[a-z]+");
1593 escape = escape.replace(/PATH/g, "pathB?");
1594 escape = escape.replace(/T_F/g, "([TF])");
caryclark1049f122015-04-20 08:31:59 -07001595 escape = escape.replace(/IDX/g, "(-?\\d+)");
caryclarkdac1d172014-06-17 05:15:38 -07001596 escape = escape.replace(/NUM/g, "(-?\\d+)");
1597 escape = escape.replace(/OPT/g, "(\\?|-?\\d+)");
1598 return new RegExp(escape, 'i');
1599}
1600
1601function match_regexp(str, lineNo, array, id, pattern) {
1602 var regex = construct_regexp2(pattern);
1603 if (filter_str_by(id, str, regex, array)) {
1604 return true;
1605 }
1606 regex = construct_regexp2c(pattern);
1607 return filter_str_by(id, str, regex, array);
1608}
1609
1610function endsWith(str, suffix) {
1611 return str.indexOf(suffix, str.length - suffix.length) !== -1;
1612}
1613
1614function parse_all(test) {
1615 var lines = test.match(/[^\r\n]+/g);
1616 var records = []; // a rec can be the original paths, a set of intersections, a set of active spans, a sort, or a path add
1617 var record = [];
1618 var recType = REC_TYPE_UNKNOWN;
1619 var lastLineNo;
1620 var moveX, moveY;
1621 for (var lineNo = 0; lineNo < lines.length; ++lineNo) {
1622 var line = lines[lineNo];
1623 if (line.length == 0) {
1624 continue;
1625 }
1626 var opStart = "SkOpSegment::";
1627 if (line.lastIndexOf(opStart, 0) === 0) {
1628 line = line.substr(opStart.length);
1629 }
1630 var angleStart = "SkOpAngle::";
1631 if (line.lastIndexOf(angleStart, 0) === 0) {
1632 line = line.substr(angleStart.length);
1633 }
caryclark624637c2015-05-11 07:21:27 -07001634 var coinStart = "SkOpCoincidence::";
1635 if (line.lastIndexOf(coinStart, 0) === 0) {
1636 line = line.substr(coinStart.length);
1637 }
caryclark54359292015-03-26 07:52:43 -07001638 var type = line.lastIndexOf("debugShowActiveSpans", 0) === 0 ? REC_TYPE_ACTIVE
caryclark624637c2015-05-11 07:21:27 -07001639 : line.lastIndexOf("debugShowCoincidence", 0) === 0 ? REC_TYPE_COINCIDENCE
caryclark54359292015-03-26 07:52:43 -07001640 : line.lastIndexOf("((SkOpSegment*)", 0) === 0 ? REC_TYPE_PATH2
caryclark55888e42016-07-18 10:01:36 -07001641 : line.lastIndexOf("debugShowTs", 0) === 0 ? REC_TYPE_COIN
caryclark54359292015-03-26 07:52:43 -07001642 : line.lastIndexOf("afterPart", 0) === 0 ? REC_TYPE_AFTERPART
caryclarkdac1d172014-06-17 05:15:38 -07001643 : line.lastIndexOf("debugShow", 0) === 0 ? REC_TYPE_SECT
1644 : line.lastIndexOf("activeOp", 0) === 0 ? REC_TYPE_ACTIVE_OP
1645 : line.lastIndexOf("computed", 0) === 0 ? REC_TYPE_COMPUTED
1646 : line.lastIndexOf("debugOne", 0) === 0 ? REC_TYPE_SORT
caryclark26ad22a2015-10-16 09:03:38 -07001647 : line.lastIndexOf("aligned=", 0) === 0 ? REC_TYPE_ALIGNED
caryclarkdac1d172014-06-17 05:15:38 -07001648 : line.lastIndexOf("dumpOne", 0) === 0 ? REC_TYPE_SORT
caryclark03b03ca2015-04-23 09:13:37 -07001649 : line.lastIndexOf("findTop", 0) === 0 ? REC_TYPE_TOP
caryclarkdac1d172014-06-17 05:15:38 -07001650 : line.lastIndexOf("pathB.", 0) === 0 ? REC_TYPE_ADD
1651 : line.lastIndexOf("path.", 0) === 0 ? REC_TYPE_ADD
1652 : line.lastIndexOf("after", 0) === 0 ? REC_TYPE_ANGLE
1653 : line.lastIndexOf("mark", 0) === 0 ? REC_TYPE_MARK
1654 : line.lastIndexOf(" {{", 0) === 0 ? REC_TYPE_COMPUTED
caryclark54359292015-03-26 07:52:43 -07001655 : line.lastIndexOf("seg=", 0) === 0 ? REC_TYPE_PATH
caryclarkdac1d172014-06-17 05:15:38 -07001656 : line.lastIndexOf("op", 0) === 0 ? REC_TYPE_OP
1657 : line.lastIndexOf("$", 0) === 0 ? REC_TYPE_PATH
1658 : REC_TYPE_UNKNOWN;
1659 if (recType != type || recType == REC_TYPE_ADD || recType == REC_TYPE_SECT
1660 || recType == REC_TYPE_ACTIVE_OP || recType == REC_TYPE_ANGLE) {
1661 if (recType != REC_TYPE_UNKNOWN) {
1662 records.push(recType);
1663 records.push(lastLineNo);
1664 records.push(record);
1665 }
1666 record = [];
1667 recType = type;
1668 lastLineNo = lineNo;
1669 }
1670 var found = false;
1671 switch (recType) {
1672 case REC_TYPE_ACTIVE:
1673 found = match_regexp(line, lineNo, record, ACTIVE_LINE_SPAN, "debugShowActiveSpans" +
caryclark55888e42016-07-18 10:01:36 -07001674" id=IDX LINE_VAL t=T_VAL tEnd=T_VAL windSum=OPT windValue=IDX"
caryclarkdac1d172014-06-17 05:15:38 -07001675 ) || match_regexp(line, lineNo, record, ACTIVE_QUAD_SPAN, "debugShowActiveSpans" +
caryclark55888e42016-07-18 10:01:36 -07001676" id=IDX QUAD_VAL t=T_VAL tEnd=T_VAL windSum=OPT windValue=IDX"
caryclark1049f122015-04-20 08:31:59 -07001677 ) || match_regexp(line, lineNo, record, ACTIVE_CONIC_SPAN, "debugShowActiveSpans" +
caryclark55888e42016-07-18 10:01:36 -07001678" id=IDX CONIC_VAL t=T_VAL tEnd=T_VAL windSum=OPT windValue=IDX"
caryclarkdac1d172014-06-17 05:15:38 -07001679 ) || match_regexp(line, lineNo, record, ACTIVE_CUBIC_SPAN, "debugShowActiveSpans" +
caryclark55888e42016-07-18 10:01:36 -07001680" id=IDX CUBIC_VAL t=T_VAL tEnd=T_VAL windSum=OPT windValue=IDX"
caryclark624637c2015-05-11 07:21:27 -07001681 ) || match_regexp(line, lineNo, record, ACTIVE_LINE_SPAN, "debugShowActiveSpans" +
caryclark55888e42016-07-18 10:01:36 -07001682" id=IDX LINE_VAL t=T_VAL tEnd=T_VAL windSum=OPT oppSum=OPT windValue=IDX oppValue=NUM"
caryclark624637c2015-05-11 07:21:27 -07001683 ) || match_regexp(line, lineNo, record, ACTIVE_QUAD_SPAN, "debugShowActiveSpans" +
caryclark55888e42016-07-18 10:01:36 -07001684" id=IDX QUAD_VAL t=T_VAL tEnd=T_VAL windSum=OPT oppSum=OPT windValue=IDX oppValue=NUM"
caryclark624637c2015-05-11 07:21:27 -07001685 ) || match_regexp(line, lineNo, record, ACTIVE_CONIC_SPAN, "debugShowActiveSpans" +
caryclark55888e42016-07-18 10:01:36 -07001686" id=IDX CONIC_VAL t=T_VAL tEnd=T_VAL windSum=OPT oppSum=OPT windValue=IDX oppValue=NUM"
caryclark624637c2015-05-11 07:21:27 -07001687 ) || match_regexp(line, lineNo, record, ACTIVE_CUBIC_SPAN, "debugShowActiveSpans" +
caryclark55888e42016-07-18 10:01:36 -07001688" id=IDX CUBIC_VAL t=T_VAL tEnd=T_VAL windSum=OPT oppSum=OPT windValue=IDX oppValue=NUM"
caryclarkdac1d172014-06-17 05:15:38 -07001689 );
1690 break;
1691 case REC_TYPE_ACTIVE_OP:
1692 found = match_regexp(line, lineNo, record, ACTIVE_OP, "activeOp" +
1693" id=IDX t=T_VAL tEnd=T_VAL op=OPER miFrom=NUM miTo=NUM suFrom=NUM suTo=NUM result=IDX"
1694 );
1695 break;
1696 case REC_TYPE_ADD:
1697 if (match_regexp(line, lineNo, record, ADD_MOVETO, "PATH.moveTo(P_VAL);")) {
1698 moveX = record[1][0];
1699 moveY = record[1][1];
1700 found = true;
1701 } else if (match_regexp(line, lineNo, record, ADD_LINETO, "PATH.lineTo(P_VAL);")) {
1702 record[1].unshift(moveY);
1703 record[1].unshift(moveX);
1704 moveX = record[1][2];
1705 moveY = record[1][3];
1706 found = true;
1707 } else if (match_regexp(line, lineNo, record, ADD_QUADTO, "PATH.quadTo(P_VAL, P_VAL);")) {
1708 record[1].unshift(moveY);
1709 record[1].unshift(moveX);
1710 moveX = record[1][4];
1711 moveY = record[1][5];
1712 found = true;
caryclark1049f122015-04-20 08:31:59 -07001713 } else if (match_regexp(line, lineNo, record, ADD_CONICTO, "PATH.conicTo(P_VAL, P_VAL, T_VAL);")) {
1714 record[1].unshift(moveY);
1715 record[1].unshift(moveX);
1716 moveX = record[1][4];
1717 moveY = record[1][5];
1718 found = true;
caryclarkdac1d172014-06-17 05:15:38 -07001719 } else if (match_regexp(line, lineNo, record, ADD_CUBICTO, "PATH.cubicTo(P_VAL, P_VAL, P_VAL);")) {
1720 record[1].unshift(moveY);
1721 record[1].unshift(moveX);
1722 moveX = record[1][6];
1723 moveY = record[1][7];
1724 found = true;
1725 } else if (match_regexp(line, lineNo, record, ADD_FILL, "PATH.setFillType(FILL_TYPE);")) {
1726 found = true;
1727 } else {
1728 found = match_regexp(line, lineNo, record, ADD_CLOSE, "PATH.close();");
1729 }
1730 break;
caryclark54359292015-03-26 07:52:43 -07001731 case REC_TYPE_AFTERPART:
Cary Clarkff114282016-12-14 11:56:16 -05001732 found = match_regexp(line, lineNo, record, PATH_LINE, "afterPart LINE_VAL id=IDX")
1733 || match_regexp(line, lineNo, record, PATH_QUAD, "afterPart QUAD_VAL id=IDX")
1734 || match_regexp(line, lineNo, record, PATH_CONIC, "afterPart CONIC_VAL id=IDX")
1735 || match_regexp(line, lineNo, record, PATH_CUBIC, "afterPart CUBIC_VAL id=IDX")
caryclark54359292015-03-26 07:52:43 -07001736 break;
caryclark26ad22a2015-10-16 09:03:38 -07001737 case REC_TYPE_ALIGNED:
1738 found = match_regexp(line, lineNo, record, PATH_LINE, "aligned=IDX LINE_VAL"
1739 ) || match_regexp(line, lineNo, record, PATH_QUAD, "aligned=IDX QUAD_VAL"
1740 ) || match_regexp(line, lineNo, record, PATH_CONIC, "aligned=IDX CONIC_VAL"
1741 ) || match_regexp(line, lineNo, record, PATH_CUBIC, "aligned=IDX CUBIC_VAL"
1742 );
1743 break;
caryclarkdac1d172014-06-17 05:15:38 -07001744 case REC_TYPE_ANGLE:
1745 found = match_regexp(line, lineNo, record, ANGLE_AFTER, "after " +
caryclarkdac1d172014-06-17 05:15:38 -07001746"[IDX/IDX] NUM/NUM tStart=T_VAL tEnd=T_VAL < [IDX/IDX] NUM/NUM tStart=T_VAL tEnd=T_VAL < [IDX/IDX] NUM/NUM tStart=T_VAL tEnd=T_VAL T_F IDX");
1747 break;
1748 case REC_TYPE_COIN:
1749 found = true;
1750 break;
caryclark624637c2015-05-11 07:21:27 -07001751 case REC_TYPE_COINCIDENCE:
1752 found = match_regexp(line, lineNo, record, COIN_MAIN_SPAN, "debugShowCoincidence" +
1753" + id=IDX t=T_VAL tEnd=T_VAL"
1754 ) || match_regexp(line, lineNo, record, COIN_OPP_SPAN, "debugShowCoincidence" +
1755" - id=IDX t=T_VAL tEnd=T_VAL"
1756 );
1757 break;
caryclarkdac1d172014-06-17 05:15:38 -07001758 case REC_TYPE_COMPUTED:
1759 found = line == "computed quadratics given"
1760 || match_regexp(line, lineNo, record, COMPUTED_SET_1, "computed quadratics set 1"
1761 ) || match_regexp(line, lineNo, record, COMPUTED_SET_2, "computed quadratics set 2"
1762 ) || match_regexp(line, lineNo, record, PATH_QUAD, " QUAD_VAL,"
caryclark1049f122015-04-20 08:31:59 -07001763 ) || match_regexp(line, lineNo, record, PATH_CONIC, " CONIC_VAL,"
caryclarkdac1d172014-06-17 05:15:38 -07001764 ) || match_regexp(line, lineNo, record, PATH_CUBIC, " CUBIC_VAL,"
1765 );
1766 break;
1767 case REC_TYPE_PATH:
caryclark54359292015-03-26 07:52:43 -07001768 found = match_regexp(line, lineNo, record, PATH_LINE, "seg=IDX LINE_VAL"
1769 ) || match_regexp(line, lineNo, record, PATH_QUAD, "seg=IDX QUAD_VAL"
caryclark1049f122015-04-20 08:31:59 -07001770 ) || match_regexp(line, lineNo, record, PATH_CONIC, "seg=IDX CONIC_VAL"
caryclark54359292015-03-26 07:52:43 -07001771 ) || match_regexp(line, lineNo, record, PATH_CUBIC, "seg=IDX CUBIC_VAL"
1772 );
1773 break;
1774 case REC_TYPE_PATH2:
1775 found = match_regexp(line, lineNo, record, PATH_LINE, "((SkOpSegment*) PTR_VAL) [IDX] {LINE_VAL}"
1776 ) || match_regexp(line, lineNo, record, PATH_QUAD, "((SkOpSegment*) PTR_VAL) [IDX] {QUAD_VAL}"
caryclark1049f122015-04-20 08:31:59 -07001777 ) || match_regexp(line, lineNo, record, PATH_CONIC, "((SkOpSegment*) PTR_VAL) [IDX] {CONIC_VAL}"
caryclark54359292015-03-26 07:52:43 -07001778 ) || match_regexp(line, lineNo, record, PATH_CUBIC, "((SkOpSegment*) PTR_VAL) [IDX] {CUBIC_VAL}"
caryclarkdac1d172014-06-17 05:15:38 -07001779 );
1780 break;
1781 case REC_TYPE_SECT:
1782 found = match_regexp(line, lineNo, record, INTERSECT_LINE, "debugShowLineIntersection" +
1783" wtTs[0]=T_VAL LINE_VAL PT_VAL wnTs[0]=T_VAL LINE_VAL"
1784 ) || match_regexp(line, lineNo, record, INTERSECT_LINE_2, "debugShowLineIntersection" +
1785" wtTs[0]=T_VAL LINE_VAL PT_VAL wtTs[1]=T_VAL PT_VAL wnTs[0]=T_VAL LINE_VAL wnTs[1]=T_VAL"
1786 ) || match_regexp(line, lineNo, record, INTERSECT_LINE_NO, "debugShowLineIntersection" +
1787" no intersect LINE_VAL LINE_VAL"
1788 ) || match_regexp(line, lineNo, record, INTERSECT_QUAD_LINE, "debugShowQuadLineIntersection" +
1789" wtTs[0]=T_VAL QUAD_VAL PT_VAL wnTs[0]=T_VAL LINE_VAL"
1790 ) || match_regexp(line, lineNo, record, INTERSECT_QUAD_LINE_2, "debugShowQuadLineIntersection" +
1791" wtTs[0]=T_VAL QUAD_VAL PT_VAL wtTs[1]=T_VAL PT_VAL wnTs[0]=T_VAL LINE_VAL wnTs[1]=T_VAL"
1792 ) || match_regexp(line, lineNo, record, INTERSECT_QUAD_LINE_NO, "debugShowQuadLineIntersection" +
1793" no intersect QUAD_VAL LINE_VAL"
1794 ) || match_regexp(line, lineNo, record, INTERSECT_QUAD, "debugShowQuadIntersection" +
1795" wtTs[0]=T_VAL QUAD_VAL PT_VAL wnTs[0]=T_VAL QUAD_VAL"
1796 ) || match_regexp(line, lineNo, record, INTERSECT_QUAD_2, "debugShowQuadIntersection" +
1797" wtTs[0]=T_VAL QUAD_VAL PT_VAL wtTs[1]=T_VAL PT_VAL wnTs[0]=T_VAL QUAD_VAL wnTs[1]=T_VAL"
1798 ) || match_regexp(line, lineNo, record, INTERSECT_QUAD_NO, "debugShowQuadIntersection" +
1799" no intersect QUAD_VAL QUAD_VAL"
caryclark55888e42016-07-18 10:01:36 -07001800
caryclark1049f122015-04-20 08:31:59 -07001801 ) || match_regexp(line, lineNo, record, INTERSECT_CONIC_LINE, "debugShowConicLineIntersection" +
1802" wtTs[0]=T_VAL CONIC_VAL PT_VAL wnTs[0]=T_VAL LINE_VAL"
1803 ) || match_regexp(line, lineNo, record, INTERSECT_CONIC_LINE_2, "debugShowConicLineIntersection" +
1804" wtTs[0]=T_VAL CONIC_VAL PT_VAL wtTs[1]=T_VAL PT_VAL wnTs[0]=T_VAL LINE_VAL wnTs[1]=T_VAL"
1805 ) || match_regexp(line, lineNo, record, INTERSECT_CONIC_LINE_NO, "debugShowConicLineIntersection" +
1806" no intersect CONIC_VAL LINE_VAL"
caryclark55888e42016-07-18 10:01:36 -07001807
1808 ) || match_regexp(line, lineNo, record, INTERSECT_CONIC_QUAD, "debugShowConicQuadIntersection" +
1809" wtTs[0]=T_VAL CONIC_VAL PT_VAL wnTs[0]=T_VAL QUAD_VAL"
1810 ) || match_regexp(line, lineNo, record, INTERSECT_CONIC_QUAD_2, "debugShowConicQuadIntersection" +
1811" wtTs[0]=T_VAL CONIC_VAL PT_VAL wtTs[1]=T_VAL PT_VAL wnTs[0]=T_VAL QUAD_VAL wnTs[1]=T_VAL"
caryclark6c3b9cd2016-09-26 05:36:58 -07001812 ) || match_regexp(line, lineNo, record, INTERSECT_CONIC_QUAD_3, "debugShowConicQuadIntersection" +
1813" wtTs[0]=T_VAL CONIC_VAL PT_VAL wtTs[1]=T_VAL PT_VAL wtTs[2]=T_VAL PT_VAL wnTs[0]=T_VAL QUAD_VAL wnTs[1]=T_VAL wnTs[2]=T_VAL"
1814 ) || match_regexp(line, lineNo, record, INTERSECT_CONIC_QUAD_4, "debugShowConicQuadIntersection" +
1815" wtTs[0]=T_VAL CONIC_VAL PT_VAL wtTs[1]=T_VAL PT_VAL wtTs[2]=T_VAL PT_VAL wtTs[3]=T_VAL PT_VAL wnTs[0]=T_VAL QUAD_VAL wnTs[1]=T_VAL wnTs[2]=T_VAL wnTs[3]=T_VAL"
caryclark55888e42016-07-18 10:01:36 -07001816 ) || match_regexp(line, lineNo, record, INTERSECT_CONIC_QUAD_NO, "debugShowConicQuadIntersection" +
1817" no intersect CONIC_VAL QUAD_VAL"
1818
caryclark1049f122015-04-20 08:31:59 -07001819 ) || match_regexp(line, lineNo, record, INTERSECT_CONIC, "debugShowConicIntersection" +
1820" wtTs[0]=T_VAL CONIC_VAL PT_VAL wnTs[0]=T_VAL CONIC_VAL"
1821 ) || match_regexp(line, lineNo, record, INTERSECT_CONIC_2, "debugShowConicIntersection" +
1822" wtTs[0]=T_VAL CONIC_VAL PT_VAL wtTs[1]=T_VAL PT_VAL wnTs[0]=T_VAL CONIC_VAL wnTs[1]=T_VAL"
1823 ) || match_regexp(line, lineNo, record, INTERSECT_CONIC_NO, "debugShowConicIntersection" +
1824" no intersect CONIC_VAL CONIC_VAL"
caryclarkdac1d172014-06-17 05:15:38 -07001825 ) || match_regexp(line, lineNo, record, INTERSECT_CUBIC_LINE, "debugShowCubicLineIntersection" +
1826" wtTs[0]=T_VAL CUBIC_VAL PT_VAL wnTs[0]=T_VAL LINE_VAL"
1827 ) || match_regexp(line, lineNo, record, INTERSECT_CUBIC_LINE_2, "debugShowCubicLineIntersection" +
1828" wtTs[0]=T_VAL CUBIC_VAL PT_VAL wtTs[1]=T_VAL PT_VAL wnTs[0]=T_VAL LINE_VAL wnTs[1]=T_VAL"
1829 ) || match_regexp(line, lineNo, record, INTERSECT_CUBIC_LINE_3, "debugShowCubicLineIntersection" +
1830" wtTs[0]=T_VAL CUBIC_VAL PT_VAL wtTs[1]=T_VAL PT_VAL wtTs[2]=T_VAL PT_VAL wnTs[0]=T_VAL LINE_VAL wnTs[1]=T_VAL wnTs[2]=T_VAL"
1831 ) || match_regexp(line, lineNo, record, INTERSECT_CUBIC_LINE_NO, "debugShowCubicLineIntersection" +
1832" no intersect CUBIC_VAL LINE_VAL"
1833 ) || match_regexp(line, lineNo, record, INTERSECT_CUBIC_QUAD, "debugShowCubicQuadIntersection" +
1834" wtTs[0]=T_VAL CUBIC_VAL PT_VAL wnTs[0]=T_VAL QUAD_VAL"
1835 ) || match_regexp(line, lineNo, record, INTERSECT_CUBIC_QUAD_2, "debugShowCubicQuadIntersection" +
1836" wtTs[0]=T_VAL CUBIC_VAL PT_VAL wtTs[1]=T_VAL PT_VAL wnTs[0]=T_VAL QUAD_VAL wnTs[1]=T_VAL"
1837 ) || match_regexp(line, lineNo, record, INTERSECT_CUBIC_QUAD_3, "debugShowCubicQuadIntersection" +
1838" wtTs[0]=T_VAL CUBIC_VAL PT_VAL wtTs[1]=T_VAL PT_VAL wtTs[2]=T_VAL PT_VAL wnTs[0]=T_VAL QUAD_VAL wnTs[1]=T_VAL wnTs[2]=T_VAL"
1839 ) || match_regexp(line, lineNo, record, INTERSECT_CUBIC_QUAD_4, "debugShowCubicQuadIntersection" +
1840" wtTs[0]=T_VAL CUBIC_VAL PT_VAL wtTs[1]=T_VAL PT_VAL wtTs[2]=T_VAL wtTs[3]=T_VAL PT_VAL wnTs[0]=T_VAL QUAD_VAL wnTs[1]=T_VAL wnTs[2]=T_VAL wnTs[3]=T_VAL"
1841 ) || match_regexp(line, lineNo, record, INTERSECT_CUBIC_QUAD_NO, "debugShowCubicQuadIntersection" +
1842" no intersect CUBIC_VAL QUAD_VAL"
1843 ) || match_regexp(line, lineNo, record, INTERSECT_CUBIC, "debugShowCubicIntersection" +
1844" wtTs[0]=T_VAL CUBIC_VAL PT_VAL wnTs[0]=T_VAL CUBIC_VAL"
1845 ) || match_regexp(line, lineNo, record, INTERSECT_CUBIC_2, "debugShowCubicIntersection" +
1846" wtTs[0]=T_VAL CUBIC_VAL PT_VAL wtTs[1]=T_VAL PT_VAL wnTs[0]=T_VAL CUBIC_VAL wnTs[1]=T_VAL"
1847 ) || match_regexp(line, lineNo, record, INTERSECT_CUBIC_3, "debugShowCubicIntersection" +
1848" wtTs[0]=T_VAL CUBIC_VAL PT_VAL wtTs[1]=T_VAL PT_VAL wtTs[2]=T_VAL PT_VAL wnTs[0]=T_VAL CUBIC_VAL wnTs[1]=T_VAL wnTs[2]=T_VAL"
1849 ) || match_regexp(line, lineNo, record, INTERSECT_CUBIC_4, "debugShowCubicIntersection" +
1850" wtTs[0]=T_VAL CUBIC_VAL PT_VAL wtTs[1]=T_VAL PT_VAL wtTs[2]=T_VAL PT_VAL wtTs[3]=T_VAL PT_VAL wnTs[0]=T_VAL CUBIC_VAL wnTs[1]=T_VAL wnTs[2]=T_VAL wnTs[3]=T_VAL"
1851 ) || match_regexp(line, lineNo, record, INTERSECT_CUBIC_NO, "debugShowCubicIntersection" +
1852" no intersect CUBIC_VAL CUBIC_VAL"
1853 ) || match_regexp(line, lineNo, record, INTERSECT_SELF_CUBIC, "debugShowCubicIntersection" +
1854" wtTs[0]=T_VAL CUBIC_VAL PT_VAL wtTs[1]=T_VAL"
1855 ) || match_regexp(line, lineNo, record, INTERSECT_SELF_CUBIC_NO, "debugShowCubicIntersection" +
1856" no self intersect CUBIC_VAL"
1857 );
1858 break;
1859 case REC_TYPE_SORT:
1860 var hasDone = / done/.test(line);
1861 var hasUnorderable = / unorderable/.test(line);
1862 var hasSmall = / small/.test(line);
1863 var hasTiny = / tiny/.test(line);
1864 var hasOperand = / operand/.test(line);
1865 var hasStop = / stop/.test(line);
1866 line.replace(/[ a-z]+$/, "");
1867 found = match_regexp(line, lineNo, record, SORT_UNARY, "debugOne" +
1868" [IDX/IDX] next=IDX/IDX sect=IDX/IDX s=T_VAL [IDX] e=T_VAL [IDX] sgn=NUM windVal=IDX windSum=OPT"
1869 ) || match_regexp(line, lineNo, record, SORT_BINARY, "debugOne" +
1870" [IDX/IDX] next=IDX/IDX sect=IDX/IDX s=T_VAL [IDX] e=T_VAL [IDX] sgn=NUM windVal=IDX windSum=OPT oppVal=IDX oppSum=OPT"
1871 ) || match_regexp(line, lineNo, record, SORT_UNARY, "dumpOne" +
1872" [IDX/IDX] next=IDX/IDX sect=NUM/NUM s=T_VAL [IDX] e=T_VAL [IDX] sgn=NUM windVal=IDX windSum=OPT"
1873 ) || match_regexp(line, lineNo, record, SORT_BINARY, "dumpOne" +
1874" [IDX/IDX] next=IDX/IDX sect=NUM/NUM s=T_VAL [IDX] e=T_VAL [IDX] sgn=NUM windVal=IDX windSum=OPT oppVal=IDX oppSum=OPT"
1875 );
1876 if (found) {
1877 record[1].push(hasDone);
1878 record[1].push(hasUnorderable);
1879 record[1].push(hasSmall);
1880 record[1].push(hasTiny);
1881 record[1].push(hasOperand);
1882 record[1].push(hasStop);
1883 }
1884 break;
caryclark03b03ca2015-04-23 09:13:37 -07001885 case REC_TYPE_TOP:
1886 found = match_regexp(line, lineNo, record, ACTIVE_OP, "findTop" +
1887" id=IDX s=T_VAL e=T_VAL cw=NUM swap=NUM inflections=NUM monotonic=NUM"
1888 ) || match_regexp(line, lineNo, record, ACTIVE_OP, "findTop" +
1889" id=IDX s=T_VAL e=T_VAL (-) cw=NUM swap=NUM inflections=NUM monotonic=NUM"
1890 ) || match_regexp(line, lineNo, record, ACTIVE_OP, "findTop" +
1891" id=IDX s=T_VAL e=T_VAL (+) cw=NUM swap=NUM inflections=NUM monotonic=NUM"
1892 );
1893 break;
caryclarkdac1d172014-06-17 05:15:38 -07001894 case REC_TYPE_MARK:
1895 found = match_regexp(line, lineNo, record, MARK_LINE, "markWinding" +
caryclark54359292015-03-26 07:52:43 -07001896" id=IDX LINE_VAL t=T_VAL [IDX] PT_VAL tEnd=T_VAL newWindSum=NUM newOppSum=OPT oppSum=OPT windSum=OPT windValue=IDX"
caryclarkdac1d172014-06-17 05:15:38 -07001897 ) || match_regexp(line, lineNo, record, MARK_QUAD, "markWinding" +
caryclark54359292015-03-26 07:52:43 -07001898" id=IDX QUAD_VAL t=T_VAL [IDX] PT_VAL tEnd=T_VAL newWindSum=NUM newOppSum=OPT oppSum=OPT windSum=OPT windValue=IDX"
caryclark1049f122015-04-20 08:31:59 -07001899 ) || match_regexp(line, lineNo, record, MARK_CONIC, "markWinding" +
1900" id=IDX CONIC_VAL t=T_VAL [IDX] PT_VAL tEnd=T_VAL newWindSum=NUM newOppSum=OPT oppSum=OPT windSum=OPT windValue=IDX"
caryclarkdac1d172014-06-17 05:15:38 -07001901 ) || match_regexp(line, lineNo, record, MARK_CUBIC, "markWinding" +
caryclark54359292015-03-26 07:52:43 -07001902" id=IDX CUBIC_VAL t=T_VAL [IDX] PT_VAL tEnd=T_VAL newWindSum=NUM newOppSum=OPT oppSum=OPT windSum=OPT windValue=IDX"
1903 ) || match_regexp(line, lineNo, record, MARK_DONE_LINE, "markDone" +
1904" id=IDX LINE_VAL t=T_VAL [IDX] PT_VAL tEnd=T_VAL newWindSum=OPT newOppSum=OPT oppSum=OPT windSum=OPT windValue=IDX oppValue=OPT"
1905 ) || match_regexp(line, lineNo, record, MARK_DONE_QUAD, "markDone" +
1906" id=IDX QUAD_VAL t=T_VAL [IDX] PT_VAL tEnd=T_VAL newWindSum=OPT newOppSum=OPT oppSum=OPT windSum=OPT windValue=IDX oppValue=OPT"
caryclark1049f122015-04-20 08:31:59 -07001907 ) || match_regexp(line, lineNo, record, MARK_DONE_CONIC, "markDone" +
1908" id=IDX CONIC_VAL t=T_VAL [IDX] PT_VAL tEnd=T_VAL newWindSum=OPT newOppSum=OPT oppSum=OPT windSum=OPT windValue=IDX oppValue=OPT"
caryclark54359292015-03-26 07:52:43 -07001909 ) || match_regexp(line, lineNo, record, MARK_DONE_CUBIC, "markDone" +
1910" id=IDX CUBIC_VAL t=T_VAL [IDX] PT_VAL tEnd=T_VAL newWindSum=OPT newOppSum=OPT oppSum=OPT windSum=OPT windValue=IDX oppValue=OPT"
caryclarkdac1d172014-06-17 05:15:38 -07001911 ) || match_regexp(line, lineNo, record, MARK_SIMPLE_LINE, "markWinding" +
1912" id=IDX LINE_VAL t=T_VAL [IDX] PT_VAL tEnd=T_VAL newWindSum=NUM windSum=OPT windValue=IDX"
1913 ) || match_regexp(line, lineNo, record, MARK_SIMPLE_QUAD, "markWinding" +
1914" id=IDX QUAD_VAL t=T_VAL [IDX] PT_VAL tEnd=T_VAL newWindSum=NUM windSum=OPT windValue=IDX"
caryclark1049f122015-04-20 08:31:59 -07001915 ) || match_regexp(line, lineNo, record, MARK_SIMPLE_CONIC, "markWinding" +
1916" id=IDX CONIC_VAL t=T_VAL [IDX] PT_VAL tEnd=T_VAL newWindSum=NUM windSum=OPT windValue=IDX"
caryclarkdac1d172014-06-17 05:15:38 -07001917 ) || match_regexp(line, lineNo, record, MARK_SIMPLE_CUBIC, "markWinding" +
1918" id=IDX CUBIC_VAL t=T_VAL [IDX] PT_VAL tEnd=T_VAL newWindSum=NUM windSum=OPT windValue=IDX"
caryclarkdac1d172014-06-17 05:15:38 -07001919 ) || match_regexp(line, lineNo, record, MARK_ANGLE_LAST, "markAngle" +
caryclark1049f122015-04-20 08:31:59 -07001920" last segment=IDX span=IDX"
caryclark54359292015-03-26 07:52:43 -07001921 ) || match_regexp(line, lineNo, record, MARK_ANGLE_LAST, "markAngle" +
caryclark55888e42016-07-18 10:01:36 -07001922" last seg=IDX span=IDX"
1923 ) || match_regexp(line, lineNo, record, MARK_ANGLE_LAST, "markAngle" +
1924" last segment=IDX span=IDX windSum=OPT"
1925 ) || match_regexp(line, lineNo, record, MARK_ANGLE_LAST, "markAngle" +
1926" last seg=IDX span=IDX windSum=OPT"
1927 );
caryclarkdac1d172014-06-17 05:15:38 -07001928 break;
1929 case REC_TYPE_OP:
1930 if (line.lastIndexOf("oppSign oppSign=", 0) === 0
1931 || line.lastIndexOf("operator<", 0) === 0) {
1932 found = true;
1933 break;
1934 }
caryclark54359292015-03-26 07:52:43 -07001935 found = match_regexp(line, lineNo, record, OP_DIFFERENCE, "op diff"
caryclarkdac1d172014-06-17 05:15:38 -07001936 ) || match_regexp(line, lineNo, record, OP_INTERSECT, "op intersect"
caryclark54359292015-03-26 07:52:43 -07001937 ) || match_regexp(line, lineNo, record, OP_INTERSECT, "op sect"
caryclarkdac1d172014-06-17 05:15:38 -07001938 ) || match_regexp(line, lineNo, record, OP_UNION, "op union"
1939 ) || match_regexp(line, lineNo, record, OP_XOR, "op xor"
1940 );
1941 break;
1942 case REC_TYPE_UNKNOWN:
1943 found = true;
1944 break;
1945 }
1946 if (!found) {
1947 console.log(line + " [" + lineNo + "] of type " + type + " not found");
1948 }
1949 }
1950 if (recType != REC_TYPE_UNKNOWN) {
1951 records.push(recType);
1952 records.push(lastLineNo);
1953 records.push(record);
1954 }
1955 if (records.length >= 1) {
1956 tests[testIndex] = records;
1957 testLines[testIndex] = lines;
1958 }
1959}
1960
1961function init(test) {
1962 var canvas = document.getElementById('canvas');
1963 if (!canvas.getContext) return;
1964 ctx = canvas.getContext('2d');
1965 var resScale = retina_scale && window.devicePixelRatio ? window.devicePixelRatio : 1;
1966 var unscaledWidth = window.innerWidth - 20;
1967 var unscaledHeight = window.innerHeight - 20;
1968 screenWidth = unscaledWidth;
1969 screenHeight = unscaledHeight;
1970 canvas.width = unscaledWidth * resScale;
1971 canvas.height = unscaledHeight * resScale;
1972 canvas.style.width = unscaledWidth + 'px';
1973 canvas.style.height = unscaledHeight + 'px';
1974 if (resScale != 1) {
1975 ctx.scale(resScale, resScale);
1976 }
1977 xmin = Infinity;
1978 xmax = -Infinity;
1979 ymin = Infinity;
1980 ymax = -Infinity;
caryclark26ad22a2015-10-16 09:03:38 -07001981 hasPath = hasAlignedPath = hasComputedPath = false;
caryclarkdac1d172014-06-17 05:15:38 -07001982 firstActiveSpan = -1;
1983 for (var tIndex = 0; tIndex < test.length; tIndex += 3) {
1984 var recType = test[tIndex];
1985 if (!typeof recType == 'number' || recType < REC_TYPE_UNKNOWN || recType > REC_TYPE_LAST) {
1986 console.log("unknown rec type: " + recType);
1987 throw "stop execution";
1988 }
1989 var records = test[tIndex + 2];
1990 for (var recordIndex = 0; recordIndex < records.length; recordIndex += 2) {
1991 var fragType = records[recordIndex];
1992 if (!typeof fragType == 'number' || fragType < 1 || fragType > FRAG_TYPE_LAST) {
1993 console.log("unknown in range frag type: " + fragType);
1994 throw "stop execution";
1995 }
1996 var frags = records[recordIndex + 1];
1997 var first = 0;
1998 var last = -1;
1999 var first2 = 0;
2000 var last2 = 0;
2001 switch (recType) {
caryclark26ad22a2015-10-16 09:03:38 -07002002 case REC_TYPE_ALIGNED:
2003 hasAlignedPath = true;
caryclarkdac1d172014-06-17 05:15:38 -07002004 case REC_TYPE_COMPUTED:
2005 if (fragType == COMPUTED_SET_1 || fragType == COMPUTED_SET_2) {
2006 break;
2007 }
caryclark26ad22a2015-10-16 09:03:38 -07002008 if (REC_TYPE_COMPUTED == recType) {
2009 hasComputedPath = true;
2010 }
caryclarkdac1d172014-06-17 05:15:38 -07002011 case REC_TYPE_PATH:
caryclark54359292015-03-26 07:52:43 -07002012 first = 1;
caryclarkdac1d172014-06-17 05:15:38 -07002013 switch (fragType) {
2014 case PATH_LINE:
caryclark54359292015-03-26 07:52:43 -07002015 last = 5;
caryclarkdac1d172014-06-17 05:15:38 -07002016 break;
caryclark1049f122015-04-20 08:31:59 -07002017 case PATH_CONIC:
caryclarkdac1d172014-06-17 05:15:38 -07002018 case PATH_QUAD:
caryclark54359292015-03-26 07:52:43 -07002019 last = 7;
caryclarkdac1d172014-06-17 05:15:38 -07002020 break;
2021 case PATH_CUBIC:
caryclark54359292015-03-26 07:52:43 -07002022 last = 9;
caryclarkdac1d172014-06-17 05:15:38 -07002023 break;
2024 default:
caryclark55888e42016-07-18 10:01:36 -07002025 console.log("unknown " + (recType == REC_TYPE_PATH ? "REC_TYPE_PATH"
caryclarkdac1d172014-06-17 05:15:38 -07002026 : "REC_TYPE_COMPUTED") + " frag type:" + fragType);
2027 throw "stop execution";
2028 }
2029 if (recType == REC_TYPE_PATH) {
2030 hasPath = true;
2031 }
2032 break;
caryclark54359292015-03-26 07:52:43 -07002033 case REC_TYPE_PATH2:
2034 first = 1;
2035 switch (fragType) {
2036 case PATH_LINE:
2037 last = 5;
2038 break;
caryclark1049f122015-04-20 08:31:59 -07002039 case PATH_CONIC:
caryclark54359292015-03-26 07:52:43 -07002040 case PATH_QUAD:
2041 last = 7;
2042 break;
2043 case PATH_CUBIC:
2044 last = 9;
2045 break;
2046 default:
caryclark55888e42016-07-18 10:01:36 -07002047 console.log("unknown " + (recType == REC_TYPE_PATH2 ? "REC_TYPE_PATH2"
caryclark54359292015-03-26 07:52:43 -07002048 : "REC_TYPE_COMPUTED") + " frag type:" + fragType);
2049 throw "stop execution";
2050 }
2051 if (recType == REC_TYPE_PATH2) {
2052 hasPath = true;
2053 }
2054 break;
caryclarkdac1d172014-06-17 05:15:38 -07002055 case REC_TYPE_ACTIVE:
2056 if (firstActiveSpan < 0) {
2057 firstActiveSpan = tIndex;
2058 }
2059 first = 1;
2060 switch (fragType) {
2061 case ACTIVE_LINE_SPAN:
2062 last = 5;
2063 break;
caryclark1049f122015-04-20 08:31:59 -07002064 case ACTIVE_CONIC_SPAN:
caryclarkdac1d172014-06-17 05:15:38 -07002065 case ACTIVE_QUAD_SPAN:
2066 last = 7;
2067 break;
2068 case ACTIVE_CUBIC_SPAN:
2069 last = 9;
2070 break;
2071 default:
2072 console.log("unknown REC_TYPE_ACTIVE frag type: " + fragType);
2073 throw "stop execution";
2074 }
2075 break;
2076 case REC_TYPE_ADD:
2077 switch (fragType) {
2078 case ADD_MOVETO:
2079 break;
2080 case ADD_LINETO:
2081 last = 4;
2082 break;
caryclark1049f122015-04-20 08:31:59 -07002083 case ADD_CONICTO:
caryclarkdac1d172014-06-17 05:15:38 -07002084 case ADD_QUADTO:
2085 last = 6;
2086 break;
2087 case ADD_CUBICTO:
2088 last = 8;
2089 break;
2090 case ADD_CLOSE:
2091 case ADD_FILL:
2092 break;
2093 default:
2094 console.log("unknown REC_TYPE_ADD frag type: " + fragType);
2095 throw "stop execution";
2096 }
2097 break;
caryclark54359292015-03-26 07:52:43 -07002098 case REC_TYPE_AFTERPART:
2099 switch (fragType) {
2100 case PATH_LINE:
2101 last = 4;
2102 break;
caryclark1049f122015-04-20 08:31:59 -07002103 case PATH_CONIC:
caryclark54359292015-03-26 07:52:43 -07002104 case PATH_QUAD:
2105 last = 6;
2106 break;
2107 case PATH_CUBIC:
2108 last = 8;
2109 break;
2110 default:
2111 console.log("unknown REC_TYPE_ACTIVEPART frag type: " + fragType);
2112 throw "stop execution";
2113 }
2114 break;
caryclarkdac1d172014-06-17 05:15:38 -07002115 case REC_TYPE_SECT:
2116 switch (fragType) {
2117 case INTERSECT_LINE:
2118 first = 1; last = 5; first2 = 8; last2 = 12;
2119 break;
2120 case INTERSECT_LINE_2:
2121 first = 1; last = 5; first2 = 11; last2 = 15;
2122 break;
2123 case INTERSECT_LINE_NO:
2124 first = 0; last = 4; first2 = 4; last2 = 8;
2125 break;
caryclark1049f122015-04-20 08:31:59 -07002126 case INTERSECT_CONIC_LINE:
2127 first = 1; last = 7; first2 = 11; last2 = 15;
2128 break;
caryclarkdac1d172014-06-17 05:15:38 -07002129 case INTERSECT_QUAD_LINE:
2130 first = 1; last = 7; first2 = 10; last2 = 14;
2131 break;
caryclark1049f122015-04-20 08:31:59 -07002132 case INTERSECT_CONIC_LINE_2:
2133 first = 1; last = 7; first2 = 14; last2 = 18;
2134 break;
caryclarkdac1d172014-06-17 05:15:38 -07002135 case INTERSECT_QUAD_LINE_2:
2136 first = 1; last = 7; first2 = 13; last2 = 17;
2137 break;
caryclark1049f122015-04-20 08:31:59 -07002138 case INTERSECT_CONIC_LINE_NO:
2139 first = 0; last = 6; first2 = 7; last2 = 11;
2140 break;
caryclarkdac1d172014-06-17 05:15:38 -07002141 case INTERSECT_QUAD_LINE_NO:
2142 first = 0; last = 6; first2 = 6; last2 = 10;
2143 break;
caryclark1049f122015-04-20 08:31:59 -07002144 case INTERSECT_CONIC:
2145 first = 1; last = 7; first2 = 11; last2 = 17;
2146 break;
caryclarkdac1d172014-06-17 05:15:38 -07002147 case INTERSECT_QUAD:
2148 first = 1; last = 7; first2 = 10; last2 = 16;
2149 break;
caryclark1049f122015-04-20 08:31:59 -07002150 case INTERSECT_CONIC_2:
2151 first = 1; last = 7; first2 = 14; last2 = 20;
2152 break;
caryclarkdac1d172014-06-17 05:15:38 -07002153 case INTERSECT_QUAD_2:
2154 first = 1; last = 7; first2 = 13; last2 = 19;
2155 break;
caryclark1049f122015-04-20 08:31:59 -07002156 case INTERSECT_CONIC_NO:
2157 first = 0; last = 6; first2 = 7; last2 = 13;
2158 break;
caryclarkdac1d172014-06-17 05:15:38 -07002159 case INTERSECT_QUAD_NO:
2160 first = 0; last = 6; first2 = 6; last2 = 12;
2161 break;
2162 case INTERSECT_SELF_CUBIC:
2163 first = 1; last = 9;
2164 break;
2165 case INTERSECT_SELF_CUBIC_NO:
2166 first = 0; last = 8;
2167 break;
2168 case INTERSECT_CUBIC_LINE:
2169 first = 1; last = 9; first2 = 12; last2 = 16;
2170 break;
2171 case INTERSECT_CUBIC_LINE_2:
2172 first = 1; last = 9; first2 = 15; last2 = 19;
2173 break;
2174 case INTERSECT_CUBIC_LINE_3:
2175 first = 1; last = 9; first2 = 18; last2 = 22;
2176 break;
2177 case INTERSECT_CUBIC_LINE_NO:
2178 first = 0; last = 8; first2 = 8; last2 = 12;
2179 break;
caryclark55888e42016-07-18 10:01:36 -07002180 case INTERSECT_CONIC_QUAD:
2181 first = 1; last = 7; first2 = 11; last2 = 17;
2182 break;
2183 case INTERSECT_CONIC_QUAD_2:
2184 first = 1; last = 7; first2 = 14; last2 = 20;
2185 break;
caryclark6c3b9cd2016-09-26 05:36:58 -07002186 case INTERSECT_CONIC_QUAD_3:
2187 first = 1; last = 7; first2 = 17; last2 = 23;
2188 break;
2189 case INTERSECT_CONIC_QUAD_4:
2190 first = 1; last = 7; first2 = 20; last2 = 26;
2191 break;
caryclark55888e42016-07-18 10:01:36 -07002192 case INTERSECT_CONIC_QUAD_NO:
2193 first = 0; last = 6; first2 = 7; last2 = 13;
2194 break;
caryclarkdac1d172014-06-17 05:15:38 -07002195 case INTERSECT_CUBIC_QUAD:
2196 first = 1; last = 9; first2 = 12; last2 = 18;
2197 break;
2198 case INTERSECT_CUBIC_QUAD_2:
2199 first = 1; last = 9; first2 = 15; last2 = 21;
2200 break;
2201 case INTERSECT_CUBIC_QUAD_3:
2202 first = 1; last = 9; first2 = 18; last2 = 24;
2203 break;
2204 case INTERSECT_CUBIC_QUAD_4:
2205 first = 1; last = 9; first2 = 21; last2 = 27;
2206 break;
2207 case INTERSECT_CUBIC_QUAD_NO:
2208 first = 0; last = 8; first2 = 8; last2 = 14;
2209 break;
2210 case INTERSECT_CUBIC:
2211 first = 1; last = 9; first2 = 12; last2 = 20;
2212 break;
2213 case INTERSECT_CUBIC_2:
2214 first = 1; last = 9; first2 = 15; last2 = 23;
2215 break;
2216 case INTERSECT_CUBIC_3:
2217 first = 1; last = 9; first2 = 18; last2 = 26;
2218 break;
2219 case INTERSECT_CUBIC_4:
2220 first = 1; last = 9; first2 = 21; last2 = 29;
2221 break;
2222 case INTERSECT_CUBIC_NO:
2223 first = 0; last = 8; first2 = 8; last2 = 16;
2224 break;
2225 default:
2226 console.log("unknown REC_TYPE_SECT frag type: " + fragType);
2227 throw "stop execution";
2228 }
2229 break;
2230 default:
2231 continue;
2232 }
2233 for (var idx = first; idx < last; idx += 2) {
2234 xmin = Math.min(xmin, frags[idx]);
2235 xmax = Math.max(xmax, frags[idx]);
2236 ymin = Math.min(ymin, frags[idx + 1]);
2237 ymax = Math.max(ymax, frags[idx + 1]);
2238 }
2239 for (var idx = first2; idx < last2; idx += 2) {
2240 xmin = Math.min(xmin, frags[idx]);
2241 xmax = Math.max(xmax, frags[idx]);
2242 ymin = Math.min(ymin, frags[idx + 1]);
2243 ymax = Math.max(ymax, frags[idx + 1]);
2244 }
2245 }
2246 }
2247 var angleBounds = [Infinity, Infinity, -Infinity, -Infinity];
2248 for (var tIndex = 0; tIndex < test.length; tIndex += 3) {
2249 var recType = test[tIndex];
2250 var records = test[tIndex + 2];
2251 for (var recordIndex = 0; recordIndex < records.length; recordIndex += 2) {
2252 var fragType = records[recordIndex];
2253 var frags = records[recordIndex + 1];
2254 switch (recType) {
2255 case REC_TYPE_ACTIVE_OP:
2256 if (!draw_op) {
2257 break;
2258 }
2259 {
2260 var curve = curvePartialByID(test, frags[0], frags[1], frags[2]);
2261 curve_extremes(curve, angleBounds);
2262 }
2263 break;
2264 case REC_TYPE_ANGLE:
2265 if (!draw_angle) {
2266 break;
2267 }
caryclark54359292015-03-26 07:52:43 -07002268 {
caryclarkdac1d172014-06-17 05:15:38 -07002269 var curve = curvePartialByID(test, frags[0], frags[4], frags[5]);
2270 curve_extremes(curve, angleBounds);
2271 curve = curvePartialByID(test, frags[6], frags[10], frags[11]);
2272 curve_extremes(curve, angleBounds);
2273 curve = curvePartialByID(test, frags[12], frags[16], frags[17]);
2274 }
2275 break;
caryclark624637c2015-05-11 07:21:27 -07002276 case REC_TYPE_COINCIDENCE:
2277 if (!draw_coincidence) {
2278 break;
2279 }
2280 {
2281 var curve = curvePartialByID(test, frags[0], frags[1], frags[2]);
2282 curve_extremes(curve, angleBounds);
2283 }
2284 break;
caryclarkdac1d172014-06-17 05:15:38 -07002285 case REC_TYPE_SORT:
2286 if (!draw_sort) {
2287 break;
2288 }
2289 if (fragType == SORT_UNARY || fragType == SORT_BINARY) {
2290 var curve = curvePartialByID(test, frags[0], frags[6], frags[8]);
2291 curve_extremes(curve, angleBounds);
2292 }
2293 break;
caryclark03b03ca2015-04-23 09:13:37 -07002294 case REC_TYPE_TOP:
2295 if (!draw_top) {
2296 break;
2297 }
2298 {
2299 var curve = curvePartialByID(test, frags[0], frags[1], frags[2]);
2300 curve_extremes(curve, angleBounds);
2301 }
2302 break;
caryclarkdac1d172014-06-17 05:15:38 -07002303 }
2304 }
2305 }
2306 xmin = Math.min(xmin, angleBounds[0]);
2307 ymin = Math.min(ymin, angleBounds[1]);
2308 xmax = Math.max(xmax, angleBounds[2]);
2309 ymax = Math.max(ymax, angleBounds[3]);
2310 setScale(xmin, xmax, ymin, ymax);
2311 if (hasPath == false && hasComputedPath == true && !draw_computed) {
caryclark1049f122015-04-20 08:31:59 -07002312 draw_computed = 7; // show quadratics, conics, and cubics
caryclarkdac1d172014-06-17 05:15:38 -07002313 }
2314 if (hasPath == true && hasComputedPath == false && draw_computed) {
2315 draw_computed = 0;
2316 }
2317}
2318
caryclark26ad22a2015-10-16 09:03:38 -07002319function curveByIDMatch(test, id, recMatch) {
caryclark54359292015-03-26 07:52:43 -07002320 var tIndex = -3;
2321 while ((tIndex += 3) < test.length) {
caryclarkdac1d172014-06-17 05:15:38 -07002322 var recType = test[tIndex];
caryclark54359292015-03-26 07:52:43 -07002323 if (recType == REC_TYPE_OP) {
2324 continue;
2325 }
caryclark26ad22a2015-10-16 09:03:38 -07002326 if (recType != recMatch) {
caryclarkdac1d172014-06-17 05:15:38 -07002327 return [];
2328 }
2329 var records = test[tIndex + 2];
2330 for (var recordIndex = 0; recordIndex < records.length; recordIndex += 2) {
2331 var fragType = records[recordIndex];
2332 var frags = records[recordIndex + 1];
2333 if (frags[0] == id) {
2334 switch (fragType) {
caryclark54359292015-03-26 07:52:43 -07002335 case PATH_LINE:
caryclarkdac1d172014-06-17 05:15:38 -07002336 return [frags[1], frags[2], frags[3], frags[4]];
caryclark54359292015-03-26 07:52:43 -07002337 case PATH_QUAD:
caryclarkdac1d172014-06-17 05:15:38 -07002338 return [frags[1], frags[2], frags[3], frags[4],
2339 frags[5], frags[6]];
caryclark1049f122015-04-20 08:31:59 -07002340 case PATH_CONIC:
2341 return [frags[1], frags[2], frags[3], frags[4],
2342 frags[5], frags[6], frags[7]];
caryclark54359292015-03-26 07:52:43 -07002343 case PATH_CUBIC:
caryclarkdac1d172014-06-17 05:15:38 -07002344 return [frags[1], frags[2], frags[3], frags[4],
2345 frags[5], frags[6], frags[7], frags[8]];
2346 }
2347 }
2348 }
caryclarkdac1d172014-06-17 05:15:38 -07002349 }
2350 return [];
2351}
2352
caryclark26ad22a2015-10-16 09:03:38 -07002353function curveByID(test, id) {
2354 var result = draw_path >= 4 ? curveByIDMatch(test, id, REC_TYPE_ALIGNED) : [];
2355 if (!result.length) {
2356 result = curveByIDMatch(test, id, REC_TYPE_PATH);
2357 }
2358 return result;
2359}
2360
2361function curvePartialByIDMatch(test, id, t0, t1, recMatch) {
caryclark54359292015-03-26 07:52:43 -07002362 var tIndex = -3;
2363 while ((tIndex += 3) < test.length) {
caryclarkdac1d172014-06-17 05:15:38 -07002364 var recType = test[tIndex];
caryclark54359292015-03-26 07:52:43 -07002365 if (recType == REC_TYPE_OP) {
2366 continue;
2367 }
caryclark26ad22a2015-10-16 09:03:38 -07002368 if (recType != recMatch) {
caryclarkdac1d172014-06-17 05:15:38 -07002369 return [];
2370 }
2371 var records = test[tIndex + 2];
2372 for (var recordIndex = 0; recordIndex < records.length; recordIndex += 2) {
2373 var fragType = records[recordIndex];
2374 var frags = records[recordIndex + 1];
2375 if (frags[0] == id) {
2376 switch (fragType) {
caryclark54359292015-03-26 07:52:43 -07002377 case PATH_LINE:
caryclarkdac1d172014-06-17 05:15:38 -07002378 return linePartial(frags[1], frags[2], frags[3], frags[4], t0, t1);
caryclark54359292015-03-26 07:52:43 -07002379 case PATH_QUAD:
caryclarkdac1d172014-06-17 05:15:38 -07002380 return quadPartial(frags[1], frags[2], frags[3], frags[4],
2381 frags[5], frags[6], t0, t1);
caryclark1049f122015-04-20 08:31:59 -07002382 case PATH_CONIC:
2383 return conicPartial(frags[1], frags[2], frags[3], frags[4],
2384 frags[5], frags[6], frags[7], t0, t1);
caryclark54359292015-03-26 07:52:43 -07002385 case PATH_CUBIC:
caryclarkdac1d172014-06-17 05:15:38 -07002386 return cubicPartial(frags[1], frags[2], frags[3], frags[4],
2387 frags[5], frags[6], frags[7], frags[8], t0, t1);
2388 }
2389 }
2390 }
caryclarkdac1d172014-06-17 05:15:38 -07002391 }
2392 return [];
2393}
2394
caryclark26ad22a2015-10-16 09:03:38 -07002395function curvePartialByID(test, id, t0, t1) {
2396 var result = draw_path >= 4 ? curvePartialByIDMatch(test, id, t0, t1, REC_TYPE_ALIGNED) : [];
2397 if (!result.length) {
2398 result = curvePartialByIDMatch(test, id, t0, t1, REC_TYPE_PATH);
2399 }
2400 return result;
2401}
2402
2403function idByCurveIDMatch(test, frag, type, recMatch) {
caryclark54359292015-03-26 07:52:43 -07002404 var tIndex = 0;
caryclarkdac1d172014-06-17 05:15:38 -07002405 while (tIndex < test.length) {
2406 var recType = test[tIndex];
caryclark26ad22a2015-10-16 09:03:38 -07002407 if (recType != recMatch) {
caryclark54359292015-03-26 07:52:43 -07002408 ++tIndex;
2409 continue;
caryclarkdac1d172014-06-17 05:15:38 -07002410 }
2411 var records = test[tIndex + 2];
2412 for (var recordIndex = 0; recordIndex < records.length; recordIndex += 2) {
2413 var fragType = records[recordIndex];
2414 var frags = records[recordIndex + 1];
caryclark54359292015-03-26 07:52:43 -07002415 if (frag.length != frags.length - 1) {
2416 continue;
2417 }
caryclarkdac1d172014-06-17 05:15:38 -07002418 switch (fragType) {
caryclark54359292015-03-26 07:52:43 -07002419 case PATH_LINE:
caryclarkdac1d172014-06-17 05:15:38 -07002420 if (frag[0] != frags[1] || frag[1] != frags[2]
2421 || frag[2] != frags[3] || frag[3] != frags[4]) {
2422 continue;
2423 }
2424 return frags[0];
caryclark54359292015-03-26 07:52:43 -07002425 case PATH_QUAD:
caryclarkdac1d172014-06-17 05:15:38 -07002426 if (frag[0] != frags[1] || frag[1] != frags[2]
2427 || frag[2] != frags[3] || frag[3] != frags[4]
2428 || frag[4] != frags[5] || frag[5] != frags[6]) {
2429 continue;
2430 }
2431 return frags[0];
caryclark1049f122015-04-20 08:31:59 -07002432 case PATH_CONIC:
2433 if (frag[0] != frags[1] || frag[1] != frags[2]
2434 || frag[2] != frags[3] || frag[3] != frags[4]
2435 || frag[4] != frags[5] || frag[5] != frags[6]
2436 || frag[6] != frags[7]) {
2437 continue;
2438 }
2439 return frags[0];
caryclark54359292015-03-26 07:52:43 -07002440 case PATH_CUBIC:
caryclarkdac1d172014-06-17 05:15:38 -07002441 if (frag[0] != frags[1] || frag[1] != frags[2]
2442 || frag[2] != frags[3] || frag[3] != frags[4]
2443 || frag[4] != frags[5] || frag[5] != frags[6]
2444 || frag[6] != frags[7] || frag[7] != frags[8]) {
2445 continue;
2446 }
2447 return frags[0];
2448 }
2449 }
2450 ++tIndex;
2451 }
2452 return -1;
2453}
2454
caryclark26ad22a2015-10-16 09:03:38 -07002455function idByCurve(test, frag, type) {
2456 var result = draw_path >= 4 ? idByCurveIDMatch(test, frag, type, REC_TYPE_ALIGNED) : [];
2457 if (!result.length) {
2458 result = idByCurveIDMatch(test, frag, type, REC_TYPE_PATH);
2459 }
2460 return result;
2461}
2462
caryclarkdac1d172014-06-17 05:15:38 -07002463function curve_extremes(curve, bounds) {
caryclark1049f122015-04-20 08:31:59 -07002464 var length = curve.length == 7 ? 6 : curve.length;
caryclarked0935a2015-10-22 07:23:52 -07002465 for (var index = 0; index < length; index += 2) {
caryclarkdac1d172014-06-17 05:15:38 -07002466 var x = curve[index];
2467 var y = curve[index + 1];
2468 bounds[0] = Math.min(bounds[0], x);
2469 bounds[1] = Math.min(bounds[1], y);
2470 bounds[2] = Math.max(bounds[2], x);
2471 bounds[3] = Math.max(bounds[3], y);
2472 }
2473}
2474
2475function setScale(x0, x1, y0, y1) {
2476 var srcWidth = x1 - x0;
2477 var srcHeight = y1 - y0;
2478 var usableWidth = screenWidth;
2479 var xDigits = Math.ceil(Math.log(Math.abs(xmax)) / Math.log(10));
2480 var yDigits = Math.ceil(Math.log(Math.abs(ymax)) / Math.log(10));
2481 usableWidth -= (xDigits + yDigits) * 10;
2482 usableWidth -= decimal_places * 10;
2483 if (draw_legend) {
2484 usableWidth -= 40;
2485 }
2486 var hscale = usableWidth / srcWidth;
2487 var vscale = screenHeight / srcHeight;
2488 scale = Math.min(hscale, vscale);
2489 var invScale = 1 / scale;
2490 var sxmin = x0 - invScale * 5;
2491 var symin = y0 - invScale * 10;
2492 var sxmax = x1 + invScale * (6 * decimal_places + 10);
2493 var symax = y1 + invScale * 10;
2494 srcWidth = sxmax - sxmin;
2495 srcHeight = symax - symin;
2496 hscale = usableWidth / srcWidth;
2497 vscale = screenHeight / srcHeight;
2498 scale = Math.min(hscale, vscale);
2499 srcLeft = sxmin;
2500 srcTop = symin;
2501}
2502
2503function drawArc(curve, op, from, to) {
2504 var type = PATH_LINE + (curve.length / 2 - 2);
2505 var pt = pointAtT(curve, type, op ? 0.4 : 0.6);
2506 var dy = pt.y - curve[1];
2507 var dx = pt.x - curve[0];
2508 var dist = Math.sqrt(dy * dy + dx * dx);
2509 var _dist = dist * scale;
2510 var angle = Math.atan2(dy, dx);
2511 var _px = (curve[0] - srcLeft) * scale;
2512 var _py = (curve[1] - srcTop) * scale;
2513 var divisor = 4;
2514 var endDist;
2515 do {
2516 var ends = [];
2517 for (var index = -1; index <= 1; index += 2) {
2518 var px = Math.cos(index * Math.PI / divisor);
2519 var py = Math.sin(index * Math.PI / divisor);
2520 ends.push(px);
2521 ends.push(py);
2522 }
2523 var endDx = (ends[2] - ends[0]) * scale * dist;
2524 var endDy = (ends[3] - ends[1]) * scale * dist;
2525 endDist = Math.sqrt(endDx * endDx + endDy * endDy);
2526 if (endDist < 100) {
2527 break;
2528 }
2529 divisor *= 2;
2530 } while (true);
2531 if (endDist < 30) {
2532 return;
2533 }
2534 if (op) {
2535 divisor *= 2;
2536 }
2537 ctx.strokeStyle = op ? "rgba(210,0,45, 0.4)" : "rgba(90,90,90, 0.5)";
2538 ctx.beginPath();
2539 ctx.arc(_px, _py, _dist, angle - Math.PI / divisor, angle + Math.PI / divisor, false);
2540 ctx.stroke();
2541 var saveAlign = ctx.textAlign;
2542 var saveStyle = ctx.fillStyle;
2543 var saveFont = ctx.font;
2544 ctx.textAlign = "center";
2545 ctx.fillStyle = "black";
2546 ctx.font = "normal 24px Arial";
2547 divisor *= 0.8;
2548 for (var index = -1; index <= 1; index += 2) {
2549 var px = curve[0] + Math.cos(angle + index * Math.PI / divisor) * dist;
2550 var py = curve[1] + Math.sin(angle + index * Math.PI / divisor) * dist;
2551 var _px = (px - srcLeft) * scale;
2552 var _py = (py - srcTop) * scale;
2553 ctx.fillText(index < 0 ? to.toString() : from.toString(), _px, _py + 8);
2554 }
2555 ctx.textAlign = saveAlign;
2556 ctx.fillStyle = saveStyle;
2557 ctx.font = saveFont;
2558}
2559
2560function drawPoint(px, py, end) {
caryclark1049f122015-04-20 08:31:59 -07002561 var length = drawnPts.length == 7 ? 6 : drawnPts.length;
2562 for (var pts = 0; pts < length; pts += 2) {
caryclarkdac1d172014-06-17 05:15:38 -07002563 var x = drawnPts[pts];
2564 var y = drawnPts[pts + 1];
2565 if (px == x && py == y) {
2566 return;
2567 }
2568 }
2569 drawnPts.push(px);
2570 drawnPts.push(py);
2571 var label = px.toFixed(decimal_places) + ", " + py.toFixed(decimal_places);
2572 var _px = (px - srcLeft) * scale;
2573 var _py = (py - srcTop) * scale;
2574 ctx.beginPath();
2575 ctx.arc(_px, _py, 3, 0, Math.PI*2, true);
2576 ctx.closePath();
2577 if (end) {
2578 ctx.fill();
2579 } else {
2580 ctx.stroke();
2581 }
2582 if (debug_xy) {
2583 ctx.textAlign = "left";
2584 ctx.fillText(label, _px + 5, _py);
2585 }
2586}
2587
caryclark1049f122015-04-20 08:31:59 -07002588function coordCount(curveType) {
2589 switch (curveType) {
2590 case PATH_LINE:
2591 return 4;
2592 case PATH_QUAD:
2593 return 6;
2594 case PATH_CONIC:
2595 return 6;
2596 case PATH_CUBIC:
2597 return 8;
2598 }
2599 return -1;
2600}
2601
caryclarkdac1d172014-06-17 05:15:38 -07002602function drawPoints(ptArray, curveType, drawControls) {
caryclark1049f122015-04-20 08:31:59 -07002603 var count = coordCount(curveType);
caryclarkdac1d172014-06-17 05:15:38 -07002604 for (var idx = 0; idx < count; idx += 2) {
2605 if (!drawControls && idx != 0 && idx != count - 2) {
2606 continue;
2607 }
2608 drawPoint(ptArray[idx], ptArray[idx + 1], idx == 0 || idx == count - 2);
2609 }
2610}
2611
2612function drawControlLines(curve, curveType, drawEnd) {
2613 if (curveType == PATH_LINE) {
2614 return;
2615 }
2616 ctx.strokeStyle = "rgba(0,0,0, 0.3)";
2617 drawLine(curve[0], curve[1], curve[2], curve[3]);
2618 drawLine(curve[2], curve[3], curve[4], curve[5]);
2619 if (curveType == PATH_CUBIC) {
2620 drawLine(curve[4], curve[5], curve[6], curve[7]);
2621 if (drawEnd > 1) {
2622 drawLine(curve[6], curve[7], curve[0], curve[1]);
2623 if (drawEnd > 2) {
2624 drawLine(curve[0], curve[1], curve[4], curve[5]);
2625 drawLine(curve[6], curve[7], curve[2], curve[3]);
2626 }
2627 }
2628 } else if (drawEnd > 1) {
2629 drawLine(curve[4], curve[5], curve[0], curve[1]);
2630 }
2631}
2632
2633function pointAtT(curve, curveType, t) {
2634 var xy = {};
2635 switch (curveType) {
2636 case PATH_LINE:
2637 var a = 1 - t;
2638 var b = t;
2639 xy.x = a * curve[0] + b * curve[2];
2640 xy.y = a * curve[1] + b * curve[3];
2641 break;
2642 case PATH_QUAD:
2643 var one_t = 1 - t;
2644 var a = one_t * one_t;
2645 var b = 2 * one_t * t;
2646 var c = t * t;
2647 xy.x = a * curve[0] + b * curve[2] + c * curve[4];
2648 xy.y = a * curve[1] + b * curve[3] + c * curve[5];
2649 break;
caryclark1049f122015-04-20 08:31:59 -07002650 case PATH_CONIC:
2651 var one_t = 1 - t;
2652 var a = one_t * one_t;
2653 var b = 2 * one_t * t;
2654 var c = t * t;
2655 xy.x = a * curve[0] + b * curve[2] * curve[6] + c * curve[4];
2656 xy.y = a * curve[1] + b * curve[3] * curve[6] + c * curve[5];
2657 var d = a + b * curve[6] + c;
2658 xy.x /= d;
2659 xy.y /= d;
2660 break;
caryclarkdac1d172014-06-17 05:15:38 -07002661 case PATH_CUBIC:
2662 var one_t = 1 - t;
2663 var one_t2 = one_t * one_t;
2664 var a = one_t2 * one_t;
2665 var b = 3 * one_t2 * t;
2666 var t2 = t * t;
2667 var c = 3 * one_t * t2;
2668 var d = t2 * t;
2669 xy.x = a * curve[0] + b * curve[2] + c * curve[4] + d * curve[6];
2670 xy.y = a * curve[1] + b * curve[3] + c * curve[5] + d * curve[7];
2671 break;
2672 }
2673 return xy;
2674}
caryclark55888e42016-07-18 10:01:36 -07002675
caryclarkdac1d172014-06-17 05:15:38 -07002676function drawPointAtT(curve, curveType) {
2677 var x, y;
2678 var xy = pointAtT(curve, curveType, curveT);
2679 drawPoint(xy.x, xy.y, true);
2680 if (!draw_intersectT) {
2681 return;
2682 }
2683 ctx.fillStyle = "red";
2684 drawTAtPointUp(xy.x, xy.y, curveT);
2685}
2686
2687function drawTAtPointUp(px, py, t) {
2688 var label = t.toFixed(decimal_places);
2689 var _px = (px - srcLeft)* scale;
2690 var _py = (py - srcTop) * scale;
2691 ctx.fillText(label, _px + 5, _py - 10);
2692}
2693
2694function drawTAtPointDown(px, py, t) {
2695 var label = t.toFixed(decimal_places);
2696 var _px = (px - srcLeft)* scale;
2697 var _py = (py - srcTop) * scale;
2698 ctx.fillText(label, _px + 5, _py + 10);
2699}
2700
2701function alreadyDrawnLine(x1, y1, x2, y2) {
2702 if (collect_bounds) {
2703 if (focus_enabled) {
2704 focusXmin = Math.min(focusXmin, x1, x2);
2705 focusYmin = Math.min(focusYmin, y1, y2);
2706 focusXmax = Math.max(focusXmax, x1, x2);
2707 focusYmax = Math.max(focusYmax, y1, y2);
2708 }
2709 return true;
2710 }
2711 for (var pts = 0; pts < drawnLines.length; pts += 4) {
2712 if (x1 == drawnLines[pts] && y1 == drawnLines[pts + 1]
2713 && x2 == drawnLines[pts + 2] && y2 == drawnLines[pts + 3]) {
2714 return true;
2715 }
2716 }
2717 drawnLines.push(x1);
2718 drawnLines.push(y1);
2719 drawnLines.push(x2);
2720 drawnLines.push(y2);
2721 return false;
2722}
2723
2724function drawLine(x1, y1, x2, y2) {
2725 if (alreadyDrawnLine(x1, y1, x2, y2)) {
2726 return;
2727 }
2728 ctx.beginPath();
2729 ctx.moveTo((x1 - srcLeft) * scale,
2730 (y1 - srcTop) * scale);
2731 ctx.lineTo((x2 - srcLeft) * scale,
2732 (y2 - srcTop) * scale);
2733 ctx.stroke();
2734}
2735
2736function linePartial(x1, y1, x2, y2, t1, t2) {
2737 var dx = x1 - x2;
2738 var dy = y1 - y2;
2739 var array = [
2740 x1 - t1 * dx,
2741 y1 - t1 * dy,
2742 x1 - t2 * dx,
2743 y1 - t2 * dy
2744 ];
2745 return array;
2746}
2747
2748function drawLinePartial(x1, y1, x2, y2, t1, t2) {
2749 var a = linePartial(x1, y1, x2, y2, t1, t2);
2750 var ax = a[0];
2751 var ay = a[1];
2752 var bx = a[2];
2753 var by = a[3];
2754 if (alreadyDrawnLine(ax, ay, bx, by)) {
2755 return;
2756 }
2757 ctx.beginPath();
2758 ctx.moveTo((ax - srcLeft) * scale,
2759 (ay - srcTop) * scale);
2760 ctx.lineTo((bx - srcLeft) * scale,
2761 (by - srcTop) * scale);
2762 ctx.stroke();
2763}
2764
2765function alreadyDrawnQuad(x1, y1, x2, y2, x3, y3) {
2766 if (collect_bounds) {
2767 if (focus_enabled) {
2768 focusXmin = Math.min(focusXmin, x1, x2, x3);
2769 focusYmin = Math.min(focusYmin, y1, y2, y3);
2770 focusXmax = Math.max(focusXmax, x1, x2, x3);
2771 focusYmax = Math.max(focusYmax, y1, y2, y3);
2772 }
2773 return true;
2774 }
2775 for (var pts = 0; pts < drawnQuads.length; pts += 6) {
2776 if (x1 == drawnQuads[pts] && y1 == drawnQuads[pts + 1]
2777 && x2 == drawnQuads[pts + 2] && y2 == drawnQuads[pts + 3]
2778 && x3 == drawnQuads[pts + 4] && y3 == drawnQuads[pts + 5]) {
2779 return true;
2780 }
2781 }
2782 drawnQuads.push(x1);
2783 drawnQuads.push(y1);
2784 drawnQuads.push(x2);
2785 drawnQuads.push(y2);
2786 drawnQuads.push(x3);
2787 drawnQuads.push(y3);
2788 return false;
2789}
2790
2791function drawQuad(x1, y1, x2, y2, x3, y3) {
2792 if (alreadyDrawnQuad(x1, y1, x2, y2, x3, y3)) {
2793 return;
2794 }
2795 ctx.beginPath();
2796 ctx.moveTo((x1 - srcLeft) * scale,
2797 (y1 - srcTop) * scale);
2798 ctx.quadraticCurveTo((x2 - srcLeft) * scale,
2799 (y2 - srcTop) * scale,
2800 (x3 - srcLeft) * scale,
2801 (y3 - srcTop) * scale);
2802 ctx.stroke();
2803}
2804
2805function interp(A, B, t) {
2806 return A + (B - A) * t;
2807}
2808
2809function interp_quad_coords(x1, x2, x3, t)
2810{
2811 var ab = interp(x1, x2, t);
2812 var bc = interp(x2, x3, t);
2813 var abc = interp(ab, bc, t);
2814 return abc;
2815}
2816
2817function quadPartial(x1, y1, x2, y2, x3, y3, t1, t2) {
2818 var ax = interp_quad_coords(x1, x2, x3, t1);
2819 var ay = interp_quad_coords(y1, y2, y3, t1);
2820 var dx = interp_quad_coords(x1, x2, x3, (t1 + t2) / 2);
2821 var dy = interp_quad_coords(y1, y2, y3, (t1 + t2) / 2);
2822 var cx = interp_quad_coords(x1, x2, x3, t2);
2823 var cy = interp_quad_coords(y1, y2, y3, t2);
2824 var bx = 2*dx - (ax + cx)/2;
2825 var by = 2*dy - (ay + cy)/2;
2826 var array = [
2827 ax, ay, bx, by, cx, cy
2828 ];
2829 return array;
2830}
2831
2832function drawQuadPartial(x1, y1, x2, y2, x3, y3, t1, t2) {
2833 var a = quadPartial(x1, y1, x2, y2, x3, y3, t1, t2);
2834 var ax = a[0];
2835 var ay = a[1];
2836 var bx = a[2];
2837 var by = a[3];
2838 var cx = a[4];
2839 var cy = a[5];
2840 if (alreadyDrawnQuad(ax, ay, bx, by, cx, cy)) {
2841 return;
2842 }
2843 ctx.beginPath();
2844 ctx.moveTo((ax - srcLeft) * scale,
2845 (ay - srcTop) * scale);
2846 ctx.quadraticCurveTo((bx - srcLeft) * scale,
2847 (by - srcTop) * scale,
2848 (cx - srcLeft) * scale,
2849 (cy - srcTop) * scale);
2850 ctx.stroke();
2851}
2852
caryclark1049f122015-04-20 08:31:59 -07002853function alreadyDrawnConic(x1, y1, x2, y2, x3, y3, w) {
2854 if (collect_bounds) {
2855 if (focus_enabled) {
2856 focusXmin = Math.min(focusXmin, x1, x2, x3);
2857 focusYmin = Math.min(focusYmin, y1, y2, y3);
2858 focusXmax = Math.max(focusXmax, x1, x2, x3);
2859 focusYmax = Math.max(focusYmax, y1, y2, y3);
2860 }
2861 return true;
2862 }
2863 for (var pts = 0; pts < drawnConics.length; pts += 8) {
2864 if (x1 == drawnConics[pts] && y1 == drawnCubics[pts + 1]
caryclark55888e42016-07-18 10:01:36 -07002865 && x2 == drawnCubics[pts + 2] && y2 == drawnCubics[pts + 3]
2866 && x3 == drawnCubics[pts + 4] && y3 == drawnCubics[pts + 5]
caryclark1049f122015-04-20 08:31:59 -07002867 && w == drawnCubics[pts + 6]) {
2868 return true;
2869 }
2870 }
2871 drawnConics.push(x1);
2872 drawnConics.push(y1);
2873 drawnConics.push(x2);
2874 drawnConics.push(y2);
2875 drawnConics.push(x3);
2876 drawnConics.push(y3);
2877 drawnCubics.push(w);
2878 return false;
2879}
2880
2881var kMaxConicToQuadPOW2 = 5;
2882
2883function computeQuadPOW2(curve, tol) {
2884 var a = curve[6] - 1;
2885 var k = a / (4 * (2 + a));
2886 var x = k * (curve[0] - 2 * curve[2] + curve[4]);
2887 var y = k * (curve[1] - 2 * curve[3] + curve[5]);
2888
2889 var error = Math.sqrt(x * x + y * y);
2890 var pow2;
2891 for (pow2 = 0; pow2 < kMaxConicToQuadPOW2; ++pow2) {
2892 if (error <= tol) {
2893 break;
2894 }
2895 error *= 0.25;
2896 }
2897 return pow2;
2898}
2899
2900function subdivide_w_value(w) {
2901 return Math.sqrt(0.5 + w * 0.5);
2902}
2903
2904function chop(curve, part1, part2) {
2905 var w = curve[6];
2906 var scale = 1 / (1 + w);
2907 part1[0] = curve[0];
2908 part1[1] = curve[1];
2909 part1[2] = (curve[0] + curve[2] * w) * scale;
2910 part1[3] = (curve[1] + curve[3] * w) * scale;
2911 part1[4] = part2[0] = (curve[0] + (curve[2] * w) * 2 + curve[4]) * scale * 0.5;
2912 part1[5] = part2[1] = (curve[1] + (curve[3] * w) * 2 + curve[5]) * scale * 0.5;
2913 part2[2] = (curve[2] * w + curve[4]) * scale;
2914 part2[3] = (curve[3] * w + curve[5]) * scale;
2915 part2[4] = curve[4];
2916 part2[5] = curve[5];
2917 part1[6] = part2[6] = subdivide_w_value(w);
2918}
2919
2920function subdivide(curve, level, pts) {
2921 if (0 == level) {
2922 pts.push(curve[2]);
2923 pts.push(curve[3]);
2924 pts.push(curve[4]);
2925 pts.push(curve[5]);
2926 } else {
2927 var part1 = [], part2 = [];
2928 chop(curve, part1, part2);
2929 --level;
2930 subdivide(part1, level, pts);
2931 subdivide(part2, level, pts);
2932 }
2933}
2934
2935function chopIntoQuadsPOW2(curve, pow2, pts) {
2936 subdivide(curve, pow2, pts);
2937 return 1 << pow2;
2938}
2939
2940function drawConicWithQuads(x1, y1, x2, y2, x3, y3, w) {
2941 if (alreadyDrawnConic(x1, y1, x2, y2, x3, y3, w)) {
2942 return;
2943 }
2944 ctx.beginPath();
2945 ctx.moveTo((x1 - srcLeft) * scale,
2946 (y1 - srcTop) * scale);
2947 var tol = 1 / scale;
2948 var curve = [x1, y1, x2, y2, x3, y3, w];
2949 var pow2 = computeQuadPOW2(curve, tol);
2950 var pts = [];
2951 chopIntoQuadsPOW2(curve, pow2, pts);
2952 for (var i = 0; i < pts.length; i += 4) {
2953 ctx.quadraticCurveTo(
2954 (pts[i + 0] - srcLeft) * scale, (pts[i + 1] - srcTop) * scale,
2955 (pts[i + 2] - srcLeft) * scale, (pts[i + 3] - srcTop) * scale);
2956 }
2957 ctx.stroke();
2958}
2959
2960function conic_eval_numerator(x1, x2, x3, w, t) {
2961 var src2w = x2 * w;
2962 var C = x1;
2963 var A = x3 - 2 * src2w + C;
2964 var B = 2 * (src2w - C);
2965 return (A * t + B) * t + C;
2966}
2967
2968
2969function conic_eval_denominator(w, t) {
2970 var B = 2 * (w - 1);
2971 var C = 1;
2972 var A = -B;
2973 return (A * t + B) * t + C;
2974}
2975
2976function conicPartial(x1, y1, x2, y2, x3, y3, w, t1, t2) {
2977 var ax = conic_eval_numerator(x1, x2, x3, w, t1);
2978 var ay = conic_eval_numerator(y1, y2, y3, w, t1);
2979 var az = conic_eval_denominator(w, t1);
2980 var midT = (t1 + t2) / 2;
2981 var dx = conic_eval_numerator(x1, x2, x3, w, midT);
2982 var dy = conic_eval_numerator(y1, y2, y3, w, midT);
2983 var dz = conic_eval_denominator(w, midT);
2984 var cx = conic_eval_numerator(x1, x2, x3, w, t2);
2985 var cy = conic_eval_numerator(y1, y2, y3, w, t2);
2986 var cz = conic_eval_denominator(w, t2);
2987 var bx = 2 * dx - (ax + cx) / 2;
2988 var by = 2 * dy - (ay + cy) / 2;
2989 var bz = 2 * dz - (az + cz) / 2;
2990 var dt = t2 - t1;
2991 var dt_1 = 1 - dt;
caryclark1049f122015-04-20 08:31:59 -07002992 var array = [
caryclarked0935a2015-10-22 07:23:52 -07002993 ax / az, ay / az, bx / bz, by / bz, cx / cz, cy / cz, 0
caryclark1049f122015-04-20 08:31:59 -07002994 ];
caryclarked0935a2015-10-22 07:23:52 -07002995 var dMidAC = { x:(array[0] + array[4]) / 2, y:(array[1] + array[5]) / 2 };
2996 var dMid = { x:dx / dz, y:dy / dz };
2997 var dWNumer = { x:dMidAC.x - dMid.x, y:dMidAC.y - dMid.y };
2998 var dWDenom = { x:dMid.x - array[2], y:dMid.y - array[3] };
2999 var partW = Math.sqrt(dWNumer.x * dWNumer.x + dWNumer.y * dWNumer.y)
3000 / Math.sqrt(dWDenom.x * dWDenom.x + dWDenom.y * dWDenom.y);
3001 array[6] = partW;
caryclark1049f122015-04-20 08:31:59 -07003002 return array;
3003}
caryclark55888e42016-07-18 10:01:36 -07003004
caryclark1049f122015-04-20 08:31:59 -07003005function drawConicPartial(x1, y1, x2, y2, x3, y3, w, t1, t2) {
3006 var a = conicPartial(x1, y1, x2, y2, x3, y3, w, t1, t2);
3007 var ax = a[0];
3008 var ay = a[1];
3009 var bx = a[2];
3010 var by = a[3];
3011 var cx = a[4];
3012 var cy = a[5];
3013 var w_ = a[6];
3014 drawConicWithQuads(ax, ay, bx, by, cx, cy, w_);
3015}
3016
caryclarkdac1d172014-06-17 05:15:38 -07003017function alreadyDrawnCubic(x1, y1, x2, y2, x3, y3, x4, y4) {
3018 if (collect_bounds) {
3019 if (focus_enabled) {
3020 focusXmin = Math.min(focusXmin, x1, x2, x3, x4);
3021 focusYmin = Math.min(focusYmin, y1, y2, y3, y4);
3022 focusXmax = Math.max(focusXmax, x1, x2, x3, x4);
3023 focusYmax = Math.max(focusYmax, y1, y2, y3, y4);
3024 }
3025 return true;
3026 }
3027 for (var pts = 0; pts < drawnCubics.length; pts += 8) {
3028 if (x1 == drawnCubics[pts] && y1 == drawnCubics[pts + 1]
caryclark55888e42016-07-18 10:01:36 -07003029 && x2 == drawnCubics[pts + 2] && y2 == drawnCubics[pts + 3]
3030 && x3 == drawnCubics[pts + 4] && y3 == drawnCubics[pts + 5]
caryclarkdac1d172014-06-17 05:15:38 -07003031 && x4 == drawnCubics[pts + 6] && y4 == drawnCubics[pts + 7]) {
3032 return true;
3033 }
3034 }
3035 drawnCubics.push(x1);
3036 drawnCubics.push(y1);
3037 drawnCubics.push(x2);
3038 drawnCubics.push(y2);
3039 drawnCubics.push(x3);
3040 drawnCubics.push(y3);
3041 drawnCubics.push(x4);
3042 drawnCubics.push(y4);
3043 return false;
3044}
3045
3046function drawCubic(x1, y1, x2, y2, x3, y3, x4, y4) {
3047 if (alreadyDrawnCubic(x1, y1, x2, y2, x3, y3, x4, y4)) {
3048 return;
3049 }
3050 ctx.beginPath();
3051 ctx.moveTo((x1 - srcLeft) * scale,
3052 (y1 - srcTop) * scale);
3053 ctx.bezierCurveTo((x2 - srcLeft) * scale,
3054 (y2 - srcTop) * scale,
3055 (x3 - srcLeft) * scale,
3056 (y3 - srcTop) * scale,
3057 (x4 - srcLeft) * scale,
3058 (y4 - srcTop) * scale);
3059 ctx.stroke();
3060}
3061
3062function interp_cubic_coords(x1, x2, x3, x4, t)
3063{
3064 var ab = interp(x1, x2, t);
3065 var bc = interp(x2, x3, t);
3066 var cd = interp(x3, x4, t);
3067 var abc = interp(ab, bc, t);
3068 var bcd = interp(bc, cd, t);
3069 var abcd = interp(abc, bcd, t);
3070 return abcd;
3071}
3072
3073function cubicPartial(x1, y1, x2, y2, x3, y3, x4, y4, t1, t2) {
3074 var ax = interp_cubic_coords(x1, x2, x3, x4, t1);
3075 var ay = interp_cubic_coords(y1, y2, y3, y4, t1);
3076 var ex = interp_cubic_coords(x1, x2, x3, x4, (t1*2+t2)/3);
3077 var ey = interp_cubic_coords(y1, y2, y3, y4, (t1*2+t2)/3);
3078 var fx = interp_cubic_coords(x1, x2, x3, x4, (t1+t2*2)/3);
3079 var fy = interp_cubic_coords(y1, y2, y3, y4, (t1+t2*2)/3);
3080 var dx = interp_cubic_coords(x1, x2, x3, x4, t2);
3081 var dy = interp_cubic_coords(y1, y2, y3, y4, t2);
3082 var mx = ex * 27 - ax * 8 - dx;
3083 var my = ey * 27 - ay * 8 - dy;
3084 var nx = fx * 27 - ax - dx * 8;
3085 var ny = fy * 27 - ay - dy * 8;
3086 var bx = (mx * 2 - nx) / 18;
3087 var by = (my * 2 - ny) / 18;
3088 var cx = (nx * 2 - mx) / 18;
3089 var cy = (ny * 2 - my) / 18;
3090 var array = [
3091 ax, ay, bx, by, cx, cy, dx, dy
3092 ];
3093 return array;
3094}
caryclark55888e42016-07-18 10:01:36 -07003095
caryclarkdac1d172014-06-17 05:15:38 -07003096function drawCubicPartial(x1, y1, x2, y2, x3, y3, x4, y4, t1, t2) {
3097 var a = cubicPartial(x1, y1, x2, y2, x3, y3, x4, y4, t1, t2);
3098 var ax = a[0];
3099 var ay = a[1];
3100 var bx = a[2];
3101 var by = a[3];
3102 var cx = a[4];
3103 var cy = a[5];
3104 var dx = a[6];
3105 var dy = a[7];
3106 if (alreadyDrawnCubic(ax, ay, bx, by, cx, cy, dx, dy)) {
3107 return;
3108 }
3109 ctx.beginPath();
3110 ctx.moveTo((ax - srcLeft) * scale,
3111 (ay - srcTop) * scale);
3112 ctx.bezierCurveTo((bx - srcLeft) * scale,
3113 (by - srcTop) * scale,
3114 (cx - srcLeft) * scale,
3115 (cy - srcTop) * scale,
3116 (dx - srcLeft) * scale,
3117 (dy - srcTop) * scale);
3118 ctx.stroke();
3119}
3120
3121function drawCurve(c) {
3122 switch (c.length) {
3123 case 4:
3124 drawLine(c[0], c[1], c[2], c[3]);
3125 break;
3126 case 6:
3127 drawQuad(c[0], c[1], c[2], c[3], c[4], c[5]);
3128 break;
caryclark1049f122015-04-20 08:31:59 -07003129 case 7:
3130 drawConicWithQuads(c[0], c[1], c[2], c[3], c[4], c[5], c[6]);
3131 break;
caryclarkdac1d172014-06-17 05:15:38 -07003132 case 8:
3133 drawCubic(c[0], c[1], c[2], c[3], c[4], c[5], c[6], c[7]);
3134 break;
3135 }
3136}
3137
3138function boundsWidth(pts) {
3139 var min = pts[0];
3140 var max = pts[0];
caryclark1049f122015-04-20 08:31:59 -07003141 var length = pts.length == 7 ? 6 : pts.length;
3142 for (var idx = 2; idx < length; idx += 2) {
caryclarkdac1d172014-06-17 05:15:38 -07003143 min = Math.min(min, pts[idx]);
3144 max = Math.max(max, pts[idx]);
3145 }
3146 return max - min;
3147}
3148
3149function boundsHeight(pts) {
3150 var min = pts[1];
3151 var max = pts[1];
caryclark1049f122015-04-20 08:31:59 -07003152 var length = pts.length == 7 ? 6 : pts.length;
3153 for (var idx = 3; idx < length; idx += 2) {
caryclarkdac1d172014-06-17 05:15:38 -07003154 min = Math.min(min, pts[idx]);
3155 max = Math.max(max, pts[idx]);
3156 }
3157 return max - min;
3158}
3159
3160function tangent(pts) {
3161 var dx = pts[2] - pts[0];
3162 var dy = pts[3] - pts[1];
3163 if (dx == 0 && dy == 0 && pts.length > 4) {
3164 dx = pts[4] - pts[0];
3165 dy = pts[5] - pts[1];
caryclark1049f122015-04-20 08:31:59 -07003166 if (dx == 0 && dy == 0 && pts.length == 8) {
caryclarkdac1d172014-06-17 05:15:38 -07003167 dx = pts[6] - pts[0];
3168 dy = pts[7] - pts[1];
3169 }
3170 }
3171 return Math.atan2(-dy, dx);
3172}
3173
3174function hodograph(cubic) {
3175 var hodo = [];
3176 hodo[0] = 3 * (cubic[2] - cubic[0]);
3177 hodo[1] = 3 * (cubic[3] - cubic[1]);
3178 hodo[2] = 3 * (cubic[4] - cubic[2]);
3179 hodo[3] = 3 * (cubic[5] - cubic[3]);
3180 hodo[4] = 3 * (cubic[6] - cubic[4]);
3181 hodo[5] = 3 * (cubic[7] - cubic[5]);
3182 return hodo;
3183}
3184
3185function hodograph2(cubic) {
3186 var quad = hodograph(cubic);
3187 var hodo = [];
3188 hodo[0] = 2 * (quad[2] - quad[0]);
3189 hodo[1] = 2 * (quad[3] - quad[1]);
3190 hodo[2] = 2 * (quad[4] - quad[2]);
3191 hodo[3] = 2 * (quad[5] - quad[3]);
3192 return hodo;
3193}
3194
3195function quadraticRootsReal(A, B, C, s) {
3196 if (A == 0) {
3197 if (B == 0) {
3198 s[0] = 0;
3199 return C == 0;
3200 }
3201 s[0] = -C / B;
3202 return 1;
3203 }
3204 /* normal form: x^2 + px + q = 0 */
3205 var p = B / (2 * A);
3206 var q = C / A;
3207 var p2 = p * p;
3208 if (p2 < q) {
3209 return 0;
3210 }
3211 var sqrt_D = 0;
3212 if (p2 > q) {
3213 sqrt_D = sqrt(p2 - q);
3214 }
3215 s[0] = sqrt_D - p;
3216 s[1] = -sqrt_D - p;
3217 return 1 + s[0] != s[1];
3218}
3219
3220function add_valid_ts(s, realRoots, t) {
3221 var foundRoots = 0;
3222 for (var index = 0; index < realRoots; ++index) {
3223 var tValue = s[index];
3224 if (tValue >= 0 && tValue <= 1) {
3225 for (var idx2 = 0; idx2 < foundRoots; ++idx2) {
3226 if (t[idx2] != tValue) {
3227 t[foundRoots++] = tValue;
3228 }
3229 }
3230 }
3231 }
3232 return foundRoots;
3233}
3234
3235function quadraticRootsValidT(a, b, c, t) {
3236 var s = [];
3237 var realRoots = quadraticRootsReal(A, B, C, s);
3238 var foundRoots = add_valid_ts(s, realRoots, t);
3239 return foundRoots != 0;
3240}
3241
3242function find_cubic_inflections(cubic, tValues) {
3243 var Ax = src[2] - src[0];
3244 var Ay = src[3] - src[1];
3245 var Bx = src[4] - 2 * src[2] + src[0];
3246 var By = src[5] - 2 * src[3] + src[1];
3247 var Cx = src[6] + 3 * (src[2] - src[4]) - src[0];
3248 var Cy = src[7] + 3 * (src[3] - src[5]) - src[1];
3249 return quadraticRootsValidT(Bx * Cy - By * Cx, (Ax * Cy - Ay * Cx),
3250 Ax * By - Ay * Bx, tValues);
3251}
3252
3253function dxy_at_t(curve, type, t) {
3254 var dxy = {};
Cary Clarkff114282016-12-14 11:56:16 -05003255 if (type == PATH_LINE) {
3256 dxy.x = curve[2] - curve[0];
3257 dxy.y = curve[3] - curve[1];
3258 } else if (type == PATH_QUAD) {
caryclarkdac1d172014-06-17 05:15:38 -07003259 var a = t - 1;
3260 var b = 1 - 2 * t;
3261 var c = t;
3262 dxy.x = a * curve[0] + b * curve[2] + c * curve[4];
3263 dxy.y = a * curve[1] + b * curve[3] + c * curve[5];
caryclark1049f122015-04-20 08:31:59 -07003264 } else if (type == PATH_CONIC) {
3265 var p20x = curve[4] - curve[0];
3266 var p20y = curve[5] - curve[1];
3267 var p10xw = (curve[2] - curve[0]) * curve[6];
3268 var p10yw = (curve[3] - curve[1]) * curve[6];
3269 var coeff0x = curve[6] * p20x - p20x;
3270 var coeff0y = curve[6] * p20y - p20y;
3271 var coeff1x = p20x - 2 * p10xw;
3272 var coeff1y = p20y - 2 * p10yw;
3273 dxy.x = t * (t * coeff0x + coeff1x) + p10xw;
3274 dxy.y = t * (t * coeff0y + coeff1y) + p10yw;
caryclarkdac1d172014-06-17 05:15:38 -07003275 } else if (type == PATH_CUBIC) {
3276 var one_t = 1 - t;
3277 var a = curve[0];
3278 var b = curve[2];
3279 var c = curve[4];
3280 var d = curve[6];
3281 dxy.x = 3 * ((b - a) * one_t * one_t + 2 * (c - b) * t * one_t + (d - c) * t * t);
3282 a = curve[1];
3283 b = curve[3];
3284 c = curve[5];
3285 d = curve[7];
3286 dxy.y = 3 * ((b - a) * one_t * one_t + 2 * (c - b) * t * one_t + (d - c) * t * t);
3287 }
3288 return dxy;
3289}
3290
Cary Clarkff114282016-12-14 11:56:16 -05003291function dpt_at_t(curve, t) {
3292 var type = PATH_LINE + (curve.length / 2 - 2);
3293 return dxy_at_t(curve, type, t);
3294}
3295
caryclarkdac1d172014-06-17 05:15:38 -07003296function drawLabel(num, px, py) {
3297 ctx.beginPath();
3298 ctx.arc(px, py, 8, 0, Math.PI*2, true);
3299 ctx.closePath();
3300 ctx.strokeStyle = "rgba(0,0,0, 0.4)";
3301 ctx.lineWidth = num == 0 || num == 3 ? 2 : 1;
3302 ctx.stroke();
3303 ctx.fillStyle = "black";
3304 ctx.font = "normal 10px Arial";
3305 // ctx.rotate(0.001);
3306 ctx.fillText(num, px - 2, py + 3);
3307 // ctx.rotate(-0.001);
3308}
3309
3310function drawLabelX(ymin, num, loc) {
3311 var px = (loc - srcLeft) * scale;
3312 var py = (ymin - srcTop) * scale - 20;
3313 drawLabel(num, px, py);
3314}
3315
3316function drawLabelY(xmin, num, loc) {
3317 var px = (xmin - srcLeft) * scale - 20;
3318 var py = (loc - srcTop) * scale;
3319 drawLabel(num, px, py);
3320}
3321
3322function drawHodoOrigin(hx, hy, hMinX, hMinY, hMaxX, hMaxY) {
3323 ctx.beginPath();
3324 ctx.moveTo(hx, hy - 100);
3325 ctx.lineTo(hx, hy);
3326 ctx.strokeStyle = hMinY < 0 ? "green" : "blue";
3327 ctx.stroke();
3328 ctx.beginPath();
3329 ctx.moveTo(hx, hy);
3330 ctx.lineTo(hx, hy + 100);
3331 ctx.strokeStyle = hMaxY > 0 ? "green" : "blue";
3332 ctx.stroke();
3333 ctx.beginPath();
3334 ctx.moveTo(hx - 100, hy);
3335 ctx.lineTo(hx, hy);
3336 ctx.strokeStyle = hMinX < 0 ? "green" : "blue";
3337 ctx.stroke();
3338 ctx.beginPath();
3339 ctx.moveTo(hx, hy);
3340 ctx.lineTo(hx + 100, hy);
3341 ctx.strokeStyle = hMaxX > 0 ? "green" : "blue";
3342 ctx.stroke();
3343}
3344
3345function scalexy(x, y, mag) {
3346 var length = Math.sqrt(x * x + y * y);
3347 return mag / length;
3348}
3349
caryclark03b03ca2015-04-23 09:13:37 -07003350function drawArrow(x, y, dx, dy, s) {
3351 var dscale = scalexy(dx, dy, 1 / scale * 100 * s);
caryclarkdac1d172014-06-17 05:15:38 -07003352 dx *= dscale;
3353 dy *= dscale;
3354 ctx.beginPath();
3355 ctx.moveTo((x - srcLeft) * scale, (y - srcTop) * scale);
3356 x += dx;
3357 y += dy;
3358 ctx.lineTo((x - srcLeft) * scale, (y - srcTop) * scale);
3359 dx /= 10;
3360 dy /= 10;
3361 ctx.lineTo((x - dy - srcLeft) * scale, (y + dx - srcTop) * scale);
3362 ctx.lineTo((x + dx * 2 - srcLeft) * scale, (y + dy * 2 - srcTop) * scale);
3363 ctx.lineTo((x + dy - srcLeft) * scale, (y - dx - srcTop) * scale);
3364 ctx.lineTo((x - srcLeft) * scale, (y - srcTop) * scale);
3365 ctx.strokeStyle = "rgba(0,75,0, 0.4)";
3366 ctx.stroke();
3367}
3368
3369function x_at_t(curve, t) {
3370 var one_t = 1 - t;
3371 if (curve.length == 4) {
3372 return one_t * curve[0] + t * curve[2];
3373 }
3374 var one_t2 = one_t * one_t;
3375 var t2 = t * t;
3376 if (curve.length == 6) {
3377 return one_t2 * curve[0] + 2 * one_t * t * curve[2] + t2 * curve[4];
3378 }
caryclark1049f122015-04-20 08:31:59 -07003379 if (curve.length == 7) {
3380 return (one_t2 * curve[0] + 2 * one_t * t * curve[2] * curve[6] + t2 * curve[4])
3381 / (one_t2 +2 * one_t * t * curve[6] + t2);
3382 }
caryclarkdac1d172014-06-17 05:15:38 -07003383 var a = one_t2 * one_t;
3384 var b = 3 * one_t2 * t;
3385 var c = 3 * one_t * t2;
3386 var d = t2 * t;
3387 return a * curve[0] + b * curve[2] + c * curve[4] + d * curve[6];
3388}
3389
3390function y_at_t(curve, t) {
3391 var one_t = 1 - t;
3392 if (curve.length == 4) {
3393 return one_t * curve[1] + t * curve[3];
3394 }
3395 var one_t2 = one_t * one_t;
3396 var t2 = t * t;
3397 if (curve.length == 6) {
3398 return one_t2 * curve[1] + 2 * one_t * t * curve[3] + t2 * curve[5];
3399 }
caryclark1049f122015-04-20 08:31:59 -07003400 if (curve.length == 7) {
3401 return (one_t2 * curve[1] + 2 * one_t * t * curve[3] * curve[6] + t2 * curve[5])
3402 / (one_t2 +2 * one_t * t * curve[6] + t2);
3403 }
caryclarkdac1d172014-06-17 05:15:38 -07003404 var a = one_t2 * one_t;
3405 var b = 3 * one_t2 * t;
3406 var c = 3 * one_t * t2;
3407 var d = t2 * t;
3408 return a * curve[1] + b * curve[3] + c * curve[5] + d * curve[7];
3409}
3410
Cary Clarkff114282016-12-14 11:56:16 -05003411function pt_at_t(curve, t) {
3412 var pt = {};
3413 pt.x = x_at_t(curve, t);
3414 pt.y = y_at_t(curve, t);
3415 return pt;
3416}
3417
3418function drawOrder(curve, t, label) {
3419 var px = x_at_t(curve, t);
3420 var py = y_at_t(curve, t);
caryclarkdac1d172014-06-17 05:15:38 -07003421 var _px = (px - srcLeft) * scale;
3422 var _py = (py - srcTop) * scale;
3423 ctx.beginPath();
3424 ctx.arc(_px, _py, 15, 0, Math.PI * 2, true);
3425 ctx.closePath();
3426 ctx.fillStyle = "white";
3427 ctx.fill();
3428 if (label == 'L') {
3429 ctx.strokeStyle = "rgba(255,0,0, 1)";
3430 ctx.fillStyle = "rgba(255,0,0, 1)";
3431 } else {
3432 ctx.strokeStyle = "rgba(0,0,255, 1)";
3433 ctx.fillStyle = "rgba(0,0,255, 1)";
3434 }
3435 ctx.stroke();
3436 ctx.font = "normal 16px Arial";
3437 ctx.textAlign = "center";
3438 ctx.fillText(label, _px, _py + 5);
3439 ctx.font = "normal 10px Arial";
3440}
3441
Cary Clarkff114282016-12-14 11:56:16 -05003442function drawVisibleOrder(curve, label) {
3443 var s = pt_at_t(curve, 0);
3444 var e = pt_at_t(curve, 1);
3445 var sOn = ptOnScreen(s);
3446 var eOn = ptOnScreen(e);
3447 var defaultT = 0.85;
3448 if (sOn && eOn)
3449 return drawOrder(curve, defaultT, label);
3450 if (sOn || eOn) {
3451 if (eOn) {
3452 defaultT = 1 - defaultT;
3453 }
3454 var step = sOn ? -defaultT / 2 : (1 - defaultT) / 2;
3455 var t = defaultT;
3456 var tries = 16;
3457 do {
3458 var mid = pt_at_t(curve, t);
3459 if (ptOnScreen(mid))
3460 return drawOrder(curve, t, label);
3461 t += step;
3462 step /= 2;
3463 } while (--tries > 0);
3464 drawOrder(curve, defaultT, label);
3465 }
3466 // scattershot until we find a visible point
3467 var denom = 2; // visit odd number num / denom to hit unique pts
3468 var tries = 6; // tries 1/2, 1/4, 3/4, 1/8, 3/8, 5/8, 7/8, 1/16 ...
3469 do {
3470 for (var numer = 1; numer < denom; numer += 2) {
3471 var t = numer / denom + 0.1;
3472 if (t >= 1) {
3473 break;
3474 }
3475 var mid = pt_at_t(curve, t);
3476 if (ptOnScreen(mid))
3477 return drawOrder(curve, t, label);
3478 }
3479 denom *= 2;
3480 } while (--tries > 0);
3481 drawOrder(curve, defaultT, label);
3482}
3483
3484function set_length(pt, newLen) {
3485 var len = Math.sqrt(pt.x * pt.x + pt.y * pt.y);
3486 var scale = newLen / len;
3487 var newPt = { x: pt.x * scale, y: pt.y * scale };
3488 return newPt;
3489}
3490
3491function drawDirection(curve, t) {
3492 var d = dpt_at_t(curve, t);
3493 d = set_length(d, 16);
3494 var pt = localToGlobal(pt_at_t(curve, t));
3495 ctx.beginPath();
3496 ctx.moveTo(pt.x - d.y, pt.y + d.x);
3497 ctx.lineTo(pt.x + d.x, pt.y + d.y);
3498 ctx.lineTo(pt.x + d.y, pt.y - d.x);
3499 ctx.strokeStyle = "rgba(0,75,0, 0.4)";
3500 ctx.stroke();
3501}
3502
3503function drawVisibleDirection(curve) {
3504 var s = pt_at_t(curve, 0);
3505 var e = pt_at_t(curve, 1);
3506 var sOn = ptOnScreen(s);
3507 var eOn = ptOnScreen(e);
3508 var defaultT = 0.65;
3509 if (sOn && eOn) {
3510 return drawDirection(curve, defaultT);
3511 }
3512 if (sOn || eOn) {
3513 if (eOn) {
3514 defaultT = 1 - defaultT;
3515 }
3516 var step = sOn ? -defaultT / 2 : (1 - defaultT) / 2;
3517 var t = defaultT;
3518 var tries = 16;
3519 do {
3520 var mid = pt_at_t(curve, t);
3521 if (ptOnScreen(mid))
3522 return drawDirection(curve, t);
3523 t += step;
3524 step /= 2;
3525 } while (--tries > 0);
3526 drawDirection(curve, defaultT);
3527 }
3528 // scattershot until we find a visible point
3529 var denom = 2; // visit odd number num / denom to hit unique pts
3530 var tries = 6; // tries 1/2, 1/4, 3/4, 1/8, 3/8, 5/8, 7/8, 1/16 ...
3531 do {
3532 for (var numer = 1; numer < denom; numer += 2) {
3533 var t = numer / denom + 0.1;
3534 if (t >= 1) {
3535 break;
3536 }
3537 var mid = pt_at_t(curve, t);
3538 if (ptOnScreen(mid))
3539 return drawDirection(curve, t);
3540 }
3541 denom *= 2;
3542 } while (--tries > 0);
3543 drawDirection(curve, defaultT);
3544}
3545
3546function drawID(curve, t, id) {
3547 var px = x_at_t(curve, t);
3548 var py = y_at_t(curve, t);
caryclarkdac1d172014-06-17 05:15:38 -07003549 var _px = (px - srcLeft) * scale;
3550 var _py = (py - srcTop) * scale;
3551 draw_id_at(id, _px, _py);
3552}
3553
Cary Clarkff114282016-12-14 11:56:16 -05003554function localToGlobal(local) {
3555 var global = {};
3556 global.x = (local.x - srcLeft) * scale;
3557 global.y = (local.y - srcTop) * scale;
3558 return global;
3559}
3560
3561function ptOnScreen(local) {
3562 var pt = localToGlobal(local);
3563 return 10 <= pt.x && pt.x <= screenWidth - 10
3564 && 10 <= pt.y && pt.y <= screenHeight - 10;
3565}
3566
3567function drawVisibleID(curve, defaultT, id) {
3568 // determine if either or both ends are visible
3569 var s = pt_at_t(curve, 0);
3570 var e = pt_at_t(curve, 1);
3571 var sOn = ptOnScreen(s);
3572 var eOn = ptOnScreen(e);
3573 if (sOn && eOn)
3574 return drawID(curve, defaultT, id);
3575 if (sOn || eOn) {
3576 var step = sOn ? -defaultT / 2 : (1 - defaultT) / 2;
3577 var t = defaultT;
3578 var tries = 16;
3579 do {
3580 var mid = pt_at_t(curve, t);
3581 if (ptOnScreen(mid))
3582 return drawID(curve, t, id);
3583 t += step;
3584 step /= 2;
3585 } while (--tries > 0);
3586 drawID(curve, defaultT, id);
3587 }
3588 // scattershot until we find a visible point
3589 var denom = 2; // visit odd number num / denom to hit unique pts
3590 var tries = 6; // tries 1/2, 1/4, 3/4, 1/8, 3/8, 5/8, 7/8, 1/16 ...
3591 do {
3592 for (var numer = 1; numer < denom; numer += 2) {
3593 var t = numer / denom;
3594 var mid = pt_at_t(curve, t);
3595 if (ptOnScreen(mid))
3596 return drawID(curve, t, id);
3597 }
3598 denom *= 2;
3599 } while (--tries > 0);
3600 drawID(curve, defaultT, id);
3601}
3602
caryclarkdac1d172014-06-17 05:15:38 -07003603function draw_id_at(id, _px, _py) {
3604 ctx.beginPath();
3605 ctx.arc(_px, _py, 15, 0, Math.PI * 2, true);
3606 ctx.closePath();
3607 ctx.fillStyle = "white";
3608 ctx.fill();
3609 ctx.strokeStyle = "rgba(127,127,0, 1)";
3610 ctx.fillStyle = "rgba(127,127,0, 1)";
3611 ctx.stroke();
3612 ctx.font = "normal 16px Arial";
3613 ctx.textAlign = "center";
3614 ctx.fillText(id, _px, _py + 5);
3615 ctx.font = "normal 10px Arial";
3616}
3617
3618function drawLinePartialID(id, x1, y1, x2, y2, t1, t2) {
3619 var curve = [x1, y1, x2, y2];
3620 drawCurvePartialID(id, curve, t1, t2);
3621}
3622
caryclark55888e42016-07-18 10:01:36 -07003623function drawLineID(id, x1, y1, x2, y2) {
3624 drawLinePartialID(id, x1, y1, x2, y2, 0, 1);
3625}
3626
caryclarkdac1d172014-06-17 05:15:38 -07003627function drawQuadPartialID(id, x1, y1, x2, y2, x3, y3, t1, t2) {
3628 var curve = [x1, y1, x2, y2, x3, y3];
3629 drawCurvePartialID(id, curve, t1, t2);
3630}
3631
caryclark55888e42016-07-18 10:01:36 -07003632function drawQuadID(id, x1, y1, x2, y2, x3, y3) {
3633 drawQuadPartialID(id, x1, y1, x2, y2, x3, y3, 0, 1);
3634}
3635
caryclark1049f122015-04-20 08:31:59 -07003636function drawConicPartialID(id, x1, y1, x2, y2, x3, y3, w, t1, t2) {
3637 var curve = [x1, y1, x2, y2, x3, y3, w];
3638 drawCurvePartialID(id, curve, t1, t2);
3639}
3640
caryclark55888e42016-07-18 10:01:36 -07003641function drawConicID(id, x1, y1, x2, y2, x3, y3, w) {
3642 drawConicPartialID(id, x1, y1, x2, y2, x3, y3, w, 0, 1);
3643}
3644
caryclarkdac1d172014-06-17 05:15:38 -07003645function drawCubicPartialID(id, x1, y1, x2, y2, x3, y3, x4, y4, t1, t2) {
3646 var curve = [x1, y1, x2, y2, x3, y3, x4, y4];
3647 drawCurvePartialID(id, curve, t1, t2);
3648}
3649
caryclark55888e42016-07-18 10:01:36 -07003650function drawCubicID(id, x1, y1, x2, y2, x3, y3, x4, y4) {
3651 drawCubicPartialID(id, x1, y1, x2, y2, x3, y3, x4, y4, 0, 1);
3652}
3653
caryclarkdac1d172014-06-17 05:15:38 -07003654function drawCurvePartialID(id, curve, t1, t2) {
Cary Clarkff114282016-12-14 11:56:16 -05003655 drawVisibleID(curve, (t1 + t2) / 2, id);
caryclarkdac1d172014-06-17 05:15:38 -07003656}
3657
3658function drawCurveSpecials(test, curve, type) {
3659 if (pt_labels) {
3660 drawPoints(curve, type, pt_labels == 2);
3661 }
3662 if (control_lines != 0) {
3663 drawControlLines(curve, type, control_lines);
3664 }
3665 if (curve_t) {
3666 drawPointAtT(curve, type);
3667 }
3668 if (draw_midpoint) {
3669 var mid = pointAtT(curve, type, 0.5);
3670 drawPoint(mid.x, mid.y, true);
3671 }
3672 if (draw_id) {
3673 var id = idByCurve(test, curve, type);
3674 if (id >= 0) {
Cary Clarkff114282016-12-14 11:56:16 -05003675 drawVisibleID(curve, 0.5, id);
caryclarkdac1d172014-06-17 05:15:38 -07003676 }
3677 }
Cary Clarkff114282016-12-14 11:56:16 -05003678 if (draw_direction) {
3679 drawVisibleDirection(curve);
3680 }
caryclarkdac1d172014-06-17 05:15:38 -07003681 if (type == PATH_LINE) {
3682 return;
3683 }
3684 if (draw_deriviatives > 0) {
3685 var d = dxy_at_t(curve, type, 0);
caryclark03b03ca2015-04-23 09:13:37 -07003686 drawArrow(curve[0], curve[1], d.x, d.y, 1);
caryclarkdac1d172014-06-17 05:15:38 -07003687 if (draw_deriviatives == 2) {
3688 d = dxy_at_t(curve, type, 1);
3689 if (type == PATH_CUBIC) {
caryclark03b03ca2015-04-23 09:13:37 -07003690 drawArrow(curve[6], curve[7], d.x, d.y, 1);
caryclarkdac1d172014-06-17 05:15:38 -07003691 } else {
caryclark03b03ca2015-04-23 09:13:37 -07003692 drawArrow(curve[4], curve[5], d.x, d.y, 1);
caryclarkdac1d172014-06-17 05:15:38 -07003693 }
3694 }
3695 if (draw_midpoint) {
3696 var mid = pointAtT(curve, type, 0.5);
3697 d = dxy_at_t(curve, type, 0.5);
caryclark03b03ca2015-04-23 09:13:37 -07003698 drawArrow(mid.x, mid.y, d.x, d.y, 1);
caryclarkdac1d172014-06-17 05:15:38 -07003699 }
3700 }
3701 if (type != PATH_CUBIC) {
3702 return;
3703 }
caryclarkdac1d172014-06-17 05:15:38 -07003704 if (draw_sequence) {
3705 var ymin = Math.min(curve[1], curve[3], curve[5], curve[7]);
3706 for (var i = 0; i < 8; i+= 2) {
3707 drawLabelX(ymin, i >> 1, curve[i]);
3708 }
3709 var xmin = Math.min(curve[0], curve[2], curve[4], curve[6]);
3710 for (var i = 1; i < 8; i+= 2) {
3711 drawLabelY(xmin, i >> 1, curve[i]);
3712 }
3713 }
3714}
3715
3716function logCurves(test) {
3717 for (curves in test) {
3718 var curve = test[curves];
3719 dumpCurve(curve);
3720 }
3721}
3722
3723function curveToString(curve) {
3724 var str = "{{";
caryclark1049f122015-04-20 08:31:59 -07003725 var length = curve.length == 7 ? 6 : curve.length;
3726 if (curve.length == 7) {
3727 str += "{";
3728 }
3729 for (i = 0; i < length; i += 2) {
caryclarkdac1d172014-06-17 05:15:38 -07003730 str += curve[i].toFixed(decimal_places) + "," + curve[i + 1].toFixed(decimal_places);
3731 if (i < curve.length - 2) {
3732 str += "}, {";
3733 }
3734 }
caryclark1049f122015-04-20 08:31:59 -07003735 str += "}";
3736 if (curve.length == 7) {
3737 str += "}, " + curve[6].toFixed(decimal_places);
3738 }
3739 str += "}";
caryclarkdac1d172014-06-17 05:15:38 -07003740 return str;
3741}
3742
3743function dumpCurve(curve) {
3744 console.log(curveToString(curve));
3745}
3746
3747function draw(test, lines, title) {
3748 ctx.fillStyle = "rgba(0,0,0, 0.1)";
3749 ctx.font = "normal 50px Arial";
3750 ctx.textAlign = "left";
3751 ctx.fillText(title, 50, 50);
3752 ctx.font = "normal 10px Arial";
3753 ctx.lineWidth = "1.001"; "0.999";
3754 var secondPath = test.length;
3755 var closeCount = 0;
3756 logStart = -1;
3757 logRange = 0;
3758 // find last active rec type at this step
3759 var curType = test[0];
3760 var curStep = 0;
3761 var hasOp = false;
3762 var lastActive = 0;
3763 var lastAdd = 0;
caryclark624637c2015-05-11 07:21:27 -07003764 var lastCoin = 0;
caryclarkdac1d172014-06-17 05:15:38 -07003765 var lastSect = 0;
3766 var lastSort = 0;
3767 var lastMark = 0;
caryclark03b03ca2015-04-23 09:13:37 -07003768 var lastTop = 0;
caryclarkdac1d172014-06-17 05:15:38 -07003769 activeCount = 0;
3770 addCount = 0;
3771 angleCount = 0;
3772 opCount = 0;
3773 sectCount = 0;
3774 sortCount = 0;
caryclark03b03ca2015-04-23 09:13:37 -07003775 topCount = 0;
caryclarkdac1d172014-06-17 05:15:38 -07003776 markCount = 0;
3777 activeMax = 0;
3778 addMax = 0;
3779 angleMax = 0;
caryclark624637c2015-05-11 07:21:27 -07003780 coinMax = 0;
caryclarkdac1d172014-06-17 05:15:38 -07003781 opMax = 0;
3782 sectMax = 0;
3783 sectMax2 = 0;
3784 sortMax = 0;
caryclark03b03ca2015-04-23 09:13:37 -07003785 topMax = 0;
caryclarkdac1d172014-06-17 05:15:38 -07003786 markMax = 0;
3787 lastIndex = test.length - 3;
3788 for (var tIndex = 0; tIndex < test.length; tIndex += 3) {
3789 var recType = test[tIndex];
3790 if (!typeof recType == 'number' || recType < REC_TYPE_UNKNOWN || recType > REC_TYPE_LAST) {
3791 console.log("unknown rec type: " + recType);
3792 throw "stop execution";
3793 }
3794 // if (curType == recType && curType != REC_TYPE_ADD) {
3795 // continue;
3796 // }
3797 var inStepRange = step_limit == 0 || curStep < step_limit;
3798 curType = recType;
3799 if (recType == REC_TYPE_OP) {
3800 hasOp = true;
3801 continue;
3802 }
3803 if (recType == REC_TYPE_UNKNOWN) {
3804 // these types do not advance step
3805 continue;
3806 }
3807 var bumpStep = false;
3808 var records = test[tIndex + 2];
3809 var fragType = records[0];
3810 if (recType == REC_TYPE_ADD) {
3811 if (records.length != 2) {
3812 console.log("expect only two elements: " + records.length);
3813 throw "stop execution";
3814 }
3815 if (fragType == ADD_MOVETO || fragType == ADD_CLOSE) {
3816 continue;
3817 }
3818 ++addMax;
3819 if (!draw_add || !inStepRange) {
3820 continue;
3821 }
3822 lastAdd = tIndex;
3823 ++addCount;
3824 bumpStep = true;
3825 }
3826 if (recType == REC_TYPE_PATH && hasOp) {
3827 secondPath = tIndex;
3828 }
caryclark54359292015-03-26 07:52:43 -07003829 if (recType == REC_TYPE_PATH2 && hasOp) {
3830 secondPath = tIndex;
3831 }
caryclarkdac1d172014-06-17 05:15:38 -07003832 if (recType == REC_TYPE_ACTIVE) {
3833 ++activeMax;
3834 if (!draw_active || !inStepRange) {
3835 continue;
3836 }
3837 lastActive = tIndex;
3838 ++activeCount;
3839 bumpStep = true;
3840 }
3841 if (recType == REC_TYPE_ACTIVE_OP) {
3842 ++opMax;
3843 if (!draw_op || !inStepRange) {
3844 continue;
3845 }
3846 lastOp = tIndex;
3847 ++opCount;
3848 bumpStep = true;
3849 }
caryclark54359292015-03-26 07:52:43 -07003850 if (recType == REC_TYPE_AFTERPART) {
3851 if (draw_angle != 3 || !inStepRange) {
3852 continue;
3853 }
3854 lastAngle = tIndex;
3855 ++angleCount;
3856 bumpStep = true;
3857 }
caryclarkdac1d172014-06-17 05:15:38 -07003858 if (recType == REC_TYPE_ANGLE) {
3859 ++angleMax;
caryclark54359292015-03-26 07:52:43 -07003860 if (draw_angle == 0 || draw_angle == 3 || !inStepRange) {
caryclarkdac1d172014-06-17 05:15:38 -07003861 continue;
3862 }
3863 lastAngle = tIndex;
3864 ++angleCount;
3865 bumpStep = true;
3866 }
caryclark624637c2015-05-11 07:21:27 -07003867 if (recType == REC_TYPE_COINCIDENCE) {
3868 ++coinMax;
3869 if (!draw_coincidence || !inStepRange) {
3870 continue;
3871 }
3872 lastCoin = tIndex;
3873 ++coinCount;
3874 bumpStep = true;
3875 }
caryclarkdac1d172014-06-17 05:15:38 -07003876 if (recType == REC_TYPE_SECT) {
3877 if (records.length != 2) {
3878 console.log("expect only two elements: " + records.length);
3879 throw "stop execution";
3880 }
3881 ++sectMax;
3882 var sectBump = 1;
3883 switch (fragType) {
3884 case INTERSECT_LINE:
3885 case INTERSECT_QUAD_LINE:
3886 case INTERSECT_QUAD:
caryclark1049f122015-04-20 08:31:59 -07003887 case INTERSECT_CONIC_LINE:
caryclark55888e42016-07-18 10:01:36 -07003888 case INTERSECT_CONIC_QUAD:
caryclark1049f122015-04-20 08:31:59 -07003889 case INTERSECT_CONIC:
caryclarkdac1d172014-06-17 05:15:38 -07003890 case INTERSECT_SELF_CUBIC:
3891 case INTERSECT_CUBIC_LINE:
3892 case INTERSECT_CUBIC_QUAD:
3893 case INTERSECT_CUBIC:
3894 sectBump = 1;
3895 break;
3896 case INTERSECT_LINE_2:
3897 case INTERSECT_QUAD_LINE_2:
3898 case INTERSECT_QUAD_2:
caryclark1049f122015-04-20 08:31:59 -07003899 case INTERSECT_CONIC_LINE_2:
caryclark55888e42016-07-18 10:01:36 -07003900 case INTERSECT_CONIC_QUAD_2:
caryclark1049f122015-04-20 08:31:59 -07003901 case INTERSECT_CONIC_2:
caryclarkdac1d172014-06-17 05:15:38 -07003902 case INTERSECT_CUBIC_LINE_2:
3903 case INTERSECT_CUBIC_QUAD_2:
3904 case INTERSECT_CUBIC_2:
3905 sectBump = 2;
3906 break;
3907 case INTERSECT_LINE_NO:
3908 case INTERSECT_QUAD_LINE_NO:
3909 case INTERSECT_QUAD_NO:
caryclark1049f122015-04-20 08:31:59 -07003910 case INTERSECT_CONIC_LINE_NO:
caryclark55888e42016-07-18 10:01:36 -07003911 case INTERSECT_CONIC_QUAD_NO:
caryclark1049f122015-04-20 08:31:59 -07003912 case INTERSECT_CONIC_NO:
caryclarkdac1d172014-06-17 05:15:38 -07003913 case INTERSECT_SELF_CUBIC_NO:
3914 case INTERSECT_CUBIC_LINE_NO:
3915 case INTERSECT_CUBIC_QUAD_NO:
3916 case INTERSECT_CUBIC_NO:
3917 sectBump = 0;
3918 break;
caryclark6c3b9cd2016-09-26 05:36:58 -07003919 case INTERSECT_CONIC_QUAD_3:
caryclarkdac1d172014-06-17 05:15:38 -07003920 case INTERSECT_CUBIC_LINE_3:
3921 case INTERSECT_CUBIC_QUAD_3:
3922 case INTERSECT_CUBIC_3:
3923 sectBump = 3;
3924 break;
caryclark6c3b9cd2016-09-26 05:36:58 -07003925 case INTERSECT_CONIC_QUAD_4:
caryclarkdac1d172014-06-17 05:15:38 -07003926 case INTERSECT_CUBIC_QUAD_4:
3927 case INTERSECT_CUBIC_4:
3928 sectBump = 4;
3929 break;
3930 default:
3931 console.log("missing case " + records.length);
3932 throw "stop execution";
3933 }
3934 sectMax2 += sectBump;
3935 if (draw_intersection <= 1 || !inStepRange) {
3936 continue;
3937 }
3938 lastSect = tIndex;
3939 sectCount += sectBump;
3940 bumpStep = true;
3941 }
3942 if (recType == REC_TYPE_SORT) {
3943 ++sortMax;
3944 if (!draw_sort || !inStepRange) {
3945 continue;
3946 }
3947 lastSort = tIndex;
3948 ++sortCount;
3949 bumpStep = true;
3950 }
caryclark03b03ca2015-04-23 09:13:37 -07003951 if (recType == REC_TYPE_TOP) {
3952 ++topMax;
3953 if (!draw_top || !inStepRange) {
3954 continue;
3955 }
3956 lastTop = tIndex;
3957 ++topCount;
3958 bumpStep = true;
3959 }
caryclarkdac1d172014-06-17 05:15:38 -07003960 if (recType == REC_TYPE_MARK) {
3961 ++markMax;
3962 if (!draw_mark || !inStepRange) {
3963 continue;
3964 }
3965 lastMark = tIndex;
3966 ++markCount;
3967 bumpStep = true;
3968 }
3969 if (bumpStep) {
3970 lastIndex = tIndex;
3971 logStart = test[tIndex + 1];
3972 logRange = records.length / 2;
3973 ++curStep;
3974 }
3975 }
3976 stepMax = (draw_add ? addMax : 0)
3977 + (draw_active ? activeMax : 0)
reed0dc4dd62015-03-24 13:55:33 -07003978 + (draw_angle ? angleMax : 0)
caryclark624637c2015-05-11 07:21:27 -07003979 + (draw_coincidence ? coinMax : 0)
caryclark54359292015-03-26 07:52:43 -07003980 + (draw_op ? opMax : 0)
caryclarkdac1d172014-06-17 05:15:38 -07003981 + (draw_sort ? sortMax : 0)
caryclark03b03ca2015-04-23 09:13:37 -07003982 + (draw_top ? topMax : 0)
caryclarkdac1d172014-06-17 05:15:38 -07003983 + (draw_mark ? markMax : 0)
3984 + (draw_intersection == 2 ? sectMax : draw_intersection == 3 ? sectMax2 : 0);
3985 if (stepMax == 0) {
caryclark624637c2015-05-11 07:21:27 -07003986 stepMax = addMax + activeMax + angleMax + coinMax + opMax + sortMax + topMax + markMax;
caryclarkdac1d172014-06-17 05:15:38 -07003987 }
3988 drawnPts = [];
3989 drawnLines = [];
3990 drawnQuads = [];
caryclark1049f122015-04-20 08:31:59 -07003991 drawnConics = [];
caryclarkdac1d172014-06-17 05:15:38 -07003992 drawnCubics = [];
3993 focusXmin = focusYmin = Infinity;
3994 focusXmax = focusYmax = -Infinity;
3995 var pathIndex = 0;
3996 var opLetter = 'S';
3997 for (var tIndex = lastIndex; tIndex >= 0; tIndex -= 3) {
3998 var recType = test[tIndex];
3999 var records = test[tIndex + 2];
4000 for (var recordIndex = 0; recordIndex < records.length; recordIndex += 2) {
4001 var fragType = records[recordIndex];
4002 if (!typeof fragType == 'number' || fragType < 1 || fragType > FRAG_TYPE_LAST) {
4003 console.log("unknown in range frag type: " + fragType);
4004 throw "stop execution";
4005 }
4006 var frags = records[recordIndex + 1];
4007 focus_enabled = false;
4008 switch (recType) {
4009 case REC_TYPE_COMPUTED:
4010 if (draw_computed == 0) {
4011 continue;
4012 }
4013 ctx.lineWidth = 1;
4014 ctx.strokeStyle = pathIndex == 0 ? "black" : "red";
4015 ctx.fillStyle = "blue";
4016 var drawThis = false;
4017 switch (fragType) {
4018 case PATH_QUAD:
caryclark1049f122015-04-20 08:31:59 -07004019 if ((draw_computed & 0x9) == 1 || ((draw_computed & 8) != 0
4020 && (draw_computed & 7) == pathIndex)) {
caryclarkdac1d172014-06-17 05:15:38 -07004021 drawQuad(frags[0], frags[1], frags[2], frags[3],
4022 frags[4], frags[5]);
4023 drawThis = true;
4024 }
4025 break;
caryclark1049f122015-04-20 08:31:59 -07004026 case PATH_CONIC:
4027 if ((draw_computed & 0xA) == 2 || ((draw_computed & 8) != 0
4028 && (draw_computed & 7) == pathIndex)) {
4029 drawConicWithQuads(frags[0], frags[1], frags[2], frags[3],
4030 frags[4], frags[5], frags[6]);
4031 drawThis = true;
4032 }
4033 break;
caryclarkdac1d172014-06-17 05:15:38 -07004034 case PATH_CUBIC:
caryclark1049f122015-04-20 08:31:59 -07004035 if ((draw_computed & 0xC) == 4 || ((draw_computed & 8) != 0
4036 && (draw_computed & 7) == pathIndex)) {
caryclarkdac1d172014-06-17 05:15:38 -07004037 drawCubic(frags[0], frags[1], frags[2], frags[3],
4038 frags[4], frags[5], frags[6], frags[7]);
4039 drawThis = true;
4040 }
4041 ++pathIndex;
4042 break;
4043 case COMPUTED_SET_1:
4044 pathIndex = 0;
4045 break;
4046 case COMPUTED_SET_2:
4047 pathIndex = 1;
4048 break;
4049 default:
4050 console.log("unknown REC_TYPE_COMPUTED frag type: " + fragType);
4051 throw "stop execution";
4052 }
4053 if (!drawThis || collect_bounds) {
4054 break;
4055 }
4056 drawCurveSpecials(test, frags, fragType);
4057 break;
caryclark26ad22a2015-10-16 09:03:38 -07004058 case REC_TYPE_ALIGNED:
4059 if (draw_path < 4) {
4060 continue;
4061 }
caryclarkdac1d172014-06-17 05:15:38 -07004062 case REC_TYPE_PATH:
caryclark54359292015-03-26 07:52:43 -07004063 case REC_TYPE_PATH2:
caryclark26ad22a2015-10-16 09:03:38 -07004064 if (REC_TYPE_ALIGNED != recType && draw_path >= 4) {
4065 continue;
4066 }
caryclarkdac1d172014-06-17 05:15:38 -07004067 if (!draw_path) {
4068 continue;
4069 }
4070 var firstPath = tIndex < secondPath;
4071 if ((draw_path & (firstPath ? 1 : 2)) == 0) {
4072 continue;
4073 }
4074 ctx.lineWidth = 1;
4075 ctx.strokeStyle = firstPath ? "black" : "red";
4076 ctx.fillStyle = "blue";
caryclark55888e42016-07-18 10:01:36 -07004077 var frags2 = [];
caryclarkdac1d172014-06-17 05:15:38 -07004078 switch (fragType) {
4079 case PATH_LINE:
caryclark54359292015-03-26 07:52:43 -07004080 for (var i = 0; i < 4; ++ i) { frags2[i] = frags[i + 1]; }
4081 drawLine(frags2[0], frags2[1], frags2[2], frags2[3]);
caryclarkdac1d172014-06-17 05:15:38 -07004082 break;
4083 case PATH_QUAD:
caryclark54359292015-03-26 07:52:43 -07004084 for (var i = 0; i < 6; ++ i) { frags2[i] = frags[i + 1]; }
4085 drawQuad(frags2[0], frags2[1], frags2[2], frags2[3],
4086 frags2[4], frags2[5]);
caryclarkdac1d172014-06-17 05:15:38 -07004087 break;
caryclark1049f122015-04-20 08:31:59 -07004088 case PATH_CONIC:
4089 for (var i = 0; i < 7; ++ i) { frags2[i] = frags[i + 1]; }
4090 drawConicWithQuads(frags2[0], frags2[1], frags2[2], frags2[3],
4091 frags2[4], frags2[5], frags2[6]);
4092 break;
caryclarkdac1d172014-06-17 05:15:38 -07004093 case PATH_CUBIC:
caryclark54359292015-03-26 07:52:43 -07004094 for (var i = 0; i < 8; ++ i) { frags2[i] = frags[i + 1]; }
4095 drawCubic(frags2[0], frags2[1], frags2[2], frags2[3],
4096 frags2[4], frags2[5], frags2[6], frags2[7]);
caryclarkdac1d172014-06-17 05:15:38 -07004097 break;
4098 default:
caryclark26ad22a2015-10-16 09:03:38 -07004099 console.log("unknown " + recType + " frag type: " + fragType);
caryclarkdac1d172014-06-17 05:15:38 -07004100 throw "stop execution";
4101 }
4102 if (collect_bounds) {
4103 break;
4104 }
caryclark54359292015-03-26 07:52:43 -07004105 drawCurveSpecials(test, frags2, fragType);
caryclarkdac1d172014-06-17 05:15:38 -07004106 break;
4107 case REC_TYPE_OP:
4108 switch (fragType) {
4109 case OP_INTERSECT: opLetter = 'I'; break;
4110 case OP_DIFFERENCE: opLetter = 'D'; break;
4111 case OP_UNION: opLetter = 'U'; break;
4112 case OP_XOR: opLetter = 'X'; break;
4113 default:
4114 console.log("unknown REC_TYPE_OP frag type: " + fragType);
4115 throw "stop execution";
4116 }
4117 break;
4118 case REC_TYPE_ACTIVE:
4119 if (!draw_active || (step_limit > 0 && tIndex < lastActive)) {
4120 continue;
4121 }
4122 var x1 = frags[SPAN_X1];
4123 var y1 = frags[SPAN_Y1];
4124 var x2 = frags[SPAN_X2];
4125 var y2 = frags[SPAN_Y2];
caryclark55888e42016-07-18 10:01:36 -07004126 var x3, y3, x3, y4, w;
caryclarkdac1d172014-06-17 05:15:38 -07004127 ctx.lineWidth = 3;
4128 ctx.strokeStyle = "rgba(0,0,255, 0.3)";
4129 focus_enabled = true;
4130 switch (fragType) {
4131 case ACTIVE_LINE_SPAN:
caryclark55888e42016-07-18 10:01:36 -07004132 drawLine(x1, y1, x2, y2);
caryclarkdac1d172014-06-17 05:15:38 -07004133 if (draw_id) {
caryclark55888e42016-07-18 10:01:36 -07004134 drawLineID(frags[0], x1, y1, x2, y2);
4135 }
4136 if (pt_labels) {
4137 var curve = [x1, y1, x2, y2];
4138 ctx.fillStyle = "blue";
4139 drawPoints(curve, PATH_LINE, pt_labels == 2);
caryclarkdac1d172014-06-17 05:15:38 -07004140 }
4141 break;
4142 case ACTIVE_QUAD_SPAN:
4143 x3 = frags[SPAN_X3];
4144 y3 = frags[SPAN_Y3];
caryclark55888e42016-07-18 10:01:36 -07004145 drawQuad(x1, y1, x2, y2, x3, y3);
caryclarkdac1d172014-06-17 05:15:38 -07004146 if (draw_id) {
caryclark55888e42016-07-18 10:01:36 -07004147 drawQuadID(frags[0], x1, y1, x2, y2, x3, y3);
4148 }
4149 if (pt_labels) {
4150 var curve = [x1, y1, x2, y2, x3, y3];
4151 ctx.fillStyle = "blue";
4152 drawPoints(curve, PATH_QUAD, pt_labels == 2);
caryclarkdac1d172014-06-17 05:15:38 -07004153 }
4154 break;
caryclark1049f122015-04-20 08:31:59 -07004155 case ACTIVE_CONIC_SPAN:
4156 x3 = frags[SPAN_X3];
4157 y3 = frags[SPAN_Y3];
caryclark1049f122015-04-20 08:31:59 -07004158 w = frags[SPAN_K_W];
caryclark55888e42016-07-18 10:01:36 -07004159 drawConicWithQuads(x1, y1, x2, y2, x3, y3, w);
caryclark1049f122015-04-20 08:31:59 -07004160 if (draw_id) {
caryclark55888e42016-07-18 10:01:36 -07004161 drawConicID(frags[0], x1, y1, x2, y2, x3, y3, w);
4162 }
4163 if (pt_labels) {
4164 var curve = [x1, y1, x2, y2, x3, y3, w];
4165 ctx.fillStyle = "blue";
4166 drawPoints(curve, PATH_CONIC, pt_labels == 2);
caryclark1049f122015-04-20 08:31:59 -07004167 }
4168 break;
caryclarkdac1d172014-06-17 05:15:38 -07004169 case ACTIVE_CUBIC_SPAN:
4170 x3 = frags[SPAN_X3];
4171 y3 = frags[SPAN_Y3];
4172 x4 = frags[SPAN_X4];
4173 y4 = frags[SPAN_Y4];
caryclark55888e42016-07-18 10:01:36 -07004174 drawCubic(x1, y1, x2, y2, x3, y3, x4, y4);
caryclarkdac1d172014-06-17 05:15:38 -07004175 if (draw_id) {
caryclark55888e42016-07-18 10:01:36 -07004176 drawCubicID(frags[0], x1, y1, x2, y2, x3, y3, x4, y4);
4177 }
4178 if (pt_labels) {
4179 var curve = [x1, y1, x2, y2, x3, y3, x4, y4];
4180 ctx.fillStyle = "blue";
4181 drawPoints(curve, PATH_CUBIC, pt_labels == 2);
caryclarkdac1d172014-06-17 05:15:38 -07004182 }
4183 break;
4184 default:
4185 console.log("unknown REC_TYPE_ACTIVE frag type: " + fragType);
4186 throw "stop execution";
4187 }
4188 break;
4189 case REC_TYPE_ACTIVE_OP:
4190 if (!draw_op || (step_limit > 0 && tIndex < lastOp)) {
4191 continue;
4192 }
4193 focus_enabled = true;
4194 ctx.lineWidth = 3;
4195 var activeSpan = frags[7] == "1";
4196 ctx.strokeStyle = activeSpan ? "rgba(45,160,0, 0.3)" : "rgba(255,45,0, 0.5)";
4197 var curve = curvePartialByID(test, frags[0], frags[1], frags[2]);
4198 drawCurve(curve);
4199 if (draw_op > 1) {
4200 drawArc(curve, false, frags[3], frags[4]);
4201 drawArc(curve, true, frags[5], frags[6]);
4202 }
4203 break;
4204 case REC_TYPE_ADD:
4205 if (!draw_add) {
4206 continue;
4207 }
4208 ctx.lineWidth = 3;
4209 ctx.strokeStyle = closeCount == 0 ? "rgba(0,0,255, 0.3)"
4210 : closeCount == 1 ? "rgba(0,127,0, 0.3)"
4211 : closeCount == 2 ? "rgba(0,127,127, 0.3)"
4212 : closeCount == 3 ? "rgba(127,127,0, 0.3)"
4213 : "rgba(127,0,127, 0.3)";
4214 focus_enabled = true;
4215 switch (fragType) {
4216 case ADD_MOVETO:
4217 break;
4218 case ADD_LINETO:
4219 if (step_limit == 0 || tIndex >= lastAdd) {
4220 drawLine(frags[0], frags[1], frags[2], frags[3]);
4221 }
4222 break;
4223 case ADD_QUADTO:
4224 if (step_limit == 0 || tIndex >= lastAdd) {
4225 drawQuad(frags[0], frags[1], frags[2], frags[3], frags[4], frags[5]);
4226 }
4227 break;
caryclark1049f122015-04-20 08:31:59 -07004228 case ADD_CONICTO:
4229 if (step_limit == 0 || tIndex >= lastAdd) {
4230 drawConicWithQuads(frags[0], frags[1], frags[2], frags[3],
4231 frags[4], frags[5], frags[6]);
4232 }
4233 break;
caryclarkdac1d172014-06-17 05:15:38 -07004234 case ADD_CUBICTO:
4235 if (step_limit == 0 || tIndex >= lastAdd) {
4236 drawCubic(frags[0], frags[1], frags[2], frags[3],
4237 frags[4], frags[5], frags[6], frags[7]);
4238 }
4239 break;
4240 case ADD_CLOSE:
4241 ++closeCount;
4242 break;
4243 case ADD_FILL:
4244 break;
4245 default:
4246 console.log("unknown REC_TYPE_ADD frag type: " + fragType);
4247 throw "stop execution";
4248 }
4249 break;
4250 case REC_TYPE_ANGLE:
caryclark54359292015-03-26 07:52:43 -07004251 angleBetween = frags[18] == "T";
4252 afterIndex = 0;
4253 if (draw_angle == 0 || draw_angle == 3 || (step_limit > 0 && tIndex < lastAngle)) {
caryclarkdac1d172014-06-17 05:15:38 -07004254 continue;
4255 }
4256 focus_enabled = true;
4257 ctx.lineWidth = 3;
4258 ctx.strokeStyle = "rgba(127,45,127, 0.3)";
caryclark54359292015-03-26 07:52:43 -07004259 var leftCurve = curvePartialByID(test, frags[0], frags[4], frags[5]);
4260 var midCurve = curvePartialByID(test, frags[6], frags[10], frags[11]);
4261 var rightCurve = curvePartialByID(test, frags[12], frags[16], frags[17]);
caryclarkdac1d172014-06-17 05:15:38 -07004262 drawCurve(leftCurve);
4263 drawCurve(rightCurve);
caryclark54359292015-03-26 07:52:43 -07004264 ctx.strokeStyle = angleBetween ? "rgba(0,160,45, 0.3)" : "rgba(255,0,45, 0.5)";
caryclarkdac1d172014-06-17 05:15:38 -07004265 drawCurve(midCurve);
4266 if (draw_angle > 1) {
Cary Clarkff114282016-12-14 11:56:16 -05004267 drawVisibleOrder(leftCurve, 'L');
4268 drawVisibleOrder(rightCurve, 'R');
4269 }
4270 if (draw_id) {
4271 drawVisibleID(leftCurve, 0.5, frags[0]);
4272 drawVisibleID(midCurve, 0.5, frags[6]);
4273 drawVisibleID(rightCurve, 0.5, frags[12]);
caryclarkdac1d172014-06-17 05:15:38 -07004274 }
4275 break;
caryclark54359292015-03-26 07:52:43 -07004276 case REC_TYPE_AFTERPART:
4277 if (draw_angle != 3 || (step_limit > 0 && tIndex < lastAngle)) {
4278 continue;
4279 }
4280 ctx.strokeStyle = afterIndex == 0 ? "rgba(255,0,0, 1.0)"
4281 : (afterIndex == 1) == angleBetween ? "rgba(0,128,0, 1.0)"
Cary Clarkff114282016-12-14 11:56:16 -05004282 : "rgba(0,0,255, 1.0)";
4283 var curve;
4284 var id;
caryclark54359292015-03-26 07:52:43 -07004285 switch (fragType) {
4286 case PATH_LINE:
Cary Clarkff114282016-12-14 11:56:16 -05004287 curve = [ frags[0], frags[1], frags[2], frags[3] ];
4288 id = frags[4];
caryclark54359292015-03-26 07:52:43 -07004289 break;
4290 case PATH_QUAD:
Cary Clarkff114282016-12-14 11:56:16 -05004291 curve = [ frags[0], frags[1], frags[2], frags[3],
4292 frags[4], frags[5] ];
4293 id = frags[6];
caryclark54359292015-03-26 07:52:43 -07004294 break;
caryclark1049f122015-04-20 08:31:59 -07004295 case PATH_CONIC:
Cary Clarkff114282016-12-14 11:56:16 -05004296 curve = [ frags[0], frags[1], frags[2], frags[3],
4297 frags[4], frags[5], frags[6] ];
4298 id = frags[7];
caryclark1049f122015-04-20 08:31:59 -07004299 break;
caryclark54359292015-03-26 07:52:43 -07004300 case PATH_CUBIC:
Cary Clarkff114282016-12-14 11:56:16 -05004301 curve = [ frags[0], frags[1], frags[2], frags[3],
4302 frags[4], frags[5], frags[6], frags[7] ];
4303 id = frags[8];
caryclark54359292015-03-26 07:52:43 -07004304 break;
4305 default:
4306 console.log("unknown REC_TYPE_AFTERPART frag type: " + fragType);
4307 throw "stop execution";
4308 }
Cary Clarkff114282016-12-14 11:56:16 -05004309 drawCurve(curve);
4310 if (draw_id) {
4311 drawVisibleID(curve, 0.5, id);
4312 }
caryclark54359292015-03-26 07:52:43 -07004313 ++afterIndex;
4314 break;
caryclark624637c2015-05-11 07:21:27 -07004315 case REC_TYPE_COINCIDENCE:
4316 if (!draw_coincidence || (step_limit > 0 && tIndex < lastCoin)) {
4317 continue;
4318 }
4319 focus_enabled = true;
4320 ctx.lineWidth = 3;
4321 ctx.strokeStyle = "rgba(127,45,63, 0.3)";
4322 var curve = curvePartialByID(test, frags[0], frags[1], frags[2]);
4323 drawCurve(curve);
4324 break;
caryclarkdac1d172014-06-17 05:15:38 -07004325 case REC_TYPE_SECT:
4326 if (!draw_intersection) {
4327 continue;
4328 }
4329 if (draw_intersection != 1 && (step_limit > 0 && tIndex < lastSect)) {
4330 continue;
4331 }
4332 // draw_intersection == 1 : show all
4333 // draw_intersection == 2 : step == 0 ? show all : show intersection line #step
4334 // draw_intersection == 3 : step == 0 ? show all : show intersection #step
4335 ctx.lineWidth = 1;
4336 ctx.strokeStyle = "rgba(0,0,255, 0.3)";
4337 ctx.fillStyle = "blue";
4338 focus_enabled = true;
4339 var f = [];
4340 var c1s;
4341 var c1l;
4342 var c2s;
4343 var c2l;
4344 switch (fragType) {
4345 case INTERSECT_LINE:
4346 f.push(5, 6, 0, 7);
4347 c1s = 1; c1l = 4; c2s = 8; c2l = 4;
4348 break;
4349 case INTERSECT_LINE_2:
4350 f.push(5, 6, 0, 10);
4351 f.push(8, 9, 7, 15);
4352 c1s = 1; c1l = 4; c2s = 11; c2l = 4;
4353 break;
4354 case INTERSECT_LINE_NO:
4355 c1s = 0; c1l = 4; c2s = 4; c2l = 4;
4356 break;
4357 case INTERSECT_QUAD_LINE:
4358 f.push(7, 8, 0, 9);
4359 c1s = 1; c1l = 6; c2s = 10; c2l = 4;
4360 break;
4361 case INTERSECT_QUAD_LINE_2:
4362 f.push(7, 8, 0, 12);
4363 f.push(10, 11, 9, 17);
4364 c1s = 1; c1l = 6; c2s = 13; c2l = 4;
4365 break;
4366 case INTERSECT_QUAD_LINE_NO:
4367 c1s = 0; c1l = 6; c2s = 6; c2l = 4;
4368 break;
4369 case INTERSECT_QUAD:
4370 f.push(7, 8, 0, 9);
4371 c1s = 1; c1l = 6; c2s = 10; c2l = 6;
4372 break;
4373 case INTERSECT_QUAD_2:
4374 f.push(7, 8, 0, 12);
4375 f.push(10, 11, 9, 19);
4376 c1s = 1; c1l = 6; c2s = 13; c2l = 6;
4377 break;
4378 case INTERSECT_QUAD_NO:
4379 c1s = 0; c1l = 6; c2s = 6; c2l = 6;
4380 break;
caryclark1049f122015-04-20 08:31:59 -07004381 case INTERSECT_CONIC_LINE:
4382 f.push(8, 9, 0, 10);
4383 c1s = 1; c1l = 7; c2s = 11; c2l = 4;
4384 break;
4385 case INTERSECT_CONIC_LINE_2:
4386 f.push(8, 9, 0, 12);
4387 f.push(11, 12, 10, 18);
4388 c1s = 1; c1l = 7; c2s = 14; c2l = 4;
4389 break;
4390 case INTERSECT_CONIC_LINE_NO:
4391 c1s = 0; c1l = 7; c2s = 7; c2l = 4;
4392 break;
caryclark55888e42016-07-18 10:01:36 -07004393 case INTERSECT_CONIC_QUAD:
4394 f.push(8, 9, 0, 10);
4395 c1s = 1; c1l = 7; c2s = 11; c2l = 6;
4396 break;
4397 case INTERSECT_CONIC_QUAD_2:
4398 f.push(8, 9, 0, 12);
4399 f.push(11, 12, 10, 18);
4400 c1s = 1; c1l = 7; c2s = 14; c2l = 6;
4401 break;
caryclark6c3b9cd2016-09-26 05:36:58 -07004402 case INTERSECT_CONIC_QUAD_3:
4403 f.push(8, 9, 0, 15);
4404 f.push(11, 12, 10, 21);
4405 f.push(14, 15, 13, 22);
4406 c1s = 1; c1l = 7; c2s = 17; c2l = 6;
4407 break;
4408 case INTERSECT_CONIC_QUAD_4:
4409 f.push(8, 9, 0, 18);
4410 f.push(11, 12, 10, 24);
4411 f.push(14, 15, 13, 25);
4412 f.push(17, 18, 16, 26);
4413 c1s = 1; c1l = 7; c2s = 20; c2l = 6;
4414 break;
caryclark55888e42016-07-18 10:01:36 -07004415 case INTERSECT_CONIC_QUAD_NO:
4416 c1s = 0; c1l = 7; c2s = 7; c2l = 6;
4417 break;
caryclark1049f122015-04-20 08:31:59 -07004418 case INTERSECT_CONIC:
4419 f.push(8, 9, 0, 10);
4420 c1s = 1; c1l = 7; c2s = 11; c2l = 7;
4421 break;
4422 case INTERSECT_CONIC_2:
4423 f.push(8, 9, 0, 13);
4424 f.push(11, 12, 10, 21);
4425 c1s = 1; c1l = 7; c2s = 14; c2l = 7;
4426 break;
4427 case INTERSECT_CONIC_NO:
4428 c1s = 0; c1l = 7; c2s = 7; c2l = 7;
4429 break;
caryclarkdac1d172014-06-17 05:15:38 -07004430 case INTERSECT_SELF_CUBIC:
4431 f.push(9, 10, 0, 11);
4432 c1s = 1; c1l = 8; c2s = 0; c2l = 0;
4433 break;
4434 case INTERSECT_SELF_CUBIC_NO:
4435 c1s = 0; c1l = 8; c2s = 0; c2l = 0;
4436 break;
4437 case INTERSECT_CUBIC_LINE:
4438 f.push(9, 10, 0, 11);
4439 c1s = 1; c1l = 8; c2s = 12; c2l = 4;
4440 break;
4441 case INTERSECT_CUBIC_LINE_2:
4442 f.push(9, 10, 0, 14);
4443 f.push(12, 13, 11, 19);
4444 c1s = 1; c1l = 8; c2s = 15; c2l = 4;
4445 break;
4446 case INTERSECT_CUBIC_LINE_3:
4447 f.push(9, 10, 0, 17);
4448 f.push(12, 13, 11, 22);
4449 f.push(15, 16, 14, 23);
4450 c1s = 1; c1l = 8; c2s = 18; c2l = 4;
4451 break;
4452 case INTERSECT_CUBIC_QUAD_NO:
4453 c1s = 0; c1l = 8; c2s = 8; c2l = 6;
4454 break;
4455 case INTERSECT_CUBIC_QUAD:
4456 f.push(9, 10, 0, 11);
4457 c1s = 1; c1l = 8; c2s = 12; c2l = 6;
4458 break;
4459 case INTERSECT_CUBIC_QUAD_2:
4460 f.push(9, 10, 0, 14);
4461 f.push(12, 13, 11, 21);
4462 c1s = 1; c1l = 8; c2s = 15; c2l = 6;
4463 break;
4464 case INTERSECT_CUBIC_QUAD_3:
4465 f.push(9, 10, 0, 17);
4466 f.push(12, 13, 11, 24);
4467 f.push(15, 16, 14, 25);
4468 c1s = 1; c1l = 8; c2s = 18; c2l = 6;
4469 break;
4470 case INTERSECT_CUBIC_QUAD_4:
4471 f.push(9, 10, 0, 20);
4472 f.push(12, 13, 11, 27);
4473 f.push(15, 16, 14, 28);
4474 f.push(18, 19, 17, 29);
4475 c1s = 1; c1l = 8; c2s = 21; c2l = 6;
4476 break;
4477 case INTERSECT_CUBIC_LINE_NO:
4478 c1s = 0; c1l = 8; c2s = 8; c2l = 4;
4479 break;
4480 case INTERSECT_CUBIC:
4481 f.push(9, 10, 0, 11);
4482 c1s = 1; c1l = 8; c2s = 12; c2l = 8;
4483 break;
4484 case INTERSECT_CUBIC_2:
4485 f.push(9, 10, 0, 14);
4486 f.push(12, 13, 11, 23);
4487 c1s = 1; c1l = 8; c2s = 15; c2l = 8;
4488 break;
4489 case INTERSECT_CUBIC_3:
4490 f.push(9, 10, 0, 17);
4491 f.push(12, 13, 11, 26);
4492 f.push(15, 16, 14, 27);
4493 c1s = 1; c1l = 8; c2s = 18; c2l = 8;
4494 break;
4495 case INTERSECT_CUBIC_4:
4496 f.push(9, 10, 0, 20);
4497 f.push(12, 13, 11, 29);
4498 f.push(15, 16, 14, 30);
4499 f.push(18, 19, 17, 31);
4500 c1s = 1; c1l = 8; c2s = 21; c2l = 8;
4501 break;
4502 case INTERSECT_CUBIC_NO:
4503 c1s = 0; c1l = 8; c2s = 8; c2l = 8;
4504 break;
4505 default:
4506 console.log("unknown REC_TYPE_SECT frag type: " + fragType);
4507 throw "stop execution";
4508 }
4509 if (draw_intersection != 1) {
4510 var id = -1;
4511 var curve;
4512 switch (c1l) {
caryclark55888e42016-07-18 10:01:36 -07004513 case 4:
caryclarkdac1d172014-06-17 05:15:38 -07004514 drawLine(frags[c1s], frags[c1s + 1], frags[c1s + 2], frags[c1s + 3]);
4515 if (draw_id) {
4516 curve = [frags[c1s], frags[c1s + 1], frags[c1s + 2], frags[c1s + 3]];
4517 id = idByCurve(test, curve, PATH_LINE);
4518 }
4519 break;
4520 case 6:
4521 drawQuad(frags[c1s], frags[c1s + 1], frags[c1s + 2], frags[c1s + 3],
4522 frags[c1s + 4], frags[c1s + 5]);
4523 if (draw_id) {
4524 curve = [frags[c1s], frags[c1s + 1], frags[c1s + 2], frags[c1s + 3],
4525 frags[c1s + 4], frags[c1s + 5]];
4526 id = idByCurve(test, curve, PATH_QUAD);
4527 }
4528 break;
caryclark1049f122015-04-20 08:31:59 -07004529 case 7:
4530 drawConicWithQuads(frags[c1s], frags[c1s + 1], frags[c1s + 2], frags[c1s + 3],
4531 frags[c1s + 4], frags[c1s + 5], frags[c1s + 6]);
4532 if (draw_id) {
4533 curve = [frags[c1s], frags[c1s + 1], frags[c1s + 2], frags[c1s + 3],
4534 frags[c1s + 4], frags[c1s + 5], frags[c1s + 6]];
4535 id = idByCurve(test, curve, PATH_CONIC);
4536 }
4537 break;
caryclarkdac1d172014-06-17 05:15:38 -07004538 case 8:
4539 drawCubic(frags[c1s], frags[c1s + 1], frags[c1s + 2], frags[c1s + 3],
4540 frags[c1s + 4], frags[c1s + 5], frags[c1s + 6], frags[c1s + 7]);
4541 if (draw_id) {
4542 curve = [frags[c1s], frags[c1s + 1], frags[c1s + 2], frags[c1s + 3],
4543 frags[c1s + 4], frags[c1s + 5], frags[c1s + 6], frags[c1s + 7]];
4544 id = idByCurve(test, curve, PATH_CUBIC);
4545 }
4546 break;
4547 }
4548 if (id >= 0) {
Cary Clarkff114282016-12-14 11:56:16 -05004549 drawVisibleID(curve, 0.5, id);
caryclarkdac1d172014-06-17 05:15:38 -07004550 }
4551 id = -1;
4552 switch (c2l) {
4553 case 0:
4554 break;
caryclark55888e42016-07-18 10:01:36 -07004555 case 4:
caryclarkdac1d172014-06-17 05:15:38 -07004556 drawLine(frags[c2s], frags[c2s + 1], frags[c2s + 2], frags[c2s + 3]);
4557 if (draw_id) {
4558 curve = [frags[c2s], frags[c2s + 1], frags[c2s + 2], frags[c2s + 3]];
4559 id = idByCurve(test, curve, PATH_LINE);
4560 }
4561 break;
4562 case 6:
4563 drawQuad(frags[c2s], frags[c2s + 1], frags[c2s + 2], frags[c2s + 3],
4564 frags[c2s + 4], frags[c2s + 5]);
4565 if (draw_id) {
4566 curve = [frags[c2s], frags[c2s + 1], frags[c2s + 2], frags[c2s + 3],
4567 frags[c2s + 4], frags[c2s + 5]];
4568 id = idByCurve(test, curve, PATH_QUAD);
4569 }
4570 break;
caryclark1049f122015-04-20 08:31:59 -07004571 case 7:
4572 drawConicWithQuads(frags[c2s], frags[c2s + 1], frags[c2s + 2], frags[c2s + 3],
4573 frags[c2s + 4], frags[c2s + 5], frags[c2s + 6]);
4574 if (draw_id) {
4575 curve = [frags[c2s], frags[c2s + 1], frags[c2s + 2], frags[c2s + 3],
4576 frags[c2s + 4], frags[c2s + 5], frags[c2s + 6]];
4577 id = idByCurve(test, curve, PATH_CONIC);
4578 }
4579 break;
caryclarkdac1d172014-06-17 05:15:38 -07004580 case 8:
4581 drawCubic(frags[c2s], frags[c2s + 1], frags[c2s + 2], frags[c2s + 3],
4582 frags[c2s + 4], frags[c2s + 5], frags[c2s + 6], frags[c2s + 7]);
4583 if (draw_id) {
4584 curve = [frags[c2s], frags[c2s + 1], frags[c2s + 2], frags[c2s + 3],
4585 frags[c2s + 4], frags[c2s + 5], frags[c2s + 6], frags[c2s + 7]];
4586 id = idByCurve(test, curve, PATH_CUBIC);
4587 }
4588 break;
4589 }
4590 if (id >= 0) {
Cary Clarkff114282016-12-14 11:56:16 -05004591 drawVisibleID(curve, 0.5, id);
caryclarkdac1d172014-06-17 05:15:38 -07004592 }
4593 }
4594 if (collect_bounds) {
4595 break;
4596 }
caryclark54359292015-03-26 07:52:43 -07004597 if (draw_intersection != 3 || step_limit == 0 || tIndex >= lastSect) {
4598 for (var idx = 0; idx < f.length; idx += 4) {
caryclarkdac1d172014-06-17 05:15:38 -07004599 drawPoint(frags[f[idx]], frags[f[idx + 1]], true);
4600 }
4601 }
4602 if (!draw_intersectT) {
4603 break;
4604 }
4605 ctx.fillStyle = "red";
caryclark54359292015-03-26 07:52:43 -07004606 if (draw_intersection != 3 || step_limit == 0 || tIndex >= lastSect) {
4607 for (var idx = 0; idx < f.length; idx += 4) {
caryclarkdac1d172014-06-17 05:15:38 -07004608 drawTAtPointUp(frags[f[idx]], frags[f[idx + 1]], frags[f[idx + 2]]);
4609 drawTAtPointDown(frags[f[idx]], frags[f[idx + 1]], frags[f[idx + 3]]);
4610 }
4611 }
4612 break;
4613 case REC_TYPE_SORT:
4614 if (!draw_sort || (step_limit > 0 && tIndex < lastSort)) {
4615 continue;
4616 }
4617 ctx.lineWidth = 3;
4618 ctx.strokeStyle = "rgba(127,127,0, 0.5)";
4619 focus_enabled = true;
4620 switch (fragType) {
4621 case SORT_UNARY:
4622 case SORT_BINARY:
4623 var curve = curvePartialByID(test, frags[0], frags[6], frags[8]);
4624 drawCurve(curve);
4625 break;
4626 default:
4627 console.log("unknown REC_TYPE_SORT frag type: " + fragType);
4628 throw "stop execution";
4629 }
4630 break;
caryclark03b03ca2015-04-23 09:13:37 -07004631 case REC_TYPE_TOP:
4632 if (!draw_top || (step_limit > 0 && tIndex < lastTop)) {
4633 continue;
4634 }
4635 ctx.lineWidth = 3;
4636 ctx.strokeStyle = "rgba(127,127,0, 0.5)";
4637 focus_enabled = true;
4638 {
4639 var curve = curvePartialByID(test, frags[0], frags[1], frags[2]);
4640 drawCurve(curve);
4641 var type = PATH_LINE + (curve.length / 2 - 2);
4642 var mid = pointAtT(curve, type, 0.5);
4643 var d = dxy_at_t(curve, type, 0.5);
4644 drawArrow(mid.x, mid.y, d.x, d.y, 0.3);
4645 }
4646 break;
caryclarkdac1d172014-06-17 05:15:38 -07004647 case REC_TYPE_MARK:
4648 if (!draw_mark || (step_limit > 0 && tIndex < lastMark)) {
4649 continue;
4650 }
4651 ctx.lineWidth = 3;
4652 ctx.strokeStyle = fragType >= MARK_DONE_LINE ?
4653 "rgba(127,0,127, 0.5)" : "rgba(127,127,0, 0.5)";
4654 focus_enabled = true;
4655 switch (fragType) {
4656 case MARK_LINE:
4657 case MARK_DONE_LINE:
4658 case MARK_UNSORTABLE_LINE:
4659 case MARK_SIMPLE_LINE:
4660 case MARK_SIMPLE_DONE_LINE:
4661 case MARK_DONE_UNARY_LINE:
4662 drawLinePartial(frags[1], frags[2], frags[3], frags[4],
4663 frags[5], frags[9]);
4664 if (draw_id) {
4665 drawLinePartialID(frags[0], frags[1], frags[2], frags[3], frags[4],
4666 frags[5], frags[9]);
4667 }
4668 break;
4669 case MARK_QUAD:
4670 case MARK_DONE_QUAD:
4671 case MARK_UNSORTABLE_QUAD:
4672 case MARK_SIMPLE_QUAD:
4673 case MARK_SIMPLE_DONE_QUAD:
4674 case MARK_DONE_UNARY_QUAD:
4675 drawQuadPartial(frags[1], frags[2], frags[3], frags[4],
4676 frags[5], frags[6], frags[7], frags[11]);
4677 if (draw_id) {
4678 drawQuadPartialID(frags[0], frags[1], frags[2], frags[3], frags[4],
4679 frags[5], frags[6], frags[7], frags[11]);
4680 }
4681 break;
4682 case MARK_CUBIC:
4683 case MARK_DONE_CUBIC:
4684 case MARK_UNSORTABLE_CUBIC:
4685 case MARK_SIMPLE_CUBIC:
4686 case MARK_SIMPLE_DONE_CUBIC:
4687 case MARK_DONE_UNARY_CUBIC:
4688 drawCubicPartial(frags[1], frags[2], frags[3], frags[4],
4689 frags[5], frags[6], frags[7], frags[8], frags[9], frags[13]);
4690 if (draw_id) {
4691 drawCubicPartialID(frags[0], frags[1], frags[2], frags[3], frags[4],
4692 frags[5], frags[6], frags[7], frags[8], frags[9], frags[13]);
4693 }
4694 break;
4695 case MARK_ANGLE_LAST:
4696 // FIXME: ignored for now
4697 break;
4698 default:
4699 console.log("unknown REC_TYPE_MARK frag type: " + fragType);
4700 throw "stop execution";
4701 }
4702 break;
4703 default:
4704 continue;
4705 }
4706 }
4707 switch (recType) {
4708 case REC_TYPE_SORT:
4709 if (!draw_sort || (step_limit > 0 && tIndex < lastSort)) {
4710 break;
4711 }
4712 var angles = []; // use tangent lines to describe arcs
4713 var windFrom = [];
4714 var windTo = [];
4715 var opp = [];
4716 var minXY = Number.MAX_VALUE;
4717 var partial;
4718 focus_enabled = true;
4719 var someUnsortable = false;
4720 for (var recordIndex = 0; recordIndex < records.length; recordIndex += 2) {
4721 var fragType = records[recordIndex];
4722 var frags = records[recordIndex + 1];
4723 var unsortable = (fragType == SORT_UNARY && frags[14]) ||
4724 (fragType == SORT_BINARY && frags[16]);
4725 someUnsortable |= unsortable;
4726 switch (fragType) {
4727 case SORT_UNARY:
4728 case SORT_BINARY:
4729 partial = curvePartialByID(test, frags[0], frags[6], frags[8]);
4730 break;
4731 default:
4732 console.log("unknown REC_TYPE_SORT frag type: " + fragType);
4733 throw "stop execution";
4734 }
4735 var dx = boundsWidth(partial);
4736 var dy = boundsHeight(partial);
4737 minXY = Math.min(minXY, dx * dx + dy * dy);
4738 if (collect_bounds) {
4739 continue;
4740 }
4741 angles.push(tangent(partial));
4742 var from = frags[12];
4743 var to = frags[12];
4744 var sgn = frags[10];
4745 if (sgn < 0) {
4746 from -= frags[11];
4747 } else if (sgn > 0) {
4748 to -= frags[11];
4749 }
4750 windFrom.push(from + (unsortable ? "!" : ""));
4751 windTo.push(to + (unsortable ? "!" : ""));
4752 opp.push(fragType == SORT_BINARY);
4753 if (draw_sort == 1) {
Cary Clarkff114282016-12-14 11:56:16 -05004754 drawVisibleOrder(partial, frags[12]);
caryclarkdac1d172014-06-17 05:15:38 -07004755 } else {
Cary Clarkff114282016-12-14 11:56:16 -05004756 drawVisibleOrder(partial, (recordIndex / 2) + 1);
caryclarkdac1d172014-06-17 05:15:38 -07004757 }
4758 }
4759 var radius = Math.sqrt(minXY) / 2 * scale;
4760 radius = Math.min(50, radius);
4761 var scaledRadius = radius / scale;
4762 var centerX = partial[0];
4763 var centerY = partial[1];
4764 if (collect_bounds) {
4765 if (focus_enabled) {
4766 focusXmin = Math.min(focusXmin, centerX - scaledRadius);
4767 focusYmin = Math.min(focusYmin, centerY - scaledRadius);
4768 focusXmax = Math.max(focusXmax, centerX + scaledRadius);
4769 focusYmax = Math.max(focusYmax, centerY + scaledRadius);
4770 }
4771 break;
4772 }
4773 break;
4774 default:
4775 break;
4776 }
4777 }
4778 if (collect_bounds) {
4779 return;
4780 }
4781 if (draw_log && logStart >= 0) {
4782 ctx.font = "normal 10px Arial";
4783 ctx.textAlign = "left";
4784 ctx.beginPath();
4785 var top = screenHeight - 20 - (logRange + 2) * 10;
4786 ctx.rect(50, top, screenWidth - 100, (logRange + 2) * 10);
4787 ctx.fillStyle = "white";
4788 ctx.fill();
4789 ctx.fillStyle = "rgba(0,0,0, 0.5)";
4790 if (logStart > 0) {
4791 ctx.fillText(lines[logStart - 1], 50, top + 8);
4792 }
4793 ctx.fillStyle = "black";
4794 for (var idx = 0; idx < logRange; ++idx) {
4795 ctx.fillText(lines[logStart + idx], 50, top + 18 + 10 * idx);
4796 }
4797 ctx.fillStyle = "rgba(0,0,0, 0.5)";
4798 if (logStart + logRange < lines.length) {
4799 ctx.fillText(lines[logStart + logRange], 50, top + 18 + 10 * logRange);
4800 }
4801 }
4802 if (draw_legend) {
4803 var pos = 0;
caryclark624637c2015-05-11 07:21:27 -07004804 var drawSomething = draw_add | draw_active | draw_angle | draw_coincidence | draw_sort | draw_mark;
caryclarkdac1d172014-06-17 05:15:38 -07004805 // drawBox(pos++, "yellow", "black", opLetter, true, '');
4806 drawBox(pos++, "rgba(0,0,255, 0.3)", "black", draw_intersection > 1 ? sectCount : sectMax2, draw_intersection, intersectionKey);
4807 drawBox(pos++, "rgba(0,0,255, 0.3)", "black", draw_add ? addCount : addMax, draw_add, addKey);
4808 drawBox(pos++, "rgba(0,0,255, 0.3)", "black", draw_active ? activeCount : activeMax, draw_active, activeKey);
4809 drawBox(pos++, "rgba(127,127,0, 0.3)", "black", draw_angle ? angleCount : angleMax, draw_angle, angleKey);
caryclark624637c2015-05-11 07:21:27 -07004810 drawBox(pos++, "rgba(127,127,0, 0.3)", "black", draw_coincidence ? coinCount : coinMax, draw_coincidence, coincidenceKey);
caryclarkdac1d172014-06-17 05:15:38 -07004811 drawBox(pos++, "rgba(127,127,0, 0.3)", "black", draw_op ? opCount : opMax, draw_op, opKey);
4812 drawBox(pos++, "rgba(127,127,0, 0.3)", "black", draw_sort ? sortCount : sortMax, draw_sort, sortKey);
caryclark03b03ca2015-04-23 09:13:37 -07004813 drawBox(pos++, "rgba(127,127,0, 0.3)", "black", draw_top ? topCount : topMax, draw_top, topKey);
caryclarkdac1d172014-06-17 05:15:38 -07004814 drawBox(pos++, "rgba(127,0,127, 0.3)", "black", draw_mark ? markCount : markMax, draw_mark, markKey);
caryclark55888e42016-07-18 10:01:36 -07004815 drawBox(pos++, "black", "white",
caryclark26ad22a2015-10-16 09:03:38 -07004816 (new Array('P', 'P1', 'P2', 'P', 'p', 'p1', 'p2'))[draw_path], draw_path != 0, pathKey);
caryclarkdac1d172014-06-17 05:15:38 -07004817 drawBox(pos++, "rgba(0,63,0, 0.7)", "white",
4818 (new Array('Q', 'Q', 'C', 'QC', 'Qc', 'Cq'))[draw_computed],
4819 draw_computed != 0, computedKey);
4820 drawBox(pos++, "green", "black", step_limit, drawSomething, '');
4821 drawBox(pos++, "green", "black", stepMax, drawSomething, '');
4822 drawBox(pos++, "rgba(255,0,0, 0.6)", "black", lastIndex, drawSomething & draw_log, '');
4823 drawBox(pos++, "rgba(255,0,0, 0.6)", "black", test.length - 1, drawSomething & draw_log, '');
4824 if (curve_t) {
4825 drawCurveTControl();
4826 }
4827 ctx.font = "normal 20px Arial";
4828 ctx.fillStyle = "rgba(0,0,0, 0.3)";
4829 ctx.textAlign = "right";
4830 ctx.fillText(scale.toFixed(decimal_places) + 'x' , screenWidth - 10, screenHeight - 5);
4831 }
4832 if (draw_hints) {
4833 ctx.font = "normal 10px Arial";
4834 ctx.fillStyle = "rgba(0,0,0, 0.5)";
4835 ctx.textAlign = "right";
4836 var y = 4;
4837 ctx.fillText("control lines : " + controlLinesKey, ctx.screenWidthwidth - 10, pos * 50 + y++ * 10);
4838 ctx.fillText("curve t : " + curveTKey, screenWidth - 10, pos * 50 + y++ * 10);
4839 ctx.fillText("deriviatives : " + deriviativesKey, screenWidth - 10, pos * 50 + y++ * 10);
4840 ctx.fillText("intersect t : " + intersectTKey, screenWidth - 10, pos * 50 + y++ * 10);
caryclarkdac1d172014-06-17 05:15:38 -07004841 ctx.fillText("log : " + logKey, screenWidth - 10, pos * 50 + y++ * 10);
4842 ctx.fillText("log curve : " + logCurvesKey, screenWidth - 10, pos * 50 + y++ * 10);
4843 ctx.fillText("mid point : " + midpointKey, screenWidth - 10, pos * 50 + y++ * 10);
4844 ctx.fillText("points : " + ptsKey, screenWidth - 10, pos * 50 + y++ * 10);
4845 ctx.fillText("sequence : " + sequenceKey, screenWidth - 10, pos * 50 + y++ * 10);
4846 ctx.fillText("xy : " + xyKey, screenWidth - 10, pos * 50 + y++ * 10);
4847 }
4848}
4849
4850function drawBox(y, backC, foreC, str, enable, label) {
4851 ctx.beginPath();
4852 ctx.fillStyle = backC;
4853 ctx.rect(screenWidth - 40, y * 50 + 10, 40, 30);
4854 ctx.fill();
4855 ctx.font = "normal 16px Arial";
4856 ctx.fillStyle = foreC;
4857 ctx.textAlign = "center";
4858 ctx.fillText(str, screenWidth - 20, y * 50 + 32);
4859 if (!enable) {
4860 ctx.fillStyle = "rgba(255,255,255, 0.5)";
4861 ctx.fill();
4862 }
4863 if (label != '') {
4864 ctx.font = "normal 9px Arial";
4865 ctx.fillStyle = "black";
4866 ctx.fillText(label, screenWidth - 47, y * 50 + 40);
4867 }
4868}
4869
4870function drawCurveTControl() {
4871 ctx.lineWidth = 2;
4872 ctx.strokeStyle = "rgba(0,0,0, 0.3)";
4873 ctx.beginPath();
4874 ctx.rect(screenWidth - 80, 40, 28, screenHeight - 80);
4875 ctx.stroke();
4876 var ty = 40 + curveT * (screenHeight - 80);
4877 ctx.beginPath();
4878 ctx.moveTo(screenWidth - 80, ty);
4879 ctx.lineTo(screenWidth - 85, ty - 5);
4880 ctx.lineTo(screenWidth - 85, ty + 5);
4881 ctx.lineTo(screenWidth - 80, ty);
4882 ctx.fillStyle = "rgba(0,0,0, 0.6)";
4883 ctx.fill();
4884 var num = curveT.toFixed(decimal_places);
4885 ctx.font = "normal 10px Arial";
4886 ctx.textAlign = "left";
4887 ctx.fillText(num, screenWidth - 78, ty);
4888}
4889
4890function ptInTControl() {
4891 var e = window.event;
caryclark55888e42016-07-18 10:01:36 -07004892 var tgt = e.target || e.srcElement;
caryclarkdac1d172014-06-17 05:15:38 -07004893 var left = tgt.offsetLeft;
4894 var top = tgt.offsetTop;
4895 var x = (e.clientX - left);
4896 var y = (e.clientY - top);
4897 if (x < screenWidth - 80 || x > screenWidth - 50) {
4898 return false;
4899 }
4900 if (y < 40 || y > screenHeight - 80) {
4901 return false;
4902 }
4903 curveT = (y - 40) / (screenHeight - 120);
4904 if (curveT < 0 || curveT > 1) {
4905 throw "stop execution";
4906 }
4907 return true;
4908}
4909
4910function drawTop() {
4911 if (tests[testIndex] == null) {
4912 var str = testDivs[testIndex].textContent;
4913 parse_all(str);
4914 var title = testDivs[testIndex].id.toString();
4915 testTitles[testIndex] = title;
4916 }
4917 init(tests[testIndex]);
4918 redraw();
4919}
4920
4921function redraw() {
4922 if (focus_on_selection) {
4923 collect_bounds = true;
4924 draw(tests[testIndex], testLines[testIndex], testTitles[testIndex]);
4925 collect_bounds = false;
4926 if (focusXmin < focusXmax && focusYmin < focusYmax) {
4927 setScale(focusXmin, focusXmax, focusYmin, focusYmax);
4928 }
4929 }
4930 ctx.beginPath();
4931 ctx.fillStyle = "white";
4932 ctx.rect(0, 0, screenWidth, screenHeight);
4933 ctx.fill();
4934 draw(tests[testIndex], testLines[testIndex], testTitles[testIndex]);
4935}
4936
4937function dumpCurvePartial(test, id, t0, t1) {
4938 var curve = curveByID(test, id);
4939 var name = ["line", "quad", "cubic"][curve.length / 2 - 2];
4940 console.log("id=" + id + " " + name + "=" + curveToString(curve)
4941 + " t0=" + t0 + " t1=" + t1
4942 + " partial=" + curveToString(curvePartialByID(test, id, t0, t1)));
4943}
4944
4945function dumpAngleTest(test, id, t0, t1) {
4946 var curve = curveByID(test, id);
caryclark55888e42016-07-18 10:01:36 -07004947 console.log(" { {" + curveToString(curve) + "}, "
caryclarkdac1d172014-06-17 05:15:38 -07004948 + curve.length / 2 + ", " + t0 + ", " + t1 + ", {} }, //");
4949}
4950
4951function dumpLogToConsole() {
4952 if (logStart < 0) {
4953 return;
4954 }
4955 var test = tests[testIndex];
4956 var recType = REC_TYPE_UNKNOWN;
4957 var records;
4958 for (var index = 0; index < test.length; index += 3) {
4959 var lastLineNo = test[index + 1];
4960 if (lastLineNo >= logStart && lastLineNo < logStart + logRange) {
4961 recType = test[index];
4962 records = test[index + 2];
4963 break;
4964 }
4965 }
4966 if (recType == REC_TYPE_UNKNOWN) {
4967 return;
4968 }
4969 var lines = testLines[testIndex];
4970 for (var idx = 0; idx < logRange; ++idx) {
4971 var line = lines[logStart + idx];
4972 console.log(line);
4973 for (var recordIndex = 0; recordIndex < records.length; recordIndex += 2) {
4974 var fragType = records[recordIndex];
4975 var frags = records[recordIndex + 1];
4976 if (recType == REC_TYPE_ANGLE && fragType == ANGLE_AFTER) {
caryclarkdac1d172014-06-17 05:15:38 -07004977 dumpCurvePartial(test, frags[0], frags[4], frags[5]);
4978 dumpCurvePartial(test, frags[6], frags[10], frags[11]);
4979 dumpCurvePartial(test, frags[12], frags[16], frags[17]);
4980 console.log("\nstatic IntersectData intersectDataSet[] = { //");
4981 dumpAngleTest(test, frags[0], frags[4], frags[5]);
4982 dumpAngleTest(test, frags[6], frags[10], frags[11]);
4983 dumpAngleTest(test, frags[12], frags[16], frags[17]);
4984 console.log("}; //");
4985 }
4986 }
4987 }
4988}
4989
4990var activeKey = 'a';
4991var pathKey = 'b';
4992var pathBackKey = 'B';
4993var centerKey = 'c';
caryclark624637c2015-05-11 07:21:27 -07004994var coincidenceKey = 'C';
caryclarkdac1d172014-06-17 05:15:38 -07004995var addKey = 'd';
4996var deriviativesKey = 'f';
4997var angleKey = 'g';
4998var angleBackKey = 'G';
caryclarkdac1d172014-06-17 05:15:38 -07004999var intersectionKey = 'i';
5000var intersectionBackKey = 'I';
5001var sequenceKey = 'j';
5002var midpointKey = 'k';
5003var logKey = 'l';
5004var logToConsoleKey = 'L';
5005var markKey = 'm';
5006var sortKey = 'o';
5007var opKey = 'p';
5008var opBackKey = 'P';
5009var computedKey = 'q';
5010var computedBackKey = 'Q';
Cary Clarkff114282016-12-14 11:56:16 -05005011var directionKey = 'r';
caryclarkdac1d172014-06-17 05:15:38 -07005012var stepKey = 's';
5013var stepBackKey = 'S';
5014var intersectTKey = 't';
caryclark03b03ca2015-04-23 09:13:37 -07005015var topKey = 'T';
caryclarkdac1d172014-06-17 05:15:38 -07005016var curveTKey = 'u';
5017var controlLinesBackKey = 'V';
5018var controlLinesKey = 'v';
5019var ptsKey = 'x';
5020var xyKey = 'y';
5021var logCurvesKey = 'z';
5022var focusKey = '`';
5023var idKey = '.';
5024var retinaKey = '\\';
5025
5026function doKeyPress(evt) {
5027 var char = String.fromCharCode(evt.charCode);
5028 var focusWasOn = false;
5029 switch (char) {
5030 case '0':
5031 case '1':
5032 case '2':
5033 case '3':
5034 case '4':
5035 case '5':
5036 case '6':
5037 case '7':
5038 case '8':
5039 case '9':
5040 decimal_places = char - '0';
5041 redraw();
5042 break;
5043 case activeKey:
5044 draw_active ^= true;
caryclark55888e42016-07-18 10:01:36 -07005045 redraw();
caryclarkdac1d172014-06-17 05:15:38 -07005046 break;
5047 case addKey:
5048 draw_add ^= true;
caryclark55888e42016-07-18 10:01:36 -07005049 redraw();
caryclarkdac1d172014-06-17 05:15:38 -07005050 break;
5051 case angleKey:
caryclark54359292015-03-26 07:52:43 -07005052 draw_angle = (draw_angle + 1) % 4;
caryclarkdac1d172014-06-17 05:15:38 -07005053 redraw();
5054 break;
5055 case angleBackKey:
5056 draw_angle = (draw_angle + 2) % 3;
5057 redraw();
5058 break;
5059 case centerKey:
5060 setScale(xmin, xmax, ymin, ymax);
caryclark55888e42016-07-18 10:01:36 -07005061 redraw();
caryclarkdac1d172014-06-17 05:15:38 -07005062 break;
caryclark624637c2015-05-11 07:21:27 -07005063 case coincidenceKey:
5064 draw_coincidence ^= true;
5065 redraw();
5066 break;
caryclarkdac1d172014-06-17 05:15:38 -07005067 case controlLinesBackKey:
5068 control_lines = (control_lines + 3) % 4;
caryclark55888e42016-07-18 10:01:36 -07005069 redraw();
caryclarkdac1d172014-06-17 05:15:38 -07005070 break;
5071 case controlLinesKey:
5072 control_lines = (control_lines + 1) % 4;
caryclark55888e42016-07-18 10:01:36 -07005073 redraw();
caryclarkdac1d172014-06-17 05:15:38 -07005074 break;
5075 case computedBackKey:
5076 draw_computed = (draw_computed + 5) % 6;
caryclark55888e42016-07-18 10:01:36 -07005077 redraw();
caryclarkdac1d172014-06-17 05:15:38 -07005078 break;
5079 case computedKey:
5080 draw_computed = (draw_computed + 1) % 6;
caryclark55888e42016-07-18 10:01:36 -07005081 redraw();
caryclarkdac1d172014-06-17 05:15:38 -07005082 break;
5083 case curveTKey:
5084 curve_t ^= true;
5085 if (curve_t) {
5086 draw_legend = true;
5087 }
5088 redraw();
5089 break;
5090 case deriviativesKey:
5091 draw_deriviatives = (draw_deriviatives + 1) % 3;
5092 redraw();
5093 break;
Cary Clarkff114282016-12-14 11:56:16 -05005094 case directionKey:
5095 draw_direction ^= true;
5096 redraw();
5097 break;
caryclarkdac1d172014-06-17 05:15:38 -07005098 case focusKey:
5099 focus_on_selection ^= true;
5100 setScale(xmin, xmax, ymin, ymax);
5101 redraw();
5102 break;
caryclarkdac1d172014-06-17 05:15:38 -07005103 case idKey:
5104 draw_id ^= true;
5105 redraw();
5106 break;
5107 case intersectionBackKey:
5108 draw_intersection = (draw_intersection + 3) % 4;
caryclark55888e42016-07-18 10:01:36 -07005109 redraw();
caryclarkdac1d172014-06-17 05:15:38 -07005110 break;
5111 case intersectionKey:
5112 draw_intersection = (draw_intersection + 1) % 4;
caryclark55888e42016-07-18 10:01:36 -07005113 redraw();
caryclarkdac1d172014-06-17 05:15:38 -07005114 break;
5115 case intersectTKey:
5116 draw_intersectT ^= true;
5117 redraw();
5118 break;
5119 case logCurvesKey:
5120 logCurves(tests[testIndex]);
5121 break;
5122 case logKey:
5123 draw_log ^= true;
5124 redraw();
5125 break;
5126 case logToConsoleKey:
5127 if (draw_log) {
5128 dumpLogToConsole();
5129 }
5130 break;
5131 case markKey:
5132 draw_mark ^= true;
5133 redraw();
5134 break;
5135 case midpointKey:
5136 draw_midpoint ^= true;
5137 redraw();
5138 break;
5139 case opKey:
5140 draw_op = (draw_op + 1) % 3;
5141 redraw();
5142 break;
5143 case opBackKey:
5144 draw_op = (draw_op + 2) % 3;
5145 redraw();
5146 break;
5147 case pathKey:
caryclark26ad22a2015-10-16 09:03:38 -07005148 draw_path = (draw_path + 1) % (4 + (hasAlignedPath ? 3 : 0));
caryclark55888e42016-07-18 10:01:36 -07005149 redraw();
caryclarkdac1d172014-06-17 05:15:38 -07005150 break;
5151 case pathBackKey:
caryclark26ad22a2015-10-16 09:03:38 -07005152 draw_path = (draw_path + 3 + (hasAlignedPath ? 3 : 0)) % (4 + (hasAlignedPath ? 3 : 0));
caryclark55888e42016-07-18 10:01:36 -07005153 redraw();
caryclarkdac1d172014-06-17 05:15:38 -07005154 break;
5155 case ptsKey:
5156 pt_labels = (pt_labels + 1) % 3;
5157 redraw();
5158 break;
5159 case retinaKey:
5160 retina_scale ^= true;
5161 drawTop();
5162 break;
5163 case sequenceKey:
5164 draw_sequence ^= true;
5165 redraw();
5166 break;
5167 case sortKey:
5168 draw_sort = (draw_sort + 1) % 3;
5169 drawTop();
5170 break;
5171 case stepKey:
5172 step_limit++;
5173 if (step_limit > stepMax) {
5174 step_limit = stepMax;
5175 }
5176 redraw();
5177 break;
5178 case stepBackKey:
5179 step_limit--;
5180 if (step_limit < 0) {
5181 step_limit = 0;
5182 }
5183 redraw();
5184 break;
caryclark03b03ca2015-04-23 09:13:37 -07005185 case topKey:
5186 draw_top ^= true;
5187 redraw();
5188 break;
caryclarkdac1d172014-06-17 05:15:38 -07005189 case xyKey:
5190 debug_xy = (debug_xy + 1) % 3;
5191 redraw();
5192 break;
5193 case '-':
5194 focusWasOn = focus_on_selection;
5195 if (focusWasOn) {
5196 focus_on_selection = false;
5197 scale /= 1.2;
5198 } else {
5199 scale /= 2;
5200 calcLeftTop();
5201 }
5202 redraw();
5203 focus_on_selection = focusWasOn;
5204 break;
5205 case '=':
5206 case '+':
5207 focusWasOn = focus_on_selection;
5208 if (focusWasOn) {
5209 focus_on_selection = false;
5210 scale *= 1.2;
5211 } else {
5212 scale *= 2;
5213 calcLeftTop();
5214 }
5215 redraw();
5216 focus_on_selection = focusWasOn;
5217 break;
5218 case '?':
5219 draw_hints ^= true;
5220 if (draw_hints && !draw_legend) {
5221 draw_legend = true;
5222 }
5223 redraw();
5224 break;
5225 case '/':
5226 draw_legend ^= true;
5227 redraw();
5228 break;
5229 }
5230}
5231
5232function doKeyDown(evt) {
5233 var char = evt.keyCode;
5234 var preventDefault = false;
5235 switch (char) {
5236 case 37: // left arrow
5237 if (evt.shiftKey) {
5238 testIndex -= 9;
5239 }
5240 if (--testIndex < 0)
5241 testIndex = tests.length - 1;
5242 drawTop();
5243 preventDefault = true;
5244 break;
5245 case 39: // right arrow
5246 if (evt.shiftKey) {
5247 testIndex += 9;
5248 }
5249 if (++testIndex >= tests.length)
5250 testIndex = 0;
5251 drawTop();
5252 preventDefault = true;
5253 break;
5254 }
5255 if (preventDefault) {
5256 evt.preventDefault();
5257 return false;
5258 }
5259 return true;
5260}
5261
5262(function() {
5263 var hidden = "hidden";
5264
5265 // Standards:
5266 if (hidden in document)
5267 document.addEventListener("visibilitychange", onchange);
5268 else if ((hidden = "mozHidden") in document)
5269 document.addEventListener("mozvisibilitychange", onchange);
5270 else if ((hidden = "webkitHidden") in document)
5271 document.addEventListener("webkitvisibilitychange", onchange);
5272 else if ((hidden = "msHidden") in document)
5273 document.addEventListener("msvisibilitychange", onchange);
5274 // IE 9 and lower:
5275 else if ('onfocusin' in document)
5276 document.onfocusin = document.onfocusout = onchange;
5277 // All others:
5278 else
caryclark55888e42016-07-18 10:01:36 -07005279 window.onpageshow = window.onpagehide
caryclarkdac1d172014-06-17 05:15:38 -07005280 = window.onfocus = window.onblur = onchange;
5281
5282 function onchange (evt) {
5283 var v = 'visible', h = 'hidden',
caryclark55888e42016-07-18 10:01:36 -07005284 evtMap = {
5285 focus:v, focusin:v, pageshow:v, blur:h, focusout:h, pagehide:h
caryclarkdac1d172014-06-17 05:15:38 -07005286 };
5287
5288 evt = evt || window.event;
5289 if (evt.type in evtMap)
5290 document.body.className = evtMap[evt.type];
caryclark55888e42016-07-18 10:01:36 -07005291 else
caryclarkdac1d172014-06-17 05:15:38 -07005292 document.body.className = this[hidden] ? "hidden" : "visible";
5293 }
5294})();
5295
5296function calcXY() {
5297 var e = window.event;
caryclark55888e42016-07-18 10:01:36 -07005298 var tgt = e.target || e.srcElement;
caryclarkdac1d172014-06-17 05:15:38 -07005299 var left = tgt.offsetLeft;
5300 var top = tgt.offsetTop;
5301 mouseX = (e.clientX - left) / scale + srcLeft;
5302 mouseY = (e.clientY - top) / scale + srcTop;
5303}
5304
5305function calcLeftTop() {
5306 srcLeft = mouseX - screenWidth / 2 / scale;
5307 srcTop = mouseY - screenHeight / 2 / scale;
5308}
5309
5310var disableClick = false;
5311
5312function handleMouseClick() {
5313 if (disableClick) {
5314 return;
5315 }
5316 if (!curve_t || !ptInTControl()) {
5317 calcXY();
5318 calcLeftTop();
5319 }
5320 redraw();
5321// if (!curve_t || !ptInTControl()) {
5322// mouseX = screenWidth / 2 / scale + srcLeft;
5323// mouseY = screenHeight / 2 / scale + srcTop;
5324// }
5325}
5326
5327function handleMouseOver() {
5328 calcXY();
5329 if (debug_xy != 2) {
5330 return;
5331 }
5332 var num = mouseX.toFixed(decimal_places) + ", " + mouseY.toFixed(decimal_places);
5333 ctx.beginPath();
5334 ctx.rect(300,100,num.length * 6,10);
5335 ctx.fillStyle="white";
5336 ctx.fill();
5337 ctx.font = "normal 10px Arial";
5338 ctx.fillStyle="black";
5339 ctx.textAlign = "left";
5340 ctx.fillText(num, 300, 108);
5341}
5342
5343function start() {
5344 for (var i = 0; i < testDivs.length; ++i) {
5345 tests[i] = null;
5346 }
5347 testIndex = 0;
5348 drawTop();
5349 window.addEventListener('keypress', doKeyPress, true);
5350 window.addEventListener('keydown', doKeyDown, true);
5351 window.onresize = function() {
5352 drawTop();
5353 }
5354 /*
5355 window.onpagehide = function() {
5356 disableClick = true;
5357 }
5358 */
5359 window.onpageshow = function () {
5360 disableClick = false;
5361 }
5362}
5363
5364</script>
5365</head>
5366
5367<body onLoad="start();">
5368<canvas id="canvas" width="750" height="500"
5369 onmousemove="handleMouseOver()"
5370 onclick="handleMouseClick()"
5371 ></canvas >
5372</body>
5373</html>