blob: b666079431a9c6533b7c692fb207f77e4850ce35 [file] [log] [blame]
caryclarkdac1d172014-06-17 05:15:38 -07001<html>
2<head>
3<div height="0" hidden="true">
caryclarkdac1d172014-06-17 05:15:38 -07004
caryclark6c3b9cd2016-09-26 05:36:58 -07005Skia UnitTests: --match PathOpsSimplify$ --resourcePath resources/ SK_DEBUG
6
7<div id="tiger8b_h_1">
8seg=1 {{{{494.348663f, 224.583771f}, {494.365143f, 224.633194f}, {494.376404f, 224.684067f}}}, 0.998645842f}
9seg=2 {{{494.376404f, 224.684067f}, {494.005188f, 224.055679f}, {494.019165f, 224.046982f}}}
10seg=3 {{{494.019165f, 224.046982f}, {494.029083f, 224.040833f}, {494.232056f, 224.345306f}}}
11seg=4 {{{494.232056f, 224.345306f}, {494.273193f, 224.406982f}, {494.30481f, 224.474213f}}}
12seg=5 {{{494.30481f, 224.474213f}, {494.334961f, 224.538284f}, {494.355774f, 224.605927f}}}
13seg=6 {{{494.355774f, 224.605927f}, {494.363708f, 224.631714f}, {494.370148f, 224.657471f}}}
14seg=7 {{{494.370148f, 224.657471f}, {494.375275f, 224.679031f}}}
15seg=8 {{{494.375275f, 224.679031f}, {494.376038f, 224.682449f}}}
16seg=9 {{{494.376038f, 224.682449f}, {494.376221f, 224.683273f}}}
17seg=10 {{{494.376221f, 224.683273f}, {494.376007f, 224.682281f}}}
18seg=11 {{{494.376007f, 224.682281f}, {494.375671f, 224.680908f}}}
19seg=12 {{{494.375671f, 224.680908f}, {494.375397f, 224.67955f}, {494.376495f, 224.683868f}}}
20seg=13 {{{494.376495f, 224.683868f}, {494.634338f, 225.414886f}, {494.895874f, 225.840698f}}}
21seg=14 {{{494.895874f, 225.840698f}, {495.737305f, 227.210602f}, {497.243317f, 227.90419f}}}
22seg=15 {{{497.243317f, 227.90419f}, {502.478027f, 230.314941f}, {513.407471f, 224.129684f}}}
23seg=16 {{{513.407471f, 224.129684f}, {513.900024f, 224.999985f}}}
24seg=17 {{{513.900024f, 224.999985f}, {494.348663f, 224.583771f}}}
25debugShowConicQuadIntersection wtTs[0]=1 {{{{494.348663,224.583771}, {494.365143,224.633194}, {494.376404,224.684067}}}, 0.998645842} {{494.376404,224.684067}} wnTs[0]=0 {{{494.376404,224.684067}, {494.005188,224.055679}, {494.019165,224.046982}}}
26debugShowConicQuadIntersection no intersect {{{{494.348663,224.583771}, {494.365143,224.633194}, {494.376404,224.684067}}}, 0.998645842} {{{494.30481,224.474213}, {494.334961,224.538284}, {494.355774,224.605927}}}
27debugShowConicQuadIntersection no intersect {{{{494.348663,224.583771}, {494.365143,224.633194}, {494.376404,224.684067}}}, 0.998645842} {{{494.355774,224.605927}, {494.363708,224.631714}, {494.370148,224.657471}}}
28debugShowConicLineIntersection wtTs[0]=0.737524311 {{{{494.348663,224.583771}, {494.365143,224.633194}, {494.376404,224.684067}}}, 0.998645842} {{494.370148,224.657471}} wtTs[1]=0.95041534 {{494.375275,224.679031}} wnTs[0]=0 {{{494.370148,224.657471}, {494.375275,224.679031}}} wnTs[1]=1
29addT insert t=0.737524311 segID=1 spanID=35
30addT insert t=0.95041534 segID=1 spanID=36
31debugShowConicLineIntersection wtTs[0]=0.950415458 {{{{494.348663,224.583771}, {494.365143,224.633194}, {494.376404,224.684067}}}, 0.998645842} {{494.375275,224.679031}} wtTs[1]=0.984064836 {{494.376038,224.682449}} wnTs[0]=0 {{{494.375275,224.679031}, {494.376038,224.682449}}} wnTs[1]=1
32addT insert t=0.984064836 segID=1 spanID=37
33debugShowConicLineIntersection wtTs[0]=0.984064896 {{{{494.348663,224.583771}, {494.365143,224.633194}, {494.376404,224.684067}}}, 0.998645842} {{494.376038,224.682449}} wtTs[1]=0.992175496 {{494.376221,224.683273}} wnTs[0]=0 {{{494.376038,224.682449}, {494.376221,224.683273}}} wnTs[1]=1
34addT insert t=0.992175496 segID=1 spanID=38
35debugShowConicLineIntersection wtTs[0]=0.982426882 {{{{494.348663,224.583771}, {494.365143,224.633194}, {494.376404,224.684067}}}, 0.998645842} {{494.376007,224.682281}} wtTs[1]=0.992175933 {{494.376221,224.683273}} wnTs[0]=1 {{{494.376221,224.683273}, {494.376007,224.682281}}} wnTs[1]=0
36debugShowConicLineIntersection wtTs[0]=0.968840505 {{{{494.348663,224.583771}, {494.365143,224.633194}, {494.376404,224.684067}}}, 0.998645842} {{494.375671,224.680908}} wtTs[1]=0.982426925 {{494.376007,224.682281}} wnTs[0]=1 {{{494.376007,224.682281}, {494.375671,224.680908}}} wnTs[1]=0
37addT insert t=0.968840505 segID=1 spanID=39
38debugShowConicQuadIntersection wtTs[0]=0.966796875 {{{{494.348663,224.583771}, {494.365143,224.633194}, {494.376404,224.684067}}}, 0.998645842} {{494.375641,224.680695}} wtTs[1]=1 {{494.376404,224.684067}} wnTs[0]=0.375 {{{494.375671,224.680908}, {494.375397,224.67955}, {494.376495,224.683868}}} wnTs[1]=1
39debugShowConicQuadIntersection no intersect {{{{494.348663,224.583771}, {494.365143,224.633194}, {494.376404,224.684067}}}, 0.998645842} {{{494.376495,224.683868}, {494.634338,225.414886}, {494.895874,225.840698}}}
40debugShowConicLineIntersection wtTs[0]=0 {{{{494.348663,224.583771}, {494.365143,224.633194}, {494.376404,224.684067}}}, 0.998645842} {{494.348663,224.583771}} wnTs[0]=1 {{{513.900024,224.999985}, {494.348663,224.583771}}}
41debugShowQuadIntersection wtTs[0]=1 {{{494.376404,224.684067}, {494.005188,224.055679}, {494.019165,224.046982}}} {{494.019165,224.046982}} wnTs[0]=0 {{{494.019165,224.046982}, {494.029083,224.040833}, {494.232056,224.345306}}}
42debugShowQuadIntersection no intersect {{{494.376404,224.684067}, {494.005188,224.055679}, {494.019165,224.046982}}} {{{494.232056,224.345306}, {494.273193,224.406982}, {494.30481,224.474213}}}
43debugShowQuadIntersection no intersect {{{494.376404,224.684067}, {494.005188,224.055679}, {494.019165,224.046982}}} {{{494.30481,224.474213}, {494.334961,224.538284}, {494.355774,224.605927}}}
44debugShowQuadIntersection no intersect {{{494.376404,224.684067}, {494.005188,224.055679}, {494.019165,224.046982}}} {{{494.355774,224.605927}, {494.363708,224.631714}, {494.370148,224.657471}}}
45debugShowQuadLineIntersection no intersect {{{494.376404,224.684067}, {494.005188,224.055679}, {494.019165,224.046982}}} {{{494.370148,224.657471}, {494.375275,224.679031}}}
46debugShowQuadLineIntersection no intersect {{{494.376404,224.684067}, {494.005188,224.055679}, {494.019165,224.046982}}} {{{494.375275,224.679031}, {494.376038,224.682449}}}
47debugShowQuadLineIntersection wtTs[0]=0.000586871356 {{{494.376404,224.684067}, {494.005188,224.055679}, {494.019165,224.046982}}} {{494.376221,224.683273}} wnTs[0]=1 {{{494.376038,224.682449}, {494.376221,224.683273}}}
48addT insert t=0.000586871356 segID=2 spanID=40
49debugShowQuadLineIntersection wtTs[0]=0.000588090628 {{{494.376404,224.684067}, {494.005188,224.055679}, {494.019165,224.046982}}} {{494.376221,224.683273}} wnTs[0]=0 {{{494.376221,224.683273}, {494.376007,224.682281}}}
50debugShowQuadLineIntersection no intersect {{{494.376404,224.684067}, {494.005188,224.055679}, {494.019165,224.046982}}} {{{494.376007,224.682281}, {494.375671,224.680908}}}
51debugShowQuadIntersection no intersect {{{494.376404,224.684067}, {494.005188,224.055679}, {494.019165,224.046982}}} {{{494.375671,224.680908}, {494.375397,224.67955}, {494.376495,224.683868}}}
52debugShowQuadIntersection no intersect {{{494.376404,224.684067}, {494.005188,224.055679}, {494.019165,224.046982}}} {{{494.376495,224.683868}, {494.634338,225.414886}, {494.895874,225.840698}}}
53debugShowQuadLineIntersection no intersect {{{494.376404,224.684067}, {494.005188,224.055679}, {494.019165,224.046982}}} {{{513.900024,224.999985}, {494.348663,224.583771}}}
54debugShowQuadIntersection wtTs[0]=1 {{{494.019165,224.046982}, {494.029083,224.040833}, {494.232056,224.345306}}} {{494.232056,224.345306}} wnTs[0]=0 {{{494.232056,224.345306}, {494.273193,224.406982}, {494.30481,224.474213}}}
55debugShowQuadIntersection wtTs[0]=1 {{{494.232056,224.345306}, {494.273193,224.406982}, {494.30481,224.474213}}} {{494.30481,224.474213}} wnTs[0]=0 {{{494.30481,224.474213}, {494.334961,224.538284}, {494.355774,224.605927}}}
56debugShowQuadIntersection wtTs[0]=1 {{{494.30481,224.474213}, {494.334961,224.538284}, {494.355774,224.605927}}} {{494.355774,224.605927}} wnTs[0]=0 {{{494.355774,224.605927}, {494.363708,224.631714}, {494.370148,224.657471}}}
57debugShowQuadLineIntersection wtTs[0]=0.835281662 {{{494.30481,224.474213}, {494.334961,224.538284}, {494.355774,224.605927}}} {{494.348663,224.583771}} wnTs[0]=1 {{{513.900024,224.999985}, {494.348663,224.583771}}}
58addT insert t=0.835281662 segID=5 spanID=41
59debugShowQuadLineIntersection wtTs[0]=1 {{{494.355774,224.605927}, {494.363708,224.631714}, {494.370148,224.657471}}} {{494.370148,224.657471}} wnTs[0]=0 {{{494.370148,224.657471}, {494.375275,224.679031}}}
60debugShowQuadLineIntersection no intersect {{{494.355774,224.605927}, {494.363708,224.631714}, {494.370148,224.657471}}} {{{513.900024,224.999985}, {494.348663,224.583771}}}
61debugShowLineIntersection wtTs[0]=1 {{{494.370148,224.657471}, {494.375275,224.679031}}} {{494.375275,224.679031}} wnTs[0]=0 {{{494.375275,224.679031}, {494.376038,224.682449}}}
62debugShowLineIntersection no intersect {{{494.370148,224.657471}, {494.375275,224.679031}}} {{{513.900024,224.999985}, {494.348663,224.583771}}}
63debugShowLineIntersection wtTs[0]=1 {{{494.375275,224.679031}, {494.376038,224.682449}}} {{494.376038,224.682449}} wnTs[0]=0 {{{494.376038,224.682449}, {494.376221,224.683273}}}
64debugShowLineIntersection wtTs[0]=0.951325082 {{{494.375275,224.679031}, {494.376038,224.682449}}} {{494.376007,224.682281}} wtTs[1]=1 {{494.376038,224.682449}} wnTs[0]=1 {{{494.376221,224.683273}, {494.376007,224.682281}}} wnTs[1]=0.831938475
65debugShowLineIntersection wtTs[0]=0.547725719 {{{494.375275,224.679031}, {494.376038,224.682449}}} {{494.375671,224.680908}} wtTs[1]=0.951325082 {{494.376007,224.682281}} wnTs[0]=1 {{{494.376007,224.682281}, {494.375671,224.680908}}} wnTs[1]=0
66addT insert t=0.547725719 segID=8 spanID=42
67debugShowQuadLineIntersection wtTs[0]=0 {{{494.375671,224.680908}, {494.375397,224.67955}, {494.376495,224.683868}}} {{494.375671,224.680908}} wtTs[1]=0.809546276 {{494.376038,224.682449}} wnTs[0]=0.547726 {{{494.375275,224.679031}, {494.376038,224.682449}}} wnTs[1]=1
68addT insert t=0.809546276 segID=12 spanID=43
69debugShowLineIntersection no intersect {{{494.375275,224.679031}, {494.376038,224.682449}}} {{{513.900024,224.999985}, {494.348663,224.583771}}}
70debugShowLineIntersection wtTs[0]=0 {{{494.376038,224.682449}, {494.376221,224.683273}}} {{494.376038,224.682449}} wtTs[1]=1 {{494.376221,224.683273}} wnTs[0]=0.831938 {{{494.376221,224.683273}, {494.376007,224.682281}}} wnTs[1]=0
71debugShowLineIntersection no intersect {{{494.376038,224.682449}, {494.376221,224.683273}}} {{{494.376007,224.682281}, {494.375671,224.680908}}}
72debugShowQuadLineIntersection wtTs[0]=0.809559187 {{{494.375671,224.680908}, {494.375397,224.67955}, {494.376495,224.683868}}} {{494.376038,224.682449}} wtTs[1]=0.924341302 {{494.376221,224.683273}} wnTs[0]=0 {{{494.376038,224.682449}, {494.376221,224.683273}}} wnTs[1]=1
73addT insert t=0.924341302 segID=12 spanID=44
74debugShowLineIntersection no intersect {{{494.376038,224.682449}, {494.376221,224.683273}}} {{{513.900024,224.999985}, {494.348663,224.583771}}}
75debugShowLineIntersection wtTs[0]=1 {{{494.376221,224.683273}, {494.376007,224.682281}}} {{494.376007,224.682281}} wnTs[0]=0 {{{494.376007,224.682281}, {494.375671,224.680908}}}
76debugShowQuadLineIntersection wtTs[0]=0.783538464 {{{494.375671,224.680908}, {494.375397,224.67955}, {494.376495,224.683868}}} {{494.376007,224.682281}} wtTs[1]=0.924438181 {{494.376221,224.683273}} wnTs[0]=1 {{{494.376221,224.683273}, {494.376007,224.682281}}} wnTs[1]=0
77debugShowLineIntersection no intersect {{{494.376221,224.683273}, {494.376007,224.682281}}} {{{513.900024,224.999985}, {494.348663,224.583771}}}
78debugShowQuadLineIntersection wtTs[0]=0 {{{494.375671,224.680908}, {494.375397,224.67955}, {494.376495,224.683868}}} {{494.375671,224.680908}} wtTs[1]=0.783197805 {{494.376007,224.682281}} wnTs[0]=1 {{{494.376007,224.682281}, {494.375671,224.680908}}} wnTs[1]=0
79debugShowLineIntersection no intersect {{{494.376007,224.682281}, {494.375671,224.680908}}} {{{513.900024,224.999985}, {494.348663,224.583771}}}
80debugShowQuadIntersection wtTs[0]=1 {{{494.375671,224.680908}, {494.375397,224.67955}, {494.376495,224.683868}}} {{494.376495,224.683868}} wnTs[0]=0 {{{494.376495,224.683868}, {494.634338,225.414886}, {494.895874,225.840698}}}
81debugShowQuadLineIntersection no intersect {{{494.375671,224.680908}, {494.375397,224.67955}, {494.376495,224.683868}}} {{{513.900024,224.999985}, {494.348663,224.583771}}}
82debugShowQuadIntersection wtTs[0]=1 {{{494.376495,224.683868}, {494.634338,225.414886}, {494.895874,225.840698}}} {{494.895874,225.840698}} wnTs[0]=0 {{{494.895874,225.840698}, {495.737305,227.210602}, {497.243317,227.90419}}}
83debugShowQuadLineIntersection no intersect {{{494.376495,224.683868}, {494.634338,225.414886}, {494.895874,225.840698}}} {{{513.900024,224.999985}, {494.348663,224.583771}}}
84debugShowQuadIntersection wtTs[0]=1 {{{494.895874,225.840698}, {495.737305,227.210602}, {497.243317,227.90419}}} {{497.243317,227.90419}} wnTs[0]=0 {{{497.243317,227.90419}, {502.478027,230.314941}, {513.407471,224.129684}}}
85debugShowQuadLineIntersection wtTs[0]=1 {{{497.243317,227.90419}, {502.478027,230.314941}, {513.407471,224.129684}}} {{513.407471,224.129684}} wnTs[0]=0 {{{513.407471,224.129684}, {513.900024,224.999985}}}
86debugShowQuadLineIntersection wtTs[0]=0.929653854 {{{497.243317,227.90419}, {502.478027,230.314941}, {513.407471,224.129684}}} {{511.897949,224.957367}} wnTs[0]=0.1024 {{{513.900024,224.999985}, {494.348663,224.583771}}}
87addT insert t=0.929653854 segID=15 spanID=45
88addT insert t=0.102400099 segID=17 spanID=46
89debugShowLineIntersection wtTs[0]=1 {{{513.407471,224.129684}, {513.900024,224.999985}}} {{513.900024,224.999985}} wnTs[0]=0 {{{513.900024,224.999985}, {494.348663,224.583771}}}
90--x--x---------xx-x--x------------x start
9100: coinSeg/Span/PtT=2/3/3 endSpan=40 oppSeg/Span/PtT=1/2/2 oppEndSpan=38 MissingCoin
9201: coinSeg/Span/PtT=12/44/44 endSpan=24 oppSeg/Span/PtT=2/40/40 oppEndSpan=3 MissingCoin
9302: coinSeg/Span/PtT=1/38/38 endSpan=2 oppSeg/Span/PtT=2/40/40 oppEndSpan=3 MissingCoin
9403: coinSeg/Span/PtT=12/23/23 endSpan=43 oppSeg/Span/PtT=11/22/22 oppEndSpan=21 MissingCoin
9504: coinSeg/Span/PtT=11/21/21 endSpan=22 oppSeg/Span/PtT=12/43/43 oppEndSpan=23 MissingCoin
9605: coinSeg/Span/PtT=2/3/3 endSpan=40 oppSeg/Span/PtT=12/24/24 oppEndSpan=44 MissingCoin
9706: coinSeg/Span/PtT=2/3/3 endSpan=40 oppSeg/Span/PtT=1/2/2 oppEndSpan=38 MissingCoin
9807: coinSeg/Span/PtT=12/44/44 endSpan=24 oppSeg/Span/PtT=2/40/40 oppEndSpan=3 MissingCoin
9908: coinSeg/Span/PtT=1/38/38 endSpan=2 oppSeg/Span/PtT=2/40/40 oppEndSpan=3 MissingCoin
10009: coinSeg/Span/PtT=12/23/23 endSpan=43 oppSeg/Span/PtT=11/22/22 oppEndSpan=21 MissingCoin
10110: coinSeg/Span/PtT=11/21/21 endSpan=22 oppSeg/Span/PtT=12/43/43 oppEndSpan=23 MissingCoin
10211: coinSeg/Span/PtT=2/3/3 endSpan=40 oppSeg/Span/PtT=12/24/24 oppEndSpan=44 MissingCoin
10312: segment=12 AddExpandedFail
10413: segment=12 startT=0 endT=0.809546 segment=11 oppStartT=1 oppEndT=0 AddMissingCoin
10514: segment=12 AddExpandedFail
10615: segment=12 startT=0 endT=0.809546 segment=11 oppStartT=1 oppEndT=0 AddMissingCoin
10716: seg/base=10/19 seg/base=12/43 MarkCoinStart
10817: seg/base=10/20 seg/base=12/44 MarkCoinEnd
10918: seg/base=9/17 seg/base=12/43 MarkCoinStart
11019: seg/base=9/18 seg/base=12/44 MarkCoinEnd
11120: seg/base=9/17 seg/base=10/19 MarkCoinStart
11221: seg/base=9/18 seg/base=10/20 MarkCoinEnd
11322: seg/base=8/42 seg/base=12/23 MarkCoinStart
11423: seg/base=8/16 seg/base=12/43 MarkCoinEnd
11524: seg/base=8/42 seg/base=11/21 MarkCoinStart
11625: seg/base=8/16 seg/base=11/22 MarkCoinEnd
11726: seg/base=12/23 seg/base=1/39 MarkCoinStart
11827: seg/base=12/24 seg/base=1/2 MarkCoinEnd
11928: seg/base=1/37 MarkCoinInsert
12029: seg/base=1/38 MarkCoinInsert
12130: seg/base=12/43 MarkCoinInsert
12231: seg/base=12/44 MarkCoinInsert
12332: seg/base=11/21 seg/base=1/39 MarkCoinStart
12433: seg/base=11/22 seg/base=1/37 MarkCoinEnd
12534: seg/base=10/19 seg/base=1/37 MarkCoinStart
12635: seg/base=10/20 seg/base=1/38 MarkCoinEnd
12736: seg/base=9/17 seg/base=1/37 MarkCoinStart
12837: seg/base=9/18 seg/base=1/38 MarkCoinEnd
12938: seg/base=8/15 seg/base=1/36 MarkCoinStart
13039: seg/base=8/16 seg/base=1/37 MarkCoinEnd
13140: seg/base=1/39 MarkCoinInsert
13241: seg/base=8/42 MarkCoinInsert
13342: seg/base=7/13 seg/base=1/35 MarkCoinStart
13443: seg/base=7/14 seg/base=1/36 MarkCoinEnd
135active after start:
136debugShowActiveSpans id=1 (494.348663,224.583771 494.360813,224.620209 494.370148,224.657471 0.999263287f) t=0 tEnd=0.737524311 windSum=? windValue=1
137debugShowActiveSpans id=1 (494.370148,224.657471 494.372825,224.668224 494.375275,224.679031 0.999938607f) t=0.737524311 tEnd=0.95041534 windSum=? windValue=1
138debugShowActiveSpans id=1 (494.375275,224.679031 494.375488,224.679966 494.375702,224.680908 0.999999523f) t=0.95041534 tEnd=0.968840505 windSum=? windValue=1
139debugShowActiveSpans id=1 (494.375702,224.680908 494.375872,224.681675 494.376038,224.682449 0.999999702f) t=0.968840505 tEnd=0.984064836 windSum=? windValue=1
140debugShowActiveSpans id=1 (494.376038,224.682449 494.376136,224.68286 494.376221,224.683273 0.99999994f) t=0.984064836 tEnd=0.992175496 windSum=? windValue=1
141debugShowActiveSpans id=1 (494.376221,224.683273 494.376316,224.683669 494.376404,224.684067 0.99999994f) t=0.992175496 tEnd=1 windSum=? windValue=1
142debugShowActiveSpans id=2 (494.376404,224.684067 494.37619,224.6837 494.375977,224.683334) t=0 tEnd=0.000586871356 windSum=? windValue=1
143debugShowActiveSpans id=2 (494.375977,224.683334 494.0052,224.055672 494.019165,224.046982) t=0.000586871356 tEnd=1 windSum=? windValue=1
144debugShowActiveSpans id=3 (494.019165,224.046982 494.029083,224.040833 494.232056,224.345306) t=0 tEnd=1 windSum=? windValue=1
145debugShowActiveSpans id=4 (494.232056,224.345306 494.273193,224.406982 494.30481,224.474213) t=0 tEnd=1 windSum=? windValue=1
146debugShowActiveSpans id=5 (494.30481,224.474213 494.329991,224.527724 494.348663,224.58374) t=0 tEnd=0.835281662 windSum=? windValue=1
147debugShowActiveSpans id=5 (494.348663,224.58374 494.352356,224.594819 494.355774,224.605927) t=0.835281662 tEnd=1 windSum=? windValue=1
148debugShowActiveSpans id=6 (494.355774,224.605927 494.363708,224.631714 494.370148,224.657471) t=0 tEnd=1 windSum=? windValue=1
149debugShowActiveSpans id=7 (494.370148,224.657471 494.375275,224.679031) t=0 tEnd=1 windSum=? windValue=1
150debugShowActiveSpans id=8 (494.375275,224.679031 494.375702,224.680908) t=0 tEnd=0.547725719 windSum=? windValue=1
151debugShowActiveSpans id=8 (494.375702,224.680908 494.376038,224.682449) t=0.547725719 tEnd=1 windSum=? windValue=1
152debugShowActiveSpans id=9 (494.376038,224.682449 494.376221,224.683273) t=0 tEnd=1 windSum=? windValue=1
153debugShowActiveSpans id=10 (494.376221,224.683273 494.376007,224.682281) t=0 tEnd=1 windSum=? windValue=1
154debugShowActiveSpans id=11 (494.376007,224.682281 494.375671,224.680908) t=0 tEnd=1 windSum=? windValue=1
155debugShowActiveSpans id=12 (494.375671,224.680908 494.375445,224.679787 494.376129,224.682434) t=0 tEnd=0.809546276 windSum=? windValue=1
156debugShowActiveSpans id=12 (494.376129,224.682434 494.376227,224.682801 494.376343,224.683243) t=0.809546276 tEnd=0.924341302 windSum=? windValue=1
157debugShowActiveSpans id=12 (494.376343,224.683243 494.376415,224.683539 494.376495,224.683868) t=0.924341302 tEnd=1 windSum=? windValue=1
158debugShowActiveSpans id=13 (494.376495,224.683868 494.634338,225.414886 494.895874,225.840698) t=0 tEnd=1 windSum=? windValue=1
159debugShowActiveSpans id=14 (494.895874,225.840698 495.737305,227.210602 497.243317,227.90419) t=0 tEnd=1 windSum=? windValue=1
160debugShowActiveSpans id=15 (497.243317,227.90419 502.109781,230.145352 511.897949,224.957367) t=0 tEnd=0.929653854 windSum=? windValue=1
161debugShowActiveSpans id=15 (511.897949,224.957367 512.63876,224.564718 513.407471,224.129684) t=0.929653854 tEnd=1 windSum=? windValue=1
162debugShowActiveSpans id=16 (513.407471,224.129684 513.900024,224.999985) t=0 tEnd=1 windSum=? windValue=1
163debugShowActiveSpans id=17 (513.900024,224.999985 511.897949,224.957367) t=0 tEnd=0.102400099 windSum=? windValue=1
164debugShowActiveSpans id=17 (511.897949,224.957367 494.348663,224.583771) t=0.102400099 tEnd=1 windSum=? windValue=1
165--x--x---------xx-x--x------------x addExpanded
16600: coinSeg/Span/PtT=2/3/3 endSpan=40 oppSeg/Span/PtT=1/2/2 oppEndSpan=38 MissingCoin
16701: coinSeg/Span/PtT=12/44/44 endSpan=24 oppSeg/Span/PtT=2/40/40 oppEndSpan=3 MissingCoin
16802: coinSeg/Span/PtT=1/38/38 endSpan=2 oppSeg/Span/PtT=2/40/40 oppEndSpan=3 MissingCoin
16903: coinSeg/Span/PtT=12/23/23 endSpan=43 oppSeg/Span/PtT=11/22/22 oppEndSpan=21 MissingCoin
17004: coinSeg/Span/PtT=11/21/21 endSpan=22 oppSeg/Span/PtT=12/43/43 oppEndSpan=23 MissingCoin
17105: coinSeg/Span/PtT=2/3/3 endSpan=40 oppSeg/Span/PtT=12/24/24 oppEndSpan=44 MissingCoin
17206: coinSeg/Span/PtT=2/3/3 endSpan=40 oppSeg/Span/PtT=1/2/2 oppEndSpan=38 MissingCoin
17307: coinSeg/Span/PtT=12/44/44 endSpan=24 oppSeg/Span/PtT=2/40/40 oppEndSpan=3 MissingCoin
17408: coinSeg/Span/PtT=1/38/38 endSpan=2 oppSeg/Span/PtT=2/40/40 oppEndSpan=3 MissingCoin
17509: coinSeg/Span/PtT=12/23/23 endSpan=43 oppSeg/Span/PtT=11/22/22 oppEndSpan=21 MissingCoin
17610: coinSeg/Span/PtT=11/21/21 endSpan=22 oppSeg/Span/PtT=12/43/43 oppEndSpan=23 MissingCoin
17711: coinSeg/Span/PtT=2/3/3 endSpan=40 oppSeg/Span/PtT=12/24/24 oppEndSpan=44 MissingCoin
17812: segment=12 AddExpandedFail
17913: segment=12 startT=0 endT=0.809546 segment=11 oppStartT=1 oppEndT=0 AddMissingCoin
18014: segment=12 AddExpandedFail
18115: segment=12 startT=0 endT=0.809546 segment=11 oppStartT=1 oppEndT=0 AddMissingCoin
18216: seg/base=10/19 seg/base=12/43 MarkCoinStart
18317: seg/base=10/20 seg/base=12/44 MarkCoinEnd
18418: seg/base=9/17 seg/base=12/43 MarkCoinStart
18519: seg/base=9/18 seg/base=12/44 MarkCoinEnd
18620: seg/base=9/17 seg/base=10/19 MarkCoinStart
18721: seg/base=9/18 seg/base=10/20 MarkCoinEnd
18822: seg/base=8/42 seg/base=12/23 MarkCoinStart
18923: seg/base=8/16 seg/base=12/43 MarkCoinEnd
19024: seg/base=8/42 seg/base=11/21 MarkCoinStart
19125: seg/base=8/16 seg/base=11/22 MarkCoinEnd
19226: seg/base=12/23 seg/base=1/39 MarkCoinStart
19327: seg/base=12/24 seg/base=1/2 MarkCoinEnd
19428: seg/base=1/37 MarkCoinInsert
19529: seg/base=1/38 MarkCoinInsert
19630: seg/base=12/43 MarkCoinInsert
19731: seg/base=12/44 MarkCoinInsert
19832: seg/base=11/21 seg/base=1/39 MarkCoinStart
19933: seg/base=11/22 seg/base=1/37 MarkCoinEnd
20034: seg/base=10/19 seg/base=1/37 MarkCoinStart
20135: seg/base=10/20 seg/base=1/38 MarkCoinEnd
20236: seg/base=9/17 seg/base=1/37 MarkCoinStart
20337: seg/base=9/18 seg/base=1/38 MarkCoinEnd
20438: seg/base=8/15 seg/base=1/36 MarkCoinStart
20539: seg/base=8/16 seg/base=1/37 MarkCoinEnd
20640: seg/base=1/39 MarkCoinInsert
20741: seg/base=8/42 MarkCoinInsert
20842: seg/base=7/13 seg/base=1/35 MarkCoinStart
20943: seg/base=7/14 seg/base=1/36 MarkCoinEnd
210active after addExpanded:
211debugShowActiveSpans id=1 (494.348663,224.583771 494.360813,224.620209 494.370148,224.657471 0.999263287f) t=0 tEnd=0.737524311 windSum=? windValue=1
212debugShowActiveSpans id=1 (494.370148,224.657471 494.372825,224.668224 494.375275,224.679031 0.999938607f) t=0.737524311 tEnd=0.95041534 windSum=? windValue=1
213debugShowActiveSpans id=1 (494.375275,224.679031 494.375488,224.679966 494.375702,224.680908 0.999999523f) t=0.95041534 tEnd=0.968840505 windSum=? windValue=1
214debugShowActiveSpans id=1 (494.375702,224.680908 494.375872,224.681675 494.376038,224.682449 0.999999702f) t=0.968840505 tEnd=0.984064836 windSum=? windValue=1
215debugShowActiveSpans id=1 (494.376038,224.682449 494.376136,224.68286 494.376221,224.683273 0.99999994f) t=0.984064836 tEnd=0.992175496 windSum=? windValue=1
216debugShowActiveSpans id=1 (494.376221,224.683273 494.376316,224.683669 494.376404,224.684067 0.99999994f) t=0.992175496 tEnd=1 windSum=? windValue=1
217debugShowActiveSpans id=2 (494.376404,224.684067 494.37619,224.6837 494.375977,224.683334) t=0 tEnd=0.000586871356 windSum=? windValue=1
218debugShowActiveSpans id=2 (494.375977,224.683334 494.0052,224.055672 494.019165,224.046982) t=0.000586871356 tEnd=1 windSum=? windValue=1
219debugShowActiveSpans id=3 (494.019165,224.046982 494.029083,224.040833 494.232056,224.345306) t=0 tEnd=1 windSum=? windValue=1
220debugShowActiveSpans id=4 (494.232056,224.345306 494.273193,224.406982 494.30481,224.474213) t=0 tEnd=1 windSum=? windValue=1
221debugShowActiveSpans id=5 (494.30481,224.474213 494.329991,224.527724 494.348663,224.58374) t=0 tEnd=0.835281662 windSum=? windValue=1
222debugShowActiveSpans id=5 (494.348663,224.58374 494.352356,224.594819 494.355774,224.605927) t=0.835281662 tEnd=1 windSum=? windValue=1
223debugShowActiveSpans id=6 (494.355774,224.605927 494.363708,224.631714 494.370148,224.657471) t=0 tEnd=1 windSum=? windValue=1
224debugShowActiveSpans id=7 (494.370148,224.657471 494.375275,224.679031) t=0 tEnd=1 windSum=? windValue=1
225debugShowActiveSpans id=8 (494.375275,224.679031 494.375702,224.680908) t=0 tEnd=0.547725719 windSum=? windValue=1
226debugShowActiveSpans id=8 (494.375702,224.680908 494.376038,224.682449) t=0.547725719 tEnd=1 windSum=? windValue=1
227debugShowActiveSpans id=9 (494.376038,224.682449 494.376221,224.683273) t=0 tEnd=1 windSum=? windValue=1
228debugShowActiveSpans id=10 (494.376221,224.683273 494.376007,224.682281) t=0 tEnd=1 windSum=? windValue=1
229debugShowActiveSpans id=11 (494.376007,224.682281 494.375671,224.680908) t=0 tEnd=1 windSum=? windValue=1
230debugShowActiveSpans id=12 (494.375671,224.680908 494.375445,224.679787 494.376129,224.682434) t=0 tEnd=0.809546276 windSum=? windValue=1
231debugShowActiveSpans id=12 (494.376129,224.682434 494.376227,224.682801 494.376343,224.683243) t=0.809546276 tEnd=0.924341302 windSum=? windValue=1
232debugShowActiveSpans id=12 (494.376343,224.683243 494.376415,224.683539 494.376495,224.683868) t=0.924341302 tEnd=1 windSum=? windValue=1
233debugShowActiveSpans id=13 (494.376495,224.683868 494.634338,225.414886 494.895874,225.840698) t=0 tEnd=1 windSum=? windValue=1
234debugShowActiveSpans id=14 (494.895874,225.840698 495.737305,227.210602 497.243317,227.90419) t=0 tEnd=1 windSum=? windValue=1
235debugShowActiveSpans id=15 (497.243317,227.90419 502.109781,230.145352 511.897949,224.957367) t=0 tEnd=0.929653854 windSum=? windValue=1
236debugShowActiveSpans id=15 (511.897949,224.957367 512.63876,224.564718 513.407471,224.129684) t=0.929653854 tEnd=1 windSum=? windValue=1
237debugShowActiveSpans id=16 (513.407471,224.129684 513.900024,224.999985) t=0 tEnd=1 windSum=? windValue=1
238debugShowActiveSpans id=17 (513.900024,224.999985 511.897949,224.957367) t=0 tEnd=0.102400099 windSum=? windValue=1
239debugShowActiveSpans id=17 (511.897949,224.957367 494.348663,224.583771) t=0.102400099 tEnd=1 windSum=? windValue=1
240--x--x---------xx-x--x------------x moveMultiples
24100: coinSeg/Span/PtT=2/3/3 endSpan=40 oppSeg/Span/PtT=1/2/2 oppEndSpan=38 MissingCoin
24201: coinSeg/Span/PtT=12/44/44 endSpan=24 oppSeg/Span/PtT=2/40/40 oppEndSpan=3 MissingCoin
24302: coinSeg/Span/PtT=1/38/38 endSpan=2 oppSeg/Span/PtT=2/40/40 oppEndSpan=3 MissingCoin
24403: coinSeg/Span/PtT=12/23/23 endSpan=43 oppSeg/Span/PtT=11/22/22 oppEndSpan=21 MissingCoin
24504: coinSeg/Span/PtT=11/21/21 endSpan=22 oppSeg/Span/PtT=12/43/43 oppEndSpan=23 MissingCoin
24605: coinSeg/Span/PtT=2/3/3 endSpan=40 oppSeg/Span/PtT=12/24/24 oppEndSpan=44 MissingCoin
24706: coinSeg/Span/PtT=2/3/3 endSpan=40 oppSeg/Span/PtT=1/2/2 oppEndSpan=38 MissingCoin
24807: coinSeg/Span/PtT=12/44/44 endSpan=24 oppSeg/Span/PtT=2/40/40 oppEndSpan=3 MissingCoin
24908: coinSeg/Span/PtT=1/38/38 endSpan=2 oppSeg/Span/PtT=2/40/40 oppEndSpan=3 MissingCoin
25009: coinSeg/Span/PtT=12/23/23 endSpan=43 oppSeg/Span/PtT=11/22/22 oppEndSpan=21 MissingCoin
25110: coinSeg/Span/PtT=11/21/21 endSpan=22 oppSeg/Span/PtT=12/43/43 oppEndSpan=23 MissingCoin
25211: coinSeg/Span/PtT=2/3/3 endSpan=40 oppSeg/Span/PtT=12/24/24 oppEndSpan=44 MissingCoin
25312: segment=12 AddExpandedFail
25413: segment=12 startT=0 endT=0.809546 segment=11 oppStartT=1 oppEndT=0 AddMissingCoin
25514: segment=12 AddExpandedFail
25615: segment=12 startT=0 endT=0.809546 segment=11 oppStartT=1 oppEndT=0 AddMissingCoin
25716: seg/base=10/19 seg/base=12/43 MarkCoinStart
25817: seg/base=10/20 seg/base=12/44 MarkCoinEnd
25918: seg/base=9/17 seg/base=12/43 MarkCoinStart
26019: seg/base=9/18 seg/base=12/44 MarkCoinEnd
26120: seg/base=9/17 seg/base=10/19 MarkCoinStart
26221: seg/base=9/18 seg/base=10/20 MarkCoinEnd
26322: seg/base=8/42 seg/base=12/23 MarkCoinStart
26423: seg/base=8/16 seg/base=12/43 MarkCoinEnd
26524: seg/base=8/42 seg/base=11/21 MarkCoinStart
26625: seg/base=8/16 seg/base=11/22 MarkCoinEnd
26726: seg/base=12/23 seg/base=1/39 MarkCoinStart
26827: seg/base=12/24 seg/base=1/2 MarkCoinEnd
26928: seg/base=1/37 MarkCoinInsert
27029: seg/base=1/38 MarkCoinInsert
27130: seg/base=12/43 MarkCoinInsert
27231: seg/base=12/44 MarkCoinInsert
27332: seg/base=11/21 seg/base=1/39 MarkCoinStart
27433: seg/base=11/22 seg/base=1/37 MarkCoinEnd
27534: seg/base=10/19 seg/base=1/37 MarkCoinStart
27635: seg/base=10/20 seg/base=1/38 MarkCoinEnd
27736: seg/base=9/17 seg/base=1/37 MarkCoinStart
27837: seg/base=9/18 seg/base=1/38 MarkCoinEnd
27938: seg/base=8/15 seg/base=1/36 MarkCoinStart
28039: seg/base=8/16 seg/base=1/37 MarkCoinEnd
28140: seg/base=1/39 MarkCoinInsert
28241: seg/base=8/42 MarkCoinInsert
28342: seg/base=7/13 seg/base=1/35 MarkCoinStart
28443: seg/base=7/14 seg/base=1/36 MarkCoinEnd
285active after moveMultiples:
286debugShowActiveSpans id=1 (494.348663,224.583771 494.360813,224.620209 494.370148,224.657471 0.999263287f) t=0 tEnd=0.737524311 windSum=? windValue=1
287debugShowActiveSpans id=1 (494.370148,224.657471 494.372825,224.668224 494.375275,224.679031 0.999938607f) t=0.737524311 tEnd=0.95041534 windSum=? windValue=1
288debugShowActiveSpans id=1 (494.375275,224.679031 494.375488,224.679966 494.375702,224.680908 0.999999523f) t=0.95041534 tEnd=0.968840505 windSum=? windValue=1
289debugShowActiveSpans id=1 (494.375702,224.680908 494.375872,224.681675 494.376038,224.682449 0.999999702f) t=0.968840505 tEnd=0.984064836 windSum=? windValue=1
290debugShowActiveSpans id=1 (494.376038,224.682449 494.376136,224.68286 494.376221,224.683273 0.99999994f) t=0.984064836 tEnd=0.992175496 windSum=? windValue=1
291debugShowActiveSpans id=1 (494.376221,224.683273 494.376316,224.683669 494.376404,224.684067 0.99999994f) t=0.992175496 tEnd=1 windSum=? windValue=1
292debugShowActiveSpans id=2 (494.376404,224.684067 494.37619,224.6837 494.375977,224.683334) t=0 tEnd=0.000586871356 windSum=? windValue=1
293debugShowActiveSpans id=2 (494.375977,224.683334 494.0052,224.055672 494.019165,224.046982) t=0.000586871356 tEnd=1 windSum=? windValue=1
294debugShowActiveSpans id=3 (494.019165,224.046982 494.029083,224.040833 494.232056,224.345306) t=0 tEnd=1 windSum=? windValue=1
295debugShowActiveSpans id=4 (494.232056,224.345306 494.273193,224.406982 494.30481,224.474213) t=0 tEnd=1 windSum=? windValue=1
296debugShowActiveSpans id=5 (494.30481,224.474213 494.329991,224.527724 494.348663,224.58374) t=0 tEnd=0.835281662 windSum=? windValue=1
297debugShowActiveSpans id=5 (494.348663,224.58374 494.352356,224.594819 494.355774,224.605927) t=0.835281662 tEnd=1 windSum=? windValue=1
298debugShowActiveSpans id=6 (494.355774,224.605927 494.363708,224.631714 494.370148,224.657471) t=0 tEnd=1 windSum=? windValue=1
299debugShowActiveSpans id=7 (494.370148,224.657471 494.375275,224.679031) t=0 tEnd=1 windSum=? windValue=1
300debugShowActiveSpans id=8 (494.375275,224.679031 494.375702,224.680908) t=0 tEnd=0.547725719 windSum=? windValue=1
301debugShowActiveSpans id=8 (494.375702,224.680908 494.376038,224.682449) t=0.547725719 tEnd=1 windSum=? windValue=1
302debugShowActiveSpans id=9 (494.376038,224.682449 494.376221,224.683273) t=0 tEnd=1 windSum=? windValue=1
303debugShowActiveSpans id=10 (494.376221,224.683273 494.376007,224.682281) t=0 tEnd=1 windSum=? windValue=1
304debugShowActiveSpans id=11 (494.376007,224.682281 494.375671,224.680908) t=0 tEnd=1 windSum=? windValue=1
305debugShowActiveSpans id=12 (494.375671,224.680908 494.375445,224.679787 494.376129,224.682434) t=0 tEnd=0.809546276 windSum=? windValue=1
306debugShowActiveSpans id=12 (494.376129,224.682434 494.376227,224.682801 494.376343,224.683243) t=0.809546276 tEnd=0.924341302 windSum=? windValue=1
307debugShowActiveSpans id=12 (494.376343,224.683243 494.376415,224.683539 494.376495,224.683868) t=0.924341302 tEnd=1 windSum=? windValue=1
308debugShowActiveSpans id=13 (494.376495,224.683868 494.634338,225.414886 494.895874,225.840698) t=0 tEnd=1 windSum=? windValue=1
309debugShowActiveSpans id=14 (494.895874,225.840698 495.737305,227.210602 497.243317,227.90419) t=0 tEnd=1 windSum=? windValue=1
310debugShowActiveSpans id=15 (497.243317,227.90419 502.109781,230.145352 511.897949,224.957367) t=0 tEnd=0.929653854 windSum=? windValue=1
311debugShowActiveSpans id=15 (511.897949,224.957367 512.63876,224.564718 513.407471,224.129684) t=0.929653854 tEnd=1 windSum=? windValue=1
312debugShowActiveSpans id=16 (513.407471,224.129684 513.900024,224.999985) t=0 tEnd=1 windSum=? windValue=1
313debugShowActiveSpans id=17 (513.900024,224.999985 511.897949,224.957367) t=0 tEnd=0.102400099 windSum=? windValue=1
314debugShowActiveSpans id=17 (511.897949,224.957367 494.348663,224.583771) t=0.102400099 tEnd=1 windSum=? windValue=1
315--x--x---------xx-x--x------------x moveNearby
31600: coinSeg/Span/PtT=2/3/3 endSpan=40 oppSeg/Span/PtT=1/2/2 oppEndSpan=38 MissingCoin
31701: coinSeg/Span/PtT=12/44/44 endSpan=24 oppSeg/Span/PtT=2/40/40 oppEndSpan=3 MissingCoin
31802: coinSeg/Span/PtT=1/38/38 endSpan=2 oppSeg/Span/PtT=2/40/40 oppEndSpan=3 MissingCoin
31903: coinSeg/Span/PtT=12/23/23 endSpan=43 oppSeg/Span/PtT=11/22/22 oppEndSpan=21 MissingCoin
32004: coinSeg/Span/PtT=11/21/21 endSpan=22 oppSeg/Span/PtT=12/43/43 oppEndSpan=23 MissingCoin
32105: coinSeg/Span/PtT=2/3/3 endSpan=40 oppSeg/Span/PtT=12/24/24 oppEndSpan=44 MissingCoin
32206: coinSeg/Span/PtT=2/3/3 endSpan=40 oppSeg/Span/PtT=1/2/2 oppEndSpan=38 MissingCoin
32307: coinSeg/Span/PtT=12/44/44 endSpan=24 oppSeg/Span/PtT=2/40/40 oppEndSpan=3 MissingCoin
32408: coinSeg/Span/PtT=1/38/38 endSpan=2 oppSeg/Span/PtT=2/40/40 oppEndSpan=3 MissingCoin
32509: coinSeg/Span/PtT=12/23/23 endSpan=43 oppSeg/Span/PtT=11/22/22 oppEndSpan=21 MissingCoin
32610: coinSeg/Span/PtT=11/21/21 endSpan=22 oppSeg/Span/PtT=12/43/43 oppEndSpan=23 MissingCoin
32711: coinSeg/Span/PtT=2/3/3 endSpan=40 oppSeg/Span/PtT=12/24/24 oppEndSpan=44 MissingCoin
32812: segment=12 AddExpandedFail
32913: segment=12 startT=0 endT=0.809546 segment=11 oppStartT=1 oppEndT=0 AddMissingCoin
33014: segment=12 AddExpandedFail
33115: segment=12 startT=0 endT=0.809546 segment=11 oppStartT=1 oppEndT=0 AddMissingCoin
33216: seg/base=10/19 seg/base=12/43 MarkCoinStart
33317: seg/base=10/20 seg/base=12/44 MarkCoinEnd
33418: seg/base=9/17 seg/base=12/43 MarkCoinStart
33519: seg/base=9/18 seg/base=12/44 MarkCoinEnd
33620: seg/base=9/17 seg/base=10/19 MarkCoinStart
33721: seg/base=9/18 seg/base=10/20 MarkCoinEnd
33822: seg/base=8/42 seg/base=12/23 MarkCoinStart
33923: seg/base=8/16 seg/base=12/43 MarkCoinEnd
34024: seg/base=8/42 seg/base=11/21 MarkCoinStart
34125: seg/base=8/16 seg/base=11/22 MarkCoinEnd
34226: seg/base=12/23 seg/base=1/39 MarkCoinStart
34327: seg/base=12/24 seg/base=1/2 MarkCoinEnd
34428: seg/base=1/37 MarkCoinInsert
34529: seg/base=1/38 MarkCoinInsert
34630: seg/base=12/43 MarkCoinInsert
34731: seg/base=12/44 MarkCoinInsert
34832: seg/base=11/21 seg/base=1/39 MarkCoinStart
34933: seg/base=11/22 seg/base=1/37 MarkCoinEnd
35034: seg/base=10/19 seg/base=1/37 MarkCoinStart
35135: seg/base=10/20 seg/base=1/38 MarkCoinEnd
35236: seg/base=9/17 seg/base=1/37 MarkCoinStart
35337: seg/base=9/18 seg/base=1/38 MarkCoinEnd
35438: seg/base=8/15 seg/base=1/36 MarkCoinStart
35539: seg/base=8/16 seg/base=1/37 MarkCoinEnd
35640: seg/base=1/39 MarkCoinInsert
35741: seg/base=8/42 MarkCoinInsert
35842: seg/base=7/13 seg/base=1/35 MarkCoinStart
35943: seg/base=7/14 seg/base=1/36 MarkCoinEnd
360active after moveNearby:
361debugShowActiveSpans id=1 (494.348663,224.583771 494.360813,224.620209 494.370148,224.657471 0.999263287f) t=0 tEnd=0.737524311 windSum=? windValue=1
362debugShowActiveSpans id=1 (494.370148,224.657471 494.372825,224.668224 494.375275,224.679031 0.999938607f) t=0.737524311 tEnd=0.95041534 windSum=? windValue=1
363debugShowActiveSpans id=1 (494.375275,224.679031 494.375488,224.679966 494.375702,224.680908 0.999999523f) t=0.95041534 tEnd=0.968840505 windSum=? windValue=1
364debugShowActiveSpans id=1 (494.375702,224.680908 494.375872,224.681675 494.376038,224.682449 0.999999702f) t=0.968840505 tEnd=0.984064836 windSum=? windValue=1
365debugShowActiveSpans id=1 (494.376038,224.682449 494.376136,224.68286 494.376221,224.683273 0.99999994f) t=0.984064836 tEnd=0.992175496 windSum=? windValue=1
366debugShowActiveSpans id=1 (494.376221,224.683273 494.376316,224.683669 494.376404,224.684067 0.99999994f) t=0.992175496 tEnd=1 windSum=? windValue=1
367debugShowActiveSpans id=2 (494.376404,224.684067 494.37619,224.6837 494.375977,224.683334) t=0 tEnd=0.000586871356 windSum=? windValue=1
368debugShowActiveSpans id=2 (494.375977,224.683334 494.0052,224.055672 494.019165,224.046982) t=0.000586871356 tEnd=1 windSum=? windValue=1
369debugShowActiveSpans id=3 (494.019165,224.046982 494.029083,224.040833 494.232056,224.345306) t=0 tEnd=1 windSum=? windValue=1
370debugShowActiveSpans id=4 (494.232056,224.345306 494.273193,224.406982 494.30481,224.474213) t=0 tEnd=1 windSum=? windValue=1
371debugShowActiveSpans id=5 (494.30481,224.474213 494.329991,224.527724 494.348663,224.58374) t=0 tEnd=0.835281662 windSum=? windValue=1
372debugShowActiveSpans id=5 (494.348663,224.58374 494.352356,224.594819 494.355774,224.605927) t=0.835281662 tEnd=1 windSum=? windValue=1
373debugShowActiveSpans id=6 (494.355774,224.605927 494.363708,224.631714 494.370148,224.657471) t=0 tEnd=1 windSum=? windValue=1
374debugShowActiveSpans id=7 (494.370148,224.657471 494.375275,224.679031) t=0 tEnd=1 windSum=? windValue=1
375debugShowActiveSpans id=8 (494.375275,224.679031 494.375702,224.680908) t=0 tEnd=0.547725719 windSum=? windValue=1
376debugShowActiveSpans id=8 (494.375702,224.680908 494.376038,224.682449) t=0.547725719 tEnd=1 windSum=? windValue=1
377debugShowActiveSpans id=9 (494.376038,224.682449 494.376221,224.683273) t=0 tEnd=1 windSum=? windValue=1
378debugShowActiveSpans id=10 (494.376221,224.683273 494.376007,224.682281) t=0 tEnd=1 windSum=? windValue=1
379debugShowActiveSpans id=11 (494.376007,224.682281 494.375671,224.680908) t=0 tEnd=1 windSum=? windValue=1
380debugShowActiveSpans id=12 (494.375671,224.680908 494.375445,224.679787 494.376129,224.682434) t=0 tEnd=0.809546276 windSum=? windValue=1
381debugShowActiveSpans id=12 (494.376129,224.682434 494.376227,224.682801 494.376343,224.683243) t=0.809546276 tEnd=0.924341302 windSum=? windValue=1
382debugShowActiveSpans id=12 (494.376343,224.683243 494.376415,224.683539 494.376495,224.683868) t=0.924341302 tEnd=1 windSum=? windValue=1
383debugShowActiveSpans id=13 (494.376495,224.683868 494.634338,225.414886 494.895874,225.840698) t=0 tEnd=1 windSum=? windValue=1
384debugShowActiveSpans id=14 (494.895874,225.840698 495.737305,227.210602 497.243317,227.90419) t=0 tEnd=1 windSum=? windValue=1
385debugShowActiveSpans id=15 (497.243317,227.90419 502.109781,230.145352 511.897949,224.957367) t=0 tEnd=0.929653854 windSum=? windValue=1
386debugShowActiveSpans id=15 (511.897949,224.957367 512.63876,224.564718 513.407471,224.129684) t=0.929653854 tEnd=1 windSum=? windValue=1
387debugShowActiveSpans id=16 (513.407471,224.129684 513.900024,224.999985) t=0 tEnd=1 windSum=? windValue=1
388debugShowActiveSpans id=17 (513.900024,224.999985 511.897949,224.957367) t=0 tEnd=0.102400099 windSum=? windValue=1
389debugShowActiveSpans id=17 (511.897949,224.957367 494.348663,224.583771) t=0.102400099 tEnd=1 windSum=? windValue=1
390--x--x---------xx-x--x------------x addEndMovedSpans
39100: coinSeg/Span/PtT=2/3/3 endSpan=40 oppSeg/Span/PtT=1/2/2 oppEndSpan=38 MissingCoin
39201: coinSeg/Span/PtT=12/44/44 endSpan=24 oppSeg/Span/PtT=2/40/40 oppEndSpan=3 MissingCoin
39302: coinSeg/Span/PtT=1/38/38 endSpan=2 oppSeg/Span/PtT=2/40/40 oppEndSpan=3 MissingCoin
39403: coinSeg/Span/PtT=12/23/23 endSpan=43 oppSeg/Span/PtT=11/22/22 oppEndSpan=21 MissingCoin
39504: coinSeg/Span/PtT=11/21/21 endSpan=22 oppSeg/Span/PtT=12/43/43 oppEndSpan=23 MissingCoin
39605: coinSeg/Span/PtT=2/3/3 endSpan=40 oppSeg/Span/PtT=12/24/24 oppEndSpan=44 MissingCoin
39706: coinSeg/Span/PtT=2/3/3 endSpan=40 oppSeg/Span/PtT=1/2/2 oppEndSpan=38 MissingCoin
39807: coinSeg/Span/PtT=12/44/44 endSpan=24 oppSeg/Span/PtT=2/40/40 oppEndSpan=3 MissingCoin
39908: coinSeg/Span/PtT=1/38/38 endSpan=2 oppSeg/Span/PtT=2/40/40 oppEndSpan=3 MissingCoin
40009: coinSeg/Span/PtT=12/23/23 endSpan=43 oppSeg/Span/PtT=11/22/22 oppEndSpan=21 MissingCoin
40110: coinSeg/Span/PtT=11/21/21 endSpan=22 oppSeg/Span/PtT=12/43/43 oppEndSpan=23 MissingCoin
40211: coinSeg/Span/PtT=2/3/3 endSpan=40 oppSeg/Span/PtT=12/24/24 oppEndSpan=44 MissingCoin
40312: segment=12 AddExpandedFail
40413: segment=12 startT=0 endT=0.809546 segment=11 oppStartT=1 oppEndT=0 AddMissingCoin
40514: segment=12 AddExpandedFail
40615: segment=12 startT=0 endT=0.809546 segment=11 oppStartT=1 oppEndT=0 AddMissingCoin
40716: seg/base=10/19 seg/base=12/43 MarkCoinStart
40817: seg/base=10/20 seg/base=12/44 MarkCoinEnd
40918: seg/base=9/17 seg/base=12/43 MarkCoinStart
41019: seg/base=9/18 seg/base=12/44 MarkCoinEnd
41120: seg/base=9/17 seg/base=10/19 MarkCoinStart
41221: seg/base=9/18 seg/base=10/20 MarkCoinEnd
41322: seg/base=8/42 seg/base=12/23 MarkCoinStart
41423: seg/base=8/16 seg/base=12/43 MarkCoinEnd
41524: seg/base=8/42 seg/base=11/21 MarkCoinStart
41625: seg/base=8/16 seg/base=11/22 MarkCoinEnd
41726: seg/base=12/23 seg/base=1/39 MarkCoinStart
41827: seg/base=12/24 seg/base=1/2 MarkCoinEnd
41928: seg/base=1/37 MarkCoinInsert
42029: seg/base=1/38 MarkCoinInsert
42130: seg/base=12/43 MarkCoinInsert
42231: seg/base=12/44 MarkCoinInsert
42332: seg/base=11/21 seg/base=1/39 MarkCoinStart
42433: seg/base=11/22 seg/base=1/37 MarkCoinEnd
42534: seg/base=10/19 seg/base=1/37 MarkCoinStart
42635: seg/base=10/20 seg/base=1/38 MarkCoinEnd
42736: seg/base=9/17 seg/base=1/37 MarkCoinStart
42837: seg/base=9/18 seg/base=1/38 MarkCoinEnd
42938: seg/base=8/15 seg/base=1/36 MarkCoinStart
43039: seg/base=8/16 seg/base=1/37 MarkCoinEnd
43140: seg/base=1/39 MarkCoinInsert
43241: seg/base=8/42 MarkCoinInsert
43342: seg/base=7/13 seg/base=1/35 MarkCoinStart
43443: seg/base=7/14 seg/base=1/36 MarkCoinEnd
435active after addEndMovedSpans:
436debugShowActiveSpans id=1 (494.348663,224.583771 494.360813,224.620209 494.370148,224.657471 0.999263287f) t=0 tEnd=0.737524311 windSum=? windValue=1
437debugShowActiveSpans id=1 (494.370148,224.657471 494.372825,224.668224 494.375275,224.679031 0.999938607f) t=0.737524311 tEnd=0.95041534 windSum=? windValue=1
438debugShowActiveSpans id=1 (494.375275,224.679031 494.375488,224.679966 494.375702,224.680908 0.999999523f) t=0.95041534 tEnd=0.968840505 windSum=? windValue=1
439debugShowActiveSpans id=1 (494.375702,224.680908 494.375872,224.681675 494.376038,224.682449 0.999999702f) t=0.968840505 tEnd=0.984064836 windSum=? windValue=1
440debugShowActiveSpans id=1 (494.376038,224.682449 494.376136,224.68286 494.376221,224.683273 0.99999994f) t=0.984064836 tEnd=0.992175496 windSum=? windValue=1
441debugShowActiveSpans id=1 (494.376221,224.683273 494.376316,224.683669 494.376404,224.684067 0.99999994f) t=0.992175496 tEnd=1 windSum=? windValue=1
442debugShowActiveSpans id=2 (494.376404,224.684067 494.37619,224.6837 494.375977,224.683334) t=0 tEnd=0.000586871356 windSum=? windValue=1
443debugShowActiveSpans id=2 (494.375977,224.683334 494.0052,224.055672 494.019165,224.046982) t=0.000586871356 tEnd=1 windSum=? windValue=1
444debugShowActiveSpans id=3 (494.019165,224.046982 494.029083,224.040833 494.232056,224.345306) t=0 tEnd=1 windSum=? windValue=1
445debugShowActiveSpans id=4 (494.232056,224.345306 494.273193,224.406982 494.30481,224.474213) t=0 tEnd=1 windSum=? windValue=1
446debugShowActiveSpans id=5 (494.30481,224.474213 494.329991,224.527724 494.348663,224.58374) t=0 tEnd=0.835281662 windSum=? windValue=1
447debugShowActiveSpans id=5 (494.348663,224.58374 494.352356,224.594819 494.355774,224.605927) t=0.835281662 tEnd=1 windSum=? windValue=1
448debugShowActiveSpans id=6 (494.355774,224.605927 494.363708,224.631714 494.370148,224.657471) t=0 tEnd=1 windSum=? windValue=1
449debugShowActiveSpans id=7 (494.370148,224.657471 494.375275,224.679031) t=0 tEnd=1 windSum=? windValue=1
450debugShowActiveSpans id=8 (494.375275,224.679031 494.375702,224.680908) t=0 tEnd=0.547725719 windSum=? windValue=1
451debugShowActiveSpans id=8 (494.375702,224.680908 494.376038,224.682449) t=0.547725719 tEnd=1 windSum=? windValue=1
452debugShowActiveSpans id=9 (494.376038,224.682449 494.376221,224.683273) t=0 tEnd=1 windSum=? windValue=1
453debugShowActiveSpans id=10 (494.376221,224.683273 494.376007,224.682281) t=0 tEnd=1 windSum=? windValue=1
454debugShowActiveSpans id=11 (494.376007,224.682281 494.375671,224.680908) t=0 tEnd=1 windSum=? windValue=1
455debugShowActiveSpans id=12 (494.375671,224.680908 494.375445,224.679787 494.376129,224.682434) t=0 tEnd=0.809546276 windSum=? windValue=1
456debugShowActiveSpans id=12 (494.376129,224.682434 494.376227,224.682801 494.376343,224.683243) t=0.809546276 tEnd=0.924341302 windSum=? windValue=1
457debugShowActiveSpans id=12 (494.376343,224.683243 494.376415,224.683539 494.376495,224.683868) t=0.924341302 tEnd=1 windSum=? windValue=1
458debugShowActiveSpans id=13 (494.376495,224.683868 494.634338,225.414886 494.895874,225.840698) t=0 tEnd=1 windSum=? windValue=1
459debugShowActiveSpans id=14 (494.895874,225.840698 495.737305,227.210602 497.243317,227.90419) t=0 tEnd=1 windSum=? windValue=1
460debugShowActiveSpans id=15 (497.243317,227.90419 502.109781,230.145352 511.897949,224.957367) t=0 tEnd=0.929653854 windSum=? windValue=1
461debugShowActiveSpans id=15 (511.897949,224.957367 512.63876,224.564718 513.407471,224.129684) t=0.929653854 tEnd=1 windSum=? windValue=1
462debugShowActiveSpans id=16 (513.407471,224.129684 513.900024,224.999985) t=0 tEnd=1 windSum=? windValue=1
463debugShowActiveSpans id=17 (513.900024,224.999985 511.897949,224.957367) t=0 tEnd=0.102400099 windSum=? windValue=1
464debugShowActiveSpans id=17 (511.897949,224.957367 494.348663,224.583771) t=0.102400099 tEnd=1 windSum=? windValue=1
465coinSpan - id=11 t=0 tEnd=1
466coinSpan + id=12 t=0.809546276 tEnd=0
467---------------xx-x--x------------- addMissing
46800: coinSeg/Span/PtT=2/3/3 endSpan=40 oppSeg/Span/PtT=1/2/2 oppEndSpan=38 MissingCoin
46901: coinSeg/Span/PtT=12/44/44 endSpan=24 oppSeg/Span/PtT=2/40/40 oppEndSpan=3 MissingCoin
47002: coinSeg/Span/PtT=1/38/38 endSpan=2 oppSeg/Span/PtT=2/40/40 oppEndSpan=3 MissingCoin
47103: coinSeg/Span/PtT=2/3/3 endSpan=40 oppSeg/Span/PtT=12/24/24 oppEndSpan=44 MissingCoin
47204: coinSeg/Span/PtT=2/3/3 endSpan=40 oppSeg/Span/PtT=1/2/2 oppEndSpan=38 MissingCoin
47305: coinSeg/Span/PtT=12/44/44 endSpan=24 oppSeg/Span/PtT=2/40/40 oppEndSpan=3 MissingCoin
47406: coinSeg/Span/PtT=1/38/38 endSpan=2 oppSeg/Span/PtT=2/40/40 oppEndSpan=3 MissingCoin
47507: coinSeg/Span/PtT=2/3/3 endSpan=40 oppSeg/Span/PtT=12/24/24 oppEndSpan=44 MissingCoin
47608: seg/base=11/21 seg/base=12/23 MarkCoinStart
47709: seg/base=11/22 seg/base=12/43 MarkCoinEnd
47810: seg/base=10/19 seg/base=12/43 MarkCoinStart
47911: seg/base=10/20 seg/base=12/44 MarkCoinEnd
48012: seg/base=9/17 seg/base=12/43 MarkCoinStart
48113: seg/base=9/18 seg/base=12/44 MarkCoinEnd
48214: seg/base=9/17 seg/base=10/19 MarkCoinStart
48315: seg/base=9/18 seg/base=10/20 MarkCoinEnd
48416: seg/base=8/42 seg/base=12/23 MarkCoinStart
48517: seg/base=8/16 seg/base=12/43 MarkCoinEnd
48618: seg/base=8/42 seg/base=11/21 MarkCoinStart
48719: seg/base=8/16 seg/base=11/22 MarkCoinEnd
48820: seg/base=12/23 seg/base=1/39 MarkCoinStart
48921: seg/base=12/24 seg/base=1/2 MarkCoinEnd
49022: seg/base=1/37 MarkCoinInsert
49123: seg/base=1/38 MarkCoinInsert
49224: seg/base=12/43 MarkCoinInsert
49325: seg/base=12/44 MarkCoinInsert
49426: seg/base=11/21 seg/base=1/39 MarkCoinStart
49527: seg/base=11/22 seg/base=1/37 MarkCoinEnd
49628: seg/base=10/19 seg/base=1/37 MarkCoinStart
49729: seg/base=10/20 seg/base=1/38 MarkCoinEnd
49830: seg/base=9/17 seg/base=1/37 MarkCoinStart
49931: seg/base=9/18 seg/base=1/38 MarkCoinEnd
50032: seg/base=8/15 seg/base=1/36 MarkCoinStart
50133: seg/base=8/16 seg/base=1/37 MarkCoinEnd
50234: seg/base=1/39 MarkCoinInsert
50335: seg/base=8/42 MarkCoinInsert
50436: seg/base=7/13 seg/base=1/35 MarkCoinStart
50537: seg/base=7/14 seg/base=1/36 MarkCoinEnd
506active after addMissing:
507debugShowActiveSpans id=1 (494.348663,224.583771 494.360813,224.620209 494.370148,224.657471 0.999263287f) t=0 tEnd=0.737524311 windSum=? windValue=1
508debugShowActiveSpans id=1 (494.370148,224.657471 494.372825,224.668224 494.375275,224.679031 0.999938607f) t=0.737524311 tEnd=0.95041534 windSum=? windValue=1
509debugShowActiveSpans id=1 (494.375275,224.679031 494.375488,224.679966 494.375702,224.680908 0.999999523f) t=0.95041534 tEnd=0.968840505 windSum=? windValue=1
510debugShowActiveSpans id=1 (494.375702,224.680908 494.375872,224.681675 494.376038,224.682449 0.999999702f) t=0.968840505 tEnd=0.984064836 windSum=? windValue=1
511debugShowActiveSpans id=1 (494.376038,224.682449 494.376136,224.68286 494.376221,224.683273 0.99999994f) t=0.984064836 tEnd=0.992175496 windSum=? windValue=1
512debugShowActiveSpans id=1 (494.376221,224.683273 494.376316,224.683669 494.376404,224.684067 0.99999994f) t=0.992175496 tEnd=1 windSum=? windValue=1
513debugShowActiveSpans id=2 (494.376404,224.684067 494.37619,224.6837 494.375977,224.683334) t=0 tEnd=0.000586871356 windSum=? windValue=1
514debugShowActiveSpans id=2 (494.375977,224.683334 494.0052,224.055672 494.019165,224.046982) t=0.000586871356 tEnd=1 windSum=? windValue=1
515debugShowActiveSpans id=3 (494.019165,224.046982 494.029083,224.040833 494.232056,224.345306) t=0 tEnd=1 windSum=? windValue=1
516debugShowActiveSpans id=4 (494.232056,224.345306 494.273193,224.406982 494.30481,224.474213) t=0 tEnd=1 windSum=? windValue=1
517debugShowActiveSpans id=5 (494.30481,224.474213 494.329991,224.527724 494.348663,224.58374) t=0 tEnd=0.835281662 windSum=? windValue=1
518debugShowActiveSpans id=5 (494.348663,224.58374 494.352356,224.594819 494.355774,224.605927) t=0.835281662 tEnd=1 windSum=? windValue=1
519debugShowActiveSpans id=6 (494.355774,224.605927 494.363708,224.631714 494.370148,224.657471) t=0 tEnd=1 windSum=? windValue=1
520debugShowActiveSpans id=7 (494.370148,224.657471 494.375275,224.679031) t=0 tEnd=1 windSum=? windValue=1
521debugShowActiveSpans id=8 (494.375275,224.679031 494.375702,224.680908) t=0 tEnd=0.547725719 windSum=? windValue=1
522debugShowActiveSpans id=8 (494.375702,224.680908 494.376038,224.682449) t=0.547725719 tEnd=1 windSum=? windValue=1
523debugShowActiveSpans id=9 (494.376038,224.682449 494.376221,224.683273) t=0 tEnd=1 windSum=? windValue=1
524debugShowActiveSpans id=10 (494.376221,224.683273 494.376007,224.682281) t=0 tEnd=1 windSum=? windValue=1
525debugShowActiveSpans id=11 (494.376007,224.682281 494.375671,224.680908) t=0 tEnd=1 windSum=? windValue=1
526debugShowActiveSpans id=12 (494.375671,224.680908 494.375445,224.679787 494.376129,224.682434) t=0 tEnd=0.809546276 windSum=? windValue=1
527debugShowActiveSpans id=12 (494.376129,224.682434 494.376227,224.682801 494.376343,224.683243) t=0.809546276 tEnd=0.924341302 windSum=? windValue=1
528debugShowActiveSpans id=12 (494.376343,224.683243 494.376415,224.683539 494.376495,224.683868) t=0.924341302 tEnd=1 windSum=? windValue=1
529debugShowActiveSpans id=13 (494.376495,224.683868 494.634338,225.414886 494.895874,225.840698) t=0 tEnd=1 windSum=? windValue=1
530debugShowActiveSpans id=14 (494.895874,225.840698 495.737305,227.210602 497.243317,227.90419) t=0 tEnd=1 windSum=? windValue=1
531debugShowActiveSpans id=15 (497.243317,227.90419 502.109781,230.145352 511.897949,224.957367) t=0 tEnd=0.929653854 windSum=? windValue=1
532debugShowActiveSpans id=15 (511.897949,224.957367 512.63876,224.564718 513.407471,224.129684) t=0.929653854 tEnd=1 windSum=? windValue=1
533debugShowActiveSpans id=16 (513.407471,224.129684 513.900024,224.999985) t=0 tEnd=1 windSum=? windValue=1
534debugShowActiveSpans id=17 (513.900024,224.999985 511.897949,224.957367) t=0 tEnd=0.102400099 windSum=? windValue=1
535debugShowActiveSpans id=17 (511.897949,224.957367 494.348663,224.583771) t=0.102400099 tEnd=1 windSum=? windValue=1
536---------------xx-x--x------------- moveNearby
53700: coinSeg/Span/PtT=2/3/3 endSpan=40 oppSeg/Span/PtT=1/2/2 oppEndSpan=38 MissingCoin
53801: coinSeg/Span/PtT=12/44/44 endSpan=24 oppSeg/Span/PtT=2/40/40 oppEndSpan=3 MissingCoin
53902: coinSeg/Span/PtT=1/38/38 endSpan=2 oppSeg/Span/PtT=2/40/40 oppEndSpan=3 MissingCoin
54003: coinSeg/Span/PtT=2/3/3 endSpan=40 oppSeg/Span/PtT=12/24/24 oppEndSpan=44 MissingCoin
54104: coinSeg/Span/PtT=2/3/3 endSpan=40 oppSeg/Span/PtT=1/2/2 oppEndSpan=38 MissingCoin
54205: coinSeg/Span/PtT=12/44/44 endSpan=24 oppSeg/Span/PtT=2/40/40 oppEndSpan=3 MissingCoin
54306: coinSeg/Span/PtT=1/38/38 endSpan=2 oppSeg/Span/PtT=2/40/40 oppEndSpan=3 MissingCoin
54407: coinSeg/Span/PtT=2/3/3 endSpan=40 oppSeg/Span/PtT=12/24/24 oppEndSpan=44 MissingCoin
54508: seg/base=11/21 seg/base=12/23 MarkCoinStart
54609: seg/base=11/22 seg/base=12/43 MarkCoinEnd
54710: seg/base=10/19 seg/base=12/43 MarkCoinStart
54811: seg/base=10/20 seg/base=12/44 MarkCoinEnd
54912: seg/base=9/17 seg/base=12/43 MarkCoinStart
55013: seg/base=9/18 seg/base=12/44 MarkCoinEnd
55114: seg/base=9/17 seg/base=10/19 MarkCoinStart
55215: seg/base=9/18 seg/base=10/20 MarkCoinEnd
55316: seg/base=8/42 seg/base=12/23 MarkCoinStart
55417: seg/base=8/16 seg/base=12/43 MarkCoinEnd
55518: seg/base=8/42 seg/base=11/21 MarkCoinStart
55619: seg/base=8/16 seg/base=11/22 MarkCoinEnd
55720: seg/base=12/23 seg/base=1/39 MarkCoinStart
55821: seg/base=12/24 seg/base=1/2 MarkCoinEnd
55922: seg/base=1/37 MarkCoinInsert
56023: seg/base=1/38 MarkCoinInsert
56124: seg/base=12/43 MarkCoinInsert
56225: seg/base=12/44 MarkCoinInsert
56326: seg/base=11/21 seg/base=1/39 MarkCoinStart
56427: seg/base=11/22 seg/base=1/37 MarkCoinEnd
56528: seg/base=10/19 seg/base=1/37 MarkCoinStart
56629: seg/base=10/20 seg/base=1/38 MarkCoinEnd
56730: seg/base=9/17 seg/base=1/37 MarkCoinStart
56831: seg/base=9/18 seg/base=1/38 MarkCoinEnd
56932: seg/base=8/15 seg/base=1/36 MarkCoinStart
57033: seg/base=8/16 seg/base=1/37 MarkCoinEnd
57134: seg/base=1/39 MarkCoinInsert
57235: seg/base=8/42 MarkCoinInsert
57336: seg/base=7/13 seg/base=1/35 MarkCoinStart
57437: seg/base=7/14 seg/base=1/36 MarkCoinEnd
575active after moveNearby:
576debugShowActiveSpans id=1 (494.348663,224.583771 494.360813,224.620209 494.370148,224.657471 0.999263287f) t=0 tEnd=0.737524311 windSum=? windValue=1
577debugShowActiveSpans id=1 (494.370148,224.657471 494.372825,224.668224 494.375275,224.679031 0.999938607f) t=0.737524311 tEnd=0.95041534 windSum=? windValue=1
578debugShowActiveSpans id=1 (494.375275,224.679031 494.375488,224.679966 494.375702,224.680908 0.999999523f) t=0.95041534 tEnd=0.968840505 windSum=? windValue=1
579debugShowActiveSpans id=1 (494.375702,224.680908 494.375872,224.681675 494.376038,224.682449 0.999999702f) t=0.968840505 tEnd=0.984064836 windSum=? windValue=1
580debugShowActiveSpans id=1 (494.376038,224.682449 494.376136,224.68286 494.376221,224.683273 0.99999994f) t=0.984064836 tEnd=0.992175496 windSum=? windValue=1
581debugShowActiveSpans id=1 (494.376221,224.683273 494.376316,224.683669 494.376404,224.684067 0.99999994f) t=0.992175496 tEnd=1 windSum=? windValue=1
582debugShowActiveSpans id=2 (494.376404,224.684067 494.37619,224.6837 494.375977,224.683334) t=0 tEnd=0.000586871356 windSum=? windValue=1
583debugShowActiveSpans id=2 (494.375977,224.683334 494.0052,224.055672 494.019165,224.046982) t=0.000586871356 tEnd=1 windSum=? windValue=1
584debugShowActiveSpans id=3 (494.019165,224.046982 494.029083,224.040833 494.232056,224.345306) t=0 tEnd=1 windSum=? windValue=1
585debugShowActiveSpans id=4 (494.232056,224.345306 494.273193,224.406982 494.30481,224.474213) t=0 tEnd=1 windSum=? windValue=1
586debugShowActiveSpans id=5 (494.30481,224.474213 494.329991,224.527724 494.348663,224.58374) t=0 tEnd=0.835281662 windSum=? windValue=1
587debugShowActiveSpans id=5 (494.348663,224.58374 494.352356,224.594819 494.355774,224.605927) t=0.835281662 tEnd=1 windSum=? windValue=1
588debugShowActiveSpans id=6 (494.355774,224.605927 494.363708,224.631714 494.370148,224.657471) t=0 tEnd=1 windSum=? windValue=1
589debugShowActiveSpans id=7 (494.370148,224.657471 494.375275,224.679031) t=0 tEnd=1 windSum=? windValue=1
590debugShowActiveSpans id=8 (494.375275,224.679031 494.375702,224.680908) t=0 tEnd=0.547725719 windSum=? windValue=1
591debugShowActiveSpans id=8 (494.375702,224.680908 494.376038,224.682449) t=0.547725719 tEnd=1 windSum=? windValue=1
592debugShowActiveSpans id=9 (494.376038,224.682449 494.376221,224.683273) t=0 tEnd=1 windSum=? windValue=1
593debugShowActiveSpans id=10 (494.376221,224.683273 494.376007,224.682281) t=0 tEnd=1 windSum=? windValue=1
594debugShowActiveSpans id=11 (494.376007,224.682281 494.375671,224.680908) t=0 tEnd=1 windSum=? windValue=1
595debugShowActiveSpans id=12 (494.375671,224.680908 494.375445,224.679787 494.376129,224.682434) t=0 tEnd=0.809546276 windSum=? windValue=1
596debugShowActiveSpans id=12 (494.376129,224.682434 494.376227,224.682801 494.376343,224.683243) t=0.809546276 tEnd=0.924341302 windSum=? windValue=1
597debugShowActiveSpans id=12 (494.376343,224.683243 494.376415,224.683539 494.376495,224.683868) t=0.924341302 tEnd=1 windSum=? windValue=1
598debugShowActiveSpans id=13 (494.376495,224.683868 494.634338,225.414886 494.895874,225.840698) t=0 tEnd=1 windSum=? windValue=1
599debugShowActiveSpans id=14 (494.895874,225.840698 495.737305,227.210602 497.243317,227.90419) t=0 tEnd=1 windSum=? windValue=1
600debugShowActiveSpans id=15 (497.243317,227.90419 502.109781,230.145352 511.897949,224.957367) t=0 tEnd=0.929653854 windSum=? windValue=1
601debugShowActiveSpans id=15 (511.897949,224.957367 512.63876,224.564718 513.407471,224.129684) t=0.929653854 tEnd=1 windSum=? windValue=1
602debugShowActiveSpans id=16 (513.407471,224.129684 513.900024,224.999985) t=0 tEnd=1 windSum=? windValue=1
603debugShowActiveSpans id=17 (513.900024,224.999985 511.897949,224.957367) t=0 tEnd=0.102400099 windSum=? windValue=1
604debugShowActiveSpans id=17 (511.897949,224.957367 494.348663,224.583771) t=0.102400099 tEnd=1 windSum=? windValue=1
605---------------xx-x--x------------- addMissing2
60600: coinSeg/Span/PtT=2/3/3 endSpan=40 oppSeg/Span/PtT=1/2/2 oppEndSpan=38 MissingCoin
60701: coinSeg/Span/PtT=12/44/44 endSpan=24 oppSeg/Span/PtT=2/40/40 oppEndSpan=3 MissingCoin
60802: coinSeg/Span/PtT=1/38/38 endSpan=2 oppSeg/Span/PtT=2/40/40 oppEndSpan=3 MissingCoin
60903: coinSeg/Span/PtT=2/3/3 endSpan=40 oppSeg/Span/PtT=12/24/24 oppEndSpan=44 MissingCoin
61004: coinSeg/Span/PtT=2/3/3 endSpan=40 oppSeg/Span/PtT=1/2/2 oppEndSpan=38 MissingCoin
61105: coinSeg/Span/PtT=12/44/44 endSpan=24 oppSeg/Span/PtT=2/40/40 oppEndSpan=3 MissingCoin
61206: coinSeg/Span/PtT=1/38/38 endSpan=2 oppSeg/Span/PtT=2/40/40 oppEndSpan=3 MissingCoin
61307: coinSeg/Span/PtT=2/3/3 endSpan=40 oppSeg/Span/PtT=12/24/24 oppEndSpan=44 MissingCoin
61408: seg/base=11/21 seg/base=12/23 MarkCoinStart
61509: seg/base=11/22 seg/base=12/43 MarkCoinEnd
61610: seg/base=10/19 seg/base=12/43 MarkCoinStart
61711: seg/base=10/20 seg/base=12/44 MarkCoinEnd
61812: seg/base=9/17 seg/base=12/43 MarkCoinStart
61913: seg/base=9/18 seg/base=12/44 MarkCoinEnd
62014: seg/base=9/17 seg/base=10/19 MarkCoinStart
62115: seg/base=9/18 seg/base=10/20 MarkCoinEnd
62216: seg/base=8/42 seg/base=12/23 MarkCoinStart
62317: seg/base=8/16 seg/base=12/43 MarkCoinEnd
62418: seg/base=8/42 seg/base=11/21 MarkCoinStart
62519: seg/base=8/16 seg/base=11/22 MarkCoinEnd
62620: seg/base=12/23 seg/base=1/39 MarkCoinStart
62721: seg/base=12/24 seg/base=1/2 MarkCoinEnd
62822: seg/base=1/37 MarkCoinInsert
62923: seg/base=1/38 MarkCoinInsert
63024: seg/base=12/43 MarkCoinInsert
63125: seg/base=12/44 MarkCoinInsert
63226: seg/base=11/21 seg/base=1/39 MarkCoinStart
63327: seg/base=11/22 seg/base=1/37 MarkCoinEnd
63428: seg/base=10/19 seg/base=1/37 MarkCoinStart
63529: seg/base=10/20 seg/base=1/38 MarkCoinEnd
63630: seg/base=9/17 seg/base=1/37 MarkCoinStart
63731: seg/base=9/18 seg/base=1/38 MarkCoinEnd
63832: seg/base=8/15 seg/base=1/36 MarkCoinStart
63933: seg/base=8/16 seg/base=1/37 MarkCoinEnd
64034: seg/base=1/39 MarkCoinInsert
64135: seg/base=8/42 MarkCoinInsert
64236: seg/base=7/13 seg/base=1/35 MarkCoinStart
64337: seg/base=7/14 seg/base=1/36 MarkCoinEnd
644active after addMissing2:
645debugShowActiveSpans id=1 (494.348663,224.583771 494.360813,224.620209 494.370148,224.657471 0.999263287f) t=0 tEnd=0.737524311 windSum=? windValue=1
646debugShowActiveSpans id=1 (494.370148,224.657471 494.372825,224.668224 494.375275,224.679031 0.999938607f) t=0.737524311 tEnd=0.95041534 windSum=? windValue=1
647debugShowActiveSpans id=1 (494.375275,224.679031 494.375488,224.679966 494.375702,224.680908 0.999999523f) t=0.95041534 tEnd=0.968840505 windSum=? windValue=1
648debugShowActiveSpans id=1 (494.375702,224.680908 494.375872,224.681675 494.376038,224.682449 0.999999702f) t=0.968840505 tEnd=0.984064836 windSum=? windValue=1
649debugShowActiveSpans id=1 (494.376038,224.682449 494.376136,224.68286 494.376221,224.683273 0.99999994f) t=0.984064836 tEnd=0.992175496 windSum=? windValue=1
650debugShowActiveSpans id=1 (494.376221,224.683273 494.376316,224.683669 494.376404,224.684067 0.99999994f) t=0.992175496 tEnd=1 windSum=? windValue=1
651debugShowActiveSpans id=2 (494.376404,224.684067 494.37619,224.6837 494.375977,224.683334) t=0 tEnd=0.000586871356 windSum=? windValue=1
652debugShowActiveSpans id=2 (494.375977,224.683334 494.0052,224.055672 494.019165,224.046982) t=0.000586871356 tEnd=1 windSum=? windValue=1
653debugShowActiveSpans id=3 (494.019165,224.046982 494.029083,224.040833 494.232056,224.345306) t=0 tEnd=1 windSum=? windValue=1
654debugShowActiveSpans id=4 (494.232056,224.345306 494.273193,224.406982 494.30481,224.474213) t=0 tEnd=1 windSum=? windValue=1
655debugShowActiveSpans id=5 (494.30481,224.474213 494.329991,224.527724 494.348663,224.58374) t=0 tEnd=0.835281662 windSum=? windValue=1
656debugShowActiveSpans id=5 (494.348663,224.58374 494.352356,224.594819 494.355774,224.605927) t=0.835281662 tEnd=1 windSum=? windValue=1
657debugShowActiveSpans id=6 (494.355774,224.605927 494.363708,224.631714 494.370148,224.657471) t=0 tEnd=1 windSum=? windValue=1
658debugShowActiveSpans id=7 (494.370148,224.657471 494.375275,224.679031) t=0 tEnd=1 windSum=? windValue=1
659debugShowActiveSpans id=8 (494.375275,224.679031 494.375702,224.680908) t=0 tEnd=0.547725719 windSum=? windValue=1
660debugShowActiveSpans id=8 (494.375702,224.680908 494.376038,224.682449) t=0.547725719 tEnd=1 windSum=? windValue=1
661debugShowActiveSpans id=9 (494.376038,224.682449 494.376221,224.683273) t=0 tEnd=1 windSum=? windValue=1
662debugShowActiveSpans id=10 (494.376221,224.683273 494.376007,224.682281) t=0 tEnd=1 windSum=? windValue=1
663debugShowActiveSpans id=11 (494.376007,224.682281 494.375671,224.680908) t=0 tEnd=1 windSum=? windValue=1
664debugShowActiveSpans id=12 (494.375671,224.680908 494.375445,224.679787 494.376129,224.682434) t=0 tEnd=0.809546276 windSum=? windValue=1
665debugShowActiveSpans id=12 (494.376129,224.682434 494.376227,224.682801 494.376343,224.683243) t=0.809546276 tEnd=0.924341302 windSum=? windValue=1
666debugShowActiveSpans id=12 (494.376343,224.683243 494.376415,224.683539 494.376495,224.683868) t=0.924341302 tEnd=1 windSum=? windValue=1
667debugShowActiveSpans id=13 (494.376495,224.683868 494.634338,225.414886 494.895874,225.840698) t=0 tEnd=1 windSum=? windValue=1
668debugShowActiveSpans id=14 (494.895874,225.840698 495.737305,227.210602 497.243317,227.90419) t=0 tEnd=1 windSum=? windValue=1
669debugShowActiveSpans id=15 (497.243317,227.90419 502.109781,230.145352 511.897949,224.957367) t=0 tEnd=0.929653854 windSum=? windValue=1
670debugShowActiveSpans id=15 (511.897949,224.957367 512.63876,224.564718 513.407471,224.129684) t=0.929653854 tEnd=1 windSum=? windValue=1
671debugShowActiveSpans id=16 (513.407471,224.129684 513.900024,224.999985) t=0 tEnd=1 windSum=? windValue=1
672debugShowActiveSpans id=17 (513.900024,224.999985 511.897949,224.957367) t=0 tEnd=0.102400099 windSum=? windValue=1
673debugShowActiveSpans id=17 (511.897949,224.957367 494.348663,224.583771) t=0.102400099 tEnd=1 windSum=? windValue=1
674---------------xx-x--x------------- moveNearby2
67500: coinSeg/Span/PtT=2/3/3 endSpan=40 oppSeg/Span/PtT=1/2/2 oppEndSpan=38 MissingCoin
67601: coinSeg/Span/PtT=12/44/44 endSpan=24 oppSeg/Span/PtT=2/40/40 oppEndSpan=3 MissingCoin
67702: coinSeg/Span/PtT=1/38/38 endSpan=2 oppSeg/Span/PtT=2/40/40 oppEndSpan=3 MissingCoin
67803: coinSeg/Span/PtT=2/3/3 endSpan=40 oppSeg/Span/PtT=12/24/24 oppEndSpan=44 MissingCoin
67904: coinSeg/Span/PtT=2/3/3 endSpan=40 oppSeg/Span/PtT=1/2/2 oppEndSpan=38 MissingCoin
68005: coinSeg/Span/PtT=12/44/44 endSpan=24 oppSeg/Span/PtT=2/40/40 oppEndSpan=3 MissingCoin
68106: coinSeg/Span/PtT=1/38/38 endSpan=2 oppSeg/Span/PtT=2/40/40 oppEndSpan=3 MissingCoin
68207: coinSeg/Span/PtT=2/3/3 endSpan=40 oppSeg/Span/PtT=12/24/24 oppEndSpan=44 MissingCoin
68308: seg/base=11/21 seg/base=12/23 MarkCoinStart
68409: seg/base=11/22 seg/base=12/43 MarkCoinEnd
68510: seg/base=10/19 seg/base=12/43 MarkCoinStart
68611: seg/base=10/20 seg/base=12/44 MarkCoinEnd
68712: seg/base=9/17 seg/base=12/43 MarkCoinStart
68813: seg/base=9/18 seg/base=12/44 MarkCoinEnd
68914: seg/base=9/17 seg/base=10/19 MarkCoinStart
69015: seg/base=9/18 seg/base=10/20 MarkCoinEnd
69116: seg/base=8/42 seg/base=12/23 MarkCoinStart
69217: seg/base=8/16 seg/base=12/43 MarkCoinEnd
69318: seg/base=8/42 seg/base=11/21 MarkCoinStart
69419: seg/base=8/16 seg/base=11/22 MarkCoinEnd
69520: seg/base=12/23 seg/base=1/39 MarkCoinStart
69621: seg/base=12/24 seg/base=1/2 MarkCoinEnd
69722: seg/base=1/37 MarkCoinInsert
69823: seg/base=1/38 MarkCoinInsert
69924: seg/base=12/43 MarkCoinInsert
70025: seg/base=12/44 MarkCoinInsert
70126: seg/base=11/21 seg/base=1/39 MarkCoinStart
70227: seg/base=11/22 seg/base=1/37 MarkCoinEnd
70328: seg/base=10/19 seg/base=1/37 MarkCoinStart
70429: seg/base=10/20 seg/base=1/38 MarkCoinEnd
70530: seg/base=9/17 seg/base=1/37 MarkCoinStart
70631: seg/base=9/18 seg/base=1/38 MarkCoinEnd
70732: seg/base=8/15 seg/base=1/36 MarkCoinStart
70833: seg/base=8/16 seg/base=1/37 MarkCoinEnd
70934: seg/base=1/39 MarkCoinInsert
71035: seg/base=8/42 MarkCoinInsert
71136: seg/base=7/13 seg/base=1/35 MarkCoinStart
71237: seg/base=7/14 seg/base=1/36 MarkCoinEnd
713active after moveNearby2:
714debugShowActiveSpans id=1 (494.348663,224.583771 494.360813,224.620209 494.370148,224.657471 0.999263287f) t=0 tEnd=0.737524311 windSum=? windValue=1
715debugShowActiveSpans id=1 (494.370148,224.657471 494.372825,224.668224 494.375275,224.679031 0.999938607f) t=0.737524311 tEnd=0.95041534 windSum=? windValue=1
716debugShowActiveSpans id=1 (494.375275,224.679031 494.375488,224.679966 494.375702,224.680908 0.999999523f) t=0.95041534 tEnd=0.968840505 windSum=? windValue=1
717debugShowActiveSpans id=1 (494.375702,224.680908 494.375872,224.681675 494.376038,224.682449 0.999999702f) t=0.968840505 tEnd=0.984064836 windSum=? windValue=1
718debugShowActiveSpans id=1 (494.376038,224.682449 494.376136,224.68286 494.376221,224.683273 0.99999994f) t=0.984064836 tEnd=0.992175496 windSum=? windValue=1
719debugShowActiveSpans id=1 (494.376221,224.683273 494.376316,224.683669 494.376404,224.684067 0.99999994f) t=0.992175496 tEnd=1 windSum=? windValue=1
720debugShowActiveSpans id=2 (494.376404,224.684067 494.37619,224.6837 494.375977,224.683334) t=0 tEnd=0.000586871356 windSum=? windValue=1
721debugShowActiveSpans id=2 (494.375977,224.683334 494.0052,224.055672 494.019165,224.046982) t=0.000586871356 tEnd=1 windSum=? windValue=1
722debugShowActiveSpans id=3 (494.019165,224.046982 494.029083,224.040833 494.232056,224.345306) t=0 tEnd=1 windSum=? windValue=1
723debugShowActiveSpans id=4 (494.232056,224.345306 494.273193,224.406982 494.30481,224.474213) t=0 tEnd=1 windSum=? windValue=1
724debugShowActiveSpans id=5 (494.30481,224.474213 494.329991,224.527724 494.348663,224.58374) t=0 tEnd=0.835281662 windSum=? windValue=1
725debugShowActiveSpans id=5 (494.348663,224.58374 494.352356,224.594819 494.355774,224.605927) t=0.835281662 tEnd=1 windSum=? windValue=1
726debugShowActiveSpans id=6 (494.355774,224.605927 494.363708,224.631714 494.370148,224.657471) t=0 tEnd=1 windSum=? windValue=1
727debugShowActiveSpans id=7 (494.370148,224.657471 494.375275,224.679031) t=0 tEnd=1 windSum=? windValue=1
728debugShowActiveSpans id=8 (494.375275,224.679031 494.375702,224.680908) t=0 tEnd=0.547725719 windSum=? windValue=1
729debugShowActiveSpans id=8 (494.375702,224.680908 494.376038,224.682449) t=0.547725719 tEnd=1 windSum=? windValue=1
730debugShowActiveSpans id=9 (494.376038,224.682449 494.376221,224.683273) t=0 tEnd=1 windSum=? windValue=1
731debugShowActiveSpans id=10 (494.376221,224.683273 494.376007,224.682281) t=0 tEnd=1 windSum=? windValue=1
732debugShowActiveSpans id=11 (494.376007,224.682281 494.375671,224.680908) t=0 tEnd=1 windSum=? windValue=1
733debugShowActiveSpans id=12 (494.375671,224.680908 494.375445,224.679787 494.376129,224.682434) t=0 tEnd=0.809546276 windSum=? windValue=1
734debugShowActiveSpans id=12 (494.376129,224.682434 494.376227,224.682801 494.376343,224.683243) t=0.809546276 tEnd=0.924341302 windSum=? windValue=1
735debugShowActiveSpans id=12 (494.376343,224.683243 494.376415,224.683539 494.376495,224.683868) t=0.924341302 tEnd=1 windSum=? windValue=1
736debugShowActiveSpans id=13 (494.376495,224.683868 494.634338,225.414886 494.895874,225.840698) t=0 tEnd=1 windSum=? windValue=1
737debugShowActiveSpans id=14 (494.895874,225.840698 495.737305,227.210602 497.243317,227.90419) t=0 tEnd=1 windSum=? windValue=1
738debugShowActiveSpans id=15 (497.243317,227.90419 502.109781,230.145352 511.897949,224.957367) t=0 tEnd=0.929653854 windSum=? windValue=1
739debugShowActiveSpans id=15 (511.897949,224.957367 512.63876,224.564718 513.407471,224.129684) t=0.929653854 tEnd=1 windSum=? windValue=1
740debugShowActiveSpans id=16 (513.407471,224.129684 513.900024,224.999985) t=0 tEnd=1 windSum=? windValue=1
741debugShowActiveSpans id=17 (513.900024,224.999985 511.897949,224.957367) t=0 tEnd=0.102400099 windSum=? windValue=1
742debugShowActiveSpans id=17 (511.897949,224.957367 494.348663,224.583771) t=0.102400099 tEnd=1 windSum=? windValue=1
743---------------xx-x--x------------- expand2
74400: coinSeg/Span/PtT=2/3/3 endSpan=40 oppSeg/Span/PtT=1/2/2 oppEndSpan=38 MissingCoin
74501: coinSeg/Span/PtT=12/44/44 endSpan=24 oppSeg/Span/PtT=2/40/40 oppEndSpan=3 MissingCoin
74602: coinSeg/Span/PtT=1/38/38 endSpan=2 oppSeg/Span/PtT=2/40/40 oppEndSpan=3 MissingCoin
74703: coinSeg/Span/PtT=2/3/3 endSpan=40 oppSeg/Span/PtT=12/24/24 oppEndSpan=44 MissingCoin
74804: coinSeg/Span/PtT=2/3/3 endSpan=40 oppSeg/Span/PtT=1/2/2 oppEndSpan=38 MissingCoin
74905: coinSeg/Span/PtT=12/44/44 endSpan=24 oppSeg/Span/PtT=2/40/40 oppEndSpan=3 MissingCoin
75006: coinSeg/Span/PtT=1/38/38 endSpan=2 oppSeg/Span/PtT=2/40/40 oppEndSpan=3 MissingCoin
75107: coinSeg/Span/PtT=2/3/3 endSpan=40 oppSeg/Span/PtT=12/24/24 oppEndSpan=44 MissingCoin
75208: seg/base=11/21 seg/base=12/23 MarkCoinStart
75309: seg/base=11/22 seg/base=12/43 MarkCoinEnd
75410: seg/base=10/19 seg/base=12/43 MarkCoinStart
75511: seg/base=10/20 seg/base=12/44 MarkCoinEnd
75612: seg/base=9/17 seg/base=12/43 MarkCoinStart
75713: seg/base=9/18 seg/base=12/44 MarkCoinEnd
75814: seg/base=9/17 seg/base=10/19 MarkCoinStart
75915: seg/base=9/18 seg/base=10/20 MarkCoinEnd
76016: seg/base=8/42 seg/base=12/23 MarkCoinStart
76117: seg/base=8/16 seg/base=12/43 MarkCoinEnd
76218: seg/base=8/42 seg/base=11/21 MarkCoinStart
76319: seg/base=8/16 seg/base=11/22 MarkCoinEnd
76420: seg/base=12/23 seg/base=1/39 MarkCoinStart
76521: seg/base=12/24 seg/base=1/2 MarkCoinEnd
76622: seg/base=1/37 MarkCoinInsert
76723: seg/base=1/38 MarkCoinInsert
76824: seg/base=12/43 MarkCoinInsert
76925: seg/base=12/44 MarkCoinInsert
77026: seg/base=11/21 seg/base=1/39 MarkCoinStart
77127: seg/base=11/22 seg/base=1/37 MarkCoinEnd
77228: seg/base=10/19 seg/base=1/37 MarkCoinStart
77329: seg/base=10/20 seg/base=1/38 MarkCoinEnd
77430: seg/base=9/17 seg/base=1/37 MarkCoinStart
77531: seg/base=9/18 seg/base=1/38 MarkCoinEnd
77632: seg/base=8/15 seg/base=1/36 MarkCoinStart
77733: seg/base=8/16 seg/base=1/37 MarkCoinEnd
77834: seg/base=1/39 MarkCoinInsert
77935: seg/base=8/42 MarkCoinInsert
78036: seg/base=7/13 seg/base=1/35 MarkCoinStart
78137: seg/base=7/14 seg/base=1/36 MarkCoinEnd
782active after expand2:
783debugShowActiveSpans id=1 (494.348663,224.583771 494.360813,224.620209 494.370148,224.657471 0.999263287f) t=0 tEnd=0.737524311 windSum=? windValue=1
784debugShowActiveSpans id=1 (494.370148,224.657471 494.372825,224.668224 494.375275,224.679031 0.999938607f) t=0.737524311 tEnd=0.95041534 windSum=? windValue=1
785debugShowActiveSpans id=1 (494.375275,224.679031 494.375488,224.679966 494.375702,224.680908 0.999999523f) t=0.95041534 tEnd=0.968840505 windSum=? windValue=1
786debugShowActiveSpans id=1 (494.375702,224.680908 494.375872,224.681675 494.376038,224.682449 0.999999702f) t=0.968840505 tEnd=0.984064836 windSum=? windValue=1
787debugShowActiveSpans id=1 (494.376038,224.682449 494.376136,224.68286 494.376221,224.683273 0.99999994f) t=0.984064836 tEnd=0.992175496 windSum=? windValue=1
788debugShowActiveSpans id=1 (494.376221,224.683273 494.376316,224.683669 494.376404,224.684067 0.99999994f) t=0.992175496 tEnd=1 windSum=? windValue=1
789debugShowActiveSpans id=2 (494.376404,224.684067 494.37619,224.6837 494.375977,224.683334) t=0 tEnd=0.000586871356 windSum=? windValue=1
790debugShowActiveSpans id=2 (494.375977,224.683334 494.0052,224.055672 494.019165,224.046982) t=0.000586871356 tEnd=1 windSum=? windValue=1
791debugShowActiveSpans id=3 (494.019165,224.046982 494.029083,224.040833 494.232056,224.345306) t=0 tEnd=1 windSum=? windValue=1
792debugShowActiveSpans id=4 (494.232056,224.345306 494.273193,224.406982 494.30481,224.474213) t=0 tEnd=1 windSum=? windValue=1
793debugShowActiveSpans id=5 (494.30481,224.474213 494.329991,224.527724 494.348663,224.58374) t=0 tEnd=0.835281662 windSum=? windValue=1
794debugShowActiveSpans id=5 (494.348663,224.58374 494.352356,224.594819 494.355774,224.605927) t=0.835281662 tEnd=1 windSum=? windValue=1
795debugShowActiveSpans id=6 (494.355774,224.605927 494.363708,224.631714 494.370148,224.657471) t=0 tEnd=1 windSum=? windValue=1
796debugShowActiveSpans id=7 (494.370148,224.657471 494.375275,224.679031) t=0 tEnd=1 windSum=? windValue=1
797debugShowActiveSpans id=8 (494.375275,224.679031 494.375702,224.680908) t=0 tEnd=0.547725719 windSum=? windValue=1
798debugShowActiveSpans id=8 (494.375702,224.680908 494.376038,224.682449) t=0.547725719 tEnd=1 windSum=? windValue=1
799debugShowActiveSpans id=9 (494.376038,224.682449 494.376221,224.683273) t=0 tEnd=1 windSum=? windValue=1
800debugShowActiveSpans id=10 (494.376221,224.683273 494.376007,224.682281) t=0 tEnd=1 windSum=? windValue=1
801debugShowActiveSpans id=11 (494.376007,224.682281 494.375671,224.680908) t=0 tEnd=1 windSum=? windValue=1
802debugShowActiveSpans id=12 (494.375671,224.680908 494.375445,224.679787 494.376129,224.682434) t=0 tEnd=0.809546276 windSum=? windValue=1
803debugShowActiveSpans id=12 (494.376129,224.682434 494.376227,224.682801 494.376343,224.683243) t=0.809546276 tEnd=0.924341302 windSum=? windValue=1
804debugShowActiveSpans id=12 (494.376343,224.683243 494.376415,224.683539 494.376495,224.683868) t=0.924341302 tEnd=1 windSum=? windValue=1
805debugShowActiveSpans id=13 (494.376495,224.683868 494.634338,225.414886 494.895874,225.840698) t=0 tEnd=1 windSum=? windValue=1
806debugShowActiveSpans id=14 (494.895874,225.840698 495.737305,227.210602 497.243317,227.90419) t=0 tEnd=1 windSum=? windValue=1
807debugShowActiveSpans id=15 (497.243317,227.90419 502.109781,230.145352 511.897949,224.957367) t=0 tEnd=0.929653854 windSum=? windValue=1
808debugShowActiveSpans id=15 (511.897949,224.957367 512.63876,224.564718 513.407471,224.129684) t=0.929653854 tEnd=1 windSum=? windValue=1
809debugShowActiveSpans id=16 (513.407471,224.129684 513.900024,224.999985) t=0 tEnd=1 windSum=? windValue=1
810debugShowActiveSpans id=17 (513.900024,224.999985 511.897949,224.957367) t=0 tEnd=0.102400099 windSum=? windValue=1
811debugShowActiveSpans id=17 (511.897949,224.957367 494.348663,224.583771) t=0.102400099 tEnd=1 windSum=? windValue=1
812---------------xx-x--x------------- addExpanded3
81300: coinSeg/Span/PtT=2/3/3 endSpan=40 oppSeg/Span/PtT=1/2/2 oppEndSpan=38 MissingCoin
81401: coinSeg/Span/PtT=12/44/44 endSpan=24 oppSeg/Span/PtT=2/40/40 oppEndSpan=3 MissingCoin
81502: coinSeg/Span/PtT=1/38/38 endSpan=2 oppSeg/Span/PtT=2/40/40 oppEndSpan=3 MissingCoin
81603: coinSeg/Span/PtT=2/3/3 endSpan=40 oppSeg/Span/PtT=12/24/24 oppEndSpan=44 MissingCoin
81704: coinSeg/Span/PtT=2/3/3 endSpan=40 oppSeg/Span/PtT=1/2/2 oppEndSpan=38 MissingCoin
81805: coinSeg/Span/PtT=12/44/44 endSpan=24 oppSeg/Span/PtT=2/40/40 oppEndSpan=3 MissingCoin
81906: coinSeg/Span/PtT=1/38/38 endSpan=2 oppSeg/Span/PtT=2/40/40 oppEndSpan=3 MissingCoin
82007: coinSeg/Span/PtT=2/3/3 endSpan=40 oppSeg/Span/PtT=12/24/24 oppEndSpan=44 MissingCoin
82108: seg/base=11/21 seg/base=12/23 MarkCoinStart
82209: seg/base=11/22 seg/base=12/43 MarkCoinEnd
82310: seg/base=10/19 seg/base=12/43 MarkCoinStart
82411: seg/base=10/20 seg/base=12/44 MarkCoinEnd
82512: seg/base=9/17 seg/base=12/43 MarkCoinStart
82613: seg/base=9/18 seg/base=12/44 MarkCoinEnd
82714: seg/base=9/17 seg/base=10/19 MarkCoinStart
82815: seg/base=9/18 seg/base=10/20 MarkCoinEnd
82916: seg/base=8/42 seg/base=12/23 MarkCoinStart
83017: seg/base=8/16 seg/base=12/43 MarkCoinEnd
83118: seg/base=8/42 seg/base=11/21 MarkCoinStart
83219: seg/base=8/16 seg/base=11/22 MarkCoinEnd
83320: seg/base=12/23 seg/base=1/39 MarkCoinStart
83421: seg/base=12/24 seg/base=1/2 MarkCoinEnd
83522: seg/base=1/37 MarkCoinInsert
83623: seg/base=1/38 MarkCoinInsert
83724: seg/base=12/43 MarkCoinInsert
83825: seg/base=12/44 MarkCoinInsert
83926: seg/base=11/21 seg/base=1/39 MarkCoinStart
84027: seg/base=11/22 seg/base=1/37 MarkCoinEnd
84128: seg/base=10/19 seg/base=1/37 MarkCoinStart
84229: seg/base=10/20 seg/base=1/38 MarkCoinEnd
84330: seg/base=9/17 seg/base=1/37 MarkCoinStart
84431: seg/base=9/18 seg/base=1/38 MarkCoinEnd
84532: seg/base=8/15 seg/base=1/36 MarkCoinStart
84633: seg/base=8/16 seg/base=1/37 MarkCoinEnd
84734: seg/base=1/39 MarkCoinInsert
84835: seg/base=8/42 MarkCoinInsert
84936: seg/base=7/13 seg/base=1/35 MarkCoinStart
85037: seg/base=7/14 seg/base=1/36 MarkCoinEnd
851active after addExpanded3:
852debugShowActiveSpans id=1 (494.348663,224.583771 494.360813,224.620209 494.370148,224.657471 0.999263287f) t=0 tEnd=0.737524311 windSum=? windValue=1
853debugShowActiveSpans id=1 (494.370148,224.657471 494.372825,224.668224 494.375275,224.679031 0.999938607f) t=0.737524311 tEnd=0.95041534 windSum=? windValue=1
854debugShowActiveSpans id=1 (494.375275,224.679031 494.375488,224.679966 494.375702,224.680908 0.999999523f) t=0.95041534 tEnd=0.968840505 windSum=? windValue=1
855debugShowActiveSpans id=1 (494.375702,224.680908 494.375872,224.681675 494.376038,224.682449 0.999999702f) t=0.968840505 tEnd=0.984064836 windSum=? windValue=1
856debugShowActiveSpans id=1 (494.376038,224.682449 494.376136,224.68286 494.376221,224.683273 0.99999994f) t=0.984064836 tEnd=0.992175496 windSum=? windValue=1
857debugShowActiveSpans id=1 (494.376221,224.683273 494.376316,224.683669 494.376404,224.684067 0.99999994f) t=0.992175496 tEnd=1 windSum=? windValue=1
858debugShowActiveSpans id=2 (494.376404,224.684067 494.37619,224.6837 494.375977,224.683334) t=0 tEnd=0.000586871356 windSum=? windValue=1
859debugShowActiveSpans id=2 (494.375977,224.683334 494.0052,224.055672 494.019165,224.046982) t=0.000586871356 tEnd=1 windSum=? windValue=1
860debugShowActiveSpans id=3 (494.019165,224.046982 494.029083,224.040833 494.232056,224.345306) t=0 tEnd=1 windSum=? windValue=1
861debugShowActiveSpans id=4 (494.232056,224.345306 494.273193,224.406982 494.30481,224.474213) t=0 tEnd=1 windSum=? windValue=1
862debugShowActiveSpans id=5 (494.30481,224.474213 494.329991,224.527724 494.348663,224.58374) t=0 tEnd=0.835281662 windSum=? windValue=1
863debugShowActiveSpans id=5 (494.348663,224.58374 494.352356,224.594819 494.355774,224.605927) t=0.835281662 tEnd=1 windSum=? windValue=1
864debugShowActiveSpans id=6 (494.355774,224.605927 494.363708,224.631714 494.370148,224.657471) t=0 tEnd=1 windSum=? windValue=1
865debugShowActiveSpans id=7 (494.370148,224.657471 494.375275,224.679031) t=0 tEnd=1 windSum=? windValue=1
866debugShowActiveSpans id=8 (494.375275,224.679031 494.375702,224.680908) t=0 tEnd=0.547725719 windSum=? windValue=1
867debugShowActiveSpans id=8 (494.375702,224.680908 494.376038,224.682449) t=0.547725719 tEnd=1 windSum=? windValue=1
868debugShowActiveSpans id=9 (494.376038,224.682449 494.376221,224.683273) t=0 tEnd=1 windSum=? windValue=1
869debugShowActiveSpans id=10 (494.376221,224.683273 494.376007,224.682281) t=0 tEnd=1 windSum=? windValue=1
870debugShowActiveSpans id=11 (494.376007,224.682281 494.375671,224.680908) t=0 tEnd=1 windSum=? windValue=1
871debugShowActiveSpans id=12 (494.375671,224.680908 494.375445,224.679787 494.376129,224.682434) t=0 tEnd=0.809546276 windSum=? windValue=1
872debugShowActiveSpans id=12 (494.376129,224.682434 494.376227,224.682801 494.376343,224.683243) t=0.809546276 tEnd=0.924341302 windSum=? windValue=1
873debugShowActiveSpans id=12 (494.376343,224.683243 494.376415,224.683539 494.376495,224.683868) t=0.924341302 tEnd=1 windSum=? windValue=1
874debugShowActiveSpans id=13 (494.376495,224.683868 494.634338,225.414886 494.895874,225.840698) t=0 tEnd=1 windSum=? windValue=1
875debugShowActiveSpans id=14 (494.895874,225.840698 495.737305,227.210602 497.243317,227.90419) t=0 tEnd=1 windSum=? windValue=1
876debugShowActiveSpans id=15 (497.243317,227.90419 502.109781,230.145352 511.897949,224.957367) t=0 tEnd=0.929653854 windSum=? windValue=1
877debugShowActiveSpans id=15 (511.897949,224.957367 512.63876,224.564718 513.407471,224.129684) t=0.929653854 tEnd=1 windSum=? windValue=1
878debugShowActiveSpans id=16 (513.407471,224.129684 513.900024,224.999985) t=0 tEnd=1 windSum=? windValue=1
879debugShowActiveSpans id=17 (513.900024,224.999985 511.897949,224.957367) t=0 tEnd=0.102400099 windSum=? windValue=1
880debugShowActiveSpans id=17 (511.897949,224.957367 494.348663,224.583771) t=0.102400099 tEnd=1 windSum=? windValue=1
881---------------------x------------- mark1
88200: coinSeg/Span/PtT=2/3/3 endSpan=40 oppSeg/Span/PtT=1/2/2 oppEndSpan=38 MissingCoin
88301: coinSeg/Span/PtT=12/44/44 endSpan=24 oppSeg/Span/PtT=2/40/40 oppEndSpan=3 MissingCoin
88402: coinSeg/Span/PtT=1/38/38 endSpan=2 oppSeg/Span/PtT=2/40/40 oppEndSpan=3 MissingCoin
88503: coinSeg/Span/PtT=2/3/3 endSpan=40 oppSeg/Span/PtT=12/24/24 oppEndSpan=44 MissingCoin
88604: coinSeg/Span/PtT=2/3/3 endSpan=40 oppSeg/Span/PtT=1/2/2 oppEndSpan=38 MissingCoin
88705: coinSeg/Span/PtT=12/44/44 endSpan=24 oppSeg/Span/PtT=2/40/40 oppEndSpan=3 MissingCoin
88806: coinSeg/Span/PtT=1/38/38 endSpan=2 oppSeg/Span/PtT=2/40/40 oppEndSpan=3 MissingCoin
88907: coinSeg/Span/PtT=2/3/3 endSpan=40 oppSeg/Span/PtT=12/24/24 oppEndSpan=44 MissingCoin
890active after mark1:
891debugShowActiveSpans id=1 (494.348663,224.583771 494.360813,224.620209 494.370148,224.657471 0.999263287f) t=0 tEnd=0.737524311 windSum=? windValue=1
892debugShowActiveSpans id=1 (494.370148,224.657471 494.372825,224.668224 494.375275,224.679031 0.999938607f) t=0.737524311 tEnd=0.95041534 windSum=? windValue=1
893debugShowActiveSpans id=1 (494.375275,224.679031 494.375488,224.679966 494.375702,224.680908 0.999999523f) t=0.95041534 tEnd=0.968840505 windSum=? windValue=1
894debugShowActiveSpans id=1 (494.375702,224.680908 494.375872,224.681675 494.376038,224.682449 0.999999702f) t=0.968840505 tEnd=0.984064836 windSum=? windValue=1
895debugShowActiveSpans id=1 (494.376038,224.682449 494.376136,224.68286 494.376221,224.683273 0.99999994f) t=0.984064836 tEnd=0.992175496 windSum=? windValue=1
896debugShowActiveSpans id=1 (494.376221,224.683273 494.376316,224.683669 494.376404,224.684067 0.99999994f) t=0.992175496 tEnd=1 windSum=? windValue=1
897debugShowActiveSpans id=2 (494.376404,224.684067 494.37619,224.6837 494.375977,224.683334) t=0 tEnd=0.000586871356 windSum=? windValue=1
898debugShowActiveSpans id=2 (494.375977,224.683334 494.0052,224.055672 494.019165,224.046982) t=0.000586871356 tEnd=1 windSum=? windValue=1
899debugShowActiveSpans id=3 (494.019165,224.046982 494.029083,224.040833 494.232056,224.345306) t=0 tEnd=1 windSum=? windValue=1
900debugShowActiveSpans id=4 (494.232056,224.345306 494.273193,224.406982 494.30481,224.474213) t=0 tEnd=1 windSum=? windValue=1
901debugShowActiveSpans id=5 (494.30481,224.474213 494.329991,224.527724 494.348663,224.58374) t=0 tEnd=0.835281662 windSum=? windValue=1
902debugShowActiveSpans id=5 (494.348663,224.58374 494.352356,224.594819 494.355774,224.605927) t=0.835281662 tEnd=1 windSum=? windValue=1
903debugShowActiveSpans id=6 (494.355774,224.605927 494.363708,224.631714 494.370148,224.657471) t=0 tEnd=1 windSum=? windValue=1
904debugShowActiveSpans id=7 (494.370148,224.657471 494.375275,224.679031) t=0 tEnd=1 windSum=? windValue=1
905debugShowActiveSpans id=8 (494.375275,224.679031 494.375702,224.680908) t=0 tEnd=0.547725719 windSum=? windValue=1
906debugShowActiveSpans id=8 (494.375702,224.680908 494.376038,224.682449) t=0.547725719 tEnd=1 windSum=? windValue=1
907debugShowActiveSpans id=9 (494.376038,224.682449 494.376221,224.683273) t=0 tEnd=1 windSum=? windValue=1
908debugShowActiveSpans id=10 (494.376221,224.683273 494.376007,224.682281) t=0 tEnd=1 windSum=? windValue=1
909debugShowActiveSpans id=11 (494.376007,224.682281 494.375671,224.680908) t=0 tEnd=1 windSum=? windValue=1
910debugShowActiveSpans id=12 (494.375671,224.680908 494.375445,224.679787 494.376129,224.682434) t=0 tEnd=0.809546276 windSum=? windValue=1
911debugShowActiveSpans id=12 (494.376129,224.682434 494.376227,224.682801 494.376343,224.683243) t=0.809546276 tEnd=0.924341302 windSum=? windValue=1
912debugShowActiveSpans id=12 (494.376343,224.683243 494.376415,224.683539 494.376495,224.683868) t=0.924341302 tEnd=1 windSum=? windValue=1
913debugShowActiveSpans id=13 (494.376495,224.683868 494.634338,225.414886 494.895874,225.840698) t=0 tEnd=1 windSum=? windValue=1
914debugShowActiveSpans id=14 (494.895874,225.840698 495.737305,227.210602 497.243317,227.90419) t=0 tEnd=1 windSum=? windValue=1
915debugShowActiveSpans id=15 (497.243317,227.90419 502.109781,230.145352 511.897949,224.957367) t=0 tEnd=0.929653854 windSum=? windValue=1
916debugShowActiveSpans id=15 (511.897949,224.957367 512.63876,224.564718 513.407471,224.129684) t=0.929653854 tEnd=1 windSum=? windValue=1
917debugShowActiveSpans id=16 (513.407471,224.129684 513.900024,224.999985) t=0 tEnd=1 windSum=? windValue=1
918debugShowActiveSpans id=17 (513.900024,224.999985 511.897949,224.957367) t=0 tEnd=0.102400099 windSum=? windValue=1
919debugShowActiveSpans id=17 (511.897949,224.957367 494.348663,224.583771) t=0.102400099 tEnd=1 windSum=? windValue=1
920missingCoincidence coinSpan=3 endSpan=40 oppSpan=2 oppEndSpan=38
921missingCoincidence coinSpan=44 endSpan=24 oppSpan=40 oppEndSpan=3
922---------------x--x---------------- missingCoincidence1
92300: seg/base=12/44 seg/base=2/3 MarkCoinStart
92401: seg/base=12/24 seg/base=2/40 MarkCoinEnd
92502: seg/base=2/3 seg/base=1/38 MarkCoinStart
92603: seg/base=2/40 seg/base=1/2 MarkCoinEnd
927active after missingCoincidence1:
928debugShowActiveSpans id=1 (494.348663,224.583771 494.360813,224.620209 494.370148,224.657471 0.999263287f) t=0 tEnd=0.737524311 windSum=? windValue=1
929debugShowActiveSpans id=1 (494.370148,224.657471 494.372825,224.668224 494.375275,224.679031 0.999938607f) t=0.737524311 tEnd=0.95041534 windSum=? windValue=1
930debugShowActiveSpans id=1 (494.375275,224.679031 494.375488,224.679966 494.375702,224.680908 0.999999523f) t=0.95041534 tEnd=0.968840505 windSum=? windValue=1
931debugShowActiveSpans id=1 (494.375702,224.680908 494.375872,224.681675 494.376038,224.682449 0.999999702f) t=0.968840505 tEnd=0.984064836 windSum=? windValue=1
932debugShowActiveSpans id=1 (494.376038,224.682449 494.376136,224.68286 494.376221,224.683273 0.99999994f) t=0.984064836 tEnd=0.992175496 windSum=? windValue=1
933debugShowActiveSpans id=1 (494.376221,224.683273 494.376316,224.683669 494.376404,224.684067 0.99999994f) t=0.992175496 tEnd=1 windSum=? windValue=1
934debugShowActiveSpans id=2 (494.376404,224.684067 494.37619,224.6837 494.375977,224.683334) t=0 tEnd=0.000586871356 windSum=? windValue=1
935debugShowActiveSpans id=2 (494.375977,224.683334 494.0052,224.055672 494.019165,224.046982) t=0.000586871356 tEnd=1 windSum=? windValue=1
936debugShowActiveSpans id=3 (494.019165,224.046982 494.029083,224.040833 494.232056,224.345306) t=0 tEnd=1 windSum=? windValue=1
937debugShowActiveSpans id=4 (494.232056,224.345306 494.273193,224.406982 494.30481,224.474213) t=0 tEnd=1 windSum=? windValue=1
938debugShowActiveSpans id=5 (494.30481,224.474213 494.329991,224.527724 494.348663,224.58374) t=0 tEnd=0.835281662 windSum=? windValue=1
939debugShowActiveSpans id=5 (494.348663,224.58374 494.352356,224.594819 494.355774,224.605927) t=0.835281662 tEnd=1 windSum=? windValue=1
940debugShowActiveSpans id=6 (494.355774,224.605927 494.363708,224.631714 494.370148,224.657471) t=0 tEnd=1 windSum=? windValue=1
941debugShowActiveSpans id=7 (494.370148,224.657471 494.375275,224.679031) t=0 tEnd=1 windSum=? windValue=1
942debugShowActiveSpans id=8 (494.375275,224.679031 494.375702,224.680908) t=0 tEnd=0.547725719 windSum=? windValue=1
943debugShowActiveSpans id=8 (494.375702,224.680908 494.376038,224.682449) t=0.547725719 tEnd=1 windSum=? windValue=1
944debugShowActiveSpans id=9 (494.376038,224.682449 494.376221,224.683273) t=0 tEnd=1 windSum=? windValue=1
945debugShowActiveSpans id=10 (494.376221,224.683273 494.376007,224.682281) t=0 tEnd=1 windSum=? windValue=1
946debugShowActiveSpans id=11 (494.376007,224.682281 494.375671,224.680908) t=0 tEnd=1 windSum=? windValue=1
947debugShowActiveSpans id=12 (494.375671,224.680908 494.375445,224.679787 494.376129,224.682434) t=0 tEnd=0.809546276 windSum=? windValue=1
948debugShowActiveSpans id=12 (494.376129,224.682434 494.376227,224.682801 494.376343,224.683243) t=0.809546276 tEnd=0.924341302 windSum=? windValue=1
949debugShowActiveSpans id=12 (494.376343,224.683243 494.376415,224.683539 494.376495,224.683868) t=0.924341302 tEnd=1 windSum=? windValue=1
950debugShowActiveSpans id=13 (494.376495,224.683868 494.634338,225.414886 494.895874,225.840698) t=0 tEnd=1 windSum=? windValue=1
951debugShowActiveSpans id=14 (494.895874,225.840698 495.737305,227.210602 497.243317,227.90419) t=0 tEnd=1 windSum=? windValue=1
952debugShowActiveSpans id=15 (497.243317,227.90419 502.109781,230.145352 511.897949,224.957367) t=0 tEnd=0.929653854 windSum=? windValue=1
953debugShowActiveSpans id=15 (511.897949,224.957367 512.63876,224.564718 513.407471,224.129684) t=0.929653854 tEnd=1 windSum=? windValue=1
954debugShowActiveSpans id=16 (513.407471,224.129684 513.900024,224.999985) t=0 tEnd=1 windSum=? windValue=1
955debugShowActiveSpans id=17 (513.900024,224.999985 511.897949,224.957367) t=0 tEnd=0.102400099 windSum=? windValue=1
956debugShowActiveSpans id=17 (511.897949,224.957367 494.348663,224.583771) t=0.102400099 tEnd=1 windSum=? windValue=1
957---------------x--x---------------- expand3
95800: seg/base=12/44 seg/base=2/3 MarkCoinStart
95901: seg/base=12/24 seg/base=2/40 MarkCoinEnd
96002: seg/base=2/3 seg/base=1/38 MarkCoinStart
96103: seg/base=2/40 seg/base=1/2 MarkCoinEnd
962active after expand3:
963debugShowActiveSpans id=1 (494.348663,224.583771 494.360813,224.620209 494.370148,224.657471 0.999263287f) t=0 tEnd=0.737524311 windSum=? windValue=1
964debugShowActiveSpans id=1 (494.370148,224.657471 494.372825,224.668224 494.375275,224.679031 0.999938607f) t=0.737524311 tEnd=0.95041534 windSum=? windValue=1
965debugShowActiveSpans id=1 (494.375275,224.679031 494.375488,224.679966 494.375702,224.680908 0.999999523f) t=0.95041534 tEnd=0.968840505 windSum=? windValue=1
966debugShowActiveSpans id=1 (494.375702,224.680908 494.375872,224.681675 494.376038,224.682449 0.999999702f) t=0.968840505 tEnd=0.984064836 windSum=? windValue=1
967debugShowActiveSpans id=1 (494.376038,224.682449 494.376136,224.68286 494.376221,224.683273 0.99999994f) t=0.984064836 tEnd=0.992175496 windSum=? windValue=1
968debugShowActiveSpans id=1 (494.376221,224.683273 494.376316,224.683669 494.376404,224.684067 0.99999994f) t=0.992175496 tEnd=1 windSum=? windValue=1
969debugShowActiveSpans id=2 (494.376404,224.684067 494.37619,224.6837 494.375977,224.683334) t=0 tEnd=0.000586871356 windSum=? windValue=1
970debugShowActiveSpans id=2 (494.375977,224.683334 494.0052,224.055672 494.019165,224.046982) t=0.000586871356 tEnd=1 windSum=? windValue=1
971debugShowActiveSpans id=3 (494.019165,224.046982 494.029083,224.040833 494.232056,224.345306) t=0 tEnd=1 windSum=? windValue=1
972debugShowActiveSpans id=4 (494.232056,224.345306 494.273193,224.406982 494.30481,224.474213) t=0 tEnd=1 windSum=? windValue=1
973debugShowActiveSpans id=5 (494.30481,224.474213 494.329991,224.527724 494.348663,224.58374) t=0 tEnd=0.835281662 windSum=? windValue=1
974debugShowActiveSpans id=5 (494.348663,224.58374 494.352356,224.594819 494.355774,224.605927) t=0.835281662 tEnd=1 windSum=? windValue=1
975debugShowActiveSpans id=6 (494.355774,224.605927 494.363708,224.631714 494.370148,224.657471) t=0 tEnd=1 windSum=? windValue=1
976debugShowActiveSpans id=7 (494.370148,224.657471 494.375275,224.679031) t=0 tEnd=1 windSum=? windValue=1
977debugShowActiveSpans id=8 (494.375275,224.679031 494.375702,224.680908) t=0 tEnd=0.547725719 windSum=? windValue=1
978debugShowActiveSpans id=8 (494.375702,224.680908 494.376038,224.682449) t=0.547725719 tEnd=1 windSum=? windValue=1
979debugShowActiveSpans id=9 (494.376038,224.682449 494.376221,224.683273) t=0 tEnd=1 windSum=? windValue=1
980debugShowActiveSpans id=10 (494.376221,224.683273 494.376007,224.682281) t=0 tEnd=1 windSum=? windValue=1
981debugShowActiveSpans id=11 (494.376007,224.682281 494.375671,224.680908) t=0 tEnd=1 windSum=? windValue=1
982debugShowActiveSpans id=12 (494.375671,224.680908 494.375445,224.679787 494.376129,224.682434) t=0 tEnd=0.809546276 windSum=? windValue=1
983debugShowActiveSpans id=12 (494.376129,224.682434 494.376227,224.682801 494.376343,224.683243) t=0.809546276 tEnd=0.924341302 windSum=? windValue=1
984debugShowActiveSpans id=12 (494.376343,224.683243 494.376415,224.683539 494.376495,224.683868) t=0.924341302 tEnd=1 windSum=? windValue=1
985debugShowActiveSpans id=13 (494.376495,224.683868 494.634338,225.414886 494.895874,225.840698) t=0 tEnd=1 windSum=? windValue=1
986debugShowActiveSpans id=14 (494.895874,225.840698 495.737305,227.210602 497.243317,227.90419) t=0 tEnd=1 windSum=? windValue=1
987debugShowActiveSpans id=15 (497.243317,227.90419 502.109781,230.145352 511.897949,224.957367) t=0 tEnd=0.929653854 windSum=? windValue=1
988debugShowActiveSpans id=15 (511.897949,224.957367 512.63876,224.564718 513.407471,224.129684) t=0.929653854 tEnd=1 windSum=? windValue=1
989debugShowActiveSpans id=16 (513.407471,224.129684 513.900024,224.999985) t=0 tEnd=1 windSum=? windValue=1
990debugShowActiveSpans id=17 (513.900024,224.999985 511.897949,224.957367) t=0 tEnd=0.102400099 windSum=? windValue=1
991debugShowActiveSpans id=17 (511.897949,224.957367 494.348663,224.583771) t=0.102400099 tEnd=1 windSum=? windValue=1
992---------------x--x---------------- addExpanded3
99300: seg/base=12/44 seg/base=2/3 MarkCoinStart
99401: seg/base=12/24 seg/base=2/40 MarkCoinEnd
99502: seg/base=2/3 seg/base=1/38 MarkCoinStart
99603: seg/base=2/40 seg/base=1/2 MarkCoinEnd
997active after addExpanded3:
998debugShowActiveSpans id=1 (494.348663,224.583771 494.360813,224.620209 494.370148,224.657471 0.999263287f) t=0 tEnd=0.737524311 windSum=? windValue=1
999debugShowActiveSpans id=1 (494.370148,224.657471 494.372825,224.668224 494.375275,224.679031 0.999938607f) t=0.737524311 tEnd=0.95041534 windSum=? windValue=1
1000debugShowActiveSpans id=1 (494.375275,224.679031 494.375488,224.679966 494.375702,224.680908 0.999999523f) t=0.95041534 tEnd=0.968840505 windSum=? windValue=1
1001debugShowActiveSpans id=1 (494.375702,224.680908 494.375872,224.681675 494.376038,224.682449 0.999999702f) t=0.968840505 tEnd=0.984064836 windSum=? windValue=1
1002debugShowActiveSpans id=1 (494.376038,224.682449 494.376136,224.68286 494.376221,224.683273 0.99999994f) t=0.984064836 tEnd=0.992175496 windSum=? windValue=1
1003debugShowActiveSpans id=1 (494.376221,224.683273 494.376316,224.683669 494.376404,224.684067 0.99999994f) t=0.992175496 tEnd=1 windSum=? windValue=1
1004debugShowActiveSpans id=2 (494.376404,224.684067 494.37619,224.6837 494.375977,224.683334) t=0 tEnd=0.000586871356 windSum=? windValue=1
1005debugShowActiveSpans id=2 (494.375977,224.683334 494.0052,224.055672 494.019165,224.046982) t=0.000586871356 tEnd=1 windSum=? windValue=1
1006debugShowActiveSpans id=3 (494.019165,224.046982 494.029083,224.040833 494.232056,224.345306) t=0 tEnd=1 windSum=? windValue=1
1007debugShowActiveSpans id=4 (494.232056,224.345306 494.273193,224.406982 494.30481,224.474213) t=0 tEnd=1 windSum=? windValue=1
1008debugShowActiveSpans id=5 (494.30481,224.474213 494.329991,224.527724 494.348663,224.58374) t=0 tEnd=0.835281662 windSum=? windValue=1
1009debugShowActiveSpans id=5 (494.348663,224.58374 494.352356,224.594819 494.355774,224.605927) t=0.835281662 tEnd=1 windSum=? windValue=1
1010debugShowActiveSpans id=6 (494.355774,224.605927 494.363708,224.631714 494.370148,224.657471) t=0 tEnd=1 windSum=? windValue=1
1011debugShowActiveSpans id=7 (494.370148,224.657471 494.375275,224.679031) t=0 tEnd=1 windSum=? windValue=1
1012debugShowActiveSpans id=8 (494.375275,224.679031 494.375702,224.680908) t=0 tEnd=0.547725719 windSum=? windValue=1
1013debugShowActiveSpans id=8 (494.375702,224.680908 494.376038,224.682449) t=0.547725719 tEnd=1 windSum=? windValue=1
1014debugShowActiveSpans id=9 (494.376038,224.682449 494.376221,224.683273) t=0 tEnd=1 windSum=? windValue=1
1015debugShowActiveSpans id=10 (494.376221,224.683273 494.376007,224.682281) t=0 tEnd=1 windSum=? windValue=1
1016debugShowActiveSpans id=11 (494.376007,224.682281 494.375671,224.680908) t=0 tEnd=1 windSum=? windValue=1
1017debugShowActiveSpans id=12 (494.375671,224.680908 494.375445,224.679787 494.376129,224.682434) t=0 tEnd=0.809546276 windSum=? windValue=1
1018debugShowActiveSpans id=12 (494.376129,224.682434 494.376227,224.682801 494.376343,224.683243) t=0.809546276 tEnd=0.924341302 windSum=? windValue=1
1019debugShowActiveSpans id=12 (494.376343,224.683243 494.376415,224.683539 494.376495,224.683868) t=0.924341302 tEnd=1 windSum=? windValue=1
1020debugShowActiveSpans id=13 (494.376495,224.683868 494.634338,225.414886 494.895874,225.840698) t=0 tEnd=1 windSum=? windValue=1
1021debugShowActiveSpans id=14 (494.895874,225.840698 495.737305,227.210602 497.243317,227.90419) t=0 tEnd=1 windSum=? windValue=1
1022debugShowActiveSpans id=15 (497.243317,227.90419 502.109781,230.145352 511.897949,224.957367) t=0 tEnd=0.929653854 windSum=? windValue=1
1023debugShowActiveSpans id=15 (511.897949,224.957367 512.63876,224.564718 513.407471,224.129684) t=0.929653854 tEnd=1 windSum=? windValue=1
1024debugShowActiveSpans id=16 (513.407471,224.129684 513.900024,224.999985) t=0 tEnd=1 windSum=? windValue=1
1025debugShowActiveSpans id=17 (513.900024,224.999985 511.897949,224.957367) t=0 tEnd=0.102400099 windSum=? windValue=1
1026debugShowActiveSpans id=17 (511.897949,224.957367 494.348663,224.583771) t=0.102400099 tEnd=1 windSum=? windValue=1
caryclark27c015d2016-09-23 05:47:20 -07001027----------------------------------- missingCoincidence3
caryclark6c3b9cd2016-09-26 05:36:58 -07001028active after missingCoincidence3:
1029debugShowActiveSpans id=1 (494.348663,224.583771 494.360813,224.620209 494.370148,224.657471 0.999263287f) t=0 tEnd=0.737524311 windSum=? windValue=1
1030debugShowActiveSpans id=1 (494.370148,224.657471 494.372825,224.668224 494.375275,224.679031 0.999938607f) t=0.737524311 tEnd=0.95041534 windSum=? windValue=1
1031debugShowActiveSpans id=1 (494.375275,224.679031 494.375488,224.679966 494.375702,224.680908 0.999999523f) t=0.95041534 tEnd=0.968840505 windSum=? windValue=1
1032debugShowActiveSpans id=1 (494.375702,224.680908 494.375872,224.681675 494.376038,224.682449 0.999999702f) t=0.968840505 tEnd=0.984064836 windSum=? windValue=1
1033debugShowActiveSpans id=1 (494.376038,224.682449 494.376136,224.68286 494.376221,224.683273 0.99999994f) t=0.984064836 tEnd=0.992175496 windSum=? windValue=1
1034debugShowActiveSpans id=1 (494.376221,224.683273 494.376316,224.683669 494.376404,224.684067 0.99999994f) t=0.992175496 tEnd=1 windSum=? windValue=1
1035debugShowActiveSpans id=2 (494.376404,224.684067 494.37619,224.6837 494.375977,224.683334) t=0 tEnd=0.000586871356 windSum=? windValue=1
1036debugShowActiveSpans id=2 (494.375977,224.683334 494.0052,224.055672 494.019165,224.046982) t=0.000586871356 tEnd=1 windSum=? windValue=1
1037debugShowActiveSpans id=3 (494.019165,224.046982 494.029083,224.040833 494.232056,224.345306) t=0 tEnd=1 windSum=? windValue=1
1038debugShowActiveSpans id=4 (494.232056,224.345306 494.273193,224.406982 494.30481,224.474213) t=0 tEnd=1 windSum=? windValue=1
1039debugShowActiveSpans id=5 (494.30481,224.474213 494.329991,224.527724 494.348663,224.58374) t=0 tEnd=0.835281662 windSum=? windValue=1
1040debugShowActiveSpans id=5 (494.348663,224.58374 494.352356,224.594819 494.355774,224.605927) t=0.835281662 tEnd=1 windSum=? windValue=1
1041debugShowActiveSpans id=6 (494.355774,224.605927 494.363708,224.631714 494.370148,224.657471) t=0 tEnd=1 windSum=? windValue=1
1042debugShowActiveSpans id=7 (494.370148,224.657471 494.375275,224.679031) t=0 tEnd=1 windSum=? windValue=1
1043debugShowActiveSpans id=8 (494.375275,224.679031 494.375702,224.680908) t=0 tEnd=0.547725719 windSum=? windValue=1
1044debugShowActiveSpans id=8 (494.375702,224.680908 494.376038,224.682449) t=0.547725719 tEnd=1 windSum=? windValue=1
1045debugShowActiveSpans id=9 (494.376038,224.682449 494.376221,224.683273) t=0 tEnd=1 windSum=? windValue=1
1046debugShowActiveSpans id=10 (494.376221,224.683273 494.376007,224.682281) t=0 tEnd=1 windSum=? windValue=1
1047debugShowActiveSpans id=11 (494.376007,224.682281 494.375671,224.680908) t=0 tEnd=1 windSum=? windValue=1
1048debugShowActiveSpans id=12 (494.375671,224.680908 494.375445,224.679787 494.376129,224.682434) t=0 tEnd=0.809546276 windSum=? windValue=1
1049debugShowActiveSpans id=12 (494.376129,224.682434 494.376227,224.682801 494.376343,224.683243) t=0.809546276 tEnd=0.924341302 windSum=? windValue=1
1050debugShowActiveSpans id=12 (494.376343,224.683243 494.376415,224.683539 494.376495,224.683868) t=0.924341302 tEnd=1 windSum=? windValue=1
1051debugShowActiveSpans id=13 (494.376495,224.683868 494.634338,225.414886 494.895874,225.840698) t=0 tEnd=1 windSum=? windValue=1
1052debugShowActiveSpans id=14 (494.895874,225.840698 495.737305,227.210602 497.243317,227.90419) t=0 tEnd=1 windSum=? windValue=1
1053debugShowActiveSpans id=15 (497.243317,227.90419 502.109781,230.145352 511.897949,224.957367) t=0 tEnd=0.929653854 windSum=? windValue=1
1054debugShowActiveSpans id=15 (511.897949,224.957367 512.63876,224.564718 513.407471,224.129684) t=0.929653854 tEnd=1 windSum=? windValue=1
1055debugShowActiveSpans id=16 (513.407471,224.129684 513.900024,224.999985) t=0 tEnd=1 windSum=? windValue=1
1056debugShowActiveSpans id=17 (513.900024,224.999985 511.897949,224.957367) t=0 tEnd=0.102400099 windSum=? windValue=1
1057debugShowActiveSpans id=17 (511.897949,224.957367 494.348663,224.583771) t=0.102400099 tEnd=1 windSum=? windValue=1
caryclark27c015d2016-09-23 05:47:20 -07001058----------------------------------- coincidence.reorder
caryclark6c3b9cd2016-09-26 05:36:58 -07001059active after coincidence.reorder:
1060debugShowActiveSpans id=1 (494.348663,224.583771 494.360813,224.620209 494.370148,224.657471 0.999263287f) t=0 tEnd=0.737524311 windSum=? windValue=1
1061debugShowActiveSpans id=1 (494.370148,224.657471 494.372825,224.668224 494.375275,224.679031 0.999938607f) t=0.737524311 tEnd=0.95041534 windSum=? windValue=1
1062debugShowActiveSpans id=1 (494.375275,224.679031 494.375488,224.679966 494.375702,224.680908 0.999999523f) t=0.95041534 tEnd=0.968840505 windSum=? windValue=1
1063debugShowActiveSpans id=1 (494.375702,224.680908 494.375872,224.681675 494.376038,224.682449 0.999999702f) t=0.968840505 tEnd=0.984064836 windSum=? windValue=1
1064debugShowActiveSpans id=1 (494.376038,224.682449 494.376136,224.68286 494.376221,224.683273 0.99999994f) t=0.984064836 tEnd=0.992175496 windSum=? windValue=1
1065debugShowActiveSpans id=1 (494.376221,224.683273 494.376316,224.683669 494.376404,224.684067 0.99999994f) t=0.992175496 tEnd=1 windSum=? windValue=1
1066debugShowActiveSpans id=2 (494.376404,224.684067 494.37619,224.6837 494.375977,224.683334) t=0 tEnd=0.000586871356 windSum=? windValue=1
1067debugShowActiveSpans id=2 (494.375977,224.683334 494.0052,224.055672 494.019165,224.046982) t=0.000586871356 tEnd=1 windSum=? windValue=1
1068debugShowActiveSpans id=3 (494.019165,224.046982 494.029083,224.040833 494.232056,224.345306) t=0 tEnd=1 windSum=? windValue=1
1069debugShowActiveSpans id=4 (494.232056,224.345306 494.273193,224.406982 494.30481,224.474213) t=0 tEnd=1 windSum=? windValue=1
1070debugShowActiveSpans id=5 (494.30481,224.474213 494.329991,224.527724 494.348663,224.58374) t=0 tEnd=0.835281662 windSum=? windValue=1
1071debugShowActiveSpans id=5 (494.348663,224.58374 494.352356,224.594819 494.355774,224.605927) t=0.835281662 tEnd=1 windSum=? windValue=1
1072debugShowActiveSpans id=6 (494.355774,224.605927 494.363708,224.631714 494.370148,224.657471) t=0 tEnd=1 windSum=? windValue=1
1073debugShowActiveSpans id=7 (494.370148,224.657471 494.375275,224.679031) t=0 tEnd=1 windSum=? windValue=1
1074debugShowActiveSpans id=8 (494.375275,224.679031 494.375702,224.680908) t=0 tEnd=0.547725719 windSum=? windValue=1
1075debugShowActiveSpans id=8 (494.375702,224.680908 494.376038,224.682449) t=0.547725719 tEnd=1 windSum=? windValue=1
1076debugShowActiveSpans id=9 (494.376038,224.682449 494.376221,224.683273) t=0 tEnd=1 windSum=? windValue=1
1077debugShowActiveSpans id=10 (494.376221,224.683273 494.376007,224.682281) t=0 tEnd=1 windSum=? windValue=1
1078debugShowActiveSpans id=11 (494.376007,224.682281 494.375671,224.680908) t=0 tEnd=1 windSum=? windValue=1
1079debugShowActiveSpans id=12 (494.375671,224.680908 494.375445,224.679787 494.376129,224.682434) t=0 tEnd=0.809546276 windSum=? windValue=1
1080debugShowActiveSpans id=12 (494.376129,224.682434 494.376227,224.682801 494.376343,224.683243) t=0.809546276 tEnd=0.924341302 windSum=? windValue=1
1081debugShowActiveSpans id=12 (494.376343,224.683243 494.376415,224.683539 494.376495,224.683868) t=0.924341302 tEnd=1 windSum=? windValue=1
1082debugShowActiveSpans id=13 (494.376495,224.683868 494.634338,225.414886 494.895874,225.840698) t=0 tEnd=1 windSum=? windValue=1
1083debugShowActiveSpans id=14 (494.895874,225.840698 495.737305,227.210602 497.243317,227.90419) t=0 tEnd=1 windSum=? windValue=1
1084debugShowActiveSpans id=15 (497.243317,227.90419 502.109781,230.145352 511.897949,224.957367) t=0 tEnd=0.929653854 windSum=? windValue=1
1085debugShowActiveSpans id=15 (511.897949,224.957367 512.63876,224.564718 513.407471,224.129684) t=0.929653854 tEnd=1 windSum=? windValue=1
1086debugShowActiveSpans id=16 (513.407471,224.129684 513.900024,224.999985) t=0 tEnd=1 windSum=? windValue=1
1087debugShowActiveSpans id=17 (513.900024,224.999985 511.897949,224.957367) t=0 tEnd=0.102400099 windSum=? windValue=1
1088debugShowActiveSpans id=17 (511.897949,224.957367 494.348663,224.583771) t=0.102400099 tEnd=1 windSum=? windValue=1
1089markDone id=12 (494.375671,224.680908 494.375397,224.67955 494.376495,224.683868) t=0.924341302 [44] (494.376343,224.683243) tEnd=1 newWindSum=? newOppSum=? oppSum=? windSum=? windValue=0 oppValue=0
1090markDone id=2 (494.376404,224.684067 494.005188,224.055679 494.019165,224.046982) t=0 [3] (494.376404,224.684067) tEnd=0.000586871356 newWindSum=? newOppSum=? oppSum=? windSum=? windValue=0 oppValue=0
1091markDone id=11 (494.376007,224.682281 494.375671,224.680908) t=0 [21] (494.376007,224.682281) tEnd=1 newWindSum=? newOppSum=? oppSum=? windSum=? windValue=0 oppValue=0
1092markDone id=12 (494.375671,224.680908 494.375397,224.67955 494.376495,224.683868) t=0 [23] (494.375671,224.680908) tEnd=0.809546276 newWindSum=? newOppSum=? oppSum=? windSum=? windValue=0 oppValue=0
1093markDone id=10 (494.376221,224.683273 494.376007,224.682281) t=0 [19] (494.376221,224.683273) tEnd=1 newWindSum=? newOppSum=? oppSum=? windSum=? windValue=0 oppValue=0
1094markDone id=12 (494.375671,224.680908 494.375397,224.67955 494.376495,224.683868) t=0.809546276 [43] (494.376129,224.682434) tEnd=0.924341302 newWindSum=? newOppSum=? oppSum=? windSum=? windValue=0 oppValue=0
1095markDone id=1 (494.348663,224.583771 494.365143,224.633194 494.376404,224.684067) t=0.984064836 [37] (494.376038,224.682449) tEnd=0.992175496 newWindSum=? newOppSum=? oppSum=? windSum=? windValue=0 oppValue=0
1096markDone id=1 (494.348663,224.583771 494.365143,224.633194 494.376404,224.684067) t=0.95041534 [36] (494.375275,224.679031) tEnd=0.968840505 newWindSum=? newOppSum=? oppSum=? windSum=? windValue=0 oppValue=0
1097markDone id=1 (494.348663,224.583771 494.365143,224.633194 494.376404,224.684067) t=0.968840505 [39] (494.375702,224.680908) tEnd=0.984064836 newWindSum=? newOppSum=? oppSum=? windSum=? windValue=0 oppValue=0
1098markDone id=1 (494.348663,224.583771 494.365143,224.633194 494.376404,224.684067) t=0.737524311 [35] (494.370148,224.657471) tEnd=0.95041534 newWindSum=? newOppSum=? oppSum=? windSum=? windValue=0 oppValue=0
caryclark27c015d2016-09-23 05:47:20 -07001099----------------------------------- pairs->apply
caryclark6c3b9cd2016-09-26 05:36:58 -07001100active after pairs->apply:
1101debugShowActiveSpans id=1 (494.348663,224.583771 494.360813,224.620209 494.370148,224.657471 0.999263287f) t=0 tEnd=0.737524311 windSum=? windValue=1
1102debugShowActiveSpans id=1 (494.376221,224.683273 494.376316,224.683669 494.376404,224.684067 0.99999994f) t=0.992175496 tEnd=1 windSum=? windValue=1
1103debugShowActiveSpans id=2 (494.375977,224.683334 494.0052,224.055672 494.019165,224.046982) t=0.000586871356 tEnd=1 windSum=? windValue=1
1104debugShowActiveSpans id=3 (494.019165,224.046982 494.029083,224.040833 494.232056,224.345306) t=0 tEnd=1 windSum=? windValue=1
1105debugShowActiveSpans id=4 (494.232056,224.345306 494.273193,224.406982 494.30481,224.474213) t=0 tEnd=1 windSum=? windValue=1
1106debugShowActiveSpans id=5 (494.30481,224.474213 494.329991,224.527724 494.348663,224.58374) t=0 tEnd=0.835281662 windSum=? windValue=1
1107debugShowActiveSpans id=5 (494.348663,224.58374 494.352356,224.594819 494.355774,224.605927) t=0.835281662 tEnd=1 windSum=? windValue=1
1108debugShowActiveSpans id=6 (494.355774,224.605927 494.363708,224.631714 494.370148,224.657471) t=0 tEnd=1 windSum=? windValue=1
1109debugShowActiveSpans id=7 (494.370148,224.657471 494.375275,224.679031) t=0 tEnd=1 windSum=? windValue=2
1110debugShowActiveSpans id=8 (494.375275,224.679031 494.375702,224.680908) t=0 tEnd=0.547725719 windSum=? windValue=2
1111debugShowActiveSpans id=8 (494.375702,224.680908 494.376038,224.682449) t=0.547725719 tEnd=1 windSum=? windValue=2
1112debugShowActiveSpans id=9 (494.376038,224.682449 494.376221,224.683273) t=0 tEnd=1 windSum=? windValue=2
1113debugShowActiveSpans id=13 (494.376495,224.683868 494.634338,225.414886 494.895874,225.840698) t=0 tEnd=1 windSum=? windValue=1
1114debugShowActiveSpans id=14 (494.895874,225.840698 495.737305,227.210602 497.243317,227.90419) t=0 tEnd=1 windSum=? windValue=1
1115debugShowActiveSpans id=15 (497.243317,227.90419 502.109781,230.145352 511.897949,224.957367) t=0 tEnd=0.929653854 windSum=? windValue=1
1116debugShowActiveSpans id=15 (511.897949,224.957367 512.63876,224.564718 513.407471,224.129684) t=0.929653854 tEnd=1 windSum=? windValue=1
1117debugShowActiveSpans id=16 (513.407471,224.129684 513.900024,224.999985) t=0 tEnd=1 windSum=? windValue=1
1118debugShowActiveSpans id=17 (513.900024,224.999985 511.897949,224.957367) t=0 tEnd=0.102400099 windSum=? windValue=1
1119debugShowActiveSpans id=17 (511.897949,224.957367 494.348663,224.583771) t=0.102400099 tEnd=1 windSum=? windValue=1
caryclark27c015d2016-09-23 05:47:20 -07001120----------------------------------- pairs->findOverlaps
caryclark6c3b9cd2016-09-26 05:36:58 -07001121active after pairs->findOverlaps:
1122debugShowActiveSpans id=1 (494.348663,224.583771 494.360813,224.620209 494.370148,224.657471 0.999263287f) t=0 tEnd=0.737524311 windSum=? windValue=1
1123debugShowActiveSpans id=1 (494.376221,224.683273 494.376316,224.683669 494.376404,224.684067 0.99999994f) t=0.992175496 tEnd=1 windSum=? windValue=1
1124debugShowActiveSpans id=2 (494.375977,224.683334 494.0052,224.055672 494.019165,224.046982) t=0.000586871356 tEnd=1 windSum=? windValue=1
1125debugShowActiveSpans id=3 (494.019165,224.046982 494.029083,224.040833 494.232056,224.345306) t=0 tEnd=1 windSum=? windValue=1
1126debugShowActiveSpans id=4 (494.232056,224.345306 494.273193,224.406982 494.30481,224.474213) t=0 tEnd=1 windSum=? windValue=1
1127debugShowActiveSpans id=5 (494.30481,224.474213 494.329991,224.527724 494.348663,224.58374) t=0 tEnd=0.835281662 windSum=? windValue=1
1128debugShowActiveSpans id=5 (494.348663,224.58374 494.352356,224.594819 494.355774,224.605927) t=0.835281662 tEnd=1 windSum=? windValue=1
1129debugShowActiveSpans id=6 (494.355774,224.605927 494.363708,224.631714 494.370148,224.657471) t=0 tEnd=1 windSum=? windValue=1
1130debugShowActiveSpans id=7 (494.370148,224.657471 494.375275,224.679031) t=0 tEnd=1 windSum=? windValue=2
1131debugShowActiveSpans id=8 (494.375275,224.679031 494.375702,224.680908) t=0 tEnd=0.547725719 windSum=? windValue=2
1132debugShowActiveSpans id=8 (494.375702,224.680908 494.376038,224.682449) t=0.547725719 tEnd=1 windSum=? windValue=2
1133debugShowActiveSpans id=9 (494.376038,224.682449 494.376221,224.683273) t=0 tEnd=1 windSum=? windValue=2
1134debugShowActiveSpans id=13 (494.376495,224.683868 494.634338,225.414886 494.895874,225.840698) t=0 tEnd=1 windSum=? windValue=1
1135debugShowActiveSpans id=14 (494.895874,225.840698 495.737305,227.210602 497.243317,227.90419) t=0 tEnd=1 windSum=? windValue=1
1136debugShowActiveSpans id=15 (497.243317,227.90419 502.109781,230.145352 511.897949,224.957367) t=0 tEnd=0.929653854 windSum=? windValue=1
1137debugShowActiveSpans id=15 (511.897949,224.957367 512.63876,224.564718 513.407471,224.129684) t=0.929653854 tEnd=1 windSum=? windValue=1
1138debugShowActiveSpans id=16 (513.407471,224.129684 513.900024,224.999985) t=0 tEnd=1 windSum=? windValue=1
1139debugShowActiveSpans id=17 (513.900024,224.999985 511.897949,224.957367) t=0 tEnd=0.102400099 windSum=? windValue=1
1140debugShowActiveSpans id=17 (511.897949,224.957367 494.348663,224.583771) t=0.102400099 tEnd=1 windSum=? windValue=1
1141sortAngles [1] tStart=0 [1]
1142after [1/1] 25/25 tStart=0 tEnd=0.737524311 < [5/7] 25/25 tStart=0.835281662 tEnd=1 < [5/6] 9/9 tStart=0.835281662 tEnd=0 T 12
1143afterPart {{{{494.348663,224.58374}, {494.360813,224.620178}, {494.370148,224.65744}}}, 0.999263287} id=1
1144afterPart {{{494.348663,224.58374}, {494.352356,224.594819}, {494.355774,224.605927}}} id=5
1145afterPart {{{494.348663,224.58374}, {494.329991,224.527724}, {494.30481,224.474213}}} id=5
1146after [1/1] 25/25 tStart=0 tEnd=0.737524311 < [17/22] 29/29 tStart=1 tEnd=0.102400099 < [5/7] 25/25 tStart=0.835281662 tEnd=1 T 5
1147afterPart {{{{494.348663,224.583771}, {494.360813,224.620209}, {494.370148,224.657471}}}, 0.999263287} id=1
1148afterPart {{{494.348663,224.583771}, {511.897949,224.957367}}} id=17
1149afterPart {{{494.348663,224.583771}, {494.352356,224.59485}, {494.355774,224.605957}}} id=5
1150sortAngles [1] tStart=0.737524311 [35]
1151after [1/2] 9/9 tStart=0.737524311 tEnd=0 < [7/9] 25/25 tStart=0 tEnd=1 < [6/8] 9/9 tStart=1 tEnd=0 T 5
1152afterPart {{{{494.370148,224.657471}, {494.360813,224.620209}, {494.348663,224.583771}}}, 0.999263287} id=1
1153afterPart {{{494.370148,224.657471}, {494.375275,224.679031}}} id=7
1154afterPart {{{494.370148,224.657471}, {494.363708,224.631714}, {494.355774,224.605927}}} id=6
1155sortAngles [1] tStart=0.992175496 [38]
1156after [1/3] 25/25 tStart=0.992175496 tEnd=1 < [9/16] 9/9 tStart=1 tEnd=0 < [2/5] 9/9 tStart=0.000586871356 tEnd=1 T 11
1157afterPart {{{{494.376221,224.683273}, {494.376404,224.684067}, {494.376404,224.684067}}}, 0.99999994} id=1
1158afterPart {{{494.376221,224.683273}, {494.376038,224.682449}}} id=9
1159afterPart {{{494.376221,224.683273}, {494.005444,224.055611}, {494.019409,224.046921}}} id=2
1160sortAngles [1] tStart=1 [2]
1161sortAngles [2] tStart=0.000586871356 [40]
1162sortAngles [5] tStart=0.835281662 [41]
1163sortAngles [6] tStart=1 [12]
1164sortAngles [7] tStart=0 [13]
1165sortAngles [7] tStart=1 [14]
1166sortAngles [8] tStart=0 [15]
1167sortAngles [8] tStart=0.547725719 [42]
1168sortAngles [8] tStart=1 [16]
1169sortAngles [9] tStart=0 [17]
1170sortAngles [9] tStart=1 [18]
1171sortAngles [13] tStart=0 [25]
1172sortAngles [15] tStart=0.929653854 [45]
1173after [15/18] 17/17 tStart=0.929653854 tEnd=0 < [17/20] 29/29 tStart=0.102400099 tEnd=0 < [15/19] 1/1 tStart=0.929653854 tEnd=1 T 4
1174afterPart {{{511.897949,224.957367}, {502.109781,230.145352}, {497.243317,227.90419}}} id=15
1175afterPart {{{511.897949,224.957367}, {513.900024,224.999985}}} id=17
1176afterPart {{{511.897949,224.957367}, {512.63876,224.564718}, {513.407471,224.129684}}} id=15
1177after [15/18] 17/17 tStart=0.929653854 tEnd=0 < [17/21] 13/13 tStart=0.102400099 tEnd=1 < [17/20] 29/29 tStart=0.102400099 tEnd=0 F 4
1178afterPart {{{511.897949,224.957367}, {502.109781,230.145352}, {497.243317,227.90419}}} id=15
1179afterPart {{{511.897949,224.957367}, {494.348663,224.583771}}} id=17
1180afterPart {{{511.897949,224.957367}, {513.900024,224.999985}}} id=17
1181after [17/20] 29/29 tStart=0.102400099 tEnd=0 < [17/21] 13/13 tStart=0.102400099 tEnd=1 < [15/19] 1/1 tStart=0.929653854 tEnd=1 F 4
1182afterPart {{{511.897949,224.957367}, {513.900024,224.999985}}} id=17
1183afterPart {{{511.897949,224.957367}, {494.348663,224.583771}}} id=17
1184afterPart {{{511.897949,224.957367}, {512.63876,224.564718}, {513.407471,224.129684}}} id=15
1185after [15/19] 1/1 tStart=0.929653854 tEnd=1 < [17/21] 13/13 tStart=0.102400099 tEnd=1 < [15/18] 17/17 tStart=0.929653854 tEnd=0 T 4
1186afterPart {{{511.897949,224.957367}, {512.63876,224.564718}, {513.407471,224.129684}}} id=15
1187afterPart {{{511.897949,224.957367}, {494.348663,224.583771}}} id=17
1188afterPart {{{511.897949,224.957367}, {502.109781,230.145352}, {497.243317,227.90419}}} id=15
1189sortAngles [17] tStart=0.102400099 [46]
1190sortAngles [17] tStart=1 [34]
1191coinSpan - id=12 t=0.924341302 tEnd=1
1192coinSpan + id=2 t=0.000586871356 tEnd=0
1193coinSpan - id=2 t=0 tEnd=0.000586871356
1194coinSpan + id=1 t=1 tEnd=0.992175496
1195coinSpan - id=11 t=0 tEnd=1
1196coinSpan + id=12 t=0.809546276 tEnd=0
1197coinSpan - id=10 t=0 tEnd=1
1198coinSpan + id=12 t=0.924341302 tEnd=0.809546276
1199coinSpan - id=9 t=0 tEnd=1
1200coinSpan + id=12 t=0.809546276 tEnd=0.924341302
1201coinSpan - id=9 t=0 tEnd=1
1202coinSpan + id=10 t=1 tEnd=0
1203coinSpan - id=8 t=0.547725719 tEnd=1
1204coinSpan + id=12 t=0 tEnd=0.809546276
1205coinSpan - id=8 t=0.547725719 tEnd=1
1206coinSpan + id=11 t=1 tEnd=0
1207coinSpan - id=12 t=0 tEnd=1
1208coinSpan + id=1 t=0.968840505 tEnd=1
1209coinSpan - id=11 t=0 tEnd=1
1210coinSpan + id=1 t=0.984064836 tEnd=0.968840505
1211coinSpan - id=10 t=0 tEnd=1
1212coinSpan + id=1 t=0.992175496 tEnd=0.984064836
1213coinSpan - id=9 t=0 tEnd=1
1214coinSpan + id=1 t=0.984064836 tEnd=0.992175496
1215coinSpan - id=8 t=0 tEnd=1
1216coinSpan + id=1 t=0.95041534 tEnd=0.984064836
1217coinSpan - id=7 t=0 tEnd=1
1218coinSpan + id=1 t=0.737524311 tEnd=0.95041534
1219debugShowActiveSpans id=1 (494.348663,224.583771 494.360813,224.620209 494.370148,224.657471 0.999263287f) t=0 tEnd=0.737524311 windSum=? windValue=1
1220debugShowActiveSpans id=1 (494.376221,224.683273 494.376316,224.683669 494.376404,224.684067 0.99999994f) t=0.992175496 tEnd=1 windSum=? windValue=1
1221debugShowActiveSpans id=2 (494.375977,224.683334 494.0052,224.055672 494.019165,224.046982) t=0.000586871356 tEnd=1 windSum=? windValue=1
1222debugShowActiveSpans id=3 (494.019165,224.046982 494.029083,224.040833 494.232056,224.345306) t=0 tEnd=1 windSum=? windValue=1
1223debugShowActiveSpans id=4 (494.232056,224.345306 494.273193,224.406982 494.30481,224.474213) t=0 tEnd=1 windSum=? windValue=1
1224debugShowActiveSpans id=5 (494.30481,224.474213 494.329991,224.527724 494.348663,224.58374) t=0 tEnd=0.835281662 windSum=? windValue=1
1225debugShowActiveSpans id=5 (494.348663,224.58374 494.352356,224.594819 494.355774,224.605927) t=0.835281662 tEnd=1 windSum=? windValue=1
1226debugShowActiveSpans id=6 (494.355774,224.605927 494.363708,224.631714 494.370148,224.657471) t=0 tEnd=1 windSum=? windValue=1
1227debugShowActiveSpans id=7 (494.370148,224.657471 494.375275,224.679031) t=0 tEnd=1 windSum=? windValue=2
1228debugShowActiveSpans id=8 (494.375275,224.679031 494.375702,224.680908) t=0 tEnd=0.547725719 windSum=? windValue=2
1229debugShowActiveSpans id=8 (494.375702,224.680908 494.376038,224.682449) t=0.547725719 tEnd=1 windSum=? windValue=2
1230debugShowActiveSpans id=9 (494.376038,224.682449 494.376221,224.683273) t=0 tEnd=1 windSum=? windValue=2
1231debugShowActiveSpans id=13 (494.376495,224.683868 494.634338,225.414886 494.895874,225.840698) t=0 tEnd=1 windSum=? windValue=1
1232debugShowActiveSpans id=14 (494.895874,225.840698 495.737305,227.210602 497.243317,227.90419) t=0 tEnd=1 windSum=? windValue=1
1233debugShowActiveSpans id=15 (497.243317,227.90419 502.109781,230.145352 511.897949,224.957367) t=0 tEnd=0.929653854 windSum=? windValue=1
1234debugShowActiveSpans id=15 (511.897949,224.957367 512.63876,224.564718 513.407471,224.129684) t=0.929653854 tEnd=1 windSum=? windValue=1
1235debugShowActiveSpans id=16 (513.407471,224.129684 513.900024,224.999985) t=0 tEnd=1 windSum=? windValue=1
1236debugShowActiveSpans id=17 (513.900024,224.999985 511.897949,224.957367) t=0 tEnd=0.102400099 windSum=? windValue=1
1237debugShowActiveSpans id=17 (511.897949,224.957367 494.348663,224.583771) t=0.102400099 tEnd=1 windSum=? windValue=1
1238sortableTop dir=kLeft seg=1 t=0.368762156 pt=(494.360107,224.620407)
1239sortableTop [0] valid=1 operand=0 span=40 ccw=1 seg=2 {{{494.376404f, 224.684067f}, {494.005188f, 224.055679f}, {494.019165f, 224.046982f}}} t=0.0519857546 pt=(494.338837,224.620407) slope=(-0.351191278,-0.596172402)
1240sortableTop [1] valid=0 operand=0 span=11 ccw=1 seg=6 {{{494.355774f, 224.605927f}, {494.363708f, 224.631714f}, {494.370148f, 224.657471f}}} t=0.280815892 pt=(494.360107,224.620407) slope=(0,0)
1241sortableTop [2] valid=1 operand=0 span=1 ccw=0 seg=1 {{{{494.348663f, 224.583771f}, {494.365143f, 224.633194f}, {494.376404f, 224.684067f}}}, 0.998645842f} t=0.368762156 pt=(494.360107,224.620407) slope=(0.0145441391,0.0499217341)
1242markWinding id=2 (494.376404,224.684067 494.005188,224.055679 494.019165,224.046982) t=0.000586871356 [40] (494.375977,224.683334) tEnd=1 newWindSum=-1 newOppSum=0 oppSum=0 windSum=-1 windValue=1 oppValue=0
1243markWinding id=3 (494.019165,224.046982 494.029083,224.040833 494.232056,224.345306) t=0 [5] (494.019165,224.046982) tEnd=1 newWindSum=-1 newOppSum=0 oppSum=? windSum=? windValue=1 oppValue=0
1244markWinding id=4 (494.232056,224.345306 494.273193,224.406982 494.30481,224.474213) t=0 [7] (494.232056,224.345306) tEnd=1 newWindSum=-1 newOppSum=0 oppSum=? windSum=? windValue=1 oppValue=0
1245markWinding id=5 (494.30481,224.474213 494.334961,224.538284 494.355774,224.605927) t=0 [9] (494.30481,224.474213) tEnd=0.835281662 newWindSum=-1 newOppSum=0 oppSum=? windSum=? windValue=1 oppValue=0
1246markWinding id=2 (494.376404,224.684067 494.005188,224.055679 494.019165,224.046982) t=0.000586871356 [40] (494.375977,224.683334) tEnd=1 newWindSum=-1 newOppSum=0 oppSum=0 windSum=-1 windValue=1 oppValue=0
1247sortableTop dir=kLeft seg=1 t=0.996087748 pt=(494.376312,224.68367)
1248sortableTop [0] valid=1 operand=0 span=38 ccw=0 seg=1 {{{{494.348663f, 224.583771f}, {494.365143f, 224.633194f}, {494.376404f, 224.684067f}}}, 0.998645842f} t=0.996087748 pt=(494.376312,224.68367) slope=(0.011266272,0.0507987787)
1249markWinding id=1 (494.348663,224.583771 494.365143,224.633194 494.376404,224.684067) t=0.992175496 [38] (494.376221,224.683273) tEnd=1 newWindSum=1 newOppSum=0 oppSum=0 windSum=1 windValue=1 oppValue=0
1250nextChase mismatched signs
1251markWinding id=13 (494.376495,224.683868 494.634338,225.414886 494.895874,225.840698) t=0 [25] (494.376495,224.683868) tEnd=1 newWindSum=1 newOppSum=0 oppSum=? windSum=? windValue=1 oppValue=0
1252markWinding id=14 (494.895874,225.840698 495.737305,227.210602 497.243317,227.90419) t=0 [27] (494.895874,225.840698) tEnd=1 newWindSum=1 newOppSum=0 oppSum=? windSum=? windValue=1 oppValue=0
1253markWinding id=15 (497.243317,227.90419 502.478027,230.314941 513.407471,224.129684) t=0 [29] (497.243317,227.90419) tEnd=0.929653854 newWindSum=1 newOppSum=0 oppSum=? windSum=? windValue=1 oppValue=0
1254markWinding id=1 (494.348663,224.583771 494.365143,224.633194 494.376404,224.684067) t=0.992175496 [38] (494.376221,224.683273) tEnd=1 newWindSum=1 newOppSum=0 oppSum=0 windSum=1 windValue=1 oppValue=0
1255markWinding id=9 (494.376038,224.682449 494.376221,224.683273) t=0 [17] (494.376038,224.682449) tEnd=1 newWindSum=1 windSum=? windValue=2
1256nextChase mismatched signs
1257markWinding id=8 (494.375275,224.679031 494.376038,224.682449) t=0.547725719 [42] (494.375702,224.680908) tEnd=1 newWindSum=1 windSum=? windValue=2
1258nextChase mismatched signs
1259markWinding id=8 (494.375275,224.679031 494.376038,224.682449) t=0 [15] (494.375275,224.679031) tEnd=0.547725719 newWindSum=1 windSum=? windValue=2
1260nextChase mismatched signs
1261markWinding id=7 (494.370148,224.657471 494.375275,224.679031) t=0 [13] (494.370148,224.657471) tEnd=1 newWindSum=1 windSum=? windValue=2
1262markAngle last seg=7 span=13 windSum=1
1263findNextWinding
1264dumpOne [1/3] next=9/16 sect=25/25 s=0.992175496 [38] e=1 [2] sgn=-1 windVal=1 windSum=1 oppVal=0 oppSum=0
1265dumpOne [9/16] next=2/5 sect=9/9 s=1 [18] e=0 [17] sgn=1 windVal=2 windSum=1
1266dumpOne [2/5] next=1/3 sect=9/9 s=0.000586871356 [40] e=1 [4] sgn=-1 windVal=1 windSum=-1 oppVal=0 oppSum=0
1267markDone id=9 (494.376038,224.682449 494.376221,224.683273) t=0 [17] (494.376038,224.682449) tEnd=1 newWindSum=1 newOppSum=? oppSum=? windSum=1 windValue=2 oppValue=0
1268nextChase mismatched signs
1269markDone id=8 (494.375275,224.679031 494.376038,224.682449) t=0.547725719 [42] (494.375702,224.680908) tEnd=1 newWindSum=1 newOppSum=? oppSum=? windSum=1 windValue=2 oppValue=0
1270nextChase mismatched signs
1271markDone id=8 (494.375275,224.679031 494.376038,224.682449) t=0 [15] (494.375275,224.679031) tEnd=0.547725719 newWindSum=1 newOppSum=? oppSum=? windSum=1 windValue=2 oppValue=0
1272nextChase mismatched signs
1273markDone id=7 (494.370148,224.657471 494.375275,224.679031) t=0 [13] (494.370148,224.657471) tEnd=1 newWindSum=1 newOppSum=? oppSum=? windSum=1 windValue=2 oppValue=0
1274findNextWinding chase.append segment=7 span=13 windSum=1
1275markDone id=1 (494.348663,224.583771 494.365143,224.633194 494.376404,224.684067) t=0.992175496 [38] (494.376221,224.683273) tEnd=1 newWindSum=1 newOppSum=0 oppSum=0 windSum=1 windValue=1 oppValue=0
1276findNextWinding from:[1] to:[2] start=83893016 end=83886272
1277bridgeWinding current id=1 from=(494.376404,224.684067) to=(494.376221,224.683273)
1278findNextWinding simple
1279markDone id=2 (494.376404,224.684067 494.005188,224.055679 494.019165,224.046982) t=0.000586871356 [40] (494.375977,224.683334) tEnd=1 newWindSum=-1 newOppSum=0 oppSum=0 windSum=-1 windValue=1 oppValue=0
1280bridgeWinding current id=2 from=(494.375977,224.683334) to=(494.019165,224.046982)
1281path.moveTo(494.376404,224.684067);
1282path.lineTo(494.376221,224.683273);
1283path.quadTo(494.005188,224.055679, 494.019165,224.046982);
1284findNextWinding simple
1285markDone id=3 (494.019165,224.046982 494.029083,224.040833 494.232056,224.345306) t=0 [5] (494.019165,224.046982) tEnd=1 newWindSum=-1 newOppSum=0 oppSum=0 windSum=-1 windValue=1 oppValue=0
1286bridgeWinding current id=3 from=(494.019165,224.046982) to=(494.232056,224.345306)
1287path.quadTo(494.029083,224.040833, 494.232056,224.345306);
1288findNextWinding simple
1289markDone id=4 (494.232056,224.345306 494.273193,224.406982 494.30481,224.474213) t=0 [7] (494.232056,224.345306) tEnd=1 newWindSum=-1 newOppSum=0 oppSum=0 windSum=-1 windValue=1 oppValue=0
1290bridgeWinding current id=4 from=(494.232056,224.345306) to=(494.30481,224.474213)
1291path.quadTo(494.273193,224.406982, 494.30481,224.474213);
1292markWinding id=1 (494.348663,224.583771 494.365143,224.633194 494.376404,224.684067) t=0 [1] (494.348663,224.583771) tEnd=0.737524311 newWindSum=-1 windSum=? windValue=1
1293markAngle last seg=1 span=35 windSum=?
1294markWinding id=17 (513.900024,224.999985 494.348663,224.583771) t=0.102400099 [46] (511.897949,224.957367) tEnd=1 newWindSum=-1 windSum=? windValue=1
1295markAngle last seg=17 span=46 windSum=-1
1296markWinding id=5 (494.30481,224.474213 494.334961,224.538284 494.355774,224.605927) t=0.835281662 [41] (494.348663,224.58374) tEnd=1 newWindSum=-1 windSum=? windValue=1
1297markWinding id=6 (494.355774,224.605927 494.363708,224.631714 494.370148,224.657471) t=0 [11] (494.355774,224.605927) tEnd=1 newWindSum=-1 windSum=? windValue=1
1298markAngle last seg=6 span=12
1299findNextWinding
1300dumpOne [5/6] next=1/1 sect=9/9 s=0.835281662 [41] e=0 [9] sgn=1 windVal=1 windSum=-1 oppVal=0 oppSum=0
1301dumpOne [1/1] next=17/22 sect=25/25 s=0 [1] e=0.737524311 [35] sgn=-1 windVal=1 windSum=-1
1302dumpOne [17/22] next=5/7 sect=29/29 s=1 [34] e=0.102400099 [46] sgn=1 windVal=1 windSum=-1
1303dumpOne [5/7] next=5/6 sect=25/25 s=0.835281662 [41] e=1 [10] sgn=-1 windVal=1 windSum=-1
1304findNextWinding chase.append segment=1 span=35 windSum=-2147483647
1305findNextWinding chase.append segment=17 span=46 windSum=-1
1306findNextWinding chase.append segment=6 span=12
1307markDone id=5 (494.30481,224.474213 494.334961,224.538284 494.355774,224.605927) t=0 [9] (494.30481,224.474213) tEnd=0.835281662 newWindSum=-1 newOppSum=0 oppSum=0 windSum=-1 windValue=1 oppValue=0
1308findNextWinding from:[5] to:[1] start=4281728 end=83891960
1309bridgeWinding current id=5 from=(494.30481,224.474213) to=(494.348663,224.58374)
1310path.quadTo(494.329987,224.527725, 494.348663,224.58374);
1311findNextWinding
1312dumpOne [1/2] next=7/9 sect=9/9 s=0.737524311 [35] e=0 [1] sgn=1 windVal=1 windSum=-1
1313dumpOne [7/9] next=6/8 sect=25/25 s=0 [13] e=1 [14] sgn=-1 windVal=2 windSum=1 done
1314dumpOne [6/8] next=1/2 sect=9/9 s=1 [12] e=0 [11] sgn=1 windVal=1 windSum=-1
1315markDone id=1 (494.348663,224.583771 494.365143,224.633194 494.376404,224.684067) t=0 [1] (494.348663,224.583771) tEnd=0.737524311 newWindSum=-1 newOppSum=? oppSum=? windSum=-1 windValue=1 oppValue=0
1316findNextWinding from:[1] to:[6] start=83887544 end=83887400
1317bridgeWinding current id=1 from=(494.348663,224.583771) to=(494.370148,224.657471)
1318path.conicTo(494.360809,224.620209, 494.370148,224.657471, 0.999263287);
1319findNextWinding simple
1320markDone id=6 (494.355774,224.605927 494.363708,224.631714 494.370148,224.657471) t=0 [11] (494.355774,224.605927) tEnd=1 newWindSum=-1 newOppSum=? oppSum=? windSum=-1 windValue=1 oppValue=0
1321bridgeWinding current id=6 from=(494.370148,224.657471) to=(494.355774,224.605927)
1322path.quadTo(494.363708,224.631714, 494.355774,224.605927);
1323findNextWinding
1324dumpOne [5/7] next=5/6 sect=25/25 s=0.835281662 [41] e=1 [10] sgn=-1 windVal=1 windSum=-1
1325dumpOne [5/6] next=1/1 sect=9/9 s=0.835281662 [41] e=0 [9] sgn=1 windVal=1 windSum=-1 oppVal=0 oppSum=0 done
1326dumpOne [1/1] next=17/22 sect=25/25 s=0 [1] e=0.737524311 [35] sgn=-1 windVal=1 windSum=-1 done
1327dumpOne [17/22] next=5/7 sect=29/29 s=1 [34] e=0.102400099 [46] sgn=1 windVal=1 windSum=-1
1328markDone id=5 (494.30481,224.474213 494.334961,224.538284 494.355774,224.605927) t=0.835281662 [41] (494.348663,224.58374) tEnd=1 newWindSum=-1 newOppSum=? oppSum=? windSum=-1 windValue=1 oppValue=0
1329findNextWinding from:[5] to:[17] start=83891792 end=83894160
1330bridgeWinding current id=5 from=(494.355774,224.605927) to=(494.348663,224.58374)
1331path.quadTo(494.352356,224.594818, 494.348663,224.58374);
1332markWinding id=17 (513.900024,224.999985 494.348663,224.583771) t=0 [33] (513.900024,224.999985) tEnd=0.102400099 newWindSum=-1 windSum=? windValue=1
1333markWinding id=16 (513.407471,224.129684 513.900024,224.999985) t=0 [31] (513.407471,224.129684) tEnd=1 newWindSum=-1 windSum=? windValue=1
1334markWinding id=15 (497.243317,227.90419 502.478027,230.314941 513.407471,224.129684) t=0.929653854 [45] (511.897949,224.957367) tEnd=1 newWindSum=-1 windSum=? windValue=1
1335markAngle last seg=15 span=45 windSum=-1
1336findNextWinding
1337dumpOne [17/21] next=15/18 sect=13/13 s=0.102400099 [46] e=1 [34] sgn=-1 windVal=1 windSum=-1
1338dumpOne [15/18] next=17/20 sect=17/17 s=0.929653854 [45] e=0 [29] sgn=1 windVal=1 windSum=1 oppVal=0 oppSum=0
1339dumpOne [17/20] next=15/19 sect=29/29 s=0.102400099 [46] e=0 [33] sgn=1 windVal=1 windSum=-1
1340dumpOne [15/19] next=17/21 sect=1/1 s=0.929653854 [45] e=1 [30] sgn=-1 windVal=1 windSum=-1
1341markDone id=17 (513.900024,224.999985 494.348663,224.583771) t=0 [33] (513.900024,224.999985) tEnd=0.102400099 newWindSum=-1 newOppSum=? oppSum=? windSum=-1 windValue=1 oppValue=0
1342markDone id=16 (513.407471,224.129684 513.900024,224.999985) t=0 [31] (513.407471,224.129684) tEnd=1 newWindSum=-1 newOppSum=? oppSum=? windSum=-1 windValue=1 oppValue=0
1343markDone id=15 (497.243317,227.90419 502.478027,230.314941 513.407471,224.129684) t=0.929653854 [45] (511.897949,224.957367) tEnd=1 newWindSum=-1 newOppSum=? oppSum=? windSum=-1 windValue=1 oppValue=0
1344findNextWinding chase.append segment=15 span=45 windSum=-1
1345markDone id=17 (513.900024,224.999985 494.348663,224.583771) t=0.102400099 [46] (511.897949,224.957367) tEnd=1 newWindSum=-1 newOppSum=? oppSum=? windSum=-1 windValue=1 oppValue=0
1346findNextWinding from:[17] to:[15] start=83894016 end=83891024
1347bridgeWinding current id=17 from=(494.348663,224.583771) to=(511.897949,224.957367)
1348findNextWinding simple
1349markDone id=15 (497.243317,227.90419 502.478027,230.314941 513.407471,224.129684) t=0 [29] (497.243317,227.90419) tEnd=0.929653854 newWindSum=1 newOppSum=0 oppSum=0 windSum=1 windValue=1 oppValue=0
1350bridgeWinding current id=15 from=(511.897949,224.957367) to=(497.243317,227.90419)
1351path.lineTo(511.897949,224.957367);
1352path.quadTo(502.109772,230.145355, 497.243317,227.90419);
1353findNextWinding simple
1354markDone id=14 (494.895874,225.840698 495.737305,227.210602 497.243317,227.90419) t=0 [27] (494.895874,225.840698) tEnd=1 newWindSum=1 newOppSum=0 oppSum=0 windSum=1 windValue=1 oppValue=0
1355bridgeWinding current id=14 from=(497.243317,227.90419) to=(494.895874,225.840698)
1356path.quadTo(495.737305,227.210602, 494.895874,225.840698);
1357nextChase mismatched signs
1358findNextWinding simple
1359markDone id=13 (494.376495,224.683868 494.634338,225.414886 494.895874,225.840698) t=0 [25] (494.376495,224.683868) tEnd=1 newWindSum=1 newOppSum=0 oppSum=0 windSum=1 windValue=1 oppValue=0
1360bridgeWinding current id=13 from=(494.895874,225.840698) to=(494.376495,224.683868)
1361path.quadTo(494.634338,225.414886, 494.376495,224.683868);
caryclark27c015d2016-09-23 05:47:20 -07001362path.close();
caryclarkdac1d172014-06-17 05:15:38 -07001363</div>
caryclark26ad22a2015-10-16 09:03:38 -07001364
caryclarkdac1d172014-06-17 05:15:38 -07001365</div>
1366
1367<script type="text/javascript">
1368
caryclark55888e42016-07-18 10:01:36 -07001369 var testDivs = [
caryclark6c3b9cd2016-09-26 05:36:58 -07001370 tiger8b_h_1,
caryclark30b9fdd2016-08-31 14:36:29 -07001371 ];
caryclarkdac1d172014-06-17 05:15:38 -07001372
1373var decimal_places = 3; // make this 3 to show more precision
1374
1375var tests = [];
1376var testLines = [];
1377var testTitles = [];
1378var testIndex = 0;
1379var ctx;
1380
1381var xmin, xmax, focusXmin, focusXmax;
1382var ymin, ymax, focusYmin, focusYmax;
1383var scale;
1384var mouseX, mouseY;
1385var srcLeft, srcTop;
1386var screenWidth, screenHeight;
caryclark1049f122015-04-20 08:31:59 -07001387var drawnPts, drawnLines, drawnQuads, drawnConics, drawnCubics;
caryclarkdac1d172014-06-17 05:15:38 -07001388var curveT = 0;
1389
1390var pt_labels = 2;
1391var collect_bounds = false;
1392var control_lines = 0;
1393var curve_t = false;
1394var debug_xy = 1;
1395var focus_enabled = false;
1396var focus_on_selection = false;
1397var step_limit = 0;
1398var draw_active = false;
1399var draw_add = false;
1400var draw_angle = 0;
caryclark624637c2015-05-11 07:21:27 -07001401var draw_coincidence = false;
caryclarkdac1d172014-06-17 05:15:38 -07001402var draw_deriviatives = 0;
1403var draw_hints = false;
caryclarkdac1d172014-06-17 05:15:38 -07001404var draw_id = false;
1405var draw_intersection = 0;
1406var draw_intersectT = false;
1407var draw_legend = true;
1408var draw_log = false;
1409var draw_mark = false;
1410var draw_midpoint = false;
1411var draw_op = 0;
1412var draw_sequence = false;
1413var draw_sort = 0;
caryclark03b03ca2015-04-23 09:13:37 -07001414var draw_top = false;
caryclarkdac1d172014-06-17 05:15:38 -07001415var draw_path = 3;
1416var draw_computed = 0;
1417var retina_scale = !!window.devicePixelRatio;
1418
1419var activeCount = 0;
1420var addCount = 0;
1421var angleCount = 0;
caryclark624637c2015-05-11 07:21:27 -07001422var coinCount = 0;
caryclarkdac1d172014-06-17 05:15:38 -07001423var opCount = 0;
1424var sectCount = 0;
1425var sortCount = 0;
caryclark03b03ca2015-04-23 09:13:37 -07001426var topCount = 0;
caryclarkdac1d172014-06-17 05:15:38 -07001427var markCount = 0;
1428var activeMax = 0;
1429var addMax = 0;
1430var angleMax = 0;
caryclark624637c2015-05-11 07:21:27 -07001431var coinMax = 0;
caryclarkdac1d172014-06-17 05:15:38 -07001432var sectMax = 0;
1433var sectMax2 = 0;
1434var sortMax = 0;
caryclark03b03ca2015-04-23 09:13:37 -07001435var topMax = 0;
caryclarkdac1d172014-06-17 05:15:38 -07001436var markMax = 0;
1437var opMax = 0;
1438var stepMax = 0;
1439var lastIndex = 0;
1440var hasPath = false;
caryclark26ad22a2015-10-16 09:03:38 -07001441var hasAlignedPath = false;
caryclarkdac1d172014-06-17 05:15:38 -07001442var hasComputedPath = false;
caryclark54359292015-03-26 07:52:43 -07001443var angleBetween = false;
1444var afterIndex = 0;
caryclarkdac1d172014-06-17 05:15:38 -07001445
1446var firstActiveSpan = -1;
1447var logStart = -1;
1448var logRange = 0;
1449
1450var SPAN_ID = 0;
1451var SPAN_X1 = SPAN_ID + 1;
1452var SPAN_Y1 = SPAN_X1 + 1;
1453var SPAN_X2 = SPAN_Y1 + 1;
1454var SPAN_Y2 = SPAN_X2 + 1;
caryclark1049f122015-04-20 08:31:59 -07001455
caryclark55888e42016-07-18 10:01:36 -07001456var SPAN_L_TX = SPAN_Y2 + 1;
caryclarkdac1d172014-06-17 05:15:38 -07001457var SPAN_L_TY = SPAN_L_TX + 1;
caryclark55888e42016-07-18 10:01:36 -07001458var SPAN_L_OTHER = SPAN_L_TY + 1;
caryclarkdac1d172014-06-17 05:15:38 -07001459var SPAN_L_OTHERT = SPAN_L_OTHER + 1;
1460var SPAN_L_OTHERI = SPAN_L_OTHERT + 1;
1461var SPAN_L_SUM = SPAN_L_OTHERI + 1;
1462var SPAN_L_VAL = SPAN_L_SUM + 1;
1463var SPAN_L_OPP = SPAN_L_VAL + 1;
1464
1465var SPAN_X3 = SPAN_Y2 + 1;
1466var SPAN_Y3 = SPAN_X3 + 1;
caryclark1049f122015-04-20 08:31:59 -07001467
caryclark55888e42016-07-18 10:01:36 -07001468var SPAN_Q_TX = SPAN_Y3 + 1;
caryclarkdac1d172014-06-17 05:15:38 -07001469var SPAN_Q_TY = SPAN_Q_TX + 1;
caryclark55888e42016-07-18 10:01:36 -07001470var SPAN_Q_OTHER = SPAN_Q_TY + 1;
caryclarkdac1d172014-06-17 05:15:38 -07001471var SPAN_Q_OTHERT = SPAN_Q_OTHER + 1;
1472var SPAN_Q_OTHERI = SPAN_Q_OTHERT + 1;
1473var SPAN_Q_SUM = SPAN_Q_OTHERI + 1;
1474var SPAN_Q_VAL = SPAN_Q_SUM + 1;
1475var SPAN_Q_OPP = SPAN_Q_VAL + 1;
1476
caryclark1049f122015-04-20 08:31:59 -07001477var SPAN_K_W = SPAN_Y3 + 1;
caryclark55888e42016-07-18 10:01:36 -07001478var SPAN_K_TX = SPAN_K_W + 1;
caryclark1049f122015-04-20 08:31:59 -07001479var SPAN_K_TY = SPAN_K_TX + 1;
caryclark55888e42016-07-18 10:01:36 -07001480var SPAN_K_OTHER = SPAN_K_TY + 1;
caryclark1049f122015-04-20 08:31:59 -07001481var SPAN_K_OTHERT = SPAN_K_OTHER + 1;
1482var SPAN_K_OTHERI = SPAN_K_OTHERT + 1;
1483var SPAN_K_SUM = SPAN_K_OTHERI + 1;
1484var SPAN_K_VAL = SPAN_K_SUM + 1;
1485var SPAN_K_OPP = SPAN_K_VAL + 1;
1486
caryclarkdac1d172014-06-17 05:15:38 -07001487var SPAN_X4 = SPAN_Y3 + 1;
1488var SPAN_Y4 = SPAN_X4 + 1;
caryclark1049f122015-04-20 08:31:59 -07001489
caryclark55888e42016-07-18 10:01:36 -07001490var SPAN_C_TX = SPAN_Y4 + 1;
caryclarkdac1d172014-06-17 05:15:38 -07001491var SPAN_C_TY = SPAN_C_TX + 1;
caryclark55888e42016-07-18 10:01:36 -07001492var SPAN_C_OTHER = SPAN_C_TY + 1;
caryclarkdac1d172014-06-17 05:15:38 -07001493var SPAN_C_OTHERT = SPAN_C_OTHER + 1;
1494var SPAN_C_OTHERI = SPAN_C_OTHERT + 1;
1495var SPAN_C_SUM = SPAN_C_OTHERI + 1;
1496var SPAN_C_VAL = SPAN_C_SUM + 1;
1497var SPAN_C_OPP = SPAN_C_VAL + 1;
1498
1499var ACTIVE_LINE_SPAN = 1;
1500var ACTIVE_QUAD_SPAN = ACTIVE_LINE_SPAN + 1;
caryclark1049f122015-04-20 08:31:59 -07001501var ACTIVE_CONIC_SPAN = ACTIVE_QUAD_SPAN + 1;
1502var ACTIVE_CUBIC_SPAN = ACTIVE_CONIC_SPAN + 1;
caryclarkdac1d172014-06-17 05:15:38 -07001503
1504var ADD_MOVETO = ACTIVE_CUBIC_SPAN + 1;
1505var ADD_LINETO = ADD_MOVETO + 1;
1506var ADD_QUADTO = ADD_LINETO + 1;
caryclark1049f122015-04-20 08:31:59 -07001507var ADD_CONICTO = ADD_QUADTO + 1;
1508var ADD_CUBICTO = ADD_CONICTO + 1;
caryclarkdac1d172014-06-17 05:15:38 -07001509var ADD_CLOSE = ADD_CUBICTO + 1;
1510var ADD_FILL = ADD_CLOSE + 1;
1511
1512var PATH_LINE = ADD_FILL + 1;
1513var PATH_QUAD = PATH_LINE + 1;
caryclark1049f122015-04-20 08:31:59 -07001514var PATH_CONIC = PATH_QUAD + 1;
1515var PATH_CUBIC = PATH_CONIC + 1;
caryclarkdac1d172014-06-17 05:15:38 -07001516
1517var INTERSECT_LINE = PATH_CUBIC + 1;
1518var INTERSECT_LINE_2 = INTERSECT_LINE + 1;
1519var INTERSECT_LINE_NO = INTERSECT_LINE_2 + 1;
1520var INTERSECT_QUAD_LINE = INTERSECT_LINE_NO + 1;
1521var INTERSECT_QUAD_LINE_2 = INTERSECT_QUAD_LINE + 1;
1522var INTERSECT_QUAD_LINE_NO = INTERSECT_QUAD_LINE_2 + 1;
1523var INTERSECT_QUAD = INTERSECT_QUAD_LINE_NO + 1;
1524var INTERSECT_QUAD_2 = INTERSECT_QUAD + 1;
1525var INTERSECT_QUAD_NO = INTERSECT_QUAD_2 + 1;
caryclark1049f122015-04-20 08:31:59 -07001526var INTERSECT_CONIC_LINE = INTERSECT_QUAD_NO + 1;
1527var INTERSECT_CONIC_LINE_2 = INTERSECT_CONIC_LINE + 1;
1528var INTERSECT_CONIC_LINE_NO = INTERSECT_CONIC_LINE_2 + 1;
caryclark55888e42016-07-18 10:01:36 -07001529var INTERSECT_CONIC_QUAD = INTERSECT_CONIC_LINE_NO + 1;
1530var INTERSECT_CONIC_QUAD_2 = INTERSECT_CONIC_QUAD + 1;
caryclark6c3b9cd2016-09-26 05:36:58 -07001531var INTERSECT_CONIC_QUAD_3 = INTERSECT_CONIC_QUAD_2 + 1;
1532var INTERSECT_CONIC_QUAD_4 = INTERSECT_CONIC_QUAD_3 + 1;
1533var INTERSECT_CONIC_QUAD_NO = INTERSECT_CONIC_QUAD_4 + 1;
caryclark55888e42016-07-18 10:01:36 -07001534var INTERSECT_CONIC = INTERSECT_CONIC_QUAD_NO + 1;
caryclark1049f122015-04-20 08:31:59 -07001535var INTERSECT_CONIC_2 = INTERSECT_CONIC + 1;
1536var INTERSECT_CONIC_NO = INTERSECT_CONIC_2 + 1;
1537var INTERSECT_SELF_CUBIC = INTERSECT_CONIC_NO + 1;
caryclarkdac1d172014-06-17 05:15:38 -07001538var INTERSECT_SELF_CUBIC_NO = INTERSECT_SELF_CUBIC + 1;
1539var INTERSECT_CUBIC_LINE = INTERSECT_SELF_CUBIC_NO + 1;
1540var INTERSECT_CUBIC_LINE_2 = INTERSECT_CUBIC_LINE + 1;
1541var INTERSECT_CUBIC_LINE_3 = INTERSECT_CUBIC_LINE_2 + 1;
1542var INTERSECT_CUBIC_LINE_NO = INTERSECT_CUBIC_LINE_3 + 1;
1543var INTERSECT_CUBIC_QUAD = INTERSECT_CUBIC_LINE_NO + 1;
1544var INTERSECT_CUBIC_QUAD_2 = INTERSECT_CUBIC_QUAD + 1;
1545var INTERSECT_CUBIC_QUAD_3 = INTERSECT_CUBIC_QUAD_2 + 1;
1546var INTERSECT_CUBIC_QUAD_4 = INTERSECT_CUBIC_QUAD_3 + 1;
1547var INTERSECT_CUBIC_QUAD_NO = INTERSECT_CUBIC_QUAD_4 + 1;
1548var INTERSECT_CUBIC = INTERSECT_CUBIC_QUAD_NO + 1;
1549var INTERSECT_CUBIC_2 = INTERSECT_CUBIC + 1;
1550var INTERSECT_CUBIC_3 = INTERSECT_CUBIC_2 + 1;
1551var INTERSECT_CUBIC_4 = INTERSECT_CUBIC_3 + 1;
1552// FIXME: add cubic 5- 9
1553var INTERSECT_CUBIC_NO = INTERSECT_CUBIC_4 + 1;
1554
1555var SORT_UNARY = INTERSECT_CUBIC_NO + 1;
1556var SORT_BINARY = SORT_UNARY + 1;
1557
1558var OP_DIFFERENCE = SORT_BINARY + 1;
1559var OP_INTERSECT = OP_DIFFERENCE + 1;
1560var OP_UNION = OP_INTERSECT + 1;
1561var OP_XOR = OP_UNION + 1;
1562
1563var MARK_LINE = OP_XOR + 1;
1564var MARK_QUAD = MARK_LINE + 1;
caryclark1049f122015-04-20 08:31:59 -07001565var MARK_CONIC = MARK_QUAD + 1;
1566var MARK_CUBIC = MARK_CONIC + 1;
caryclarkdac1d172014-06-17 05:15:38 -07001567var MARK_DONE_LINE = MARK_CUBIC + 1;
1568var MARK_DONE_QUAD = MARK_DONE_LINE + 1;
caryclark1049f122015-04-20 08:31:59 -07001569var MARK_DONE_CONIC = MARK_DONE_QUAD + 1;
1570var MARK_DONE_CUBIC = MARK_DONE_CONIC + 1;
caryclarkdac1d172014-06-17 05:15:38 -07001571var MARK_UNSORTABLE_LINE = MARK_DONE_CUBIC + 1;
1572var MARK_UNSORTABLE_QUAD = MARK_UNSORTABLE_LINE + 1;
caryclark1049f122015-04-20 08:31:59 -07001573var MARK_UNSORTABLE_CONIC = MARK_UNSORTABLE_QUAD + 1;
1574var MARK_UNSORTABLE_CUBIC = MARK_UNSORTABLE_CONIC + 1;
caryclarkdac1d172014-06-17 05:15:38 -07001575var MARK_SIMPLE_LINE = MARK_UNSORTABLE_CUBIC + 1;
1576var MARK_SIMPLE_QUAD = MARK_SIMPLE_LINE + 1;
caryclark1049f122015-04-20 08:31:59 -07001577var MARK_SIMPLE_CONIC = MARK_SIMPLE_QUAD + 1;
1578var MARK_SIMPLE_CUBIC = MARK_SIMPLE_CONIC + 1;
caryclarkdac1d172014-06-17 05:15:38 -07001579var MARK_SIMPLE_DONE_LINE = MARK_SIMPLE_CUBIC + 1;
1580var MARK_SIMPLE_DONE_QUAD = MARK_SIMPLE_DONE_LINE + 1;
caryclark1049f122015-04-20 08:31:59 -07001581var MARK_SIMPLE_DONE_CONIC = MARK_SIMPLE_DONE_QUAD + 1;
1582var MARK_SIMPLE_DONE_CUBIC = MARK_SIMPLE_DONE_CONIC + 1;
caryclarkdac1d172014-06-17 05:15:38 -07001583var MARK_DONE_UNARY_LINE = MARK_SIMPLE_DONE_CUBIC + 1;
1584var MARK_DONE_UNARY_QUAD = MARK_DONE_UNARY_LINE + 1;
caryclark1049f122015-04-20 08:31:59 -07001585var MARK_DONE_UNARY_CONIC = MARK_DONE_UNARY_QUAD + 1;
1586var MARK_DONE_UNARY_CUBIC = MARK_DONE_UNARY_CONIC + 1;
caryclarkdac1d172014-06-17 05:15:38 -07001587var MARK_ANGLE_LAST = MARK_DONE_UNARY_CUBIC + 1;
1588
1589var COMPUTED_SET_1 = MARK_ANGLE_LAST + 1;
1590var COMPUTED_SET_2 = COMPUTED_SET_1 + 1;
1591
caryclark624637c2015-05-11 07:21:27 -07001592var ANGLE_AFTER = COMPUTED_SET_2 + 1;
caryclark54359292015-03-26 07:52:43 -07001593var ANGLE_AFTERPART = ANGLE_AFTER + 1;
caryclarkdac1d172014-06-17 05:15:38 -07001594
caryclark54359292015-03-26 07:52:43 -07001595var ACTIVE_OP = ANGLE_AFTERPART + 1;
caryclarkdac1d172014-06-17 05:15:38 -07001596
caryclark624637c2015-05-11 07:21:27 -07001597var COIN_MAIN_SPAN = ACTIVE_OP + 1;
1598var COIN_OPP_SPAN = COIN_MAIN_SPAN + 1;
1599
1600var FRAG_TYPE_LAST = COIN_OPP_SPAN;
caryclarkdac1d172014-06-17 05:15:38 -07001601
1602var REC_TYPE_UNKNOWN = -1;
1603var REC_TYPE_PATH = 0;
caryclark54359292015-03-26 07:52:43 -07001604var REC_TYPE_PATH2 = 1;
1605var REC_TYPE_SECT = 2;
1606var REC_TYPE_ACTIVE = 3;
1607var REC_TYPE_ADD = 4;
1608var REC_TYPE_SORT = 5;
1609var REC_TYPE_OP = 6;
1610var REC_TYPE_MARK = 7;
1611var REC_TYPE_COMPUTED = 8;
1612var REC_TYPE_COIN = 9;
1613var REC_TYPE_ANGLE = 10;
1614var REC_TYPE_ACTIVE_OP = 11;
1615var REC_TYPE_AFTERPART = 12;
caryclark03b03ca2015-04-23 09:13:37 -07001616var REC_TYPE_TOP = 13;
caryclark624637c2015-05-11 07:21:27 -07001617var REC_TYPE_COINCIDENCE = 14;
caryclark26ad22a2015-10-16 09:03:38 -07001618var REC_TYPE_ALIGNED = 15;
1619var REC_TYPE_LAST = REC_TYPE_ALIGNED;
caryclarkdac1d172014-06-17 05:15:38 -07001620
1621function strs_to_nums(strs) {
1622 var result = [];
1623 for (var idx = 1; idx < strs.length; ++idx) {
1624 var str = strs[idx];
1625 var num = parseFloat(str);
1626 if (isNaN(num)) {
1627 result.push(str);
1628 } else {
1629 result.push(num);
1630 }
1631 }
1632 return result;
1633}
1634
1635function filter_str_by(id, str, regex, array) {
1636 if (regex.test(str)) {
1637 var strs = regex.exec(str);
1638 var result = strs_to_nums(strs);
1639 array.push(id);
1640 array.push(result);
1641 return true;
1642 }
1643 return false;
1644}
1645
1646function construct_regexp2(pattern) {
1647 var escape = pattern.replace(/[-/\\^$*+?.()|[\]{}]/g, '\\$&');
1648 escape = escape.replace(/UNSORTABLE/g, "\\*\\*\\* UNSORTABLE \\*\\*\\*");
1649 escape = escape.replace(/CUBIC_VAL/g, "\\(P_VAL P_VAL P_VAL P_VAL\\)");
caryclark1049f122015-04-20 08:31:59 -07001650 escape = escape.replace(/CONIC_VAL/g, "\\(P_VAL P_VAL P_VAL W_VAL\\)");
caryclarkdac1d172014-06-17 05:15:38 -07001651 escape = escape.replace(/QUAD_VAL/g, "\\(P_VAL P_VAL P_VAL\\)");
1652 escape = escape.replace(/LINE_VAL/g, "\\(P_VAL P_VAL\\)");
1653 escape = escape.replace(/FILL_TYPE/g, "SkPath::k[a-zA-Z]+_FillType");
caryclark54359292015-03-26 07:52:43 -07001654 escape = escape.replace(/PTR_VAL/g, "0x[0-9A-F]+");
caryclarkdac1d172014-06-17 05:15:38 -07001655 escape = escape.replace(/PT_VAL/g, "\\(P_VAL\\)");
1656 escape = escape.replace(/P_VAL/g, "(-?\\d+\\.?\\d*(?:e-?\\d+)?)[Ff]?, ?(-?\\d+\\.?\\d*(?:e-?\\d+)?)[Ff]?");
1657 escape = escape.replace(/T_VAL/g, "(-?\\d+\\.?\\d*(?:e-?\\d+)?)");
caryclark1049f122015-04-20 08:31:59 -07001658 escape = escape.replace(/W_VAL/g, "(-?\\d+\\.?\\d*(?:e-?\\d+)?)[Ff]?");
caryclarkdac1d172014-06-17 05:15:38 -07001659 escape = escape.replace(/PATH/g, "pathB?");
caryclark1049f122015-04-20 08:31:59 -07001660 escape = escape.replace(/IDX/g, "(-?\\d+)");
caryclarkdac1d172014-06-17 05:15:38 -07001661 escape = escape.replace(/NUM/g, "(-?\\d+)");
1662 escape = escape.replace(/OPT/g, "(\\?|-?\\d+)");
1663 return new RegExp(escape, 'i');
1664}
1665
1666function construct_regexp2c(pattern) {
1667 var escape = pattern.replace(/[-/\\^$*+?.()|[\]{}]/g, '\\$&');
1668 escape = escape.replace(/UNSORTABLE/g, "\\*\\*\\* UNSORTABLE \\*\\*\\*");
caryclark54359292015-03-26 07:52:43 -07001669 escape = escape.replace(/CUBIC_VAL/g, "(?:\\$\\d = )?\\{\\{\\{P_VAL\\}, \\{P_VAL\\}, \\{P_VAL\\}, \\{P_VAL\\}\\}\\}");
caryclark1049f122015-04-20 08:31:59 -07001670 escape = escape.replace(/CONIC_VAL/g, "(?:\\$\\d = )?\\{\\{\\{\\{P_VAL\\}, \\{P_VAL\\}, \\{P_VAL\\}\\}\\}, W_VAL\\}");
caryclark54359292015-03-26 07:52:43 -07001671 escape = escape.replace(/QUAD_VAL/g, "(?:\\$\\d = )?\\{\\{\\{P_VAL\\}, \\{P_VAL\\}, \\{P_VAL\\}\\}\\}");
1672 escape = escape.replace(/LINE_VAL/g, "(?:\\$\\d = )?\\{\\{\\{P_VAL\\}, \\{P_VAL\\}\\}\\}");
caryclarkdac1d172014-06-17 05:15:38 -07001673 escape = escape.replace(/FILL_TYPE/g, "SkPath::k[a-zA-Z]+_FillType");
caryclark54359292015-03-26 07:52:43 -07001674 escape = escape.replace(/PTR_VAL/g, "0x[0-9A-F]+");
caryclarkdac1d172014-06-17 05:15:38 -07001675 escape = escape.replace(/PT_VAL/g, "\\{\\{P_VAL\\}\\}");
caryclark54359292015-03-26 07:52:43 -07001676 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 -07001677 escape = escape.replace(/T_VAL/g, "(-?\\d+\\.?\\d*(?:e-?\\d+)?)");
caryclark1049f122015-04-20 08:31:59 -07001678 escape = escape.replace(/W_VAL/g, "(-?\\d+\\.?\\d*(?:e-?\\d+)?)[Ff]?");
caryclarkdac1d172014-06-17 05:15:38 -07001679 escape = escape.replace(/OPER/g, "[a-z]+");
1680 escape = escape.replace(/PATH/g, "pathB?");
1681 escape = escape.replace(/T_F/g, "([TF])");
caryclark1049f122015-04-20 08:31:59 -07001682 escape = escape.replace(/IDX/g, "(-?\\d+)");
caryclarkdac1d172014-06-17 05:15:38 -07001683 escape = escape.replace(/NUM/g, "(-?\\d+)");
1684 escape = escape.replace(/OPT/g, "(\\?|-?\\d+)");
1685 return new RegExp(escape, 'i');
1686}
1687
1688function match_regexp(str, lineNo, array, id, pattern) {
1689 var regex = construct_regexp2(pattern);
1690 if (filter_str_by(id, str, regex, array)) {
1691 return true;
1692 }
1693 regex = construct_regexp2c(pattern);
1694 return filter_str_by(id, str, regex, array);
1695}
1696
1697function endsWith(str, suffix) {
1698 return str.indexOf(suffix, str.length - suffix.length) !== -1;
1699}
1700
1701function parse_all(test) {
1702 var lines = test.match(/[^\r\n]+/g);
1703 var records = []; // a rec can be the original paths, a set of intersections, a set of active spans, a sort, or a path add
1704 var record = [];
1705 var recType = REC_TYPE_UNKNOWN;
1706 var lastLineNo;
1707 var moveX, moveY;
1708 for (var lineNo = 0; lineNo < lines.length; ++lineNo) {
1709 var line = lines[lineNo];
1710 if (line.length == 0) {
1711 continue;
1712 }
1713 var opStart = "SkOpSegment::";
1714 if (line.lastIndexOf(opStart, 0) === 0) {
1715 line = line.substr(opStart.length);
1716 }
1717 var angleStart = "SkOpAngle::";
1718 if (line.lastIndexOf(angleStart, 0) === 0) {
1719 line = line.substr(angleStart.length);
1720 }
caryclark624637c2015-05-11 07:21:27 -07001721 var coinStart = "SkOpCoincidence::";
1722 if (line.lastIndexOf(coinStart, 0) === 0) {
1723 line = line.substr(coinStart.length);
1724 }
caryclark54359292015-03-26 07:52:43 -07001725 var type = line.lastIndexOf("debugShowActiveSpans", 0) === 0 ? REC_TYPE_ACTIVE
caryclark624637c2015-05-11 07:21:27 -07001726 : line.lastIndexOf("debugShowCoincidence", 0) === 0 ? REC_TYPE_COINCIDENCE
caryclark54359292015-03-26 07:52:43 -07001727 : line.lastIndexOf("((SkOpSegment*)", 0) === 0 ? REC_TYPE_PATH2
caryclark55888e42016-07-18 10:01:36 -07001728 : line.lastIndexOf("debugShowTs", 0) === 0 ? REC_TYPE_COIN
caryclark54359292015-03-26 07:52:43 -07001729 : line.lastIndexOf("afterPart", 0) === 0 ? REC_TYPE_AFTERPART
caryclarkdac1d172014-06-17 05:15:38 -07001730 : line.lastIndexOf("debugShow", 0) === 0 ? REC_TYPE_SECT
1731 : line.lastIndexOf("activeOp", 0) === 0 ? REC_TYPE_ACTIVE_OP
1732 : line.lastIndexOf("computed", 0) === 0 ? REC_TYPE_COMPUTED
1733 : line.lastIndexOf("debugOne", 0) === 0 ? REC_TYPE_SORT
caryclark26ad22a2015-10-16 09:03:38 -07001734 : line.lastIndexOf("aligned=", 0) === 0 ? REC_TYPE_ALIGNED
caryclarkdac1d172014-06-17 05:15:38 -07001735 : line.lastIndexOf("dumpOne", 0) === 0 ? REC_TYPE_SORT
caryclark03b03ca2015-04-23 09:13:37 -07001736 : line.lastIndexOf("findTop", 0) === 0 ? REC_TYPE_TOP
caryclarkdac1d172014-06-17 05:15:38 -07001737 : line.lastIndexOf("pathB.", 0) === 0 ? REC_TYPE_ADD
1738 : line.lastIndexOf("path.", 0) === 0 ? REC_TYPE_ADD
1739 : line.lastIndexOf("after", 0) === 0 ? REC_TYPE_ANGLE
1740 : line.lastIndexOf("mark", 0) === 0 ? REC_TYPE_MARK
1741 : line.lastIndexOf(" {{", 0) === 0 ? REC_TYPE_COMPUTED
caryclark54359292015-03-26 07:52:43 -07001742 : line.lastIndexOf("seg=", 0) === 0 ? REC_TYPE_PATH
caryclarkdac1d172014-06-17 05:15:38 -07001743 : line.lastIndexOf("op", 0) === 0 ? REC_TYPE_OP
1744 : line.lastIndexOf("$", 0) === 0 ? REC_TYPE_PATH
1745 : REC_TYPE_UNKNOWN;
1746 if (recType != type || recType == REC_TYPE_ADD || recType == REC_TYPE_SECT
1747 || recType == REC_TYPE_ACTIVE_OP || recType == REC_TYPE_ANGLE) {
1748 if (recType != REC_TYPE_UNKNOWN) {
1749 records.push(recType);
1750 records.push(lastLineNo);
1751 records.push(record);
1752 }
1753 record = [];
1754 recType = type;
1755 lastLineNo = lineNo;
1756 }
1757 var found = false;
1758 switch (recType) {
1759 case REC_TYPE_ACTIVE:
1760 found = match_regexp(line, lineNo, record, ACTIVE_LINE_SPAN, "debugShowActiveSpans" +
caryclark55888e42016-07-18 10:01:36 -07001761" id=IDX LINE_VAL t=T_VAL tEnd=T_VAL windSum=OPT windValue=IDX"
caryclarkdac1d172014-06-17 05:15:38 -07001762 ) || match_regexp(line, lineNo, record, ACTIVE_QUAD_SPAN, "debugShowActiveSpans" +
caryclark55888e42016-07-18 10:01:36 -07001763" id=IDX QUAD_VAL t=T_VAL tEnd=T_VAL windSum=OPT windValue=IDX"
caryclark1049f122015-04-20 08:31:59 -07001764 ) || match_regexp(line, lineNo, record, ACTIVE_CONIC_SPAN, "debugShowActiveSpans" +
caryclark55888e42016-07-18 10:01:36 -07001765" id=IDX CONIC_VAL t=T_VAL tEnd=T_VAL windSum=OPT windValue=IDX"
caryclarkdac1d172014-06-17 05:15:38 -07001766 ) || match_regexp(line, lineNo, record, ACTIVE_CUBIC_SPAN, "debugShowActiveSpans" +
caryclark55888e42016-07-18 10:01:36 -07001767" id=IDX CUBIC_VAL t=T_VAL tEnd=T_VAL windSum=OPT windValue=IDX"
caryclark624637c2015-05-11 07:21:27 -07001768 ) || match_regexp(line, lineNo, record, ACTIVE_LINE_SPAN, "debugShowActiveSpans" +
caryclark55888e42016-07-18 10:01:36 -07001769" id=IDX LINE_VAL t=T_VAL tEnd=T_VAL windSum=OPT oppSum=OPT windValue=IDX oppValue=NUM"
caryclark624637c2015-05-11 07:21:27 -07001770 ) || match_regexp(line, lineNo, record, ACTIVE_QUAD_SPAN, "debugShowActiveSpans" +
caryclark55888e42016-07-18 10:01:36 -07001771" id=IDX QUAD_VAL t=T_VAL tEnd=T_VAL windSum=OPT oppSum=OPT windValue=IDX oppValue=NUM"
caryclark624637c2015-05-11 07:21:27 -07001772 ) || match_regexp(line, lineNo, record, ACTIVE_CONIC_SPAN, "debugShowActiveSpans" +
caryclark55888e42016-07-18 10:01:36 -07001773" id=IDX CONIC_VAL t=T_VAL tEnd=T_VAL windSum=OPT oppSum=OPT windValue=IDX oppValue=NUM"
caryclark624637c2015-05-11 07:21:27 -07001774 ) || match_regexp(line, lineNo, record, ACTIVE_CUBIC_SPAN, "debugShowActiveSpans" +
caryclark55888e42016-07-18 10:01:36 -07001775" id=IDX CUBIC_VAL t=T_VAL tEnd=T_VAL windSum=OPT oppSum=OPT windValue=IDX oppValue=NUM"
caryclarkdac1d172014-06-17 05:15:38 -07001776 );
1777 break;
1778 case REC_TYPE_ACTIVE_OP:
1779 found = match_regexp(line, lineNo, record, ACTIVE_OP, "activeOp" +
1780" id=IDX t=T_VAL tEnd=T_VAL op=OPER miFrom=NUM miTo=NUM suFrom=NUM suTo=NUM result=IDX"
1781 );
1782 break;
1783 case REC_TYPE_ADD:
1784 if (match_regexp(line, lineNo, record, ADD_MOVETO, "PATH.moveTo(P_VAL);")) {
1785 moveX = record[1][0];
1786 moveY = record[1][1];
1787 found = true;
1788 } else if (match_regexp(line, lineNo, record, ADD_LINETO, "PATH.lineTo(P_VAL);")) {
1789 record[1].unshift(moveY);
1790 record[1].unshift(moveX);
1791 moveX = record[1][2];
1792 moveY = record[1][3];
1793 found = true;
1794 } else if (match_regexp(line, lineNo, record, ADD_QUADTO, "PATH.quadTo(P_VAL, P_VAL);")) {
1795 record[1].unshift(moveY);
1796 record[1].unshift(moveX);
1797 moveX = record[1][4];
1798 moveY = record[1][5];
1799 found = true;
caryclark1049f122015-04-20 08:31:59 -07001800 } else if (match_regexp(line, lineNo, record, ADD_CONICTO, "PATH.conicTo(P_VAL, P_VAL, T_VAL);")) {
1801 record[1].unshift(moveY);
1802 record[1].unshift(moveX);
1803 moveX = record[1][4];
1804 moveY = record[1][5];
1805 found = true;
caryclarkdac1d172014-06-17 05:15:38 -07001806 } else if (match_regexp(line, lineNo, record, ADD_CUBICTO, "PATH.cubicTo(P_VAL, P_VAL, P_VAL);")) {
1807 record[1].unshift(moveY);
1808 record[1].unshift(moveX);
1809 moveX = record[1][6];
1810 moveY = record[1][7];
1811 found = true;
1812 } else if (match_regexp(line, lineNo, record, ADD_FILL, "PATH.setFillType(FILL_TYPE);")) {
1813 found = true;
1814 } else {
1815 found = match_regexp(line, lineNo, record, ADD_CLOSE, "PATH.close();");
1816 }
1817 break;
caryclark54359292015-03-26 07:52:43 -07001818 case REC_TYPE_AFTERPART:
1819 found = match_regexp(line, lineNo, record, PATH_LINE, "afterPart LINE_VAL")
1820 || match_regexp(line, lineNo, record, PATH_QUAD, "afterPart QUAD_VAL")
caryclark1049f122015-04-20 08:31:59 -07001821 || match_regexp(line, lineNo, record, PATH_CONIC, "afterPart CONIC_VAL")
caryclark54359292015-03-26 07:52:43 -07001822 || match_regexp(line, lineNo, record, PATH_CUBIC, "afterPart CUBIC_VAL")
1823 break;
caryclark26ad22a2015-10-16 09:03:38 -07001824 case REC_TYPE_ALIGNED:
1825 found = match_regexp(line, lineNo, record, PATH_LINE, "aligned=IDX LINE_VAL"
1826 ) || match_regexp(line, lineNo, record, PATH_QUAD, "aligned=IDX QUAD_VAL"
1827 ) || match_regexp(line, lineNo, record, PATH_CONIC, "aligned=IDX CONIC_VAL"
1828 ) || match_regexp(line, lineNo, record, PATH_CUBIC, "aligned=IDX CUBIC_VAL"
1829 );
1830 break;
caryclarkdac1d172014-06-17 05:15:38 -07001831 case REC_TYPE_ANGLE:
1832 found = match_regexp(line, lineNo, record, ANGLE_AFTER, "after " +
caryclarkdac1d172014-06-17 05:15:38 -07001833"[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");
1834 break;
1835 case REC_TYPE_COIN:
1836 found = true;
1837 break;
caryclark624637c2015-05-11 07:21:27 -07001838 case REC_TYPE_COINCIDENCE:
1839 found = match_regexp(line, lineNo, record, COIN_MAIN_SPAN, "debugShowCoincidence" +
1840" + id=IDX t=T_VAL tEnd=T_VAL"
1841 ) || match_regexp(line, lineNo, record, COIN_OPP_SPAN, "debugShowCoincidence" +
1842" - id=IDX t=T_VAL tEnd=T_VAL"
1843 );
1844 break;
caryclarkdac1d172014-06-17 05:15:38 -07001845 case REC_TYPE_COMPUTED:
1846 found = line == "computed quadratics given"
1847 || match_regexp(line, lineNo, record, COMPUTED_SET_1, "computed quadratics set 1"
1848 ) || match_regexp(line, lineNo, record, COMPUTED_SET_2, "computed quadratics set 2"
1849 ) || match_regexp(line, lineNo, record, PATH_QUAD, " QUAD_VAL,"
caryclark1049f122015-04-20 08:31:59 -07001850 ) || match_regexp(line, lineNo, record, PATH_CONIC, " CONIC_VAL,"
caryclarkdac1d172014-06-17 05:15:38 -07001851 ) || match_regexp(line, lineNo, record, PATH_CUBIC, " CUBIC_VAL,"
1852 );
1853 break;
1854 case REC_TYPE_PATH:
caryclark54359292015-03-26 07:52:43 -07001855 found = match_regexp(line, lineNo, record, PATH_LINE, "seg=IDX LINE_VAL"
1856 ) || match_regexp(line, lineNo, record, PATH_QUAD, "seg=IDX QUAD_VAL"
caryclark1049f122015-04-20 08:31:59 -07001857 ) || match_regexp(line, lineNo, record, PATH_CONIC, "seg=IDX CONIC_VAL"
caryclark54359292015-03-26 07:52:43 -07001858 ) || match_regexp(line, lineNo, record, PATH_CUBIC, "seg=IDX CUBIC_VAL"
1859 );
1860 break;
1861 case REC_TYPE_PATH2:
1862 found = match_regexp(line, lineNo, record, PATH_LINE, "((SkOpSegment*) PTR_VAL) [IDX] {LINE_VAL}"
1863 ) || match_regexp(line, lineNo, record, PATH_QUAD, "((SkOpSegment*) PTR_VAL) [IDX] {QUAD_VAL}"
caryclark1049f122015-04-20 08:31:59 -07001864 ) || match_regexp(line, lineNo, record, PATH_CONIC, "((SkOpSegment*) PTR_VAL) [IDX] {CONIC_VAL}"
caryclark54359292015-03-26 07:52:43 -07001865 ) || match_regexp(line, lineNo, record, PATH_CUBIC, "((SkOpSegment*) PTR_VAL) [IDX] {CUBIC_VAL}"
caryclarkdac1d172014-06-17 05:15:38 -07001866 );
1867 break;
1868 case REC_TYPE_SECT:
1869 found = match_regexp(line, lineNo, record, INTERSECT_LINE, "debugShowLineIntersection" +
1870" wtTs[0]=T_VAL LINE_VAL PT_VAL wnTs[0]=T_VAL LINE_VAL"
1871 ) || match_regexp(line, lineNo, record, INTERSECT_LINE_2, "debugShowLineIntersection" +
1872" wtTs[0]=T_VAL LINE_VAL PT_VAL wtTs[1]=T_VAL PT_VAL wnTs[0]=T_VAL LINE_VAL wnTs[1]=T_VAL"
1873 ) || match_regexp(line, lineNo, record, INTERSECT_LINE_NO, "debugShowLineIntersection" +
1874" no intersect LINE_VAL LINE_VAL"
1875 ) || match_regexp(line, lineNo, record, INTERSECT_QUAD_LINE, "debugShowQuadLineIntersection" +
1876" wtTs[0]=T_VAL QUAD_VAL PT_VAL wnTs[0]=T_VAL LINE_VAL"
1877 ) || match_regexp(line, lineNo, record, INTERSECT_QUAD_LINE_2, "debugShowQuadLineIntersection" +
1878" wtTs[0]=T_VAL QUAD_VAL PT_VAL wtTs[1]=T_VAL PT_VAL wnTs[0]=T_VAL LINE_VAL wnTs[1]=T_VAL"
1879 ) || match_regexp(line, lineNo, record, INTERSECT_QUAD_LINE_NO, "debugShowQuadLineIntersection" +
1880" no intersect QUAD_VAL LINE_VAL"
1881 ) || match_regexp(line, lineNo, record, INTERSECT_QUAD, "debugShowQuadIntersection" +
1882" wtTs[0]=T_VAL QUAD_VAL PT_VAL wnTs[0]=T_VAL QUAD_VAL"
1883 ) || match_regexp(line, lineNo, record, INTERSECT_QUAD_2, "debugShowQuadIntersection" +
1884" wtTs[0]=T_VAL QUAD_VAL PT_VAL wtTs[1]=T_VAL PT_VAL wnTs[0]=T_VAL QUAD_VAL wnTs[1]=T_VAL"
1885 ) || match_regexp(line, lineNo, record, INTERSECT_QUAD_NO, "debugShowQuadIntersection" +
1886" no intersect QUAD_VAL QUAD_VAL"
caryclark55888e42016-07-18 10:01:36 -07001887
caryclark1049f122015-04-20 08:31:59 -07001888 ) || match_regexp(line, lineNo, record, INTERSECT_CONIC_LINE, "debugShowConicLineIntersection" +
1889" wtTs[0]=T_VAL CONIC_VAL PT_VAL wnTs[0]=T_VAL LINE_VAL"
1890 ) || match_regexp(line, lineNo, record, INTERSECT_CONIC_LINE_2, "debugShowConicLineIntersection" +
1891" wtTs[0]=T_VAL CONIC_VAL PT_VAL wtTs[1]=T_VAL PT_VAL wnTs[0]=T_VAL LINE_VAL wnTs[1]=T_VAL"
1892 ) || match_regexp(line, lineNo, record, INTERSECT_CONIC_LINE_NO, "debugShowConicLineIntersection" +
1893" no intersect CONIC_VAL LINE_VAL"
caryclark55888e42016-07-18 10:01:36 -07001894
1895 ) || match_regexp(line, lineNo, record, INTERSECT_CONIC_QUAD, "debugShowConicQuadIntersection" +
1896" wtTs[0]=T_VAL CONIC_VAL PT_VAL wnTs[0]=T_VAL QUAD_VAL"
1897 ) || match_regexp(line, lineNo, record, INTERSECT_CONIC_QUAD_2, "debugShowConicQuadIntersection" +
1898" 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 -07001899 ) || match_regexp(line, lineNo, record, INTERSECT_CONIC_QUAD_3, "debugShowConicQuadIntersection" +
1900" 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"
1901 ) || match_regexp(line, lineNo, record, INTERSECT_CONIC_QUAD_4, "debugShowConicQuadIntersection" +
1902" 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 -07001903 ) || match_regexp(line, lineNo, record, INTERSECT_CONIC_QUAD_NO, "debugShowConicQuadIntersection" +
1904" no intersect CONIC_VAL QUAD_VAL"
1905
caryclark1049f122015-04-20 08:31:59 -07001906 ) || match_regexp(line, lineNo, record, INTERSECT_CONIC, "debugShowConicIntersection" +
1907" wtTs[0]=T_VAL CONIC_VAL PT_VAL wnTs[0]=T_VAL CONIC_VAL"
1908 ) || match_regexp(line, lineNo, record, INTERSECT_CONIC_2, "debugShowConicIntersection" +
1909" wtTs[0]=T_VAL CONIC_VAL PT_VAL wtTs[1]=T_VAL PT_VAL wnTs[0]=T_VAL CONIC_VAL wnTs[1]=T_VAL"
1910 ) || match_regexp(line, lineNo, record, INTERSECT_CONIC_NO, "debugShowConicIntersection" +
1911" no intersect CONIC_VAL CONIC_VAL"
caryclarkdac1d172014-06-17 05:15:38 -07001912 ) || match_regexp(line, lineNo, record, INTERSECT_CUBIC_LINE, "debugShowCubicLineIntersection" +
1913" wtTs[0]=T_VAL CUBIC_VAL PT_VAL wnTs[0]=T_VAL LINE_VAL"
1914 ) || match_regexp(line, lineNo, record, INTERSECT_CUBIC_LINE_2, "debugShowCubicLineIntersection" +
1915" wtTs[0]=T_VAL CUBIC_VAL PT_VAL wtTs[1]=T_VAL PT_VAL wnTs[0]=T_VAL LINE_VAL wnTs[1]=T_VAL"
1916 ) || match_regexp(line, lineNo, record, INTERSECT_CUBIC_LINE_3, "debugShowCubicLineIntersection" +
1917" 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"
1918 ) || match_regexp(line, lineNo, record, INTERSECT_CUBIC_LINE_NO, "debugShowCubicLineIntersection" +
1919" no intersect CUBIC_VAL LINE_VAL"
1920 ) || match_regexp(line, lineNo, record, INTERSECT_CUBIC_QUAD, "debugShowCubicQuadIntersection" +
1921" wtTs[0]=T_VAL CUBIC_VAL PT_VAL wnTs[0]=T_VAL QUAD_VAL"
1922 ) || match_regexp(line, lineNo, record, INTERSECT_CUBIC_QUAD_2, "debugShowCubicQuadIntersection" +
1923" wtTs[0]=T_VAL CUBIC_VAL PT_VAL wtTs[1]=T_VAL PT_VAL wnTs[0]=T_VAL QUAD_VAL wnTs[1]=T_VAL"
1924 ) || match_regexp(line, lineNo, record, INTERSECT_CUBIC_QUAD_3, "debugShowCubicQuadIntersection" +
1925" 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"
1926 ) || match_regexp(line, lineNo, record, INTERSECT_CUBIC_QUAD_4, "debugShowCubicQuadIntersection" +
1927" 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"
1928 ) || match_regexp(line, lineNo, record, INTERSECT_CUBIC_QUAD_NO, "debugShowCubicQuadIntersection" +
1929" no intersect CUBIC_VAL QUAD_VAL"
1930 ) || match_regexp(line, lineNo, record, INTERSECT_CUBIC, "debugShowCubicIntersection" +
1931" wtTs[0]=T_VAL CUBIC_VAL PT_VAL wnTs[0]=T_VAL CUBIC_VAL"
1932 ) || match_regexp(line, lineNo, record, INTERSECT_CUBIC_2, "debugShowCubicIntersection" +
1933" wtTs[0]=T_VAL CUBIC_VAL PT_VAL wtTs[1]=T_VAL PT_VAL wnTs[0]=T_VAL CUBIC_VAL wnTs[1]=T_VAL"
1934 ) || match_regexp(line, lineNo, record, INTERSECT_CUBIC_3, "debugShowCubicIntersection" +
1935" 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"
1936 ) || match_regexp(line, lineNo, record, INTERSECT_CUBIC_4, "debugShowCubicIntersection" +
1937" 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"
1938 ) || match_regexp(line, lineNo, record, INTERSECT_CUBIC_NO, "debugShowCubicIntersection" +
1939" no intersect CUBIC_VAL CUBIC_VAL"
1940 ) || match_regexp(line, lineNo, record, INTERSECT_SELF_CUBIC, "debugShowCubicIntersection" +
1941" wtTs[0]=T_VAL CUBIC_VAL PT_VAL wtTs[1]=T_VAL"
1942 ) || match_regexp(line, lineNo, record, INTERSECT_SELF_CUBIC_NO, "debugShowCubicIntersection" +
1943" no self intersect CUBIC_VAL"
1944 );
1945 break;
1946 case REC_TYPE_SORT:
1947 var hasDone = / done/.test(line);
1948 var hasUnorderable = / unorderable/.test(line);
1949 var hasSmall = / small/.test(line);
1950 var hasTiny = / tiny/.test(line);
1951 var hasOperand = / operand/.test(line);
1952 var hasStop = / stop/.test(line);
1953 line.replace(/[ a-z]+$/, "");
1954 found = match_regexp(line, lineNo, record, SORT_UNARY, "debugOne" +
1955" [IDX/IDX] next=IDX/IDX sect=IDX/IDX s=T_VAL [IDX] e=T_VAL [IDX] sgn=NUM windVal=IDX windSum=OPT"
1956 ) || match_regexp(line, lineNo, record, SORT_BINARY, "debugOne" +
1957" [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"
1958 ) || match_regexp(line, lineNo, record, SORT_UNARY, "dumpOne" +
1959" [IDX/IDX] next=IDX/IDX sect=NUM/NUM s=T_VAL [IDX] e=T_VAL [IDX] sgn=NUM windVal=IDX windSum=OPT"
1960 ) || match_regexp(line, lineNo, record, SORT_BINARY, "dumpOne" +
1961" [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"
1962 );
1963 if (found) {
1964 record[1].push(hasDone);
1965 record[1].push(hasUnorderable);
1966 record[1].push(hasSmall);
1967 record[1].push(hasTiny);
1968 record[1].push(hasOperand);
1969 record[1].push(hasStop);
1970 }
1971 break;
caryclark03b03ca2015-04-23 09:13:37 -07001972 case REC_TYPE_TOP:
1973 found = match_regexp(line, lineNo, record, ACTIVE_OP, "findTop" +
1974" id=IDX s=T_VAL e=T_VAL cw=NUM swap=NUM inflections=NUM monotonic=NUM"
1975 ) || match_regexp(line, lineNo, record, ACTIVE_OP, "findTop" +
1976" id=IDX s=T_VAL e=T_VAL (-) cw=NUM swap=NUM inflections=NUM monotonic=NUM"
1977 ) || match_regexp(line, lineNo, record, ACTIVE_OP, "findTop" +
1978" id=IDX s=T_VAL e=T_VAL (+) cw=NUM swap=NUM inflections=NUM monotonic=NUM"
1979 );
1980 break;
caryclarkdac1d172014-06-17 05:15:38 -07001981 case REC_TYPE_MARK:
1982 found = match_regexp(line, lineNo, record, MARK_LINE, "markWinding" +
caryclark54359292015-03-26 07:52:43 -07001983" 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 -07001984 ) || match_regexp(line, lineNo, record, MARK_QUAD, "markWinding" +
caryclark54359292015-03-26 07:52:43 -07001985" 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 -07001986 ) || match_regexp(line, lineNo, record, MARK_CONIC, "markWinding" +
1987" 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 -07001988 ) || match_regexp(line, lineNo, record, MARK_CUBIC, "markWinding" +
caryclark54359292015-03-26 07:52:43 -07001989" id=IDX CUBIC_VAL t=T_VAL [IDX] PT_VAL tEnd=T_VAL newWindSum=NUM newOppSum=OPT oppSum=OPT windSum=OPT windValue=IDX"
1990 ) || match_regexp(line, lineNo, record, MARK_DONE_LINE, "markDone" +
1991" 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"
1992 ) || match_regexp(line, lineNo, record, MARK_DONE_QUAD, "markDone" +
1993" 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 -07001994 ) || match_regexp(line, lineNo, record, MARK_DONE_CONIC, "markDone" +
1995" 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 -07001996 ) || match_regexp(line, lineNo, record, MARK_DONE_CUBIC, "markDone" +
1997" 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 -07001998 ) || match_regexp(line, lineNo, record, MARK_SIMPLE_LINE, "markWinding" +
1999" id=IDX LINE_VAL t=T_VAL [IDX] PT_VAL tEnd=T_VAL newWindSum=NUM windSum=OPT windValue=IDX"
2000 ) || match_regexp(line, lineNo, record, MARK_SIMPLE_QUAD, "markWinding" +
2001" 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 -07002002 ) || match_regexp(line, lineNo, record, MARK_SIMPLE_CONIC, "markWinding" +
2003" 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 -07002004 ) || match_regexp(line, lineNo, record, MARK_SIMPLE_CUBIC, "markWinding" +
2005" 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 -07002006 ) || match_regexp(line, lineNo, record, MARK_ANGLE_LAST, "markAngle" +
caryclark1049f122015-04-20 08:31:59 -07002007" last segment=IDX span=IDX"
caryclark54359292015-03-26 07:52:43 -07002008 ) || match_regexp(line, lineNo, record, MARK_ANGLE_LAST, "markAngle" +
caryclark55888e42016-07-18 10:01:36 -07002009" last seg=IDX span=IDX"
2010 ) || match_regexp(line, lineNo, record, MARK_ANGLE_LAST, "markAngle" +
2011" last segment=IDX span=IDX windSum=OPT"
2012 ) || match_regexp(line, lineNo, record, MARK_ANGLE_LAST, "markAngle" +
2013" last seg=IDX span=IDX windSum=OPT"
2014 );
caryclarkdac1d172014-06-17 05:15:38 -07002015 break;
2016 case REC_TYPE_OP:
2017 if (line.lastIndexOf("oppSign oppSign=", 0) === 0
2018 || line.lastIndexOf("operator<", 0) === 0) {
2019 found = true;
2020 break;
2021 }
caryclark54359292015-03-26 07:52:43 -07002022 found = match_regexp(line, lineNo, record, OP_DIFFERENCE, "op diff"
caryclarkdac1d172014-06-17 05:15:38 -07002023 ) || match_regexp(line, lineNo, record, OP_INTERSECT, "op intersect"
caryclark54359292015-03-26 07:52:43 -07002024 ) || match_regexp(line, lineNo, record, OP_INTERSECT, "op sect"
caryclarkdac1d172014-06-17 05:15:38 -07002025 ) || match_regexp(line, lineNo, record, OP_UNION, "op union"
2026 ) || match_regexp(line, lineNo, record, OP_XOR, "op xor"
2027 );
2028 break;
2029 case REC_TYPE_UNKNOWN:
2030 found = true;
2031 break;
2032 }
2033 if (!found) {
2034 console.log(line + " [" + lineNo + "] of type " + type + " not found");
2035 }
2036 }
2037 if (recType != REC_TYPE_UNKNOWN) {
2038 records.push(recType);
2039 records.push(lastLineNo);
2040 records.push(record);
2041 }
2042 if (records.length >= 1) {
2043 tests[testIndex] = records;
2044 testLines[testIndex] = lines;
2045 }
2046}
2047
2048function init(test) {
2049 var canvas = document.getElementById('canvas');
2050 if (!canvas.getContext) return;
2051 ctx = canvas.getContext('2d');
2052 var resScale = retina_scale && window.devicePixelRatio ? window.devicePixelRatio : 1;
2053 var unscaledWidth = window.innerWidth - 20;
2054 var unscaledHeight = window.innerHeight - 20;
2055 screenWidth = unscaledWidth;
2056 screenHeight = unscaledHeight;
2057 canvas.width = unscaledWidth * resScale;
2058 canvas.height = unscaledHeight * resScale;
2059 canvas.style.width = unscaledWidth + 'px';
2060 canvas.style.height = unscaledHeight + 'px';
2061 if (resScale != 1) {
2062 ctx.scale(resScale, resScale);
2063 }
2064 xmin = Infinity;
2065 xmax = -Infinity;
2066 ymin = Infinity;
2067 ymax = -Infinity;
caryclark26ad22a2015-10-16 09:03:38 -07002068 hasPath = hasAlignedPath = hasComputedPath = false;
caryclarkdac1d172014-06-17 05:15:38 -07002069 firstActiveSpan = -1;
2070 for (var tIndex = 0; tIndex < test.length; tIndex += 3) {
2071 var recType = test[tIndex];
2072 if (!typeof recType == 'number' || recType < REC_TYPE_UNKNOWN || recType > REC_TYPE_LAST) {
2073 console.log("unknown rec type: " + recType);
2074 throw "stop execution";
2075 }
2076 var records = test[tIndex + 2];
2077 for (var recordIndex = 0; recordIndex < records.length; recordIndex += 2) {
2078 var fragType = records[recordIndex];
2079 if (!typeof fragType == 'number' || fragType < 1 || fragType > FRAG_TYPE_LAST) {
2080 console.log("unknown in range frag type: " + fragType);
2081 throw "stop execution";
2082 }
2083 var frags = records[recordIndex + 1];
2084 var first = 0;
2085 var last = -1;
2086 var first2 = 0;
2087 var last2 = 0;
2088 switch (recType) {
caryclark26ad22a2015-10-16 09:03:38 -07002089 case REC_TYPE_ALIGNED:
2090 hasAlignedPath = true;
caryclarkdac1d172014-06-17 05:15:38 -07002091 case REC_TYPE_COMPUTED:
2092 if (fragType == COMPUTED_SET_1 || fragType == COMPUTED_SET_2) {
2093 break;
2094 }
caryclark26ad22a2015-10-16 09:03:38 -07002095 if (REC_TYPE_COMPUTED == recType) {
2096 hasComputedPath = true;
2097 }
caryclarkdac1d172014-06-17 05:15:38 -07002098 case REC_TYPE_PATH:
caryclark54359292015-03-26 07:52:43 -07002099 first = 1;
caryclarkdac1d172014-06-17 05:15:38 -07002100 switch (fragType) {
2101 case PATH_LINE:
caryclark54359292015-03-26 07:52:43 -07002102 last = 5;
caryclarkdac1d172014-06-17 05:15:38 -07002103 break;
caryclark1049f122015-04-20 08:31:59 -07002104 case PATH_CONIC:
caryclarkdac1d172014-06-17 05:15:38 -07002105 case PATH_QUAD:
caryclark54359292015-03-26 07:52:43 -07002106 last = 7;
caryclarkdac1d172014-06-17 05:15:38 -07002107 break;
2108 case PATH_CUBIC:
caryclark54359292015-03-26 07:52:43 -07002109 last = 9;
caryclarkdac1d172014-06-17 05:15:38 -07002110 break;
2111 default:
caryclark55888e42016-07-18 10:01:36 -07002112 console.log("unknown " + (recType == REC_TYPE_PATH ? "REC_TYPE_PATH"
caryclarkdac1d172014-06-17 05:15:38 -07002113 : "REC_TYPE_COMPUTED") + " frag type:" + fragType);
2114 throw "stop execution";
2115 }
2116 if (recType == REC_TYPE_PATH) {
2117 hasPath = true;
2118 }
2119 break;
caryclark54359292015-03-26 07:52:43 -07002120 case REC_TYPE_PATH2:
2121 first = 1;
2122 switch (fragType) {
2123 case PATH_LINE:
2124 last = 5;
2125 break;
caryclark1049f122015-04-20 08:31:59 -07002126 case PATH_CONIC:
caryclark54359292015-03-26 07:52:43 -07002127 case PATH_QUAD:
2128 last = 7;
2129 break;
2130 case PATH_CUBIC:
2131 last = 9;
2132 break;
2133 default:
caryclark55888e42016-07-18 10:01:36 -07002134 console.log("unknown " + (recType == REC_TYPE_PATH2 ? "REC_TYPE_PATH2"
caryclark54359292015-03-26 07:52:43 -07002135 : "REC_TYPE_COMPUTED") + " frag type:" + fragType);
2136 throw "stop execution";
2137 }
2138 if (recType == REC_TYPE_PATH2) {
2139 hasPath = true;
2140 }
2141 break;
caryclarkdac1d172014-06-17 05:15:38 -07002142 case REC_TYPE_ACTIVE:
2143 if (firstActiveSpan < 0) {
2144 firstActiveSpan = tIndex;
2145 }
2146 first = 1;
2147 switch (fragType) {
2148 case ACTIVE_LINE_SPAN:
2149 last = 5;
2150 break;
caryclark1049f122015-04-20 08:31:59 -07002151 case ACTIVE_CONIC_SPAN:
caryclarkdac1d172014-06-17 05:15:38 -07002152 case ACTIVE_QUAD_SPAN:
2153 last = 7;
2154 break;
2155 case ACTIVE_CUBIC_SPAN:
2156 last = 9;
2157 break;
2158 default:
2159 console.log("unknown REC_TYPE_ACTIVE frag type: " + fragType);
2160 throw "stop execution";
2161 }
2162 break;
2163 case REC_TYPE_ADD:
2164 switch (fragType) {
2165 case ADD_MOVETO:
2166 break;
2167 case ADD_LINETO:
2168 last = 4;
2169 break;
caryclark1049f122015-04-20 08:31:59 -07002170 case ADD_CONICTO:
caryclarkdac1d172014-06-17 05:15:38 -07002171 case ADD_QUADTO:
2172 last = 6;
2173 break;
2174 case ADD_CUBICTO:
2175 last = 8;
2176 break;
2177 case ADD_CLOSE:
2178 case ADD_FILL:
2179 break;
2180 default:
2181 console.log("unknown REC_TYPE_ADD frag type: " + fragType);
2182 throw "stop execution";
2183 }
2184 break;
caryclark54359292015-03-26 07:52:43 -07002185 case REC_TYPE_AFTERPART:
2186 switch (fragType) {
2187 case PATH_LINE:
2188 last = 4;
2189 break;
caryclark1049f122015-04-20 08:31:59 -07002190 case PATH_CONIC:
caryclark54359292015-03-26 07:52:43 -07002191 case PATH_QUAD:
2192 last = 6;
2193 break;
2194 case PATH_CUBIC:
2195 last = 8;
2196 break;
2197 default:
2198 console.log("unknown REC_TYPE_ACTIVEPART frag type: " + fragType);
2199 throw "stop execution";
2200 }
2201 break;
caryclarkdac1d172014-06-17 05:15:38 -07002202 case REC_TYPE_SECT:
2203 switch (fragType) {
2204 case INTERSECT_LINE:
2205 first = 1; last = 5; first2 = 8; last2 = 12;
2206 break;
2207 case INTERSECT_LINE_2:
2208 first = 1; last = 5; first2 = 11; last2 = 15;
2209 break;
2210 case INTERSECT_LINE_NO:
2211 first = 0; last = 4; first2 = 4; last2 = 8;
2212 break;
caryclark1049f122015-04-20 08:31:59 -07002213 case INTERSECT_CONIC_LINE:
2214 first = 1; last = 7; first2 = 11; last2 = 15;
2215 break;
caryclarkdac1d172014-06-17 05:15:38 -07002216 case INTERSECT_QUAD_LINE:
2217 first = 1; last = 7; first2 = 10; last2 = 14;
2218 break;
caryclark1049f122015-04-20 08:31:59 -07002219 case INTERSECT_CONIC_LINE_2:
2220 first = 1; last = 7; first2 = 14; last2 = 18;
2221 break;
caryclarkdac1d172014-06-17 05:15:38 -07002222 case INTERSECT_QUAD_LINE_2:
2223 first = 1; last = 7; first2 = 13; last2 = 17;
2224 break;
caryclark1049f122015-04-20 08:31:59 -07002225 case INTERSECT_CONIC_LINE_NO:
2226 first = 0; last = 6; first2 = 7; last2 = 11;
2227 break;
caryclarkdac1d172014-06-17 05:15:38 -07002228 case INTERSECT_QUAD_LINE_NO:
2229 first = 0; last = 6; first2 = 6; last2 = 10;
2230 break;
caryclark1049f122015-04-20 08:31:59 -07002231 case INTERSECT_CONIC:
2232 first = 1; last = 7; first2 = 11; last2 = 17;
2233 break;
caryclarkdac1d172014-06-17 05:15:38 -07002234 case INTERSECT_QUAD:
2235 first = 1; last = 7; first2 = 10; last2 = 16;
2236 break;
caryclark1049f122015-04-20 08:31:59 -07002237 case INTERSECT_CONIC_2:
2238 first = 1; last = 7; first2 = 14; last2 = 20;
2239 break;
caryclarkdac1d172014-06-17 05:15:38 -07002240 case INTERSECT_QUAD_2:
2241 first = 1; last = 7; first2 = 13; last2 = 19;
2242 break;
caryclark1049f122015-04-20 08:31:59 -07002243 case INTERSECT_CONIC_NO:
2244 first = 0; last = 6; first2 = 7; last2 = 13;
2245 break;
caryclarkdac1d172014-06-17 05:15:38 -07002246 case INTERSECT_QUAD_NO:
2247 first = 0; last = 6; first2 = 6; last2 = 12;
2248 break;
2249 case INTERSECT_SELF_CUBIC:
2250 first = 1; last = 9;
2251 break;
2252 case INTERSECT_SELF_CUBIC_NO:
2253 first = 0; last = 8;
2254 break;
2255 case INTERSECT_CUBIC_LINE:
2256 first = 1; last = 9; first2 = 12; last2 = 16;
2257 break;
2258 case INTERSECT_CUBIC_LINE_2:
2259 first = 1; last = 9; first2 = 15; last2 = 19;
2260 break;
2261 case INTERSECT_CUBIC_LINE_3:
2262 first = 1; last = 9; first2 = 18; last2 = 22;
2263 break;
2264 case INTERSECT_CUBIC_LINE_NO:
2265 first = 0; last = 8; first2 = 8; last2 = 12;
2266 break;
caryclark55888e42016-07-18 10:01:36 -07002267 case INTERSECT_CONIC_QUAD:
2268 first = 1; last = 7; first2 = 11; last2 = 17;
2269 break;
2270 case INTERSECT_CONIC_QUAD_2:
2271 first = 1; last = 7; first2 = 14; last2 = 20;
2272 break;
caryclark6c3b9cd2016-09-26 05:36:58 -07002273 case INTERSECT_CONIC_QUAD_3:
2274 first = 1; last = 7; first2 = 17; last2 = 23;
2275 break;
2276 case INTERSECT_CONIC_QUAD_4:
2277 first = 1; last = 7; first2 = 20; last2 = 26;
2278 break;
caryclark55888e42016-07-18 10:01:36 -07002279 case INTERSECT_CONIC_QUAD_NO:
2280 first = 0; last = 6; first2 = 7; last2 = 13;
2281 break;
caryclarkdac1d172014-06-17 05:15:38 -07002282 case INTERSECT_CUBIC_QUAD:
2283 first = 1; last = 9; first2 = 12; last2 = 18;
2284 break;
2285 case INTERSECT_CUBIC_QUAD_2:
2286 first = 1; last = 9; first2 = 15; last2 = 21;
2287 break;
2288 case INTERSECT_CUBIC_QUAD_3:
2289 first = 1; last = 9; first2 = 18; last2 = 24;
2290 break;
2291 case INTERSECT_CUBIC_QUAD_4:
2292 first = 1; last = 9; first2 = 21; last2 = 27;
2293 break;
2294 case INTERSECT_CUBIC_QUAD_NO:
2295 first = 0; last = 8; first2 = 8; last2 = 14;
2296 break;
2297 case INTERSECT_CUBIC:
2298 first = 1; last = 9; first2 = 12; last2 = 20;
2299 break;
2300 case INTERSECT_CUBIC_2:
2301 first = 1; last = 9; first2 = 15; last2 = 23;
2302 break;
2303 case INTERSECT_CUBIC_3:
2304 first = 1; last = 9; first2 = 18; last2 = 26;
2305 break;
2306 case INTERSECT_CUBIC_4:
2307 first = 1; last = 9; first2 = 21; last2 = 29;
2308 break;
2309 case INTERSECT_CUBIC_NO:
2310 first = 0; last = 8; first2 = 8; last2 = 16;
2311 break;
2312 default:
2313 console.log("unknown REC_TYPE_SECT frag type: " + fragType);
2314 throw "stop execution";
2315 }
2316 break;
2317 default:
2318 continue;
2319 }
2320 for (var idx = first; idx < last; idx += 2) {
2321 xmin = Math.min(xmin, frags[idx]);
2322 xmax = Math.max(xmax, frags[idx]);
2323 ymin = Math.min(ymin, frags[idx + 1]);
2324 ymax = Math.max(ymax, frags[idx + 1]);
2325 }
2326 for (var idx = first2; idx < last2; idx += 2) {
2327 xmin = Math.min(xmin, frags[idx]);
2328 xmax = Math.max(xmax, frags[idx]);
2329 ymin = Math.min(ymin, frags[idx + 1]);
2330 ymax = Math.max(ymax, frags[idx + 1]);
2331 }
2332 }
2333 }
2334 var angleBounds = [Infinity, Infinity, -Infinity, -Infinity];
2335 for (var tIndex = 0; tIndex < test.length; tIndex += 3) {
2336 var recType = test[tIndex];
2337 var records = test[tIndex + 2];
2338 for (var recordIndex = 0; recordIndex < records.length; recordIndex += 2) {
2339 var fragType = records[recordIndex];
2340 var frags = records[recordIndex + 1];
2341 switch (recType) {
2342 case REC_TYPE_ACTIVE_OP:
2343 if (!draw_op) {
2344 break;
2345 }
2346 {
2347 var curve = curvePartialByID(test, frags[0], frags[1], frags[2]);
2348 curve_extremes(curve, angleBounds);
2349 }
2350 break;
2351 case REC_TYPE_ANGLE:
2352 if (!draw_angle) {
2353 break;
2354 }
caryclark54359292015-03-26 07:52:43 -07002355 {
caryclarkdac1d172014-06-17 05:15:38 -07002356 var curve = curvePartialByID(test, frags[0], frags[4], frags[5]);
2357 curve_extremes(curve, angleBounds);
2358 curve = curvePartialByID(test, frags[6], frags[10], frags[11]);
2359 curve_extremes(curve, angleBounds);
2360 curve = curvePartialByID(test, frags[12], frags[16], frags[17]);
2361 }
2362 break;
caryclark624637c2015-05-11 07:21:27 -07002363 case REC_TYPE_COINCIDENCE:
2364 if (!draw_coincidence) {
2365 break;
2366 }
2367 {
2368 var curve = curvePartialByID(test, frags[0], frags[1], frags[2]);
2369 curve_extremes(curve, angleBounds);
2370 }
2371 break;
caryclarkdac1d172014-06-17 05:15:38 -07002372 case REC_TYPE_SORT:
2373 if (!draw_sort) {
2374 break;
2375 }
2376 if (fragType == SORT_UNARY || fragType == SORT_BINARY) {
2377 var curve = curvePartialByID(test, frags[0], frags[6], frags[8]);
2378 curve_extremes(curve, angleBounds);
2379 }
2380 break;
caryclark03b03ca2015-04-23 09:13:37 -07002381 case REC_TYPE_TOP:
2382 if (!draw_top) {
2383 break;
2384 }
2385 {
2386 var curve = curvePartialByID(test, frags[0], frags[1], frags[2]);
2387 curve_extremes(curve, angleBounds);
2388 }
2389 break;
caryclarkdac1d172014-06-17 05:15:38 -07002390 }
2391 }
2392 }
2393 xmin = Math.min(xmin, angleBounds[0]);
2394 ymin = Math.min(ymin, angleBounds[1]);
2395 xmax = Math.max(xmax, angleBounds[2]);
2396 ymax = Math.max(ymax, angleBounds[3]);
2397 setScale(xmin, xmax, ymin, ymax);
2398 if (hasPath == false && hasComputedPath == true && !draw_computed) {
caryclark1049f122015-04-20 08:31:59 -07002399 draw_computed = 7; // show quadratics, conics, and cubics
caryclarkdac1d172014-06-17 05:15:38 -07002400 }
2401 if (hasPath == true && hasComputedPath == false && draw_computed) {
2402 draw_computed = 0;
2403 }
2404}
2405
caryclark26ad22a2015-10-16 09:03:38 -07002406function curveByIDMatch(test, id, recMatch) {
caryclark54359292015-03-26 07:52:43 -07002407 var tIndex = -3;
2408 while ((tIndex += 3) < test.length) {
caryclarkdac1d172014-06-17 05:15:38 -07002409 var recType = test[tIndex];
caryclark54359292015-03-26 07:52:43 -07002410 if (recType == REC_TYPE_OP) {
2411 continue;
2412 }
caryclark26ad22a2015-10-16 09:03:38 -07002413 if (recType != recMatch) {
caryclarkdac1d172014-06-17 05:15:38 -07002414 return [];
2415 }
2416 var records = test[tIndex + 2];
2417 for (var recordIndex = 0; recordIndex < records.length; recordIndex += 2) {
2418 var fragType = records[recordIndex];
2419 var frags = records[recordIndex + 1];
2420 if (frags[0] == id) {
2421 switch (fragType) {
caryclark54359292015-03-26 07:52:43 -07002422 case PATH_LINE:
caryclarkdac1d172014-06-17 05:15:38 -07002423 return [frags[1], frags[2], frags[3], frags[4]];
caryclark54359292015-03-26 07:52:43 -07002424 case PATH_QUAD:
caryclarkdac1d172014-06-17 05:15:38 -07002425 return [frags[1], frags[2], frags[3], frags[4],
2426 frags[5], frags[6]];
caryclark1049f122015-04-20 08:31:59 -07002427 case PATH_CONIC:
2428 return [frags[1], frags[2], frags[3], frags[4],
2429 frags[5], frags[6], frags[7]];
caryclark54359292015-03-26 07:52:43 -07002430 case PATH_CUBIC:
caryclarkdac1d172014-06-17 05:15:38 -07002431 return [frags[1], frags[2], frags[3], frags[4],
2432 frags[5], frags[6], frags[7], frags[8]];
2433 }
2434 }
2435 }
caryclarkdac1d172014-06-17 05:15:38 -07002436 }
2437 return [];
2438}
2439
caryclark26ad22a2015-10-16 09:03:38 -07002440function curveByID(test, id) {
2441 var result = draw_path >= 4 ? curveByIDMatch(test, id, REC_TYPE_ALIGNED) : [];
2442 if (!result.length) {
2443 result = curveByIDMatch(test, id, REC_TYPE_PATH);
2444 }
2445 return result;
2446}
2447
2448function curvePartialByIDMatch(test, id, t0, t1, recMatch) {
caryclark54359292015-03-26 07:52:43 -07002449 var tIndex = -3;
2450 while ((tIndex += 3) < test.length) {
caryclarkdac1d172014-06-17 05:15:38 -07002451 var recType = test[tIndex];
caryclark54359292015-03-26 07:52:43 -07002452 if (recType == REC_TYPE_OP) {
2453 continue;
2454 }
caryclark26ad22a2015-10-16 09:03:38 -07002455 if (recType != recMatch) {
caryclarkdac1d172014-06-17 05:15:38 -07002456 return [];
2457 }
2458 var records = test[tIndex + 2];
2459 for (var recordIndex = 0; recordIndex < records.length; recordIndex += 2) {
2460 var fragType = records[recordIndex];
2461 var frags = records[recordIndex + 1];
2462 if (frags[0] == id) {
2463 switch (fragType) {
caryclark54359292015-03-26 07:52:43 -07002464 case PATH_LINE:
caryclarkdac1d172014-06-17 05:15:38 -07002465 return linePartial(frags[1], frags[2], frags[3], frags[4], t0, t1);
caryclark54359292015-03-26 07:52:43 -07002466 case PATH_QUAD:
caryclarkdac1d172014-06-17 05:15:38 -07002467 return quadPartial(frags[1], frags[2], frags[3], frags[4],
2468 frags[5], frags[6], t0, t1);
caryclark1049f122015-04-20 08:31:59 -07002469 case PATH_CONIC:
2470 return conicPartial(frags[1], frags[2], frags[3], frags[4],
2471 frags[5], frags[6], frags[7], t0, t1);
caryclark54359292015-03-26 07:52:43 -07002472 case PATH_CUBIC:
caryclarkdac1d172014-06-17 05:15:38 -07002473 return cubicPartial(frags[1], frags[2], frags[3], frags[4],
2474 frags[5], frags[6], frags[7], frags[8], t0, t1);
2475 }
2476 }
2477 }
caryclarkdac1d172014-06-17 05:15:38 -07002478 }
2479 return [];
2480}
2481
caryclark26ad22a2015-10-16 09:03:38 -07002482function curvePartialByID(test, id, t0, t1) {
2483 var result = draw_path >= 4 ? curvePartialByIDMatch(test, id, t0, t1, REC_TYPE_ALIGNED) : [];
2484 if (!result.length) {
2485 result = curvePartialByIDMatch(test, id, t0, t1, REC_TYPE_PATH);
2486 }
2487 return result;
2488}
2489
2490function idByCurveIDMatch(test, frag, type, recMatch) {
caryclark54359292015-03-26 07:52:43 -07002491 var tIndex = 0;
caryclarkdac1d172014-06-17 05:15:38 -07002492 while (tIndex < test.length) {
2493 var recType = test[tIndex];
caryclark26ad22a2015-10-16 09:03:38 -07002494 if (recType != recMatch) {
caryclark54359292015-03-26 07:52:43 -07002495 ++tIndex;
2496 continue;
caryclarkdac1d172014-06-17 05:15:38 -07002497 }
2498 var records = test[tIndex + 2];
2499 for (var recordIndex = 0; recordIndex < records.length; recordIndex += 2) {
2500 var fragType = records[recordIndex];
2501 var frags = records[recordIndex + 1];
caryclark54359292015-03-26 07:52:43 -07002502 if (frag.length != frags.length - 1) {
2503 continue;
2504 }
caryclarkdac1d172014-06-17 05:15:38 -07002505 switch (fragType) {
caryclark54359292015-03-26 07:52:43 -07002506 case PATH_LINE:
caryclarkdac1d172014-06-17 05:15:38 -07002507 if (frag[0] != frags[1] || frag[1] != frags[2]
2508 || frag[2] != frags[3] || frag[3] != frags[4]) {
2509 continue;
2510 }
2511 return frags[0];
caryclark54359292015-03-26 07:52:43 -07002512 case PATH_QUAD:
caryclarkdac1d172014-06-17 05:15:38 -07002513 if (frag[0] != frags[1] || frag[1] != frags[2]
2514 || frag[2] != frags[3] || frag[3] != frags[4]
2515 || frag[4] != frags[5] || frag[5] != frags[6]) {
2516 continue;
2517 }
2518 return frags[0];
caryclark1049f122015-04-20 08:31:59 -07002519 case PATH_CONIC:
2520 if (frag[0] != frags[1] || frag[1] != frags[2]
2521 || frag[2] != frags[3] || frag[3] != frags[4]
2522 || frag[4] != frags[5] || frag[5] != frags[6]
2523 || frag[6] != frags[7]) {
2524 continue;
2525 }
2526 return frags[0];
caryclark54359292015-03-26 07:52:43 -07002527 case PATH_CUBIC:
caryclarkdac1d172014-06-17 05:15:38 -07002528 if (frag[0] != frags[1] || frag[1] != frags[2]
2529 || frag[2] != frags[3] || frag[3] != frags[4]
2530 || frag[4] != frags[5] || frag[5] != frags[6]
2531 || frag[6] != frags[7] || frag[7] != frags[8]) {
2532 continue;
2533 }
2534 return frags[0];
2535 }
2536 }
2537 ++tIndex;
2538 }
2539 return -1;
2540}
2541
caryclark26ad22a2015-10-16 09:03:38 -07002542function idByCurve(test, frag, type) {
2543 var result = draw_path >= 4 ? idByCurveIDMatch(test, frag, type, REC_TYPE_ALIGNED) : [];
2544 if (!result.length) {
2545 result = idByCurveIDMatch(test, frag, type, REC_TYPE_PATH);
2546 }
2547 return result;
2548}
2549
caryclarkdac1d172014-06-17 05:15:38 -07002550function curve_extremes(curve, bounds) {
caryclark1049f122015-04-20 08:31:59 -07002551 var length = curve.length == 7 ? 6 : curve.length;
caryclarked0935a2015-10-22 07:23:52 -07002552 for (var index = 0; index < length; index += 2) {
caryclarkdac1d172014-06-17 05:15:38 -07002553 var x = curve[index];
2554 var y = curve[index + 1];
2555 bounds[0] = Math.min(bounds[0], x);
2556 bounds[1] = Math.min(bounds[1], y);
2557 bounds[2] = Math.max(bounds[2], x);
2558 bounds[3] = Math.max(bounds[3], y);
2559 }
2560}
2561
2562function setScale(x0, x1, y0, y1) {
2563 var srcWidth = x1 - x0;
2564 var srcHeight = y1 - y0;
2565 var usableWidth = screenWidth;
2566 var xDigits = Math.ceil(Math.log(Math.abs(xmax)) / Math.log(10));
2567 var yDigits = Math.ceil(Math.log(Math.abs(ymax)) / Math.log(10));
2568 usableWidth -= (xDigits + yDigits) * 10;
2569 usableWidth -= decimal_places * 10;
2570 if (draw_legend) {
2571 usableWidth -= 40;
2572 }
2573 var hscale = usableWidth / srcWidth;
2574 var vscale = screenHeight / srcHeight;
2575 scale = Math.min(hscale, vscale);
2576 var invScale = 1 / scale;
2577 var sxmin = x0 - invScale * 5;
2578 var symin = y0 - invScale * 10;
2579 var sxmax = x1 + invScale * (6 * decimal_places + 10);
2580 var symax = y1 + invScale * 10;
2581 srcWidth = sxmax - sxmin;
2582 srcHeight = symax - symin;
2583 hscale = usableWidth / srcWidth;
2584 vscale = screenHeight / srcHeight;
2585 scale = Math.min(hscale, vscale);
2586 srcLeft = sxmin;
2587 srcTop = symin;
2588}
2589
2590function drawArc(curve, op, from, to) {
2591 var type = PATH_LINE + (curve.length / 2 - 2);
2592 var pt = pointAtT(curve, type, op ? 0.4 : 0.6);
2593 var dy = pt.y - curve[1];
2594 var dx = pt.x - curve[0];
2595 var dist = Math.sqrt(dy * dy + dx * dx);
2596 var _dist = dist * scale;
2597 var angle = Math.atan2(dy, dx);
2598 var _px = (curve[0] - srcLeft) * scale;
2599 var _py = (curve[1] - srcTop) * scale;
2600 var divisor = 4;
2601 var endDist;
2602 do {
2603 var ends = [];
2604 for (var index = -1; index <= 1; index += 2) {
2605 var px = Math.cos(index * Math.PI / divisor);
2606 var py = Math.sin(index * Math.PI / divisor);
2607 ends.push(px);
2608 ends.push(py);
2609 }
2610 var endDx = (ends[2] - ends[0]) * scale * dist;
2611 var endDy = (ends[3] - ends[1]) * scale * dist;
2612 endDist = Math.sqrt(endDx * endDx + endDy * endDy);
2613 if (endDist < 100) {
2614 break;
2615 }
2616 divisor *= 2;
2617 } while (true);
2618 if (endDist < 30) {
2619 return;
2620 }
2621 if (op) {
2622 divisor *= 2;
2623 }
2624 ctx.strokeStyle = op ? "rgba(210,0,45, 0.4)" : "rgba(90,90,90, 0.5)";
2625 ctx.beginPath();
2626 ctx.arc(_px, _py, _dist, angle - Math.PI / divisor, angle + Math.PI / divisor, false);
2627 ctx.stroke();
2628 var saveAlign = ctx.textAlign;
2629 var saveStyle = ctx.fillStyle;
2630 var saveFont = ctx.font;
2631 ctx.textAlign = "center";
2632 ctx.fillStyle = "black";
2633 ctx.font = "normal 24px Arial";
2634 divisor *= 0.8;
2635 for (var index = -1; index <= 1; index += 2) {
2636 var px = curve[0] + Math.cos(angle + index * Math.PI / divisor) * dist;
2637 var py = curve[1] + Math.sin(angle + index * Math.PI / divisor) * dist;
2638 var _px = (px - srcLeft) * scale;
2639 var _py = (py - srcTop) * scale;
2640 ctx.fillText(index < 0 ? to.toString() : from.toString(), _px, _py + 8);
2641 }
2642 ctx.textAlign = saveAlign;
2643 ctx.fillStyle = saveStyle;
2644 ctx.font = saveFont;
2645}
2646
2647function drawPoint(px, py, end) {
caryclark1049f122015-04-20 08:31:59 -07002648 var length = drawnPts.length == 7 ? 6 : drawnPts.length;
2649 for (var pts = 0; pts < length; pts += 2) {
caryclarkdac1d172014-06-17 05:15:38 -07002650 var x = drawnPts[pts];
2651 var y = drawnPts[pts + 1];
2652 if (px == x && py == y) {
2653 return;
2654 }
2655 }
2656 drawnPts.push(px);
2657 drawnPts.push(py);
2658 var label = px.toFixed(decimal_places) + ", " + py.toFixed(decimal_places);
2659 var _px = (px - srcLeft) * scale;
2660 var _py = (py - srcTop) * scale;
2661 ctx.beginPath();
2662 ctx.arc(_px, _py, 3, 0, Math.PI*2, true);
2663 ctx.closePath();
2664 if (end) {
2665 ctx.fill();
2666 } else {
2667 ctx.stroke();
2668 }
2669 if (debug_xy) {
2670 ctx.textAlign = "left";
2671 ctx.fillText(label, _px + 5, _py);
2672 }
2673}
2674
caryclark1049f122015-04-20 08:31:59 -07002675function coordCount(curveType) {
2676 switch (curveType) {
2677 case PATH_LINE:
2678 return 4;
2679 case PATH_QUAD:
2680 return 6;
2681 case PATH_CONIC:
2682 return 6;
2683 case PATH_CUBIC:
2684 return 8;
2685 }
2686 return -1;
2687}
2688
caryclarkdac1d172014-06-17 05:15:38 -07002689function drawPoints(ptArray, curveType, drawControls) {
caryclark1049f122015-04-20 08:31:59 -07002690 var count = coordCount(curveType);
caryclarkdac1d172014-06-17 05:15:38 -07002691 for (var idx = 0; idx < count; idx += 2) {
2692 if (!drawControls && idx != 0 && idx != count - 2) {
2693 continue;
2694 }
2695 drawPoint(ptArray[idx], ptArray[idx + 1], idx == 0 || idx == count - 2);
2696 }
2697}
2698
2699function drawControlLines(curve, curveType, drawEnd) {
2700 if (curveType == PATH_LINE) {
2701 return;
2702 }
2703 ctx.strokeStyle = "rgba(0,0,0, 0.3)";
2704 drawLine(curve[0], curve[1], curve[2], curve[3]);
2705 drawLine(curve[2], curve[3], curve[4], curve[5]);
2706 if (curveType == PATH_CUBIC) {
2707 drawLine(curve[4], curve[5], curve[6], curve[7]);
2708 if (drawEnd > 1) {
2709 drawLine(curve[6], curve[7], curve[0], curve[1]);
2710 if (drawEnd > 2) {
2711 drawLine(curve[0], curve[1], curve[4], curve[5]);
2712 drawLine(curve[6], curve[7], curve[2], curve[3]);
2713 }
2714 }
2715 } else if (drawEnd > 1) {
2716 drawLine(curve[4], curve[5], curve[0], curve[1]);
2717 }
2718}
2719
2720function pointAtT(curve, curveType, t) {
2721 var xy = {};
2722 switch (curveType) {
2723 case PATH_LINE:
2724 var a = 1 - t;
2725 var b = t;
2726 xy.x = a * curve[0] + b * curve[2];
2727 xy.y = a * curve[1] + b * curve[3];
2728 break;
2729 case PATH_QUAD:
2730 var one_t = 1 - t;
2731 var a = one_t * one_t;
2732 var b = 2 * one_t * t;
2733 var c = t * t;
2734 xy.x = a * curve[0] + b * curve[2] + c * curve[4];
2735 xy.y = a * curve[1] + b * curve[3] + c * curve[5];
2736 break;
caryclark1049f122015-04-20 08:31:59 -07002737 case PATH_CONIC:
2738 var one_t = 1 - t;
2739 var a = one_t * one_t;
2740 var b = 2 * one_t * t;
2741 var c = t * t;
2742 xy.x = a * curve[0] + b * curve[2] * curve[6] + c * curve[4];
2743 xy.y = a * curve[1] + b * curve[3] * curve[6] + c * curve[5];
2744 var d = a + b * curve[6] + c;
2745 xy.x /= d;
2746 xy.y /= d;
2747 break;
caryclarkdac1d172014-06-17 05:15:38 -07002748 case PATH_CUBIC:
2749 var one_t = 1 - t;
2750 var one_t2 = one_t * one_t;
2751 var a = one_t2 * one_t;
2752 var b = 3 * one_t2 * t;
2753 var t2 = t * t;
2754 var c = 3 * one_t * t2;
2755 var d = t2 * t;
2756 xy.x = a * curve[0] + b * curve[2] + c * curve[4] + d * curve[6];
2757 xy.y = a * curve[1] + b * curve[3] + c * curve[5] + d * curve[7];
2758 break;
2759 }
2760 return xy;
2761}
caryclark55888e42016-07-18 10:01:36 -07002762
caryclarkdac1d172014-06-17 05:15:38 -07002763function drawPointAtT(curve, curveType) {
2764 var x, y;
2765 var xy = pointAtT(curve, curveType, curveT);
2766 drawPoint(xy.x, xy.y, true);
2767 if (!draw_intersectT) {
2768 return;
2769 }
2770 ctx.fillStyle = "red";
2771 drawTAtPointUp(xy.x, xy.y, curveT);
2772}
2773
2774function drawTAtPointUp(px, py, t) {
2775 var label = t.toFixed(decimal_places);
2776 var _px = (px - srcLeft)* scale;
2777 var _py = (py - srcTop) * scale;
2778 ctx.fillText(label, _px + 5, _py - 10);
2779}
2780
2781function drawTAtPointDown(px, py, t) {
2782 var label = t.toFixed(decimal_places);
2783 var _px = (px - srcLeft)* scale;
2784 var _py = (py - srcTop) * scale;
2785 ctx.fillText(label, _px + 5, _py + 10);
2786}
2787
2788function alreadyDrawnLine(x1, y1, x2, y2) {
2789 if (collect_bounds) {
2790 if (focus_enabled) {
2791 focusXmin = Math.min(focusXmin, x1, x2);
2792 focusYmin = Math.min(focusYmin, y1, y2);
2793 focusXmax = Math.max(focusXmax, x1, x2);
2794 focusYmax = Math.max(focusYmax, y1, y2);
2795 }
2796 return true;
2797 }
2798 for (var pts = 0; pts < drawnLines.length; pts += 4) {
2799 if (x1 == drawnLines[pts] && y1 == drawnLines[pts + 1]
2800 && x2 == drawnLines[pts + 2] && y2 == drawnLines[pts + 3]) {
2801 return true;
2802 }
2803 }
2804 drawnLines.push(x1);
2805 drawnLines.push(y1);
2806 drawnLines.push(x2);
2807 drawnLines.push(y2);
2808 return false;
2809}
2810
2811function drawLine(x1, y1, x2, y2) {
2812 if (alreadyDrawnLine(x1, y1, x2, y2)) {
2813 return;
2814 }
2815 ctx.beginPath();
2816 ctx.moveTo((x1 - srcLeft) * scale,
2817 (y1 - srcTop) * scale);
2818 ctx.lineTo((x2 - srcLeft) * scale,
2819 (y2 - srcTop) * scale);
2820 ctx.stroke();
2821}
2822
2823function linePartial(x1, y1, x2, y2, t1, t2) {
2824 var dx = x1 - x2;
2825 var dy = y1 - y2;
2826 var array = [
2827 x1 - t1 * dx,
2828 y1 - t1 * dy,
2829 x1 - t2 * dx,
2830 y1 - t2 * dy
2831 ];
2832 return array;
2833}
2834
2835function drawLinePartial(x1, y1, x2, y2, t1, t2) {
2836 var a = linePartial(x1, y1, x2, y2, t1, t2);
2837 var ax = a[0];
2838 var ay = a[1];
2839 var bx = a[2];
2840 var by = a[3];
2841 if (alreadyDrawnLine(ax, ay, bx, by)) {
2842 return;
2843 }
2844 ctx.beginPath();
2845 ctx.moveTo((ax - srcLeft) * scale,
2846 (ay - srcTop) * scale);
2847 ctx.lineTo((bx - srcLeft) * scale,
2848 (by - srcTop) * scale);
2849 ctx.stroke();
2850}
2851
2852function alreadyDrawnQuad(x1, y1, x2, y2, x3, y3) {
2853 if (collect_bounds) {
2854 if (focus_enabled) {
2855 focusXmin = Math.min(focusXmin, x1, x2, x3);
2856 focusYmin = Math.min(focusYmin, y1, y2, y3);
2857 focusXmax = Math.max(focusXmax, x1, x2, x3);
2858 focusYmax = Math.max(focusYmax, y1, y2, y3);
2859 }
2860 return true;
2861 }
2862 for (var pts = 0; pts < drawnQuads.length; pts += 6) {
2863 if (x1 == drawnQuads[pts] && y1 == drawnQuads[pts + 1]
2864 && x2 == drawnQuads[pts + 2] && y2 == drawnQuads[pts + 3]
2865 && x3 == drawnQuads[pts + 4] && y3 == drawnQuads[pts + 5]) {
2866 return true;
2867 }
2868 }
2869 drawnQuads.push(x1);
2870 drawnQuads.push(y1);
2871 drawnQuads.push(x2);
2872 drawnQuads.push(y2);
2873 drawnQuads.push(x3);
2874 drawnQuads.push(y3);
2875 return false;
2876}
2877
2878function drawQuad(x1, y1, x2, y2, x3, y3) {
2879 if (alreadyDrawnQuad(x1, y1, x2, y2, x3, y3)) {
2880 return;
2881 }
2882 ctx.beginPath();
2883 ctx.moveTo((x1 - srcLeft) * scale,
2884 (y1 - srcTop) * scale);
2885 ctx.quadraticCurveTo((x2 - srcLeft) * scale,
2886 (y2 - srcTop) * scale,
2887 (x3 - srcLeft) * scale,
2888 (y3 - srcTop) * scale);
2889 ctx.stroke();
2890}
2891
2892function interp(A, B, t) {
2893 return A + (B - A) * t;
2894}
2895
2896function interp_quad_coords(x1, x2, x3, t)
2897{
2898 var ab = interp(x1, x2, t);
2899 var bc = interp(x2, x3, t);
2900 var abc = interp(ab, bc, t);
2901 return abc;
2902}
2903
2904function quadPartial(x1, y1, x2, y2, x3, y3, t1, t2) {
2905 var ax = interp_quad_coords(x1, x2, x3, t1);
2906 var ay = interp_quad_coords(y1, y2, y3, t1);
2907 var dx = interp_quad_coords(x1, x2, x3, (t1 + t2) / 2);
2908 var dy = interp_quad_coords(y1, y2, y3, (t1 + t2) / 2);
2909 var cx = interp_quad_coords(x1, x2, x3, t2);
2910 var cy = interp_quad_coords(y1, y2, y3, t2);
2911 var bx = 2*dx - (ax + cx)/2;
2912 var by = 2*dy - (ay + cy)/2;
2913 var array = [
2914 ax, ay, bx, by, cx, cy
2915 ];
2916 return array;
2917}
2918
2919function drawQuadPartial(x1, y1, x2, y2, x3, y3, t1, t2) {
2920 var a = quadPartial(x1, y1, x2, y2, x3, y3, t1, t2);
2921 var ax = a[0];
2922 var ay = a[1];
2923 var bx = a[2];
2924 var by = a[3];
2925 var cx = a[4];
2926 var cy = a[5];
2927 if (alreadyDrawnQuad(ax, ay, bx, by, cx, cy)) {
2928 return;
2929 }
2930 ctx.beginPath();
2931 ctx.moveTo((ax - srcLeft) * scale,
2932 (ay - srcTop) * scale);
2933 ctx.quadraticCurveTo((bx - srcLeft) * scale,
2934 (by - srcTop) * scale,
2935 (cx - srcLeft) * scale,
2936 (cy - srcTop) * scale);
2937 ctx.stroke();
2938}
2939
caryclark1049f122015-04-20 08:31:59 -07002940function alreadyDrawnConic(x1, y1, x2, y2, x3, y3, w) {
2941 if (collect_bounds) {
2942 if (focus_enabled) {
2943 focusXmin = Math.min(focusXmin, x1, x2, x3);
2944 focusYmin = Math.min(focusYmin, y1, y2, y3);
2945 focusXmax = Math.max(focusXmax, x1, x2, x3);
2946 focusYmax = Math.max(focusYmax, y1, y2, y3);
2947 }
2948 return true;
2949 }
2950 for (var pts = 0; pts < drawnConics.length; pts += 8) {
2951 if (x1 == drawnConics[pts] && y1 == drawnCubics[pts + 1]
caryclark55888e42016-07-18 10:01:36 -07002952 && x2 == drawnCubics[pts + 2] && y2 == drawnCubics[pts + 3]
2953 && x3 == drawnCubics[pts + 4] && y3 == drawnCubics[pts + 5]
caryclark1049f122015-04-20 08:31:59 -07002954 && w == drawnCubics[pts + 6]) {
2955 return true;
2956 }
2957 }
2958 drawnConics.push(x1);
2959 drawnConics.push(y1);
2960 drawnConics.push(x2);
2961 drawnConics.push(y2);
2962 drawnConics.push(x3);
2963 drawnConics.push(y3);
2964 drawnCubics.push(w);
2965 return false;
2966}
2967
2968var kMaxConicToQuadPOW2 = 5;
2969
2970function computeQuadPOW2(curve, tol) {
2971 var a = curve[6] - 1;
2972 var k = a / (4 * (2 + a));
2973 var x = k * (curve[0] - 2 * curve[2] + curve[4]);
2974 var y = k * (curve[1] - 2 * curve[3] + curve[5]);
2975
2976 var error = Math.sqrt(x * x + y * y);
2977 var pow2;
2978 for (pow2 = 0; pow2 < kMaxConicToQuadPOW2; ++pow2) {
2979 if (error <= tol) {
2980 break;
2981 }
2982 error *= 0.25;
2983 }
2984 return pow2;
2985}
2986
2987function subdivide_w_value(w) {
2988 return Math.sqrt(0.5 + w * 0.5);
2989}
2990
2991function chop(curve, part1, part2) {
2992 var w = curve[6];
2993 var scale = 1 / (1 + w);
2994 part1[0] = curve[0];
2995 part1[1] = curve[1];
2996 part1[2] = (curve[0] + curve[2] * w) * scale;
2997 part1[3] = (curve[1] + curve[3] * w) * scale;
2998 part1[4] = part2[0] = (curve[0] + (curve[2] * w) * 2 + curve[4]) * scale * 0.5;
2999 part1[5] = part2[1] = (curve[1] + (curve[3] * w) * 2 + curve[5]) * scale * 0.5;
3000 part2[2] = (curve[2] * w + curve[4]) * scale;
3001 part2[3] = (curve[3] * w + curve[5]) * scale;
3002 part2[4] = curve[4];
3003 part2[5] = curve[5];
3004 part1[6] = part2[6] = subdivide_w_value(w);
3005}
3006
3007function subdivide(curve, level, pts) {
3008 if (0 == level) {
3009 pts.push(curve[2]);
3010 pts.push(curve[3]);
3011 pts.push(curve[4]);
3012 pts.push(curve[5]);
3013 } else {
3014 var part1 = [], part2 = [];
3015 chop(curve, part1, part2);
3016 --level;
3017 subdivide(part1, level, pts);
3018 subdivide(part2, level, pts);
3019 }
3020}
3021
3022function chopIntoQuadsPOW2(curve, pow2, pts) {
3023 subdivide(curve, pow2, pts);
3024 return 1 << pow2;
3025}
3026
3027function drawConicWithQuads(x1, y1, x2, y2, x3, y3, w) {
3028 if (alreadyDrawnConic(x1, y1, x2, y2, x3, y3, w)) {
3029 return;
3030 }
3031 ctx.beginPath();
3032 ctx.moveTo((x1 - srcLeft) * scale,
3033 (y1 - srcTop) * scale);
3034 var tol = 1 / scale;
3035 var curve = [x1, y1, x2, y2, x3, y3, w];
3036 var pow2 = computeQuadPOW2(curve, tol);
3037 var pts = [];
3038 chopIntoQuadsPOW2(curve, pow2, pts);
3039 for (var i = 0; i < pts.length; i += 4) {
3040 ctx.quadraticCurveTo(
3041 (pts[i + 0] - srcLeft) * scale, (pts[i + 1] - srcTop) * scale,
3042 (pts[i + 2] - srcLeft) * scale, (pts[i + 3] - srcTop) * scale);
3043 }
3044 ctx.stroke();
3045}
3046
3047function conic_eval_numerator(x1, x2, x3, w, t) {
3048 var src2w = x2 * w;
3049 var C = x1;
3050 var A = x3 - 2 * src2w + C;
3051 var B = 2 * (src2w - C);
3052 return (A * t + B) * t + C;
3053}
3054
3055
3056function conic_eval_denominator(w, t) {
3057 var B = 2 * (w - 1);
3058 var C = 1;
3059 var A = -B;
3060 return (A * t + B) * t + C;
3061}
3062
3063function conicPartial(x1, y1, x2, y2, x3, y3, w, t1, t2) {
3064 var ax = conic_eval_numerator(x1, x2, x3, w, t1);
3065 var ay = conic_eval_numerator(y1, y2, y3, w, t1);
3066 var az = conic_eval_denominator(w, t1);
3067 var midT = (t1 + t2) / 2;
3068 var dx = conic_eval_numerator(x1, x2, x3, w, midT);
3069 var dy = conic_eval_numerator(y1, y2, y3, w, midT);
3070 var dz = conic_eval_denominator(w, midT);
3071 var cx = conic_eval_numerator(x1, x2, x3, w, t2);
3072 var cy = conic_eval_numerator(y1, y2, y3, w, t2);
3073 var cz = conic_eval_denominator(w, t2);
3074 var bx = 2 * dx - (ax + cx) / 2;
3075 var by = 2 * dy - (ay + cy) / 2;
3076 var bz = 2 * dz - (az + cz) / 2;
3077 var dt = t2 - t1;
3078 var dt_1 = 1 - dt;
caryclark1049f122015-04-20 08:31:59 -07003079 var array = [
caryclarked0935a2015-10-22 07:23:52 -07003080 ax / az, ay / az, bx / bz, by / bz, cx / cz, cy / cz, 0
caryclark1049f122015-04-20 08:31:59 -07003081 ];
caryclarked0935a2015-10-22 07:23:52 -07003082 var dMidAC = { x:(array[0] + array[4]) / 2, y:(array[1] + array[5]) / 2 };
3083 var dMid = { x:dx / dz, y:dy / dz };
3084 var dWNumer = { x:dMidAC.x - dMid.x, y:dMidAC.y - dMid.y };
3085 var dWDenom = { x:dMid.x - array[2], y:dMid.y - array[3] };
3086 var partW = Math.sqrt(dWNumer.x * dWNumer.x + dWNumer.y * dWNumer.y)
3087 / Math.sqrt(dWDenom.x * dWDenom.x + dWDenom.y * dWDenom.y);
3088 array[6] = partW;
caryclark1049f122015-04-20 08:31:59 -07003089 return array;
3090}
caryclark55888e42016-07-18 10:01:36 -07003091
caryclark1049f122015-04-20 08:31:59 -07003092function drawConicPartial(x1, y1, x2, y2, x3, y3, w, t1, t2) {
3093 var a = conicPartial(x1, y1, x2, y2, x3, y3, w, t1, t2);
3094 var ax = a[0];
3095 var ay = a[1];
3096 var bx = a[2];
3097 var by = a[3];
3098 var cx = a[4];
3099 var cy = a[5];
3100 var w_ = a[6];
3101 drawConicWithQuads(ax, ay, bx, by, cx, cy, w_);
3102}
3103
caryclarkdac1d172014-06-17 05:15:38 -07003104function alreadyDrawnCubic(x1, y1, x2, y2, x3, y3, x4, y4) {
3105 if (collect_bounds) {
3106 if (focus_enabled) {
3107 focusXmin = Math.min(focusXmin, x1, x2, x3, x4);
3108 focusYmin = Math.min(focusYmin, y1, y2, y3, y4);
3109 focusXmax = Math.max(focusXmax, x1, x2, x3, x4);
3110 focusYmax = Math.max(focusYmax, y1, y2, y3, y4);
3111 }
3112 return true;
3113 }
3114 for (var pts = 0; pts < drawnCubics.length; pts += 8) {
3115 if (x1 == drawnCubics[pts] && y1 == drawnCubics[pts + 1]
caryclark55888e42016-07-18 10:01:36 -07003116 && x2 == drawnCubics[pts + 2] && y2 == drawnCubics[pts + 3]
3117 && x3 == drawnCubics[pts + 4] && y3 == drawnCubics[pts + 5]
caryclarkdac1d172014-06-17 05:15:38 -07003118 && x4 == drawnCubics[pts + 6] && y4 == drawnCubics[pts + 7]) {
3119 return true;
3120 }
3121 }
3122 drawnCubics.push(x1);
3123 drawnCubics.push(y1);
3124 drawnCubics.push(x2);
3125 drawnCubics.push(y2);
3126 drawnCubics.push(x3);
3127 drawnCubics.push(y3);
3128 drawnCubics.push(x4);
3129 drawnCubics.push(y4);
3130 return false;
3131}
3132
3133function drawCubic(x1, y1, x2, y2, x3, y3, x4, y4) {
3134 if (alreadyDrawnCubic(x1, y1, x2, y2, x3, y3, x4, y4)) {
3135 return;
3136 }
3137 ctx.beginPath();
3138 ctx.moveTo((x1 - srcLeft) * scale,
3139 (y1 - srcTop) * scale);
3140 ctx.bezierCurveTo((x2 - srcLeft) * scale,
3141 (y2 - srcTop) * scale,
3142 (x3 - srcLeft) * scale,
3143 (y3 - srcTop) * scale,
3144 (x4 - srcLeft) * scale,
3145 (y4 - srcTop) * scale);
3146 ctx.stroke();
3147}
3148
3149function interp_cubic_coords(x1, x2, x3, x4, t)
3150{
3151 var ab = interp(x1, x2, t);
3152 var bc = interp(x2, x3, t);
3153 var cd = interp(x3, x4, t);
3154 var abc = interp(ab, bc, t);
3155 var bcd = interp(bc, cd, t);
3156 var abcd = interp(abc, bcd, t);
3157 return abcd;
3158}
3159
3160function cubicPartial(x1, y1, x2, y2, x3, y3, x4, y4, t1, t2) {
3161 var ax = interp_cubic_coords(x1, x2, x3, x4, t1);
3162 var ay = interp_cubic_coords(y1, y2, y3, y4, t1);
3163 var ex = interp_cubic_coords(x1, x2, x3, x4, (t1*2+t2)/3);
3164 var ey = interp_cubic_coords(y1, y2, y3, y4, (t1*2+t2)/3);
3165 var fx = interp_cubic_coords(x1, x2, x3, x4, (t1+t2*2)/3);
3166 var fy = interp_cubic_coords(y1, y2, y3, y4, (t1+t2*2)/3);
3167 var dx = interp_cubic_coords(x1, x2, x3, x4, t2);
3168 var dy = interp_cubic_coords(y1, y2, y3, y4, t2);
3169 var mx = ex * 27 - ax * 8 - dx;
3170 var my = ey * 27 - ay * 8 - dy;
3171 var nx = fx * 27 - ax - dx * 8;
3172 var ny = fy * 27 - ay - dy * 8;
3173 var bx = (mx * 2 - nx) / 18;
3174 var by = (my * 2 - ny) / 18;
3175 var cx = (nx * 2 - mx) / 18;
3176 var cy = (ny * 2 - my) / 18;
3177 var array = [
3178 ax, ay, bx, by, cx, cy, dx, dy
3179 ];
3180 return array;
3181}
caryclark55888e42016-07-18 10:01:36 -07003182
caryclarkdac1d172014-06-17 05:15:38 -07003183function drawCubicPartial(x1, y1, x2, y2, x3, y3, x4, y4, t1, t2) {
3184 var a = cubicPartial(x1, y1, x2, y2, x3, y3, x4, y4, t1, t2);
3185 var ax = a[0];
3186 var ay = a[1];
3187 var bx = a[2];
3188 var by = a[3];
3189 var cx = a[4];
3190 var cy = a[5];
3191 var dx = a[6];
3192 var dy = a[7];
3193 if (alreadyDrawnCubic(ax, ay, bx, by, cx, cy, dx, dy)) {
3194 return;
3195 }
3196 ctx.beginPath();
3197 ctx.moveTo((ax - srcLeft) * scale,
3198 (ay - srcTop) * scale);
3199 ctx.bezierCurveTo((bx - srcLeft) * scale,
3200 (by - srcTop) * scale,
3201 (cx - srcLeft) * scale,
3202 (cy - srcTop) * scale,
3203 (dx - srcLeft) * scale,
3204 (dy - srcTop) * scale);
3205 ctx.stroke();
3206}
3207
3208function drawCurve(c) {
3209 switch (c.length) {
3210 case 4:
3211 drawLine(c[0], c[1], c[2], c[3]);
3212 break;
3213 case 6:
3214 drawQuad(c[0], c[1], c[2], c[3], c[4], c[5]);
3215 break;
caryclark1049f122015-04-20 08:31:59 -07003216 case 7:
3217 drawConicWithQuads(c[0], c[1], c[2], c[3], c[4], c[5], c[6]);
3218 break;
caryclarkdac1d172014-06-17 05:15:38 -07003219 case 8:
3220 drawCubic(c[0], c[1], c[2], c[3], c[4], c[5], c[6], c[7]);
3221 break;
3222 }
3223}
3224
3225function boundsWidth(pts) {
3226 var min = pts[0];
3227 var max = pts[0];
caryclark1049f122015-04-20 08:31:59 -07003228 var length = pts.length == 7 ? 6 : pts.length;
3229 for (var idx = 2; idx < length; idx += 2) {
caryclarkdac1d172014-06-17 05:15:38 -07003230 min = Math.min(min, pts[idx]);
3231 max = Math.max(max, pts[idx]);
3232 }
3233 return max - min;
3234}
3235
3236function boundsHeight(pts) {
3237 var min = pts[1];
3238 var max = pts[1];
caryclark1049f122015-04-20 08:31:59 -07003239 var length = pts.length == 7 ? 6 : pts.length;
3240 for (var idx = 3; idx < length; idx += 2) {
caryclarkdac1d172014-06-17 05:15:38 -07003241 min = Math.min(min, pts[idx]);
3242 max = Math.max(max, pts[idx]);
3243 }
3244 return max - min;
3245}
3246
3247function tangent(pts) {
3248 var dx = pts[2] - pts[0];
3249 var dy = pts[3] - pts[1];
3250 if (dx == 0 && dy == 0 && pts.length > 4) {
3251 dx = pts[4] - pts[0];
3252 dy = pts[5] - pts[1];
caryclark1049f122015-04-20 08:31:59 -07003253 if (dx == 0 && dy == 0 && pts.length == 8) {
caryclarkdac1d172014-06-17 05:15:38 -07003254 dx = pts[6] - pts[0];
3255 dy = pts[7] - pts[1];
3256 }
3257 }
3258 return Math.atan2(-dy, dx);
3259}
3260
3261function hodograph(cubic) {
3262 var hodo = [];
3263 hodo[0] = 3 * (cubic[2] - cubic[0]);
3264 hodo[1] = 3 * (cubic[3] - cubic[1]);
3265 hodo[2] = 3 * (cubic[4] - cubic[2]);
3266 hodo[3] = 3 * (cubic[5] - cubic[3]);
3267 hodo[4] = 3 * (cubic[6] - cubic[4]);
3268 hodo[5] = 3 * (cubic[7] - cubic[5]);
3269 return hodo;
3270}
3271
3272function hodograph2(cubic) {
3273 var quad = hodograph(cubic);
3274 var hodo = [];
3275 hodo[0] = 2 * (quad[2] - quad[0]);
3276 hodo[1] = 2 * (quad[3] - quad[1]);
3277 hodo[2] = 2 * (quad[4] - quad[2]);
3278 hodo[3] = 2 * (quad[5] - quad[3]);
3279 return hodo;
3280}
3281
3282function quadraticRootsReal(A, B, C, s) {
3283 if (A == 0) {
3284 if (B == 0) {
3285 s[0] = 0;
3286 return C == 0;
3287 }
3288 s[0] = -C / B;
3289 return 1;
3290 }
3291 /* normal form: x^2 + px + q = 0 */
3292 var p = B / (2 * A);
3293 var q = C / A;
3294 var p2 = p * p;
3295 if (p2 < q) {
3296 return 0;
3297 }
3298 var sqrt_D = 0;
3299 if (p2 > q) {
3300 sqrt_D = sqrt(p2 - q);
3301 }
3302 s[0] = sqrt_D - p;
3303 s[1] = -sqrt_D - p;
3304 return 1 + s[0] != s[1];
3305}
3306
3307function add_valid_ts(s, realRoots, t) {
3308 var foundRoots = 0;
3309 for (var index = 0; index < realRoots; ++index) {
3310 var tValue = s[index];
3311 if (tValue >= 0 && tValue <= 1) {
3312 for (var idx2 = 0; idx2 < foundRoots; ++idx2) {
3313 if (t[idx2] != tValue) {
3314 t[foundRoots++] = tValue;
3315 }
3316 }
3317 }
3318 }
3319 return foundRoots;
3320}
3321
3322function quadraticRootsValidT(a, b, c, t) {
3323 var s = [];
3324 var realRoots = quadraticRootsReal(A, B, C, s);
3325 var foundRoots = add_valid_ts(s, realRoots, t);
3326 return foundRoots != 0;
3327}
3328
3329function find_cubic_inflections(cubic, tValues) {
3330 var Ax = src[2] - src[0];
3331 var Ay = src[3] - src[1];
3332 var Bx = src[4] - 2 * src[2] + src[0];
3333 var By = src[5] - 2 * src[3] + src[1];
3334 var Cx = src[6] + 3 * (src[2] - src[4]) - src[0];
3335 var Cy = src[7] + 3 * (src[3] - src[5]) - src[1];
3336 return quadraticRootsValidT(Bx * Cy - By * Cx, (Ax * Cy - Ay * Cx),
3337 Ax * By - Ay * Bx, tValues);
3338}
3339
3340function dxy_at_t(curve, type, t) {
3341 var dxy = {};
3342 if (type == PATH_QUAD) {
3343 var a = t - 1;
3344 var b = 1 - 2 * t;
3345 var c = t;
3346 dxy.x = a * curve[0] + b * curve[2] + c * curve[4];
3347 dxy.y = a * curve[1] + b * curve[3] + c * curve[5];
caryclark1049f122015-04-20 08:31:59 -07003348 } else if (type == PATH_CONIC) {
3349 var p20x = curve[4] - curve[0];
3350 var p20y = curve[5] - curve[1];
3351 var p10xw = (curve[2] - curve[0]) * curve[6];
3352 var p10yw = (curve[3] - curve[1]) * curve[6];
3353 var coeff0x = curve[6] * p20x - p20x;
3354 var coeff0y = curve[6] * p20y - p20y;
3355 var coeff1x = p20x - 2 * p10xw;
3356 var coeff1y = p20y - 2 * p10yw;
3357 dxy.x = t * (t * coeff0x + coeff1x) + p10xw;
3358 dxy.y = t * (t * coeff0y + coeff1y) + p10yw;
caryclarkdac1d172014-06-17 05:15:38 -07003359 } else if (type == PATH_CUBIC) {
3360 var one_t = 1 - t;
3361 var a = curve[0];
3362 var b = curve[2];
3363 var c = curve[4];
3364 var d = curve[6];
3365 dxy.x = 3 * ((b - a) * one_t * one_t + 2 * (c - b) * t * one_t + (d - c) * t * t);
3366 a = curve[1];
3367 b = curve[3];
3368 c = curve[5];
3369 d = curve[7];
3370 dxy.y = 3 * ((b - a) * one_t * one_t + 2 * (c - b) * t * one_t + (d - c) * t * t);
3371 }
3372 return dxy;
3373}
3374
3375function drawLabel(num, px, py) {
3376 ctx.beginPath();
3377 ctx.arc(px, py, 8, 0, Math.PI*2, true);
3378 ctx.closePath();
3379 ctx.strokeStyle = "rgba(0,0,0, 0.4)";
3380 ctx.lineWidth = num == 0 || num == 3 ? 2 : 1;
3381 ctx.stroke();
3382 ctx.fillStyle = "black";
3383 ctx.font = "normal 10px Arial";
3384 // ctx.rotate(0.001);
3385 ctx.fillText(num, px - 2, py + 3);
3386 // ctx.rotate(-0.001);
3387}
3388
3389function drawLabelX(ymin, num, loc) {
3390 var px = (loc - srcLeft) * scale;
3391 var py = (ymin - srcTop) * scale - 20;
3392 drawLabel(num, px, py);
3393}
3394
3395function drawLabelY(xmin, num, loc) {
3396 var px = (xmin - srcLeft) * scale - 20;
3397 var py = (loc - srcTop) * scale;
3398 drawLabel(num, px, py);
3399}
3400
3401function drawHodoOrigin(hx, hy, hMinX, hMinY, hMaxX, hMaxY) {
3402 ctx.beginPath();
3403 ctx.moveTo(hx, hy - 100);
3404 ctx.lineTo(hx, hy);
3405 ctx.strokeStyle = hMinY < 0 ? "green" : "blue";
3406 ctx.stroke();
3407 ctx.beginPath();
3408 ctx.moveTo(hx, hy);
3409 ctx.lineTo(hx, hy + 100);
3410 ctx.strokeStyle = hMaxY > 0 ? "green" : "blue";
3411 ctx.stroke();
3412 ctx.beginPath();
3413 ctx.moveTo(hx - 100, hy);
3414 ctx.lineTo(hx, hy);
3415 ctx.strokeStyle = hMinX < 0 ? "green" : "blue";
3416 ctx.stroke();
3417 ctx.beginPath();
3418 ctx.moveTo(hx, hy);
3419 ctx.lineTo(hx + 100, hy);
3420 ctx.strokeStyle = hMaxX > 0 ? "green" : "blue";
3421 ctx.stroke();
3422}
3423
3424function scalexy(x, y, mag) {
3425 var length = Math.sqrt(x * x + y * y);
3426 return mag / length;
3427}
3428
caryclark03b03ca2015-04-23 09:13:37 -07003429function drawArrow(x, y, dx, dy, s) {
3430 var dscale = scalexy(dx, dy, 1 / scale * 100 * s);
caryclarkdac1d172014-06-17 05:15:38 -07003431 dx *= dscale;
3432 dy *= dscale;
3433 ctx.beginPath();
3434 ctx.moveTo((x - srcLeft) * scale, (y - srcTop) * scale);
3435 x += dx;
3436 y += dy;
3437 ctx.lineTo((x - srcLeft) * scale, (y - srcTop) * scale);
3438 dx /= 10;
3439 dy /= 10;
3440 ctx.lineTo((x - dy - srcLeft) * scale, (y + dx - srcTop) * scale);
3441 ctx.lineTo((x + dx * 2 - srcLeft) * scale, (y + dy * 2 - srcTop) * scale);
3442 ctx.lineTo((x + dy - srcLeft) * scale, (y - dx - srcTop) * scale);
3443 ctx.lineTo((x - srcLeft) * scale, (y - srcTop) * scale);
3444 ctx.strokeStyle = "rgba(0,75,0, 0.4)";
3445 ctx.stroke();
3446}
3447
3448function x_at_t(curve, t) {
3449 var one_t = 1 - t;
3450 if (curve.length == 4) {
3451 return one_t * curve[0] + t * curve[2];
3452 }
3453 var one_t2 = one_t * one_t;
3454 var t2 = t * t;
3455 if (curve.length == 6) {
3456 return one_t2 * curve[0] + 2 * one_t * t * curve[2] + t2 * curve[4];
3457 }
caryclark1049f122015-04-20 08:31:59 -07003458 if (curve.length == 7) {
3459 return (one_t2 * curve[0] + 2 * one_t * t * curve[2] * curve[6] + t2 * curve[4])
3460 / (one_t2 +2 * one_t * t * curve[6] + t2);
3461 }
caryclarkdac1d172014-06-17 05:15:38 -07003462 var a = one_t2 * one_t;
3463 var b = 3 * one_t2 * t;
3464 var c = 3 * one_t * t2;
3465 var d = t2 * t;
3466 return a * curve[0] + b * curve[2] + c * curve[4] + d * curve[6];
3467}
3468
3469function y_at_t(curve, t) {
3470 var one_t = 1 - t;
3471 if (curve.length == 4) {
3472 return one_t * curve[1] + t * curve[3];
3473 }
3474 var one_t2 = one_t * one_t;
3475 var t2 = t * t;
3476 if (curve.length == 6) {
3477 return one_t2 * curve[1] + 2 * one_t * t * curve[3] + t2 * curve[5];
3478 }
caryclark1049f122015-04-20 08:31:59 -07003479 if (curve.length == 7) {
3480 return (one_t2 * curve[1] + 2 * one_t * t * curve[3] * curve[6] + t2 * curve[5])
3481 / (one_t2 +2 * one_t * t * curve[6] + t2);
3482 }
caryclarkdac1d172014-06-17 05:15:38 -07003483 var a = one_t2 * one_t;
3484 var b = 3 * one_t2 * t;
3485 var c = 3 * one_t * t2;
3486 var d = t2 * t;
3487 return a * curve[1] + b * curve[3] + c * curve[5] + d * curve[7];
3488}
3489
3490function drawOrder(curve, label) {
3491 var px = x_at_t(curve, 0.75);
3492 var py = y_at_t(curve, 0.75);
3493 var _px = (px - srcLeft) * scale;
3494 var _py = (py - srcTop) * scale;
3495 ctx.beginPath();
3496 ctx.arc(_px, _py, 15, 0, Math.PI * 2, true);
3497 ctx.closePath();
3498 ctx.fillStyle = "white";
3499 ctx.fill();
3500 if (label == 'L') {
3501 ctx.strokeStyle = "rgba(255,0,0, 1)";
3502 ctx.fillStyle = "rgba(255,0,0, 1)";
3503 } else {
3504 ctx.strokeStyle = "rgba(0,0,255, 1)";
3505 ctx.fillStyle = "rgba(0,0,255, 1)";
3506 }
3507 ctx.stroke();
3508 ctx.font = "normal 16px Arial";
3509 ctx.textAlign = "center";
3510 ctx.fillText(label, _px, _py + 5);
3511 ctx.font = "normal 10px Arial";
3512}
3513
3514function drawID(curve, id) {
3515 var px = x_at_t(curve, 0.5);
3516 var py = y_at_t(curve, 0.5);
3517 var _px = (px - srcLeft) * scale;
3518 var _py = (py - srcTop) * scale;
3519 draw_id_at(id, _px, _py);
3520}
3521
3522function draw_id_at(id, _px, _py) {
3523 ctx.beginPath();
3524 ctx.arc(_px, _py, 15, 0, Math.PI * 2, true);
3525 ctx.closePath();
3526 ctx.fillStyle = "white";
3527 ctx.fill();
3528 ctx.strokeStyle = "rgba(127,127,0, 1)";
3529 ctx.fillStyle = "rgba(127,127,0, 1)";
3530 ctx.stroke();
3531 ctx.font = "normal 16px Arial";
3532 ctx.textAlign = "center";
3533 ctx.fillText(id, _px, _py + 5);
3534 ctx.font = "normal 10px Arial";
3535}
3536
3537function drawLinePartialID(id, x1, y1, x2, y2, t1, t2) {
3538 var curve = [x1, y1, x2, y2];
3539 drawCurvePartialID(id, curve, t1, t2);
3540}
3541
caryclark55888e42016-07-18 10:01:36 -07003542function drawLineID(id, x1, y1, x2, y2) {
3543 drawLinePartialID(id, x1, y1, x2, y2, 0, 1);
3544}
3545
caryclarkdac1d172014-06-17 05:15:38 -07003546function drawQuadPartialID(id, x1, y1, x2, y2, x3, y3, t1, t2) {
3547 var curve = [x1, y1, x2, y2, x3, y3];
3548 drawCurvePartialID(id, curve, t1, t2);
3549}
3550
caryclark55888e42016-07-18 10:01:36 -07003551function drawQuadID(id, x1, y1, x2, y2, x3, y3) {
3552 drawQuadPartialID(id, x1, y1, x2, y2, x3, y3, 0, 1);
3553}
3554
caryclark1049f122015-04-20 08:31:59 -07003555function drawConicPartialID(id, x1, y1, x2, y2, x3, y3, w, t1, t2) {
3556 var curve = [x1, y1, x2, y2, x3, y3, w];
3557 drawCurvePartialID(id, curve, t1, t2);
3558}
3559
caryclark55888e42016-07-18 10:01:36 -07003560function drawConicID(id, x1, y1, x2, y2, x3, y3, w) {
3561 drawConicPartialID(id, x1, y1, x2, y2, x3, y3, w, 0, 1);
3562}
3563
caryclarkdac1d172014-06-17 05:15:38 -07003564function drawCubicPartialID(id, x1, y1, x2, y2, x3, y3, x4, y4, t1, t2) {
3565 var curve = [x1, y1, x2, y2, x3, y3, x4, y4];
3566 drawCurvePartialID(id, curve, t1, t2);
3567}
3568
caryclark55888e42016-07-18 10:01:36 -07003569function drawCubicID(id, x1, y1, x2, y2, x3, y3, x4, y4) {
3570 drawCubicPartialID(id, x1, y1, x2, y2, x3, y3, x4, y4, 0, 1);
3571}
3572
caryclarkdac1d172014-06-17 05:15:38 -07003573function drawCurvePartialID(id, curve, t1, t2) {
3574 var px = x_at_t(curve, (t1 + t2) / 2);
3575 var py = y_at_t(curve, (t1 + t2) / 2);
3576 var _px = (px - srcLeft) * scale;
3577 var _py = (py - srcTop) * scale;
3578 draw_id_at(id, _px, _py);
3579}
3580
3581function drawCurveSpecials(test, curve, type) {
3582 if (pt_labels) {
3583 drawPoints(curve, type, pt_labels == 2);
3584 }
3585 if (control_lines != 0) {
3586 drawControlLines(curve, type, control_lines);
3587 }
3588 if (curve_t) {
3589 drawPointAtT(curve, type);
3590 }
3591 if (draw_midpoint) {
3592 var mid = pointAtT(curve, type, 0.5);
3593 drawPoint(mid.x, mid.y, true);
3594 }
3595 if (draw_id) {
3596 var id = idByCurve(test, curve, type);
3597 if (id >= 0) {
3598 drawID(curve, id);
3599 }
3600 }
3601 if (type == PATH_LINE) {
3602 return;
3603 }
3604 if (draw_deriviatives > 0) {
3605 var d = dxy_at_t(curve, type, 0);
caryclark03b03ca2015-04-23 09:13:37 -07003606 drawArrow(curve[0], curve[1], d.x, d.y, 1);
caryclarkdac1d172014-06-17 05:15:38 -07003607 if (draw_deriviatives == 2) {
3608 d = dxy_at_t(curve, type, 1);
3609 if (type == PATH_CUBIC) {
caryclark03b03ca2015-04-23 09:13:37 -07003610 drawArrow(curve[6], curve[7], d.x, d.y, 1);
caryclarkdac1d172014-06-17 05:15:38 -07003611 } else {
caryclark03b03ca2015-04-23 09:13:37 -07003612 drawArrow(curve[4], curve[5], d.x, d.y, 1);
caryclarkdac1d172014-06-17 05:15:38 -07003613 }
3614 }
3615 if (draw_midpoint) {
3616 var mid = pointAtT(curve, type, 0.5);
3617 d = dxy_at_t(curve, type, 0.5);
caryclark03b03ca2015-04-23 09:13:37 -07003618 drawArrow(mid.x, mid.y, d.x, d.y, 1);
caryclarkdac1d172014-06-17 05:15:38 -07003619 }
3620 }
3621 if (type != PATH_CUBIC) {
3622 return;
3623 }
caryclarkdac1d172014-06-17 05:15:38 -07003624 if (draw_sequence) {
3625 var ymin = Math.min(curve[1], curve[3], curve[5], curve[7]);
3626 for (var i = 0; i < 8; i+= 2) {
3627 drawLabelX(ymin, i >> 1, curve[i]);
3628 }
3629 var xmin = Math.min(curve[0], curve[2], curve[4], curve[6]);
3630 for (var i = 1; i < 8; i+= 2) {
3631 drawLabelY(xmin, i >> 1, curve[i]);
3632 }
3633 }
3634}
3635
3636function logCurves(test) {
3637 for (curves in test) {
3638 var curve = test[curves];
3639 dumpCurve(curve);
3640 }
3641}
3642
3643function curveToString(curve) {
3644 var str = "{{";
caryclark1049f122015-04-20 08:31:59 -07003645 var length = curve.length == 7 ? 6 : curve.length;
3646 if (curve.length == 7) {
3647 str += "{";
3648 }
3649 for (i = 0; i < length; i += 2) {
caryclarkdac1d172014-06-17 05:15:38 -07003650 str += curve[i].toFixed(decimal_places) + "," + curve[i + 1].toFixed(decimal_places);
3651 if (i < curve.length - 2) {
3652 str += "}, {";
3653 }
3654 }
caryclark1049f122015-04-20 08:31:59 -07003655 str += "}";
3656 if (curve.length == 7) {
3657 str += "}, " + curve[6].toFixed(decimal_places);
3658 }
3659 str += "}";
caryclarkdac1d172014-06-17 05:15:38 -07003660 return str;
3661}
3662
3663function dumpCurve(curve) {
3664 console.log(curveToString(curve));
3665}
3666
3667function draw(test, lines, title) {
3668 ctx.fillStyle = "rgba(0,0,0, 0.1)";
3669 ctx.font = "normal 50px Arial";
3670 ctx.textAlign = "left";
3671 ctx.fillText(title, 50, 50);
3672 ctx.font = "normal 10px Arial";
3673 ctx.lineWidth = "1.001"; "0.999";
3674 var secondPath = test.length;
3675 var closeCount = 0;
3676 logStart = -1;
3677 logRange = 0;
3678 // find last active rec type at this step
3679 var curType = test[0];
3680 var curStep = 0;
3681 var hasOp = false;
3682 var lastActive = 0;
3683 var lastAdd = 0;
caryclark624637c2015-05-11 07:21:27 -07003684 var lastCoin = 0;
caryclarkdac1d172014-06-17 05:15:38 -07003685 var lastSect = 0;
3686 var lastSort = 0;
3687 var lastMark = 0;
caryclark03b03ca2015-04-23 09:13:37 -07003688 var lastTop = 0;
caryclarkdac1d172014-06-17 05:15:38 -07003689 activeCount = 0;
3690 addCount = 0;
3691 angleCount = 0;
3692 opCount = 0;
3693 sectCount = 0;
3694 sortCount = 0;
caryclark03b03ca2015-04-23 09:13:37 -07003695 topCount = 0;
caryclarkdac1d172014-06-17 05:15:38 -07003696 markCount = 0;
3697 activeMax = 0;
3698 addMax = 0;
3699 angleMax = 0;
caryclark624637c2015-05-11 07:21:27 -07003700 coinMax = 0;
caryclarkdac1d172014-06-17 05:15:38 -07003701 opMax = 0;
3702 sectMax = 0;
3703 sectMax2 = 0;
3704 sortMax = 0;
caryclark03b03ca2015-04-23 09:13:37 -07003705 topMax = 0;
caryclarkdac1d172014-06-17 05:15:38 -07003706 markMax = 0;
3707 lastIndex = test.length - 3;
3708 for (var tIndex = 0; tIndex < test.length; tIndex += 3) {
3709 var recType = test[tIndex];
3710 if (!typeof recType == 'number' || recType < REC_TYPE_UNKNOWN || recType > REC_TYPE_LAST) {
3711 console.log("unknown rec type: " + recType);
3712 throw "stop execution";
3713 }
3714 // if (curType == recType && curType != REC_TYPE_ADD) {
3715 // continue;
3716 // }
3717 var inStepRange = step_limit == 0 || curStep < step_limit;
3718 curType = recType;
3719 if (recType == REC_TYPE_OP) {
3720 hasOp = true;
3721 continue;
3722 }
3723 if (recType == REC_TYPE_UNKNOWN) {
3724 // these types do not advance step
3725 continue;
3726 }
3727 var bumpStep = false;
3728 var records = test[tIndex + 2];
3729 var fragType = records[0];
3730 if (recType == REC_TYPE_ADD) {
3731 if (records.length != 2) {
3732 console.log("expect only two elements: " + records.length);
3733 throw "stop execution";
3734 }
3735 if (fragType == ADD_MOVETO || fragType == ADD_CLOSE) {
3736 continue;
3737 }
3738 ++addMax;
3739 if (!draw_add || !inStepRange) {
3740 continue;
3741 }
3742 lastAdd = tIndex;
3743 ++addCount;
3744 bumpStep = true;
3745 }
3746 if (recType == REC_TYPE_PATH && hasOp) {
3747 secondPath = tIndex;
3748 }
caryclark54359292015-03-26 07:52:43 -07003749 if (recType == REC_TYPE_PATH2 && hasOp) {
3750 secondPath = tIndex;
3751 }
caryclarkdac1d172014-06-17 05:15:38 -07003752 if (recType == REC_TYPE_ACTIVE) {
3753 ++activeMax;
3754 if (!draw_active || !inStepRange) {
3755 continue;
3756 }
3757 lastActive = tIndex;
3758 ++activeCount;
3759 bumpStep = true;
3760 }
3761 if (recType == REC_TYPE_ACTIVE_OP) {
3762 ++opMax;
3763 if (!draw_op || !inStepRange) {
3764 continue;
3765 }
3766 lastOp = tIndex;
3767 ++opCount;
3768 bumpStep = true;
3769 }
caryclark54359292015-03-26 07:52:43 -07003770 if (recType == REC_TYPE_AFTERPART) {
3771 if (draw_angle != 3 || !inStepRange) {
3772 continue;
3773 }
3774 lastAngle = tIndex;
3775 ++angleCount;
3776 bumpStep = true;
3777 }
caryclarkdac1d172014-06-17 05:15:38 -07003778 if (recType == REC_TYPE_ANGLE) {
3779 ++angleMax;
caryclark54359292015-03-26 07:52:43 -07003780 if (draw_angle == 0 || draw_angle == 3 || !inStepRange) {
caryclarkdac1d172014-06-17 05:15:38 -07003781 continue;
3782 }
3783 lastAngle = tIndex;
3784 ++angleCount;
3785 bumpStep = true;
3786 }
caryclark624637c2015-05-11 07:21:27 -07003787 if (recType == REC_TYPE_COINCIDENCE) {
3788 ++coinMax;
3789 if (!draw_coincidence || !inStepRange) {
3790 continue;
3791 }
3792 lastCoin = tIndex;
3793 ++coinCount;
3794 bumpStep = true;
3795 }
caryclarkdac1d172014-06-17 05:15:38 -07003796 if (recType == REC_TYPE_SECT) {
3797 if (records.length != 2) {
3798 console.log("expect only two elements: " + records.length);
3799 throw "stop execution";
3800 }
3801 ++sectMax;
3802 var sectBump = 1;
3803 switch (fragType) {
3804 case INTERSECT_LINE:
3805 case INTERSECT_QUAD_LINE:
3806 case INTERSECT_QUAD:
caryclark1049f122015-04-20 08:31:59 -07003807 case INTERSECT_CONIC_LINE:
caryclark55888e42016-07-18 10:01:36 -07003808 case INTERSECT_CONIC_QUAD:
caryclark1049f122015-04-20 08:31:59 -07003809 case INTERSECT_CONIC:
caryclarkdac1d172014-06-17 05:15:38 -07003810 case INTERSECT_SELF_CUBIC:
3811 case INTERSECT_CUBIC_LINE:
3812 case INTERSECT_CUBIC_QUAD:
3813 case INTERSECT_CUBIC:
3814 sectBump = 1;
3815 break;
3816 case INTERSECT_LINE_2:
3817 case INTERSECT_QUAD_LINE_2:
3818 case INTERSECT_QUAD_2:
caryclark1049f122015-04-20 08:31:59 -07003819 case INTERSECT_CONIC_LINE_2:
caryclark55888e42016-07-18 10:01:36 -07003820 case INTERSECT_CONIC_QUAD_2:
caryclark1049f122015-04-20 08:31:59 -07003821 case INTERSECT_CONIC_2:
caryclarkdac1d172014-06-17 05:15:38 -07003822 case INTERSECT_CUBIC_LINE_2:
3823 case INTERSECT_CUBIC_QUAD_2:
3824 case INTERSECT_CUBIC_2:
3825 sectBump = 2;
3826 break;
3827 case INTERSECT_LINE_NO:
3828 case INTERSECT_QUAD_LINE_NO:
3829 case INTERSECT_QUAD_NO:
caryclark1049f122015-04-20 08:31:59 -07003830 case INTERSECT_CONIC_LINE_NO:
caryclark55888e42016-07-18 10:01:36 -07003831 case INTERSECT_CONIC_QUAD_NO:
caryclark1049f122015-04-20 08:31:59 -07003832 case INTERSECT_CONIC_NO:
caryclarkdac1d172014-06-17 05:15:38 -07003833 case INTERSECT_SELF_CUBIC_NO:
3834 case INTERSECT_CUBIC_LINE_NO:
3835 case INTERSECT_CUBIC_QUAD_NO:
3836 case INTERSECT_CUBIC_NO:
3837 sectBump = 0;
3838 break;
caryclark6c3b9cd2016-09-26 05:36:58 -07003839 case INTERSECT_CONIC_QUAD_3:
caryclarkdac1d172014-06-17 05:15:38 -07003840 case INTERSECT_CUBIC_LINE_3:
3841 case INTERSECT_CUBIC_QUAD_3:
3842 case INTERSECT_CUBIC_3:
3843 sectBump = 3;
3844 break;
caryclark6c3b9cd2016-09-26 05:36:58 -07003845 case INTERSECT_CONIC_QUAD_4:
caryclarkdac1d172014-06-17 05:15:38 -07003846 case INTERSECT_CUBIC_QUAD_4:
3847 case INTERSECT_CUBIC_4:
3848 sectBump = 4;
3849 break;
3850 default:
3851 console.log("missing case " + records.length);
3852 throw "stop execution";
3853 }
3854 sectMax2 += sectBump;
3855 if (draw_intersection <= 1 || !inStepRange) {
3856 continue;
3857 }
3858 lastSect = tIndex;
3859 sectCount += sectBump;
3860 bumpStep = true;
3861 }
3862 if (recType == REC_TYPE_SORT) {
3863 ++sortMax;
3864 if (!draw_sort || !inStepRange) {
3865 continue;
3866 }
3867 lastSort = tIndex;
3868 ++sortCount;
3869 bumpStep = true;
3870 }
caryclark03b03ca2015-04-23 09:13:37 -07003871 if (recType == REC_TYPE_TOP) {
3872 ++topMax;
3873 if (!draw_top || !inStepRange) {
3874 continue;
3875 }
3876 lastTop = tIndex;
3877 ++topCount;
3878 bumpStep = true;
3879 }
caryclarkdac1d172014-06-17 05:15:38 -07003880 if (recType == REC_TYPE_MARK) {
3881 ++markMax;
3882 if (!draw_mark || !inStepRange) {
3883 continue;
3884 }
3885 lastMark = tIndex;
3886 ++markCount;
3887 bumpStep = true;
3888 }
3889 if (bumpStep) {
3890 lastIndex = tIndex;
3891 logStart = test[tIndex + 1];
3892 logRange = records.length / 2;
3893 ++curStep;
3894 }
3895 }
3896 stepMax = (draw_add ? addMax : 0)
3897 + (draw_active ? activeMax : 0)
reed0dc4dd62015-03-24 13:55:33 -07003898 + (draw_angle ? angleMax : 0)
caryclark624637c2015-05-11 07:21:27 -07003899 + (draw_coincidence ? coinMax : 0)
caryclark54359292015-03-26 07:52:43 -07003900 + (draw_op ? opMax : 0)
caryclarkdac1d172014-06-17 05:15:38 -07003901 + (draw_sort ? sortMax : 0)
caryclark03b03ca2015-04-23 09:13:37 -07003902 + (draw_top ? topMax : 0)
caryclarkdac1d172014-06-17 05:15:38 -07003903 + (draw_mark ? markMax : 0)
3904 + (draw_intersection == 2 ? sectMax : draw_intersection == 3 ? sectMax2 : 0);
3905 if (stepMax == 0) {
caryclark624637c2015-05-11 07:21:27 -07003906 stepMax = addMax + activeMax + angleMax + coinMax + opMax + sortMax + topMax + markMax;
caryclarkdac1d172014-06-17 05:15:38 -07003907 }
3908 drawnPts = [];
3909 drawnLines = [];
3910 drawnQuads = [];
caryclark1049f122015-04-20 08:31:59 -07003911 drawnConics = [];
caryclarkdac1d172014-06-17 05:15:38 -07003912 drawnCubics = [];
3913 focusXmin = focusYmin = Infinity;
3914 focusXmax = focusYmax = -Infinity;
3915 var pathIndex = 0;
3916 var opLetter = 'S';
3917 for (var tIndex = lastIndex; tIndex >= 0; tIndex -= 3) {
3918 var recType = test[tIndex];
3919 var records = test[tIndex + 2];
3920 for (var recordIndex = 0; recordIndex < records.length; recordIndex += 2) {
3921 var fragType = records[recordIndex];
3922 if (!typeof fragType == 'number' || fragType < 1 || fragType > FRAG_TYPE_LAST) {
3923 console.log("unknown in range frag type: " + fragType);
3924 throw "stop execution";
3925 }
3926 var frags = records[recordIndex + 1];
3927 focus_enabled = false;
3928 switch (recType) {
3929 case REC_TYPE_COMPUTED:
3930 if (draw_computed == 0) {
3931 continue;
3932 }
3933 ctx.lineWidth = 1;
3934 ctx.strokeStyle = pathIndex == 0 ? "black" : "red";
3935 ctx.fillStyle = "blue";
3936 var drawThis = false;
3937 switch (fragType) {
3938 case PATH_QUAD:
caryclark1049f122015-04-20 08:31:59 -07003939 if ((draw_computed & 0x9) == 1 || ((draw_computed & 8) != 0
3940 && (draw_computed & 7) == pathIndex)) {
caryclarkdac1d172014-06-17 05:15:38 -07003941 drawQuad(frags[0], frags[1], frags[2], frags[3],
3942 frags[4], frags[5]);
3943 drawThis = true;
3944 }
3945 break;
caryclark1049f122015-04-20 08:31:59 -07003946 case PATH_CONIC:
3947 if ((draw_computed & 0xA) == 2 || ((draw_computed & 8) != 0
3948 && (draw_computed & 7) == pathIndex)) {
3949 drawConicWithQuads(frags[0], frags[1], frags[2], frags[3],
3950 frags[4], frags[5], frags[6]);
3951 drawThis = true;
3952 }
3953 break;
caryclarkdac1d172014-06-17 05:15:38 -07003954 case PATH_CUBIC:
caryclark1049f122015-04-20 08:31:59 -07003955 if ((draw_computed & 0xC) == 4 || ((draw_computed & 8) != 0
3956 && (draw_computed & 7) == pathIndex)) {
caryclarkdac1d172014-06-17 05:15:38 -07003957 drawCubic(frags[0], frags[1], frags[2], frags[3],
3958 frags[4], frags[5], frags[6], frags[7]);
3959 drawThis = true;
3960 }
3961 ++pathIndex;
3962 break;
3963 case COMPUTED_SET_1:
3964 pathIndex = 0;
3965 break;
3966 case COMPUTED_SET_2:
3967 pathIndex = 1;
3968 break;
3969 default:
3970 console.log("unknown REC_TYPE_COMPUTED frag type: " + fragType);
3971 throw "stop execution";
3972 }
3973 if (!drawThis || collect_bounds) {
3974 break;
3975 }
3976 drawCurveSpecials(test, frags, fragType);
3977 break;
caryclark26ad22a2015-10-16 09:03:38 -07003978 case REC_TYPE_ALIGNED:
3979 if (draw_path < 4) {
3980 continue;
3981 }
caryclarkdac1d172014-06-17 05:15:38 -07003982 case REC_TYPE_PATH:
caryclark54359292015-03-26 07:52:43 -07003983 case REC_TYPE_PATH2:
caryclark26ad22a2015-10-16 09:03:38 -07003984 if (REC_TYPE_ALIGNED != recType && draw_path >= 4) {
3985 continue;
3986 }
caryclarkdac1d172014-06-17 05:15:38 -07003987 if (!draw_path) {
3988 continue;
3989 }
3990 var firstPath = tIndex < secondPath;
3991 if ((draw_path & (firstPath ? 1 : 2)) == 0) {
3992 continue;
3993 }
3994 ctx.lineWidth = 1;
3995 ctx.strokeStyle = firstPath ? "black" : "red";
3996 ctx.fillStyle = "blue";
caryclark55888e42016-07-18 10:01:36 -07003997 var frags2 = [];
caryclarkdac1d172014-06-17 05:15:38 -07003998 switch (fragType) {
3999 case PATH_LINE:
caryclark54359292015-03-26 07:52:43 -07004000 for (var i = 0; i < 4; ++ i) { frags2[i] = frags[i + 1]; }
4001 drawLine(frags2[0], frags2[1], frags2[2], frags2[3]);
caryclarkdac1d172014-06-17 05:15:38 -07004002 break;
4003 case PATH_QUAD:
caryclark54359292015-03-26 07:52:43 -07004004 for (var i = 0; i < 6; ++ i) { frags2[i] = frags[i + 1]; }
4005 drawQuad(frags2[0], frags2[1], frags2[2], frags2[3],
4006 frags2[4], frags2[5]);
caryclarkdac1d172014-06-17 05:15:38 -07004007 break;
caryclark1049f122015-04-20 08:31:59 -07004008 case PATH_CONIC:
4009 for (var i = 0; i < 7; ++ i) { frags2[i] = frags[i + 1]; }
4010 drawConicWithQuads(frags2[0], frags2[1], frags2[2], frags2[3],
4011 frags2[4], frags2[5], frags2[6]);
4012 break;
caryclarkdac1d172014-06-17 05:15:38 -07004013 case PATH_CUBIC:
caryclark54359292015-03-26 07:52:43 -07004014 for (var i = 0; i < 8; ++ i) { frags2[i] = frags[i + 1]; }
4015 drawCubic(frags2[0], frags2[1], frags2[2], frags2[3],
4016 frags2[4], frags2[5], frags2[6], frags2[7]);
caryclarkdac1d172014-06-17 05:15:38 -07004017 break;
4018 default:
caryclark26ad22a2015-10-16 09:03:38 -07004019 console.log("unknown " + recType + " frag type: " + fragType);
caryclarkdac1d172014-06-17 05:15:38 -07004020 throw "stop execution";
4021 }
4022 if (collect_bounds) {
4023 break;
4024 }
caryclark54359292015-03-26 07:52:43 -07004025 drawCurveSpecials(test, frags2, fragType);
caryclarkdac1d172014-06-17 05:15:38 -07004026 break;
4027 case REC_TYPE_OP:
4028 switch (fragType) {
4029 case OP_INTERSECT: opLetter = 'I'; break;
4030 case OP_DIFFERENCE: opLetter = 'D'; break;
4031 case OP_UNION: opLetter = 'U'; break;
4032 case OP_XOR: opLetter = 'X'; break;
4033 default:
4034 console.log("unknown REC_TYPE_OP frag type: " + fragType);
4035 throw "stop execution";
4036 }
4037 break;
4038 case REC_TYPE_ACTIVE:
4039 if (!draw_active || (step_limit > 0 && tIndex < lastActive)) {
4040 continue;
4041 }
4042 var x1 = frags[SPAN_X1];
4043 var y1 = frags[SPAN_Y1];
4044 var x2 = frags[SPAN_X2];
4045 var y2 = frags[SPAN_Y2];
caryclark55888e42016-07-18 10:01:36 -07004046 var x3, y3, x3, y4, w;
caryclarkdac1d172014-06-17 05:15:38 -07004047 ctx.lineWidth = 3;
4048 ctx.strokeStyle = "rgba(0,0,255, 0.3)";
4049 focus_enabled = true;
4050 switch (fragType) {
4051 case ACTIVE_LINE_SPAN:
caryclark55888e42016-07-18 10:01:36 -07004052 drawLine(x1, y1, x2, y2);
caryclarkdac1d172014-06-17 05:15:38 -07004053 if (draw_id) {
caryclark55888e42016-07-18 10:01:36 -07004054 drawLineID(frags[0], x1, y1, x2, y2);
4055 }
4056 if (pt_labels) {
4057 var curve = [x1, y1, x2, y2];
4058 ctx.fillStyle = "blue";
4059 drawPoints(curve, PATH_LINE, pt_labels == 2);
caryclarkdac1d172014-06-17 05:15:38 -07004060 }
4061 break;
4062 case ACTIVE_QUAD_SPAN:
4063 x3 = frags[SPAN_X3];
4064 y3 = frags[SPAN_Y3];
caryclark55888e42016-07-18 10:01:36 -07004065 drawQuad(x1, y1, x2, y2, x3, y3);
caryclarkdac1d172014-06-17 05:15:38 -07004066 if (draw_id) {
caryclark55888e42016-07-18 10:01:36 -07004067 drawQuadID(frags[0], x1, y1, x2, y2, x3, y3);
4068 }
4069 if (pt_labels) {
4070 var curve = [x1, y1, x2, y2, x3, y3];
4071 ctx.fillStyle = "blue";
4072 drawPoints(curve, PATH_QUAD, pt_labels == 2);
caryclarkdac1d172014-06-17 05:15:38 -07004073 }
4074 break;
caryclark1049f122015-04-20 08:31:59 -07004075 case ACTIVE_CONIC_SPAN:
4076 x3 = frags[SPAN_X3];
4077 y3 = frags[SPAN_Y3];
caryclark1049f122015-04-20 08:31:59 -07004078 w = frags[SPAN_K_W];
caryclark55888e42016-07-18 10:01:36 -07004079 drawConicWithQuads(x1, y1, x2, y2, x3, y3, w);
caryclark1049f122015-04-20 08:31:59 -07004080 if (draw_id) {
caryclark55888e42016-07-18 10:01:36 -07004081 drawConicID(frags[0], x1, y1, x2, y2, x3, y3, w);
4082 }
4083 if (pt_labels) {
4084 var curve = [x1, y1, x2, y2, x3, y3, w];
4085 ctx.fillStyle = "blue";
4086 drawPoints(curve, PATH_CONIC, pt_labels == 2);
caryclark1049f122015-04-20 08:31:59 -07004087 }
4088 break;
caryclarkdac1d172014-06-17 05:15:38 -07004089 case ACTIVE_CUBIC_SPAN:
4090 x3 = frags[SPAN_X3];
4091 y3 = frags[SPAN_Y3];
4092 x4 = frags[SPAN_X4];
4093 y4 = frags[SPAN_Y4];
caryclark55888e42016-07-18 10:01:36 -07004094 drawCubic(x1, y1, x2, y2, x3, y3, x4, y4);
caryclarkdac1d172014-06-17 05:15:38 -07004095 if (draw_id) {
caryclark55888e42016-07-18 10:01:36 -07004096 drawCubicID(frags[0], x1, y1, x2, y2, x3, y3, x4, y4);
4097 }
4098 if (pt_labels) {
4099 var curve = [x1, y1, x2, y2, x3, y3, x4, y4];
4100 ctx.fillStyle = "blue";
4101 drawPoints(curve, PATH_CUBIC, pt_labels == 2);
caryclarkdac1d172014-06-17 05:15:38 -07004102 }
4103 break;
4104 default:
4105 console.log("unknown REC_TYPE_ACTIVE frag type: " + fragType);
4106 throw "stop execution";
4107 }
4108 break;
4109 case REC_TYPE_ACTIVE_OP:
4110 if (!draw_op || (step_limit > 0 && tIndex < lastOp)) {
4111 continue;
4112 }
4113 focus_enabled = true;
4114 ctx.lineWidth = 3;
4115 var activeSpan = frags[7] == "1";
4116 ctx.strokeStyle = activeSpan ? "rgba(45,160,0, 0.3)" : "rgba(255,45,0, 0.5)";
4117 var curve = curvePartialByID(test, frags[0], frags[1], frags[2]);
4118 drawCurve(curve);
4119 if (draw_op > 1) {
4120 drawArc(curve, false, frags[3], frags[4]);
4121 drawArc(curve, true, frags[5], frags[6]);
4122 }
4123 break;
4124 case REC_TYPE_ADD:
4125 if (!draw_add) {
4126 continue;
4127 }
4128 ctx.lineWidth = 3;
4129 ctx.strokeStyle = closeCount == 0 ? "rgba(0,0,255, 0.3)"
4130 : closeCount == 1 ? "rgba(0,127,0, 0.3)"
4131 : closeCount == 2 ? "rgba(0,127,127, 0.3)"
4132 : closeCount == 3 ? "rgba(127,127,0, 0.3)"
4133 : "rgba(127,0,127, 0.3)";
4134 focus_enabled = true;
4135 switch (fragType) {
4136 case ADD_MOVETO:
4137 break;
4138 case ADD_LINETO:
4139 if (step_limit == 0 || tIndex >= lastAdd) {
4140 drawLine(frags[0], frags[1], frags[2], frags[3]);
4141 }
4142 break;
4143 case ADD_QUADTO:
4144 if (step_limit == 0 || tIndex >= lastAdd) {
4145 drawQuad(frags[0], frags[1], frags[2], frags[3], frags[4], frags[5]);
4146 }
4147 break;
caryclark1049f122015-04-20 08:31:59 -07004148 case ADD_CONICTO:
4149 if (step_limit == 0 || tIndex >= lastAdd) {
4150 drawConicWithQuads(frags[0], frags[1], frags[2], frags[3],
4151 frags[4], frags[5], frags[6]);
4152 }
4153 break;
caryclarkdac1d172014-06-17 05:15:38 -07004154 case ADD_CUBICTO:
4155 if (step_limit == 0 || tIndex >= lastAdd) {
4156 drawCubic(frags[0], frags[1], frags[2], frags[3],
4157 frags[4], frags[5], frags[6], frags[7]);
4158 }
4159 break;
4160 case ADD_CLOSE:
4161 ++closeCount;
4162 break;
4163 case ADD_FILL:
4164 break;
4165 default:
4166 console.log("unknown REC_TYPE_ADD frag type: " + fragType);
4167 throw "stop execution";
4168 }
4169 break;
4170 case REC_TYPE_ANGLE:
caryclark54359292015-03-26 07:52:43 -07004171 angleBetween = frags[18] == "T";
4172 afterIndex = 0;
4173 if (draw_angle == 0 || draw_angle == 3 || (step_limit > 0 && tIndex < lastAngle)) {
caryclarkdac1d172014-06-17 05:15:38 -07004174 continue;
4175 }
4176 focus_enabled = true;
4177 ctx.lineWidth = 3;
4178 ctx.strokeStyle = "rgba(127,45,127, 0.3)";
caryclark54359292015-03-26 07:52:43 -07004179 var leftCurve = curvePartialByID(test, frags[0], frags[4], frags[5]);
4180 var midCurve = curvePartialByID(test, frags[6], frags[10], frags[11]);
4181 var rightCurve = curvePartialByID(test, frags[12], frags[16], frags[17]);
caryclarkdac1d172014-06-17 05:15:38 -07004182 drawCurve(leftCurve);
4183 drawCurve(rightCurve);
caryclark54359292015-03-26 07:52:43 -07004184 ctx.strokeStyle = angleBetween ? "rgba(0,160,45, 0.3)" : "rgba(255,0,45, 0.5)";
caryclarkdac1d172014-06-17 05:15:38 -07004185 drawCurve(midCurve);
4186 if (draw_angle > 1) {
4187 drawOrder(leftCurve, 'L');
4188 drawOrder(rightCurve, 'R');
4189 }
4190 break;
caryclark54359292015-03-26 07:52:43 -07004191 case REC_TYPE_AFTERPART:
4192 if (draw_angle != 3 || (step_limit > 0 && tIndex < lastAngle)) {
4193 continue;
4194 }
4195 ctx.strokeStyle = afterIndex == 0 ? "rgba(255,0,0, 1.0)"
4196 : (afterIndex == 1) == angleBetween ? "rgba(0,128,0, 1.0)"
4197 : "rgba(0,0,255, 1.0)";
4198 switch (fragType) {
4199 case PATH_LINE:
4200 drawLine(frags[0], frags[1], frags[2], frags[3]);
4201 break;
4202 case PATH_QUAD:
4203 drawQuad(frags[0], frags[1], frags[2], frags[3],
4204 frags[4], frags[5]);
4205 break;
caryclark1049f122015-04-20 08:31:59 -07004206 case PATH_CONIC:
4207 drawConicWithQuads(frags[0], frags[1], frags[2], frags[3],
4208 frags[4], frags[5], frags[6]);
4209 break;
caryclark54359292015-03-26 07:52:43 -07004210 case PATH_CUBIC:
4211 drawCubic(frags[0], frags[1], frags[2], frags[3],
caryclark1049f122015-04-20 08:31:59 -07004212 frags[4], frags[5], frags[6], frags[7]);
caryclark54359292015-03-26 07:52:43 -07004213 break;
4214 default:
4215 console.log("unknown REC_TYPE_AFTERPART frag type: " + fragType);
4216 throw "stop execution";
4217 }
4218 ++afterIndex;
4219 break;
caryclark624637c2015-05-11 07:21:27 -07004220 case REC_TYPE_COINCIDENCE:
4221 if (!draw_coincidence || (step_limit > 0 && tIndex < lastCoin)) {
4222 continue;
4223 }
4224 focus_enabled = true;
4225 ctx.lineWidth = 3;
4226 ctx.strokeStyle = "rgba(127,45,63, 0.3)";
4227 var curve = curvePartialByID(test, frags[0], frags[1], frags[2]);
4228 drawCurve(curve);
4229 break;
caryclarkdac1d172014-06-17 05:15:38 -07004230 case REC_TYPE_SECT:
4231 if (!draw_intersection) {
4232 continue;
4233 }
4234 if (draw_intersection != 1 && (step_limit > 0 && tIndex < lastSect)) {
4235 continue;
4236 }
4237 // draw_intersection == 1 : show all
4238 // draw_intersection == 2 : step == 0 ? show all : show intersection line #step
4239 // draw_intersection == 3 : step == 0 ? show all : show intersection #step
4240 ctx.lineWidth = 1;
4241 ctx.strokeStyle = "rgba(0,0,255, 0.3)";
4242 ctx.fillStyle = "blue";
4243 focus_enabled = true;
4244 var f = [];
4245 var c1s;
4246 var c1l;
4247 var c2s;
4248 var c2l;
4249 switch (fragType) {
4250 case INTERSECT_LINE:
4251 f.push(5, 6, 0, 7);
4252 c1s = 1; c1l = 4; c2s = 8; c2l = 4;
4253 break;
4254 case INTERSECT_LINE_2:
4255 f.push(5, 6, 0, 10);
4256 f.push(8, 9, 7, 15);
4257 c1s = 1; c1l = 4; c2s = 11; c2l = 4;
4258 break;
4259 case INTERSECT_LINE_NO:
4260 c1s = 0; c1l = 4; c2s = 4; c2l = 4;
4261 break;
4262 case INTERSECT_QUAD_LINE:
4263 f.push(7, 8, 0, 9);
4264 c1s = 1; c1l = 6; c2s = 10; c2l = 4;
4265 break;
4266 case INTERSECT_QUAD_LINE_2:
4267 f.push(7, 8, 0, 12);
4268 f.push(10, 11, 9, 17);
4269 c1s = 1; c1l = 6; c2s = 13; c2l = 4;
4270 break;
4271 case INTERSECT_QUAD_LINE_NO:
4272 c1s = 0; c1l = 6; c2s = 6; c2l = 4;
4273 break;
4274 case INTERSECT_QUAD:
4275 f.push(7, 8, 0, 9);
4276 c1s = 1; c1l = 6; c2s = 10; c2l = 6;
4277 break;
4278 case INTERSECT_QUAD_2:
4279 f.push(7, 8, 0, 12);
4280 f.push(10, 11, 9, 19);
4281 c1s = 1; c1l = 6; c2s = 13; c2l = 6;
4282 break;
4283 case INTERSECT_QUAD_NO:
4284 c1s = 0; c1l = 6; c2s = 6; c2l = 6;
4285 break;
caryclark1049f122015-04-20 08:31:59 -07004286 case INTERSECT_CONIC_LINE:
4287 f.push(8, 9, 0, 10);
4288 c1s = 1; c1l = 7; c2s = 11; c2l = 4;
4289 break;
4290 case INTERSECT_CONIC_LINE_2:
4291 f.push(8, 9, 0, 12);
4292 f.push(11, 12, 10, 18);
4293 c1s = 1; c1l = 7; c2s = 14; c2l = 4;
4294 break;
4295 case INTERSECT_CONIC_LINE_NO:
4296 c1s = 0; c1l = 7; c2s = 7; c2l = 4;
4297 break;
caryclark55888e42016-07-18 10:01:36 -07004298 case INTERSECT_CONIC_QUAD:
4299 f.push(8, 9, 0, 10);
4300 c1s = 1; c1l = 7; c2s = 11; c2l = 6;
4301 break;
4302 case INTERSECT_CONIC_QUAD_2:
4303 f.push(8, 9, 0, 12);
4304 f.push(11, 12, 10, 18);
4305 c1s = 1; c1l = 7; c2s = 14; c2l = 6;
4306 break;
caryclark6c3b9cd2016-09-26 05:36:58 -07004307 case INTERSECT_CONIC_QUAD_3:
4308 f.push(8, 9, 0, 15);
4309 f.push(11, 12, 10, 21);
4310 f.push(14, 15, 13, 22);
4311 c1s = 1; c1l = 7; c2s = 17; c2l = 6;
4312 break;
4313 case INTERSECT_CONIC_QUAD_4:
4314 f.push(8, 9, 0, 18);
4315 f.push(11, 12, 10, 24);
4316 f.push(14, 15, 13, 25);
4317 f.push(17, 18, 16, 26);
4318 c1s = 1; c1l = 7; c2s = 20; c2l = 6;
4319 break;
caryclark55888e42016-07-18 10:01:36 -07004320 case INTERSECT_CONIC_QUAD_NO:
4321 c1s = 0; c1l = 7; c2s = 7; c2l = 6;
4322 break;
caryclark1049f122015-04-20 08:31:59 -07004323 case INTERSECT_CONIC:
4324 f.push(8, 9, 0, 10);
4325 c1s = 1; c1l = 7; c2s = 11; c2l = 7;
4326 break;
4327 case INTERSECT_CONIC_2:
4328 f.push(8, 9, 0, 13);
4329 f.push(11, 12, 10, 21);
4330 c1s = 1; c1l = 7; c2s = 14; c2l = 7;
4331 break;
4332 case INTERSECT_CONIC_NO:
4333 c1s = 0; c1l = 7; c2s = 7; c2l = 7;
4334 break;
caryclarkdac1d172014-06-17 05:15:38 -07004335 case INTERSECT_SELF_CUBIC:
4336 f.push(9, 10, 0, 11);
4337 c1s = 1; c1l = 8; c2s = 0; c2l = 0;
4338 break;
4339 case INTERSECT_SELF_CUBIC_NO:
4340 c1s = 0; c1l = 8; c2s = 0; c2l = 0;
4341 break;
4342 case INTERSECT_CUBIC_LINE:
4343 f.push(9, 10, 0, 11);
4344 c1s = 1; c1l = 8; c2s = 12; c2l = 4;
4345 break;
4346 case INTERSECT_CUBIC_LINE_2:
4347 f.push(9, 10, 0, 14);
4348 f.push(12, 13, 11, 19);
4349 c1s = 1; c1l = 8; c2s = 15; c2l = 4;
4350 break;
4351 case INTERSECT_CUBIC_LINE_3:
4352 f.push(9, 10, 0, 17);
4353 f.push(12, 13, 11, 22);
4354 f.push(15, 16, 14, 23);
4355 c1s = 1; c1l = 8; c2s = 18; c2l = 4;
4356 break;
4357 case INTERSECT_CUBIC_QUAD_NO:
4358 c1s = 0; c1l = 8; c2s = 8; c2l = 6;
4359 break;
4360 case INTERSECT_CUBIC_QUAD:
4361 f.push(9, 10, 0, 11);
4362 c1s = 1; c1l = 8; c2s = 12; c2l = 6;
4363 break;
4364 case INTERSECT_CUBIC_QUAD_2:
4365 f.push(9, 10, 0, 14);
4366 f.push(12, 13, 11, 21);
4367 c1s = 1; c1l = 8; c2s = 15; c2l = 6;
4368 break;
4369 case INTERSECT_CUBIC_QUAD_3:
4370 f.push(9, 10, 0, 17);
4371 f.push(12, 13, 11, 24);
4372 f.push(15, 16, 14, 25);
4373 c1s = 1; c1l = 8; c2s = 18; c2l = 6;
4374 break;
4375 case INTERSECT_CUBIC_QUAD_4:
4376 f.push(9, 10, 0, 20);
4377 f.push(12, 13, 11, 27);
4378 f.push(15, 16, 14, 28);
4379 f.push(18, 19, 17, 29);
4380 c1s = 1; c1l = 8; c2s = 21; c2l = 6;
4381 break;
4382 case INTERSECT_CUBIC_LINE_NO:
4383 c1s = 0; c1l = 8; c2s = 8; c2l = 4;
4384 break;
4385 case INTERSECT_CUBIC:
4386 f.push(9, 10, 0, 11);
4387 c1s = 1; c1l = 8; c2s = 12; c2l = 8;
4388 break;
4389 case INTERSECT_CUBIC_2:
4390 f.push(9, 10, 0, 14);
4391 f.push(12, 13, 11, 23);
4392 c1s = 1; c1l = 8; c2s = 15; c2l = 8;
4393 break;
4394 case INTERSECT_CUBIC_3:
4395 f.push(9, 10, 0, 17);
4396 f.push(12, 13, 11, 26);
4397 f.push(15, 16, 14, 27);
4398 c1s = 1; c1l = 8; c2s = 18; c2l = 8;
4399 break;
4400 case INTERSECT_CUBIC_4:
4401 f.push(9, 10, 0, 20);
4402 f.push(12, 13, 11, 29);
4403 f.push(15, 16, 14, 30);
4404 f.push(18, 19, 17, 31);
4405 c1s = 1; c1l = 8; c2s = 21; c2l = 8;
4406 break;
4407 case INTERSECT_CUBIC_NO:
4408 c1s = 0; c1l = 8; c2s = 8; c2l = 8;
4409 break;
4410 default:
4411 console.log("unknown REC_TYPE_SECT frag type: " + fragType);
4412 throw "stop execution";
4413 }
4414 if (draw_intersection != 1) {
4415 var id = -1;
4416 var curve;
4417 switch (c1l) {
caryclark55888e42016-07-18 10:01:36 -07004418 case 4:
caryclarkdac1d172014-06-17 05:15:38 -07004419 drawLine(frags[c1s], frags[c1s + 1], frags[c1s + 2], frags[c1s + 3]);
4420 if (draw_id) {
4421 curve = [frags[c1s], frags[c1s + 1], frags[c1s + 2], frags[c1s + 3]];
4422 id = idByCurve(test, curve, PATH_LINE);
4423 }
4424 break;
4425 case 6:
4426 drawQuad(frags[c1s], frags[c1s + 1], frags[c1s + 2], frags[c1s + 3],
4427 frags[c1s + 4], frags[c1s + 5]);
4428 if (draw_id) {
4429 curve = [frags[c1s], frags[c1s + 1], frags[c1s + 2], frags[c1s + 3],
4430 frags[c1s + 4], frags[c1s + 5]];
4431 id = idByCurve(test, curve, PATH_QUAD);
4432 }
4433 break;
caryclark1049f122015-04-20 08:31:59 -07004434 case 7:
4435 drawConicWithQuads(frags[c1s], frags[c1s + 1], frags[c1s + 2], frags[c1s + 3],
4436 frags[c1s + 4], frags[c1s + 5], frags[c1s + 6]);
4437 if (draw_id) {
4438 curve = [frags[c1s], frags[c1s + 1], frags[c1s + 2], frags[c1s + 3],
4439 frags[c1s + 4], frags[c1s + 5], frags[c1s + 6]];
4440 id = idByCurve(test, curve, PATH_CONIC);
4441 }
4442 break;
caryclarkdac1d172014-06-17 05:15:38 -07004443 case 8:
4444 drawCubic(frags[c1s], frags[c1s + 1], frags[c1s + 2], frags[c1s + 3],
4445 frags[c1s + 4], frags[c1s + 5], frags[c1s + 6], frags[c1s + 7]);
4446 if (draw_id) {
4447 curve = [frags[c1s], frags[c1s + 1], frags[c1s + 2], frags[c1s + 3],
4448 frags[c1s + 4], frags[c1s + 5], frags[c1s + 6], frags[c1s + 7]];
4449 id = idByCurve(test, curve, PATH_CUBIC);
4450 }
4451 break;
4452 }
4453 if (id >= 0) {
4454 drawID(curve, id);
4455 }
4456 id = -1;
4457 switch (c2l) {
4458 case 0:
4459 break;
caryclark55888e42016-07-18 10:01:36 -07004460 case 4:
caryclarkdac1d172014-06-17 05:15:38 -07004461 drawLine(frags[c2s], frags[c2s + 1], frags[c2s + 2], frags[c2s + 3]);
4462 if (draw_id) {
4463 curve = [frags[c2s], frags[c2s + 1], frags[c2s + 2], frags[c2s + 3]];
4464 id = idByCurve(test, curve, PATH_LINE);
4465 }
4466 break;
4467 case 6:
4468 drawQuad(frags[c2s], frags[c2s + 1], frags[c2s + 2], frags[c2s + 3],
4469 frags[c2s + 4], frags[c2s + 5]);
4470 if (draw_id) {
4471 curve = [frags[c2s], frags[c2s + 1], frags[c2s + 2], frags[c2s + 3],
4472 frags[c2s + 4], frags[c2s + 5]];
4473 id = idByCurve(test, curve, PATH_QUAD);
4474 }
4475 break;
caryclark1049f122015-04-20 08:31:59 -07004476 case 7:
4477 drawConicWithQuads(frags[c2s], frags[c2s + 1], frags[c2s + 2], frags[c2s + 3],
4478 frags[c2s + 4], frags[c2s + 5], frags[c2s + 6]);
4479 if (draw_id) {
4480 curve = [frags[c2s], frags[c2s + 1], frags[c2s + 2], frags[c2s + 3],
4481 frags[c2s + 4], frags[c2s + 5], frags[c2s + 6]];
4482 id = idByCurve(test, curve, PATH_CONIC);
4483 }
4484 break;
caryclarkdac1d172014-06-17 05:15:38 -07004485 case 8:
4486 drawCubic(frags[c2s], frags[c2s + 1], frags[c2s + 2], frags[c2s + 3],
4487 frags[c2s + 4], frags[c2s + 5], frags[c2s + 6], frags[c2s + 7]);
4488 if (draw_id) {
4489 curve = [frags[c2s], frags[c2s + 1], frags[c2s + 2], frags[c2s + 3],
4490 frags[c2s + 4], frags[c2s + 5], frags[c2s + 6], frags[c2s + 7]];
4491 id = idByCurve(test, curve, PATH_CUBIC);
4492 }
4493 break;
4494 }
4495 if (id >= 0) {
4496 drawID(curve, id);
4497 }
4498 }
4499 if (collect_bounds) {
4500 break;
4501 }
caryclark54359292015-03-26 07:52:43 -07004502 if (draw_intersection != 3 || step_limit == 0 || tIndex >= lastSect) {
4503 for (var idx = 0; idx < f.length; idx += 4) {
caryclarkdac1d172014-06-17 05:15:38 -07004504 drawPoint(frags[f[idx]], frags[f[idx + 1]], true);
4505 }
4506 }
4507 if (!draw_intersectT) {
4508 break;
4509 }
4510 ctx.fillStyle = "red";
caryclark54359292015-03-26 07:52:43 -07004511 if (draw_intersection != 3 || step_limit == 0 || tIndex >= lastSect) {
4512 for (var idx = 0; idx < f.length; idx += 4) {
caryclarkdac1d172014-06-17 05:15:38 -07004513 drawTAtPointUp(frags[f[idx]], frags[f[idx + 1]], frags[f[idx + 2]]);
4514 drawTAtPointDown(frags[f[idx]], frags[f[idx + 1]], frags[f[idx + 3]]);
4515 }
4516 }
4517 break;
4518 case REC_TYPE_SORT:
4519 if (!draw_sort || (step_limit > 0 && tIndex < lastSort)) {
4520 continue;
4521 }
4522 ctx.lineWidth = 3;
4523 ctx.strokeStyle = "rgba(127,127,0, 0.5)";
4524 focus_enabled = true;
4525 switch (fragType) {
4526 case SORT_UNARY:
4527 case SORT_BINARY:
4528 var curve = curvePartialByID(test, frags[0], frags[6], frags[8]);
4529 drawCurve(curve);
4530 break;
4531 default:
4532 console.log("unknown REC_TYPE_SORT frag type: " + fragType);
4533 throw "stop execution";
4534 }
4535 break;
caryclark03b03ca2015-04-23 09:13:37 -07004536 case REC_TYPE_TOP:
4537 if (!draw_top || (step_limit > 0 && tIndex < lastTop)) {
4538 continue;
4539 }
4540 ctx.lineWidth = 3;
4541 ctx.strokeStyle = "rgba(127,127,0, 0.5)";
4542 focus_enabled = true;
4543 {
4544 var curve = curvePartialByID(test, frags[0], frags[1], frags[2]);
4545 drawCurve(curve);
4546 var type = PATH_LINE + (curve.length / 2 - 2);
4547 var mid = pointAtT(curve, type, 0.5);
4548 var d = dxy_at_t(curve, type, 0.5);
4549 drawArrow(mid.x, mid.y, d.x, d.y, 0.3);
4550 }
4551 break;
caryclarkdac1d172014-06-17 05:15:38 -07004552 case REC_TYPE_MARK:
4553 if (!draw_mark || (step_limit > 0 && tIndex < lastMark)) {
4554 continue;
4555 }
4556 ctx.lineWidth = 3;
4557 ctx.strokeStyle = fragType >= MARK_DONE_LINE ?
4558 "rgba(127,0,127, 0.5)" : "rgba(127,127,0, 0.5)";
4559 focus_enabled = true;
4560 switch (fragType) {
4561 case MARK_LINE:
4562 case MARK_DONE_LINE:
4563 case MARK_UNSORTABLE_LINE:
4564 case MARK_SIMPLE_LINE:
4565 case MARK_SIMPLE_DONE_LINE:
4566 case MARK_DONE_UNARY_LINE:
4567 drawLinePartial(frags[1], frags[2], frags[3], frags[4],
4568 frags[5], frags[9]);
4569 if (draw_id) {
4570 drawLinePartialID(frags[0], frags[1], frags[2], frags[3], frags[4],
4571 frags[5], frags[9]);
4572 }
4573 break;
4574 case MARK_QUAD:
4575 case MARK_DONE_QUAD:
4576 case MARK_UNSORTABLE_QUAD:
4577 case MARK_SIMPLE_QUAD:
4578 case MARK_SIMPLE_DONE_QUAD:
4579 case MARK_DONE_UNARY_QUAD:
4580 drawQuadPartial(frags[1], frags[2], frags[3], frags[4],
4581 frags[5], frags[6], frags[7], frags[11]);
4582 if (draw_id) {
4583 drawQuadPartialID(frags[0], frags[1], frags[2], frags[3], frags[4],
4584 frags[5], frags[6], frags[7], frags[11]);
4585 }
4586 break;
4587 case MARK_CUBIC:
4588 case MARK_DONE_CUBIC:
4589 case MARK_UNSORTABLE_CUBIC:
4590 case MARK_SIMPLE_CUBIC:
4591 case MARK_SIMPLE_DONE_CUBIC:
4592 case MARK_DONE_UNARY_CUBIC:
4593 drawCubicPartial(frags[1], frags[2], frags[3], frags[4],
4594 frags[5], frags[6], frags[7], frags[8], frags[9], frags[13]);
4595 if (draw_id) {
4596 drawCubicPartialID(frags[0], frags[1], frags[2], frags[3], frags[4],
4597 frags[5], frags[6], frags[7], frags[8], frags[9], frags[13]);
4598 }
4599 break;
4600 case MARK_ANGLE_LAST:
4601 // FIXME: ignored for now
4602 break;
4603 default:
4604 console.log("unknown REC_TYPE_MARK frag type: " + fragType);
4605 throw "stop execution";
4606 }
4607 break;
4608 default:
4609 continue;
4610 }
4611 }
4612 switch (recType) {
4613 case REC_TYPE_SORT:
4614 if (!draw_sort || (step_limit > 0 && tIndex < lastSort)) {
4615 break;
4616 }
4617 var angles = []; // use tangent lines to describe arcs
4618 var windFrom = [];
4619 var windTo = [];
4620 var opp = [];
4621 var minXY = Number.MAX_VALUE;
4622 var partial;
4623 focus_enabled = true;
4624 var someUnsortable = false;
4625 for (var recordIndex = 0; recordIndex < records.length; recordIndex += 2) {
4626 var fragType = records[recordIndex];
4627 var frags = records[recordIndex + 1];
4628 var unsortable = (fragType == SORT_UNARY && frags[14]) ||
4629 (fragType == SORT_BINARY && frags[16]);
4630 someUnsortable |= unsortable;
4631 switch (fragType) {
4632 case SORT_UNARY:
4633 case SORT_BINARY:
4634 partial = curvePartialByID(test, frags[0], frags[6], frags[8]);
4635 break;
4636 default:
4637 console.log("unknown REC_TYPE_SORT frag type: " + fragType);
4638 throw "stop execution";
4639 }
4640 var dx = boundsWidth(partial);
4641 var dy = boundsHeight(partial);
4642 minXY = Math.min(minXY, dx * dx + dy * dy);
4643 if (collect_bounds) {
4644 continue;
4645 }
4646 angles.push(tangent(partial));
4647 var from = frags[12];
4648 var to = frags[12];
4649 var sgn = frags[10];
4650 if (sgn < 0) {
4651 from -= frags[11];
4652 } else if (sgn > 0) {
4653 to -= frags[11];
4654 }
4655 windFrom.push(from + (unsortable ? "!" : ""));
4656 windTo.push(to + (unsortable ? "!" : ""));
4657 opp.push(fragType == SORT_BINARY);
4658 if (draw_sort == 1) {
4659 drawOrder(partial, frags[12]);
4660 } else {
4661 drawOrder(partial, (recordIndex / 2) + 1);
4662 }
4663 }
4664 var radius = Math.sqrt(minXY) / 2 * scale;
4665 radius = Math.min(50, radius);
4666 var scaledRadius = radius / scale;
4667 var centerX = partial[0];
4668 var centerY = partial[1];
4669 if (collect_bounds) {
4670 if (focus_enabled) {
4671 focusXmin = Math.min(focusXmin, centerX - scaledRadius);
4672 focusYmin = Math.min(focusYmin, centerY - scaledRadius);
4673 focusXmax = Math.max(focusXmax, centerX + scaledRadius);
4674 focusYmax = Math.max(focusYmax, centerY + scaledRadius);
4675 }
4676 break;
4677 }
4678 break;
4679 default:
4680 break;
4681 }
4682 }
4683 if (collect_bounds) {
4684 return;
4685 }
4686 if (draw_log && logStart >= 0) {
4687 ctx.font = "normal 10px Arial";
4688 ctx.textAlign = "left";
4689 ctx.beginPath();
4690 var top = screenHeight - 20 - (logRange + 2) * 10;
4691 ctx.rect(50, top, screenWidth - 100, (logRange + 2) * 10);
4692 ctx.fillStyle = "white";
4693 ctx.fill();
4694 ctx.fillStyle = "rgba(0,0,0, 0.5)";
4695 if (logStart > 0) {
4696 ctx.fillText(lines[logStart - 1], 50, top + 8);
4697 }
4698 ctx.fillStyle = "black";
4699 for (var idx = 0; idx < logRange; ++idx) {
4700 ctx.fillText(lines[logStart + idx], 50, top + 18 + 10 * idx);
4701 }
4702 ctx.fillStyle = "rgba(0,0,0, 0.5)";
4703 if (logStart + logRange < lines.length) {
4704 ctx.fillText(lines[logStart + logRange], 50, top + 18 + 10 * logRange);
4705 }
4706 }
4707 if (draw_legend) {
4708 var pos = 0;
caryclark624637c2015-05-11 07:21:27 -07004709 var drawSomething = draw_add | draw_active | draw_angle | draw_coincidence | draw_sort | draw_mark;
caryclarkdac1d172014-06-17 05:15:38 -07004710 // drawBox(pos++, "yellow", "black", opLetter, true, '');
4711 drawBox(pos++, "rgba(0,0,255, 0.3)", "black", draw_intersection > 1 ? sectCount : sectMax2, draw_intersection, intersectionKey);
4712 drawBox(pos++, "rgba(0,0,255, 0.3)", "black", draw_add ? addCount : addMax, draw_add, addKey);
4713 drawBox(pos++, "rgba(0,0,255, 0.3)", "black", draw_active ? activeCount : activeMax, draw_active, activeKey);
4714 drawBox(pos++, "rgba(127,127,0, 0.3)", "black", draw_angle ? angleCount : angleMax, draw_angle, angleKey);
caryclark624637c2015-05-11 07:21:27 -07004715 drawBox(pos++, "rgba(127,127,0, 0.3)", "black", draw_coincidence ? coinCount : coinMax, draw_coincidence, coincidenceKey);
caryclarkdac1d172014-06-17 05:15:38 -07004716 drawBox(pos++, "rgba(127,127,0, 0.3)", "black", draw_op ? opCount : opMax, draw_op, opKey);
4717 drawBox(pos++, "rgba(127,127,0, 0.3)", "black", draw_sort ? sortCount : sortMax, draw_sort, sortKey);
caryclark03b03ca2015-04-23 09:13:37 -07004718 drawBox(pos++, "rgba(127,127,0, 0.3)", "black", draw_top ? topCount : topMax, draw_top, topKey);
caryclarkdac1d172014-06-17 05:15:38 -07004719 drawBox(pos++, "rgba(127,0,127, 0.3)", "black", draw_mark ? markCount : markMax, draw_mark, markKey);
caryclark55888e42016-07-18 10:01:36 -07004720 drawBox(pos++, "black", "white",
caryclark26ad22a2015-10-16 09:03:38 -07004721 (new Array('P', 'P1', 'P2', 'P', 'p', 'p1', 'p2'))[draw_path], draw_path != 0, pathKey);
caryclarkdac1d172014-06-17 05:15:38 -07004722 drawBox(pos++, "rgba(0,63,0, 0.7)", "white",
4723 (new Array('Q', 'Q', 'C', 'QC', 'Qc', 'Cq'))[draw_computed],
4724 draw_computed != 0, computedKey);
4725 drawBox(pos++, "green", "black", step_limit, drawSomething, '');
4726 drawBox(pos++, "green", "black", stepMax, drawSomething, '');
4727 drawBox(pos++, "rgba(255,0,0, 0.6)", "black", lastIndex, drawSomething & draw_log, '');
4728 drawBox(pos++, "rgba(255,0,0, 0.6)", "black", test.length - 1, drawSomething & draw_log, '');
4729 if (curve_t) {
4730 drawCurveTControl();
4731 }
4732 ctx.font = "normal 20px Arial";
4733 ctx.fillStyle = "rgba(0,0,0, 0.3)";
4734 ctx.textAlign = "right";
4735 ctx.fillText(scale.toFixed(decimal_places) + 'x' , screenWidth - 10, screenHeight - 5);
4736 }
4737 if (draw_hints) {
4738 ctx.font = "normal 10px Arial";
4739 ctx.fillStyle = "rgba(0,0,0, 0.5)";
4740 ctx.textAlign = "right";
4741 var y = 4;
4742 ctx.fillText("control lines : " + controlLinesKey, ctx.screenWidthwidth - 10, pos * 50 + y++ * 10);
4743 ctx.fillText("curve t : " + curveTKey, screenWidth - 10, pos * 50 + y++ * 10);
4744 ctx.fillText("deriviatives : " + deriviativesKey, screenWidth - 10, pos * 50 + y++ * 10);
4745 ctx.fillText("intersect t : " + intersectTKey, screenWidth - 10, pos * 50 + y++ * 10);
caryclarkdac1d172014-06-17 05:15:38 -07004746 ctx.fillText("log : " + logKey, screenWidth - 10, pos * 50 + y++ * 10);
4747 ctx.fillText("log curve : " + logCurvesKey, screenWidth - 10, pos * 50 + y++ * 10);
4748 ctx.fillText("mid point : " + midpointKey, screenWidth - 10, pos * 50 + y++ * 10);
4749 ctx.fillText("points : " + ptsKey, screenWidth - 10, pos * 50 + y++ * 10);
4750 ctx.fillText("sequence : " + sequenceKey, screenWidth - 10, pos * 50 + y++ * 10);
4751 ctx.fillText("xy : " + xyKey, screenWidth - 10, pos * 50 + y++ * 10);
4752 }
4753}
4754
4755function drawBox(y, backC, foreC, str, enable, label) {
4756 ctx.beginPath();
4757 ctx.fillStyle = backC;
4758 ctx.rect(screenWidth - 40, y * 50 + 10, 40, 30);
4759 ctx.fill();
4760 ctx.font = "normal 16px Arial";
4761 ctx.fillStyle = foreC;
4762 ctx.textAlign = "center";
4763 ctx.fillText(str, screenWidth - 20, y * 50 + 32);
4764 if (!enable) {
4765 ctx.fillStyle = "rgba(255,255,255, 0.5)";
4766 ctx.fill();
4767 }
4768 if (label != '') {
4769 ctx.font = "normal 9px Arial";
4770 ctx.fillStyle = "black";
4771 ctx.fillText(label, screenWidth - 47, y * 50 + 40);
4772 }
4773}
4774
4775function drawCurveTControl() {
4776 ctx.lineWidth = 2;
4777 ctx.strokeStyle = "rgba(0,0,0, 0.3)";
4778 ctx.beginPath();
4779 ctx.rect(screenWidth - 80, 40, 28, screenHeight - 80);
4780 ctx.stroke();
4781 var ty = 40 + curveT * (screenHeight - 80);
4782 ctx.beginPath();
4783 ctx.moveTo(screenWidth - 80, ty);
4784 ctx.lineTo(screenWidth - 85, ty - 5);
4785 ctx.lineTo(screenWidth - 85, ty + 5);
4786 ctx.lineTo(screenWidth - 80, ty);
4787 ctx.fillStyle = "rgba(0,0,0, 0.6)";
4788 ctx.fill();
4789 var num = curveT.toFixed(decimal_places);
4790 ctx.font = "normal 10px Arial";
4791 ctx.textAlign = "left";
4792 ctx.fillText(num, screenWidth - 78, ty);
4793}
4794
4795function ptInTControl() {
4796 var e = window.event;
caryclark55888e42016-07-18 10:01:36 -07004797 var tgt = e.target || e.srcElement;
caryclarkdac1d172014-06-17 05:15:38 -07004798 var left = tgt.offsetLeft;
4799 var top = tgt.offsetTop;
4800 var x = (e.clientX - left);
4801 var y = (e.clientY - top);
4802 if (x < screenWidth - 80 || x > screenWidth - 50) {
4803 return false;
4804 }
4805 if (y < 40 || y > screenHeight - 80) {
4806 return false;
4807 }
4808 curveT = (y - 40) / (screenHeight - 120);
4809 if (curveT < 0 || curveT > 1) {
4810 throw "stop execution";
4811 }
4812 return true;
4813}
4814
4815function drawTop() {
4816 if (tests[testIndex] == null) {
4817 var str = testDivs[testIndex].textContent;
4818 parse_all(str);
4819 var title = testDivs[testIndex].id.toString();
4820 testTitles[testIndex] = title;
4821 }
4822 init(tests[testIndex]);
4823 redraw();
4824}
4825
4826function redraw() {
4827 if (focus_on_selection) {
4828 collect_bounds = true;
4829 draw(tests[testIndex], testLines[testIndex], testTitles[testIndex]);
4830 collect_bounds = false;
4831 if (focusXmin < focusXmax && focusYmin < focusYmax) {
4832 setScale(focusXmin, focusXmax, focusYmin, focusYmax);
4833 }
4834 }
4835 ctx.beginPath();
4836 ctx.fillStyle = "white";
4837 ctx.rect(0, 0, screenWidth, screenHeight);
4838 ctx.fill();
4839 draw(tests[testIndex], testLines[testIndex], testTitles[testIndex]);
4840}
4841
4842function dumpCurvePartial(test, id, t0, t1) {
4843 var curve = curveByID(test, id);
4844 var name = ["line", "quad", "cubic"][curve.length / 2 - 2];
4845 console.log("id=" + id + " " + name + "=" + curveToString(curve)
4846 + " t0=" + t0 + " t1=" + t1
4847 + " partial=" + curveToString(curvePartialByID(test, id, t0, t1)));
4848}
4849
4850function dumpAngleTest(test, id, t0, t1) {
4851 var curve = curveByID(test, id);
caryclark55888e42016-07-18 10:01:36 -07004852 console.log(" { {" + curveToString(curve) + "}, "
caryclarkdac1d172014-06-17 05:15:38 -07004853 + curve.length / 2 + ", " + t0 + ", " + t1 + ", {} }, //");
4854}
4855
4856function dumpLogToConsole() {
4857 if (logStart < 0) {
4858 return;
4859 }
4860 var test = tests[testIndex];
4861 var recType = REC_TYPE_UNKNOWN;
4862 var records;
4863 for (var index = 0; index < test.length; index += 3) {
4864 var lastLineNo = test[index + 1];
4865 if (lastLineNo >= logStart && lastLineNo < logStart + logRange) {
4866 recType = test[index];
4867 records = test[index + 2];
4868 break;
4869 }
4870 }
4871 if (recType == REC_TYPE_UNKNOWN) {
4872 return;
4873 }
4874 var lines = testLines[testIndex];
4875 for (var idx = 0; idx < logRange; ++idx) {
4876 var line = lines[logStart + idx];
4877 console.log(line);
4878 for (var recordIndex = 0; recordIndex < records.length; recordIndex += 2) {
4879 var fragType = records[recordIndex];
4880 var frags = records[recordIndex + 1];
4881 if (recType == REC_TYPE_ANGLE && fragType == ANGLE_AFTER) {
caryclarkdac1d172014-06-17 05:15:38 -07004882 dumpCurvePartial(test, frags[0], frags[4], frags[5]);
4883 dumpCurvePartial(test, frags[6], frags[10], frags[11]);
4884 dumpCurvePartial(test, frags[12], frags[16], frags[17]);
4885 console.log("\nstatic IntersectData intersectDataSet[] = { //");
4886 dumpAngleTest(test, frags[0], frags[4], frags[5]);
4887 dumpAngleTest(test, frags[6], frags[10], frags[11]);
4888 dumpAngleTest(test, frags[12], frags[16], frags[17]);
4889 console.log("}; //");
4890 }
4891 }
4892 }
4893}
4894
4895var activeKey = 'a';
4896var pathKey = 'b';
4897var pathBackKey = 'B';
4898var centerKey = 'c';
caryclark624637c2015-05-11 07:21:27 -07004899var coincidenceKey = 'C';
caryclarkdac1d172014-06-17 05:15:38 -07004900var addKey = 'd';
4901var deriviativesKey = 'f';
4902var angleKey = 'g';
4903var angleBackKey = 'G';
caryclarkdac1d172014-06-17 05:15:38 -07004904var intersectionKey = 'i';
4905var intersectionBackKey = 'I';
4906var sequenceKey = 'j';
4907var midpointKey = 'k';
4908var logKey = 'l';
4909var logToConsoleKey = 'L';
4910var markKey = 'm';
4911var sortKey = 'o';
4912var opKey = 'p';
4913var opBackKey = 'P';
4914var computedKey = 'q';
4915var computedBackKey = 'Q';
4916var stepKey = 's';
4917var stepBackKey = 'S';
4918var intersectTKey = 't';
caryclark03b03ca2015-04-23 09:13:37 -07004919var topKey = 'T';
caryclarkdac1d172014-06-17 05:15:38 -07004920var curveTKey = 'u';
4921var controlLinesBackKey = 'V';
4922var controlLinesKey = 'v';
4923var ptsKey = 'x';
4924var xyKey = 'y';
4925var logCurvesKey = 'z';
4926var focusKey = '`';
4927var idKey = '.';
4928var retinaKey = '\\';
4929
4930function doKeyPress(evt) {
4931 var char = String.fromCharCode(evt.charCode);
4932 var focusWasOn = false;
4933 switch (char) {
4934 case '0':
4935 case '1':
4936 case '2':
4937 case '3':
4938 case '4':
4939 case '5':
4940 case '6':
4941 case '7':
4942 case '8':
4943 case '9':
4944 decimal_places = char - '0';
4945 redraw();
4946 break;
4947 case activeKey:
4948 draw_active ^= true;
caryclark55888e42016-07-18 10:01:36 -07004949 redraw();
caryclarkdac1d172014-06-17 05:15:38 -07004950 break;
4951 case addKey:
4952 draw_add ^= true;
caryclark55888e42016-07-18 10:01:36 -07004953 redraw();
caryclarkdac1d172014-06-17 05:15:38 -07004954 break;
4955 case angleKey:
caryclark54359292015-03-26 07:52:43 -07004956 draw_angle = (draw_angle + 1) % 4;
caryclarkdac1d172014-06-17 05:15:38 -07004957 redraw();
4958 break;
4959 case angleBackKey:
4960 draw_angle = (draw_angle + 2) % 3;
4961 redraw();
4962 break;
4963 case centerKey:
4964 setScale(xmin, xmax, ymin, ymax);
caryclark55888e42016-07-18 10:01:36 -07004965 redraw();
caryclarkdac1d172014-06-17 05:15:38 -07004966 break;
caryclark624637c2015-05-11 07:21:27 -07004967 case coincidenceKey:
4968 draw_coincidence ^= true;
4969 redraw();
4970 break;
caryclarkdac1d172014-06-17 05:15:38 -07004971 case controlLinesBackKey:
4972 control_lines = (control_lines + 3) % 4;
caryclark55888e42016-07-18 10:01:36 -07004973 redraw();
caryclarkdac1d172014-06-17 05:15:38 -07004974 break;
4975 case controlLinesKey:
4976 control_lines = (control_lines + 1) % 4;
caryclark55888e42016-07-18 10:01:36 -07004977 redraw();
caryclarkdac1d172014-06-17 05:15:38 -07004978 break;
4979 case computedBackKey:
4980 draw_computed = (draw_computed + 5) % 6;
caryclark55888e42016-07-18 10:01:36 -07004981 redraw();
caryclarkdac1d172014-06-17 05:15:38 -07004982 break;
4983 case computedKey:
4984 draw_computed = (draw_computed + 1) % 6;
caryclark55888e42016-07-18 10:01:36 -07004985 redraw();
caryclarkdac1d172014-06-17 05:15:38 -07004986 break;
4987 case curveTKey:
4988 curve_t ^= true;
4989 if (curve_t) {
4990 draw_legend = true;
4991 }
4992 redraw();
4993 break;
4994 case deriviativesKey:
4995 draw_deriviatives = (draw_deriviatives + 1) % 3;
4996 redraw();
4997 break;
4998 case focusKey:
4999 focus_on_selection ^= true;
5000 setScale(xmin, xmax, ymin, ymax);
5001 redraw();
5002 break;
caryclarkdac1d172014-06-17 05:15:38 -07005003 case idKey:
5004 draw_id ^= true;
5005 redraw();
5006 break;
5007 case intersectionBackKey:
5008 draw_intersection = (draw_intersection + 3) % 4;
caryclark55888e42016-07-18 10:01:36 -07005009 redraw();
caryclarkdac1d172014-06-17 05:15:38 -07005010 break;
5011 case intersectionKey:
5012 draw_intersection = (draw_intersection + 1) % 4;
caryclark55888e42016-07-18 10:01:36 -07005013 redraw();
caryclarkdac1d172014-06-17 05:15:38 -07005014 break;
5015 case intersectTKey:
5016 draw_intersectT ^= true;
5017 redraw();
5018 break;
5019 case logCurvesKey:
5020 logCurves(tests[testIndex]);
5021 break;
5022 case logKey:
5023 draw_log ^= true;
5024 redraw();
5025 break;
5026 case logToConsoleKey:
5027 if (draw_log) {
5028 dumpLogToConsole();
5029 }
5030 break;
5031 case markKey:
5032 draw_mark ^= true;
5033 redraw();
5034 break;
5035 case midpointKey:
5036 draw_midpoint ^= true;
5037 redraw();
5038 break;
5039 case opKey:
5040 draw_op = (draw_op + 1) % 3;
5041 redraw();
5042 break;
5043 case opBackKey:
5044 draw_op = (draw_op + 2) % 3;
5045 redraw();
5046 break;
5047 case pathKey:
caryclark26ad22a2015-10-16 09:03:38 -07005048 draw_path = (draw_path + 1) % (4 + (hasAlignedPath ? 3 : 0));
caryclark55888e42016-07-18 10:01:36 -07005049 redraw();
caryclarkdac1d172014-06-17 05:15:38 -07005050 break;
5051 case pathBackKey:
caryclark26ad22a2015-10-16 09:03:38 -07005052 draw_path = (draw_path + 3 + (hasAlignedPath ? 3 : 0)) % (4 + (hasAlignedPath ? 3 : 0));
caryclark55888e42016-07-18 10:01:36 -07005053 redraw();
caryclarkdac1d172014-06-17 05:15:38 -07005054 break;
5055 case ptsKey:
5056 pt_labels = (pt_labels + 1) % 3;
5057 redraw();
5058 break;
5059 case retinaKey:
5060 retina_scale ^= true;
5061 drawTop();
5062 break;
5063 case sequenceKey:
5064 draw_sequence ^= true;
5065 redraw();
5066 break;
5067 case sortKey:
5068 draw_sort = (draw_sort + 1) % 3;
5069 drawTop();
5070 break;
5071 case stepKey:
5072 step_limit++;
5073 if (step_limit > stepMax) {
5074 step_limit = stepMax;
5075 }
5076 redraw();
5077 break;
5078 case stepBackKey:
5079 step_limit--;
5080 if (step_limit < 0) {
5081 step_limit = 0;
5082 }
5083 redraw();
5084 break;
caryclark03b03ca2015-04-23 09:13:37 -07005085 case topKey:
5086 draw_top ^= true;
5087 redraw();
5088 break;
caryclarkdac1d172014-06-17 05:15:38 -07005089 case xyKey:
5090 debug_xy = (debug_xy + 1) % 3;
5091 redraw();
5092 break;
5093 case '-':
5094 focusWasOn = focus_on_selection;
5095 if (focusWasOn) {
5096 focus_on_selection = false;
5097 scale /= 1.2;
5098 } else {
5099 scale /= 2;
5100 calcLeftTop();
5101 }
5102 redraw();
5103 focus_on_selection = focusWasOn;
5104 break;
5105 case '=':
5106 case '+':
5107 focusWasOn = focus_on_selection;
5108 if (focusWasOn) {
5109 focus_on_selection = false;
5110 scale *= 1.2;
5111 } else {
5112 scale *= 2;
5113 calcLeftTop();
5114 }
5115 redraw();
5116 focus_on_selection = focusWasOn;
5117 break;
5118 case '?':
5119 draw_hints ^= true;
5120 if (draw_hints && !draw_legend) {
5121 draw_legend = true;
5122 }
5123 redraw();
5124 break;
5125 case '/':
5126 draw_legend ^= true;
5127 redraw();
5128 break;
5129 }
5130}
5131
5132function doKeyDown(evt) {
5133 var char = evt.keyCode;
5134 var preventDefault = false;
5135 switch (char) {
5136 case 37: // left arrow
5137 if (evt.shiftKey) {
5138 testIndex -= 9;
5139 }
5140 if (--testIndex < 0)
5141 testIndex = tests.length - 1;
5142 drawTop();
5143 preventDefault = true;
5144 break;
5145 case 39: // right arrow
5146 if (evt.shiftKey) {
5147 testIndex += 9;
5148 }
5149 if (++testIndex >= tests.length)
5150 testIndex = 0;
5151 drawTop();
5152 preventDefault = true;
5153 break;
5154 }
5155 if (preventDefault) {
5156 evt.preventDefault();
5157 return false;
5158 }
5159 return true;
5160}
5161
5162(function() {
5163 var hidden = "hidden";
5164
5165 // Standards:
5166 if (hidden in document)
5167 document.addEventListener("visibilitychange", onchange);
5168 else if ((hidden = "mozHidden") in document)
5169 document.addEventListener("mozvisibilitychange", onchange);
5170 else if ((hidden = "webkitHidden") in document)
5171 document.addEventListener("webkitvisibilitychange", onchange);
5172 else if ((hidden = "msHidden") in document)
5173 document.addEventListener("msvisibilitychange", onchange);
5174 // IE 9 and lower:
5175 else if ('onfocusin' in document)
5176 document.onfocusin = document.onfocusout = onchange;
5177 // All others:
5178 else
caryclark55888e42016-07-18 10:01:36 -07005179 window.onpageshow = window.onpagehide
caryclarkdac1d172014-06-17 05:15:38 -07005180 = window.onfocus = window.onblur = onchange;
5181
5182 function onchange (evt) {
5183 var v = 'visible', h = 'hidden',
caryclark55888e42016-07-18 10:01:36 -07005184 evtMap = {
5185 focus:v, focusin:v, pageshow:v, blur:h, focusout:h, pagehide:h
caryclarkdac1d172014-06-17 05:15:38 -07005186 };
5187
5188 evt = evt || window.event;
5189 if (evt.type in evtMap)
5190 document.body.className = evtMap[evt.type];
caryclark55888e42016-07-18 10:01:36 -07005191 else
caryclarkdac1d172014-06-17 05:15:38 -07005192 document.body.className = this[hidden] ? "hidden" : "visible";
5193 }
5194})();
5195
5196function calcXY() {
5197 var e = window.event;
caryclark55888e42016-07-18 10:01:36 -07005198 var tgt = e.target || e.srcElement;
caryclarkdac1d172014-06-17 05:15:38 -07005199 var left = tgt.offsetLeft;
5200 var top = tgt.offsetTop;
5201 mouseX = (e.clientX - left) / scale + srcLeft;
5202 mouseY = (e.clientY - top) / scale + srcTop;
5203}
5204
5205function calcLeftTop() {
5206 srcLeft = mouseX - screenWidth / 2 / scale;
5207 srcTop = mouseY - screenHeight / 2 / scale;
5208}
5209
5210var disableClick = false;
5211
5212function handleMouseClick() {
5213 if (disableClick) {
5214 return;
5215 }
5216 if (!curve_t || !ptInTControl()) {
5217 calcXY();
5218 calcLeftTop();
5219 }
5220 redraw();
5221// if (!curve_t || !ptInTControl()) {
5222// mouseX = screenWidth / 2 / scale + srcLeft;
5223// mouseY = screenHeight / 2 / scale + srcTop;
5224// }
5225}
5226
5227function handleMouseOver() {
5228 calcXY();
5229 if (debug_xy != 2) {
5230 return;
5231 }
5232 var num = mouseX.toFixed(decimal_places) + ", " + mouseY.toFixed(decimal_places);
5233 ctx.beginPath();
5234 ctx.rect(300,100,num.length * 6,10);
5235 ctx.fillStyle="white";
5236 ctx.fill();
5237 ctx.font = "normal 10px Arial";
5238 ctx.fillStyle="black";
5239 ctx.textAlign = "left";
5240 ctx.fillText(num, 300, 108);
5241}
5242
5243function start() {
5244 for (var i = 0; i < testDivs.length; ++i) {
5245 tests[i] = null;
5246 }
5247 testIndex = 0;
5248 drawTop();
5249 window.addEventListener('keypress', doKeyPress, true);
5250 window.addEventListener('keydown', doKeyDown, true);
5251 window.onresize = function() {
5252 drawTop();
5253 }
5254 /*
5255 window.onpagehide = function() {
5256 disableClick = true;
5257 }
5258 */
5259 window.onpageshow = function () {
5260 disableClick = false;
5261 }
5262}
5263
5264</script>
5265</head>
5266
5267<body onLoad="start();">
5268<canvas id="canvas" width="750" height="500"
5269 onmousemove="handleMouseOver()"
5270 onclick="handleMouseClick()"
5271 ></canvas >
5272</body>
5273</html>