caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 1 | <html> |
| 2 | <head> |
| 3 | <div height="0" hidden="true"> |
Cary Clark | 7eb01e0 | 2016-12-08 14:36:32 -0500 | [diff] [blame] | 4 |
|
Cary Clark | ff11428 | 2016-12-14 11:56:16 -0500 | [diff] [blame^] | 5 | Skia UnitTests: --match PathOpsOp$ --resourcePath resources\ -v -V SK_DEBUG
|
Cary Clark | 7eb01e0 | 2016-12-08 14:36:32 -0500 | [diff] [blame] | 6 |
|
Cary Clark | ff11428 | 2016-12-14 11:56:16 -0500 | [diff] [blame^] | 7 | <div id="skpeldorado_com_ua1_working">
|
Cary Clark | 7eb01e0 | 2016-12-08 14:36:32 -0500 | [diff] [blame] | 8 | SkDCubic::ComplexBreak
|
Cary Clark | ff11428 | 2016-12-14 11:56:16 -0500 | [diff] [blame^] | 9 | {{{1006.69512939453125, 291}, {1023.263671875, 291}, {1033.8402099609375, 304.43145751953125}, {1030.318359375, 321}}},
|
| 10 | maxCurvature[0]=0.474344964 {{{998.1828178832590766, 267.6895845341347808}, {1052.542975701327805, 330.2457181562319306}}},
|
Cary Clark | 7eb01e0 | 2016-12-08 14:36:32 -0500 | [diff] [blame] | 11 | SkDCubic::ComplexBreak
|
Cary Clark | ff11428 | 2016-12-14 11:56:16 -0500 | [diff] [blame^] | 12 | {{{259.30487060546875, 561}, {242.7363128662109375, 561}, {232.1598052978515625, 547.56854248046875}, {235.681549072265625, 531}}},
|
| 13 | maxCurvature[0]=0.474343429 {{{267.8173432015576623, 584.3103847404762519}, {213.4569259608067568, 521.7544086132262464}}},
|
| 14 | seg=1 {{{286.695129f, 291}, {229.304855f, 561}}}
|
| 15 | seg=2 {{{229.304855f, 561}, {979.304871f, 561}}}
|
| 16 | seg=3 {{{979.304871f, 561}, {1036.69507f, 291}}}
|
| 17 | seg=4 {{{1036.69507f, 291}, {286.695129f, 291}}}
|
| 18 | op sect
|
| 19 | seg=5 {{{1006.69513f, 291}, {1023.26367f, 291}, {1033.84021f, 304.431458f}, {1030.31836f, 321}}}
|
| 20 | seg=6 {{{1030.31836f, 321}, {985.681519f, 531}}}
|
| 21 | seg=7 {{{985.681519f, 531}, {982.15979f, 547.568542f}, {965.873413f, 561}, {949.304871f, 561}}}
|
| 22 | seg=8 {{{949.304871f, 561}, {259.304871f, 561}}}
|
| 23 | seg=9 {{{259.304871f, 561}, {242.736313f, 561}, {232.159805f, 547.568542f}, {235.681549f, 531}}}
|
| 24 | seg=10 {{{235.681549f, 531}, {280.31842f, 321}}}
|
| 25 | seg=11 {{{280.31842f, 321}, {283.840179f, 304.431458f}, {300.126587f, 291}, {316.695129f, 291}}}
|
| 26 | seg=12 {{{316.695129f, 291}, {1006.69513f, 291}}}
|
| 27 | debugShowLineIntersection wtTs[0]=1 {{{286.695129,291}, {229.304855,561}}} {{229.304855,561}} wnTs[0]=0 {{{229.304855,561}, {979.304871,561}}}
|
| 28 | debugShowLineIntersection wtTs[0]=0 {{{286.695129,291}, {229.304855,561}}} {{286.695129,291}} wnTs[0]=1 {{{1036.69507,291}, {286.695129,291}}}
|
| 29 | debugShowLineIntersection wtTs[0]=0 {{{979.304871,561}, {1036.69507,291}}} {{979.304871,561}} wnTs[0]=1 {{{229.304855,561}, {979.304871,561}}}
|
| 30 | debugShowLineIntersection wtTs[0]=1 {{{979.304871,561}, {1036.69507,291}}} {{1036.69507,291}} wnTs[0]=0 {{{1036.69507,291}, {286.695129,291}}}
|
| 31 | debugShowLineIntersection no intersect {{{286.695129,291}, {229.304855,561}}} {{{949.304871,561}, {259.304871,561}}}
|
| 32 | debugShowCubicLineIntersection wtTs[0]=0.999710227 {{{259.304871,561}, {242.736313,561}, {232.159805,547.568542}, {235.681549,531}}} {{235.678497,531.014404}} wtTs[1]=1 {{235.681549,531}} wnTs[0]=0.888942 {{{286.695129,291}, {229.304855,561}}} wnTs[1]=0.888888891
|
| 33 | SkOpSegment::addT insert t=0.888942232 segID=1 spanID=25
|
| 34 | SkOpSegment::addT insert t=0.999710227 segID=9 spanID=26
|
| 35 | SkOpSegment::addT insert t=0.888888891 segID=1 spanID=27
|
| 36 | debugShowLineIntersection wtTs[0]=0.11111112 {{{286.695129,291}, {229.304855,561}}} {{280.31842,321}} wtTs[1]=0.888888891 {{235.681549,531}} wnTs[0]=1 {{{235.681549,531}, {280.31842,321}}} wnTs[1]=0
|
| 37 | SkOpSegment::addT insert t=0.11111112 segID=1 spanID=28
|
| 38 | debugShowCubicLineIntersection wtTs[0]=0 {{{280.31842,321}, {283.840179,304.431458}, {300.126587,291}, {316.695129,291}}} {{280.31842,321}} wtTs[1]=0.000542504226 {{280.324158,320.973022}} wnTs[0]=0.111111 {{{286.695129,291}, {229.304855,561}}} wnTs[1]=0.111011249
|
| 39 | SkOpSegment::addT insert t=0.111011249 segID=1 spanID=29
|
| 40 | SkOpSegment::addT insert t=0.000542504226 segID=11 spanID=30
|
| 41 | debugShowCubicLineIntersection wtTs[0]=1 {{{985.681519,531}, {982.15979,547.568542}, {965.873413,561}, {949.304871,561}}} {{949.304871,561}} wnTs[0]=0.96 {{{229.304855,561}, {979.304871,561}}}
|
| 42 | SkOpSegment::addT insert t=0.960000001 segID=2 spanID=31
|
| 43 | debugShowLineIntersection wtTs[0]=0 {{{949.304871,561}, {259.304871,561}}} {{949.304871,561}} wtTs[1]=1 {{259.304871,561}} wnTs[0]=0.96 {{{229.304855,561}, {979.304871,561}}} wnTs[1]=0.0400000195
|
| 44 | SkOpSegment::addT insert t=0.0400000195 segID=2 spanID=32
|
| 45 | debugShowCubicLineIntersection wtTs[0]=0 {{{259.304871,561}, {242.736313,561}, {232.159805,547.568542}, {235.681549,531}}} {{259.304871,561}} wnTs[0]=0.04 {{{229.304855,561}, {979.304871,561}}}
|
| 46 | debugShowCubicLineIntersection wtTs[0]=1 {{{1006.69513,291}, {1023.26367,291}, {1033.84021,304.431458}, {1030.31836,321}}} {{1030.31836,321}} wnTs[0]=0.888889 {{{979.304871,561}, {1036.69507,291}}}
|
| 47 | SkOpSegment::addT insert t=0.888888874 segID=3 spanID=33
|
| 48 | debugShowLineIntersection wtTs[0]=0.11111108 {{{979.304871,561}, {1036.69507,291}}} {{985.681519,531}} wtTs[1]=0.888888874 {{1030.31836,321}} wnTs[0]=1 {{{1030.31836,321}, {985.681519,531}}} wnTs[1]=0
|
| 49 | SkOpSegment::addT insert t=0.11111108 segID=3 spanID=34
|
| 50 | debugShowCubicLineIntersection wtTs[0]=0 {{{985.681519,531}, {982.15979,547.568542}, {965.873413,561}, {949.304871,561}}} {{985.681519,531}} wnTs[0]=0.111111 {{{979.304871,561}, {1036.69507,291}}}
|
| 51 | debugShowLineIntersection no intersect {{{979.304871,561}, {1036.69507,291}}} {{{316.695129,291}, {1006.69513,291}}}
|
| 52 | debugShowCubicLineIntersection wtTs[0]=0 {{{1006.69513,291}, {1023.26367,291}, {1033.84021,304.431458}, {1030.31836,321}}} {{1006.69513,291}} wnTs[0]=0.0399999 {{{1036.69507,291}, {286.695129,291}}}
|
| 53 | SkOpSegment::addT insert t=0.0399999219 segID=4 spanID=35
|
| 54 | debugShowCubicLineIntersection wtTs[0]=1 {{{280.31842,321}, {283.840179,304.431458}, {300.126587,291}, {316.695129,291}}} {{316.695129,291}} wnTs[0]=0.96 {{{1036.69507,291}, {286.695129,291}}}
|
| 55 | SkOpSegment::addT insert t=0.959999997 segID=4 spanID=36
|
| 56 | debugShowLineIntersection wtTs[0]=0 {{{316.695129,291}, {1006.69513,291}}} {{316.695129,291}} wtTs[1]=1 {{1006.69513,291}} wnTs[0]=0.96 {{{1036.69507,291}, {286.695129,291}}} wnTs[1]=0.0399999219
|
| 57 | debugShowCubicLineIntersection wtTs[0]=1 {{{1006.69513,291}, {1023.26367,291}, {1033.84021,304.431458}, {1030.31836,321}}} {{1030.31836,321}} wnTs[0]=0 {{{1030.31836,321}, {985.681519,531}}}
|
| 58 | debugShowCubicLineIntersection wtTs[0]=0 {{{1006.69513,291}, {1023.26367,291}, {1033.84021,304.431458}, {1030.31836,321}}} {{1006.69513,291}} wnTs[0]=1 {{{316.695129,291}, {1006.69513,291}}}
|
| 59 | debugShowCubicLineIntersection wtTs[0]=0 {{{985.681519,531}, {982.15979,547.568542}, {965.873413,561}, {949.304871,561}}} {{985.681519,531}} wnTs[0]=1 {{{1030.31836,321}, {985.681519,531}}}
|
| 60 | debugShowCubicLineIntersection wtTs[0]=1 {{{985.681519,531}, {982.15979,547.568542}, {965.873413,561}, {949.304871,561}}} {{949.304871,561}} wnTs[0]=0 {{{949.304871,561}, {259.304871,561}}}
|
| 61 | debugShowCubicLineIntersection wtTs[0]=0 {{{259.304871,561}, {242.736313,561}, {232.159805,547.568542}, {235.681549,531}}} {{259.304871,561}} wnTs[0]=1 {{{949.304871,561}, {259.304871,561}}}
|
| 62 | debugShowCubicLineIntersection wtTs[0]=1 {{{259.304871,561}, {242.736313,561}, {232.159805,547.568542}, {235.681549,531}}} {{235.681549,531}} wnTs[0]=0 {{{235.681549,531}, {280.31842,321}}}
|
| 63 | debugShowCubicLineIntersection wtTs[0]=0 {{{280.31842,321}, {283.840179,304.431458}, {300.126587,291}, {316.695129,291}}} {{280.31842,321}} wnTs[0]=1 {{{235.681549,531}, {280.31842,321}}}
|
| 64 | debugShowCubicLineIntersection wtTs[0]=1 {{{280.31842,321}, {283.840179,304.431458}, {300.126587,291}, {316.695129,291}}} {{316.695129,291}} wnTs[0]=0 {{{316.695129,291}, {1006.69513,291}}}
|
| 65 | -----------------xx--x---------------- addExpanded
|
| 66 | 00: coinSeg/Span/PtT=12/23/23 endSpan=24 Fail
|
| 67 | 01: coinSeg/Span/PtT=3/34/34 endSpan=33 Fail
|
| 68 | 02: coinSeg/Span/PtT=2/32/32 endSpan=31 Fail
|
| 69 | 03: coinSeg/Span/PtT=1/29/29 endSpan=28 Fail
|
| 70 | 04: coinSeg/Span/PtT=10/19/19 endSpan=20 Fail
|
| 71 | 05: coinSeg/Span/PtT=1/27/27 endSpan=25 Fail
|
| 72 | 06: seg/base=12/23 seg/base=4/35 MarkCoinStart
|
| 73 | 07: seg/base=12/24 seg/base=4/36 MarkCoinEnd
|
| 74 | 08: seg/base=3/34 seg/base=6/11 MarkCoinStart
|
| 75 | 09: seg/base=3/33 seg/base=6/12 MarkCoinEnd
|
| 76 | 10: seg/base=2/32 seg/base=8/15 MarkCoinStart
|
| 77 | 11: seg/base=2/31 seg/base=8/16 MarkCoinEnd
|
| 78 | 12: seg/base=1/29 seg/base=11/21 MarkCoinStart
|
| 79 | 13: seg/base=1/28 seg/base=11/30 MarkCoinEnd
|
| 80 | 14: seg/base=10/19 seg/base=1/28 MarkCoinStart
|
| 81 | 15: seg/base=10/20 seg/base=1/27 MarkCoinEnd
|
| 82 | 16: seg/base=1/27 seg/base=9/26 MarkCoinStart
|
| 83 | 17: seg/base=1/25 seg/base=9/18 MarkCoinEnd
|
| 84 | SkOpSegment::debugShowActiveSpans id=1 (286.695129,291 280.324158,320.973022) t=0 tEnd=0.111011249 windSum=? windValue=1
|
| 85 | SkOpSegment::debugShowActiveSpans id=1 (280.324158,320.973022 280.31842,321) t=0.111011249 tEnd=0.11111112 windSum=? windValue=1
|
| 86 | SkOpSegment::debugShowActiveSpans id=1 (280.31842,321 235.681549,531) t=0.11111112 tEnd=0.888888891 windSum=? windValue=1
|
| 87 | SkOpSegment::debugShowActiveSpans id=1 (235.681549,531 235.678497,531.014404) t=0.888888891 tEnd=0.888942232 windSum=? windValue=1
|
| 88 | SkOpSegment::debugShowActiveSpans id=1 (235.678497,531.014404 229.304855,561) t=0.888942232 tEnd=1 windSum=? windValue=1
|
| 89 | SkOpSegment::debugShowActiveSpans id=2 (229.304855,561 259.304871,561) t=0 tEnd=0.0400000195 windSum=? windValue=1
|
| 90 | SkOpSegment::debugShowActiveSpans id=2 (259.304871,561 949.304871,561) t=0.0400000195 tEnd=0.960000001 windSum=? windValue=1
|
| 91 | SkOpSegment::debugShowActiveSpans id=2 (949.304871,561 979.304871,561) t=0.960000001 tEnd=1 windSum=? windValue=1
|
| 92 | SkOpSegment::debugShowActiveSpans id=3 (979.304871,561 985.68158,531) t=0 tEnd=0.11111108 windSum=? windValue=1
|
| 93 | SkOpSegment::debugShowActiveSpans id=3 (985.68158,531 1030.31836,321) t=0.11111108 tEnd=0.888888874 windSum=? windValue=1
|
| 94 | SkOpSegment::debugShowActiveSpans id=3 (1030.31836,321 1036.69507,291) t=0.888888874 tEnd=1 windSum=? windValue=1
|
| 95 | SkOpSegment::debugShowActiveSpans id=4 (1036.69507,291 1006.69513,291) t=0 tEnd=0.0399999219 windSum=? windValue=1
|
| 96 | SkOpSegment::debugShowActiveSpans id=4 (1006.69513,291 316.695129,291) t=0.0399999219 tEnd=0.959999997 windSum=? windValue=1
|
| 97 | SkOpSegment::debugShowActiveSpans id=4 (316.695129,291 286.695129,291) t=0.959999997 tEnd=1 windSum=? windValue=1
|
| 98 | SkOpSegment::debugShowActiveSpans id=5 (1006.69513,291 1023.26367,291 1033.84021,304.431458 1030.31836,321) t=0 tEnd=1 windSum=? windValue=1
|
| 99 | SkOpSegment::debugShowActiveSpans id=6 (1030.31836,321 985.681519,531) t=0 tEnd=1 windSum=? windValue=1
|
| 100 | SkOpSegment::debugShowActiveSpans id=7 (985.681519,531 982.15979,547.568542 965.873413,561 949.304871,561) t=0 tEnd=1 windSum=? windValue=1
|
| 101 | SkOpSegment::debugShowActiveSpans id=8 (949.304871,561 259.304871,561) t=0 tEnd=1 windSum=? windValue=1
|
| 102 | SkOpSegment::debugShowActiveSpans id=9 (259.304871,561 242.741114,561 232.165942,547.576327 235.678497,531.014404) t=0 tEnd=0.999710227 windSum=? windValue=1
|
| 103 | SkOpSegment::debugShowActiveSpans id=9 (235.678497,531.014404 235.679515,531.009604 235.680529,531.004801 235.681549,531) t=0.999710227 tEnd=1 windSum=? windValue=1
|
| 104 | SkOpSegment::debugShowActiveSpans id=10 (235.681549,531 280.31842,321) t=0 tEnd=1 windSum=? windValue=1
|
| 105 | SkOpSegment::debugShowActiveSpans id=11 (280.31842,321 280.320331,320.991011 280.32224,320.982009 280.324158,320.973022) t=0 tEnd=0.000542504226 windSum=? windValue=1
|
| 106 | SkOpSegment::debugShowActiveSpans id=11 (280.324158,320.973022 283.857845,304.416873 300.135575,291 316.695129,291) t=0.000542504226 tEnd=1 windSum=? windValue=1
|
| 107 | SkOpSegment::debugShowActiveSpans id=12 (316.695129,291 1006.69513,291) t=0 tEnd=1 windSum=? windValue=1
|
| 108 | -----------------xx--x---------------- move_multiples
|
| 109 | 00: coinSeg/Span/PtT=12/23/23 endSpan=24 Fail
|
| 110 | 01: coinSeg/Span/PtT=3/34/34 endSpan=33 Fail
|
| 111 | 02: coinSeg/Span/PtT=2/32/32 endSpan=31 Fail
|
| 112 | 03: coinSeg/Span/PtT=1/29/29 endSpan=28 Fail
|
| 113 | 04: coinSeg/Span/PtT=10/19/19 endSpan=20 Fail
|
| 114 | 05: coinSeg/Span/PtT=1/27/27 endSpan=25 Fail
|
| 115 | 06: seg/base=12/23 seg/base=4/35 MarkCoinStart
|
| 116 | 07: seg/base=12/24 seg/base=4/36 MarkCoinEnd
|
| 117 | 08: seg/base=3/34 seg/base=6/11 MarkCoinStart
|
| 118 | 09: seg/base=3/33 seg/base=6/12 MarkCoinEnd
|
| 119 | 10: seg/base=2/32 seg/base=8/15 MarkCoinStart
|
| 120 | 11: seg/base=2/31 seg/base=8/16 MarkCoinEnd
|
| 121 | 12: seg/base=1/29 seg/base=11/21 MarkCoinStart
|
| 122 | 13: seg/base=1/28 seg/base=11/30 MarkCoinEnd
|
| 123 | 14: seg/base=10/19 seg/base=1/28 MarkCoinStart
|
| 124 | 15: seg/base=10/20 seg/base=1/27 MarkCoinEnd
|
| 125 | 16: seg/base=1/27 seg/base=9/26 MarkCoinStart
|
| 126 | 17: seg/base=1/25 seg/base=9/18 MarkCoinEnd
|
| 127 | SkOpSegment::debugShowActiveSpans id=1 (286.695129,291 280.324158,320.973022) t=0 tEnd=0.111011249 windSum=? windValue=1
|
| 128 | SkOpSegment::debugShowActiveSpans id=1 (280.324158,320.973022 280.31842,321) t=0.111011249 tEnd=0.11111112 windSum=? windValue=1
|
| 129 | SkOpSegment::debugShowActiveSpans id=1 (280.31842,321 235.681549,531) t=0.11111112 tEnd=0.888888891 windSum=? windValue=1
|
| 130 | SkOpSegment::debugShowActiveSpans id=1 (235.681549,531 235.678497,531.014404) t=0.888888891 tEnd=0.888942232 windSum=? windValue=1
|
| 131 | SkOpSegment::debugShowActiveSpans id=1 (235.678497,531.014404 229.304855,561) t=0.888942232 tEnd=1 windSum=? windValue=1
|
| 132 | SkOpSegment::debugShowActiveSpans id=2 (229.304855,561 259.304871,561) t=0 tEnd=0.0400000195 windSum=? windValue=1
|
| 133 | SkOpSegment::debugShowActiveSpans id=2 (259.304871,561 949.304871,561) t=0.0400000195 tEnd=0.960000001 windSum=? windValue=1
|
| 134 | SkOpSegment::debugShowActiveSpans id=2 (949.304871,561 979.304871,561) t=0.960000001 tEnd=1 windSum=? windValue=1
|
| 135 | SkOpSegment::debugShowActiveSpans id=3 (979.304871,561 985.68158,531) t=0 tEnd=0.11111108 windSum=? windValue=1
|
| 136 | SkOpSegment::debugShowActiveSpans id=3 (985.68158,531 1030.31836,321) t=0.11111108 tEnd=0.888888874 windSum=? windValue=1
|
| 137 | SkOpSegment::debugShowActiveSpans id=3 (1030.31836,321 1036.69507,291) t=0.888888874 tEnd=1 windSum=? windValue=1
|
| 138 | SkOpSegment::debugShowActiveSpans id=4 (1036.69507,291 1006.69513,291) t=0 tEnd=0.0399999219 windSum=? windValue=1
|
| 139 | SkOpSegment::debugShowActiveSpans id=4 (1006.69513,291 316.695129,291) t=0.0399999219 tEnd=0.959999997 windSum=? windValue=1
|
| 140 | SkOpSegment::debugShowActiveSpans id=4 (316.695129,291 286.695129,291) t=0.959999997 tEnd=1 windSum=? windValue=1
|
| 141 | SkOpSegment::debugShowActiveSpans id=5 (1006.69513,291 1023.26367,291 1033.84021,304.431458 1030.31836,321) t=0 tEnd=1 windSum=? windValue=1
|
| 142 | SkOpSegment::debugShowActiveSpans id=6 (1030.31836,321 985.681519,531) t=0 tEnd=1 windSum=? windValue=1
|
| 143 | SkOpSegment::debugShowActiveSpans id=7 (985.681519,531 982.15979,547.568542 965.873413,561 949.304871,561) t=0 tEnd=1 windSum=? windValue=1
|
| 144 | SkOpSegment::debugShowActiveSpans id=8 (949.304871,561 259.304871,561) t=0 tEnd=1 windSum=? windValue=1
|
| 145 | SkOpSegment::debugShowActiveSpans id=9 (259.304871,561 242.741114,561 232.165942,547.576327 235.678497,531.014404) t=0 tEnd=0.999710227 windSum=? windValue=1
|
| 146 | SkOpSegment::debugShowActiveSpans id=9 (235.678497,531.014404 235.679515,531.009604 235.680529,531.004801 235.681549,531) t=0.999710227 tEnd=1 windSum=? windValue=1
|
| 147 | SkOpSegment::debugShowActiveSpans id=10 (235.681549,531 280.31842,321) t=0 tEnd=1 windSum=? windValue=1
|
| 148 | SkOpSegment::debugShowActiveSpans id=11 (280.31842,321 280.320331,320.991011 280.32224,320.982009 280.324158,320.973022) t=0 tEnd=0.000542504226 windSum=? windValue=1
|
| 149 | SkOpSegment::debugShowActiveSpans id=11 (280.324158,320.973022 283.857845,304.416873 300.135575,291 316.695129,291) t=0.000542504226 tEnd=1 windSum=? windValue=1
|
| 150 | SkOpSegment::debugShowActiveSpans id=12 (316.695129,291 1006.69513,291) t=0 tEnd=1 windSum=? windValue=1
|
| 151 | -----------------xx--x---------------- move_nearby
|
| 152 | 00: coinSeg/Span/PtT=12/23/23 endSpan=24 Fail
|
| 153 | 01: coinSeg/Span/PtT=3/34/34 endSpan=33 Fail
|
| 154 | 02: coinSeg/Span/PtT=2/32/32 endSpan=31 Fail
|
| 155 | 03: coinSeg/Span/PtT=1/29/29 endSpan=28 Fail
|
| 156 | 04: coinSeg/Span/PtT=10/19/19 endSpan=20 Fail
|
| 157 | 05: coinSeg/Span/PtT=1/27/27 endSpan=25 Fail
|
| 158 | 06: seg/base=12/23 seg/base=4/35 MarkCoinStart
|
| 159 | 07: seg/base=12/24 seg/base=4/36 MarkCoinEnd
|
| 160 | 08: seg/base=3/34 seg/base=6/11 MarkCoinStart
|
| 161 | 09: seg/base=3/33 seg/base=6/12 MarkCoinEnd
|
| 162 | 10: seg/base=2/32 seg/base=8/15 MarkCoinStart
|
| 163 | 11: seg/base=2/31 seg/base=8/16 MarkCoinEnd
|
| 164 | 12: seg/base=1/29 seg/base=11/21 MarkCoinStart
|
| 165 | 13: seg/base=1/28 seg/base=11/30 MarkCoinEnd
|
| 166 | 14: seg/base=10/19 seg/base=1/28 MarkCoinStart
|
| 167 | 15: seg/base=10/20 seg/base=1/27 MarkCoinEnd
|
| 168 | 16: seg/base=1/27 seg/base=9/26 MarkCoinStart
|
| 169 | 17: seg/base=1/25 seg/base=9/18 MarkCoinEnd
|
| 170 | SkOpSegment::debugShowActiveSpans id=1 (286.695129,291 280.324158,320.973022) t=0 tEnd=0.111011249 windSum=? windValue=1
|
| 171 | SkOpSegment::debugShowActiveSpans id=1 (280.324158,320.973022 280.31842,321) t=0.111011249 tEnd=0.11111112 windSum=? windValue=1
|
| 172 | SkOpSegment::debugShowActiveSpans id=1 (280.31842,321 235.681549,531) t=0.11111112 tEnd=0.888888891 windSum=? windValue=1
|
| 173 | SkOpSegment::debugShowActiveSpans id=1 (235.681549,531 235.678497,531.014404) t=0.888888891 tEnd=0.888942232 windSum=? windValue=1
|
| 174 | SkOpSegment::debugShowActiveSpans id=1 (235.678497,531.014404 229.304855,561) t=0.888942232 tEnd=1 windSum=? windValue=1
|
| 175 | SkOpSegment::debugShowActiveSpans id=2 (229.304855,561 259.304871,561) t=0 tEnd=0.0400000195 windSum=? windValue=1
|
| 176 | SkOpSegment::debugShowActiveSpans id=2 (259.304871,561 949.304871,561) t=0.0400000195 tEnd=0.960000001 windSum=? windValue=1
|
| 177 | SkOpSegment::debugShowActiveSpans id=2 (949.304871,561 979.304871,561) t=0.960000001 tEnd=1 windSum=? windValue=1
|
| 178 | SkOpSegment::debugShowActiveSpans id=3 (979.304871,561 985.68158,531) t=0 tEnd=0.11111108 windSum=? windValue=1
|
| 179 | SkOpSegment::debugShowActiveSpans id=3 (985.68158,531 1030.31836,321) t=0.11111108 tEnd=0.888888874 windSum=? windValue=1
|
| 180 | SkOpSegment::debugShowActiveSpans id=3 (1030.31836,321 1036.69507,291) t=0.888888874 tEnd=1 windSum=? windValue=1
|
| 181 | SkOpSegment::debugShowActiveSpans id=4 (1036.69507,291 1006.69513,291) t=0 tEnd=0.0399999219 windSum=? windValue=1
|
| 182 | SkOpSegment::debugShowActiveSpans id=4 (1006.69513,291 316.695129,291) t=0.0399999219 tEnd=0.959999997 windSum=? windValue=1
|
| 183 | SkOpSegment::debugShowActiveSpans id=4 (316.695129,291 286.695129,291) t=0.959999997 tEnd=1 windSum=? windValue=1
|
| 184 | SkOpSegment::debugShowActiveSpans id=5 (1006.69513,291 1023.26367,291 1033.84021,304.431458 1030.31836,321) t=0 tEnd=1 windSum=? windValue=1
|
| 185 | SkOpSegment::debugShowActiveSpans id=6 (1030.31836,321 985.681519,531) t=0 tEnd=1 windSum=? windValue=1
|
| 186 | SkOpSegment::debugShowActiveSpans id=7 (985.681519,531 982.15979,547.568542 965.873413,561 949.304871,561) t=0 tEnd=1 windSum=? windValue=1
|
| 187 | SkOpSegment::debugShowActiveSpans id=8 (949.304871,561 259.304871,561) t=0 tEnd=1 windSum=? windValue=1
|
| 188 | SkOpSegment::debugShowActiveSpans id=9 (259.304871,561 242.741114,561 232.165942,547.576327 235.678497,531.014404) t=0 tEnd=0.999710227 windSum=? windValue=1
|
| 189 | SkOpSegment::debugShowActiveSpans id=9 (235.678497,531.014404 235.679515,531.009604 235.680529,531.004801 235.681549,531) t=0.999710227 tEnd=1 windSum=? windValue=1
|
| 190 | SkOpSegment::debugShowActiveSpans id=10 (235.681549,531 280.31842,321) t=0 tEnd=1 windSum=? windValue=1
|
| 191 | SkOpSegment::debugShowActiveSpans id=11 (280.31842,321 280.320331,320.991011 280.32224,320.982009 280.324158,320.973022) t=0 tEnd=0.000542504226 windSum=? windValue=1
|
| 192 | SkOpSegment::debugShowActiveSpans id=11 (280.324158,320.973022 283.857845,304.416873 300.135575,291 316.695129,291) t=0.000542504226 tEnd=1 windSum=? windValue=1
|
| 193 | SkOpSegment::debugShowActiveSpans id=12 (316.695129,291 1006.69513,291) t=0 tEnd=1 windSum=? windValue=1
|
| 194 | -----------------xx--x---------------- correctEnds
|
| 195 | 00: coinSeg/Span/PtT=12/23/23 endSpan=24 Fail
|
| 196 | 01: coinSeg/Span/PtT=3/34/34 endSpan=33 Fail
|
| 197 | 02: coinSeg/Span/PtT=2/32/32 endSpan=31 Fail
|
| 198 | 03: coinSeg/Span/PtT=1/29/29 endSpan=28 Fail
|
| 199 | 04: coinSeg/Span/PtT=10/19/19 endSpan=20 Fail
|
| 200 | 05: coinSeg/Span/PtT=1/27/27 endSpan=25 Fail
|
| 201 | 06: seg/base=12/23 seg/base=4/35 MarkCoinStart
|
| 202 | 07: seg/base=12/24 seg/base=4/36 MarkCoinEnd
|
| 203 | 08: seg/base=3/34 seg/base=6/11 MarkCoinStart
|
| 204 | 09: seg/base=3/33 seg/base=6/12 MarkCoinEnd
|
| 205 | 10: seg/base=2/32 seg/base=8/15 MarkCoinStart
|
| 206 | 11: seg/base=2/31 seg/base=8/16 MarkCoinEnd
|
| 207 | 12: seg/base=1/29 seg/base=11/21 MarkCoinStart
|
| 208 | 13: seg/base=1/28 seg/base=11/30 MarkCoinEnd
|
| 209 | 14: seg/base=10/19 seg/base=1/28 MarkCoinStart
|
| 210 | 15: seg/base=10/20 seg/base=1/27 MarkCoinEnd
|
| 211 | 16: seg/base=1/27 seg/base=9/26 MarkCoinStart
|
| 212 | 17: seg/base=1/25 seg/base=9/18 MarkCoinEnd
|
| 213 | SkOpSegment::debugShowActiveSpans id=1 (286.695129,291 280.324158,320.973022) t=0 tEnd=0.111011249 windSum=? windValue=1
|
| 214 | SkOpSegment::debugShowActiveSpans id=1 (280.324158,320.973022 280.31842,321) t=0.111011249 tEnd=0.11111112 windSum=? windValue=1
|
| 215 | SkOpSegment::debugShowActiveSpans id=1 (280.31842,321 235.681549,531) t=0.11111112 tEnd=0.888888891 windSum=? windValue=1
|
| 216 | SkOpSegment::debugShowActiveSpans id=1 (235.681549,531 235.678497,531.014404) t=0.888888891 tEnd=0.888942232 windSum=? windValue=1
|
| 217 | SkOpSegment::debugShowActiveSpans id=1 (235.678497,531.014404 229.304855,561) t=0.888942232 tEnd=1 windSum=? windValue=1
|
| 218 | SkOpSegment::debugShowActiveSpans id=2 (229.304855,561 259.304871,561) t=0 tEnd=0.0400000195 windSum=? windValue=1
|
| 219 | SkOpSegment::debugShowActiveSpans id=2 (259.304871,561 949.304871,561) t=0.0400000195 tEnd=0.960000001 windSum=? windValue=1
|
| 220 | SkOpSegment::debugShowActiveSpans id=2 (949.304871,561 979.304871,561) t=0.960000001 tEnd=1 windSum=? windValue=1
|
| 221 | SkOpSegment::debugShowActiveSpans id=3 (979.304871,561 985.68158,531) t=0 tEnd=0.11111108 windSum=? windValue=1
|
| 222 | SkOpSegment::debugShowActiveSpans id=3 (985.68158,531 1030.31836,321) t=0.11111108 tEnd=0.888888874 windSum=? windValue=1
|
| 223 | SkOpSegment::debugShowActiveSpans id=3 (1030.31836,321 1036.69507,291) t=0.888888874 tEnd=1 windSum=? windValue=1
|
| 224 | SkOpSegment::debugShowActiveSpans id=4 (1036.69507,291 1006.69513,291) t=0 tEnd=0.0399999219 windSum=? windValue=1
|
| 225 | SkOpSegment::debugShowActiveSpans id=4 (1006.69513,291 316.695129,291) t=0.0399999219 tEnd=0.959999997 windSum=? windValue=1
|
| 226 | SkOpSegment::debugShowActiveSpans id=4 (316.695129,291 286.695129,291) t=0.959999997 tEnd=1 windSum=? windValue=1
|
| 227 | SkOpSegment::debugShowActiveSpans id=5 (1006.69513,291 1023.26367,291 1033.84021,304.431458 1030.31836,321) t=0 tEnd=1 windSum=? windValue=1
|
| 228 | SkOpSegment::debugShowActiveSpans id=6 (1030.31836,321 985.681519,531) t=0 tEnd=1 windSum=? windValue=1
|
| 229 | SkOpSegment::debugShowActiveSpans id=7 (985.681519,531 982.15979,547.568542 965.873413,561 949.304871,561) t=0 tEnd=1 windSum=? windValue=1
|
| 230 | SkOpSegment::debugShowActiveSpans id=8 (949.304871,561 259.304871,561) t=0 tEnd=1 windSum=? windValue=1
|
| 231 | SkOpSegment::debugShowActiveSpans id=9 (259.304871,561 242.741114,561 232.165942,547.576327 235.678497,531.014404) t=0 tEnd=0.999710227 windSum=? windValue=1
|
| 232 | SkOpSegment::debugShowActiveSpans id=9 (235.678497,531.014404 235.679515,531.009604 235.680529,531.004801 235.681549,531) t=0.999710227 tEnd=1 windSum=? windValue=1
|
| 233 | SkOpSegment::debugShowActiveSpans id=10 (235.681549,531 280.31842,321) t=0 tEnd=1 windSum=? windValue=1
|
| 234 | SkOpSegment::debugShowActiveSpans id=11 (280.31842,321 280.320331,320.991011 280.32224,320.982009 280.324158,320.973022) t=0 tEnd=0.000542504226 windSum=? windValue=1
|
| 235 | SkOpSegment::debugShowActiveSpans id=11 (280.324158,320.973022 283.857845,304.416873 300.135575,291 316.695129,291) t=0.000542504226 tEnd=1 windSum=? windValue=1
|
| 236 | SkOpSegment::debugShowActiveSpans id=12 (316.695129,291 1006.69513,291) t=0 tEnd=1 windSum=? windValue=1
|
| 237 | -----------------xx--x---------------- addEndMovedSpans
|
| 238 | 00: coinSeg/Span/PtT=12/23/23 endSpan=24 Fail
|
| 239 | 01: coinSeg/Span/PtT=3/34/34 endSpan=33 Fail
|
| 240 | 02: coinSeg/Span/PtT=2/32/32 endSpan=31 Fail
|
| 241 | 03: coinSeg/Span/PtT=1/29/29 endSpan=28 Fail
|
| 242 | 04: coinSeg/Span/PtT=10/19/19 endSpan=20 Fail
|
| 243 | 05: coinSeg/Span/PtT=1/27/27 endSpan=25 Fail
|
| 244 | 06: seg/base=12/23 seg/base=4/35 MarkCoinStart
|
| 245 | 07: seg/base=12/24 seg/base=4/36 MarkCoinEnd
|
| 246 | 08: seg/base=3/34 seg/base=6/11 MarkCoinStart
|
| 247 | 09: seg/base=3/33 seg/base=6/12 MarkCoinEnd
|
| 248 | 10: seg/base=2/32 seg/base=8/15 MarkCoinStart
|
| 249 | 11: seg/base=2/31 seg/base=8/16 MarkCoinEnd
|
| 250 | 12: seg/base=1/29 seg/base=11/21 MarkCoinStart
|
| 251 | 13: seg/base=1/28 seg/base=11/30 MarkCoinEnd
|
| 252 | 14: seg/base=10/19 seg/base=1/28 MarkCoinStart
|
| 253 | 15: seg/base=10/20 seg/base=1/27 MarkCoinEnd
|
| 254 | 16: seg/base=1/27 seg/base=9/26 MarkCoinStart
|
| 255 | 17: seg/base=1/25 seg/base=9/18 MarkCoinEnd
|
| 256 | SkOpSegment::debugShowActiveSpans id=1 (286.695129,291 280.324158,320.973022) t=0 tEnd=0.111011249 windSum=? windValue=1
|
| 257 | SkOpSegment::debugShowActiveSpans id=1 (280.324158,320.973022 280.31842,321) t=0.111011249 tEnd=0.11111112 windSum=? windValue=1
|
| 258 | SkOpSegment::debugShowActiveSpans id=1 (280.31842,321 235.681549,531) t=0.11111112 tEnd=0.888888891 windSum=? windValue=1
|
| 259 | SkOpSegment::debugShowActiveSpans id=1 (235.681549,531 235.678497,531.014404) t=0.888888891 tEnd=0.888942232 windSum=? windValue=1
|
| 260 | SkOpSegment::debugShowActiveSpans id=1 (235.678497,531.014404 229.304855,561) t=0.888942232 tEnd=1 windSum=? windValue=1
|
| 261 | SkOpSegment::debugShowActiveSpans id=2 (229.304855,561 259.304871,561) t=0 tEnd=0.0400000195 windSum=? windValue=1
|
| 262 | SkOpSegment::debugShowActiveSpans id=2 (259.304871,561 949.304871,561) t=0.0400000195 tEnd=0.960000001 windSum=? windValue=1
|
| 263 | SkOpSegment::debugShowActiveSpans id=2 (949.304871,561 979.304871,561) t=0.960000001 tEnd=1 windSum=? windValue=1
|
| 264 | SkOpSegment::debugShowActiveSpans id=3 (979.304871,561 985.68158,531) t=0 tEnd=0.11111108 windSum=? windValue=1
|
| 265 | SkOpSegment::debugShowActiveSpans id=3 (985.68158,531 1030.31836,321) t=0.11111108 tEnd=0.888888874 windSum=? windValue=1
|
| 266 | SkOpSegment::debugShowActiveSpans id=3 (1030.31836,321 1036.69507,291) t=0.888888874 tEnd=1 windSum=? windValue=1
|
| 267 | SkOpSegment::debugShowActiveSpans id=4 (1036.69507,291 1006.69513,291) t=0 tEnd=0.0399999219 windSum=? windValue=1
|
| 268 | SkOpSegment::debugShowActiveSpans id=4 (1006.69513,291 316.695129,291) t=0.0399999219 tEnd=0.959999997 windSum=? windValue=1
|
| 269 | SkOpSegment::debugShowActiveSpans id=4 (316.695129,291 286.695129,291) t=0.959999997 tEnd=1 windSum=? windValue=1
|
| 270 | SkOpSegment::debugShowActiveSpans id=5 (1006.69513,291 1023.26367,291 1033.84021,304.431458 1030.31836,321) t=0 tEnd=1 windSum=? windValue=1
|
| 271 | SkOpSegment::debugShowActiveSpans id=6 (1030.31836,321 985.681519,531) t=0 tEnd=1 windSum=? windValue=1
|
| 272 | SkOpSegment::debugShowActiveSpans id=7 (985.681519,531 982.15979,547.568542 965.873413,561 949.304871,561) t=0 tEnd=1 windSum=? windValue=1
|
| 273 | SkOpSegment::debugShowActiveSpans id=8 (949.304871,561 259.304871,561) t=0 tEnd=1 windSum=? windValue=1
|
| 274 | SkOpSegment::debugShowActiveSpans id=9 (259.304871,561 242.741114,561 232.165942,547.576327 235.678497,531.014404) t=0 tEnd=0.999710227 windSum=? windValue=1
|
| 275 | SkOpSegment::debugShowActiveSpans id=9 (235.678497,531.014404 235.679515,531.009604 235.680529,531.004801 235.681549,531) t=0.999710227 tEnd=1 windSum=? windValue=1
|
| 276 | SkOpSegment::debugShowActiveSpans id=10 (235.681549,531 280.31842,321) t=0 tEnd=1 windSum=? windValue=1
|
| 277 | SkOpSegment::debugShowActiveSpans id=11 (280.31842,321 280.320331,320.991011 280.32224,320.982009 280.324158,320.973022) t=0 tEnd=0.000542504226 windSum=? windValue=1
|
| 278 | SkOpSegment::debugShowActiveSpans id=11 (280.324158,320.973022 283.857845,304.416873 300.135575,291 316.695129,291) t=0.000542504226 tEnd=1 windSum=? windValue=1
|
| 279 | SkOpSegment::debugShowActiveSpans id=12 (316.695129,291 1006.69513,291) t=0 tEnd=1 windSum=? windValue=1
|
| 280 | -----------------xx--x---------------- expand
|
| 281 | 00: coinSeg/Span/PtT=12/23/23 endSpan=24 Fail
|
| 282 | 01: coinSeg/Span/PtT=3/34/34 endSpan=33 Fail
|
| 283 | 02: coinSeg/Span/PtT=2/32/32 endSpan=31 Fail
|
| 284 | 03: coinSeg/Span/PtT=1/29/29 endSpan=28 Fail
|
| 285 | 04: coinSeg/Span/PtT=10/19/19 endSpan=20 Fail
|
| 286 | 05: coinSeg/Span/PtT=1/27/27 endSpan=25 Fail
|
| 287 | 06: seg/base=12/23 seg/base=4/35 MarkCoinStart
|
| 288 | 07: seg/base=12/24 seg/base=4/36 MarkCoinEnd
|
| 289 | 08: seg/base=3/34 seg/base=6/11 MarkCoinStart
|
| 290 | 09: seg/base=3/33 seg/base=6/12 MarkCoinEnd
|
| 291 | 10: seg/base=2/32 seg/base=8/15 MarkCoinStart
|
| 292 | 11: seg/base=2/31 seg/base=8/16 MarkCoinEnd
|
| 293 | 12: seg/base=1/29 seg/base=11/21 MarkCoinStart
|
| 294 | 13: seg/base=1/28 seg/base=11/30 MarkCoinEnd
|
| 295 | 14: seg/base=10/19 seg/base=1/28 MarkCoinStart
|
| 296 | 15: seg/base=10/20 seg/base=1/27 MarkCoinEnd
|
| 297 | 16: seg/base=1/27 seg/base=9/26 MarkCoinStart
|
| 298 | 17: seg/base=1/25 seg/base=9/18 MarkCoinEnd
|
| 299 | SkOpSegment::debugShowActiveSpans id=1 (286.695129,291 280.324158,320.973022) t=0 tEnd=0.111011249 windSum=? windValue=1
|
| 300 | SkOpSegment::debugShowActiveSpans id=1 (280.324158,320.973022 280.31842,321) t=0.111011249 tEnd=0.11111112 windSum=? windValue=1
|
| 301 | SkOpSegment::debugShowActiveSpans id=1 (280.31842,321 235.681549,531) t=0.11111112 tEnd=0.888888891 windSum=? windValue=1
|
| 302 | SkOpSegment::debugShowActiveSpans id=1 (235.681549,531 235.678497,531.014404) t=0.888888891 tEnd=0.888942232 windSum=? windValue=1
|
| 303 | SkOpSegment::debugShowActiveSpans id=1 (235.678497,531.014404 229.304855,561) t=0.888942232 tEnd=1 windSum=? windValue=1
|
| 304 | SkOpSegment::debugShowActiveSpans id=2 (229.304855,561 259.304871,561) t=0 tEnd=0.0400000195 windSum=? windValue=1
|
| 305 | SkOpSegment::debugShowActiveSpans id=2 (259.304871,561 949.304871,561) t=0.0400000195 tEnd=0.960000001 windSum=? windValue=1
|
| 306 | SkOpSegment::debugShowActiveSpans id=2 (949.304871,561 979.304871,561) t=0.960000001 tEnd=1 windSum=? windValue=1
|
| 307 | SkOpSegment::debugShowActiveSpans id=3 (979.304871,561 985.68158,531) t=0 tEnd=0.11111108 windSum=? windValue=1
|
| 308 | SkOpSegment::debugShowActiveSpans id=3 (985.68158,531 1030.31836,321) t=0.11111108 tEnd=0.888888874 windSum=? windValue=1
|
| 309 | SkOpSegment::debugShowActiveSpans id=3 (1030.31836,321 1036.69507,291) t=0.888888874 tEnd=1 windSum=? windValue=1
|
| 310 | SkOpSegment::debugShowActiveSpans id=4 (1036.69507,291 1006.69513,291) t=0 tEnd=0.0399999219 windSum=? windValue=1
|
| 311 | SkOpSegment::debugShowActiveSpans id=4 (1006.69513,291 316.695129,291) t=0.0399999219 tEnd=0.959999997 windSum=? windValue=1
|
| 312 | SkOpSegment::debugShowActiveSpans id=4 (316.695129,291 286.695129,291) t=0.959999997 tEnd=1 windSum=? windValue=1
|
| 313 | SkOpSegment::debugShowActiveSpans id=5 (1006.69513,291 1023.26367,291 1033.84021,304.431458 1030.31836,321) t=0 tEnd=1 windSum=? windValue=1
|
| 314 | SkOpSegment::debugShowActiveSpans id=6 (1030.31836,321 985.681519,531) t=0 tEnd=1 windSum=? windValue=1
|
| 315 | SkOpSegment::debugShowActiveSpans id=7 (985.681519,531 982.15979,547.568542 965.873413,561 949.304871,561) t=0 tEnd=1 windSum=? windValue=1
|
| 316 | SkOpSegment::debugShowActiveSpans id=8 (949.304871,561 259.304871,561) t=0 tEnd=1 windSum=? windValue=1
|
| 317 | SkOpSegment::debugShowActiveSpans id=9 (259.304871,561 242.741114,561 232.165942,547.576327 235.678497,531.014404) t=0 tEnd=0.999710227 windSum=? windValue=1
|
| 318 | SkOpSegment::debugShowActiveSpans id=9 (235.678497,531.014404 235.679515,531.009604 235.680529,531.004801 235.681549,531) t=0.999710227 tEnd=1 windSum=? windValue=1
|
| 319 | SkOpSegment::debugShowActiveSpans id=10 (235.681549,531 280.31842,321) t=0 tEnd=1 windSum=? windValue=1
|
| 320 | SkOpSegment::debugShowActiveSpans id=11 (280.31842,321 280.320331,320.991011 280.32224,320.982009 280.324158,320.973022) t=0 tEnd=0.000542504226 windSum=? windValue=1
|
| 321 | SkOpSegment::debugShowActiveSpans id=11 (280.324158,320.973022 283.857845,304.416873 300.135575,291 316.695129,291) t=0.000542504226 tEnd=1 windSum=? windValue=1
|
| 322 | SkOpSegment::debugShowActiveSpans id=12 (316.695129,291 1006.69513,291) t=0 tEnd=1 windSum=? windValue=1
|
| 323 | -----------------xx--x---------------- addExpanded
|
| 324 | 00: coinSeg/Span/PtT=12/23/23 endSpan=24 Fail
|
| 325 | 01: coinSeg/Span/PtT=3/34/34 endSpan=33 Fail
|
| 326 | 02: coinSeg/Span/PtT=2/32/32 endSpan=31 Fail
|
| 327 | 03: coinSeg/Span/PtT=1/29/29 endSpan=28 Fail
|
| 328 | 04: coinSeg/Span/PtT=10/19/19 endSpan=20 Fail
|
| 329 | 05: coinSeg/Span/PtT=1/27/27 endSpan=25 Fail
|
| 330 | 06: seg/base=12/23 seg/base=4/35 MarkCoinStart
|
| 331 | 07: seg/base=12/24 seg/base=4/36 MarkCoinEnd
|
| 332 | 08: seg/base=3/34 seg/base=6/11 MarkCoinStart
|
| 333 | 09: seg/base=3/33 seg/base=6/12 MarkCoinEnd
|
| 334 | 10: seg/base=2/32 seg/base=8/15 MarkCoinStart
|
| 335 | 11: seg/base=2/31 seg/base=8/16 MarkCoinEnd
|
| 336 | 12: seg/base=1/29 seg/base=11/21 MarkCoinStart
|
| 337 | 13: seg/base=1/28 seg/base=11/30 MarkCoinEnd
|
| 338 | 14: seg/base=10/19 seg/base=1/28 MarkCoinStart
|
| 339 | 15: seg/base=10/20 seg/base=1/27 MarkCoinEnd
|
| 340 | 16: seg/base=1/27 seg/base=9/26 MarkCoinStart
|
| 341 | 17: seg/base=1/25 seg/base=9/18 MarkCoinEnd
|
| 342 | SkOpSegment::debugShowActiveSpans id=1 (286.695129,291 280.324158,320.973022) t=0 tEnd=0.111011249 windSum=? windValue=1
|
| 343 | SkOpSegment::debugShowActiveSpans id=1 (280.324158,320.973022 280.31842,321) t=0.111011249 tEnd=0.11111112 windSum=? windValue=1
|
| 344 | SkOpSegment::debugShowActiveSpans id=1 (280.31842,321 235.681549,531) t=0.11111112 tEnd=0.888888891 windSum=? windValue=1
|
| 345 | SkOpSegment::debugShowActiveSpans id=1 (235.681549,531 235.678497,531.014404) t=0.888888891 tEnd=0.888942232 windSum=? windValue=1
|
| 346 | SkOpSegment::debugShowActiveSpans id=1 (235.678497,531.014404 229.304855,561) t=0.888942232 tEnd=1 windSum=? windValue=1
|
| 347 | SkOpSegment::debugShowActiveSpans id=2 (229.304855,561 259.304871,561) t=0 tEnd=0.0400000195 windSum=? windValue=1
|
| 348 | SkOpSegment::debugShowActiveSpans id=2 (259.304871,561 949.304871,561) t=0.0400000195 tEnd=0.960000001 windSum=? windValue=1
|
| 349 | SkOpSegment::debugShowActiveSpans id=2 (949.304871,561 979.304871,561) t=0.960000001 tEnd=1 windSum=? windValue=1
|
| 350 | SkOpSegment::debugShowActiveSpans id=3 (979.304871,561 985.68158,531) t=0 tEnd=0.11111108 windSum=? windValue=1
|
| 351 | SkOpSegment::debugShowActiveSpans id=3 (985.68158,531 1030.31836,321) t=0.11111108 tEnd=0.888888874 windSum=? windValue=1
|
| 352 | SkOpSegment::debugShowActiveSpans id=3 (1030.31836,321 1036.69507,291) t=0.888888874 tEnd=1 windSum=? windValue=1
|
| 353 | SkOpSegment::debugShowActiveSpans id=4 (1036.69507,291 1006.69513,291) t=0 tEnd=0.0399999219 windSum=? windValue=1
|
| 354 | SkOpSegment::debugShowActiveSpans id=4 (1006.69513,291 316.695129,291) t=0.0399999219 tEnd=0.959999997 windSum=? windValue=1
|
| 355 | SkOpSegment::debugShowActiveSpans id=4 (316.695129,291 286.695129,291) t=0.959999997 tEnd=1 windSum=? windValue=1
|
| 356 | SkOpSegment::debugShowActiveSpans id=5 (1006.69513,291 1023.26367,291 1033.84021,304.431458 1030.31836,321) t=0 tEnd=1 windSum=? windValue=1
|
| 357 | SkOpSegment::debugShowActiveSpans id=6 (1030.31836,321 985.681519,531) t=0 tEnd=1 windSum=? windValue=1
|
| 358 | SkOpSegment::debugShowActiveSpans id=7 (985.681519,531 982.15979,547.568542 965.873413,561 949.304871,561) t=0 tEnd=1 windSum=? windValue=1
|
| 359 | SkOpSegment::debugShowActiveSpans id=8 (949.304871,561 259.304871,561) t=0 tEnd=1 windSum=? windValue=1
|
| 360 | SkOpSegment::debugShowActiveSpans id=9 (259.304871,561 242.741114,561 232.165942,547.576327 235.678497,531.014404) t=0 tEnd=0.999710227 windSum=? windValue=1
|
| 361 | SkOpSegment::debugShowActiveSpans id=9 (235.678497,531.014404 235.679515,531.009604 235.680529,531.004801 235.681549,531) t=0.999710227 tEnd=1 windSum=? windValue=1
|
| 362 | SkOpSegment::debugShowActiveSpans id=10 (235.681549,531 280.31842,321) t=0 tEnd=1 windSum=? windValue=1
|
| 363 | SkOpSegment::debugShowActiveSpans id=11 (280.31842,321 280.320331,320.991011 280.32224,320.982009 280.324158,320.973022) t=0 tEnd=0.000542504226 windSum=? windValue=1
|
| 364 | SkOpSegment::debugShowActiveSpans id=11 (280.324158,320.973022 283.857845,304.416873 300.135575,291 316.695129,291) t=0.000542504226 tEnd=1 windSum=? windValue=1
|
| 365 | SkOpSegment::debugShowActiveSpans id=12 (316.695129,291 1006.69513,291) t=0 tEnd=1 windSum=? windValue=1
|
| 366 | -----------------xx--x---------------- mark
|
| 367 | 00: coinSeg/Span/PtT=12/23/23 endSpan=24 Fail
|
| 368 | 01: coinSeg/Span/PtT=3/34/34 endSpan=33 Fail
|
| 369 | 02: coinSeg/Span/PtT=2/32/32 endSpan=31 Fail
|
| 370 | 03: coinSeg/Span/PtT=1/29/29 endSpan=28 Fail
|
| 371 | 04: coinSeg/Span/PtT=10/19/19 endSpan=20 Fail
|
| 372 | 05: coinSeg/Span/PtT=1/27/27 endSpan=25 Fail
|
| 373 | 06: seg/base=12/23 seg/base=4/35 MarkCoinStart
|
| 374 | 07: seg/base=12/24 seg/base=4/36 MarkCoinEnd
|
| 375 | 08: seg/base=3/34 seg/base=6/11 MarkCoinStart
|
| 376 | 09: seg/base=3/33 seg/base=6/12 MarkCoinEnd
|
| 377 | 10: seg/base=2/32 seg/base=8/15 MarkCoinStart
|
| 378 | 11: seg/base=2/31 seg/base=8/16 MarkCoinEnd
|
| 379 | 12: seg/base=1/29 seg/base=11/21 MarkCoinStart
|
| 380 | 13: seg/base=1/28 seg/base=11/30 MarkCoinEnd
|
| 381 | 14: seg/base=10/19 seg/base=1/28 MarkCoinStart
|
| 382 | 15: seg/base=10/20 seg/base=1/27 MarkCoinEnd
|
| 383 | 16: seg/base=1/27 seg/base=9/26 MarkCoinStart
|
| 384 | 17: seg/base=1/25 seg/base=9/18 MarkCoinEnd
|
| 385 | SkOpSegment::debugShowActiveSpans id=1 (286.695129,291 280.324158,320.973022) t=0 tEnd=0.111011249 windSum=? windValue=1
|
| 386 | SkOpSegment::debugShowActiveSpans id=1 (280.324158,320.973022 280.31842,321) t=0.111011249 tEnd=0.11111112 windSum=? windValue=1
|
| 387 | SkOpSegment::debugShowActiveSpans id=1 (280.31842,321 235.681549,531) t=0.11111112 tEnd=0.888888891 windSum=? windValue=1
|
| 388 | SkOpSegment::debugShowActiveSpans id=1 (235.681549,531 235.678497,531.014404) t=0.888888891 tEnd=0.888942232 windSum=? windValue=1
|
| 389 | SkOpSegment::debugShowActiveSpans id=1 (235.678497,531.014404 229.304855,561) t=0.888942232 tEnd=1 windSum=? windValue=1
|
| 390 | SkOpSegment::debugShowActiveSpans id=2 (229.304855,561 259.304871,561) t=0 tEnd=0.0400000195 windSum=? windValue=1
|
| 391 | SkOpSegment::debugShowActiveSpans id=2 (259.304871,561 949.304871,561) t=0.0400000195 tEnd=0.960000001 windSum=? windValue=1
|
| 392 | SkOpSegment::debugShowActiveSpans id=2 (949.304871,561 979.304871,561) t=0.960000001 tEnd=1 windSum=? windValue=1
|
| 393 | SkOpSegment::debugShowActiveSpans id=3 (979.304871,561 985.68158,531) t=0 tEnd=0.11111108 windSum=? windValue=1
|
| 394 | SkOpSegment::debugShowActiveSpans id=3 (985.68158,531 1030.31836,321) t=0.11111108 tEnd=0.888888874 windSum=? windValue=1
|
| 395 | SkOpSegment::debugShowActiveSpans id=3 (1030.31836,321 1036.69507,291) t=0.888888874 tEnd=1 windSum=? windValue=1
|
| 396 | SkOpSegment::debugShowActiveSpans id=4 (1036.69507,291 1006.69513,291) t=0 tEnd=0.0399999219 windSum=? windValue=1
|
| 397 | SkOpSegment::debugShowActiveSpans id=4 (1006.69513,291 316.695129,291) t=0.0399999219 tEnd=0.959999997 windSum=? windValue=1
|
| 398 | SkOpSegment::debugShowActiveSpans id=4 (316.695129,291 286.695129,291) t=0.959999997 tEnd=1 windSum=? windValue=1
|
| 399 | SkOpSegment::debugShowActiveSpans id=5 (1006.69513,291 1023.26367,291 1033.84021,304.431458 1030.31836,321) t=0 tEnd=1 windSum=? windValue=1
|
| 400 | SkOpSegment::debugShowActiveSpans id=6 (1030.31836,321 985.681519,531) t=0 tEnd=1 windSum=? windValue=1
|
| 401 | SkOpSegment::debugShowActiveSpans id=7 (985.681519,531 982.15979,547.568542 965.873413,561 949.304871,561) t=0 tEnd=1 windSum=? windValue=1
|
| 402 | SkOpSegment::debugShowActiveSpans id=8 (949.304871,561 259.304871,561) t=0 tEnd=1 windSum=? windValue=1
|
| 403 | SkOpSegment::debugShowActiveSpans id=9 (259.304871,561 242.741114,561 232.165942,547.576327 235.678497,531.014404) t=0 tEnd=0.999710227 windSum=? windValue=1
|
| 404 | SkOpSegment::debugShowActiveSpans id=9 (235.678497,531.014404 235.679515,531.009604 235.680529,531.004801 235.681549,531) t=0.999710227 tEnd=1 windSum=? windValue=1
|
| 405 | SkOpSegment::debugShowActiveSpans id=10 (235.681549,531 280.31842,321) t=0 tEnd=1 windSum=? windValue=1
|
| 406 | SkOpSegment::debugShowActiveSpans id=11 (280.31842,321 280.320331,320.991011 280.32224,320.982009 280.324158,320.973022) t=0 tEnd=0.000542504226 windSum=? windValue=1
|
| 407 | SkOpSegment::debugShowActiveSpans id=11 (280.324158,320.973022 283.857845,304.416873 300.135575,291 316.695129,291) t=0.000542504226 tEnd=1 windSum=? windValue=1
|
| 408 | SkOpSegment::debugShowActiveSpans id=12 (316.695129,291 1006.69513,291) t=0 tEnd=1 windSum=? windValue=1
|
| 409 | -----------------x-------------------- missing_coincidence
|
| 410 | 00: coinSeg/Span/PtT=12/23/23 endSpan=24 Fail
|
| 411 | 01: coinSeg/Span/PtT=3/34/34 endSpan=33 Fail
|
| 412 | 02: coinSeg/Span/PtT=2/32/32 endSpan=31 Fail
|
| 413 | 03: coinSeg/Span/PtT=1/29/29 endSpan=28 Fail
|
| 414 | 04: coinSeg/Span/PtT=10/19/19 endSpan=20 Fail
|
| 415 | 05: coinSeg/Span/PtT=1/27/27 endSpan=25 Fail
|
| 416 | SkOpSegment::debugShowActiveSpans id=1 (286.695129,291 280.324158,320.973022) t=0 tEnd=0.111011249 windSum=? windValue=1
|
| 417 | SkOpSegment::debugShowActiveSpans id=1 (280.324158,320.973022 280.31842,321) t=0.111011249 tEnd=0.11111112 windSum=? windValue=1
|
| 418 | SkOpSegment::debugShowActiveSpans id=1 (280.31842,321 235.681549,531) t=0.11111112 tEnd=0.888888891 windSum=? windValue=1
|
| 419 | SkOpSegment::debugShowActiveSpans id=1 (235.681549,531 235.678497,531.014404) t=0.888888891 tEnd=0.888942232 windSum=? windValue=1
|
| 420 | SkOpSegment::debugShowActiveSpans id=1 (235.678497,531.014404 229.304855,561) t=0.888942232 tEnd=1 windSum=? windValue=1
|
| 421 | SkOpSegment::debugShowActiveSpans id=2 (229.304855,561 259.304871,561) t=0 tEnd=0.0400000195 windSum=? windValue=1
|
| 422 | SkOpSegment::debugShowActiveSpans id=2 (259.304871,561 949.304871,561) t=0.0400000195 tEnd=0.960000001 windSum=? windValue=1
|
| 423 | SkOpSegment::debugShowActiveSpans id=2 (949.304871,561 979.304871,561) t=0.960000001 tEnd=1 windSum=? windValue=1
|
| 424 | SkOpSegment::debugShowActiveSpans id=3 (979.304871,561 985.68158,531) t=0 tEnd=0.11111108 windSum=? windValue=1
|
| 425 | SkOpSegment::debugShowActiveSpans id=3 (985.68158,531 1030.31836,321) t=0.11111108 tEnd=0.888888874 windSum=? windValue=1
|
| 426 | SkOpSegment::debugShowActiveSpans id=3 (1030.31836,321 1036.69507,291) t=0.888888874 tEnd=1 windSum=? windValue=1
|
| 427 | SkOpSegment::debugShowActiveSpans id=4 (1036.69507,291 1006.69513,291) t=0 tEnd=0.0399999219 windSum=? windValue=1
|
| 428 | SkOpSegment::debugShowActiveSpans id=4 (1006.69513,291 316.695129,291) t=0.0399999219 tEnd=0.959999997 windSum=? windValue=1
|
| 429 | SkOpSegment::debugShowActiveSpans id=4 (316.695129,291 286.695129,291) t=0.959999997 tEnd=1 windSum=? windValue=1
|
| 430 | SkOpSegment::debugShowActiveSpans id=5 (1006.69513,291 1023.26367,291 1033.84021,304.431458 1030.31836,321) t=0 tEnd=1 windSum=? windValue=1
|
| 431 | SkOpSegment::debugShowActiveSpans id=6 (1030.31836,321 985.681519,531) t=0 tEnd=1 windSum=? windValue=1
|
| 432 | SkOpSegment::debugShowActiveSpans id=7 (985.681519,531 982.15979,547.568542 965.873413,561 949.304871,561) t=0 tEnd=1 windSum=? windValue=1
|
| 433 | SkOpSegment::debugShowActiveSpans id=8 (949.304871,561 259.304871,561) t=0 tEnd=1 windSum=? windValue=1
|
| 434 | SkOpSegment::debugShowActiveSpans id=9 (259.304871,561 242.741114,561 232.165942,547.576327 235.678497,531.014404) t=0 tEnd=0.999710227 windSum=? windValue=1
|
| 435 | SkOpSegment::debugShowActiveSpans id=9 (235.678497,531.014404 235.679515,531.009604 235.680529,531.004801 235.681549,531) t=0.999710227 tEnd=1 windSum=? windValue=1
|
| 436 | SkOpSegment::debugShowActiveSpans id=10 (235.681549,531 280.31842,321) t=0 tEnd=1 windSum=? windValue=1
|
| 437 | SkOpSegment::debugShowActiveSpans id=11 (280.31842,321 280.320331,320.991011 280.32224,320.982009 280.324158,320.973022) t=0 tEnd=0.000542504226 windSum=? windValue=1
|
| 438 | SkOpSegment::debugShowActiveSpans id=11 (280.324158,320.973022 283.857845,304.416873 300.135575,291 316.695129,291) t=0.000542504226 tEnd=1 windSum=? windValue=1
|
| 439 | SkOpSegment::debugShowActiveSpans id=12 (316.695129,291 1006.69513,291) t=0 tEnd=1 windSum=? windValue=1
|
| 440 | -----------------x-------------------- expand
|
| 441 | 00: coinSeg/Span/PtT=12/23/23 endSpan=24 Fail
|
| 442 | 01: coinSeg/Span/PtT=3/34/34 endSpan=33 Fail
|
| 443 | 02: coinSeg/Span/PtT=2/32/32 endSpan=31 Fail
|
| 444 | 03: coinSeg/Span/PtT=1/29/29 endSpan=28 Fail
|
| 445 | 04: coinSeg/Span/PtT=10/19/19 endSpan=20 Fail
|
| 446 | 05: coinSeg/Span/PtT=1/27/27 endSpan=25 Fail
|
| 447 | SkOpSegment::debugShowActiveSpans id=1 (286.695129,291 280.324158,320.973022) t=0 tEnd=0.111011249 windSum=? windValue=1
|
| 448 | SkOpSegment::debugShowActiveSpans id=1 (280.324158,320.973022 280.31842,321) t=0.111011249 tEnd=0.11111112 windSum=? windValue=1
|
| 449 | SkOpSegment::debugShowActiveSpans id=1 (280.31842,321 235.681549,531) t=0.11111112 tEnd=0.888888891 windSum=? windValue=1
|
| 450 | SkOpSegment::debugShowActiveSpans id=1 (235.681549,531 235.678497,531.014404) t=0.888888891 tEnd=0.888942232 windSum=? windValue=1
|
| 451 | SkOpSegment::debugShowActiveSpans id=1 (235.678497,531.014404 229.304855,561) t=0.888942232 tEnd=1 windSum=? windValue=1
|
| 452 | SkOpSegment::debugShowActiveSpans id=2 (229.304855,561 259.304871,561) t=0 tEnd=0.0400000195 windSum=? windValue=1
|
| 453 | SkOpSegment::debugShowActiveSpans id=2 (259.304871,561 949.304871,561) t=0.0400000195 tEnd=0.960000001 windSum=? windValue=1
|
| 454 | SkOpSegment::debugShowActiveSpans id=2 (949.304871,561 979.304871,561) t=0.960000001 tEnd=1 windSum=? windValue=1
|
| 455 | SkOpSegment::debugShowActiveSpans id=3 (979.304871,561 985.68158,531) t=0 tEnd=0.11111108 windSum=? windValue=1
|
| 456 | SkOpSegment::debugShowActiveSpans id=3 (985.68158,531 1030.31836,321) t=0.11111108 tEnd=0.888888874 windSum=? windValue=1
|
| 457 | SkOpSegment::debugShowActiveSpans id=3 (1030.31836,321 1036.69507,291) t=0.888888874 tEnd=1 windSum=? windValue=1
|
| 458 | SkOpSegment::debugShowActiveSpans id=4 (1036.69507,291 1006.69513,291) t=0 tEnd=0.0399999219 windSum=? windValue=1
|
| 459 | SkOpSegment::debugShowActiveSpans id=4 (1006.69513,291 316.695129,291) t=0.0399999219 tEnd=0.959999997 windSum=? windValue=1
|
| 460 | SkOpSegment::debugShowActiveSpans id=4 (316.695129,291 286.695129,291) t=0.959999997 tEnd=1 windSum=? windValue=1
|
| 461 | SkOpSegment::debugShowActiveSpans id=5 (1006.69513,291 1023.26367,291 1033.84021,304.431458 1030.31836,321) t=0 tEnd=1 windSum=? windValue=1
|
| 462 | SkOpSegment::debugShowActiveSpans id=6 (1030.31836,321 985.681519,531) t=0 tEnd=1 windSum=? windValue=1
|
| 463 | SkOpSegment::debugShowActiveSpans id=7 (985.681519,531 982.15979,547.568542 965.873413,561 949.304871,561) t=0 tEnd=1 windSum=? windValue=1
|
| 464 | SkOpSegment::debugShowActiveSpans id=8 (949.304871,561 259.304871,561) t=0 tEnd=1 windSum=? windValue=1
|
| 465 | SkOpSegment::debugShowActiveSpans id=9 (259.304871,561 242.741114,561 232.165942,547.576327 235.678497,531.014404) t=0 tEnd=0.999710227 windSum=? windValue=1
|
| 466 | SkOpSegment::debugShowActiveSpans id=9 (235.678497,531.014404 235.679515,531.009604 235.680529,531.004801 235.681549,531) t=0.999710227 tEnd=1 windSum=? windValue=1
|
| 467 | SkOpSegment::debugShowActiveSpans id=10 (235.681549,531 280.31842,321) t=0 tEnd=1 windSum=? windValue=1
|
| 468 | SkOpSegment::debugShowActiveSpans id=11 (280.31842,321 280.320331,320.991011 280.32224,320.982009 280.324158,320.973022) t=0 tEnd=0.000542504226 windSum=? windValue=1
|
| 469 | SkOpSegment::debugShowActiveSpans id=11 (280.324158,320.973022 283.857845,304.416873 300.135575,291 316.695129,291) t=0.000542504226 tEnd=1 windSum=? windValue=1
|
| 470 | SkOpSegment::debugShowActiveSpans id=12 (316.695129,291 1006.69513,291) t=0 tEnd=1 windSum=? windValue=1
|
| 471 | -----------------x-------------------- expand
|
| 472 | 00: coinSeg/Span/PtT=12/23/23 endSpan=24 Fail
|
| 473 | 01: coinSeg/Span/PtT=3/34/34 endSpan=33 Fail
|
| 474 | 02: coinSeg/Span/PtT=2/32/32 endSpan=31 Fail
|
| 475 | 03: coinSeg/Span/PtT=1/29/29 endSpan=28 Fail
|
| 476 | 04: coinSeg/Span/PtT=10/19/19 endSpan=20 Fail
|
| 477 | 05: coinSeg/Span/PtT=1/27/27 endSpan=25 Fail
|
| 478 | SkOpSegment::debugShowActiveSpans id=1 (286.695129,291 280.324158,320.973022) t=0 tEnd=0.111011249 windSum=? windValue=1
|
| 479 | SkOpSegment::debugShowActiveSpans id=1 (280.324158,320.973022 280.31842,321) t=0.111011249 tEnd=0.11111112 windSum=? windValue=1
|
| 480 | SkOpSegment::debugShowActiveSpans id=1 (280.31842,321 235.681549,531) t=0.11111112 tEnd=0.888888891 windSum=? windValue=1
|
| 481 | SkOpSegment::debugShowActiveSpans id=1 (235.681549,531 235.678497,531.014404) t=0.888888891 tEnd=0.888942232 windSum=? windValue=1
|
| 482 | SkOpSegment::debugShowActiveSpans id=1 (235.678497,531.014404 229.304855,561) t=0.888942232 tEnd=1 windSum=? windValue=1
|
| 483 | SkOpSegment::debugShowActiveSpans id=2 (229.304855,561 259.304871,561) t=0 tEnd=0.0400000195 windSum=? windValue=1
|
| 484 | SkOpSegment::debugShowActiveSpans id=2 (259.304871,561 949.304871,561) t=0.0400000195 tEnd=0.960000001 windSum=? windValue=1
|
| 485 | SkOpSegment::debugShowActiveSpans id=2 (949.304871,561 979.304871,561) t=0.960000001 tEnd=1 windSum=? windValue=1
|
| 486 | SkOpSegment::debugShowActiveSpans id=3 (979.304871,561 985.68158,531) t=0 tEnd=0.11111108 windSum=? windValue=1
|
| 487 | SkOpSegment::debugShowActiveSpans id=3 (985.68158,531 1030.31836,321) t=0.11111108 tEnd=0.888888874 windSum=? windValue=1
|
| 488 | SkOpSegment::debugShowActiveSpans id=3 (1030.31836,321 1036.69507,291) t=0.888888874 tEnd=1 windSum=? windValue=1
|
| 489 | SkOpSegment::debugShowActiveSpans id=4 (1036.69507,291 1006.69513,291) t=0 tEnd=0.0399999219 windSum=? windValue=1
|
| 490 | SkOpSegment::debugShowActiveSpans id=4 (1006.69513,291 316.695129,291) t=0.0399999219 tEnd=0.959999997 windSum=? windValue=1
|
| 491 | SkOpSegment::debugShowActiveSpans id=4 (316.695129,291 286.695129,291) t=0.959999997 tEnd=1 windSum=? windValue=1
|
| 492 | SkOpSegment::debugShowActiveSpans id=5 (1006.69513,291 1023.26367,291 1033.84021,304.431458 1030.31836,321) t=0 tEnd=1 windSum=? windValue=1
|
| 493 | SkOpSegment::debugShowActiveSpans id=6 (1030.31836,321 985.681519,531) t=0 tEnd=1 windSum=? windValue=1
|
| 494 | SkOpSegment::debugShowActiveSpans id=7 (985.681519,531 982.15979,547.568542 965.873413,561 949.304871,561) t=0 tEnd=1 windSum=? windValue=1
|
| 495 | SkOpSegment::debugShowActiveSpans id=8 (949.304871,561 259.304871,561) t=0 tEnd=1 windSum=? windValue=1
|
| 496 | SkOpSegment::debugShowActiveSpans id=9 (259.304871,561 242.741114,561 232.165942,547.576327 235.678497,531.014404) t=0 tEnd=0.999710227 windSum=? windValue=1
|
| 497 | SkOpSegment::debugShowActiveSpans id=9 (235.678497,531.014404 235.679515,531.009604 235.680529,531.004801 235.681549,531) t=0.999710227 tEnd=1 windSum=? windValue=1
|
| 498 | SkOpSegment::debugShowActiveSpans id=10 (235.681549,531 280.31842,321) t=0 tEnd=1 windSum=? windValue=1
|
| 499 | SkOpSegment::debugShowActiveSpans id=11 (280.31842,321 280.320331,320.991011 280.32224,320.982009 280.324158,320.973022) t=0 tEnd=0.000542504226 windSum=? windValue=1
|
| 500 | SkOpSegment::debugShowActiveSpans id=11 (280.324158,320.973022 283.857845,304.416873 300.135575,291 316.695129,291) t=0.000542504226 tEnd=1 windSum=? windValue=1
|
| 501 | SkOpSegment::debugShowActiveSpans id=12 (316.695129,291 1006.69513,291) t=0 tEnd=1 windSum=? windValue=1
|
| 502 | -------------------------------------- apply
|
| 503 | SkOpSegment::debugShowActiveSpans id=1 (286.695129,291 280.324158,320.973022) t=0 tEnd=0.111011249 windSum=? windValue=1
|
| 504 | SkOpSegment::debugShowActiveSpans id=1 (280.324158,320.973022 280.31842,321) t=0.111011249 tEnd=0.11111112 windSum=? windValue=1
|
| 505 | SkOpSegment::debugShowActiveSpans id=1 (280.31842,321 235.681549,531) t=0.11111112 tEnd=0.888888891 windSum=? windValue=1
|
| 506 | SkOpSegment::debugShowActiveSpans id=1 (235.681549,531 235.678497,531.014404) t=0.888888891 tEnd=0.888942232 windSum=? windValue=1
|
| 507 | SkOpSegment::debugShowActiveSpans id=1 (235.678497,531.014404 229.304855,561) t=0.888942232 tEnd=1 windSum=? windValue=1
|
| 508 | SkOpSegment::debugShowActiveSpans id=2 (229.304855,561 259.304871,561) t=0 tEnd=0.0400000195 windSum=? windValue=1
|
| 509 | SkOpSegment::debugShowActiveSpans id=2 (259.304871,561 949.304871,561) t=0.0400000195 tEnd=0.960000001 windSum=? windValue=1
|
| 510 | SkOpSegment::debugShowActiveSpans id=2 (949.304871,561 979.304871,561) t=0.960000001 tEnd=1 windSum=? windValue=1
|
| 511 | SkOpSegment::debugShowActiveSpans id=3 (979.304871,561 985.68158,531) t=0 tEnd=0.11111108 windSum=? windValue=1
|
| 512 | SkOpSegment::debugShowActiveSpans id=3 (985.68158,531 1030.31836,321) t=0.11111108 tEnd=0.888888874 windSum=? windValue=1
|
| 513 | SkOpSegment::debugShowActiveSpans id=3 (1030.31836,321 1036.69507,291) t=0.888888874 tEnd=1 windSum=? windValue=1
|
| 514 | SkOpSegment::debugShowActiveSpans id=4 (1036.69507,291 1006.69513,291) t=0 tEnd=0.0399999219 windSum=? windValue=1
|
| 515 | SkOpSegment::debugShowActiveSpans id=4 (1006.69513,291 316.695129,291) t=0.0399999219 tEnd=0.959999997 windSum=? windValue=1
|
| 516 | SkOpSegment::debugShowActiveSpans id=4 (316.695129,291 286.695129,291) t=0.959999997 tEnd=1 windSum=? windValue=1
|
| 517 | SkOpSegment::debugShowActiveSpans id=5 (1006.69513,291 1023.26367,291 1033.84021,304.431458 1030.31836,321) t=0 tEnd=1 windSum=? windValue=1
|
| 518 | SkOpSegment::debugShowActiveSpans id=6 (1030.31836,321 985.681519,531) t=0 tEnd=1 windSum=? windValue=1
|
| 519 | SkOpSegment::debugShowActiveSpans id=7 (985.681519,531 982.15979,547.568542 965.873413,561 949.304871,561) t=0 tEnd=1 windSum=? windValue=1
|
| 520 | SkOpSegment::debugShowActiveSpans id=8 (949.304871,561 259.304871,561) t=0 tEnd=1 windSum=? windValue=1
|
| 521 | SkOpSegment::debugShowActiveSpans id=9 (259.304871,561 242.741114,561 232.165942,547.576327 235.678497,531.014404) t=0 tEnd=0.999710227 windSum=? windValue=1
|
| 522 | SkOpSegment::debugShowActiveSpans id=9 (235.678497,531.014404 235.679515,531.009604 235.680529,531.004801 235.681549,531) t=0.999710227 tEnd=1 windSum=? windValue=1
|
| 523 | SkOpSegment::debugShowActiveSpans id=10 (235.681549,531 280.31842,321) t=0 tEnd=1 windSum=? windValue=1
|
| 524 | SkOpSegment::debugShowActiveSpans id=11 (280.31842,321 280.320331,320.991011 280.32224,320.982009 280.324158,320.973022) t=0 tEnd=0.000542504226 windSum=? windValue=1
|
| 525 | SkOpSegment::debugShowActiveSpans id=11 (280.324158,320.973022 283.857845,304.416873 300.135575,291 316.695129,291) t=0.000542504226 tEnd=1 windSum=? windValue=1
|
| 526 | SkOpSegment::debugShowActiveSpans id=12 (316.695129,291 1006.69513,291) t=0 tEnd=1 windSum=? windValue=1
|
| 527 | SkOpSegment::markDone id=4 (1036.69507,291 286.695129,291) t=0.0399999219 [35] (1006.69513,291) tEnd=0.959999997 newWindSum=? newOppSum=? oppSum=? windSum=? windValue=0 oppValue=0
|
| 528 | SkOpSegment::markDone id=6 (1030.31836,321 985.681519,531) t=0 [11] (1030.31836,321) tEnd=1 newWindSum=? newOppSum=? oppSum=? windSum=? windValue=0 oppValue=0
|
| 529 | SkOpSegment::markDone id=8 (949.304871,561 259.304871,561) t=0 [15] (949.304871,561) tEnd=1 newWindSum=? newOppSum=? oppSum=? windSum=? windValue=0 oppValue=0
|
| 530 | SkOpSegment::markDone id=11 (280.31842,321 283.840179,304.431458 300.126587,291 316.695129,291) t=0 [21] (280.31842,321) tEnd=0.000542504226 newWindSum=? newOppSum=? oppSum=? windSum=? windValue=0 oppValue=0
|
| 531 | SkOpSegment::markDone id=1 (286.695129,291 229.304855,561) t=0.11111112 [28] (280.31842,321) tEnd=0.888888891 newWindSum=? newOppSum=? oppSum=? windSum=? windValue=0 oppValue=0
|
| 532 | SkOpSegment::markDone id=9 (259.304871,561 242.736313,561 232.159805,547.568542 235.681549,531) t=0.999710227 [26] (235.678497,531.014404) tEnd=1 newWindSum=? newOppSum=? oppSum=? windSum=? windValue=0 oppValue=0
|
| 533 | -------------------------------------- findOverlaps
|
| 534 | SkOpSegment::debugShowActiveSpans id=1 (286.695129,291 280.324158,320.973022) t=0 tEnd=0.111011249 windSum=? windValue=1
|
| 535 | SkOpSegment::debugShowActiveSpans id=1 (280.324158,320.973022 280.31842,321) t=0.111011249 tEnd=0.11111112 windSum=? oppSum=? windValue=1 oppValue=-1
|
| 536 | SkOpSegment::debugShowActiveSpans id=1 (235.681549,531 235.678497,531.014404) t=0.888888891 tEnd=0.888942232 windSum=? oppSum=? windValue=1 oppValue=-1
|
| 537 | SkOpSegment::debugShowActiveSpans id=1 (235.678497,531.014404 229.304855,561) t=0.888942232 tEnd=1 windSum=? windValue=1
|
| 538 | SkOpSegment::debugShowActiveSpans id=2 (229.304855,561 259.304871,561) t=0 tEnd=0.0400000195 windSum=? windValue=1
|
| 539 | SkOpSegment::debugShowActiveSpans id=2 (259.304871,561 949.304871,561) t=0.0400000195 tEnd=0.960000001 windSum=? oppSum=? windValue=1 oppValue=-1
|
| 540 | SkOpSegment::debugShowActiveSpans id=2 (949.304871,561 979.304871,561) t=0.960000001 tEnd=1 windSum=? windValue=1
|
| 541 | SkOpSegment::debugShowActiveSpans id=3 (979.304871,561 985.68158,531) t=0 tEnd=0.11111108 windSum=? windValue=1
|
| 542 | SkOpSegment::debugShowActiveSpans id=3 (985.68158,531 1030.31836,321) t=0.11111108 tEnd=0.888888874 windSum=? oppSum=? windValue=1 oppValue=-1
|
| 543 | SkOpSegment::debugShowActiveSpans id=3 (1030.31836,321 1036.69507,291) t=0.888888874 tEnd=1 windSum=? windValue=1
|
| 544 | SkOpSegment::debugShowActiveSpans id=4 (1036.69507,291 1006.69513,291) t=0 tEnd=0.0399999219 windSum=? windValue=1
|
| 545 | SkOpSegment::debugShowActiveSpans id=4 (316.695129,291 286.695129,291) t=0.959999997 tEnd=1 windSum=? windValue=1
|
| 546 | SkOpSegment::debugShowActiveSpans id=5 (1006.69513,291 1023.26367,291 1033.84021,304.431458 1030.31836,321) t=0 tEnd=1 windSum=? windValue=1
|
| 547 | SkOpSegment::debugShowActiveSpans id=7 (985.681519,531 982.15979,547.568542 965.873413,561 949.304871,561) t=0 tEnd=1 windSum=? windValue=1
|
| 548 | SkOpSegment::debugShowActiveSpans id=9 (259.304871,561 242.741114,561 232.165942,547.576327 235.678497,531.014404) t=0 tEnd=0.999710227 windSum=? windValue=1
|
| 549 | SkOpSegment::debugShowActiveSpans id=10 (235.681549,531 280.31842,321) t=0 tEnd=1 windSum=? oppSum=? windValue=1 oppValue=1
|
| 550 | SkOpSegment::debugShowActiveSpans id=11 (280.324158,320.973022 283.857845,304.416873 300.135575,291 316.695129,291) t=0.000542504226 tEnd=1 windSum=? windValue=1
|
| 551 | SkOpSegment::debugShowActiveSpans id=12 (316.695129,291 1006.69513,291) t=0 tEnd=1 windSum=? oppSum=? windValue=1 oppValue=1
|
| 552 | -------------------------------------- calc_angles
|
| 553 | SkOpSegment::debugShowActiveSpans id=1 (286.695129,291 280.324158,320.973022) t=0 tEnd=0.111011249 windSum=? windValue=1
|
| 554 | SkOpSegment::debugShowActiveSpans id=1 (280.324158,320.973022 280.31842,321) t=0.111011249 tEnd=0.11111112 windSum=? oppSum=? windValue=1 oppValue=-1
|
| 555 | SkOpSegment::debugShowActiveSpans id=1 (235.681549,531 235.678497,531.014404) t=0.888888891 tEnd=0.888942232 windSum=? oppSum=? windValue=1 oppValue=-1
|
| 556 | SkOpSegment::debugShowActiveSpans id=1 (235.678497,531.014404 229.304855,561) t=0.888942232 tEnd=1 windSum=? windValue=1
|
| 557 | SkOpSegment::debugShowActiveSpans id=2 (229.304855,561 259.304871,561) t=0 tEnd=0.0400000195 windSum=? windValue=1
|
| 558 | SkOpSegment::debugShowActiveSpans id=2 (259.304871,561 949.304871,561) t=0.0400000195 tEnd=0.960000001 windSum=? oppSum=? windValue=1 oppValue=-1
|
| 559 | SkOpSegment::debugShowActiveSpans id=2 (949.304871,561 979.304871,561) t=0.960000001 tEnd=1 windSum=? windValue=1
|
| 560 | SkOpSegment::debugShowActiveSpans id=3 (979.304871,561 985.68158,531) t=0 tEnd=0.11111108 windSum=? windValue=1
|
| 561 | SkOpSegment::debugShowActiveSpans id=3 (985.68158,531 1030.31836,321) t=0.11111108 tEnd=0.888888874 windSum=? oppSum=? windValue=1 oppValue=-1
|
| 562 | SkOpSegment::debugShowActiveSpans id=3 (1030.31836,321 1036.69507,291) t=0.888888874 tEnd=1 windSum=? windValue=1
|
| 563 | SkOpSegment::debugShowActiveSpans id=4 (1036.69507,291 1006.69513,291) t=0 tEnd=0.0399999219 windSum=? windValue=1
|
| 564 | SkOpSegment::debugShowActiveSpans id=4 (316.695129,291 286.695129,291) t=0.959999997 tEnd=1 windSum=? windValue=1
|
| 565 | SkOpSegment::debugShowActiveSpans id=5 (1006.69513,291 1023.26367,291 1033.84021,304.431458 1030.31836,321) t=0 tEnd=1 windSum=? windValue=1
|
| 566 | SkOpSegment::debugShowActiveSpans id=7 (985.681519,531 982.15979,547.568542 965.873413,561 949.304871,561) t=0 tEnd=1 windSum=? windValue=1
|
| 567 | SkOpSegment::debugShowActiveSpans id=9 (259.304871,561 242.741114,561 232.165942,547.576327 235.678497,531.014404) t=0 tEnd=0.999710227 windSum=? windValue=1
|
| 568 | SkOpSegment::debugShowActiveSpans id=10 (235.681549,531 280.31842,321) t=0 tEnd=1 windSum=? oppSum=? windValue=1 oppValue=1
|
| 569 | SkOpSegment::debugShowActiveSpans id=11 (280.324158,320.973022 283.857845,304.416873 300.135575,291 316.695129,291) t=0.000542504226 tEnd=1 windSum=? windValue=1
|
| 570 | SkOpSegment::debugShowActiveSpans id=12 (316.695129,291 1006.69513,291) t=0 tEnd=1 windSum=? oppSum=? windValue=1 oppValue=1
|
| 571 | SkOpSegment::sortAngles [1] tStart=0.111011249 [29]
|
| 572 | SkOpAngle::after [1/1] 5/5 tStart=0.111011249 tEnd=0 < [11/25] 5/1 tStart=0.000542504226 tEnd=1 < [1/2] 21/21 tStart=0.111011249 tEnd=0.11111112 F 12
|
| 573 | SkOpAngle::afterPart {{{280.324158,320.973022}, {286.695129,291}}} id=1
|
| 574 | SkOpAngle::afterPart {{{280.324158,320.973022}, {283.857845,304.416873}, {300.135575,291}, {316.695129,291}}} id=11
|
| 575 | SkOpAngle::afterPart {{{280.324158,320.973022}, {280.31842,321}}} id=1
|
| 576 | SkOpSegment::sortAngles [1] tStart=0.11111112 [28]
|
| 577 | SkOpSegment::sortAngles [1] tStart=0.888888891 [27]
|
| 578 | SkOpSegment::sortAngles [1] tStart=0.888942232 [25]
|
| 579 | SkOpAngle::after [1/5] 5/5 tStart=0.888942232 tEnd=0.888888891 < [9/22] 21/25 tStart=0.999710227 tEnd=0 < [1/6] 21/21 tStart=0.888942232 tEnd=1 F 11
|
| 580 | SkOpAngle::afterPart {{{235.678497,531.014404}, {235.681549,531}}} id=1
|
| 581 | SkOpAngle::afterPart {{{235.678497,531.014404}, {232.165942,547.576327}, {242.741114,561}, {259.304871,561}}} id=9
|
| 582 | SkOpAngle::afterPart {{{235.678497,531.014404}, {229.304855,561}}} id=1
|
| 583 | SkOpSegment::sortAngles [2] tStart=0.0400000195 [32]
|
| 584 | SkOpAngle::after [2/7] 15/15 tStart=0.0400000195 tEnd=0 < [9/21] 14/9 tStart=0 tEnd=0.999710227 < [2/8] 31/31 tStart=0.0400000195 tEnd=0.960000001 F 4
|
| 585 | SkOpAngle::afterPart {{{259.304871,561}, {229.304855,561}}} id=2
|
| 586 | SkOpAngle::afterPart {{{259.304871,561}, {242.741114,561}, {232.165942,547.576327}, {235.678497,531.014404}}} id=9
|
| 587 | SkOpAngle::afterPart {{{259.304871,561}, {949.304871,561}}} id=2
|
| 588 | SkOpSegment::sortAngles [2] tStart=0.960000001 [31]
|
| 589 | SkOpAngle::after [2/9] 15/15 tStart=0.960000001 tEnd=0.0400000195 < [7/20] 0/1 tStart=1 tEnd=0 < [2/10] 31/31 tStart=0.960000001 tEnd=1 F 4
|
| 590 | SkOpAngle::afterPart {{{949.304871,561}, {259.304871,561}}} id=2
|
| 591 | SkOpAngle::afterPart {{{949.304871,561}, {965.873413,561}, {982.15979,547.568542}, {985.681519,531}}} id=7
|
| 592 | SkOpAngle::afterPart {{{949.304871,561}, {979.304871,561}}} id=2
|
| 593 | SkOpSegment::sortAngles [3] tStart=0.11111108 [34]
|
| 594 | SkOpAngle::after [3/11] 21/21 tStart=0.11111108 tEnd=0 < [7/19] 21/17 tStart=0 tEnd=1 < [3/12] 5/5 tStart=0.11111108 tEnd=0.888888874 F 12
|
| 595 | SkOpAngle::afterPart {{{985.681519,531}, {979.30481,561}}} id=3
|
| 596 | SkOpAngle::afterPart {{{985.681519,531}, {982.15979,547.568542}, {965.873413,561}, {949.304871,561}}} id=7
|
| 597 | SkOpAngle::afterPart {{{985.681519,531}, {1030.3183,321}}} id=3
|
| 598 | SkOpSegment::sortAngles [3] tStart=0.888888874 [33]
|
| 599 | SkOpAngle::after [3/13] 21/21 tStart=0.888888874 tEnd=0.11111108 < [5/18] 5/9 tStart=1 tEnd=0 < [3/14] 5/5 tStart=0.888888874 tEnd=1 F 11
|
| 600 | SkOpAngle::afterPart {{{1030.31836,321}, {985.68158,531}}} id=3
|
| 601 | SkOpAngle::afterPart {{{1030.31836,321}, {1033.84021,304.431458}, {1023.26367,291}, {1006.69513,291}}} id=5
|
| 602 | SkOpAngle::afterPart {{{1030.31836,321}, {1036.69507,291}}} id=3
|
| 603 | SkOpSegment::sortAngles [4] tStart=0.0399999219 [35]
|
| 604 | SkOpAngle::after [4/15] 31/31 tStart=0.0399999219 tEnd=0 < [5/17] 30/25 tStart=0 tEnd=1 < [12/28] 15/15 tStart=1 tEnd=0 F 4
|
| 605 | SkOpAngle::afterPart {{{1006.69513,291}, {1036.69507,291}}} id=4
|
| 606 | SkOpAngle::afterPart {{{1006.69513,291}, {1023.26367,291}, {1033.84021,304.431458}, {1030.31836,321}}} id=5
|
| 607 | SkOpAngle::afterPart {{{1006.69513,291}, {316.695129,291}}} id=12
|
| 608 | SkOpSegment::sortAngles [4] tStart=0.959999997 [36]
|
| 609 | SkOpAngle::after [4/16] 15/15 tStart=0.959999997 tEnd=1 < [11/26] 16/17 tStart=1 tEnd=0.000542504226 < [12/27] 31/31 tStart=0 tEnd=1 T 4
|
| 610 | SkOpAngle::afterPart {{{316.695129,291}, {286.695129,291}}} id=4
|
| 611 | SkOpAngle::afterPart {{{316.695129,291}, {300.135575,291}, {283.857845,304.416873}, {280.324158,320.973022}}} id=11
|
| 612 | SkOpAngle::afterPart {{{316.695129,291}, {1006.69513,291}}} id=12
|
| 613 | SkOpSegment::sortAngles [5] tStart=0 [9]
|
| 614 | SkOpSegment::sortAngles [5] tStart=1 [10]
|
| 615 | SkOpSegment::sortAngles [7] tStart=0 [13]
|
| 616 | SkOpSegment::sortAngles [7] tStart=1 [14]
|
| 617 | SkOpSegment::sortAngles [9] tStart=0 [17]
|
| 618 | SkOpSegment::sortAngles [9] tStart=0.999710227 [26]
|
| 619 | SkOpSegment::sortAngles [10] tStart=0 [19]
|
| 620 | SkOpSegment::sortAngles [10] tStart=1 [20]
|
| 621 | SkOpSegment::sortAngles [11] tStart=0.000542504226 [30]
|
Cary Clark | 7eb01e0 | 2016-12-08 14:36:32 -0500 | [diff] [blame] | 622 | SkOpSegment::sortAngles [11] tStart=1 [22]
|
| 623 | SkOpSegment::sortAngles [12] tStart=0 [23]
|
Cary Clark | ff11428 | 2016-12-14 11:56:16 -0500 | [diff] [blame^] | 624 | SkOpSegment::sortAngles [12] tStart=1 [24]
|
| 625 | coinSpan - id=12 t=0 tEnd=1
|
| 626 | coinSpan + id=4 t=0.959999997 tEnd=0.0399999219
|
| 627 | coinSpan - id=3 t=0.11111108 tEnd=0.888888874
|
| 628 | coinSpan + id=6 t=1 tEnd=0
|
| 629 | coinSpan - id=2 t=0.0400000195 tEnd=0.960000001
|
| 630 | coinSpan + id=8 t=1 tEnd=0
|
| 631 | coinSpan - id=1 t=0.111011249 tEnd=0.11111112
|
| 632 | coinSpan + id=11 t=0.000542504226 tEnd=0
|
| 633 | coinSpan - id=10 t=0 tEnd=1
|
| 634 | coinSpan + id=1 t=0.888888891 tEnd=0.11111112
|
| 635 | coinSpan - id=1 t=0.888888891 tEnd=0.888942232
|
| 636 | coinSpan + id=9 t=1 tEnd=0.999710227
|
| 637 | SkOpSegment::debugShowActiveSpans id=1 (286.695129,291 280.324158,320.973022) t=0 tEnd=0.111011249 windSum=? windValue=1
|
| 638 | SkOpSegment::debugShowActiveSpans id=1 (280.324158,320.973022 280.31842,321) t=0.111011249 tEnd=0.11111112 windSum=? oppSum=? windValue=1 oppValue=-1
|
| 639 | SkOpSegment::debugShowActiveSpans id=1 (235.681549,531 235.678497,531.014404) t=0.888888891 tEnd=0.888942232 windSum=? oppSum=? windValue=1 oppValue=-1
|
| 640 | SkOpSegment::debugShowActiveSpans id=1 (235.678497,531.014404 229.304855,561) t=0.888942232 tEnd=1 windSum=? windValue=1
|
| 641 | SkOpSegment::debugShowActiveSpans id=2 (229.304855,561 259.304871,561) t=0 tEnd=0.0400000195 windSum=? windValue=1
|
| 642 | SkOpSegment::debugShowActiveSpans id=2 (259.304871,561 949.304871,561) t=0.0400000195 tEnd=0.960000001 windSum=? oppSum=? windValue=1 oppValue=-1
|
| 643 | SkOpSegment::debugShowActiveSpans id=2 (949.304871,561 979.304871,561) t=0.960000001 tEnd=1 windSum=? windValue=1
|
| 644 | SkOpSegment::debugShowActiveSpans id=3 (979.304871,561 985.68158,531) t=0 tEnd=0.11111108 windSum=? windValue=1
|
| 645 | SkOpSegment::debugShowActiveSpans id=3 (985.68158,531 1030.31836,321) t=0.11111108 tEnd=0.888888874 windSum=? oppSum=? windValue=1 oppValue=-1
|
| 646 | SkOpSegment::debugShowActiveSpans id=3 (1030.31836,321 1036.69507,291) t=0.888888874 tEnd=1 windSum=? windValue=1
|
| 647 | SkOpSegment::debugShowActiveSpans id=4 (1036.69507,291 1006.69513,291) t=0 tEnd=0.0399999219 windSum=? windValue=1
|
| 648 | SkOpSegment::debugShowActiveSpans id=4 (316.695129,291 286.695129,291) t=0.959999997 tEnd=1 windSum=? windValue=1
|
| 649 | SkOpSegment::debugShowActiveSpans id=5 (1006.69513,291 1023.26367,291 1033.84021,304.431458 1030.31836,321) t=0 tEnd=1 windSum=? windValue=1
|
| 650 | SkOpSegment::debugShowActiveSpans id=7 (985.681519,531 982.15979,547.568542 965.873413,561 949.304871,561) t=0 tEnd=1 windSum=? windValue=1
|
| 651 | SkOpSegment::debugShowActiveSpans id=9 (259.304871,561 242.741114,561 232.165942,547.576327 235.678497,531.014404) t=0 tEnd=0.999710227 windSum=? windValue=1
|
| 652 | SkOpSegment::debugShowActiveSpans id=10 (235.681549,531 280.31842,321) t=0 tEnd=1 windSum=? oppSum=? windValue=1 oppValue=1
|
| 653 | SkOpSegment::debugShowActiveSpans id=11 (280.324158,320.973022 283.857845,304.416873 300.135575,291 316.695129,291) t=0.000542504226 tEnd=1 windSum=? windValue=1
|
| 654 | SkOpSegment::debugShowActiveSpans id=12 (316.695129,291 1006.69513,291) t=0 tEnd=1 windSum=? oppSum=? windValue=1 oppValue=1
|
| 655 | SkOpSpan::sortableTop dir=kLeft seg=1 t=0.0555056246 pt=(283.509644,305.986511)
|
| 656 | SkOpSpan::sortableTop [0] valid=1 operand=0 span=1 ccw=0 seg=1 {{{286.695129f, 291}, {229.304855f, 561}}} t=0.0555056246 pt=(283.509644,305.986511) slope=(-57.390274,270)
|
| 657 | SkOpSegment::markWinding id=1 (286.695129,291 229.304855,561) t=0 [1] (286.695129,291) tEnd=0.111011249 newWindSum=1 newOppSum=0 oppSum=0 windSum=1 windValue=1 oppValue=0
|
| 658 | SkOpSegment::markWinding id=1 (286.695129,291 229.304855,561) t=0 [1] (286.695129,291) tEnd=0.111011249 newWindSum=1 newOppSum=0 oppSum=0 windSum=1 windValue=1 oppValue=0
|
| 659 | SkOpSegment::markWinding id=4 (1036.69507,291 286.695129,291) t=0.959999997 [36] (316.695129,291) tEnd=1 newWindSum=1 newOppSum=0 oppSum=? windSum=? windValue=1 oppValue=0
|
| 660 | SkOpSegment::activeOp id=1 t=0.111011249 tEnd=0 op=sect miFrom=1 miTo=0 suFrom=0 suTo=0 result=0
|
| 661 | SkOpSegment::markDone id=1 (286.695129,291 229.304855,561) t=0 [1] (286.695129,291) tEnd=0.111011249 newWindSum=1 newOppSum=0 oppSum=0 windSum=1 windValue=1 oppValue=0
|
| 662 | SkOpSegment::markDone id=4 (1036.69507,291 286.695129,291) t=0.959999997 [36] (316.695129,291) tEnd=1 newWindSum=1 newOppSum=0 oppSum=0 windSum=1 windValue=1 oppValue=0
|
| 663 | bridgeOp chase.append id=4 windSum=1
|
| 664 | SkOpSegment::markWinding id=11 (280.31842,321 283.840179,304.431458 300.126587,291 316.695129,291) t=0.000542504226 [30] (280.324158,320.973022) tEnd=1 newWindSum=-1 newOppSum=1 oppSum=? windSum=? windValue=1 oppValue=0
|
| 665 | SkOpSegment::markAngle last segment=11 span=30 windSum=-1
|
| 666 | SkOpSegment::markWinding id=12 (316.695129,291 1006.69513,291) t=0 [23] (316.695129,291) tEnd=1 newWindSum=-1 newOppSum=2 oppSum=? windSum=? windValue=1 oppValue=1
|
| 667 | SkOpSegment::markAngle last segment=12 span=24
|
| 668 | SkOpSegment::debugShowActiveSpans id=1 (280.324158,320.973022 280.31842,321) t=0.111011249 tEnd=0.11111112 windSum=? oppSum=? windValue=1 oppValue=-1
|
| 669 | SkOpSegment::debugShowActiveSpans id=1 (235.681549,531 235.678497,531.014404) t=0.888888891 tEnd=0.888942232 windSum=? oppSum=? windValue=1 oppValue=-1
|
| 670 | SkOpSegment::debugShowActiveSpans id=1 (235.678497,531.014404 229.304855,561) t=0.888942232 tEnd=1 windSum=? windValue=1
|
| 671 | SkOpSegment::debugShowActiveSpans id=2 (229.304855,561 259.304871,561) t=0 tEnd=0.0400000195 windSum=? windValue=1
|
| 672 | SkOpSegment::debugShowActiveSpans id=2 (259.304871,561 949.304871,561) t=0.0400000195 tEnd=0.960000001 windSum=? oppSum=? windValue=1 oppValue=-1
|
| 673 | SkOpSegment::debugShowActiveSpans id=2 (949.304871,561 979.304871,561) t=0.960000001 tEnd=1 windSum=? windValue=1
|
| 674 | SkOpSegment::debugShowActiveSpans id=3 (979.304871,561 985.68158,531) t=0 tEnd=0.11111108 windSum=? windValue=1
|
| 675 | SkOpSegment::debugShowActiveSpans id=3 (985.68158,531 1030.31836,321) t=0.11111108 tEnd=0.888888874 windSum=? oppSum=? windValue=1 oppValue=-1
|
| 676 | SkOpSegment::debugShowActiveSpans id=3 (1030.31836,321 1036.69507,291) t=0.888888874 tEnd=1 windSum=? windValue=1
|
| 677 | SkOpSegment::debugShowActiveSpans id=4 (1036.69507,291 1006.69513,291) t=0 tEnd=0.0399999219 windSum=? windValue=1
|
| 678 | SkOpSegment::debugShowActiveSpans id=5 (1006.69513,291 1023.26367,291 1033.84021,304.431458 1030.31836,321) t=0 tEnd=1 windSum=? windValue=1
|
| 679 | SkOpSegment::debugShowActiveSpans id=7 (985.681519,531 982.15979,547.568542 965.873413,561 949.304871,561) t=0 tEnd=1 windSum=? windValue=1
|
| 680 | SkOpSegment::debugShowActiveSpans id=9 (259.304871,561 242.741114,561 232.165942,547.576327 235.678497,531.014404) t=0 tEnd=0.999710227 windSum=? windValue=1
|
| 681 | SkOpSegment::debugShowActiveSpans id=10 (235.681549,531 280.31842,321) t=0 tEnd=1 windSum=? oppSum=? windValue=1 oppValue=1
|
| 682 | SkOpSegment::debugShowActiveSpans id=11 (280.324158,320.973022 283.857845,304.416873 300.135575,291 316.695129,291) t=0.000542504226 tEnd=1 windSum=-1 oppSum=1 windValue=1 oppValue=0
|
| 683 | SkOpSegment::debugShowActiveSpans id=12 (316.695129,291 1006.69513,291) t=0 tEnd=1 windSum=-1 oppSum=2 windValue=1 oppValue=1
|
| 684 | SkOpSegment::activeOp id=11 t=1 tEnd=0.000542504226 op=sect miFrom=1 miTo=1 suFrom=0 suTo=1 result=1
|
| 685 | SkOpSegment::markWinding id=1 (286.695129,291 229.304855,561) t=0.111011249 [29] (280.324158,320.973022) tEnd=0.11111112 newWindSum=1 newOppSum=-1 oppSum=? windSum=? windValue=1 oppValue=-1
|
| 686 | SkOpSegment::markAngle last segment=10 span=20
|
| 687 | SkOpSegment::findNextOp
|
| 688 | SkOpAngle::dumpOne [11/25] next=1/1 sect=5/1 s=0.000542504226 [30] e=1 [22] sgn=-1 windVal=1 windSum=-1 oppVal=0 oppSum=1 operand
|
| 689 | SkOpAngle::dumpOne [1/1] next=1/2 sect=5/5 s=0.111011249 [29] e=0 [1] sgn=1 windVal=1 windSum=1 oppVal=0 oppSum=0 done
|
| 690 | SkOpAngle::dumpOne [1/2] next=11/25 sect=21/21 s=0.111011249 [29] e=0.11111112 [28] sgn=-1 windVal=1 windSum=1 oppVal=-1 oppSum=-1
|
| 691 | SkOpSegment::activeOp id=1 t=0.111011249 tEnd=0 op=sect miFrom=1 miTo=0 suFrom=0 suTo=0 result=0
|
| 692 | SkOpSegment::activeOp id=1 t=0.111011249 tEnd=0.11111112 op=sect miFrom=0 miTo=1 suFrom=0 suTo=1 result=1
|
| 693 | SkOpSegment::findNextOp chase.append segment=10 span=20
|
| 694 | SkOpSegment::markDone id=11 (280.31842,321 283.840179,304.431458 300.126587,291 316.695129,291) t=0.000542504226 [30] (280.324158,320.973022) tEnd=1 newWindSum=-1 newOppSum=1 oppSum=1 windSum=-1 windValue=1 oppValue=0
|
| 695 | SkOpSegment::findNextOp from:[11] to:[1] start=2783944 end=2783752
|
| 696 | bridgeOp current id=11 from=(316.695129,291) to=(280.324158,320.973022)
|
| 697 | path.moveTo(316.695129,291);
|
| 698 | path.cubicTo(300.13559,291, 283.857849,304.41687, 280.324158,320.973022);
|
| 699 | SkOpSegment::markWinding id=10 (235.681549,531 280.31842,321) t=0 [19] (235.681549,531) tEnd=1 newWindSum=-1 newOppSum=-1 oppSum=? windSum=? windValue=1 oppValue=1
|
| 700 | SkOpSegment::markAngle last segment=1 span=27 windSum=?
|
| 701 | SkOpSegment::findNextOp
|
| 702 | SkOpAngle::dumpOne [1/3] next=10/24 sect=5/5 s=0.11111112 [28] e=0.111011249 [29] sgn=1 windVal=1 windSum=1 oppVal=-1 oppSum=-1
|
| 703 | SkOpAngle::dumpOne [10/24] next=1/3 sect=21/21 s=1 [20] e=0 [19] sgn=1 windVal=1 windSum=-1 oppVal=1 oppSum=-1 operand
|
| 704 | SkOpSegment::activeOp id=10 t=1 tEnd=0 op=sect miFrom=0 miTo=1 suFrom=0 suTo=1 result=1
|
| 705 | SkOpSegment::findNextOp chase.append segment=1 span=27 windSum=-2147483647
|
| 706 | SkOpSegment::markDone id=1 (286.695129,291 229.304855,561) t=0.111011249 [29] (280.324158,320.973022) tEnd=0.11111112 newWindSum=1 newOppSum=-1 oppSum=-1 windSum=1 windValue=1 oppValue=-1
|
| 707 | SkOpSegment::findNextOp from:[1] to:[10] start=2782336 end=2782192
|
| 708 | bridgeOp current id=1 from=(280.324158,320.973022) to=(280.31842,321)
|
| 709 | SkOpSegment::markWinding id=1 (286.695129,291 229.304855,561) t=0.888888891 [27] (235.681549,531) tEnd=0.888942232 newWindSum=1 newOppSum=-1 oppSum=? windSum=? windValue=1 oppValue=-1
|
| 710 | SkOpSegment::markAngle last segment=1 span=25 windSum=?
|
| 711 | SkOpSegment::findNextOp
|
| 712 | SkOpAngle::dumpOne [10/23] next=1/4 sect=5/5 s=0 [19] e=1 [20] sgn=-1 windVal=1 windSum=-1 oppVal=1 oppSum=-1 operand
|
| 713 | SkOpAngle::dumpOne [1/4] next=10/23 sect=21/21 s=0.888888891 [27] e=0.888942232 [25] sgn=-1 windVal=1 windSum=1 oppVal=-1 oppSum=-1
|
| 714 | SkOpSegment::activeOp id=1 t=0.888888891 tEnd=0.888942232 op=sect miFrom=0 miTo=1 suFrom=0 suTo=1 result=1
|
| 715 | SkOpSegment::findNextOp chase.append segment=1 span=25 windSum=-2147483647
|
| 716 | SkOpSegment::markDone id=10 (235.681549,531 280.31842,321) t=0 [19] (235.681549,531) tEnd=1 newWindSum=-1 newOppSum=-1 oppSum=-1 windSum=-1 windValue=1 oppValue=1
|
| 717 | SkOpSegment::findNextOp from:[10] to:[1] start=2783416 end=2783128
|
| 718 | bridgeOp current id=10 from=(280.31842,321) to=(235.681549,531)
|
| 719 | path.lineTo(280.31842,321);
|
| 720 | SkOpSegment::markWinding id=1 (286.695129,291 229.304855,561) t=0.888942232 [25] (235.678497,531.014404) tEnd=1 newWindSum=1 newOppSum=0 oppSum=? windSum=? windValue=1 oppValue=0
|
| 721 | SkOpSegment::markWinding id=2 (229.304855,561 979.304871,561) t=0 [3] (229.304855,561) tEnd=0.0400000195 newWindSum=1 newOppSum=0 oppSum=? windSum=? windValue=1 oppValue=0
|
| 722 | SkOpSegment::markAngle last segment=2 span=32 windSum=?
|
| 723 | SkOpSegment::markWinding id=9 (259.304871,561 242.736313,561 232.159805,547.568542 235.681549,531) t=0 [17] (259.304871,561) tEnd=0.999710227 newWindSum=-1 newOppSum=1 oppSum=? windSum=? windValue=1 oppValue=0
|
| 724 | SkOpSegment::markAngle last segment=9 span=17 windSum=-1
|
| 725 | SkOpSegment::findNextOp
|
| 726 | SkOpAngle::dumpOne [1/5] next=1/6 sect=5/5 s=0.888942232 [25] e=0.888888891 [27] sgn=1 windVal=1 windSum=1 oppVal=-1 oppSum=-1
|
| 727 | SkOpAngle::dumpOne [1/6] next=9/22 sect=21/21 s=0.888942232 [25] e=1 [2] sgn=-1 windVal=1 windSum=1 oppVal=0 oppSum=0
|
| 728 | SkOpAngle::dumpOne [9/22] next=1/5 sect=21/25 s=0.999710227 [26] e=0 [17] sgn=1 windVal=1 windSum=-1 oppVal=0 oppSum=1 operand
|
| 729 | SkOpSegment::activeOp id=1 t=0.888942232 tEnd=1 op=sect miFrom=0 miTo=1 suFrom=0 suTo=0 result=0
|
| 730 | SkOpSegment::markDone id=1 (286.695129,291 229.304855,561) t=0.888942232 [25] (235.678497,531.014404) tEnd=1 newWindSum=1 newOppSum=0 oppSum=0 windSum=1 windValue=1 oppValue=0
|
| 731 | SkOpSegment::markDone id=2 (229.304855,561 979.304871,561) t=0 [3] (229.304855,561) tEnd=0.0400000195 newWindSum=1 newOppSum=0 oppSum=0 windSum=1 windValue=1 oppValue=0
|
| 732 | SkOpSegment::findNextOp chase.append segment=2 span=32 windSum=-2147483647
|
| 733 | SkOpSegment::activeOp id=9 t=0.999710227 tEnd=0 op=sect miFrom=1 miTo=1 suFrom=0 suTo=1 result=1
|
| 734 | SkOpSegment::findNextOp chase.append segment=9 span=17 windSum=-1
|
| 735 | SkOpSegment::markDone id=1 (286.695129,291 229.304855,561) t=0.888888891 [27] (235.681549,531) tEnd=0.888942232 newWindSum=1 newOppSum=-1 oppSum=-1 windSum=1 windValue=1 oppValue=-1
|
| 736 | SkOpSegment::findNextOp from:[1] to:[9] start=2783272 end=2781880
|
| 737 | bridgeOp current id=1 from=(235.681549,531) to=(235.678497,531.014404)
|
| 738 | path.lineTo(235.681549,531);
|
| 739 | SkOpSegment::markWinding id=2 (229.304855,561 979.304871,561) t=0.0400000195 [32] (259.304871,561) tEnd=0.960000001 newWindSum=1 newOppSum=-1 oppSum=? windSum=? windValue=1 oppValue=-1
|
| 740 | SkOpSegment::markAngle last segment=2 span=31 windSum=?
|
| 741 | SkOpSegment::findNextOp
|
| 742 | SkOpAngle::dumpOne [9/21] next=2/7 sect=14/9 s=0 [17] e=0.999710227 [26] sgn=-1 windVal=1 windSum=-1 oppVal=0 oppSum=1 operand
|
| 743 | SkOpAngle::dumpOne [2/7] next=2/8 sect=15/15 s=0.0400000195 [32] e=0 [3] sgn=1 windVal=1 windSum=1 oppVal=0 oppSum=0 done
|
| 744 | SkOpAngle::dumpOne [2/8] next=9/21 sect=31/31 s=0.0400000195 [32] e=0.960000001 [31] sgn=-1 windVal=1 windSum=1 oppVal=-1 oppSum=-1
|
| 745 | SkOpSegment::activeOp id=2 t=0.0400000195 tEnd=0 op=sect miFrom=1 miTo=0 suFrom=0 suTo=0 result=0
|
| 746 | SkOpSegment::activeOp id=2 t=0.0400000195 tEnd=0.960000001 op=sect miFrom=0 miTo=1 suFrom=0 suTo=1 result=1
|
| 747 | SkOpSegment::findNextOp chase.append segment=2 span=31 windSum=-2147483647
|
| 748 | SkOpSegment::markDone id=9 (259.304871,561 242.736313,561 232.159805,547.568542 235.681549,531) t=0 [17] (259.304871,561) tEnd=0.999710227 newWindSum=-1 newOppSum=1 oppSum=1 windSum=-1 windValue=1 oppValue=0
|
| 749 | SkOpSegment::findNextOp from:[9] to:[2] start=2784424 end=2784280
|
| 750 | bridgeOp current id=9 from=(235.678497,531.014404) to=(259.304871,561)
|
| 751 | path.lineTo(235.678497,531.014404);
|
| 752 | path.cubicTo(232.165939,547.576355, 242.741119,561, 259.304871,561);
|
| 753 | SkOpSegment::markWinding id=2 (229.304855,561 979.304871,561) t=0.960000001 [31] (949.304871,561) tEnd=1 newWindSum=1 newOppSum=0 oppSum=? windSum=? windValue=1 oppValue=0
|
| 754 | SkOpSegment::markWinding id=3 (979.304871,561 1036.69507,291) t=0 [5] (979.304871,561) tEnd=0.11111108 newWindSum=1 newOppSum=0 oppSum=? windSum=? windValue=1 oppValue=0
|
| 755 | SkOpSegment::markAngle last segment=3 span=34 windSum=?
|
| 756 | SkOpSegment::markWinding id=7 (985.681519,531 982.15979,547.568542 965.873413,561 949.304871,561) t=0 [13] (985.681519,531) tEnd=1 newWindSum=-1 newOppSum=1 oppSum=? windSum=? windValue=1 oppValue=0
|
| 757 | SkOpSegment::markAngle last segment=7 span=13 windSum=-1
|
| 758 | SkOpSegment::findNextOp
|
| 759 | SkOpAngle::dumpOne [2/9] next=2/10 sect=15/15 s=0.960000001 [31] e=0.0400000195 [32] sgn=1 windVal=1 windSum=1 oppVal=-1 oppSum=-1
|
| 760 | SkOpAngle::dumpOne [2/10] next=7/20 sect=31/31 s=0.960000001 [31] e=1 [4] sgn=-1 windVal=1 windSum=1 oppVal=0 oppSum=0
|
| 761 | SkOpAngle::dumpOne [7/20] next=2/9 sect=0/1 s=1 [14] e=0 [13] sgn=1 windVal=1 windSum=-1 oppVal=0 oppSum=1 operand
|
| 762 | SkOpSegment::activeOp id=2 t=0.960000001 tEnd=1 op=sect miFrom=0 miTo=1 suFrom=0 suTo=0 result=0
|
| 763 | SkOpSegment::markDone id=2 (229.304855,561 979.304871,561) t=0.960000001 [31] (949.304871,561) tEnd=1 newWindSum=1 newOppSum=0 oppSum=0 windSum=1 windValue=1 oppValue=0
|
| 764 | SkOpSegment::markDone id=3 (979.304871,561 1036.69507,291) t=0 [5] (979.304871,561) tEnd=0.11111108 newWindSum=1 newOppSum=0 oppSum=0 windSum=1 windValue=1 oppValue=0
|
| 765 | SkOpSegment::findNextOp chase.append segment=3 span=34 windSum=-2147483647
|
| 766 | SkOpSegment::activeOp id=7 t=1 tEnd=0 op=sect miFrom=1 miTo=1 suFrom=0 suTo=1 result=1
|
| 767 | SkOpSegment::findNextOp chase.append segment=7 span=13 windSum=-1
|
| 768 | SkOpSegment::markDone id=2 (229.304855,561 979.304871,561) t=0.0400000195 [32] (259.304871,561) tEnd=0.960000001 newWindSum=1 newOppSum=-1 oppSum=-1 windSum=1 windValue=1 oppValue=-1
|
| 769 | SkOpSegment::findNextOp from:[2] to:[7] start=2781400 end=2781256
|
| 770 | bridgeOp current id=2 from=(259.304871,561) to=(949.304871,561)
|
| 771 | SkOpSegment::markWinding id=3 (979.304871,561 1036.69507,291) t=0.11111108 [34] (985.68158,531) tEnd=0.888888874 newWindSum=1 newOppSum=-1 oppSum=? windSum=? windValue=1 oppValue=-1
|
| 772 | SkOpSegment::markAngle last segment=3 span=33 windSum=?
|
| 773 | SkOpSegment::findNextOp
|
| 774 | SkOpAngle::dumpOne [7/19] next=3/11 sect=21/17 s=0 [13] e=1 [14] sgn=-1 windVal=1 windSum=-1 oppVal=0 oppSum=1 operand
|
| 775 | SkOpAngle::dumpOne [3/11] next=3/12 sect=21/21 s=0.11111108 [34] e=0 [5] sgn=1 windVal=1 windSum=1 oppVal=0 oppSum=0 done
|
| 776 | SkOpAngle::dumpOne [3/12] next=7/19 sect=5/5 s=0.11111108 [34] e=0.888888874 [33] sgn=-1 windVal=1 windSum=1 oppVal=-1 oppSum=-1
|
| 777 | SkOpSegment::activeOp id=3 t=0.11111108 tEnd=0 op=sect miFrom=1 miTo=0 suFrom=0 suTo=0 result=0
|
| 778 | SkOpSegment::activeOp id=3 t=0.11111108 tEnd=0.888888874 op=sect miFrom=0 miTo=1 suFrom=0 suTo=1 result=1
|
| 779 | SkOpSegment::findNextOp chase.append segment=3 span=33 windSum=-2147483647
|
| 780 | SkOpSegment::markDone id=7 (985.681519,531 982.15979,547.568542 965.873413,561 949.304871,561) t=0 [13] (985.681519,531) tEnd=1 newWindSum=-1 newOppSum=1 oppSum=1 windSum=-1 windValue=1 oppValue=0
|
| 781 | SkOpSegment::findNextOp from:[7] to:[3] start=2784760 end=2784616
|
| 782 | bridgeOp current id=7 from=(949.304871,561) to=(985.681519,531)
|
| 783 | path.lineTo(949.304871,561);
|
| 784 | path.cubicTo(965.873413,561, 982.15979,547.568542, 985.681519,531);
|
| 785 | SkOpSegment::markWinding id=3 (979.304871,561 1036.69507,291) t=0.888888874 [33] (1030.31836,321) tEnd=1 newWindSum=1 newOppSum=0 oppSum=? windSum=? windValue=1 oppValue=0
|
| 786 | SkOpSegment::markWinding id=4 (1036.69507,291 286.695129,291) t=0 [7] (1036.69507,291) tEnd=0.0399999219 newWindSum=1 newOppSum=0 oppSum=? windSum=? windValue=1 oppValue=0
|
| 787 | SkOpSegment::markAngle last segment=4 span=35 windSum=?
|
| 788 | SkOpSegment::markWinding id=5 (1006.69513,291 1023.26367,291 1033.84021,304.431458 1030.31836,321) t=0 [9] (1006.69513,291) tEnd=1 newWindSum=-1 newOppSum=1 oppSum=? windSum=? windValue=1 oppValue=0
|
| 789 | SkOpSegment::markAngle last segment=5 span=9 windSum=-1
|
| 790 | SkOpSegment::findNextOp
|
| 791 | SkOpAngle::dumpOne [3/13] next=3/14 sect=21/21 s=0.888888874 [33] e=0.11111108 [34] sgn=1 windVal=1 windSum=1 oppVal=-1 oppSum=-1
|
| 792 | SkOpAngle::dumpOne [3/14] next=5/18 sect=5/5 s=0.888888874 [33] e=1 [6] sgn=-1 windVal=1 windSum=1 oppVal=0 oppSum=0
|
| 793 | SkOpAngle::dumpOne [5/18] next=3/13 sect=5/9 s=1 [10] e=0 [9] sgn=1 windVal=1 windSum=-1 oppVal=0 oppSum=1 operand
|
| 794 | SkOpSegment::activeOp id=3 t=0.888888874 tEnd=1 op=sect miFrom=0 miTo=1 suFrom=0 suTo=0 result=0
|
| 795 | SkOpSegment::markDone id=3 (979.304871,561 1036.69507,291) t=0.888888874 [33] (1030.31836,321) tEnd=1 newWindSum=1 newOppSum=0 oppSum=0 windSum=1 windValue=1 oppValue=0
|
| 796 | SkOpSegment::markDone id=4 (1036.69507,291 286.695129,291) t=0 [7] (1036.69507,291) tEnd=0.0399999219 newWindSum=1 newOppSum=0 oppSum=0 windSum=1 windValue=1 oppValue=0
|
| 797 | SkOpSegment::findNextOp chase.append segment=4 span=35 windSum=-2147483647
|
| 798 | SkOpSegment::activeOp id=5 t=1 tEnd=0 op=sect miFrom=1 miTo=1 suFrom=0 suTo=1 result=1
|
| 799 | SkOpSegment::findNextOp chase.append segment=5 span=9 windSum=-1
|
| 800 | SkOpSegment::markDone id=3 (979.304871,561 1036.69507,291) t=0.11111108 [34] (985.68158,531) tEnd=0.888888874 newWindSum=1 newOppSum=-1 oppSum=-1 windSum=1 windValue=1 oppValue=-1
|
| 801 | SkOpSegment::findNextOp from:[3] to:[5] start=2780712 end=2780568
|
| 802 | bridgeOp current id=3 from=(985.68158,531) to=(1030.31836,321)
|
| 803 | SkOpSegment::findNextOp
|
| 804 | SkOpAngle::dumpOne [5/17] next=4/15 sect=30/25 s=0 [9] e=1 [10] sgn=-1 windVal=1 windSum=-1 oppVal=0 oppSum=1 operand
|
| 805 | SkOpAngle::dumpOne [4/15] next=12/28 sect=31/31 s=0.0399999219 [35] e=0 [7] sgn=1 windVal=1 windSum=1 oppVal=0 oppSum=0 done
|
| 806 | SkOpAngle::dumpOne [12/28] next=5/17 sect=15/15 s=1 [24] e=0 [23] sgn=1 windVal=1 windSum=-1 oppVal=1 oppSum=2 operand
|
| 807 | SkOpSegment::activeOp id=4 t=0.0399999219 tEnd=0 op=sect miFrom=1 miTo=0 suFrom=0 suTo=0 result=0
|
| 808 | SkOpSegment::activeOp id=12 t=1 tEnd=0 op=sect miFrom=0 miTo=1 suFrom=0 suTo=1 result=1
|
| 809 | SkOpSegment::markDone id=5 (1006.69513,291 1023.26367,291 1033.84021,304.431458 1030.31836,321) t=0 [9] (1006.69513,291) tEnd=1 newWindSum=-1 newOppSum=1 oppSum=1 windSum=-1 windValue=1 oppValue=0
|
| 810 | SkOpSegment::findNextOp from:[5] to:[12] start=2782960 end=2782816
|
| 811 | bridgeOp current id=5 from=(1030.31836,321) to=(1006.69513,291)
|
| 812 | path.lineTo(1030.31836,321);
|
| 813 | path.cubicTo(1033.84021,304.431458, 1023.26367,291, 1006.69513,291);
|
| 814 | SkOpSegment::findNextOp
|
| 815 | SkOpAngle::dumpOne [12/27] next=4/16 sect=31/31 s=0 [23] e=1 [24] sgn=-1 windVal=1 windSum=-1 oppVal=1 oppSum=2 operand
|
| 816 | SkOpAngle::dumpOne [4/16] next=11/26 sect=15/15 s=0.959999997 [36] e=1 [8] sgn=-1 windVal=1 windSum=1 oppVal=0 oppSum=0 done
|
| 817 | SkOpAngle::dumpOne [11/26] next=12/27 sect=16/17 s=1 [22] e=0.000542504226 [30] sgn=1 windVal=1 windSum=-1 oppVal=0 oppSum=1 done operand
|
| 818 | SkOpSegment::activeOp id=4 t=0.959999997 tEnd=1 op=sect miFrom=0 miTo=1 suFrom=0 suTo=0 result=0
|
| 819 | SkOpSegment::activeOp id=11 t=1 tEnd=0.000542504226 op=sect miFrom=1 miTo=1 suFrom=0 suTo=1 result=1
|
| 820 | SkOpSegment::markDone id=12 (316.695129,291 1006.69513,291) t=0 [23] (316.695129,291) tEnd=1 newWindSum=-1 newOppSum=2 oppSum=2 windSum=-1 windValue=1 oppValue=1
|
| 821 | SkOpSegment::findNextOp from:[12] to:[11] start=2782648 end=2784088
|
| 822 | bridgeOp current id=12 from=(1006.69513,291) to=(316.695129,291)
|
| 823 | path.lineTo(316.695129,291);
|
Cary Clark | 7eb01e0 | 2016-12-08 14:36:32 -0500 | [diff] [blame] | 824 | path.close();
|
Cary Clark | ff11428 | 2016-12-14 11:56:16 -0500 | [diff] [blame^] | 825 | </div>
|
| 826 | |
| 827 | Skia UnitTests: --match PathOpsOp$ --resourcePath resources\ -v -V SK_DEBUG
|
| 828 |
|
| 829 | <div id="skpeldorado_com_ua1_broken">
|
| 830 | SkDCubic::ComplexBreak
|
| 831 | {{{1006.69512939453125, 291}, {1023.263671875, 291}, {1033.8402099609375, 304.43145751953125}, {1030.318359375, 321}}},
|
| 832 | maxCurvature[0]=0.474344964 {{{998.1828178832590766, 267.6895845341347808}, {1052.542975701327805, 330.2457181562319306}}},
|
| 833 | SkDCubic::ComplexBreak
|
| 834 | {{{259.30487060546875, 561}, {242.7363128662109375, 561}, {232.1598052978515625, 547.56854248046875}, {235.681549072265625, 531}}},
|
| 835 | maxCurvature[0]=0.474343429 {{{267.8173432015576623, 584.3103847404762519}, {213.4569259608067568, 521.7544086132262464}}},
|
| 836 | seg=1 {{{286.695129f, 291}, {229.304855f, 561}}}
|
| 837 | seg=2 {{{229.304855f, 561}, {979.304871f, 561}}}
|
| 838 | seg=3 {{{979.304871f, 561}, {1036.69507f, 291}}}
|
| 839 | seg=4 {{{1036.69507f, 291}, {286.695129f, 291}}}
|
| 840 | op sect
|
| 841 | seg=5 {{{1006.69513f, 291}, {1023.26367f, 291}, {1033.84021f, 304.431458f}, {1030.31836f, 321}}}
|
| 842 | seg=6 {{{1030.31836f, 321}, {985.681519f, 531}}}
|
| 843 | seg=7 {{{985.681519f, 531}, {982.15979f, 547.568542f}, {965.873413f, 561}, {949.304871f, 561}}}
|
| 844 | seg=8 {{{949.304871f, 561}, {259.304871f, 561}}}
|
| 845 | seg=9 {{{259.304871f, 561}, {242.736313f, 561}, {232.159805f, 547.568542f}, {235.681549f, 531}}}
|
| 846 | seg=10 {{{235.681549f, 531}, {280.31842f, 321}}}
|
| 847 | seg=11 {{{280.31842f, 321}, {283.840179f, 304.431458f}, {300.126587f, 291}, {316.695129f, 291}}}
|
| 848 | seg=12 {{{316.695129f, 291}, {1006.69513f, 291}}}
|
| 849 | debugShowLineIntersection wtTs[0]=1 {{{286.695129,291}, {229.304855,561}}} {{229.304855,561}} wnTs[0]=0 {{{229.304855,561}, {979.304871,561}}}
|
| 850 | debugShowLineIntersection wtTs[0]=0 {{{286.695129,291}, {229.304855,561}}} {{286.695129,291}} wnTs[0]=1 {{{1036.69507,291}, {286.695129,291}}}
|
| 851 | debugShowLineIntersection wtTs[0]=0 {{{979.304871,561}, {1036.69507,291}}} {{979.304871,561}} wnTs[0]=1 {{{229.304855,561}, {979.304871,561}}}
|
| 852 | debugShowLineIntersection wtTs[0]=1 {{{979.304871,561}, {1036.69507,291}}} {{1036.69507,291}} wnTs[0]=0 {{{1036.69507,291}, {286.695129,291}}}
|
| 853 | debugShowLineIntersection no intersect {{{286.695129,291}, {229.304855,561}}} {{{949.304871,561}, {259.304871,561}}}
|
| 854 | debugShowCubicLineIntersection wtTs[0]=0.999710227 {{{259.304871,561}, {242.736313,561}, {232.159805,547.568542}, {235.681549,531}}} {{235.678497,531.014404}} wtTs[1]=1 {{235.681549,531}} wnTs[0]=0.888942 {{{286.695129,291}, {229.304855,561}}} wnTs[1]=0.888888891
|
| 855 | SkOpSegment::addT insert t=0.888942232 segID=1 spanID=25
|
| 856 | SkOpSegment::addT insert t=0.999710227 segID=9 spanID=26
|
| 857 | SkOpSegment::addT insert t=0.888888891 segID=1 spanID=27
|
| 858 | debugShowLineIntersection wtTs[0]=0.11111112 {{{286.695129,291}, {229.304855,561}}} {{280.31842,321}} wtTs[1]=0.888888891 {{235.681549,531}} wnTs[0]=1 {{{235.681549,531}, {280.31842,321}}} wnTs[1]=0
|
| 859 | SkOpSegment::addT insert t=0.11111112 segID=1 spanID=28
|
| 860 | debugShowCubicLineIntersection wtTs[0]=0 {{{280.31842,321}, {283.840179,304.431458}, {300.126587,291}, {316.695129,291}}} {{280.31842,321}} wtTs[1]=0.000542504226 {{280.324158,320.973022}} wnTs[0]=0.111111 {{{286.695129,291}, {229.304855,561}}} wnTs[1]=0.111011249
|
| 861 | SkOpSegment::addT insert t=0.111011249 segID=1 spanID=29
|
| 862 | SkOpSegment::addT insert t=0.000542504226 segID=11 spanID=30
|
| 863 | debugShowCubicLineIntersection wtTs[0]=1 {{{985.681519,531}, {982.15979,547.568542}, {965.873413,561}, {949.304871,561}}} {{949.304871,561}} wnTs[0]=0.96 {{{229.304855,561}, {979.304871,561}}}
|
| 864 | SkOpSegment::addT insert t=0.960000001 segID=2 spanID=31
|
| 865 | debugShowLineIntersection wtTs[0]=0 {{{949.304871,561}, {259.304871,561}}} {{949.304871,561}} wtTs[1]=1 {{259.304871,561}} wnTs[0]=0.96 {{{229.304855,561}, {979.304871,561}}} wnTs[1]=0.0400000195
|
| 866 | SkOpSegment::addT insert t=0.0400000195 segID=2 spanID=32
|
| 867 | debugShowCubicLineIntersection wtTs[0]=0 {{{259.304871,561}, {242.736313,561}, {232.159805,547.568542}, {235.681549,531}}} {{259.304871,561}} wnTs[0]=0.04 {{{229.304855,561}, {979.304871,561}}}
|
| 868 | debugShowCubicLineIntersection wtTs[0]=1 {{{1006.69513,291}, {1023.26367,291}, {1033.84021,304.431458}, {1030.31836,321}}} {{1030.31836,321}} wnTs[0]=0.888889 {{{979.304871,561}, {1036.69507,291}}}
|
| 869 | SkOpSegment::addT insert t=0.888888874 segID=3 spanID=33
|
| 870 | debugShowLineIntersection wtTs[0]=0.11111108 {{{979.304871,561}, {1036.69507,291}}} {{985.681519,531}} wtTs[1]=0.888888874 {{1030.31836,321}} wnTs[0]=1 {{{1030.31836,321}, {985.681519,531}}} wnTs[1]=0
|
| 871 | SkOpSegment::addT insert t=0.11111108 segID=3 spanID=34
|
| 872 | debugShowCubicLineIntersection wtTs[0]=0 {{{985.681519,531}, {982.15979,547.568542}, {965.873413,561}, {949.304871,561}}} {{985.681519,531}} wnTs[0]=0.111111 {{{979.304871,561}, {1036.69507,291}}}
|
| 873 | debugShowLineIntersection no intersect {{{979.304871,561}, {1036.69507,291}}} {{{316.695129,291}, {1006.69513,291}}}
|
| 874 | debugShowCubicLineIntersection wtTs[0]=0 {{{1006.69513,291}, {1023.26367,291}, {1033.84021,304.431458}, {1030.31836,321}}} {{1006.69513,291}} wnTs[0]=0.0399999 {{{1036.69507,291}, {286.695129,291}}}
|
| 875 | SkOpSegment::addT insert t=0.0399999219 segID=4 spanID=35
|
| 876 | debugShowCubicLineIntersection wtTs[0]=1 {{{280.31842,321}, {283.840179,304.431458}, {300.126587,291}, {316.695129,291}}} {{316.695129,291}} wnTs[0]=0.96 {{{1036.69507,291}, {286.695129,291}}}
|
| 877 | SkOpSegment::addT insert t=0.959999997 segID=4 spanID=36
|
| 878 | debugShowLineIntersection wtTs[0]=0 {{{316.695129,291}, {1006.69513,291}}} {{316.695129,291}} wtTs[1]=1 {{1006.69513,291}} wnTs[0]=0.96 {{{1036.69507,291}, {286.695129,291}}} wnTs[1]=0.0399999219
|
| 879 | debugShowCubicLineIntersection wtTs[0]=1 {{{1006.69513,291}, {1023.26367,291}, {1033.84021,304.431458}, {1030.31836,321}}} {{1030.31836,321}} wnTs[0]=0 {{{1030.31836,321}, {985.681519,531}}}
|
| 880 | debugShowCubicLineIntersection wtTs[0]=0 {{{1006.69513,291}, {1023.26367,291}, {1033.84021,304.431458}, {1030.31836,321}}} {{1006.69513,291}} wnTs[0]=1 {{{316.695129,291}, {1006.69513,291}}}
|
| 881 | debugShowCubicLineIntersection wtTs[0]=0 {{{985.681519,531}, {982.15979,547.568542}, {965.873413,561}, {949.304871,561}}} {{985.681519,531}} wnTs[0]=1 {{{1030.31836,321}, {985.681519,531}}}
|
| 882 | debugShowCubicLineIntersection wtTs[0]=1 {{{985.681519,531}, {982.15979,547.568542}, {965.873413,561}, {949.304871,561}}} {{949.304871,561}} wnTs[0]=0 {{{949.304871,561}, {259.304871,561}}}
|
| 883 | debugShowCubicLineIntersection wtTs[0]=0 {{{259.304871,561}, {242.736313,561}, {232.159805,547.568542}, {235.681549,531}}} {{259.304871,561}} wnTs[0]=1 {{{949.304871,561}, {259.304871,561}}}
|
| 884 | debugShowCubicLineIntersection wtTs[0]=1 {{{259.304871,561}, {242.736313,561}, {232.159805,547.568542}, {235.681549,531}}} {{235.681549,531}} wnTs[0]=0 {{{235.681549,531}, {280.31842,321}}}
|
| 885 | debugShowCubicLineIntersection wtTs[0]=0 {{{280.31842,321}, {283.840179,304.431458}, {300.126587,291}, {316.695129,291}}} {{280.31842,321}} wnTs[0]=1 {{{235.681549,531}, {280.31842,321}}}
|
| 886 | debugShowCubicLineIntersection wtTs[0]=1 {{{280.31842,321}, {283.840179,304.431458}, {300.126587,291}, {316.695129,291}}} {{316.695129,291}} wnTs[0]=0 {{{316.695129,291}, {1006.69513,291}}}
|
| 887 | ------------------x--x---------------- addExpanded
|
| 888 | 00: seg/base=12/23 seg/base=4/35 MarkCoinStart
|
| 889 | 01: seg/base=12/24 seg/base=4/36 MarkCoinEnd
|
| 890 | 02: seg/base=3/34 seg/base=6/11 MarkCoinStart
|
| 891 | 03: seg/base=3/33 seg/base=6/12 MarkCoinEnd
|
| 892 | 04: seg/base=2/32 seg/base=8/15 MarkCoinStart
|
| 893 | 05: seg/base=2/31 seg/base=8/16 MarkCoinEnd
|
| 894 | 06: seg/base=1/29 seg/base=11/21 MarkCoinStart
|
| 895 | 07: seg/base=1/28 seg/base=11/30 MarkCoinEnd
|
| 896 | 08: seg/base=10/19 seg/base=1/28 MarkCoinStart
|
| 897 | 09: seg/base=10/20 seg/base=1/27 MarkCoinEnd
|
| 898 | 10: seg/base=1/27 seg/base=9/26 MarkCoinStart
|
| 899 | 11: seg/base=1/25 seg/base=9/18 MarkCoinEnd
|
| 900 | SkOpSegment::debugShowActiveSpans id=1 (286.695129,291 280.324158,320.973022) t=0 tEnd=0.111011249 windSum=? windValue=1
|
| 901 | SkOpSegment::debugShowActiveSpans id=1 (280.324158,320.973022 280.31842,321) t=0.111011249 tEnd=0.11111112 windSum=? windValue=1
|
| 902 | SkOpSegment::debugShowActiveSpans id=1 (280.31842,321 235.681549,531) t=0.11111112 tEnd=0.888888891 windSum=? windValue=1
|
| 903 | SkOpSegment::debugShowActiveSpans id=1 (235.681549,531 235.678497,531.014404) t=0.888888891 tEnd=0.888942232 windSum=? windValue=1
|
| 904 | SkOpSegment::debugShowActiveSpans id=1 (235.678497,531.014404 229.304855,561) t=0.888942232 tEnd=1 windSum=? windValue=1
|
| 905 | SkOpSegment::debugShowActiveSpans id=2 (229.304855,561 259.304871,561) t=0 tEnd=0.0400000195 windSum=? windValue=1
|
| 906 | SkOpSegment::debugShowActiveSpans id=2 (259.304871,561 949.304871,561) t=0.0400000195 tEnd=0.960000001 windSum=? windValue=1
|
| 907 | SkOpSegment::debugShowActiveSpans id=2 (949.304871,561 979.304871,561) t=0.960000001 tEnd=1 windSum=? windValue=1
|
| 908 | SkOpSegment::debugShowActiveSpans id=3 (979.304871,561 985.68158,531) t=0 tEnd=0.11111108 windSum=? windValue=1
|
| 909 | SkOpSegment::debugShowActiveSpans id=3 (985.68158,531 1030.31836,321) t=0.11111108 tEnd=0.888888874 windSum=? windValue=1
|
| 910 | SkOpSegment::debugShowActiveSpans id=3 (1030.31836,321 1036.69507,291) t=0.888888874 tEnd=1 windSum=? windValue=1
|
| 911 | SkOpSegment::debugShowActiveSpans id=4 (1036.69507,291 1006.69513,291) t=0 tEnd=0.0399999219 windSum=? windValue=1
|
| 912 | SkOpSegment::debugShowActiveSpans id=4 (1006.69513,291 316.695129,291) t=0.0399999219 tEnd=0.959999997 windSum=? windValue=1
|
| 913 | SkOpSegment::debugShowActiveSpans id=4 (316.695129,291 286.695129,291) t=0.959999997 tEnd=1 windSum=? windValue=1
|
| 914 | SkOpSegment::debugShowActiveSpans id=5 (1006.69513,291 1023.26367,291 1033.84021,304.431458 1030.31836,321) t=0 tEnd=1 windSum=? windValue=1
|
| 915 | SkOpSegment::debugShowActiveSpans id=6 (1030.31836,321 985.681519,531) t=0 tEnd=1 windSum=? windValue=1
|
| 916 | SkOpSegment::debugShowActiveSpans id=7 (985.681519,531 982.15979,547.568542 965.873413,561 949.304871,561) t=0 tEnd=1 windSum=? windValue=1
|
| 917 | SkOpSegment::debugShowActiveSpans id=8 (949.304871,561 259.304871,561) t=0 tEnd=1 windSum=? windValue=1
|
| 918 | SkOpSegment::debugShowActiveSpans id=9 (259.304871,561 242.741114,561 232.165942,547.576327 235.678497,531.014404) t=0 tEnd=0.999710227 windSum=? windValue=1
|
| 919 | SkOpSegment::debugShowActiveSpans id=9 (235.678497,531.014404 235.679515,531.009604 235.680529,531.004801 235.681549,531) t=0.999710227 tEnd=1 windSum=? windValue=1
|
| 920 | SkOpSegment::debugShowActiveSpans id=10 (235.681549,531 280.31842,321) t=0 tEnd=1 windSum=? windValue=1
|
| 921 | SkOpSegment::debugShowActiveSpans id=11 (280.31842,321 280.320331,320.991011 280.32224,320.982009 280.324158,320.973022) t=0 tEnd=0.000542504226 windSum=? windValue=1
|
| 922 | SkOpSegment::debugShowActiveSpans id=11 (280.324158,320.973022 283.857845,304.416873 300.135575,291 316.695129,291) t=0.000542504226 tEnd=1 windSum=? windValue=1
|
| 923 | SkOpSegment::debugShowActiveSpans id=12 (316.695129,291 1006.69513,291) t=0 tEnd=1 windSum=? windValue=1
|
| 924 | ------------------x--x---------------- move_multiples
|
| 925 | 00: seg/base=12/23 seg/base=4/35 MarkCoinStart
|
| 926 | 01: seg/base=12/24 seg/base=4/36 MarkCoinEnd
|
| 927 | 02: seg/base=3/34 seg/base=6/11 MarkCoinStart
|
| 928 | 03: seg/base=3/33 seg/base=6/12 MarkCoinEnd
|
| 929 | 04: seg/base=2/32 seg/base=8/15 MarkCoinStart
|
| 930 | 05: seg/base=2/31 seg/base=8/16 MarkCoinEnd
|
| 931 | 06: seg/base=1/29 seg/base=11/21 MarkCoinStart
|
| 932 | 07: seg/base=1/28 seg/base=11/30 MarkCoinEnd
|
| 933 | 08: seg/base=10/19 seg/base=1/28 MarkCoinStart
|
| 934 | 09: seg/base=10/20 seg/base=1/27 MarkCoinEnd
|
| 935 | 10: seg/base=1/27 seg/base=9/26 MarkCoinStart
|
| 936 | 11: seg/base=1/25 seg/base=9/18 MarkCoinEnd
|
| 937 | ------------------x--x---------------- move_nearby
|
| 938 | 00: seg/base=12/23 seg/base=4/35 MarkCoinStart
|
| 939 | 01: seg/base=12/24 seg/base=4/36 MarkCoinEnd
|
| 940 | 02: seg/base=3/34 seg/base=6/11 MarkCoinStart
|
| 941 | 03: seg/base=3/33 seg/base=6/12 MarkCoinEnd
|
| 942 | 04: seg/base=2/32 seg/base=8/15 MarkCoinStart
|
| 943 | 05: seg/base=2/31 seg/base=8/16 MarkCoinEnd
|
| 944 | 06: seg/base=1/29 seg/base=11/21 MarkCoinStart
|
| 945 | 07: seg/base=1/28 seg/base=11/30 MarkCoinEnd
|
| 946 | 08: seg/base=10/19 seg/base=1/28 MarkCoinStart
|
| 947 | 09: seg/base=10/20 seg/base=1/27 MarkCoinEnd
|
| 948 | 10: seg/base=1/27 seg/base=9/26 MarkCoinStart
|
| 949 | 11: seg/base=1/25 seg/base=9/18 MarkCoinEnd
|
| 950 | ------------------x--x---------------- correctEnds
|
| 951 | 00: seg/base=12/23 seg/base=4/35 MarkCoinStart
|
| 952 | 01: seg/base=12/24 seg/base=4/36 MarkCoinEnd
|
| 953 | 02: seg/base=3/34 seg/base=6/11 MarkCoinStart
|
| 954 | 03: seg/base=3/33 seg/base=6/12 MarkCoinEnd
|
| 955 | 04: seg/base=2/32 seg/base=8/15 MarkCoinStart
|
| 956 | 05: seg/base=2/31 seg/base=8/16 MarkCoinEnd
|
| 957 | 06: seg/base=1/29 seg/base=11/21 MarkCoinStart
|
| 958 | 07: seg/base=1/28 seg/base=11/30 MarkCoinEnd
|
| 959 | 08: seg/base=10/19 seg/base=1/28 MarkCoinStart
|
| 960 | 09: seg/base=10/20 seg/base=1/27 MarkCoinEnd
|
| 961 | 10: seg/base=1/27 seg/base=9/26 MarkCoinStart
|
| 962 | 11: seg/base=1/25 seg/base=9/18 MarkCoinEnd
|
| 963 | ------------------x--x---------------- addEndMovedSpans
|
| 964 | 00: seg/base=12/23 seg/base=4/35 MarkCoinStart
|
| 965 | 01: seg/base=12/24 seg/base=4/36 MarkCoinEnd
|
| 966 | 02: seg/base=3/34 seg/base=6/11 MarkCoinStart
|
| 967 | 03: seg/base=3/33 seg/base=6/12 MarkCoinEnd
|
| 968 | 04: seg/base=2/32 seg/base=8/15 MarkCoinStart
|
| 969 | 05: seg/base=2/31 seg/base=8/16 MarkCoinEnd
|
| 970 | 06: seg/base=1/29 seg/base=11/21 MarkCoinStart
|
| 971 | 07: seg/base=1/28 seg/base=11/30 MarkCoinEnd
|
| 972 | 08: seg/base=10/19 seg/base=1/28 MarkCoinStart
|
| 973 | 09: seg/base=10/20 seg/base=1/27 MarkCoinEnd
|
| 974 | 10: seg/base=1/27 seg/base=9/26 MarkCoinStart
|
| 975 | 11: seg/base=1/25 seg/base=9/18 MarkCoinEnd
|
| 976 | ------------------x--x---------------- expand
|
| 977 | 00: seg/base=12/23 seg/base=4/35 MarkCoinStart
|
| 978 | 01: seg/base=12/24 seg/base=4/36 MarkCoinEnd
|
| 979 | 02: seg/base=3/34 seg/base=6/11 MarkCoinStart
|
| 980 | 03: seg/base=3/33 seg/base=6/12 MarkCoinEnd
|
| 981 | 04: seg/base=2/32 seg/base=8/15 MarkCoinStart
|
| 982 | 05: seg/base=2/31 seg/base=8/16 MarkCoinEnd
|
| 983 | 06: seg/base=1/29 seg/base=11/21 MarkCoinStart
|
| 984 | 07: seg/base=1/28 seg/base=11/30 MarkCoinEnd
|
| 985 | 08: seg/base=10/19 seg/base=1/28 MarkCoinStart
|
| 986 | 09: seg/base=10/20 seg/base=1/27 MarkCoinEnd
|
| 987 | 10: seg/base=1/27 seg/base=9/26 MarkCoinStart
|
| 988 | 11: seg/base=1/25 seg/base=9/18 MarkCoinEnd
|
| 989 | ------------------x--x---------------- addExpanded
|
| 990 | 00: seg/base=12/23 seg/base=4/35 MarkCoinStart
|
| 991 | 01: seg/base=12/24 seg/base=4/36 MarkCoinEnd
|
| 992 | 02: seg/base=3/34 seg/base=6/11 MarkCoinStart
|
| 993 | 03: seg/base=3/33 seg/base=6/12 MarkCoinEnd
|
| 994 | 04: seg/base=2/32 seg/base=8/15 MarkCoinStart
|
| 995 | 05: seg/base=2/31 seg/base=8/16 MarkCoinEnd
|
| 996 | 06: seg/base=1/29 seg/base=11/21 MarkCoinStart
|
| 997 | 07: seg/base=1/28 seg/base=11/30 MarkCoinEnd
|
| 998 | 08: seg/base=10/19 seg/base=1/28 MarkCoinStart
|
| 999 | 09: seg/base=10/20 seg/base=1/27 MarkCoinEnd
|
| 1000 | 10: seg/base=1/27 seg/base=9/26 MarkCoinStart
|
| 1001 | 11: seg/base=1/25 seg/base=9/18 MarkCoinEnd
|
| 1002 | ------------------x--x---------------- mark
|
| 1003 | 00: seg/base=12/23 seg/base=4/35 MarkCoinStart
|
| 1004 | 01: seg/base=12/24 seg/base=4/36 MarkCoinEnd
|
| 1005 | 02: seg/base=3/34 seg/base=6/11 MarkCoinStart
|
| 1006 | 03: seg/base=3/33 seg/base=6/12 MarkCoinEnd
|
| 1007 | 04: seg/base=2/32 seg/base=8/15 MarkCoinStart
|
| 1008 | 05: seg/base=2/31 seg/base=8/16 MarkCoinEnd
|
| 1009 | 06: seg/base=1/29 seg/base=11/21 MarkCoinStart
|
| 1010 | 07: seg/base=1/28 seg/base=11/30 MarkCoinEnd
|
| 1011 | 08: seg/base=10/19 seg/base=1/28 MarkCoinStart
|
| 1012 | 09: seg/base=10/20 seg/base=1/27 MarkCoinEnd
|
| 1013 | 10: seg/base=1/27 seg/base=9/26 MarkCoinStart
|
| 1014 | 11: seg/base=1/25 seg/base=9/18 MarkCoinEnd
|
| 1015 | -------------------------------------- missing_coincidence
|
| 1016 | -------------------------------------- expand
|
| 1017 | -------------------------------------- expand
|
| 1018 | -------------------------------------- apply
|
| 1019 | SkOpSegment::markDone id=4 (1036.69507,291 286.695129,291) t=0.0399999219 [35] (1006.69513,291) tEnd=0.959999997 newWindSum=? newOppSum=? oppSum=? windSum=? windValue=0 oppValue=0
|
| 1020 | SkOpSegment::markDone id=6 (1030.31836,321 985.681519,531) t=0 [11] (1030.31836,321) tEnd=1 newWindSum=? newOppSum=? oppSum=? windSum=? windValue=0 oppValue=0
|
| 1021 | SkOpSegment::markDone id=8 (949.304871,561 259.304871,561) t=0 [15] (949.304871,561) tEnd=1 newWindSum=? newOppSum=? oppSum=? windSum=? windValue=0 oppValue=0
|
| 1022 | SkOpSegment::markDone id=11 (280.31842,321 283.840179,304.431458 300.126587,291 316.695129,291) t=0 [21] (280.31842,321) tEnd=0.000542504226 newWindSum=? newOppSum=? oppSum=? windSum=? windValue=0 oppValue=0
|
| 1023 | SkOpSegment::markDone id=1 (286.695129,291 229.304855,561) t=0.11111112 [28] (280.31842,321) tEnd=0.888888891 newWindSum=? newOppSum=? oppSum=? windSum=? windValue=0 oppValue=0
|
| 1024 | SkOpSegment::markDone id=9 (259.304871,561 242.736313,561 232.159805,547.568542 235.681549,531) t=0.999710227 [26] (235.678497,531.014404) tEnd=1 newWindSum=? newOppSum=? oppSum=? windSum=? windValue=0 oppValue=0
|
| 1025 | -------------------------------------- findOverlaps
|
| 1026 | SkOpSegment::debugShowActiveSpans id=1 (286.695129,291 280.324158,320.973022) t=0 tEnd=0.111011249 windSum=? windValue=1
|
| 1027 | SkOpSegment::debugShowActiveSpans id=1 (280.324158,320.973022 280.31842,321) t=0.111011249 tEnd=0.11111112 windSum=? oppSum=? windValue=1 oppValue=-1
|
| 1028 | SkOpSegment::debugShowActiveSpans id=1 (235.681549,531 235.678497,531.014404) t=0.888888891 tEnd=0.888942232 windSum=? oppSum=? windValue=1 oppValue=-1
|
| 1029 | SkOpSegment::debugShowActiveSpans id=1 (235.678497,531.014404 229.304855,561) t=0.888942232 tEnd=1 windSum=? windValue=1
|
| 1030 | SkOpSegment::debugShowActiveSpans id=2 (229.304855,561 259.304871,561) t=0 tEnd=0.0400000195 windSum=? windValue=1
|
| 1031 | SkOpSegment::debugShowActiveSpans id=2 (259.304871,561 949.304871,561) t=0.0400000195 tEnd=0.960000001 windSum=? oppSum=? windValue=1 oppValue=-1
|
| 1032 | SkOpSegment::debugShowActiveSpans id=2 (949.304871,561 979.304871,561) t=0.960000001 tEnd=1 windSum=? windValue=1
|
| 1033 | SkOpSegment::debugShowActiveSpans id=3 (979.304871,561 985.68158,531) t=0 tEnd=0.11111108 windSum=? windValue=1
|
| 1034 | SkOpSegment::debugShowActiveSpans id=3 (985.68158,531 1030.31836,321) t=0.11111108 tEnd=0.888888874 windSum=? oppSum=? windValue=1 oppValue=-1
|
| 1035 | SkOpSegment::debugShowActiveSpans id=3 (1030.31836,321 1036.69507,291) t=0.888888874 tEnd=1 windSum=? windValue=1
|
| 1036 | SkOpSegment::debugShowActiveSpans id=4 (1036.69507,291 1006.69513,291) t=0 tEnd=0.0399999219 windSum=? windValue=1
|
| 1037 | SkOpSegment::debugShowActiveSpans id=4 (316.695129,291 286.695129,291) t=0.959999997 tEnd=1 windSum=? windValue=1
|
| 1038 | SkOpSegment::debugShowActiveSpans id=5 (1006.69513,291 1023.26367,291 1033.84021,304.431458 1030.31836,321) t=0 tEnd=1 windSum=? windValue=1
|
| 1039 | SkOpSegment::debugShowActiveSpans id=7 (985.681519,531 982.15979,547.568542 965.873413,561 949.304871,561) t=0 tEnd=1 windSum=? windValue=1
|
| 1040 | SkOpSegment::debugShowActiveSpans id=9 (259.304871,561 242.741114,561 232.165942,547.576327 235.678497,531.014404) t=0 tEnd=0.999710227 windSum=? windValue=1
|
| 1041 | SkOpSegment::debugShowActiveSpans id=10 (235.681549,531 280.31842,321) t=0 tEnd=1 windSum=? oppSum=? windValue=1 oppValue=1
|
| 1042 | SkOpSegment::debugShowActiveSpans id=11 (280.324158,320.973022 283.857845,304.416873 300.135575,291 316.695129,291) t=0.000542504226 tEnd=1 windSum=? windValue=1
|
| 1043 | SkOpSegment::debugShowActiveSpans id=12 (316.695129,291 1006.69513,291) t=0 tEnd=1 windSum=? oppSum=? windValue=1 oppValue=1
|
| 1044 | -------------------------------------- calc_angles
|
| 1045 | SkOpSegment::sortAngles [1] tStart=0.111011249 [29]
|
| 1046 | SkOpAngle::after [1/1] 5/5 tStart=0.111011249 tEnd=0 < [11/25] 5/1 tStart=0.000542504226 tEnd=1 < [1/2] 21/21 tStart=0.111011249 tEnd=0.11111112 F 14
|
| 1047 | SkOpAngle::afterPart {{{280.324158,320.973022}, {286.695129,291}}} id=1
|
| 1048 | SkOpAngle::afterPart {{{280.324158,320.973022}, {283.857845,304.416873}, {300.135575,291}, {316.695129,291}}} id=11
|
| 1049 | SkOpAngle::afterPart {{{280.324158,320.973022}, {280.31842,321}}} id=1
|
| 1050 | SkOpSegment::sortAngles [1] tStart=0.11111112 [28]
|
| 1051 | SkOpSegment::sortAngles [1] tStart=0.888888891 [27]
|
| 1052 | SkOpSegment::sortAngles [1] tStart=0.888942232 [25]
|
| 1053 | SkOpAngle::after [1/5] 5/5 tStart=0.888942232 tEnd=0.888888891 < [9/22] 21/25 tStart=0.999710227 tEnd=0 < [1/6] 21/21 tStart=0.888942232 tEnd=1 F 13
|
| 1054 | SkOpAngle::afterPart {{{235.678497,531.014404}, {235.681549,531}}} id=1
|
| 1055 | SkOpAngle::afterPart {{{235.678497,531.014404}, {232.165942,547.576327}, {242.741114,561}, {259.304871,561}}} id=9
|
| 1056 | SkOpAngle::afterPart {{{235.678497,531.014404}, {229.304855,561}}} id=1
|
| 1057 | SkOpSegment::sortAngles [2] tStart=0.0400000195 [32]
|
| 1058 | SkOpAngle::after [2/7] 15/15 tStart=0.0400000195 tEnd=0 < [9/21] 14/9 tStart=0 tEnd=0.999710227 < [2/8] 31/31 tStart=0.0400000195 tEnd=0.960000001 F 4
|
| 1059 | SkOpAngle::afterPart {{{259.304871,561}, {229.304855,561}}} id=2
|
| 1060 | SkOpAngle::afterPart {{{259.304871,561}, {242.741114,561}, {232.165942,547.576327}, {235.678497,531.014404}}} id=9
|
| 1061 | SkOpAngle::afterPart {{{259.304871,561}, {949.304871,561}}} id=2
|
| 1062 | SkOpSegment::sortAngles [2] tStart=0.960000001 [31]
|
| 1063 | SkOpAngle::after [2/9] 15/15 tStart=0.960000001 tEnd=0.0400000195 < [7/20] 0/1 tStart=1 tEnd=0 < [2/10] 31/31 tStart=0.960000001 tEnd=1 F 4
|
| 1064 | SkOpAngle::afterPart {{{949.304871,561}, {259.304871,561}}} id=2
|
| 1065 | SkOpAngle::afterPart {{{949.304871,561}, {965.873413,561}, {982.15979,547.568542}, {985.681519,531}}} id=7
|
| 1066 | SkOpAngle::afterPart {{{949.304871,561}, {979.304871,561}}} id=2
|
| 1067 | SkOpSegment::sortAngles [3] tStart=0.11111108 [34]
|
| 1068 | SkOpAngle::after [3/11] 21/21 tStart=0.11111108 tEnd=0 < [7/19] 21/17 tStart=0 tEnd=1 < [3/12] 5/5 tStart=0.11111108 tEnd=0.888888874 T 14
|
| 1069 | SkOpAngle::afterPart {{{985.681519,531}, {979.30481,561}}} id=3
|
| 1070 | SkOpAngle::afterPart {{{985.681519,531}, {982.15979,547.568542}, {965.873413,561}, {949.304871,561}}} id=7
|
| 1071 | SkOpAngle::afterPart {{{985.681519,531}, {1030.3183,321}}} id=3
|
| 1072 | SkOpSegment::sortAngles [3] tStart=0.888888874 [33]
|
| 1073 | SkOpAngle::after [3/13] 21/21 tStart=0.888888874 tEnd=0.11111108 < [5/18] 5/9 tStart=1 tEnd=0 < [3/14] 5/5 tStart=0.888888874 tEnd=1 F 13
|
| 1074 | SkOpAngle::afterPart {{{1030.31836,321}, {985.68158,531}}} id=3
|
| 1075 | SkOpAngle::afterPart {{{1030.31836,321}, {1033.84021,304.431458}, {1023.26367,291}, {1006.69513,291}}} id=5
|
| 1076 | SkOpAngle::afterPart {{{1030.31836,321}, {1036.69507,291}}} id=3
|
| 1077 | SkOpSegment::sortAngles [4] tStart=0.0399999219 [35]
|
| 1078 | SkOpAngle::after [4/15] 31/31 tStart=0.0399999219 tEnd=0 < [5/17] 30/25 tStart=0 tEnd=1 < [12/28] 15/15 tStart=1 tEnd=0 F 4
|
| 1079 | SkOpAngle::afterPart {{{1006.69513,291}, {1036.69507,291}}} id=4
|
| 1080 | SkOpAngle::afterPart {{{1006.69513,291}, {1023.26367,291}, {1033.84021,304.431458}, {1030.31836,321}}} id=5
|
| 1081 | SkOpAngle::afterPart {{{1006.69513,291}, {316.695129,291}}} id=12
|
| 1082 | SkOpSegment::sortAngles [4] tStart=0.959999997 [36]
|
| 1083 | SkOpAngle::after [4/16] 15/15 tStart=0.959999997 tEnd=1 < [11/26] 16/17 tStart=1 tEnd=0.000542504226 < [12/27] 31/31 tStart=0 tEnd=1 T 4
|
| 1084 | SkOpAngle::afterPart {{{316.695129,291}, {286.695129,291}}} id=4
|
| 1085 | SkOpAngle::afterPart {{{316.695129,291}, {300.135575,291}, {283.857845,304.416873}, {280.324158,320.973022}}} id=11
|
| 1086 | SkOpAngle::afterPart {{{316.695129,291}, {1006.69513,291}}} id=12
|
| 1087 | SkOpSegment::sortAngles [5] tStart=0 [9]
|
| 1088 | SkOpSegment::sortAngles [5] tStart=1 [10]
|
| 1089 | SkOpSegment::sortAngles [7] tStart=0 [13]
|
| 1090 | SkOpSegment::sortAngles [7] tStart=1 [14]
|
| 1091 | SkOpSegment::sortAngles [9] tStart=0 [17]
|
| 1092 | SkOpSegment::sortAngles [9] tStart=0.999710227 [26]
|
| 1093 | SkOpSegment::sortAngles [10] tStart=0 [19]
|
| 1094 | SkOpSegment::sortAngles [10] tStart=1 [20]
|
| 1095 | SkOpSegment::sortAngles [11] tStart=0.000542504226 [30]
|
| 1096 | SkOpSegment::sortAngles [11] tStart=1 [22]
|
| 1097 | SkOpSegment::sortAngles [12] tStart=0 [23]
|
| 1098 | SkOpSegment::sortAngles [12] tStart=1 [24]
|
| 1099 | coinSpan - id=12 t=0 tEnd=1
|
| 1100 | coinSpan + id=4 t=0.959999997 tEnd=0.0399999219
|
| 1101 | coinSpan - id=3 t=0.11111108 tEnd=0.888888874
|
| 1102 | coinSpan + id=6 t=1 tEnd=0
|
| 1103 | coinSpan - id=2 t=0.0400000195 tEnd=0.960000001
|
| 1104 | coinSpan + id=8 t=1 tEnd=0
|
| 1105 | coinSpan - id=1 t=0.111011249 tEnd=0.11111112
|
| 1106 | coinSpan + id=11 t=0.000542504226 tEnd=0
|
| 1107 | coinSpan - id=10 t=0 tEnd=1
|
| 1108 | coinSpan + id=1 t=0.888888891 tEnd=0.11111112
|
| 1109 | coinSpan - id=1 t=0.888888891 tEnd=0.888942232
|
| 1110 | coinSpan + id=9 t=1 tEnd=0.999710227
|
| 1111 | SkOpSpan::sortableTop dir=kLeft seg=1 t=0.0555056246 pt=(283.509644,305.986511)
|
| 1112 | SkOpSpan::sortableTop [0] valid=1 operand=0 span=1 ccw=0 seg=1 {{{286.695129f, 291}, {229.304855f, 561}}} t=0.0555056246 pt=(283.509644,305.986511) slope=(-57.390274,270)
|
| 1113 | SkOpSegment::markWinding id=1 (286.695129,291 229.304855,561) t=0 [1] (286.695129,291) tEnd=0.111011249 newWindSum=1 newOppSum=0 oppSum=0 windSum=1 windValue=1 oppValue=0
|
| 1114 | SkOpSegment::markWinding id=1 (286.695129,291 229.304855,561) t=0 [1] (286.695129,291) tEnd=0.111011249 newWindSum=1 newOppSum=0 oppSum=0 windSum=1 windValue=1 oppValue=0
|
| 1115 | SkOpSegment::markWinding id=4 (1036.69507,291 286.695129,291) t=0.959999997 [36] (316.695129,291) tEnd=1 newWindSum=1 newOppSum=0 oppSum=? windSum=? windValue=1 oppValue=0
|
| 1116 | SkOpSegment::activeOp id=1 t=0.111011249 tEnd=0 op=sect miFrom=1 miTo=0 suFrom=0 suTo=0 result=0
|
| 1117 | SkOpSegment::markDone id=1 (286.695129,291 229.304855,561) t=0 [1] (286.695129,291) tEnd=0.111011249 newWindSum=1 newOppSum=0 oppSum=0 windSum=1 windValue=1 oppValue=0
|
| 1118 | SkOpSegment::markDone id=4 (1036.69507,291 286.695129,291) t=0.959999997 [36] (316.695129,291) tEnd=1 newWindSum=1 newOppSum=0 oppSum=0 windSum=1 windValue=1 oppValue=0
|
| 1119 | bridgeOp chase.append id=4 windSum=1
|
| 1120 | SkOpSegment::markWinding id=11 (280.31842,321 283.840179,304.431458 300.126587,291 316.695129,291) t=0.000542504226 [30] (280.324158,320.973022) tEnd=1 newWindSum=-1 newOppSum=1 oppSum=? windSum=? windValue=1 oppValue=0
|
| 1121 | SkOpSegment::markAngle last segment=11 span=30 windSum=-1
|
| 1122 | SkOpSegment::markWinding id=12 (316.695129,291 1006.69513,291) t=0 [23] (316.695129,291) tEnd=1 newWindSum=-1 newOppSum=2 oppSum=? windSum=? windValue=1 oppValue=1
|
| 1123 | SkOpSegment::markAngle last segment=12 span=24
|
| 1124 | SkOpSegment::debugShowActiveSpans id=1 (280.324158,320.973022 280.31842,321) t=0.111011249 tEnd=0.11111112 windSum=? oppSum=? windValue=1 oppValue=-1
|
| 1125 | SkOpSegment::debugShowActiveSpans id=1 (235.681549,531 235.678497,531.014404) t=0.888888891 tEnd=0.888942232 windSum=? oppSum=? windValue=1 oppValue=-1
|
| 1126 | SkOpSegment::debugShowActiveSpans id=1 (235.678497,531.014404 229.304855,561) t=0.888942232 tEnd=1 windSum=? windValue=1
|
| 1127 | SkOpSegment::debugShowActiveSpans id=2 (229.304855,561 259.304871,561) t=0 tEnd=0.0400000195 windSum=? windValue=1
|
| 1128 | SkOpSegment::debugShowActiveSpans id=2 (259.304871,561 949.304871,561) t=0.0400000195 tEnd=0.960000001 windSum=? oppSum=? windValue=1 oppValue=-1
|
| 1129 | SkOpSegment::debugShowActiveSpans id=2 (949.304871,561 979.304871,561) t=0.960000001 tEnd=1 windSum=? windValue=1
|
| 1130 | SkOpSegment::debugShowActiveSpans id=3 (979.304871,561 985.68158,531) t=0 tEnd=0.11111108 windSum=? windValue=1
|
| 1131 | SkOpSegment::debugShowActiveSpans id=3 (985.68158,531 1030.31836,321) t=0.11111108 tEnd=0.888888874 windSum=? oppSum=? windValue=1 oppValue=-1
|
| 1132 | SkOpSegment::debugShowActiveSpans id=3 (1030.31836,321 1036.69507,291) t=0.888888874 tEnd=1 windSum=? windValue=1
|
| 1133 | SkOpSegment::debugShowActiveSpans id=4 (1036.69507,291 1006.69513,291) t=0 tEnd=0.0399999219 windSum=? windValue=1
|
| 1134 | SkOpSegment::debugShowActiveSpans id=5 (1006.69513,291 1023.26367,291 1033.84021,304.431458 1030.31836,321) t=0 tEnd=1 windSum=? windValue=1
|
| 1135 | SkOpSegment::debugShowActiveSpans id=7 (985.681519,531 982.15979,547.568542 965.873413,561 949.304871,561) t=0 tEnd=1 windSum=? windValue=1
|
| 1136 | SkOpSegment::debugShowActiveSpans id=9 (259.304871,561 242.741114,561 232.165942,547.576327 235.678497,531.014404) t=0 tEnd=0.999710227 windSum=? windValue=1
|
| 1137 | SkOpSegment::debugShowActiveSpans id=10 (235.681549,531 280.31842,321) t=0 tEnd=1 windSum=? oppSum=? windValue=1 oppValue=1
|
| 1138 | SkOpSegment::debugShowActiveSpans id=11 (280.324158,320.973022 283.857845,304.416873 300.135575,291 316.695129,291) t=0.000542504226 tEnd=1 windSum=-1 oppSum=1 windValue=1 oppValue=0
|
| 1139 | SkOpSegment::debugShowActiveSpans id=12 (316.695129,291 1006.69513,291) t=0 tEnd=1 windSum=-1 oppSum=2 windValue=1 oppValue=1
|
| 1140 | SkOpSegment::activeOp id=11 t=1 tEnd=0.000542504226 op=sect miFrom=1 miTo=1 suFrom=0 suTo=1 result=1
|
| 1141 | SkOpSegment::markWinding id=1 (286.695129,291 229.304855,561) t=0.111011249 [29] (280.324158,320.973022) tEnd=0.11111112 newWindSum=1 newOppSum=-1 oppSum=? windSum=? windValue=1 oppValue=-1
|
| 1142 | SkOpSegment::markAngle last segment=10 span=20
|
| 1143 | SkOpSegment::findNextOp
|
| 1144 | SkOpAngle::dumpOne [11/25] next=1/1 sect=5/1 s=0.000542504226 [30] e=1 [22] sgn=-1 windVal=1 windSum=-1 oppVal=0 oppSum=1 operand
|
| 1145 | SkOpAngle::dumpOne [1/1] next=1/2 sect=5/5 s=0.111011249 [29] e=0 [1] sgn=1 windVal=1 windSum=1 oppVal=0 oppSum=0 done
|
| 1146 | SkOpAngle::dumpOne [1/2] next=11/25 sect=21/21 s=0.111011249 [29] e=0.11111112 [28] sgn=-1 windVal=1 windSum=1 oppVal=-1 oppSum=-1
|
| 1147 | SkOpSegment::activeOp id=1 t=0.111011249 tEnd=0 op=sect miFrom=1 miTo=0 suFrom=0 suTo=0 result=0
|
| 1148 | SkOpSegment::activeOp id=1 t=0.111011249 tEnd=0.11111112 op=sect miFrom=0 miTo=1 suFrom=0 suTo=1 result=1
|
| 1149 | SkOpSegment::findNextOp chase.append segment=10 span=20
|
| 1150 | SkOpSegment::markDone id=11 (280.31842,321 283.840179,304.431458 300.126587,291 316.695129,291) t=0.000542504226 [30] (280.324158,320.973022) tEnd=1 newWindSum=-1 newOppSum=1 oppSum=1 windSum=-1 windValue=1 oppValue=0
|
| 1151 | SkOpSegment::findNextOp from:[11] to:[1] start=5851048 end=5850856
|
| 1152 | bridgeOp current id=11 from=(316.695129,291) to=(280.324158,320.973022)
|
| 1153 | path.moveTo(316.695129,291);
|
| 1154 | path.cubicTo(300.13559,291, 283.857849,304.41687, 280.324158,320.973022);
|
| 1155 | SkOpSegment::markWinding id=10 (235.681549,531 280.31842,321) t=0 [19] (235.681549,531) tEnd=1 newWindSum=-1 newOppSum=-1 oppSum=? windSum=? windValue=1 oppValue=1
|
| 1156 | SkOpSegment::markAngle last segment=1 span=27 windSum=?
|
| 1157 | SkOpSegment::findNextOp
|
| 1158 | SkOpAngle::dumpOne [1/3] next=10/24 sect=5/5 s=0.11111112 [28] e=0.111011249 [29] sgn=1 windVal=1 windSum=1 oppVal=-1 oppSum=-1
|
| 1159 | SkOpAngle::dumpOne [10/24] next=1/3 sect=21/21 s=1 [20] e=0 [19] sgn=1 windVal=1 windSum=-1 oppVal=1 oppSum=-1 operand
|
| 1160 | SkOpSegment::activeOp id=10 t=1 tEnd=0 op=sect miFrom=0 miTo=1 suFrom=0 suTo=1 result=1
|
| 1161 | SkOpSegment::findNextOp chase.append segment=1 span=27 windSum=-2147483647
|
| 1162 | SkOpSegment::markDone id=1 (286.695129,291 229.304855,561) t=0.111011249 [29] (280.324158,320.973022) tEnd=0.11111112 newWindSum=1 newOppSum=-1 oppSum=-1 windSum=1 windValue=1 oppValue=-1
|
| 1163 | SkOpSegment::findNextOp from:[1] to:[10] start=5849408 end=5849264
|
| 1164 | bridgeOp current id=1 from=(280.324158,320.973022) to=(280.31842,321)
|
| 1165 | SkOpSegment::markWinding id=1 (286.695129,291 229.304855,561) t=0.888888891 [27] (235.681549,531) tEnd=0.888942232 newWindSum=1 newOppSum=-1 oppSum=? windSum=? windValue=1 oppValue=-1
|
| 1166 | SkOpSegment::markAngle last segment=1 span=25 windSum=?
|
| 1167 | SkOpSegment::findNextOp
|
| 1168 | SkOpAngle::dumpOne [10/23] next=1/4 sect=5/5 s=0 [19] e=1 [20] sgn=-1 windVal=1 windSum=-1 oppVal=1 oppSum=-1 operand
|
| 1169 | SkOpAngle::dumpOne [1/4] next=10/23 sect=21/21 s=0.888888891 [27] e=0.888942232 [25] sgn=-1 windVal=1 windSum=1 oppVal=-1 oppSum=-1
|
| 1170 | SkOpSegment::activeOp id=1 t=0.888888891 tEnd=0.888942232 op=sect miFrom=0 miTo=1 suFrom=0 suTo=1 result=1
|
| 1171 | SkOpSegment::findNextOp chase.append segment=1 span=25 windSum=-2147483647
|
| 1172 | SkOpSegment::markDone id=10 (235.681549,531 280.31842,321) t=0 [19] (235.681549,531) tEnd=1 newWindSum=-1 newOppSum=-1 oppSum=-1 windSum=-1 windValue=1 oppValue=1
|
| 1173 | SkOpSegment::findNextOp from:[10] to:[1] start=5850664 end=5850288
|
| 1174 | bridgeOp current id=10 from=(280.31842,321) to=(235.681549,531)
|
| 1175 | path.lineTo(280.31842,321);
|
| 1176 | SkOpSegment::markWinding id=1 (286.695129,291 229.304855,561) t=0.888942232 [25] (235.678497,531.014404) tEnd=1 newWindSum=1 newOppSum=0 oppSum=? windSum=? windValue=1 oppValue=0
|
| 1177 | SkOpSegment::markWinding id=2 (229.304855,561 979.304871,561) t=0 [3] (229.304855,561) tEnd=0.0400000195 newWindSum=1 newOppSum=0 oppSum=? windSum=? windValue=1 oppValue=0
|
| 1178 | SkOpSegment::markAngle last segment=2 span=32 windSum=?
|
| 1179 | SkOpSegment::markWinding id=9 (259.304871,561 242.736313,561 232.159805,547.568542 235.681549,531) t=0 [17] (259.304871,561) tEnd=0.999710227 newWindSum=-1 newOppSum=1 oppSum=? windSum=? windValue=1 oppValue=0
|
| 1180 | SkOpSegment::markAngle last segment=9 span=17 windSum=-1
|
| 1181 | SkOpSegment::findNextOp
|
| 1182 | SkOpAngle::dumpOne [1/5] next=1/6 sect=5/5 s=0.888942232 [25] e=0.888888891 [27] sgn=1 windVal=1 windSum=1 oppVal=-1 oppSum=-1
|
| 1183 | SkOpAngle::dumpOne [1/6] next=9/22 sect=21/21 s=0.888942232 [25] e=1 [2] sgn=-1 windVal=1 windSum=1 oppVal=0 oppSum=0
|
| 1184 | SkOpAngle::dumpOne [9/22] next=1/5 sect=21/25 s=0.999710227 [26] e=0 [17] sgn=1 windVal=1 windSum=-1 oppVal=0 oppSum=1 operand
|
| 1185 | SkOpSegment::activeOp id=1 t=0.888942232 tEnd=1 op=sect miFrom=0 miTo=1 suFrom=0 suTo=0 result=0
|
| 1186 | SkOpSegment::markDone id=1 (286.695129,291 229.304855,561) t=0.888942232 [25] (235.678497,531.014404) tEnd=1 newWindSum=1 newOppSum=0 oppSum=0 windSum=1 windValue=1 oppValue=0
|
| 1187 | SkOpSegment::markDone id=2 (229.304855,561 979.304871,561) t=0 [3] (229.304855,561) tEnd=0.0400000195 newWindSum=1 newOppSum=0 oppSum=0 windSum=1 windValue=1 oppValue=0
|
| 1188 | SkOpSegment::findNextOp chase.append segment=2 span=32 windSum=-2147483647
|
| 1189 | SkOpSegment::activeOp id=9 t=0.999710227 tEnd=0 op=sect miFrom=1 miTo=1 suFrom=0 suTo=1 result=1
|
| 1190 | SkOpSegment::findNextOp chase.append segment=9 span=17 windSum=-1
|
| 1191 | SkOpSegment::markDone id=1 (286.695129,291 229.304855,561) t=0.888888891 [27] (235.681549,531) tEnd=0.888942232 newWindSum=1 newOppSum=-1 oppSum=-1 windSum=1 windValue=1 oppValue=-1
|
| 1192 | SkOpSegment::findNextOp from:[1] to:[9] start=5850520 end=5848912
|
| 1193 | bridgeOp current id=1 from=(235.681549,531) to=(235.678497,531.014404)
|
| 1194 | path.lineTo(235.681549,531);
|
| 1195 | SkOpSegment::markWinding id=2 (229.304855,561 979.304871,561) t=0.0400000195 [32] (259.304871,561) tEnd=0.960000001 newWindSum=1 newOppSum=-1 oppSum=? windSum=? windValue=1 oppValue=-1
|
| 1196 | SkOpSegment::markAngle last segment=2 span=31 windSum=?
|
| 1197 | SkOpSegment::findNextOp
|
| 1198 | SkOpAngle::dumpOne [9/21] next=2/7 sect=14/9 s=0 [17] e=0.999710227 [26] sgn=-1 windVal=1 windSum=-1 oppVal=0 oppSum=1 operand
|
| 1199 | SkOpAngle::dumpOne [2/7] next=2/8 sect=15/15 s=0.0400000195 [32] e=0 [3] sgn=1 windVal=1 windSum=1 oppVal=0 oppSum=0 done
|
| 1200 | SkOpAngle::dumpOne [2/8] next=9/21 sect=31/31 s=0.0400000195 [32] e=0.960000001 [31] sgn=-1 windVal=1 windSum=1 oppVal=-1 oppSum=-1
|
| 1201 | SkOpSegment::activeOp id=2 t=0.0400000195 tEnd=0 op=sect miFrom=1 miTo=0 suFrom=0 suTo=0 result=0
|
| 1202 | SkOpSegment::activeOp id=2 t=0.0400000195 tEnd=0.960000001 op=sect miFrom=0 miTo=1 suFrom=0 suTo=1 result=1
|
| 1203 | SkOpSegment::findNextOp chase.append segment=2 span=31 windSum=-2147483647
|
| 1204 | SkOpSegment::markDone id=9 (259.304871,561 242.736313,561 232.159805,547.568542 235.681549,531) t=0 [17] (259.304871,561) tEnd=0.999710227 newWindSum=-1 newOppSum=1 oppSum=1 windSum=-1 windValue=1 oppValue=0
|
| 1205 | SkOpSegment::findNextOp from:[9] to:[2] start=5851528 end=5851384
|
| 1206 | bridgeOp current id=9 from=(235.678497,531.014404) to=(259.304871,561)
|
| 1207 | path.lineTo(235.678497,531.014404);
|
| 1208 | path.cubicTo(232.165939,547.576355, 242.741119,561, 259.304871,561);
|
| 1209 | SkOpSegment::markWinding id=2 (229.304855,561 979.304871,561) t=0.960000001 [31] (949.304871,561) tEnd=1 newWindSum=1 newOppSum=0 oppSum=? windSum=? windValue=1 oppValue=0
|
| 1210 | SkOpSegment::markWinding id=3 (979.304871,561 1036.69507,291) t=0 [5] (979.304871,561) tEnd=0.11111108 newWindSum=1 newOppSum=0 oppSum=? windSum=? windValue=1 oppValue=0
|
| 1211 | SkOpSegment::markAngle last segment=3 span=34 windSum=?
|
| 1212 | SkOpSegment::markWinding id=7 (985.681519,531 982.15979,547.568542 965.873413,561 949.304871,561) t=0 [13] (985.681519,531) tEnd=1 newWindSum=-1 newOppSum=1 oppSum=? windSum=? windValue=1 oppValue=0
|
| 1213 | SkOpSegment::markAngle last segment=7 span=13 windSum=-1
|
| 1214 | SkOpSegment::findNextOp
|
| 1215 | SkOpAngle::dumpOne [2/9] next=2/10 sect=15/15 s=0.960000001 [31] e=0.0400000195 [32] sgn=1 windVal=1 windSum=1 oppVal=-1 oppSum=-1
|
| 1216 | SkOpAngle::dumpOne [2/10] next=7/20 sect=31/31 s=0.960000001 [31] e=1 [4] sgn=-1 windVal=1 windSum=1 oppVal=0 oppSum=0
|
| 1217 | SkOpAngle::dumpOne [7/20] next=2/9 sect=0/1 s=1 [14] e=0 [13] sgn=1 windVal=1 windSum=-1 oppVal=0 oppSum=1 operand
|
| 1218 | SkOpSegment::activeOp id=2 t=0.960000001 tEnd=1 op=sect miFrom=0 miTo=1 suFrom=0 suTo=0 result=0
|
| 1219 | SkOpSegment::markDone id=2 (229.304855,561 979.304871,561) t=0.960000001 [31] (949.304871,561) tEnd=1 newWindSum=1 newOppSum=0 oppSum=0 windSum=1 windValue=1 oppValue=0
|
| 1220 | SkOpSegment::markDone id=3 (979.304871,561 1036.69507,291) t=0 [5] (979.304871,561) tEnd=0.11111108 newWindSum=1 newOppSum=0 oppSum=0 windSum=1 windValue=1 oppValue=0
|
| 1221 | SkOpSegment::findNextOp chase.append segment=3 span=34 windSum=-2147483647
|
| 1222 | SkOpSegment::activeOp id=7 t=1 tEnd=0 op=sect miFrom=1 miTo=1 suFrom=0 suTo=1 result=1
|
| 1223 | SkOpSegment::findNextOp chase.append segment=7 span=13 windSum=-1
|
| 1224 | SkOpSegment::markDone id=2 (229.304855,561 979.304871,561) t=0.0400000195 [32] (259.304871,561) tEnd=0.960000001 newWindSum=1 newOppSum=-1 oppSum=-1 windSum=1 windValue=1 oppValue=-1
|
| 1225 | SkOpSegment::findNextOp from:[2] to:[7] start=5848368 end=5848224
|
| 1226 | bridgeOp current id=2 from=(259.304871,561) to=(949.304871,561)
|
| 1227 | SkOpSegment::markWinding id=3 (979.304871,561 1036.69507,291) t=0.11111108 [34] (985.68158,531) tEnd=0.888888874 newWindSum=2 newOppSum=-1 oppSum=? windSum=? windValue=1 oppValue=-1
|
| 1228 | SkOpSegment::markAngle last segment=3 span=33 windSum=?
|
| 1229 | SkOpSegment::findNextOp
|
| 1230 | SkOpAngle::dumpOne [7/19] next=3/12 sect=21/17 s=0 [13] e=1 [14] sgn=-1 windVal=1 windSum=-1 oppVal=0 oppSum=1 operand
|
| 1231 | SkOpAngle::dumpOne [3/12] next=3/11 sect=5/5 s=0.11111108 [34] e=0.888888874 [33] sgn=-1 windVal=1 windSum=2 oppVal=-1 oppSum=-1
|
| 1232 | SkOpAngle::dumpOne [3/11] next=7/19 sect=21/21 s=0.11111108 [34] e=0 [5] sgn=1 windVal=1 windSum=1 oppVal=0 oppSum=0 done
|
| 1233 | SkOpSegment::activeOp id=3 t=0.11111108 tEnd=0.888888874 op=sect miFrom=1 miTo=0 suFrom=0 suTo=1 result=0
|
| 1234 | SkOpSegment::markDone id=3 (979.304871,561 1036.69507,291) t=0.11111108 [34] (985.68158,531) tEnd=0.888888874 newWindSum=2 newOppSum=-1 oppSum=-1 windSum=2 windValue=1 oppValue=-1
|
| 1235 | SkOpSegment::findNextOp chase.append segment=3 span=33 windSum=-2147483647
|
| 1236 | SkOpSegment::activeOp id=3 t=0.11111108 tEnd=0 op=sect miFrom=0 miTo=1 suFrom=1 suTo=1 result=1
|
| 1237 | SkOpSegment::markDone id=7 (985.681519,531 982.15979,547.568542 965.873413,561 949.304871,561) t=0 [13] (985.681519,531) tEnd=1 newWindSum=-1 newOppSum=1 oppSum=1 windSum=-1 windValue=1 oppValue=0
|
| 1238 | SkOpSegment::findNextOp from:[7] to:[3] start=5851864 end=5846776
|
| 1239 | bridgeOp current id=7 from=(949.304871,561) to=(985.681519,531)
|
| 1240 | path.lineTo(949.304871,561);
|
| 1241 | path.cubicTo(965.873413,561, 982.15979,547.568542, 985.681519,531);
|
| 1242 | SkOpSegment::findNextOp simple
|
| 1243 | SkOpSegment::markWinding id=3 (979.304871,561 1036.69507,291) t=0.888888874 [33] (1030.31836,321) tEnd=1 newWindSum=2 newOppSum=0 oppSum=? windSum=? windValue=1 oppValue=0
|
| 1244 | SkOpSegment::markWinding id=4 (1036.69507,291 286.695129,291) t=0 [7] (1036.69507,291) tEnd=0.0399999219 newWindSum=2 newOppSum=0 oppSum=? windSum=? windValue=1 oppValue=0
|
| 1245 | SkOpSegment::markAngle last segment=4 span=35 windSum=?
|
| 1246 | SkOpSegment::markWinding id=5 (1006.69513,291 1023.26367,291 1033.84021,304.431458 1030.31836,321) t=0 [9] (1006.69513,291) tEnd=1 newWindSum=-1 newOppSum=2 oppSum=? windSum=? windValue=1 oppValue=0
|
| 1247 | SkOpSegment::markAngle last segment=5 span=9 windSum=-1
|
| 1248 | SkOpSegment::debugShowActiveSpans id=3 (1030.31836,321 1036.69507,291) t=0.888888874 tEnd=1 windSum=2 oppSum=0 windValue=1 oppValue=0
|
| 1249 | SkOpSegment::debugShowActiveSpans id=4 (1036.69507,291 1006.69513,291) t=0 tEnd=0.0399999219 windSum=2 oppSum=0 windValue=1 oppValue=0
|
| 1250 | SkOpSegment::debugShowActiveSpans id=5 (1006.69513,291 1023.26367,291 1033.84021,304.431458 1030.31836,321) t=0 tEnd=1 windSum=-1 oppSum=2 windValue=1 oppValue=0
|
| 1251 | SkOpSegment::debugShowActiveSpans id=12 (316.695129,291 1006.69513,291) t=0 tEnd=1 windSum=-1 oppSum=2 windValue=1 oppValue=1
|
| 1252 | SkOpSegment::activeOp id=3 t=0.888888874 tEnd=1 op=sect miFrom=1 miTo=0 suFrom=0 suTo=0 result=0
|
| 1253 | SkOpSegment::markDone id=3 (979.304871,561 1036.69507,291) t=0.888888874 [33] (1030.31836,321) tEnd=1 newWindSum=2 newOppSum=0 oppSum=0 windSum=2 windValue=1 oppValue=0
|
| 1254 | SkOpSegment::markDone id=4 (1036.69507,291 286.695129,291) t=0 [7] (1036.69507,291) tEnd=0.0399999219 newWindSum=2 newOppSum=0 oppSum=0 windSum=2 windValue=1 oppValue=0
|
| 1255 | bridgeOp chase.append id=4 windSum=-2147483647
|
| 1256 | SkOpSegment::debugShowActiveSpans id=5 (1006.69513,291 1023.26367,291 1033.84021,304.431458 1030.31836,321) t=0 tEnd=1 windSum=-1 oppSum=2 windValue=1 oppValue=0
|
| 1257 | SkOpSegment::debugShowActiveSpans id=12 (316.695129,291 1006.69513,291) t=0 tEnd=1 windSum=-1 oppSum=2 windValue=1 oppValue=1
|
| 1258 | SkOpSegment::activeOp id=5 t=0 tEnd=1 op=sect miFrom=0 miTo=0 suFrom=1 suTo=0 result=0
|
| 1259 | SkOpSegment::markDone id=5 (1006.69513,291 1023.26367,291 1033.84021,304.431458 1030.31836,321) t=0 [9] (1006.69513,291) tEnd=1 newWindSum=-1 newOppSum=2 oppSum=2 windSum=-1 windValue=1 oppValue=0
|
| 1260 | bridgeOp chase.append id=5
|
| 1261 | SkOpSegment::debugShowActiveSpans id=12 (316.695129,291 1006.69513,291) t=0 tEnd=1 windSum=-1 oppSum=2 windValue=1 oppValue=1
|
| 1262 | SkOpSegment::activeOp id=12 t=1 tEnd=0 op=sect miFrom=0 miTo=1 suFrom=0 suTo=1 result=1
|
| 1263 | SkOpSegment::findNextOp
|
| 1264 | SkOpAngle::dumpOne [12/27] next=4/16 sect=31/31 s=0 [23] e=1 [24] sgn=-1 windVal=1 windSum=-1 oppVal=1 oppSum=2 operand
|
| 1265 | SkOpAngle::dumpOne [4/16] next=11/26 sect=15/15 s=0.959999997 [36] e=1 [8] sgn=-1 windVal=1 windSum=1 oppVal=0 oppSum=0 done
|
| 1266 | SkOpAngle::dumpOne [11/26] next=12/27 sect=16/17 s=1 [22] e=0.000542504226 [30] sgn=1 windVal=1 windSum=-1 oppVal=0 oppSum=1 done operand
|
| 1267 | SkOpSegment::activeOp id=4 t=0.959999997 tEnd=1 op=sect miFrom=0 miTo=1 suFrom=0 suTo=0 result=0
|
| 1268 | SkOpSegment::activeOp id=11 t=1 tEnd=0.000542504226 op=sect miFrom=1 miTo=1 suFrom=0 suTo=1 result=1
|
| 1269 | SkOpSegment::markDone id=12 (316.695129,291 1006.69513,291) t=0 [23] (316.695129,291) tEnd=1 newWindSum=-1 newOppSum=2 oppSum=2 windSum=-1 windValue=1 oppValue=1
|
| 1270 | SkOpSegment::findNextOp from:[12] to:[11] start=5849744 end=5851192
|
| 1271 | bridgeOp current id=12 from=(1006.69513,291) to=(316.695129,291)
|
| 1272 | path.moveTo(1006.69513,291);
|
| 1273 | path.lineTo(316.695129,291);
|
Cary Clark | 7eb01e0 | 2016-12-08 14:36:32 -0500 | [diff] [blame] | 1274 | </div>
|
caryclark | 26ad22a | 2015-10-16 09:03:38 -0700 | [diff] [blame] | 1275 | |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 1276 | </div> |
| 1277 | |
| 1278 | <script type="text/javascript"> |
| 1279 | |
caryclark | 55888e4 | 2016-07-18 10:01:36 -0700 | [diff] [blame] | 1280 | var testDivs = [ |
Cary Clark | ff11428 | 2016-12-14 11:56:16 -0500 | [diff] [blame^] | 1281 | skpeldorado_com_ua1_working, |
| 1282 | skpeldorado_com_ua1_broken, |
caryclark | 30b9fdd | 2016-08-31 14:36:29 -0700 | [diff] [blame] | 1283 | ]; |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 1284 | |
| 1285 | var decimal_places = 3; // make this 3 to show more precision |
| 1286 | |
| 1287 | var tests = []; |
| 1288 | var testLines = []; |
| 1289 | var testTitles = []; |
| 1290 | var testIndex = 0; |
| 1291 | var ctx; |
| 1292 | |
| 1293 | var xmin, xmax, focusXmin, focusXmax; |
| 1294 | var ymin, ymax, focusYmin, focusYmax; |
| 1295 | var scale; |
| 1296 | var mouseX, mouseY; |
| 1297 | var srcLeft, srcTop; |
| 1298 | var screenWidth, screenHeight; |
caryclark | 1049f12 | 2015-04-20 08:31:59 -0700 | [diff] [blame] | 1299 | var drawnPts, drawnLines, drawnQuads, drawnConics, drawnCubics; |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 1300 | var curveT = 0; |
| 1301 | |
| 1302 | var pt_labels = 2; |
| 1303 | var collect_bounds = false; |
| 1304 | var control_lines = 0; |
| 1305 | var curve_t = false; |
| 1306 | var debug_xy = 1; |
| 1307 | var focus_enabled = false; |
| 1308 | var focus_on_selection = false; |
| 1309 | var step_limit = 0; |
| 1310 | var draw_active = false; |
| 1311 | var draw_add = false; |
| 1312 | var draw_angle = 0; |
caryclark | 624637c | 2015-05-11 07:21:27 -0700 | [diff] [blame] | 1313 | var draw_coincidence = false; |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 1314 | var draw_deriviatives = 0; |
Cary Clark | ff11428 | 2016-12-14 11:56:16 -0500 | [diff] [blame^] | 1315 | var draw_direction = false; |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 1316 | var draw_hints = false; |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 1317 | var draw_id = false; |
| 1318 | var draw_intersection = 0; |
| 1319 | var draw_intersectT = false; |
| 1320 | var draw_legend = true; |
| 1321 | var draw_log = false; |
| 1322 | var draw_mark = false; |
| 1323 | var draw_midpoint = false; |
| 1324 | var draw_op = 0; |
| 1325 | var draw_sequence = false; |
| 1326 | var draw_sort = 0; |
caryclark | 03b03ca | 2015-04-23 09:13:37 -0700 | [diff] [blame] | 1327 | var draw_top = false; |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 1328 | var draw_path = 3; |
| 1329 | var draw_computed = 0; |
| 1330 | var retina_scale = !!window.devicePixelRatio; |
| 1331 | |
| 1332 | var activeCount = 0; |
| 1333 | var addCount = 0; |
| 1334 | var angleCount = 0; |
caryclark | 624637c | 2015-05-11 07:21:27 -0700 | [diff] [blame] | 1335 | var coinCount = 0; |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 1336 | var opCount = 0; |
| 1337 | var sectCount = 0; |
| 1338 | var sortCount = 0; |
caryclark | 03b03ca | 2015-04-23 09:13:37 -0700 | [diff] [blame] | 1339 | var topCount = 0; |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 1340 | var markCount = 0; |
| 1341 | var activeMax = 0; |
| 1342 | var addMax = 0; |
| 1343 | var angleMax = 0; |
caryclark | 624637c | 2015-05-11 07:21:27 -0700 | [diff] [blame] | 1344 | var coinMax = 0; |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 1345 | var sectMax = 0; |
| 1346 | var sectMax2 = 0; |
| 1347 | var sortMax = 0; |
caryclark | 03b03ca | 2015-04-23 09:13:37 -0700 | [diff] [blame] | 1348 | var topMax = 0; |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 1349 | var markMax = 0; |
| 1350 | var opMax = 0; |
| 1351 | var stepMax = 0; |
| 1352 | var lastIndex = 0; |
| 1353 | var hasPath = false; |
caryclark | 26ad22a | 2015-10-16 09:03:38 -0700 | [diff] [blame] | 1354 | var hasAlignedPath = false; |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 1355 | var hasComputedPath = false; |
caryclark | 5435929 | 2015-03-26 07:52:43 -0700 | [diff] [blame] | 1356 | var angleBetween = false; |
| 1357 | var afterIndex = 0; |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 1358 | |
| 1359 | var firstActiveSpan = -1; |
| 1360 | var logStart = -1; |
| 1361 | var logRange = 0; |
| 1362 | |
| 1363 | var SPAN_ID = 0; |
| 1364 | var SPAN_X1 = SPAN_ID + 1; |
| 1365 | var SPAN_Y1 = SPAN_X1 + 1; |
| 1366 | var SPAN_X2 = SPAN_Y1 + 1; |
| 1367 | var SPAN_Y2 = SPAN_X2 + 1; |
caryclark | 1049f12 | 2015-04-20 08:31:59 -0700 | [diff] [blame] | 1368 | |
caryclark | 55888e4 | 2016-07-18 10:01:36 -0700 | [diff] [blame] | 1369 | var SPAN_L_TX = SPAN_Y2 + 1; |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 1370 | var SPAN_L_TY = SPAN_L_TX + 1; |
caryclark | 55888e4 | 2016-07-18 10:01:36 -0700 | [diff] [blame] | 1371 | var SPAN_L_OTHER = SPAN_L_TY + 1; |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 1372 | var SPAN_L_OTHERT = SPAN_L_OTHER + 1; |
| 1373 | var SPAN_L_OTHERI = SPAN_L_OTHERT + 1; |
| 1374 | var SPAN_L_SUM = SPAN_L_OTHERI + 1; |
| 1375 | var SPAN_L_VAL = SPAN_L_SUM + 1; |
| 1376 | var SPAN_L_OPP = SPAN_L_VAL + 1; |
| 1377 | |
| 1378 | var SPAN_X3 = SPAN_Y2 + 1; |
| 1379 | var SPAN_Y3 = SPAN_X3 + 1; |
caryclark | 1049f12 | 2015-04-20 08:31:59 -0700 | [diff] [blame] | 1380 | |
caryclark | 55888e4 | 2016-07-18 10:01:36 -0700 | [diff] [blame] | 1381 | var SPAN_Q_TX = SPAN_Y3 + 1; |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 1382 | var SPAN_Q_TY = SPAN_Q_TX + 1; |
caryclark | 55888e4 | 2016-07-18 10:01:36 -0700 | [diff] [blame] | 1383 | var SPAN_Q_OTHER = SPAN_Q_TY + 1; |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 1384 | var SPAN_Q_OTHERT = SPAN_Q_OTHER + 1; |
| 1385 | var SPAN_Q_OTHERI = SPAN_Q_OTHERT + 1; |
| 1386 | var SPAN_Q_SUM = SPAN_Q_OTHERI + 1; |
| 1387 | var SPAN_Q_VAL = SPAN_Q_SUM + 1; |
| 1388 | var SPAN_Q_OPP = SPAN_Q_VAL + 1; |
| 1389 | |
caryclark | 1049f12 | 2015-04-20 08:31:59 -0700 | [diff] [blame] | 1390 | var SPAN_K_W = SPAN_Y3 + 1; |
caryclark | 55888e4 | 2016-07-18 10:01:36 -0700 | [diff] [blame] | 1391 | var SPAN_K_TX = SPAN_K_W + 1; |
caryclark | 1049f12 | 2015-04-20 08:31:59 -0700 | [diff] [blame] | 1392 | var SPAN_K_TY = SPAN_K_TX + 1; |
caryclark | 55888e4 | 2016-07-18 10:01:36 -0700 | [diff] [blame] | 1393 | var SPAN_K_OTHER = SPAN_K_TY + 1; |
caryclark | 1049f12 | 2015-04-20 08:31:59 -0700 | [diff] [blame] | 1394 | var SPAN_K_OTHERT = SPAN_K_OTHER + 1; |
| 1395 | var SPAN_K_OTHERI = SPAN_K_OTHERT + 1; |
| 1396 | var SPAN_K_SUM = SPAN_K_OTHERI + 1; |
| 1397 | var SPAN_K_VAL = SPAN_K_SUM + 1; |
| 1398 | var SPAN_K_OPP = SPAN_K_VAL + 1; |
| 1399 | |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 1400 | var SPAN_X4 = SPAN_Y3 + 1; |
| 1401 | var SPAN_Y4 = SPAN_X4 + 1; |
caryclark | 1049f12 | 2015-04-20 08:31:59 -0700 | [diff] [blame] | 1402 | |
caryclark | 55888e4 | 2016-07-18 10:01:36 -0700 | [diff] [blame] | 1403 | var SPAN_C_TX = SPAN_Y4 + 1; |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 1404 | var SPAN_C_TY = SPAN_C_TX + 1; |
caryclark | 55888e4 | 2016-07-18 10:01:36 -0700 | [diff] [blame] | 1405 | var SPAN_C_OTHER = SPAN_C_TY + 1; |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 1406 | var SPAN_C_OTHERT = SPAN_C_OTHER + 1; |
| 1407 | var SPAN_C_OTHERI = SPAN_C_OTHERT + 1; |
| 1408 | var SPAN_C_SUM = SPAN_C_OTHERI + 1; |
| 1409 | var SPAN_C_VAL = SPAN_C_SUM + 1; |
| 1410 | var SPAN_C_OPP = SPAN_C_VAL + 1; |
| 1411 | |
| 1412 | var ACTIVE_LINE_SPAN = 1; |
| 1413 | var ACTIVE_QUAD_SPAN = ACTIVE_LINE_SPAN + 1; |
caryclark | 1049f12 | 2015-04-20 08:31:59 -0700 | [diff] [blame] | 1414 | var ACTIVE_CONIC_SPAN = ACTIVE_QUAD_SPAN + 1; |
| 1415 | var ACTIVE_CUBIC_SPAN = ACTIVE_CONIC_SPAN + 1; |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 1416 | |
| 1417 | var ADD_MOVETO = ACTIVE_CUBIC_SPAN + 1; |
| 1418 | var ADD_LINETO = ADD_MOVETO + 1; |
| 1419 | var ADD_QUADTO = ADD_LINETO + 1; |
caryclark | 1049f12 | 2015-04-20 08:31:59 -0700 | [diff] [blame] | 1420 | var ADD_CONICTO = ADD_QUADTO + 1; |
| 1421 | var ADD_CUBICTO = ADD_CONICTO + 1; |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 1422 | var ADD_CLOSE = ADD_CUBICTO + 1; |
| 1423 | var ADD_FILL = ADD_CLOSE + 1; |
| 1424 | |
| 1425 | var PATH_LINE = ADD_FILL + 1; |
| 1426 | var PATH_QUAD = PATH_LINE + 1; |
caryclark | 1049f12 | 2015-04-20 08:31:59 -0700 | [diff] [blame] | 1427 | var PATH_CONIC = PATH_QUAD + 1; |
| 1428 | var PATH_CUBIC = PATH_CONIC + 1; |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 1429 | |
| 1430 | var INTERSECT_LINE = PATH_CUBIC + 1; |
| 1431 | var INTERSECT_LINE_2 = INTERSECT_LINE + 1; |
| 1432 | var INTERSECT_LINE_NO = INTERSECT_LINE_2 + 1; |
| 1433 | var INTERSECT_QUAD_LINE = INTERSECT_LINE_NO + 1; |
| 1434 | var INTERSECT_QUAD_LINE_2 = INTERSECT_QUAD_LINE + 1; |
| 1435 | var INTERSECT_QUAD_LINE_NO = INTERSECT_QUAD_LINE_2 + 1; |
| 1436 | var INTERSECT_QUAD = INTERSECT_QUAD_LINE_NO + 1; |
| 1437 | var INTERSECT_QUAD_2 = INTERSECT_QUAD + 1; |
| 1438 | var INTERSECT_QUAD_NO = INTERSECT_QUAD_2 + 1; |
caryclark | 1049f12 | 2015-04-20 08:31:59 -0700 | [diff] [blame] | 1439 | var INTERSECT_CONIC_LINE = INTERSECT_QUAD_NO + 1; |
| 1440 | var INTERSECT_CONIC_LINE_2 = INTERSECT_CONIC_LINE + 1; |
| 1441 | var INTERSECT_CONIC_LINE_NO = INTERSECT_CONIC_LINE_2 + 1; |
caryclark | 55888e4 | 2016-07-18 10:01:36 -0700 | [diff] [blame] | 1442 | var INTERSECT_CONIC_QUAD = INTERSECT_CONIC_LINE_NO + 1; |
| 1443 | var INTERSECT_CONIC_QUAD_2 = INTERSECT_CONIC_QUAD + 1; |
caryclark | 6c3b9cd | 2016-09-26 05:36:58 -0700 | [diff] [blame] | 1444 | var INTERSECT_CONIC_QUAD_3 = INTERSECT_CONIC_QUAD_2 + 1; |
| 1445 | var INTERSECT_CONIC_QUAD_4 = INTERSECT_CONIC_QUAD_3 + 1; |
| 1446 | var INTERSECT_CONIC_QUAD_NO = INTERSECT_CONIC_QUAD_4 + 1; |
caryclark | 55888e4 | 2016-07-18 10:01:36 -0700 | [diff] [blame] | 1447 | var INTERSECT_CONIC = INTERSECT_CONIC_QUAD_NO + 1; |
caryclark | 1049f12 | 2015-04-20 08:31:59 -0700 | [diff] [blame] | 1448 | var INTERSECT_CONIC_2 = INTERSECT_CONIC + 1; |
| 1449 | var INTERSECT_CONIC_NO = INTERSECT_CONIC_2 + 1; |
| 1450 | var INTERSECT_SELF_CUBIC = INTERSECT_CONIC_NO + 1; |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 1451 | var INTERSECT_SELF_CUBIC_NO = INTERSECT_SELF_CUBIC + 1; |
| 1452 | var INTERSECT_CUBIC_LINE = INTERSECT_SELF_CUBIC_NO + 1; |
| 1453 | var INTERSECT_CUBIC_LINE_2 = INTERSECT_CUBIC_LINE + 1; |
| 1454 | var INTERSECT_CUBIC_LINE_3 = INTERSECT_CUBIC_LINE_2 + 1; |
| 1455 | var INTERSECT_CUBIC_LINE_NO = INTERSECT_CUBIC_LINE_3 + 1; |
| 1456 | var INTERSECT_CUBIC_QUAD = INTERSECT_CUBIC_LINE_NO + 1; |
| 1457 | var INTERSECT_CUBIC_QUAD_2 = INTERSECT_CUBIC_QUAD + 1; |
| 1458 | var INTERSECT_CUBIC_QUAD_3 = INTERSECT_CUBIC_QUAD_2 + 1; |
| 1459 | var INTERSECT_CUBIC_QUAD_4 = INTERSECT_CUBIC_QUAD_3 + 1; |
| 1460 | var INTERSECT_CUBIC_QUAD_NO = INTERSECT_CUBIC_QUAD_4 + 1; |
| 1461 | var INTERSECT_CUBIC = INTERSECT_CUBIC_QUAD_NO + 1; |
| 1462 | var INTERSECT_CUBIC_2 = INTERSECT_CUBIC + 1; |
| 1463 | var INTERSECT_CUBIC_3 = INTERSECT_CUBIC_2 + 1; |
| 1464 | var INTERSECT_CUBIC_4 = INTERSECT_CUBIC_3 + 1; |
| 1465 | // FIXME: add cubic 5- 9 |
| 1466 | var INTERSECT_CUBIC_NO = INTERSECT_CUBIC_4 + 1; |
| 1467 | |
| 1468 | var SORT_UNARY = INTERSECT_CUBIC_NO + 1; |
| 1469 | var SORT_BINARY = SORT_UNARY + 1; |
| 1470 | |
| 1471 | var OP_DIFFERENCE = SORT_BINARY + 1; |
| 1472 | var OP_INTERSECT = OP_DIFFERENCE + 1; |
| 1473 | var OP_UNION = OP_INTERSECT + 1; |
| 1474 | var OP_XOR = OP_UNION + 1; |
| 1475 | |
| 1476 | var MARK_LINE = OP_XOR + 1; |
| 1477 | var MARK_QUAD = MARK_LINE + 1; |
caryclark | 1049f12 | 2015-04-20 08:31:59 -0700 | [diff] [blame] | 1478 | var MARK_CONIC = MARK_QUAD + 1; |
| 1479 | var MARK_CUBIC = MARK_CONIC + 1; |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 1480 | var MARK_DONE_LINE = MARK_CUBIC + 1; |
| 1481 | var MARK_DONE_QUAD = MARK_DONE_LINE + 1; |
caryclark | 1049f12 | 2015-04-20 08:31:59 -0700 | [diff] [blame] | 1482 | var MARK_DONE_CONIC = MARK_DONE_QUAD + 1; |
| 1483 | var MARK_DONE_CUBIC = MARK_DONE_CONIC + 1; |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 1484 | var MARK_UNSORTABLE_LINE = MARK_DONE_CUBIC + 1; |
| 1485 | var MARK_UNSORTABLE_QUAD = MARK_UNSORTABLE_LINE + 1; |
caryclark | 1049f12 | 2015-04-20 08:31:59 -0700 | [diff] [blame] | 1486 | var MARK_UNSORTABLE_CONIC = MARK_UNSORTABLE_QUAD + 1; |
| 1487 | var MARK_UNSORTABLE_CUBIC = MARK_UNSORTABLE_CONIC + 1; |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 1488 | var MARK_SIMPLE_LINE = MARK_UNSORTABLE_CUBIC + 1; |
| 1489 | var MARK_SIMPLE_QUAD = MARK_SIMPLE_LINE + 1; |
caryclark | 1049f12 | 2015-04-20 08:31:59 -0700 | [diff] [blame] | 1490 | var MARK_SIMPLE_CONIC = MARK_SIMPLE_QUAD + 1; |
| 1491 | var MARK_SIMPLE_CUBIC = MARK_SIMPLE_CONIC + 1; |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 1492 | var MARK_SIMPLE_DONE_LINE = MARK_SIMPLE_CUBIC + 1; |
| 1493 | var MARK_SIMPLE_DONE_QUAD = MARK_SIMPLE_DONE_LINE + 1; |
caryclark | 1049f12 | 2015-04-20 08:31:59 -0700 | [diff] [blame] | 1494 | var MARK_SIMPLE_DONE_CONIC = MARK_SIMPLE_DONE_QUAD + 1; |
| 1495 | var MARK_SIMPLE_DONE_CUBIC = MARK_SIMPLE_DONE_CONIC + 1; |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 1496 | var MARK_DONE_UNARY_LINE = MARK_SIMPLE_DONE_CUBIC + 1; |
| 1497 | var MARK_DONE_UNARY_QUAD = MARK_DONE_UNARY_LINE + 1; |
caryclark | 1049f12 | 2015-04-20 08:31:59 -0700 | [diff] [blame] | 1498 | var MARK_DONE_UNARY_CONIC = MARK_DONE_UNARY_QUAD + 1; |
| 1499 | var MARK_DONE_UNARY_CUBIC = MARK_DONE_UNARY_CONIC + 1; |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 1500 | var MARK_ANGLE_LAST = MARK_DONE_UNARY_CUBIC + 1; |
| 1501 | |
| 1502 | var COMPUTED_SET_1 = MARK_ANGLE_LAST + 1; |
| 1503 | var COMPUTED_SET_2 = COMPUTED_SET_1 + 1; |
| 1504 | |
caryclark | 624637c | 2015-05-11 07:21:27 -0700 | [diff] [blame] | 1505 | var ANGLE_AFTER = COMPUTED_SET_2 + 1; |
caryclark | 5435929 | 2015-03-26 07:52:43 -0700 | [diff] [blame] | 1506 | var ANGLE_AFTERPART = ANGLE_AFTER + 1; |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 1507 | |
caryclark | 5435929 | 2015-03-26 07:52:43 -0700 | [diff] [blame] | 1508 | var ACTIVE_OP = ANGLE_AFTERPART + 1; |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 1509 | |
caryclark | 624637c | 2015-05-11 07:21:27 -0700 | [diff] [blame] | 1510 | var COIN_MAIN_SPAN = ACTIVE_OP + 1; |
| 1511 | var COIN_OPP_SPAN = COIN_MAIN_SPAN + 1; |
| 1512 | |
| 1513 | var FRAG_TYPE_LAST = COIN_OPP_SPAN; |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 1514 | |
| 1515 | var REC_TYPE_UNKNOWN = -1; |
| 1516 | var REC_TYPE_PATH = 0; |
caryclark | 5435929 | 2015-03-26 07:52:43 -0700 | [diff] [blame] | 1517 | var REC_TYPE_PATH2 = 1; |
| 1518 | var REC_TYPE_SECT = 2; |
| 1519 | var REC_TYPE_ACTIVE = 3; |
| 1520 | var REC_TYPE_ADD = 4; |
| 1521 | var REC_TYPE_SORT = 5; |
| 1522 | var REC_TYPE_OP = 6; |
| 1523 | var REC_TYPE_MARK = 7; |
| 1524 | var REC_TYPE_COMPUTED = 8; |
| 1525 | var REC_TYPE_COIN = 9; |
| 1526 | var REC_TYPE_ANGLE = 10; |
| 1527 | var REC_TYPE_ACTIVE_OP = 11; |
| 1528 | var REC_TYPE_AFTERPART = 12; |
caryclark | 03b03ca | 2015-04-23 09:13:37 -0700 | [diff] [blame] | 1529 | var REC_TYPE_TOP = 13; |
caryclark | 624637c | 2015-05-11 07:21:27 -0700 | [diff] [blame] | 1530 | var REC_TYPE_COINCIDENCE = 14; |
caryclark | 26ad22a | 2015-10-16 09:03:38 -0700 | [diff] [blame] | 1531 | var REC_TYPE_ALIGNED = 15; |
| 1532 | var REC_TYPE_LAST = REC_TYPE_ALIGNED; |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 1533 | |
| 1534 | function strs_to_nums(strs) { |
| 1535 | var result = []; |
| 1536 | for (var idx = 1; idx < strs.length; ++idx) { |
| 1537 | var str = strs[idx]; |
| 1538 | var num = parseFloat(str); |
| 1539 | if (isNaN(num)) { |
| 1540 | result.push(str); |
| 1541 | } else { |
| 1542 | result.push(num); |
| 1543 | } |
| 1544 | } |
| 1545 | return result; |
| 1546 | } |
| 1547 | |
| 1548 | function filter_str_by(id, str, regex, array) { |
| 1549 | if (regex.test(str)) { |
| 1550 | var strs = regex.exec(str); |
| 1551 | var result = strs_to_nums(strs); |
| 1552 | array.push(id); |
| 1553 | array.push(result); |
| 1554 | return true; |
| 1555 | } |
| 1556 | return false; |
| 1557 | } |
| 1558 | |
| 1559 | function construct_regexp2(pattern) { |
| 1560 | var escape = pattern.replace(/[-/\\^$*+?.()|[\]{}]/g, '\\$&'); |
| 1561 | escape = escape.replace(/UNSORTABLE/g, "\\*\\*\\* UNSORTABLE \\*\\*\\*"); |
| 1562 | escape = escape.replace(/CUBIC_VAL/g, "\\(P_VAL P_VAL P_VAL P_VAL\\)"); |
caryclark | 1049f12 | 2015-04-20 08:31:59 -0700 | [diff] [blame] | 1563 | escape = escape.replace(/CONIC_VAL/g, "\\(P_VAL P_VAL P_VAL W_VAL\\)"); |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 1564 | escape = escape.replace(/QUAD_VAL/g, "\\(P_VAL P_VAL P_VAL\\)"); |
| 1565 | escape = escape.replace(/LINE_VAL/g, "\\(P_VAL P_VAL\\)"); |
| 1566 | escape = escape.replace(/FILL_TYPE/g, "SkPath::k[a-zA-Z]+_FillType"); |
caryclark | 5435929 | 2015-03-26 07:52:43 -0700 | [diff] [blame] | 1567 | escape = escape.replace(/PTR_VAL/g, "0x[0-9A-F]+"); |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 1568 | escape = escape.replace(/PT_VAL/g, "\\(P_VAL\\)"); |
| 1569 | escape = escape.replace(/P_VAL/g, "(-?\\d+\\.?\\d*(?:e-?\\d+)?)[Ff]?, ?(-?\\d+\\.?\\d*(?:e-?\\d+)?)[Ff]?"); |
| 1570 | escape = escape.replace(/T_VAL/g, "(-?\\d+\\.?\\d*(?:e-?\\d+)?)"); |
caryclark | 1049f12 | 2015-04-20 08:31:59 -0700 | [diff] [blame] | 1571 | escape = escape.replace(/W_VAL/g, "(-?\\d+\\.?\\d*(?:e-?\\d+)?)[Ff]?"); |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 1572 | escape = escape.replace(/PATH/g, "pathB?"); |
caryclark | 1049f12 | 2015-04-20 08:31:59 -0700 | [diff] [blame] | 1573 | escape = escape.replace(/IDX/g, "(-?\\d+)"); |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 1574 | escape = escape.replace(/NUM/g, "(-?\\d+)"); |
| 1575 | escape = escape.replace(/OPT/g, "(\\?|-?\\d+)"); |
| 1576 | return new RegExp(escape, 'i'); |
| 1577 | } |
| 1578 | |
| 1579 | function construct_regexp2c(pattern) { |
| 1580 | var escape = pattern.replace(/[-/\\^$*+?.()|[\]{}]/g, '\\$&'); |
| 1581 | escape = escape.replace(/UNSORTABLE/g, "\\*\\*\\* UNSORTABLE \\*\\*\\*"); |
caryclark | 5435929 | 2015-03-26 07:52:43 -0700 | [diff] [blame] | 1582 | escape = escape.replace(/CUBIC_VAL/g, "(?:\\$\\d = )?\\{\\{\\{P_VAL\\}, \\{P_VAL\\}, \\{P_VAL\\}, \\{P_VAL\\}\\}\\}"); |
caryclark | 1049f12 | 2015-04-20 08:31:59 -0700 | [diff] [blame] | 1583 | escape = escape.replace(/CONIC_VAL/g, "(?:\\$\\d = )?\\{\\{\\{\\{P_VAL\\}, \\{P_VAL\\}, \\{P_VAL\\}\\}\\}, W_VAL\\}"); |
caryclark | 5435929 | 2015-03-26 07:52:43 -0700 | [diff] [blame] | 1584 | escape = escape.replace(/QUAD_VAL/g, "(?:\\$\\d = )?\\{\\{\\{P_VAL\\}, \\{P_VAL\\}, \\{P_VAL\\}\\}\\}"); |
| 1585 | escape = escape.replace(/LINE_VAL/g, "(?:\\$\\d = )?\\{\\{\\{P_VAL\\}, \\{P_VAL\\}\\}\\}"); |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 1586 | escape = escape.replace(/FILL_TYPE/g, "SkPath::k[a-zA-Z]+_FillType"); |
caryclark | 5435929 | 2015-03-26 07:52:43 -0700 | [diff] [blame] | 1587 | escape = escape.replace(/PTR_VAL/g, "0x[0-9A-F]+"); |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 1588 | escape = escape.replace(/PT_VAL/g, "\\{\\{P_VAL\\}\\}"); |
caryclark | 5435929 | 2015-03-26 07:52:43 -0700 | [diff] [blame] | 1589 | escape = escape.replace(/P_VAL/g, "(?:f?[xX] = )?(-?\\d+\\.?\\d*(?:e-?\\d+)?)[Ff]?, *(?: f?[yY] = )?(-?\\d+\\.?\\d*(?:e-?\\d+)?)[Ff]?"); |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 1590 | escape = escape.replace(/T_VAL/g, "(-?\\d+\\.?\\d*(?:e-?\\d+)?)"); |
caryclark | 1049f12 | 2015-04-20 08:31:59 -0700 | [diff] [blame] | 1591 | escape = escape.replace(/W_VAL/g, "(-?\\d+\\.?\\d*(?:e-?\\d+)?)[Ff]?"); |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 1592 | escape = escape.replace(/OPER/g, "[a-z]+"); |
| 1593 | escape = escape.replace(/PATH/g, "pathB?"); |
| 1594 | escape = escape.replace(/T_F/g, "([TF])"); |
caryclark | 1049f12 | 2015-04-20 08:31:59 -0700 | [diff] [blame] | 1595 | escape = escape.replace(/IDX/g, "(-?\\d+)"); |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 1596 | escape = escape.replace(/NUM/g, "(-?\\d+)"); |
| 1597 | escape = escape.replace(/OPT/g, "(\\?|-?\\d+)"); |
| 1598 | return new RegExp(escape, 'i'); |
| 1599 | } |
| 1600 | |
| 1601 | function match_regexp(str, lineNo, array, id, pattern) { |
| 1602 | var regex = construct_regexp2(pattern); |
| 1603 | if (filter_str_by(id, str, regex, array)) { |
| 1604 | return true; |
| 1605 | } |
| 1606 | regex = construct_regexp2c(pattern); |
| 1607 | return filter_str_by(id, str, regex, array); |
| 1608 | } |
| 1609 | |
| 1610 | function endsWith(str, suffix) { |
| 1611 | return str.indexOf(suffix, str.length - suffix.length) !== -1; |
| 1612 | } |
| 1613 | |
| 1614 | function parse_all(test) { |
| 1615 | var lines = test.match(/[^\r\n]+/g); |
| 1616 | var records = []; // a rec can be the original paths, a set of intersections, a set of active spans, a sort, or a path add |
| 1617 | var record = []; |
| 1618 | var recType = REC_TYPE_UNKNOWN; |
| 1619 | var lastLineNo; |
| 1620 | var moveX, moveY; |
| 1621 | for (var lineNo = 0; lineNo < lines.length; ++lineNo) { |
| 1622 | var line = lines[lineNo]; |
| 1623 | if (line.length == 0) { |
| 1624 | continue; |
| 1625 | } |
| 1626 | var opStart = "SkOpSegment::"; |
| 1627 | if (line.lastIndexOf(opStart, 0) === 0) { |
| 1628 | line = line.substr(opStart.length); |
| 1629 | } |
| 1630 | var angleStart = "SkOpAngle::"; |
| 1631 | if (line.lastIndexOf(angleStart, 0) === 0) { |
| 1632 | line = line.substr(angleStart.length); |
| 1633 | } |
caryclark | 624637c | 2015-05-11 07:21:27 -0700 | [diff] [blame] | 1634 | var coinStart = "SkOpCoincidence::"; |
| 1635 | if (line.lastIndexOf(coinStart, 0) === 0) { |
| 1636 | line = line.substr(coinStart.length); |
| 1637 | } |
caryclark | 5435929 | 2015-03-26 07:52:43 -0700 | [diff] [blame] | 1638 | var type = line.lastIndexOf("debugShowActiveSpans", 0) === 0 ? REC_TYPE_ACTIVE |
caryclark | 624637c | 2015-05-11 07:21:27 -0700 | [diff] [blame] | 1639 | : line.lastIndexOf("debugShowCoincidence", 0) === 0 ? REC_TYPE_COINCIDENCE |
caryclark | 5435929 | 2015-03-26 07:52:43 -0700 | [diff] [blame] | 1640 | : line.lastIndexOf("((SkOpSegment*)", 0) === 0 ? REC_TYPE_PATH2 |
caryclark | 55888e4 | 2016-07-18 10:01:36 -0700 | [diff] [blame] | 1641 | : line.lastIndexOf("debugShowTs", 0) === 0 ? REC_TYPE_COIN |
caryclark | 5435929 | 2015-03-26 07:52:43 -0700 | [diff] [blame] | 1642 | : line.lastIndexOf("afterPart", 0) === 0 ? REC_TYPE_AFTERPART |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 1643 | : line.lastIndexOf("debugShow", 0) === 0 ? REC_TYPE_SECT |
| 1644 | : line.lastIndexOf("activeOp", 0) === 0 ? REC_TYPE_ACTIVE_OP |
| 1645 | : line.lastIndexOf("computed", 0) === 0 ? REC_TYPE_COMPUTED |
| 1646 | : line.lastIndexOf("debugOne", 0) === 0 ? REC_TYPE_SORT |
caryclark | 26ad22a | 2015-10-16 09:03:38 -0700 | [diff] [blame] | 1647 | : line.lastIndexOf("aligned=", 0) === 0 ? REC_TYPE_ALIGNED |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 1648 | : line.lastIndexOf("dumpOne", 0) === 0 ? REC_TYPE_SORT |
caryclark | 03b03ca | 2015-04-23 09:13:37 -0700 | [diff] [blame] | 1649 | : line.lastIndexOf("findTop", 0) === 0 ? REC_TYPE_TOP |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 1650 | : line.lastIndexOf("pathB.", 0) === 0 ? REC_TYPE_ADD |
| 1651 | : line.lastIndexOf("path.", 0) === 0 ? REC_TYPE_ADD |
| 1652 | : line.lastIndexOf("after", 0) === 0 ? REC_TYPE_ANGLE |
| 1653 | : line.lastIndexOf("mark", 0) === 0 ? REC_TYPE_MARK |
| 1654 | : line.lastIndexOf(" {{", 0) === 0 ? REC_TYPE_COMPUTED |
caryclark | 5435929 | 2015-03-26 07:52:43 -0700 | [diff] [blame] | 1655 | : line.lastIndexOf("seg=", 0) === 0 ? REC_TYPE_PATH |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 1656 | : line.lastIndexOf("op", 0) === 0 ? REC_TYPE_OP |
| 1657 | : line.lastIndexOf("$", 0) === 0 ? REC_TYPE_PATH |
| 1658 | : REC_TYPE_UNKNOWN; |
| 1659 | if (recType != type || recType == REC_TYPE_ADD || recType == REC_TYPE_SECT |
| 1660 | || recType == REC_TYPE_ACTIVE_OP || recType == REC_TYPE_ANGLE) { |
| 1661 | if (recType != REC_TYPE_UNKNOWN) { |
| 1662 | records.push(recType); |
| 1663 | records.push(lastLineNo); |
| 1664 | records.push(record); |
| 1665 | } |
| 1666 | record = []; |
| 1667 | recType = type; |
| 1668 | lastLineNo = lineNo; |
| 1669 | } |
| 1670 | var found = false; |
| 1671 | switch (recType) { |
| 1672 | case REC_TYPE_ACTIVE: |
| 1673 | found = match_regexp(line, lineNo, record, ACTIVE_LINE_SPAN, "debugShowActiveSpans" + |
caryclark | 55888e4 | 2016-07-18 10:01:36 -0700 | [diff] [blame] | 1674 | " id=IDX LINE_VAL t=T_VAL tEnd=T_VAL windSum=OPT windValue=IDX" |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 1675 | ) || match_regexp(line, lineNo, record, ACTIVE_QUAD_SPAN, "debugShowActiveSpans" + |
caryclark | 55888e4 | 2016-07-18 10:01:36 -0700 | [diff] [blame] | 1676 | " id=IDX QUAD_VAL t=T_VAL tEnd=T_VAL windSum=OPT windValue=IDX" |
caryclark | 1049f12 | 2015-04-20 08:31:59 -0700 | [diff] [blame] | 1677 | ) || match_regexp(line, lineNo, record, ACTIVE_CONIC_SPAN, "debugShowActiveSpans" + |
caryclark | 55888e4 | 2016-07-18 10:01:36 -0700 | [diff] [blame] | 1678 | " id=IDX CONIC_VAL t=T_VAL tEnd=T_VAL windSum=OPT windValue=IDX" |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 1679 | ) || match_regexp(line, lineNo, record, ACTIVE_CUBIC_SPAN, "debugShowActiveSpans" + |
caryclark | 55888e4 | 2016-07-18 10:01:36 -0700 | [diff] [blame] | 1680 | " id=IDX CUBIC_VAL t=T_VAL tEnd=T_VAL windSum=OPT windValue=IDX" |
caryclark | 624637c | 2015-05-11 07:21:27 -0700 | [diff] [blame] | 1681 | ) || match_regexp(line, lineNo, record, ACTIVE_LINE_SPAN, "debugShowActiveSpans" + |
caryclark | 55888e4 | 2016-07-18 10:01:36 -0700 | [diff] [blame] | 1682 | " id=IDX LINE_VAL t=T_VAL tEnd=T_VAL windSum=OPT oppSum=OPT windValue=IDX oppValue=NUM" |
caryclark | 624637c | 2015-05-11 07:21:27 -0700 | [diff] [blame] | 1683 | ) || match_regexp(line, lineNo, record, ACTIVE_QUAD_SPAN, "debugShowActiveSpans" + |
caryclark | 55888e4 | 2016-07-18 10:01:36 -0700 | [diff] [blame] | 1684 | " id=IDX QUAD_VAL t=T_VAL tEnd=T_VAL windSum=OPT oppSum=OPT windValue=IDX oppValue=NUM" |
caryclark | 624637c | 2015-05-11 07:21:27 -0700 | [diff] [blame] | 1685 | ) || match_regexp(line, lineNo, record, ACTIVE_CONIC_SPAN, "debugShowActiveSpans" + |
caryclark | 55888e4 | 2016-07-18 10:01:36 -0700 | [diff] [blame] | 1686 | " id=IDX CONIC_VAL t=T_VAL tEnd=T_VAL windSum=OPT oppSum=OPT windValue=IDX oppValue=NUM" |
caryclark | 624637c | 2015-05-11 07:21:27 -0700 | [diff] [blame] | 1687 | ) || match_regexp(line, lineNo, record, ACTIVE_CUBIC_SPAN, "debugShowActiveSpans" + |
caryclark | 55888e4 | 2016-07-18 10:01:36 -0700 | [diff] [blame] | 1688 | " id=IDX CUBIC_VAL t=T_VAL tEnd=T_VAL windSum=OPT oppSum=OPT windValue=IDX oppValue=NUM" |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 1689 | ); |
| 1690 | break; |
| 1691 | case REC_TYPE_ACTIVE_OP: |
| 1692 | found = match_regexp(line, lineNo, record, ACTIVE_OP, "activeOp" + |
| 1693 | " id=IDX t=T_VAL tEnd=T_VAL op=OPER miFrom=NUM miTo=NUM suFrom=NUM suTo=NUM result=IDX" |
| 1694 | ); |
| 1695 | break; |
| 1696 | case REC_TYPE_ADD: |
| 1697 | if (match_regexp(line, lineNo, record, ADD_MOVETO, "PATH.moveTo(P_VAL);")) { |
| 1698 | moveX = record[1][0]; |
| 1699 | moveY = record[1][1]; |
| 1700 | found = true; |
| 1701 | } else if (match_regexp(line, lineNo, record, ADD_LINETO, "PATH.lineTo(P_VAL);")) { |
| 1702 | record[1].unshift(moveY); |
| 1703 | record[1].unshift(moveX); |
| 1704 | moveX = record[1][2]; |
| 1705 | moveY = record[1][3]; |
| 1706 | found = true; |
| 1707 | } else if (match_regexp(line, lineNo, record, ADD_QUADTO, "PATH.quadTo(P_VAL, P_VAL);")) { |
| 1708 | record[1].unshift(moveY); |
| 1709 | record[1].unshift(moveX); |
| 1710 | moveX = record[1][4]; |
| 1711 | moveY = record[1][5]; |
| 1712 | found = true; |
caryclark | 1049f12 | 2015-04-20 08:31:59 -0700 | [diff] [blame] | 1713 | } else if (match_regexp(line, lineNo, record, ADD_CONICTO, "PATH.conicTo(P_VAL, P_VAL, T_VAL);")) { |
| 1714 | record[1].unshift(moveY); |
| 1715 | record[1].unshift(moveX); |
| 1716 | moveX = record[1][4]; |
| 1717 | moveY = record[1][5]; |
| 1718 | found = true; |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 1719 | } else if (match_regexp(line, lineNo, record, ADD_CUBICTO, "PATH.cubicTo(P_VAL, P_VAL, P_VAL);")) { |
| 1720 | record[1].unshift(moveY); |
| 1721 | record[1].unshift(moveX); |
| 1722 | moveX = record[1][6]; |
| 1723 | moveY = record[1][7]; |
| 1724 | found = true; |
| 1725 | } else if (match_regexp(line, lineNo, record, ADD_FILL, "PATH.setFillType(FILL_TYPE);")) { |
| 1726 | found = true; |
| 1727 | } else { |
| 1728 | found = match_regexp(line, lineNo, record, ADD_CLOSE, "PATH.close();"); |
| 1729 | } |
| 1730 | break; |
caryclark | 5435929 | 2015-03-26 07:52:43 -0700 | [diff] [blame] | 1731 | case REC_TYPE_AFTERPART: |
Cary Clark | ff11428 | 2016-12-14 11:56:16 -0500 | [diff] [blame^] | 1732 | found = match_regexp(line, lineNo, record, PATH_LINE, "afterPart LINE_VAL id=IDX") |
| 1733 | || match_regexp(line, lineNo, record, PATH_QUAD, "afterPart QUAD_VAL id=IDX") |
| 1734 | || match_regexp(line, lineNo, record, PATH_CONIC, "afterPart CONIC_VAL id=IDX") |
| 1735 | || match_regexp(line, lineNo, record, PATH_CUBIC, "afterPart CUBIC_VAL id=IDX") |
caryclark | 5435929 | 2015-03-26 07:52:43 -0700 | [diff] [blame] | 1736 | break; |
caryclark | 26ad22a | 2015-10-16 09:03:38 -0700 | [diff] [blame] | 1737 | case REC_TYPE_ALIGNED: |
| 1738 | found = match_regexp(line, lineNo, record, PATH_LINE, "aligned=IDX LINE_VAL" |
| 1739 | ) || match_regexp(line, lineNo, record, PATH_QUAD, "aligned=IDX QUAD_VAL" |
| 1740 | ) || match_regexp(line, lineNo, record, PATH_CONIC, "aligned=IDX CONIC_VAL" |
| 1741 | ) || match_regexp(line, lineNo, record, PATH_CUBIC, "aligned=IDX CUBIC_VAL" |
| 1742 | ); |
| 1743 | break; |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 1744 | case REC_TYPE_ANGLE: |
| 1745 | found = match_regexp(line, lineNo, record, ANGLE_AFTER, "after " + |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 1746 | "[IDX/IDX] NUM/NUM tStart=T_VAL tEnd=T_VAL < [IDX/IDX] NUM/NUM tStart=T_VAL tEnd=T_VAL < [IDX/IDX] NUM/NUM tStart=T_VAL tEnd=T_VAL T_F IDX"); |
| 1747 | break; |
| 1748 | case REC_TYPE_COIN: |
| 1749 | found = true; |
| 1750 | break; |
caryclark | 624637c | 2015-05-11 07:21:27 -0700 | [diff] [blame] | 1751 | case REC_TYPE_COINCIDENCE: |
| 1752 | found = match_regexp(line, lineNo, record, COIN_MAIN_SPAN, "debugShowCoincidence" + |
| 1753 | " + id=IDX t=T_VAL tEnd=T_VAL" |
| 1754 | ) || match_regexp(line, lineNo, record, COIN_OPP_SPAN, "debugShowCoincidence" + |
| 1755 | " - id=IDX t=T_VAL tEnd=T_VAL" |
| 1756 | ); |
| 1757 | break; |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 1758 | case REC_TYPE_COMPUTED: |
| 1759 | found = line == "computed quadratics given" |
| 1760 | || match_regexp(line, lineNo, record, COMPUTED_SET_1, "computed quadratics set 1" |
| 1761 | ) || match_regexp(line, lineNo, record, COMPUTED_SET_2, "computed quadratics set 2" |
| 1762 | ) || match_regexp(line, lineNo, record, PATH_QUAD, " QUAD_VAL," |
caryclark | 1049f12 | 2015-04-20 08:31:59 -0700 | [diff] [blame] | 1763 | ) || match_regexp(line, lineNo, record, PATH_CONIC, " CONIC_VAL," |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 1764 | ) || match_regexp(line, lineNo, record, PATH_CUBIC, " CUBIC_VAL," |
| 1765 | ); |
| 1766 | break; |
| 1767 | case REC_TYPE_PATH: |
caryclark | 5435929 | 2015-03-26 07:52:43 -0700 | [diff] [blame] | 1768 | found = match_regexp(line, lineNo, record, PATH_LINE, "seg=IDX LINE_VAL" |
| 1769 | ) || match_regexp(line, lineNo, record, PATH_QUAD, "seg=IDX QUAD_VAL" |
caryclark | 1049f12 | 2015-04-20 08:31:59 -0700 | [diff] [blame] | 1770 | ) || match_regexp(line, lineNo, record, PATH_CONIC, "seg=IDX CONIC_VAL" |
caryclark | 5435929 | 2015-03-26 07:52:43 -0700 | [diff] [blame] | 1771 | ) || match_regexp(line, lineNo, record, PATH_CUBIC, "seg=IDX CUBIC_VAL" |
| 1772 | ); |
| 1773 | break; |
| 1774 | case REC_TYPE_PATH2: |
| 1775 | found = match_regexp(line, lineNo, record, PATH_LINE, "((SkOpSegment*) PTR_VAL) [IDX] {LINE_VAL}" |
| 1776 | ) || match_regexp(line, lineNo, record, PATH_QUAD, "((SkOpSegment*) PTR_VAL) [IDX] {QUAD_VAL}" |
caryclark | 1049f12 | 2015-04-20 08:31:59 -0700 | [diff] [blame] | 1777 | ) || match_regexp(line, lineNo, record, PATH_CONIC, "((SkOpSegment*) PTR_VAL) [IDX] {CONIC_VAL}" |
caryclark | 5435929 | 2015-03-26 07:52:43 -0700 | [diff] [blame] | 1778 | ) || match_regexp(line, lineNo, record, PATH_CUBIC, "((SkOpSegment*) PTR_VAL) [IDX] {CUBIC_VAL}" |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 1779 | ); |
| 1780 | break; |
| 1781 | case REC_TYPE_SECT: |
| 1782 | found = match_regexp(line, lineNo, record, INTERSECT_LINE, "debugShowLineIntersection" + |
| 1783 | " wtTs[0]=T_VAL LINE_VAL PT_VAL wnTs[0]=T_VAL LINE_VAL" |
| 1784 | ) || match_regexp(line, lineNo, record, INTERSECT_LINE_2, "debugShowLineIntersection" + |
| 1785 | " wtTs[0]=T_VAL LINE_VAL PT_VAL wtTs[1]=T_VAL PT_VAL wnTs[0]=T_VAL LINE_VAL wnTs[1]=T_VAL" |
| 1786 | ) || match_regexp(line, lineNo, record, INTERSECT_LINE_NO, "debugShowLineIntersection" + |
| 1787 | " no intersect LINE_VAL LINE_VAL" |
| 1788 | ) || match_regexp(line, lineNo, record, INTERSECT_QUAD_LINE, "debugShowQuadLineIntersection" + |
| 1789 | " wtTs[0]=T_VAL QUAD_VAL PT_VAL wnTs[0]=T_VAL LINE_VAL" |
| 1790 | ) || match_regexp(line, lineNo, record, INTERSECT_QUAD_LINE_2, "debugShowQuadLineIntersection" + |
| 1791 | " wtTs[0]=T_VAL QUAD_VAL PT_VAL wtTs[1]=T_VAL PT_VAL wnTs[0]=T_VAL LINE_VAL wnTs[1]=T_VAL" |
| 1792 | ) || match_regexp(line, lineNo, record, INTERSECT_QUAD_LINE_NO, "debugShowQuadLineIntersection" + |
| 1793 | " no intersect QUAD_VAL LINE_VAL" |
| 1794 | ) || match_regexp(line, lineNo, record, INTERSECT_QUAD, "debugShowQuadIntersection" + |
| 1795 | " wtTs[0]=T_VAL QUAD_VAL PT_VAL wnTs[0]=T_VAL QUAD_VAL" |
| 1796 | ) || match_regexp(line, lineNo, record, INTERSECT_QUAD_2, "debugShowQuadIntersection" + |
| 1797 | " wtTs[0]=T_VAL QUAD_VAL PT_VAL wtTs[1]=T_VAL PT_VAL wnTs[0]=T_VAL QUAD_VAL wnTs[1]=T_VAL" |
| 1798 | ) || match_regexp(line, lineNo, record, INTERSECT_QUAD_NO, "debugShowQuadIntersection" + |
| 1799 | " no intersect QUAD_VAL QUAD_VAL" |
caryclark | 55888e4 | 2016-07-18 10:01:36 -0700 | [diff] [blame] | 1800 | |
caryclark | 1049f12 | 2015-04-20 08:31:59 -0700 | [diff] [blame] | 1801 | ) || match_regexp(line, lineNo, record, INTERSECT_CONIC_LINE, "debugShowConicLineIntersection" + |
| 1802 | " wtTs[0]=T_VAL CONIC_VAL PT_VAL wnTs[0]=T_VAL LINE_VAL" |
| 1803 | ) || match_regexp(line, lineNo, record, INTERSECT_CONIC_LINE_2, "debugShowConicLineIntersection" + |
| 1804 | " wtTs[0]=T_VAL CONIC_VAL PT_VAL wtTs[1]=T_VAL PT_VAL wnTs[0]=T_VAL LINE_VAL wnTs[1]=T_VAL" |
| 1805 | ) || match_regexp(line, lineNo, record, INTERSECT_CONIC_LINE_NO, "debugShowConicLineIntersection" + |
| 1806 | " no intersect CONIC_VAL LINE_VAL" |
caryclark | 55888e4 | 2016-07-18 10:01:36 -0700 | [diff] [blame] | 1807 | |
| 1808 | ) || match_regexp(line, lineNo, record, INTERSECT_CONIC_QUAD, "debugShowConicQuadIntersection" + |
| 1809 | " wtTs[0]=T_VAL CONIC_VAL PT_VAL wnTs[0]=T_VAL QUAD_VAL" |
| 1810 | ) || match_regexp(line, lineNo, record, INTERSECT_CONIC_QUAD_2, "debugShowConicQuadIntersection" + |
| 1811 | " wtTs[0]=T_VAL CONIC_VAL PT_VAL wtTs[1]=T_VAL PT_VAL wnTs[0]=T_VAL QUAD_VAL wnTs[1]=T_VAL" |
caryclark | 6c3b9cd | 2016-09-26 05:36:58 -0700 | [diff] [blame] | 1812 | ) || match_regexp(line, lineNo, record, INTERSECT_CONIC_QUAD_3, "debugShowConicQuadIntersection" + |
| 1813 | " wtTs[0]=T_VAL CONIC_VAL PT_VAL wtTs[1]=T_VAL PT_VAL wtTs[2]=T_VAL PT_VAL wnTs[0]=T_VAL QUAD_VAL wnTs[1]=T_VAL wnTs[2]=T_VAL" |
| 1814 | ) || match_regexp(line, lineNo, record, INTERSECT_CONIC_QUAD_4, "debugShowConicQuadIntersection" + |
| 1815 | " wtTs[0]=T_VAL CONIC_VAL PT_VAL wtTs[1]=T_VAL PT_VAL wtTs[2]=T_VAL PT_VAL wtTs[3]=T_VAL PT_VAL wnTs[0]=T_VAL QUAD_VAL wnTs[1]=T_VAL wnTs[2]=T_VAL wnTs[3]=T_VAL" |
caryclark | 55888e4 | 2016-07-18 10:01:36 -0700 | [diff] [blame] | 1816 | ) || match_regexp(line, lineNo, record, INTERSECT_CONIC_QUAD_NO, "debugShowConicQuadIntersection" + |
| 1817 | " no intersect CONIC_VAL QUAD_VAL" |
| 1818 | |
caryclark | 1049f12 | 2015-04-20 08:31:59 -0700 | [diff] [blame] | 1819 | ) || match_regexp(line, lineNo, record, INTERSECT_CONIC, "debugShowConicIntersection" + |
| 1820 | " wtTs[0]=T_VAL CONIC_VAL PT_VAL wnTs[0]=T_VAL CONIC_VAL" |
| 1821 | ) || match_regexp(line, lineNo, record, INTERSECT_CONIC_2, "debugShowConicIntersection" + |
| 1822 | " wtTs[0]=T_VAL CONIC_VAL PT_VAL wtTs[1]=T_VAL PT_VAL wnTs[0]=T_VAL CONIC_VAL wnTs[1]=T_VAL" |
| 1823 | ) || match_regexp(line, lineNo, record, INTERSECT_CONIC_NO, "debugShowConicIntersection" + |
| 1824 | " no intersect CONIC_VAL CONIC_VAL" |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 1825 | ) || match_regexp(line, lineNo, record, INTERSECT_CUBIC_LINE, "debugShowCubicLineIntersection" + |
| 1826 | " wtTs[0]=T_VAL CUBIC_VAL PT_VAL wnTs[0]=T_VAL LINE_VAL" |
| 1827 | ) || match_regexp(line, lineNo, record, INTERSECT_CUBIC_LINE_2, "debugShowCubicLineIntersection" + |
| 1828 | " wtTs[0]=T_VAL CUBIC_VAL PT_VAL wtTs[1]=T_VAL PT_VAL wnTs[0]=T_VAL LINE_VAL wnTs[1]=T_VAL" |
| 1829 | ) || match_regexp(line, lineNo, record, INTERSECT_CUBIC_LINE_3, "debugShowCubicLineIntersection" + |
| 1830 | " wtTs[0]=T_VAL CUBIC_VAL PT_VAL wtTs[1]=T_VAL PT_VAL wtTs[2]=T_VAL PT_VAL wnTs[0]=T_VAL LINE_VAL wnTs[1]=T_VAL wnTs[2]=T_VAL" |
| 1831 | ) || match_regexp(line, lineNo, record, INTERSECT_CUBIC_LINE_NO, "debugShowCubicLineIntersection" + |
| 1832 | " no intersect CUBIC_VAL LINE_VAL" |
| 1833 | ) || match_regexp(line, lineNo, record, INTERSECT_CUBIC_QUAD, "debugShowCubicQuadIntersection" + |
| 1834 | " wtTs[0]=T_VAL CUBIC_VAL PT_VAL wnTs[0]=T_VAL QUAD_VAL" |
| 1835 | ) || match_regexp(line, lineNo, record, INTERSECT_CUBIC_QUAD_2, "debugShowCubicQuadIntersection" + |
| 1836 | " wtTs[0]=T_VAL CUBIC_VAL PT_VAL wtTs[1]=T_VAL PT_VAL wnTs[0]=T_VAL QUAD_VAL wnTs[1]=T_VAL" |
| 1837 | ) || match_regexp(line, lineNo, record, INTERSECT_CUBIC_QUAD_3, "debugShowCubicQuadIntersection" + |
| 1838 | " wtTs[0]=T_VAL CUBIC_VAL PT_VAL wtTs[1]=T_VAL PT_VAL wtTs[2]=T_VAL PT_VAL wnTs[0]=T_VAL QUAD_VAL wnTs[1]=T_VAL wnTs[2]=T_VAL" |
| 1839 | ) || match_regexp(line, lineNo, record, INTERSECT_CUBIC_QUAD_4, "debugShowCubicQuadIntersection" + |
| 1840 | " wtTs[0]=T_VAL CUBIC_VAL PT_VAL wtTs[1]=T_VAL PT_VAL wtTs[2]=T_VAL wtTs[3]=T_VAL PT_VAL wnTs[0]=T_VAL QUAD_VAL wnTs[1]=T_VAL wnTs[2]=T_VAL wnTs[3]=T_VAL" |
| 1841 | ) || match_regexp(line, lineNo, record, INTERSECT_CUBIC_QUAD_NO, "debugShowCubicQuadIntersection" + |
| 1842 | " no intersect CUBIC_VAL QUAD_VAL" |
| 1843 | ) || match_regexp(line, lineNo, record, INTERSECT_CUBIC, "debugShowCubicIntersection" + |
| 1844 | " wtTs[0]=T_VAL CUBIC_VAL PT_VAL wnTs[0]=T_VAL CUBIC_VAL" |
| 1845 | ) || match_regexp(line, lineNo, record, INTERSECT_CUBIC_2, "debugShowCubicIntersection" + |
| 1846 | " wtTs[0]=T_VAL CUBIC_VAL PT_VAL wtTs[1]=T_VAL PT_VAL wnTs[0]=T_VAL CUBIC_VAL wnTs[1]=T_VAL" |
| 1847 | ) || match_regexp(line, lineNo, record, INTERSECT_CUBIC_3, "debugShowCubicIntersection" + |
| 1848 | " wtTs[0]=T_VAL CUBIC_VAL PT_VAL wtTs[1]=T_VAL PT_VAL wtTs[2]=T_VAL PT_VAL wnTs[0]=T_VAL CUBIC_VAL wnTs[1]=T_VAL wnTs[2]=T_VAL" |
| 1849 | ) || match_regexp(line, lineNo, record, INTERSECT_CUBIC_4, "debugShowCubicIntersection" + |
| 1850 | " wtTs[0]=T_VAL CUBIC_VAL PT_VAL wtTs[1]=T_VAL PT_VAL wtTs[2]=T_VAL PT_VAL wtTs[3]=T_VAL PT_VAL wnTs[0]=T_VAL CUBIC_VAL wnTs[1]=T_VAL wnTs[2]=T_VAL wnTs[3]=T_VAL" |
| 1851 | ) || match_regexp(line, lineNo, record, INTERSECT_CUBIC_NO, "debugShowCubicIntersection" + |
| 1852 | " no intersect CUBIC_VAL CUBIC_VAL" |
| 1853 | ) || match_regexp(line, lineNo, record, INTERSECT_SELF_CUBIC, "debugShowCubicIntersection" + |
| 1854 | " wtTs[0]=T_VAL CUBIC_VAL PT_VAL wtTs[1]=T_VAL" |
| 1855 | ) || match_regexp(line, lineNo, record, INTERSECT_SELF_CUBIC_NO, "debugShowCubicIntersection" + |
| 1856 | " no self intersect CUBIC_VAL" |
| 1857 | ); |
| 1858 | break; |
| 1859 | case REC_TYPE_SORT: |
| 1860 | var hasDone = / done/.test(line); |
| 1861 | var hasUnorderable = / unorderable/.test(line); |
| 1862 | var hasSmall = / small/.test(line); |
| 1863 | var hasTiny = / tiny/.test(line); |
| 1864 | var hasOperand = / operand/.test(line); |
| 1865 | var hasStop = / stop/.test(line); |
| 1866 | line.replace(/[ a-z]+$/, ""); |
| 1867 | found = match_regexp(line, lineNo, record, SORT_UNARY, "debugOne" + |
| 1868 | " [IDX/IDX] next=IDX/IDX sect=IDX/IDX s=T_VAL [IDX] e=T_VAL [IDX] sgn=NUM windVal=IDX windSum=OPT" |
| 1869 | ) || match_regexp(line, lineNo, record, SORT_BINARY, "debugOne" + |
| 1870 | " [IDX/IDX] next=IDX/IDX sect=IDX/IDX s=T_VAL [IDX] e=T_VAL [IDX] sgn=NUM windVal=IDX windSum=OPT oppVal=IDX oppSum=OPT" |
| 1871 | ) || match_regexp(line, lineNo, record, SORT_UNARY, "dumpOne" + |
| 1872 | " [IDX/IDX] next=IDX/IDX sect=NUM/NUM s=T_VAL [IDX] e=T_VAL [IDX] sgn=NUM windVal=IDX windSum=OPT" |
| 1873 | ) || match_regexp(line, lineNo, record, SORT_BINARY, "dumpOne" + |
| 1874 | " [IDX/IDX] next=IDX/IDX sect=NUM/NUM s=T_VAL [IDX] e=T_VAL [IDX] sgn=NUM windVal=IDX windSum=OPT oppVal=IDX oppSum=OPT" |
| 1875 | ); |
| 1876 | if (found) { |
| 1877 | record[1].push(hasDone); |
| 1878 | record[1].push(hasUnorderable); |
| 1879 | record[1].push(hasSmall); |
| 1880 | record[1].push(hasTiny); |
| 1881 | record[1].push(hasOperand); |
| 1882 | record[1].push(hasStop); |
| 1883 | } |
| 1884 | break; |
caryclark | 03b03ca | 2015-04-23 09:13:37 -0700 | [diff] [blame] | 1885 | case REC_TYPE_TOP: |
| 1886 | found = match_regexp(line, lineNo, record, ACTIVE_OP, "findTop" + |
| 1887 | " id=IDX s=T_VAL e=T_VAL cw=NUM swap=NUM inflections=NUM monotonic=NUM" |
| 1888 | ) || match_regexp(line, lineNo, record, ACTIVE_OP, "findTop" + |
| 1889 | " id=IDX s=T_VAL e=T_VAL (-) cw=NUM swap=NUM inflections=NUM monotonic=NUM" |
| 1890 | ) || match_regexp(line, lineNo, record, ACTIVE_OP, "findTop" + |
| 1891 | " id=IDX s=T_VAL e=T_VAL (+) cw=NUM swap=NUM inflections=NUM monotonic=NUM" |
| 1892 | ); |
| 1893 | break; |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 1894 | case REC_TYPE_MARK: |
| 1895 | found = match_regexp(line, lineNo, record, MARK_LINE, "markWinding" + |
caryclark | 5435929 | 2015-03-26 07:52:43 -0700 | [diff] [blame] | 1896 | " id=IDX LINE_VAL t=T_VAL [IDX] PT_VAL tEnd=T_VAL newWindSum=NUM newOppSum=OPT oppSum=OPT windSum=OPT windValue=IDX" |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 1897 | ) || match_regexp(line, lineNo, record, MARK_QUAD, "markWinding" + |
caryclark | 5435929 | 2015-03-26 07:52:43 -0700 | [diff] [blame] | 1898 | " id=IDX QUAD_VAL t=T_VAL [IDX] PT_VAL tEnd=T_VAL newWindSum=NUM newOppSum=OPT oppSum=OPT windSum=OPT windValue=IDX" |
caryclark | 1049f12 | 2015-04-20 08:31:59 -0700 | [diff] [blame] | 1899 | ) || match_regexp(line, lineNo, record, MARK_CONIC, "markWinding" + |
| 1900 | " id=IDX CONIC_VAL t=T_VAL [IDX] PT_VAL tEnd=T_VAL newWindSum=NUM newOppSum=OPT oppSum=OPT windSum=OPT windValue=IDX" |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 1901 | ) || match_regexp(line, lineNo, record, MARK_CUBIC, "markWinding" + |
caryclark | 5435929 | 2015-03-26 07:52:43 -0700 | [diff] [blame] | 1902 | " id=IDX CUBIC_VAL t=T_VAL [IDX] PT_VAL tEnd=T_VAL newWindSum=NUM newOppSum=OPT oppSum=OPT windSum=OPT windValue=IDX" |
| 1903 | ) || match_regexp(line, lineNo, record, MARK_DONE_LINE, "markDone" + |
| 1904 | " id=IDX LINE_VAL t=T_VAL [IDX] PT_VAL tEnd=T_VAL newWindSum=OPT newOppSum=OPT oppSum=OPT windSum=OPT windValue=IDX oppValue=OPT" |
| 1905 | ) || match_regexp(line, lineNo, record, MARK_DONE_QUAD, "markDone" + |
| 1906 | " id=IDX QUAD_VAL t=T_VAL [IDX] PT_VAL tEnd=T_VAL newWindSum=OPT newOppSum=OPT oppSum=OPT windSum=OPT windValue=IDX oppValue=OPT" |
caryclark | 1049f12 | 2015-04-20 08:31:59 -0700 | [diff] [blame] | 1907 | ) || match_regexp(line, lineNo, record, MARK_DONE_CONIC, "markDone" + |
| 1908 | " id=IDX CONIC_VAL t=T_VAL [IDX] PT_VAL tEnd=T_VAL newWindSum=OPT newOppSum=OPT oppSum=OPT windSum=OPT windValue=IDX oppValue=OPT" |
caryclark | 5435929 | 2015-03-26 07:52:43 -0700 | [diff] [blame] | 1909 | ) || match_regexp(line, lineNo, record, MARK_DONE_CUBIC, "markDone" + |
| 1910 | " id=IDX CUBIC_VAL t=T_VAL [IDX] PT_VAL tEnd=T_VAL newWindSum=OPT newOppSum=OPT oppSum=OPT windSum=OPT windValue=IDX oppValue=OPT" |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 1911 | ) || match_regexp(line, lineNo, record, MARK_SIMPLE_LINE, "markWinding" + |
| 1912 | " id=IDX LINE_VAL t=T_VAL [IDX] PT_VAL tEnd=T_VAL newWindSum=NUM windSum=OPT windValue=IDX" |
| 1913 | ) || match_regexp(line, lineNo, record, MARK_SIMPLE_QUAD, "markWinding" + |
| 1914 | " id=IDX QUAD_VAL t=T_VAL [IDX] PT_VAL tEnd=T_VAL newWindSum=NUM windSum=OPT windValue=IDX" |
caryclark | 1049f12 | 2015-04-20 08:31:59 -0700 | [diff] [blame] | 1915 | ) || match_regexp(line, lineNo, record, MARK_SIMPLE_CONIC, "markWinding" + |
| 1916 | " id=IDX CONIC_VAL t=T_VAL [IDX] PT_VAL tEnd=T_VAL newWindSum=NUM windSum=OPT windValue=IDX" |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 1917 | ) || match_regexp(line, lineNo, record, MARK_SIMPLE_CUBIC, "markWinding" + |
| 1918 | " id=IDX CUBIC_VAL t=T_VAL [IDX] PT_VAL tEnd=T_VAL newWindSum=NUM windSum=OPT windValue=IDX" |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 1919 | ) || match_regexp(line, lineNo, record, MARK_ANGLE_LAST, "markAngle" + |
caryclark | 1049f12 | 2015-04-20 08:31:59 -0700 | [diff] [blame] | 1920 | " last segment=IDX span=IDX" |
caryclark | 5435929 | 2015-03-26 07:52:43 -0700 | [diff] [blame] | 1921 | ) || match_regexp(line, lineNo, record, MARK_ANGLE_LAST, "markAngle" + |
caryclark | 55888e4 | 2016-07-18 10:01:36 -0700 | [diff] [blame] | 1922 | " last seg=IDX span=IDX" |
| 1923 | ) || match_regexp(line, lineNo, record, MARK_ANGLE_LAST, "markAngle" + |
| 1924 | " last segment=IDX span=IDX windSum=OPT" |
| 1925 | ) || match_regexp(line, lineNo, record, MARK_ANGLE_LAST, "markAngle" + |
| 1926 | " last seg=IDX span=IDX windSum=OPT" |
| 1927 | ); |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 1928 | break; |
| 1929 | case REC_TYPE_OP: |
| 1930 | if (line.lastIndexOf("oppSign oppSign=", 0) === 0 |
| 1931 | || line.lastIndexOf("operator<", 0) === 0) { |
| 1932 | found = true; |
| 1933 | break; |
| 1934 | } |
caryclark | 5435929 | 2015-03-26 07:52:43 -0700 | [diff] [blame] | 1935 | found = match_regexp(line, lineNo, record, OP_DIFFERENCE, "op diff" |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 1936 | ) || match_regexp(line, lineNo, record, OP_INTERSECT, "op intersect" |
caryclark | 5435929 | 2015-03-26 07:52:43 -0700 | [diff] [blame] | 1937 | ) || match_regexp(line, lineNo, record, OP_INTERSECT, "op sect" |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 1938 | ) || match_regexp(line, lineNo, record, OP_UNION, "op union" |
| 1939 | ) || match_regexp(line, lineNo, record, OP_XOR, "op xor" |
| 1940 | ); |
| 1941 | break; |
| 1942 | case REC_TYPE_UNKNOWN: |
| 1943 | found = true; |
| 1944 | break; |
| 1945 | } |
| 1946 | if (!found) { |
| 1947 | console.log(line + " [" + lineNo + "] of type " + type + " not found"); |
| 1948 | } |
| 1949 | } |
| 1950 | if (recType != REC_TYPE_UNKNOWN) { |
| 1951 | records.push(recType); |
| 1952 | records.push(lastLineNo); |
| 1953 | records.push(record); |
| 1954 | } |
| 1955 | if (records.length >= 1) { |
| 1956 | tests[testIndex] = records; |
| 1957 | testLines[testIndex] = lines; |
| 1958 | } |
| 1959 | } |
| 1960 | |
| 1961 | function init(test) { |
| 1962 | var canvas = document.getElementById('canvas'); |
| 1963 | if (!canvas.getContext) return; |
| 1964 | ctx = canvas.getContext('2d'); |
| 1965 | var resScale = retina_scale && window.devicePixelRatio ? window.devicePixelRatio : 1; |
| 1966 | var unscaledWidth = window.innerWidth - 20; |
| 1967 | var unscaledHeight = window.innerHeight - 20; |
| 1968 | screenWidth = unscaledWidth; |
| 1969 | screenHeight = unscaledHeight; |
| 1970 | canvas.width = unscaledWidth * resScale; |
| 1971 | canvas.height = unscaledHeight * resScale; |
| 1972 | canvas.style.width = unscaledWidth + 'px'; |
| 1973 | canvas.style.height = unscaledHeight + 'px'; |
| 1974 | if (resScale != 1) { |
| 1975 | ctx.scale(resScale, resScale); |
| 1976 | } |
| 1977 | xmin = Infinity; |
| 1978 | xmax = -Infinity; |
| 1979 | ymin = Infinity; |
| 1980 | ymax = -Infinity; |
caryclark | 26ad22a | 2015-10-16 09:03:38 -0700 | [diff] [blame] | 1981 | hasPath = hasAlignedPath = hasComputedPath = false; |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 1982 | firstActiveSpan = -1; |
| 1983 | for (var tIndex = 0; tIndex < test.length; tIndex += 3) { |
| 1984 | var recType = test[tIndex]; |
| 1985 | if (!typeof recType == 'number' || recType < REC_TYPE_UNKNOWN || recType > REC_TYPE_LAST) { |
| 1986 | console.log("unknown rec type: " + recType); |
| 1987 | throw "stop execution"; |
| 1988 | } |
| 1989 | var records = test[tIndex + 2]; |
| 1990 | for (var recordIndex = 0; recordIndex < records.length; recordIndex += 2) { |
| 1991 | var fragType = records[recordIndex]; |
| 1992 | if (!typeof fragType == 'number' || fragType < 1 || fragType > FRAG_TYPE_LAST) { |
| 1993 | console.log("unknown in range frag type: " + fragType); |
| 1994 | throw "stop execution"; |
| 1995 | } |
| 1996 | var frags = records[recordIndex + 1]; |
| 1997 | var first = 0; |
| 1998 | var last = -1; |
| 1999 | var first2 = 0; |
| 2000 | var last2 = 0; |
| 2001 | switch (recType) { |
caryclark | 26ad22a | 2015-10-16 09:03:38 -0700 | [diff] [blame] | 2002 | case REC_TYPE_ALIGNED: |
| 2003 | hasAlignedPath = true; |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 2004 | case REC_TYPE_COMPUTED: |
| 2005 | if (fragType == COMPUTED_SET_1 || fragType == COMPUTED_SET_2) { |
| 2006 | break; |
| 2007 | } |
caryclark | 26ad22a | 2015-10-16 09:03:38 -0700 | [diff] [blame] | 2008 | if (REC_TYPE_COMPUTED == recType) { |
| 2009 | hasComputedPath = true; |
| 2010 | } |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 2011 | case REC_TYPE_PATH: |
caryclark | 5435929 | 2015-03-26 07:52:43 -0700 | [diff] [blame] | 2012 | first = 1; |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 2013 | switch (fragType) { |
| 2014 | case PATH_LINE: |
caryclark | 5435929 | 2015-03-26 07:52:43 -0700 | [diff] [blame] | 2015 | last = 5; |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 2016 | break; |
caryclark | 1049f12 | 2015-04-20 08:31:59 -0700 | [diff] [blame] | 2017 | case PATH_CONIC: |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 2018 | case PATH_QUAD: |
caryclark | 5435929 | 2015-03-26 07:52:43 -0700 | [diff] [blame] | 2019 | last = 7; |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 2020 | break; |
| 2021 | case PATH_CUBIC: |
caryclark | 5435929 | 2015-03-26 07:52:43 -0700 | [diff] [blame] | 2022 | last = 9; |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 2023 | break; |
| 2024 | default: |
caryclark | 55888e4 | 2016-07-18 10:01:36 -0700 | [diff] [blame] | 2025 | console.log("unknown " + (recType == REC_TYPE_PATH ? "REC_TYPE_PATH" |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 2026 | : "REC_TYPE_COMPUTED") + " frag type:" + fragType); |
| 2027 | throw "stop execution"; |
| 2028 | } |
| 2029 | if (recType == REC_TYPE_PATH) { |
| 2030 | hasPath = true; |
| 2031 | } |
| 2032 | break; |
caryclark | 5435929 | 2015-03-26 07:52:43 -0700 | [diff] [blame] | 2033 | case REC_TYPE_PATH2: |
| 2034 | first = 1; |
| 2035 | switch (fragType) { |
| 2036 | case PATH_LINE: |
| 2037 | last = 5; |
| 2038 | break; |
caryclark | 1049f12 | 2015-04-20 08:31:59 -0700 | [diff] [blame] | 2039 | case PATH_CONIC: |
caryclark | 5435929 | 2015-03-26 07:52:43 -0700 | [diff] [blame] | 2040 | case PATH_QUAD: |
| 2041 | last = 7; |
| 2042 | break; |
| 2043 | case PATH_CUBIC: |
| 2044 | last = 9; |
| 2045 | break; |
| 2046 | default: |
caryclark | 55888e4 | 2016-07-18 10:01:36 -0700 | [diff] [blame] | 2047 | console.log("unknown " + (recType == REC_TYPE_PATH2 ? "REC_TYPE_PATH2" |
caryclark | 5435929 | 2015-03-26 07:52:43 -0700 | [diff] [blame] | 2048 | : "REC_TYPE_COMPUTED") + " frag type:" + fragType); |
| 2049 | throw "stop execution"; |
| 2050 | } |
| 2051 | if (recType == REC_TYPE_PATH2) { |
| 2052 | hasPath = true; |
| 2053 | } |
| 2054 | break; |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 2055 | case REC_TYPE_ACTIVE: |
| 2056 | if (firstActiveSpan < 0) { |
| 2057 | firstActiveSpan = tIndex; |
| 2058 | } |
| 2059 | first = 1; |
| 2060 | switch (fragType) { |
| 2061 | case ACTIVE_LINE_SPAN: |
| 2062 | last = 5; |
| 2063 | break; |
caryclark | 1049f12 | 2015-04-20 08:31:59 -0700 | [diff] [blame] | 2064 | case ACTIVE_CONIC_SPAN: |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 2065 | case ACTIVE_QUAD_SPAN: |
| 2066 | last = 7; |
| 2067 | break; |
| 2068 | case ACTIVE_CUBIC_SPAN: |
| 2069 | last = 9; |
| 2070 | break; |
| 2071 | default: |
| 2072 | console.log("unknown REC_TYPE_ACTIVE frag type: " + fragType); |
| 2073 | throw "stop execution"; |
| 2074 | } |
| 2075 | break; |
| 2076 | case REC_TYPE_ADD: |
| 2077 | switch (fragType) { |
| 2078 | case ADD_MOVETO: |
| 2079 | break; |
| 2080 | case ADD_LINETO: |
| 2081 | last = 4; |
| 2082 | break; |
caryclark | 1049f12 | 2015-04-20 08:31:59 -0700 | [diff] [blame] | 2083 | case ADD_CONICTO: |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 2084 | case ADD_QUADTO: |
| 2085 | last = 6; |
| 2086 | break; |
| 2087 | case ADD_CUBICTO: |
| 2088 | last = 8; |
| 2089 | break; |
| 2090 | case ADD_CLOSE: |
| 2091 | case ADD_FILL: |
| 2092 | break; |
| 2093 | default: |
| 2094 | console.log("unknown REC_TYPE_ADD frag type: " + fragType); |
| 2095 | throw "stop execution"; |
| 2096 | } |
| 2097 | break; |
caryclark | 5435929 | 2015-03-26 07:52:43 -0700 | [diff] [blame] | 2098 | case REC_TYPE_AFTERPART: |
| 2099 | switch (fragType) { |
| 2100 | case PATH_LINE: |
| 2101 | last = 4; |
| 2102 | break; |
caryclark | 1049f12 | 2015-04-20 08:31:59 -0700 | [diff] [blame] | 2103 | case PATH_CONIC: |
caryclark | 5435929 | 2015-03-26 07:52:43 -0700 | [diff] [blame] | 2104 | case PATH_QUAD: |
| 2105 | last = 6; |
| 2106 | break; |
| 2107 | case PATH_CUBIC: |
| 2108 | last = 8; |
| 2109 | break; |
| 2110 | default: |
| 2111 | console.log("unknown REC_TYPE_ACTIVEPART frag type: " + fragType); |
| 2112 | throw "stop execution"; |
| 2113 | } |
| 2114 | break; |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 2115 | case REC_TYPE_SECT: |
| 2116 | switch (fragType) { |
| 2117 | case INTERSECT_LINE: |
| 2118 | first = 1; last = 5; first2 = 8; last2 = 12; |
| 2119 | break; |
| 2120 | case INTERSECT_LINE_2: |
| 2121 | first = 1; last = 5; first2 = 11; last2 = 15; |
| 2122 | break; |
| 2123 | case INTERSECT_LINE_NO: |
| 2124 | first = 0; last = 4; first2 = 4; last2 = 8; |
| 2125 | break; |
caryclark | 1049f12 | 2015-04-20 08:31:59 -0700 | [diff] [blame] | 2126 | case INTERSECT_CONIC_LINE: |
| 2127 | first = 1; last = 7; first2 = 11; last2 = 15; |
| 2128 | break; |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 2129 | case INTERSECT_QUAD_LINE: |
| 2130 | first = 1; last = 7; first2 = 10; last2 = 14; |
| 2131 | break; |
caryclark | 1049f12 | 2015-04-20 08:31:59 -0700 | [diff] [blame] | 2132 | case INTERSECT_CONIC_LINE_2: |
| 2133 | first = 1; last = 7; first2 = 14; last2 = 18; |
| 2134 | break; |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 2135 | case INTERSECT_QUAD_LINE_2: |
| 2136 | first = 1; last = 7; first2 = 13; last2 = 17; |
| 2137 | break; |
caryclark | 1049f12 | 2015-04-20 08:31:59 -0700 | [diff] [blame] | 2138 | case INTERSECT_CONIC_LINE_NO: |
| 2139 | first = 0; last = 6; first2 = 7; last2 = 11; |
| 2140 | break; |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 2141 | case INTERSECT_QUAD_LINE_NO: |
| 2142 | first = 0; last = 6; first2 = 6; last2 = 10; |
| 2143 | break; |
caryclark | 1049f12 | 2015-04-20 08:31:59 -0700 | [diff] [blame] | 2144 | case INTERSECT_CONIC: |
| 2145 | first = 1; last = 7; first2 = 11; last2 = 17; |
| 2146 | break; |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 2147 | case INTERSECT_QUAD: |
| 2148 | first = 1; last = 7; first2 = 10; last2 = 16; |
| 2149 | break; |
caryclark | 1049f12 | 2015-04-20 08:31:59 -0700 | [diff] [blame] | 2150 | case INTERSECT_CONIC_2: |
| 2151 | first = 1; last = 7; first2 = 14; last2 = 20; |
| 2152 | break; |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 2153 | case INTERSECT_QUAD_2: |
| 2154 | first = 1; last = 7; first2 = 13; last2 = 19; |
| 2155 | break; |
caryclark | 1049f12 | 2015-04-20 08:31:59 -0700 | [diff] [blame] | 2156 | case INTERSECT_CONIC_NO: |
| 2157 | first = 0; last = 6; first2 = 7; last2 = 13; |
| 2158 | break; |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 2159 | case INTERSECT_QUAD_NO: |
| 2160 | first = 0; last = 6; first2 = 6; last2 = 12; |
| 2161 | break; |
| 2162 | case INTERSECT_SELF_CUBIC: |
| 2163 | first = 1; last = 9; |
| 2164 | break; |
| 2165 | case INTERSECT_SELF_CUBIC_NO: |
| 2166 | first = 0; last = 8; |
| 2167 | break; |
| 2168 | case INTERSECT_CUBIC_LINE: |
| 2169 | first = 1; last = 9; first2 = 12; last2 = 16; |
| 2170 | break; |
| 2171 | case INTERSECT_CUBIC_LINE_2: |
| 2172 | first = 1; last = 9; first2 = 15; last2 = 19; |
| 2173 | break; |
| 2174 | case INTERSECT_CUBIC_LINE_3: |
| 2175 | first = 1; last = 9; first2 = 18; last2 = 22; |
| 2176 | break; |
| 2177 | case INTERSECT_CUBIC_LINE_NO: |
| 2178 | first = 0; last = 8; first2 = 8; last2 = 12; |
| 2179 | break; |
caryclark | 55888e4 | 2016-07-18 10:01:36 -0700 | [diff] [blame] | 2180 | case INTERSECT_CONIC_QUAD: |
| 2181 | first = 1; last = 7; first2 = 11; last2 = 17; |
| 2182 | break; |
| 2183 | case INTERSECT_CONIC_QUAD_2: |
| 2184 | first = 1; last = 7; first2 = 14; last2 = 20; |
| 2185 | break; |
caryclark | 6c3b9cd | 2016-09-26 05:36:58 -0700 | [diff] [blame] | 2186 | case INTERSECT_CONIC_QUAD_3: |
| 2187 | first = 1; last = 7; first2 = 17; last2 = 23; |
| 2188 | break; |
| 2189 | case INTERSECT_CONIC_QUAD_4: |
| 2190 | first = 1; last = 7; first2 = 20; last2 = 26; |
| 2191 | break; |
caryclark | 55888e4 | 2016-07-18 10:01:36 -0700 | [diff] [blame] | 2192 | case INTERSECT_CONIC_QUAD_NO: |
| 2193 | first = 0; last = 6; first2 = 7; last2 = 13; |
| 2194 | break; |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 2195 | case INTERSECT_CUBIC_QUAD: |
| 2196 | first = 1; last = 9; first2 = 12; last2 = 18; |
| 2197 | break; |
| 2198 | case INTERSECT_CUBIC_QUAD_2: |
| 2199 | first = 1; last = 9; first2 = 15; last2 = 21; |
| 2200 | break; |
| 2201 | case INTERSECT_CUBIC_QUAD_3: |
| 2202 | first = 1; last = 9; first2 = 18; last2 = 24; |
| 2203 | break; |
| 2204 | case INTERSECT_CUBIC_QUAD_4: |
| 2205 | first = 1; last = 9; first2 = 21; last2 = 27; |
| 2206 | break; |
| 2207 | case INTERSECT_CUBIC_QUAD_NO: |
| 2208 | first = 0; last = 8; first2 = 8; last2 = 14; |
| 2209 | break; |
| 2210 | case INTERSECT_CUBIC: |
| 2211 | first = 1; last = 9; first2 = 12; last2 = 20; |
| 2212 | break; |
| 2213 | case INTERSECT_CUBIC_2: |
| 2214 | first = 1; last = 9; first2 = 15; last2 = 23; |
| 2215 | break; |
| 2216 | case INTERSECT_CUBIC_3: |
| 2217 | first = 1; last = 9; first2 = 18; last2 = 26; |
| 2218 | break; |
| 2219 | case INTERSECT_CUBIC_4: |
| 2220 | first = 1; last = 9; first2 = 21; last2 = 29; |
| 2221 | break; |
| 2222 | case INTERSECT_CUBIC_NO: |
| 2223 | first = 0; last = 8; first2 = 8; last2 = 16; |
| 2224 | break; |
| 2225 | default: |
| 2226 | console.log("unknown REC_TYPE_SECT frag type: " + fragType); |
| 2227 | throw "stop execution"; |
| 2228 | } |
| 2229 | break; |
| 2230 | default: |
| 2231 | continue; |
| 2232 | } |
| 2233 | for (var idx = first; idx < last; idx += 2) { |
| 2234 | xmin = Math.min(xmin, frags[idx]); |
| 2235 | xmax = Math.max(xmax, frags[idx]); |
| 2236 | ymin = Math.min(ymin, frags[idx + 1]); |
| 2237 | ymax = Math.max(ymax, frags[idx + 1]); |
| 2238 | } |
| 2239 | for (var idx = first2; idx < last2; idx += 2) { |
| 2240 | xmin = Math.min(xmin, frags[idx]); |
| 2241 | xmax = Math.max(xmax, frags[idx]); |
| 2242 | ymin = Math.min(ymin, frags[idx + 1]); |
| 2243 | ymax = Math.max(ymax, frags[idx + 1]); |
| 2244 | } |
| 2245 | } |
| 2246 | } |
| 2247 | var angleBounds = [Infinity, Infinity, -Infinity, -Infinity]; |
| 2248 | for (var tIndex = 0; tIndex < test.length; tIndex += 3) { |
| 2249 | var recType = test[tIndex]; |
| 2250 | var records = test[tIndex + 2]; |
| 2251 | for (var recordIndex = 0; recordIndex < records.length; recordIndex += 2) { |
| 2252 | var fragType = records[recordIndex]; |
| 2253 | var frags = records[recordIndex + 1]; |
| 2254 | switch (recType) { |
| 2255 | case REC_TYPE_ACTIVE_OP: |
| 2256 | if (!draw_op) { |
| 2257 | break; |
| 2258 | } |
| 2259 | { |
| 2260 | var curve = curvePartialByID(test, frags[0], frags[1], frags[2]); |
| 2261 | curve_extremes(curve, angleBounds); |
| 2262 | } |
| 2263 | break; |
| 2264 | case REC_TYPE_ANGLE: |
| 2265 | if (!draw_angle) { |
| 2266 | break; |
| 2267 | } |
caryclark | 5435929 | 2015-03-26 07:52:43 -0700 | [diff] [blame] | 2268 | { |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 2269 | var curve = curvePartialByID(test, frags[0], frags[4], frags[5]); |
| 2270 | curve_extremes(curve, angleBounds); |
| 2271 | curve = curvePartialByID(test, frags[6], frags[10], frags[11]); |
| 2272 | curve_extremes(curve, angleBounds); |
| 2273 | curve = curvePartialByID(test, frags[12], frags[16], frags[17]); |
| 2274 | } |
| 2275 | break; |
caryclark | 624637c | 2015-05-11 07:21:27 -0700 | [diff] [blame] | 2276 | case REC_TYPE_COINCIDENCE: |
| 2277 | if (!draw_coincidence) { |
| 2278 | break; |
| 2279 | } |
| 2280 | { |
| 2281 | var curve = curvePartialByID(test, frags[0], frags[1], frags[2]); |
| 2282 | curve_extremes(curve, angleBounds); |
| 2283 | } |
| 2284 | break; |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 2285 | case REC_TYPE_SORT: |
| 2286 | if (!draw_sort) { |
| 2287 | break; |
| 2288 | } |
| 2289 | if (fragType == SORT_UNARY || fragType == SORT_BINARY) { |
| 2290 | var curve = curvePartialByID(test, frags[0], frags[6], frags[8]); |
| 2291 | curve_extremes(curve, angleBounds); |
| 2292 | } |
| 2293 | break; |
caryclark | 03b03ca | 2015-04-23 09:13:37 -0700 | [diff] [blame] | 2294 | case REC_TYPE_TOP: |
| 2295 | if (!draw_top) { |
| 2296 | break; |
| 2297 | } |
| 2298 | { |
| 2299 | var curve = curvePartialByID(test, frags[0], frags[1], frags[2]); |
| 2300 | curve_extremes(curve, angleBounds); |
| 2301 | } |
| 2302 | break; |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 2303 | } |
| 2304 | } |
| 2305 | } |
| 2306 | xmin = Math.min(xmin, angleBounds[0]); |
| 2307 | ymin = Math.min(ymin, angleBounds[1]); |
| 2308 | xmax = Math.max(xmax, angleBounds[2]); |
| 2309 | ymax = Math.max(ymax, angleBounds[3]); |
| 2310 | setScale(xmin, xmax, ymin, ymax); |
| 2311 | if (hasPath == false && hasComputedPath == true && !draw_computed) { |
caryclark | 1049f12 | 2015-04-20 08:31:59 -0700 | [diff] [blame] | 2312 | draw_computed = 7; // show quadratics, conics, and cubics |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 2313 | } |
| 2314 | if (hasPath == true && hasComputedPath == false && draw_computed) { |
| 2315 | draw_computed = 0; |
| 2316 | } |
| 2317 | } |
| 2318 | |
caryclark | 26ad22a | 2015-10-16 09:03:38 -0700 | [diff] [blame] | 2319 | function curveByIDMatch(test, id, recMatch) { |
caryclark | 5435929 | 2015-03-26 07:52:43 -0700 | [diff] [blame] | 2320 | var tIndex = -3; |
| 2321 | while ((tIndex += 3) < test.length) { |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 2322 | var recType = test[tIndex]; |
caryclark | 5435929 | 2015-03-26 07:52:43 -0700 | [diff] [blame] | 2323 | if (recType == REC_TYPE_OP) { |
| 2324 | continue; |
| 2325 | } |
caryclark | 26ad22a | 2015-10-16 09:03:38 -0700 | [diff] [blame] | 2326 | if (recType != recMatch) { |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 2327 | return []; |
| 2328 | } |
| 2329 | var records = test[tIndex + 2]; |
| 2330 | for (var recordIndex = 0; recordIndex < records.length; recordIndex += 2) { |
| 2331 | var fragType = records[recordIndex]; |
| 2332 | var frags = records[recordIndex + 1]; |
| 2333 | if (frags[0] == id) { |
| 2334 | switch (fragType) { |
caryclark | 5435929 | 2015-03-26 07:52:43 -0700 | [diff] [blame] | 2335 | case PATH_LINE: |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 2336 | return [frags[1], frags[2], frags[3], frags[4]]; |
caryclark | 5435929 | 2015-03-26 07:52:43 -0700 | [diff] [blame] | 2337 | case PATH_QUAD: |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 2338 | return [frags[1], frags[2], frags[3], frags[4], |
| 2339 | frags[5], frags[6]]; |
caryclark | 1049f12 | 2015-04-20 08:31:59 -0700 | [diff] [blame] | 2340 | case PATH_CONIC: |
| 2341 | return [frags[1], frags[2], frags[3], frags[4], |
| 2342 | frags[5], frags[6], frags[7]]; |
caryclark | 5435929 | 2015-03-26 07:52:43 -0700 | [diff] [blame] | 2343 | case PATH_CUBIC: |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 2344 | return [frags[1], frags[2], frags[3], frags[4], |
| 2345 | frags[5], frags[6], frags[7], frags[8]]; |
| 2346 | } |
| 2347 | } |
| 2348 | } |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 2349 | } |
| 2350 | return []; |
| 2351 | } |
| 2352 | |
caryclark | 26ad22a | 2015-10-16 09:03:38 -0700 | [diff] [blame] | 2353 | function curveByID(test, id) { |
| 2354 | var result = draw_path >= 4 ? curveByIDMatch(test, id, REC_TYPE_ALIGNED) : []; |
| 2355 | if (!result.length) { |
| 2356 | result = curveByIDMatch(test, id, REC_TYPE_PATH); |
| 2357 | } |
| 2358 | return result; |
| 2359 | } |
| 2360 | |
| 2361 | function curvePartialByIDMatch(test, id, t0, t1, recMatch) { |
caryclark | 5435929 | 2015-03-26 07:52:43 -0700 | [diff] [blame] | 2362 | var tIndex = -3; |
| 2363 | while ((tIndex += 3) < test.length) { |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 2364 | var recType = test[tIndex]; |
caryclark | 5435929 | 2015-03-26 07:52:43 -0700 | [diff] [blame] | 2365 | if (recType == REC_TYPE_OP) { |
| 2366 | continue; |
| 2367 | } |
caryclark | 26ad22a | 2015-10-16 09:03:38 -0700 | [diff] [blame] | 2368 | if (recType != recMatch) { |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 2369 | return []; |
| 2370 | } |
| 2371 | var records = test[tIndex + 2]; |
| 2372 | for (var recordIndex = 0; recordIndex < records.length; recordIndex += 2) { |
| 2373 | var fragType = records[recordIndex]; |
| 2374 | var frags = records[recordIndex + 1]; |
| 2375 | if (frags[0] == id) { |
| 2376 | switch (fragType) { |
caryclark | 5435929 | 2015-03-26 07:52:43 -0700 | [diff] [blame] | 2377 | case PATH_LINE: |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 2378 | return linePartial(frags[1], frags[2], frags[3], frags[4], t0, t1); |
caryclark | 5435929 | 2015-03-26 07:52:43 -0700 | [diff] [blame] | 2379 | case PATH_QUAD: |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 2380 | return quadPartial(frags[1], frags[2], frags[3], frags[4], |
| 2381 | frags[5], frags[6], t0, t1); |
caryclark | 1049f12 | 2015-04-20 08:31:59 -0700 | [diff] [blame] | 2382 | case PATH_CONIC: |
| 2383 | return conicPartial(frags[1], frags[2], frags[3], frags[4], |
| 2384 | frags[5], frags[6], frags[7], t0, t1); |
caryclark | 5435929 | 2015-03-26 07:52:43 -0700 | [diff] [blame] | 2385 | case PATH_CUBIC: |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 2386 | return cubicPartial(frags[1], frags[2], frags[3], frags[4], |
| 2387 | frags[5], frags[6], frags[7], frags[8], t0, t1); |
| 2388 | } |
| 2389 | } |
| 2390 | } |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 2391 | } |
| 2392 | return []; |
| 2393 | } |
| 2394 | |
caryclark | 26ad22a | 2015-10-16 09:03:38 -0700 | [diff] [blame] | 2395 | function curvePartialByID(test, id, t0, t1) { |
| 2396 | var result = draw_path >= 4 ? curvePartialByIDMatch(test, id, t0, t1, REC_TYPE_ALIGNED) : []; |
| 2397 | if (!result.length) { |
| 2398 | result = curvePartialByIDMatch(test, id, t0, t1, REC_TYPE_PATH); |
| 2399 | } |
| 2400 | return result; |
| 2401 | } |
| 2402 | |
| 2403 | function idByCurveIDMatch(test, frag, type, recMatch) { |
caryclark | 5435929 | 2015-03-26 07:52:43 -0700 | [diff] [blame] | 2404 | var tIndex = 0; |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 2405 | while (tIndex < test.length) { |
| 2406 | var recType = test[tIndex]; |
caryclark | 26ad22a | 2015-10-16 09:03:38 -0700 | [diff] [blame] | 2407 | if (recType != recMatch) { |
caryclark | 5435929 | 2015-03-26 07:52:43 -0700 | [diff] [blame] | 2408 | ++tIndex; |
| 2409 | continue; |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 2410 | } |
| 2411 | var records = test[tIndex + 2]; |
| 2412 | for (var recordIndex = 0; recordIndex < records.length; recordIndex += 2) { |
| 2413 | var fragType = records[recordIndex]; |
| 2414 | var frags = records[recordIndex + 1]; |
caryclark | 5435929 | 2015-03-26 07:52:43 -0700 | [diff] [blame] | 2415 | if (frag.length != frags.length - 1) { |
| 2416 | continue; |
| 2417 | } |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 2418 | switch (fragType) { |
caryclark | 5435929 | 2015-03-26 07:52:43 -0700 | [diff] [blame] | 2419 | case PATH_LINE: |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 2420 | if (frag[0] != frags[1] || frag[1] != frags[2] |
| 2421 | || frag[2] != frags[3] || frag[3] != frags[4]) { |
| 2422 | continue; |
| 2423 | } |
| 2424 | return frags[0]; |
caryclark | 5435929 | 2015-03-26 07:52:43 -0700 | [diff] [blame] | 2425 | case PATH_QUAD: |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 2426 | if (frag[0] != frags[1] || frag[1] != frags[2] |
| 2427 | || frag[2] != frags[3] || frag[3] != frags[4] |
| 2428 | || frag[4] != frags[5] || frag[5] != frags[6]) { |
| 2429 | continue; |
| 2430 | } |
| 2431 | return frags[0]; |
caryclark | 1049f12 | 2015-04-20 08:31:59 -0700 | [diff] [blame] | 2432 | case PATH_CONIC: |
| 2433 | if (frag[0] != frags[1] || frag[1] != frags[2] |
| 2434 | || frag[2] != frags[3] || frag[3] != frags[4] |
| 2435 | || frag[4] != frags[5] || frag[5] != frags[6] |
| 2436 | || frag[6] != frags[7]) { |
| 2437 | continue; |
| 2438 | } |
| 2439 | return frags[0]; |
caryclark | 5435929 | 2015-03-26 07:52:43 -0700 | [diff] [blame] | 2440 | case PATH_CUBIC: |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 2441 | if (frag[0] != frags[1] || frag[1] != frags[2] |
| 2442 | || frag[2] != frags[3] || frag[3] != frags[4] |
| 2443 | || frag[4] != frags[5] || frag[5] != frags[6] |
| 2444 | || frag[6] != frags[7] || frag[7] != frags[8]) { |
| 2445 | continue; |
| 2446 | } |
| 2447 | return frags[0]; |
| 2448 | } |
| 2449 | } |
| 2450 | ++tIndex; |
| 2451 | } |
| 2452 | return -1; |
| 2453 | } |
| 2454 | |
caryclark | 26ad22a | 2015-10-16 09:03:38 -0700 | [diff] [blame] | 2455 | function idByCurve(test, frag, type) { |
| 2456 | var result = draw_path >= 4 ? idByCurveIDMatch(test, frag, type, REC_TYPE_ALIGNED) : []; |
| 2457 | if (!result.length) { |
| 2458 | result = idByCurveIDMatch(test, frag, type, REC_TYPE_PATH); |
| 2459 | } |
| 2460 | return result; |
| 2461 | } |
| 2462 | |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 2463 | function curve_extremes(curve, bounds) { |
caryclark | 1049f12 | 2015-04-20 08:31:59 -0700 | [diff] [blame] | 2464 | var length = curve.length == 7 ? 6 : curve.length; |
caryclark | ed0935a | 2015-10-22 07:23:52 -0700 | [diff] [blame] | 2465 | for (var index = 0; index < length; index += 2) { |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 2466 | var x = curve[index]; |
| 2467 | var y = curve[index + 1]; |
| 2468 | bounds[0] = Math.min(bounds[0], x); |
| 2469 | bounds[1] = Math.min(bounds[1], y); |
| 2470 | bounds[2] = Math.max(bounds[2], x); |
| 2471 | bounds[3] = Math.max(bounds[3], y); |
| 2472 | } |
| 2473 | } |
| 2474 | |
| 2475 | function setScale(x0, x1, y0, y1) { |
| 2476 | var srcWidth = x1 - x0; |
| 2477 | var srcHeight = y1 - y0; |
| 2478 | var usableWidth = screenWidth; |
| 2479 | var xDigits = Math.ceil(Math.log(Math.abs(xmax)) / Math.log(10)); |
| 2480 | var yDigits = Math.ceil(Math.log(Math.abs(ymax)) / Math.log(10)); |
| 2481 | usableWidth -= (xDigits + yDigits) * 10; |
| 2482 | usableWidth -= decimal_places * 10; |
| 2483 | if (draw_legend) { |
| 2484 | usableWidth -= 40; |
| 2485 | } |
| 2486 | var hscale = usableWidth / srcWidth; |
| 2487 | var vscale = screenHeight / srcHeight; |
| 2488 | scale = Math.min(hscale, vscale); |
| 2489 | var invScale = 1 / scale; |
| 2490 | var sxmin = x0 - invScale * 5; |
| 2491 | var symin = y0 - invScale * 10; |
| 2492 | var sxmax = x1 + invScale * (6 * decimal_places + 10); |
| 2493 | var symax = y1 + invScale * 10; |
| 2494 | srcWidth = sxmax - sxmin; |
| 2495 | srcHeight = symax - symin; |
| 2496 | hscale = usableWidth / srcWidth; |
| 2497 | vscale = screenHeight / srcHeight; |
| 2498 | scale = Math.min(hscale, vscale); |
| 2499 | srcLeft = sxmin; |
| 2500 | srcTop = symin; |
| 2501 | } |
| 2502 | |
| 2503 | function drawArc(curve, op, from, to) { |
| 2504 | var type = PATH_LINE + (curve.length / 2 - 2); |
| 2505 | var pt = pointAtT(curve, type, op ? 0.4 : 0.6); |
| 2506 | var dy = pt.y - curve[1]; |
| 2507 | var dx = pt.x - curve[0]; |
| 2508 | var dist = Math.sqrt(dy * dy + dx * dx); |
| 2509 | var _dist = dist * scale; |
| 2510 | var angle = Math.atan2(dy, dx); |
| 2511 | var _px = (curve[0] - srcLeft) * scale; |
| 2512 | var _py = (curve[1] - srcTop) * scale; |
| 2513 | var divisor = 4; |
| 2514 | var endDist; |
| 2515 | do { |
| 2516 | var ends = []; |
| 2517 | for (var index = -1; index <= 1; index += 2) { |
| 2518 | var px = Math.cos(index * Math.PI / divisor); |
| 2519 | var py = Math.sin(index * Math.PI / divisor); |
| 2520 | ends.push(px); |
| 2521 | ends.push(py); |
| 2522 | } |
| 2523 | var endDx = (ends[2] - ends[0]) * scale * dist; |
| 2524 | var endDy = (ends[3] - ends[1]) * scale * dist; |
| 2525 | endDist = Math.sqrt(endDx * endDx + endDy * endDy); |
| 2526 | if (endDist < 100) { |
| 2527 | break; |
| 2528 | } |
| 2529 | divisor *= 2; |
| 2530 | } while (true); |
| 2531 | if (endDist < 30) { |
| 2532 | return; |
| 2533 | } |
| 2534 | if (op) { |
| 2535 | divisor *= 2; |
| 2536 | } |
| 2537 | ctx.strokeStyle = op ? "rgba(210,0,45, 0.4)" : "rgba(90,90,90, 0.5)"; |
| 2538 | ctx.beginPath(); |
| 2539 | ctx.arc(_px, _py, _dist, angle - Math.PI / divisor, angle + Math.PI / divisor, false); |
| 2540 | ctx.stroke(); |
| 2541 | var saveAlign = ctx.textAlign; |
| 2542 | var saveStyle = ctx.fillStyle; |
| 2543 | var saveFont = ctx.font; |
| 2544 | ctx.textAlign = "center"; |
| 2545 | ctx.fillStyle = "black"; |
| 2546 | ctx.font = "normal 24px Arial"; |
| 2547 | divisor *= 0.8; |
| 2548 | for (var index = -1; index <= 1; index += 2) { |
| 2549 | var px = curve[0] + Math.cos(angle + index * Math.PI / divisor) * dist; |
| 2550 | var py = curve[1] + Math.sin(angle + index * Math.PI / divisor) * dist; |
| 2551 | var _px = (px - srcLeft) * scale; |
| 2552 | var _py = (py - srcTop) * scale; |
| 2553 | ctx.fillText(index < 0 ? to.toString() : from.toString(), _px, _py + 8); |
| 2554 | } |
| 2555 | ctx.textAlign = saveAlign; |
| 2556 | ctx.fillStyle = saveStyle; |
| 2557 | ctx.font = saveFont; |
| 2558 | } |
| 2559 | |
| 2560 | function drawPoint(px, py, end) { |
caryclark | 1049f12 | 2015-04-20 08:31:59 -0700 | [diff] [blame] | 2561 | var length = drawnPts.length == 7 ? 6 : drawnPts.length; |
| 2562 | for (var pts = 0; pts < length; pts += 2) { |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 2563 | var x = drawnPts[pts]; |
| 2564 | var y = drawnPts[pts + 1]; |
| 2565 | if (px == x && py == y) { |
| 2566 | return; |
| 2567 | } |
| 2568 | } |
| 2569 | drawnPts.push(px); |
| 2570 | drawnPts.push(py); |
| 2571 | var label = px.toFixed(decimal_places) + ", " + py.toFixed(decimal_places); |
| 2572 | var _px = (px - srcLeft) * scale; |
| 2573 | var _py = (py - srcTop) * scale; |
| 2574 | ctx.beginPath(); |
| 2575 | ctx.arc(_px, _py, 3, 0, Math.PI*2, true); |
| 2576 | ctx.closePath(); |
| 2577 | if (end) { |
| 2578 | ctx.fill(); |
| 2579 | } else { |
| 2580 | ctx.stroke(); |
| 2581 | } |
| 2582 | if (debug_xy) { |
| 2583 | ctx.textAlign = "left"; |
| 2584 | ctx.fillText(label, _px + 5, _py); |
| 2585 | } |
| 2586 | } |
| 2587 | |
caryclark | 1049f12 | 2015-04-20 08:31:59 -0700 | [diff] [blame] | 2588 | function coordCount(curveType) { |
| 2589 | switch (curveType) { |
| 2590 | case PATH_LINE: |
| 2591 | return 4; |
| 2592 | case PATH_QUAD: |
| 2593 | return 6; |
| 2594 | case PATH_CONIC: |
| 2595 | return 6; |
| 2596 | case PATH_CUBIC: |
| 2597 | return 8; |
| 2598 | } |
| 2599 | return -1; |
| 2600 | } |
| 2601 | |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 2602 | function drawPoints(ptArray, curveType, drawControls) { |
caryclark | 1049f12 | 2015-04-20 08:31:59 -0700 | [diff] [blame] | 2603 | var count = coordCount(curveType); |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 2604 | for (var idx = 0; idx < count; idx += 2) { |
| 2605 | if (!drawControls && idx != 0 && idx != count - 2) { |
| 2606 | continue; |
| 2607 | } |
| 2608 | drawPoint(ptArray[idx], ptArray[idx + 1], idx == 0 || idx == count - 2); |
| 2609 | } |
| 2610 | } |
| 2611 | |
| 2612 | function drawControlLines(curve, curveType, drawEnd) { |
| 2613 | if (curveType == PATH_LINE) { |
| 2614 | return; |
| 2615 | } |
| 2616 | ctx.strokeStyle = "rgba(0,0,0, 0.3)"; |
| 2617 | drawLine(curve[0], curve[1], curve[2], curve[3]); |
| 2618 | drawLine(curve[2], curve[3], curve[4], curve[5]); |
| 2619 | if (curveType == PATH_CUBIC) { |
| 2620 | drawLine(curve[4], curve[5], curve[6], curve[7]); |
| 2621 | if (drawEnd > 1) { |
| 2622 | drawLine(curve[6], curve[7], curve[0], curve[1]); |
| 2623 | if (drawEnd > 2) { |
| 2624 | drawLine(curve[0], curve[1], curve[4], curve[5]); |
| 2625 | drawLine(curve[6], curve[7], curve[2], curve[3]); |
| 2626 | } |
| 2627 | } |
| 2628 | } else if (drawEnd > 1) { |
| 2629 | drawLine(curve[4], curve[5], curve[0], curve[1]); |
| 2630 | } |
| 2631 | } |
| 2632 | |
| 2633 | function pointAtT(curve, curveType, t) { |
| 2634 | var xy = {}; |
| 2635 | switch (curveType) { |
| 2636 | case PATH_LINE: |
| 2637 | var a = 1 - t; |
| 2638 | var b = t; |
| 2639 | xy.x = a * curve[0] + b * curve[2]; |
| 2640 | xy.y = a * curve[1] + b * curve[3]; |
| 2641 | break; |
| 2642 | case PATH_QUAD: |
| 2643 | var one_t = 1 - t; |
| 2644 | var a = one_t * one_t; |
| 2645 | var b = 2 * one_t * t; |
| 2646 | var c = t * t; |
| 2647 | xy.x = a * curve[0] + b * curve[2] + c * curve[4]; |
| 2648 | xy.y = a * curve[1] + b * curve[3] + c * curve[5]; |
| 2649 | break; |
caryclark | 1049f12 | 2015-04-20 08:31:59 -0700 | [diff] [blame] | 2650 | case PATH_CONIC: |
| 2651 | var one_t = 1 - t; |
| 2652 | var a = one_t * one_t; |
| 2653 | var b = 2 * one_t * t; |
| 2654 | var c = t * t; |
| 2655 | xy.x = a * curve[0] + b * curve[2] * curve[6] + c * curve[4]; |
| 2656 | xy.y = a * curve[1] + b * curve[3] * curve[6] + c * curve[5]; |
| 2657 | var d = a + b * curve[6] + c; |
| 2658 | xy.x /= d; |
| 2659 | xy.y /= d; |
| 2660 | break; |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 2661 | case PATH_CUBIC: |
| 2662 | var one_t = 1 - t; |
| 2663 | var one_t2 = one_t * one_t; |
| 2664 | var a = one_t2 * one_t; |
| 2665 | var b = 3 * one_t2 * t; |
| 2666 | var t2 = t * t; |
| 2667 | var c = 3 * one_t * t2; |
| 2668 | var d = t2 * t; |
| 2669 | xy.x = a * curve[0] + b * curve[2] + c * curve[4] + d * curve[6]; |
| 2670 | xy.y = a * curve[1] + b * curve[3] + c * curve[5] + d * curve[7]; |
| 2671 | break; |
| 2672 | } |
| 2673 | return xy; |
| 2674 | } |
caryclark | 55888e4 | 2016-07-18 10:01:36 -0700 | [diff] [blame] | 2675 | |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 2676 | function drawPointAtT(curve, curveType) { |
| 2677 | var x, y; |
| 2678 | var xy = pointAtT(curve, curveType, curveT); |
| 2679 | drawPoint(xy.x, xy.y, true); |
| 2680 | if (!draw_intersectT) { |
| 2681 | return; |
| 2682 | } |
| 2683 | ctx.fillStyle = "red"; |
| 2684 | drawTAtPointUp(xy.x, xy.y, curveT); |
| 2685 | } |
| 2686 | |
| 2687 | function drawTAtPointUp(px, py, t) { |
| 2688 | var label = t.toFixed(decimal_places); |
| 2689 | var _px = (px - srcLeft)* scale; |
| 2690 | var _py = (py - srcTop) * scale; |
| 2691 | ctx.fillText(label, _px + 5, _py - 10); |
| 2692 | } |
| 2693 | |
| 2694 | function drawTAtPointDown(px, py, t) { |
| 2695 | var label = t.toFixed(decimal_places); |
| 2696 | var _px = (px - srcLeft)* scale; |
| 2697 | var _py = (py - srcTop) * scale; |
| 2698 | ctx.fillText(label, _px + 5, _py + 10); |
| 2699 | } |
| 2700 | |
| 2701 | function alreadyDrawnLine(x1, y1, x2, y2) { |
| 2702 | if (collect_bounds) { |
| 2703 | if (focus_enabled) { |
| 2704 | focusXmin = Math.min(focusXmin, x1, x2); |
| 2705 | focusYmin = Math.min(focusYmin, y1, y2); |
| 2706 | focusXmax = Math.max(focusXmax, x1, x2); |
| 2707 | focusYmax = Math.max(focusYmax, y1, y2); |
| 2708 | } |
| 2709 | return true; |
| 2710 | } |
| 2711 | for (var pts = 0; pts < drawnLines.length; pts += 4) { |
| 2712 | if (x1 == drawnLines[pts] && y1 == drawnLines[pts + 1] |
| 2713 | && x2 == drawnLines[pts + 2] && y2 == drawnLines[pts + 3]) { |
| 2714 | return true; |
| 2715 | } |
| 2716 | } |
| 2717 | drawnLines.push(x1); |
| 2718 | drawnLines.push(y1); |
| 2719 | drawnLines.push(x2); |
| 2720 | drawnLines.push(y2); |
| 2721 | return false; |
| 2722 | } |
| 2723 | |
| 2724 | function drawLine(x1, y1, x2, y2) { |
| 2725 | if (alreadyDrawnLine(x1, y1, x2, y2)) { |
| 2726 | return; |
| 2727 | } |
| 2728 | ctx.beginPath(); |
| 2729 | ctx.moveTo((x1 - srcLeft) * scale, |
| 2730 | (y1 - srcTop) * scale); |
| 2731 | ctx.lineTo((x2 - srcLeft) * scale, |
| 2732 | (y2 - srcTop) * scale); |
| 2733 | ctx.stroke(); |
| 2734 | } |
| 2735 | |
| 2736 | function linePartial(x1, y1, x2, y2, t1, t2) { |
| 2737 | var dx = x1 - x2; |
| 2738 | var dy = y1 - y2; |
| 2739 | var array = [ |
| 2740 | x1 - t1 * dx, |
| 2741 | y1 - t1 * dy, |
| 2742 | x1 - t2 * dx, |
| 2743 | y1 - t2 * dy |
| 2744 | ]; |
| 2745 | return array; |
| 2746 | } |
| 2747 | |
| 2748 | function drawLinePartial(x1, y1, x2, y2, t1, t2) { |
| 2749 | var a = linePartial(x1, y1, x2, y2, t1, t2); |
| 2750 | var ax = a[0]; |
| 2751 | var ay = a[1]; |
| 2752 | var bx = a[2]; |
| 2753 | var by = a[3]; |
| 2754 | if (alreadyDrawnLine(ax, ay, bx, by)) { |
| 2755 | return; |
| 2756 | } |
| 2757 | ctx.beginPath(); |
| 2758 | ctx.moveTo((ax - srcLeft) * scale, |
| 2759 | (ay - srcTop) * scale); |
| 2760 | ctx.lineTo((bx - srcLeft) * scale, |
| 2761 | (by - srcTop) * scale); |
| 2762 | ctx.stroke(); |
| 2763 | } |
| 2764 | |
| 2765 | function alreadyDrawnQuad(x1, y1, x2, y2, x3, y3) { |
| 2766 | if (collect_bounds) { |
| 2767 | if (focus_enabled) { |
| 2768 | focusXmin = Math.min(focusXmin, x1, x2, x3); |
| 2769 | focusYmin = Math.min(focusYmin, y1, y2, y3); |
| 2770 | focusXmax = Math.max(focusXmax, x1, x2, x3); |
| 2771 | focusYmax = Math.max(focusYmax, y1, y2, y3); |
| 2772 | } |
| 2773 | return true; |
| 2774 | } |
| 2775 | for (var pts = 0; pts < drawnQuads.length; pts += 6) { |
| 2776 | if (x1 == drawnQuads[pts] && y1 == drawnQuads[pts + 1] |
| 2777 | && x2 == drawnQuads[pts + 2] && y2 == drawnQuads[pts + 3] |
| 2778 | && x3 == drawnQuads[pts + 4] && y3 == drawnQuads[pts + 5]) { |
| 2779 | return true; |
| 2780 | } |
| 2781 | } |
| 2782 | drawnQuads.push(x1); |
| 2783 | drawnQuads.push(y1); |
| 2784 | drawnQuads.push(x2); |
| 2785 | drawnQuads.push(y2); |
| 2786 | drawnQuads.push(x3); |
| 2787 | drawnQuads.push(y3); |
| 2788 | return false; |
| 2789 | } |
| 2790 | |
| 2791 | function drawQuad(x1, y1, x2, y2, x3, y3) { |
| 2792 | if (alreadyDrawnQuad(x1, y1, x2, y2, x3, y3)) { |
| 2793 | return; |
| 2794 | } |
| 2795 | ctx.beginPath(); |
| 2796 | ctx.moveTo((x1 - srcLeft) * scale, |
| 2797 | (y1 - srcTop) * scale); |
| 2798 | ctx.quadraticCurveTo((x2 - srcLeft) * scale, |
| 2799 | (y2 - srcTop) * scale, |
| 2800 | (x3 - srcLeft) * scale, |
| 2801 | (y3 - srcTop) * scale); |
| 2802 | ctx.stroke(); |
| 2803 | } |
| 2804 | |
| 2805 | function interp(A, B, t) { |
| 2806 | return A + (B - A) * t; |
| 2807 | } |
| 2808 | |
| 2809 | function interp_quad_coords(x1, x2, x3, t) |
| 2810 | { |
| 2811 | var ab = interp(x1, x2, t); |
| 2812 | var bc = interp(x2, x3, t); |
| 2813 | var abc = interp(ab, bc, t); |
| 2814 | return abc; |
| 2815 | } |
| 2816 | |
| 2817 | function quadPartial(x1, y1, x2, y2, x3, y3, t1, t2) { |
| 2818 | var ax = interp_quad_coords(x1, x2, x3, t1); |
| 2819 | var ay = interp_quad_coords(y1, y2, y3, t1); |
| 2820 | var dx = interp_quad_coords(x1, x2, x3, (t1 + t2) / 2); |
| 2821 | var dy = interp_quad_coords(y1, y2, y3, (t1 + t2) / 2); |
| 2822 | var cx = interp_quad_coords(x1, x2, x3, t2); |
| 2823 | var cy = interp_quad_coords(y1, y2, y3, t2); |
| 2824 | var bx = 2*dx - (ax + cx)/2; |
| 2825 | var by = 2*dy - (ay + cy)/2; |
| 2826 | var array = [ |
| 2827 | ax, ay, bx, by, cx, cy |
| 2828 | ]; |
| 2829 | return array; |
| 2830 | } |
| 2831 | |
| 2832 | function drawQuadPartial(x1, y1, x2, y2, x3, y3, t1, t2) { |
| 2833 | var a = quadPartial(x1, y1, x2, y2, x3, y3, t1, t2); |
| 2834 | var ax = a[0]; |
| 2835 | var ay = a[1]; |
| 2836 | var bx = a[2]; |
| 2837 | var by = a[3]; |
| 2838 | var cx = a[4]; |
| 2839 | var cy = a[5]; |
| 2840 | if (alreadyDrawnQuad(ax, ay, bx, by, cx, cy)) { |
| 2841 | return; |
| 2842 | } |
| 2843 | ctx.beginPath(); |
| 2844 | ctx.moveTo((ax - srcLeft) * scale, |
| 2845 | (ay - srcTop) * scale); |
| 2846 | ctx.quadraticCurveTo((bx - srcLeft) * scale, |
| 2847 | (by - srcTop) * scale, |
| 2848 | (cx - srcLeft) * scale, |
| 2849 | (cy - srcTop) * scale); |
| 2850 | ctx.stroke(); |
| 2851 | } |
| 2852 | |
caryclark | 1049f12 | 2015-04-20 08:31:59 -0700 | [diff] [blame] | 2853 | function alreadyDrawnConic(x1, y1, x2, y2, x3, y3, w) { |
| 2854 | if (collect_bounds) { |
| 2855 | if (focus_enabled) { |
| 2856 | focusXmin = Math.min(focusXmin, x1, x2, x3); |
| 2857 | focusYmin = Math.min(focusYmin, y1, y2, y3); |
| 2858 | focusXmax = Math.max(focusXmax, x1, x2, x3); |
| 2859 | focusYmax = Math.max(focusYmax, y1, y2, y3); |
| 2860 | } |
| 2861 | return true; |
| 2862 | } |
| 2863 | for (var pts = 0; pts < drawnConics.length; pts += 8) { |
| 2864 | if (x1 == drawnConics[pts] && y1 == drawnCubics[pts + 1] |
caryclark | 55888e4 | 2016-07-18 10:01:36 -0700 | [diff] [blame] | 2865 | && x2 == drawnCubics[pts + 2] && y2 == drawnCubics[pts + 3] |
| 2866 | && x3 == drawnCubics[pts + 4] && y3 == drawnCubics[pts + 5] |
caryclark | 1049f12 | 2015-04-20 08:31:59 -0700 | [diff] [blame] | 2867 | && w == drawnCubics[pts + 6]) { |
| 2868 | return true; |
| 2869 | } |
| 2870 | } |
| 2871 | drawnConics.push(x1); |
| 2872 | drawnConics.push(y1); |
| 2873 | drawnConics.push(x2); |
| 2874 | drawnConics.push(y2); |
| 2875 | drawnConics.push(x3); |
| 2876 | drawnConics.push(y3); |
| 2877 | drawnCubics.push(w); |
| 2878 | return false; |
| 2879 | } |
| 2880 | |
| 2881 | var kMaxConicToQuadPOW2 = 5; |
| 2882 | |
| 2883 | function computeQuadPOW2(curve, tol) { |
| 2884 | var a = curve[6] - 1; |
| 2885 | var k = a / (4 * (2 + a)); |
| 2886 | var x = k * (curve[0] - 2 * curve[2] + curve[4]); |
| 2887 | var y = k * (curve[1] - 2 * curve[3] + curve[5]); |
| 2888 | |
| 2889 | var error = Math.sqrt(x * x + y * y); |
| 2890 | var pow2; |
| 2891 | for (pow2 = 0; pow2 < kMaxConicToQuadPOW2; ++pow2) { |
| 2892 | if (error <= tol) { |
| 2893 | break; |
| 2894 | } |
| 2895 | error *= 0.25; |
| 2896 | } |
| 2897 | return pow2; |
| 2898 | } |
| 2899 | |
| 2900 | function subdivide_w_value(w) { |
| 2901 | return Math.sqrt(0.5 + w * 0.5); |
| 2902 | } |
| 2903 | |
| 2904 | function chop(curve, part1, part2) { |
| 2905 | var w = curve[6]; |
| 2906 | var scale = 1 / (1 + w); |
| 2907 | part1[0] = curve[0]; |
| 2908 | part1[1] = curve[1]; |
| 2909 | part1[2] = (curve[0] + curve[2] * w) * scale; |
| 2910 | part1[3] = (curve[1] + curve[3] * w) * scale; |
| 2911 | part1[4] = part2[0] = (curve[0] + (curve[2] * w) * 2 + curve[4]) * scale * 0.5; |
| 2912 | part1[5] = part2[1] = (curve[1] + (curve[3] * w) * 2 + curve[5]) * scale * 0.5; |
| 2913 | part2[2] = (curve[2] * w + curve[4]) * scale; |
| 2914 | part2[3] = (curve[3] * w + curve[5]) * scale; |
| 2915 | part2[4] = curve[4]; |
| 2916 | part2[5] = curve[5]; |
| 2917 | part1[6] = part2[6] = subdivide_w_value(w); |
| 2918 | } |
| 2919 | |
| 2920 | function subdivide(curve, level, pts) { |
| 2921 | if (0 == level) { |
| 2922 | pts.push(curve[2]); |
| 2923 | pts.push(curve[3]); |
| 2924 | pts.push(curve[4]); |
| 2925 | pts.push(curve[5]); |
| 2926 | } else { |
| 2927 | var part1 = [], part2 = []; |
| 2928 | chop(curve, part1, part2); |
| 2929 | --level; |
| 2930 | subdivide(part1, level, pts); |
| 2931 | subdivide(part2, level, pts); |
| 2932 | } |
| 2933 | } |
| 2934 | |
| 2935 | function chopIntoQuadsPOW2(curve, pow2, pts) { |
| 2936 | subdivide(curve, pow2, pts); |
| 2937 | return 1 << pow2; |
| 2938 | } |
| 2939 | |
| 2940 | function drawConicWithQuads(x1, y1, x2, y2, x3, y3, w) { |
| 2941 | if (alreadyDrawnConic(x1, y1, x2, y2, x3, y3, w)) { |
| 2942 | return; |
| 2943 | } |
| 2944 | ctx.beginPath(); |
| 2945 | ctx.moveTo((x1 - srcLeft) * scale, |
| 2946 | (y1 - srcTop) * scale); |
| 2947 | var tol = 1 / scale; |
| 2948 | var curve = [x1, y1, x2, y2, x3, y3, w]; |
| 2949 | var pow2 = computeQuadPOW2(curve, tol); |
| 2950 | var pts = []; |
| 2951 | chopIntoQuadsPOW2(curve, pow2, pts); |
| 2952 | for (var i = 0; i < pts.length; i += 4) { |
| 2953 | ctx.quadraticCurveTo( |
| 2954 | (pts[i + 0] - srcLeft) * scale, (pts[i + 1] - srcTop) * scale, |
| 2955 | (pts[i + 2] - srcLeft) * scale, (pts[i + 3] - srcTop) * scale); |
| 2956 | } |
| 2957 | ctx.stroke(); |
| 2958 | } |
| 2959 | |
| 2960 | function conic_eval_numerator(x1, x2, x3, w, t) { |
| 2961 | var src2w = x2 * w; |
| 2962 | var C = x1; |
| 2963 | var A = x3 - 2 * src2w + C; |
| 2964 | var B = 2 * (src2w - C); |
| 2965 | return (A * t + B) * t + C; |
| 2966 | } |
| 2967 | |
| 2968 | |
| 2969 | function conic_eval_denominator(w, t) { |
| 2970 | var B = 2 * (w - 1); |
| 2971 | var C = 1; |
| 2972 | var A = -B; |
| 2973 | return (A * t + B) * t + C; |
| 2974 | } |
| 2975 | |
| 2976 | function conicPartial(x1, y1, x2, y2, x3, y3, w, t1, t2) { |
| 2977 | var ax = conic_eval_numerator(x1, x2, x3, w, t1); |
| 2978 | var ay = conic_eval_numerator(y1, y2, y3, w, t1); |
| 2979 | var az = conic_eval_denominator(w, t1); |
| 2980 | var midT = (t1 + t2) / 2; |
| 2981 | var dx = conic_eval_numerator(x1, x2, x3, w, midT); |
| 2982 | var dy = conic_eval_numerator(y1, y2, y3, w, midT); |
| 2983 | var dz = conic_eval_denominator(w, midT); |
| 2984 | var cx = conic_eval_numerator(x1, x2, x3, w, t2); |
| 2985 | var cy = conic_eval_numerator(y1, y2, y3, w, t2); |
| 2986 | var cz = conic_eval_denominator(w, t2); |
| 2987 | var bx = 2 * dx - (ax + cx) / 2; |
| 2988 | var by = 2 * dy - (ay + cy) / 2; |
| 2989 | var bz = 2 * dz - (az + cz) / 2; |
| 2990 | var dt = t2 - t1; |
| 2991 | var dt_1 = 1 - dt; |
caryclark | 1049f12 | 2015-04-20 08:31:59 -0700 | [diff] [blame] | 2992 | var array = [ |
caryclark | ed0935a | 2015-10-22 07:23:52 -0700 | [diff] [blame] | 2993 | ax / az, ay / az, bx / bz, by / bz, cx / cz, cy / cz, 0 |
caryclark | 1049f12 | 2015-04-20 08:31:59 -0700 | [diff] [blame] | 2994 | ]; |
caryclark | ed0935a | 2015-10-22 07:23:52 -0700 | [diff] [blame] | 2995 | var dMidAC = { x:(array[0] + array[4]) / 2, y:(array[1] + array[5]) / 2 }; |
| 2996 | var dMid = { x:dx / dz, y:dy / dz }; |
| 2997 | var dWNumer = { x:dMidAC.x - dMid.x, y:dMidAC.y - dMid.y }; |
| 2998 | var dWDenom = { x:dMid.x - array[2], y:dMid.y - array[3] }; |
| 2999 | var partW = Math.sqrt(dWNumer.x * dWNumer.x + dWNumer.y * dWNumer.y) |
| 3000 | / Math.sqrt(dWDenom.x * dWDenom.x + dWDenom.y * dWDenom.y); |
| 3001 | array[6] = partW; |
caryclark | 1049f12 | 2015-04-20 08:31:59 -0700 | [diff] [blame] | 3002 | return array; |
| 3003 | } |
caryclark | 55888e4 | 2016-07-18 10:01:36 -0700 | [diff] [blame] | 3004 | |
caryclark | 1049f12 | 2015-04-20 08:31:59 -0700 | [diff] [blame] | 3005 | function drawConicPartial(x1, y1, x2, y2, x3, y3, w, t1, t2) { |
| 3006 | var a = conicPartial(x1, y1, x2, y2, x3, y3, w, t1, t2); |
| 3007 | var ax = a[0]; |
| 3008 | var ay = a[1]; |
| 3009 | var bx = a[2]; |
| 3010 | var by = a[3]; |
| 3011 | var cx = a[4]; |
| 3012 | var cy = a[5]; |
| 3013 | var w_ = a[6]; |
| 3014 | drawConicWithQuads(ax, ay, bx, by, cx, cy, w_); |
| 3015 | } |
| 3016 | |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 3017 | function alreadyDrawnCubic(x1, y1, x2, y2, x3, y3, x4, y4) { |
| 3018 | if (collect_bounds) { |
| 3019 | if (focus_enabled) { |
| 3020 | focusXmin = Math.min(focusXmin, x1, x2, x3, x4); |
| 3021 | focusYmin = Math.min(focusYmin, y1, y2, y3, y4); |
| 3022 | focusXmax = Math.max(focusXmax, x1, x2, x3, x4); |
| 3023 | focusYmax = Math.max(focusYmax, y1, y2, y3, y4); |
| 3024 | } |
| 3025 | return true; |
| 3026 | } |
| 3027 | for (var pts = 0; pts < drawnCubics.length; pts += 8) { |
| 3028 | if (x1 == drawnCubics[pts] && y1 == drawnCubics[pts + 1] |
caryclark | 55888e4 | 2016-07-18 10:01:36 -0700 | [diff] [blame] | 3029 | && x2 == drawnCubics[pts + 2] && y2 == drawnCubics[pts + 3] |
| 3030 | && x3 == drawnCubics[pts + 4] && y3 == drawnCubics[pts + 5] |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 3031 | && x4 == drawnCubics[pts + 6] && y4 == drawnCubics[pts + 7]) { |
| 3032 | return true; |
| 3033 | } |
| 3034 | } |
| 3035 | drawnCubics.push(x1); |
| 3036 | drawnCubics.push(y1); |
| 3037 | drawnCubics.push(x2); |
| 3038 | drawnCubics.push(y2); |
| 3039 | drawnCubics.push(x3); |
| 3040 | drawnCubics.push(y3); |
| 3041 | drawnCubics.push(x4); |
| 3042 | drawnCubics.push(y4); |
| 3043 | return false; |
| 3044 | } |
| 3045 | |
| 3046 | function drawCubic(x1, y1, x2, y2, x3, y3, x4, y4) { |
| 3047 | if (alreadyDrawnCubic(x1, y1, x2, y2, x3, y3, x4, y4)) { |
| 3048 | return; |
| 3049 | } |
| 3050 | ctx.beginPath(); |
| 3051 | ctx.moveTo((x1 - srcLeft) * scale, |
| 3052 | (y1 - srcTop) * scale); |
| 3053 | ctx.bezierCurveTo((x2 - srcLeft) * scale, |
| 3054 | (y2 - srcTop) * scale, |
| 3055 | (x3 - srcLeft) * scale, |
| 3056 | (y3 - srcTop) * scale, |
| 3057 | (x4 - srcLeft) * scale, |
| 3058 | (y4 - srcTop) * scale); |
| 3059 | ctx.stroke(); |
| 3060 | } |
| 3061 | |
| 3062 | function interp_cubic_coords(x1, x2, x3, x4, t) |
| 3063 | { |
| 3064 | var ab = interp(x1, x2, t); |
| 3065 | var bc = interp(x2, x3, t); |
| 3066 | var cd = interp(x3, x4, t); |
| 3067 | var abc = interp(ab, bc, t); |
| 3068 | var bcd = interp(bc, cd, t); |
| 3069 | var abcd = interp(abc, bcd, t); |
| 3070 | return abcd; |
| 3071 | } |
| 3072 | |
| 3073 | function cubicPartial(x1, y1, x2, y2, x3, y3, x4, y4, t1, t2) { |
| 3074 | var ax = interp_cubic_coords(x1, x2, x3, x4, t1); |
| 3075 | var ay = interp_cubic_coords(y1, y2, y3, y4, t1); |
| 3076 | var ex = interp_cubic_coords(x1, x2, x3, x4, (t1*2+t2)/3); |
| 3077 | var ey = interp_cubic_coords(y1, y2, y3, y4, (t1*2+t2)/3); |
| 3078 | var fx = interp_cubic_coords(x1, x2, x3, x4, (t1+t2*2)/3); |
| 3079 | var fy = interp_cubic_coords(y1, y2, y3, y4, (t1+t2*2)/3); |
| 3080 | var dx = interp_cubic_coords(x1, x2, x3, x4, t2); |
| 3081 | var dy = interp_cubic_coords(y1, y2, y3, y4, t2); |
| 3082 | var mx = ex * 27 - ax * 8 - dx; |
| 3083 | var my = ey * 27 - ay * 8 - dy; |
| 3084 | var nx = fx * 27 - ax - dx * 8; |
| 3085 | var ny = fy * 27 - ay - dy * 8; |
| 3086 | var bx = (mx * 2 - nx) / 18; |
| 3087 | var by = (my * 2 - ny) / 18; |
| 3088 | var cx = (nx * 2 - mx) / 18; |
| 3089 | var cy = (ny * 2 - my) / 18; |
| 3090 | var array = [ |
| 3091 | ax, ay, bx, by, cx, cy, dx, dy |
| 3092 | ]; |
| 3093 | return array; |
| 3094 | } |
caryclark | 55888e4 | 2016-07-18 10:01:36 -0700 | [diff] [blame] | 3095 | |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 3096 | function drawCubicPartial(x1, y1, x2, y2, x3, y3, x4, y4, t1, t2) { |
| 3097 | var a = cubicPartial(x1, y1, x2, y2, x3, y3, x4, y4, t1, t2); |
| 3098 | var ax = a[0]; |
| 3099 | var ay = a[1]; |
| 3100 | var bx = a[2]; |
| 3101 | var by = a[3]; |
| 3102 | var cx = a[4]; |
| 3103 | var cy = a[5]; |
| 3104 | var dx = a[6]; |
| 3105 | var dy = a[7]; |
| 3106 | if (alreadyDrawnCubic(ax, ay, bx, by, cx, cy, dx, dy)) { |
| 3107 | return; |
| 3108 | } |
| 3109 | ctx.beginPath(); |
| 3110 | ctx.moveTo((ax - srcLeft) * scale, |
| 3111 | (ay - srcTop) * scale); |
| 3112 | ctx.bezierCurveTo((bx - srcLeft) * scale, |
| 3113 | (by - srcTop) * scale, |
| 3114 | (cx - srcLeft) * scale, |
| 3115 | (cy - srcTop) * scale, |
| 3116 | (dx - srcLeft) * scale, |
| 3117 | (dy - srcTop) * scale); |
| 3118 | ctx.stroke(); |
| 3119 | } |
| 3120 | |
| 3121 | function drawCurve(c) { |
| 3122 | switch (c.length) { |
| 3123 | case 4: |
| 3124 | drawLine(c[0], c[1], c[2], c[3]); |
| 3125 | break; |
| 3126 | case 6: |
| 3127 | drawQuad(c[0], c[1], c[2], c[3], c[4], c[5]); |
| 3128 | break; |
caryclark | 1049f12 | 2015-04-20 08:31:59 -0700 | [diff] [blame] | 3129 | case 7: |
| 3130 | drawConicWithQuads(c[0], c[1], c[2], c[3], c[4], c[5], c[6]); |
| 3131 | break; |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 3132 | case 8: |
| 3133 | drawCubic(c[0], c[1], c[2], c[3], c[4], c[5], c[6], c[7]); |
| 3134 | break; |
| 3135 | } |
| 3136 | } |
| 3137 | |
| 3138 | function boundsWidth(pts) { |
| 3139 | var min = pts[0]; |
| 3140 | var max = pts[0]; |
caryclark | 1049f12 | 2015-04-20 08:31:59 -0700 | [diff] [blame] | 3141 | var length = pts.length == 7 ? 6 : pts.length; |
| 3142 | for (var idx = 2; idx < length; idx += 2) { |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 3143 | min = Math.min(min, pts[idx]); |
| 3144 | max = Math.max(max, pts[idx]); |
| 3145 | } |
| 3146 | return max - min; |
| 3147 | } |
| 3148 | |
| 3149 | function boundsHeight(pts) { |
| 3150 | var min = pts[1]; |
| 3151 | var max = pts[1]; |
caryclark | 1049f12 | 2015-04-20 08:31:59 -0700 | [diff] [blame] | 3152 | var length = pts.length == 7 ? 6 : pts.length; |
| 3153 | for (var idx = 3; idx < length; idx += 2) { |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 3154 | min = Math.min(min, pts[idx]); |
| 3155 | max = Math.max(max, pts[idx]); |
| 3156 | } |
| 3157 | return max - min; |
| 3158 | } |
| 3159 | |
| 3160 | function tangent(pts) { |
| 3161 | var dx = pts[2] - pts[0]; |
| 3162 | var dy = pts[3] - pts[1]; |
| 3163 | if (dx == 0 && dy == 0 && pts.length > 4) { |
| 3164 | dx = pts[4] - pts[0]; |
| 3165 | dy = pts[5] - pts[1]; |
caryclark | 1049f12 | 2015-04-20 08:31:59 -0700 | [diff] [blame] | 3166 | if (dx == 0 && dy == 0 && pts.length == 8) { |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 3167 | dx = pts[6] - pts[0]; |
| 3168 | dy = pts[7] - pts[1]; |
| 3169 | } |
| 3170 | } |
| 3171 | return Math.atan2(-dy, dx); |
| 3172 | } |
| 3173 | |
| 3174 | function hodograph(cubic) { |
| 3175 | var hodo = []; |
| 3176 | hodo[0] = 3 * (cubic[2] - cubic[0]); |
| 3177 | hodo[1] = 3 * (cubic[3] - cubic[1]); |
| 3178 | hodo[2] = 3 * (cubic[4] - cubic[2]); |
| 3179 | hodo[3] = 3 * (cubic[5] - cubic[3]); |
| 3180 | hodo[4] = 3 * (cubic[6] - cubic[4]); |
| 3181 | hodo[5] = 3 * (cubic[7] - cubic[5]); |
| 3182 | return hodo; |
| 3183 | } |
| 3184 | |
| 3185 | function hodograph2(cubic) { |
| 3186 | var quad = hodograph(cubic); |
| 3187 | var hodo = []; |
| 3188 | hodo[0] = 2 * (quad[2] - quad[0]); |
| 3189 | hodo[1] = 2 * (quad[3] - quad[1]); |
| 3190 | hodo[2] = 2 * (quad[4] - quad[2]); |
| 3191 | hodo[3] = 2 * (quad[5] - quad[3]); |
| 3192 | return hodo; |
| 3193 | } |
| 3194 | |
| 3195 | function quadraticRootsReal(A, B, C, s) { |
| 3196 | if (A == 0) { |
| 3197 | if (B == 0) { |
| 3198 | s[0] = 0; |
| 3199 | return C == 0; |
| 3200 | } |
| 3201 | s[0] = -C / B; |
| 3202 | return 1; |
| 3203 | } |
| 3204 | /* normal form: x^2 + px + q = 0 */ |
| 3205 | var p = B / (2 * A); |
| 3206 | var q = C / A; |
| 3207 | var p2 = p * p; |
| 3208 | if (p2 < q) { |
| 3209 | return 0; |
| 3210 | } |
| 3211 | var sqrt_D = 0; |
| 3212 | if (p2 > q) { |
| 3213 | sqrt_D = sqrt(p2 - q); |
| 3214 | } |
| 3215 | s[0] = sqrt_D - p; |
| 3216 | s[1] = -sqrt_D - p; |
| 3217 | return 1 + s[0] != s[1]; |
| 3218 | } |
| 3219 | |
| 3220 | function add_valid_ts(s, realRoots, t) { |
| 3221 | var foundRoots = 0; |
| 3222 | for (var index = 0; index < realRoots; ++index) { |
| 3223 | var tValue = s[index]; |
| 3224 | if (tValue >= 0 && tValue <= 1) { |
| 3225 | for (var idx2 = 0; idx2 < foundRoots; ++idx2) { |
| 3226 | if (t[idx2] != tValue) { |
| 3227 | t[foundRoots++] = tValue; |
| 3228 | } |
| 3229 | } |
| 3230 | } |
| 3231 | } |
| 3232 | return foundRoots; |
| 3233 | } |
| 3234 | |
| 3235 | function quadraticRootsValidT(a, b, c, t) { |
| 3236 | var s = []; |
| 3237 | var realRoots = quadraticRootsReal(A, B, C, s); |
| 3238 | var foundRoots = add_valid_ts(s, realRoots, t); |
| 3239 | return foundRoots != 0; |
| 3240 | } |
| 3241 | |
| 3242 | function find_cubic_inflections(cubic, tValues) { |
| 3243 | var Ax = src[2] - src[0]; |
| 3244 | var Ay = src[3] - src[1]; |
| 3245 | var Bx = src[4] - 2 * src[2] + src[0]; |
| 3246 | var By = src[5] - 2 * src[3] + src[1]; |
| 3247 | var Cx = src[6] + 3 * (src[2] - src[4]) - src[0]; |
| 3248 | var Cy = src[7] + 3 * (src[3] - src[5]) - src[1]; |
| 3249 | return quadraticRootsValidT(Bx * Cy - By * Cx, (Ax * Cy - Ay * Cx), |
| 3250 | Ax * By - Ay * Bx, tValues); |
| 3251 | } |
| 3252 | |
| 3253 | function dxy_at_t(curve, type, t) { |
| 3254 | var dxy = {}; |
Cary Clark | ff11428 | 2016-12-14 11:56:16 -0500 | [diff] [blame^] | 3255 | if (type == PATH_LINE) { |
| 3256 | dxy.x = curve[2] - curve[0]; |
| 3257 | dxy.y = curve[3] - curve[1]; |
| 3258 | } else if (type == PATH_QUAD) { |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 3259 | var a = t - 1; |
| 3260 | var b = 1 - 2 * t; |
| 3261 | var c = t; |
| 3262 | dxy.x = a * curve[0] + b * curve[2] + c * curve[4]; |
| 3263 | dxy.y = a * curve[1] + b * curve[3] + c * curve[5]; |
caryclark | 1049f12 | 2015-04-20 08:31:59 -0700 | [diff] [blame] | 3264 | } else if (type == PATH_CONIC) { |
| 3265 | var p20x = curve[4] - curve[0]; |
| 3266 | var p20y = curve[5] - curve[1]; |
| 3267 | var p10xw = (curve[2] - curve[0]) * curve[6]; |
| 3268 | var p10yw = (curve[3] - curve[1]) * curve[6]; |
| 3269 | var coeff0x = curve[6] * p20x - p20x; |
| 3270 | var coeff0y = curve[6] * p20y - p20y; |
| 3271 | var coeff1x = p20x - 2 * p10xw; |
| 3272 | var coeff1y = p20y - 2 * p10yw; |
| 3273 | dxy.x = t * (t * coeff0x + coeff1x) + p10xw; |
| 3274 | dxy.y = t * (t * coeff0y + coeff1y) + p10yw; |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 3275 | } else if (type == PATH_CUBIC) { |
| 3276 | var one_t = 1 - t; |
| 3277 | var a = curve[0]; |
| 3278 | var b = curve[2]; |
| 3279 | var c = curve[4]; |
| 3280 | var d = curve[6]; |
| 3281 | dxy.x = 3 * ((b - a) * one_t * one_t + 2 * (c - b) * t * one_t + (d - c) * t * t); |
| 3282 | a = curve[1]; |
| 3283 | b = curve[3]; |
| 3284 | c = curve[5]; |
| 3285 | d = curve[7]; |
| 3286 | dxy.y = 3 * ((b - a) * one_t * one_t + 2 * (c - b) * t * one_t + (d - c) * t * t); |
| 3287 | } |
| 3288 | return dxy; |
| 3289 | } |
| 3290 | |
Cary Clark | ff11428 | 2016-12-14 11:56:16 -0500 | [diff] [blame^] | 3291 | function dpt_at_t(curve, t) {
|
| 3292 | var type = PATH_LINE + (curve.length / 2 - 2); |
| 3293 | return dxy_at_t(curve, type, t);
|
| 3294 | } |
| 3295 | |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 3296 | function drawLabel(num, px, py) { |
| 3297 | ctx.beginPath(); |
| 3298 | ctx.arc(px, py, 8, 0, Math.PI*2, true); |
| 3299 | ctx.closePath(); |
| 3300 | ctx.strokeStyle = "rgba(0,0,0, 0.4)"; |
| 3301 | ctx.lineWidth = num == 0 || num == 3 ? 2 : 1; |
| 3302 | ctx.stroke(); |
| 3303 | ctx.fillStyle = "black"; |
| 3304 | ctx.font = "normal 10px Arial"; |
| 3305 | // ctx.rotate(0.001); |
| 3306 | ctx.fillText(num, px - 2, py + 3); |
| 3307 | // ctx.rotate(-0.001); |
| 3308 | } |
| 3309 | |
| 3310 | function drawLabelX(ymin, num, loc) { |
| 3311 | var px = (loc - srcLeft) * scale; |
| 3312 | var py = (ymin - srcTop) * scale - 20; |
| 3313 | drawLabel(num, px, py); |
| 3314 | } |
| 3315 | |
| 3316 | function drawLabelY(xmin, num, loc) { |
| 3317 | var px = (xmin - srcLeft) * scale - 20; |
| 3318 | var py = (loc - srcTop) * scale; |
| 3319 | drawLabel(num, px, py); |
| 3320 | } |
| 3321 | |
| 3322 | function drawHodoOrigin(hx, hy, hMinX, hMinY, hMaxX, hMaxY) { |
| 3323 | ctx.beginPath(); |
| 3324 | ctx.moveTo(hx, hy - 100); |
| 3325 | ctx.lineTo(hx, hy); |
| 3326 | ctx.strokeStyle = hMinY < 0 ? "green" : "blue"; |
| 3327 | ctx.stroke(); |
| 3328 | ctx.beginPath(); |
| 3329 | ctx.moveTo(hx, hy); |
| 3330 | ctx.lineTo(hx, hy + 100); |
| 3331 | ctx.strokeStyle = hMaxY > 0 ? "green" : "blue"; |
| 3332 | ctx.stroke(); |
| 3333 | ctx.beginPath(); |
| 3334 | ctx.moveTo(hx - 100, hy); |
| 3335 | ctx.lineTo(hx, hy); |
| 3336 | ctx.strokeStyle = hMinX < 0 ? "green" : "blue"; |
| 3337 | ctx.stroke(); |
| 3338 | ctx.beginPath(); |
| 3339 | ctx.moveTo(hx, hy); |
| 3340 | ctx.lineTo(hx + 100, hy); |
| 3341 | ctx.strokeStyle = hMaxX > 0 ? "green" : "blue"; |
| 3342 | ctx.stroke(); |
| 3343 | } |
| 3344 | |
| 3345 | function scalexy(x, y, mag) { |
| 3346 | var length = Math.sqrt(x * x + y * y); |
| 3347 | return mag / length; |
| 3348 | } |
| 3349 | |
caryclark | 03b03ca | 2015-04-23 09:13:37 -0700 | [diff] [blame] | 3350 | function drawArrow(x, y, dx, dy, s) { |
| 3351 | var dscale = scalexy(dx, dy, 1 / scale * 100 * s); |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 3352 | dx *= dscale; |
| 3353 | dy *= dscale; |
| 3354 | ctx.beginPath(); |
| 3355 | ctx.moveTo((x - srcLeft) * scale, (y - srcTop) * scale); |
| 3356 | x += dx; |
| 3357 | y += dy; |
| 3358 | ctx.lineTo((x - srcLeft) * scale, (y - srcTop) * scale); |
| 3359 | dx /= 10; |
| 3360 | dy /= 10; |
| 3361 | ctx.lineTo((x - dy - srcLeft) * scale, (y + dx - srcTop) * scale); |
| 3362 | ctx.lineTo((x + dx * 2 - srcLeft) * scale, (y + dy * 2 - srcTop) * scale); |
| 3363 | ctx.lineTo((x + dy - srcLeft) * scale, (y - dx - srcTop) * scale); |
| 3364 | ctx.lineTo((x - srcLeft) * scale, (y - srcTop) * scale); |
| 3365 | ctx.strokeStyle = "rgba(0,75,0, 0.4)"; |
| 3366 | ctx.stroke(); |
| 3367 | } |
| 3368 | |
| 3369 | function x_at_t(curve, t) { |
| 3370 | var one_t = 1 - t; |
| 3371 | if (curve.length == 4) { |
| 3372 | return one_t * curve[0] + t * curve[2]; |
| 3373 | } |
| 3374 | var one_t2 = one_t * one_t; |
| 3375 | var t2 = t * t; |
| 3376 | if (curve.length == 6) { |
| 3377 | return one_t2 * curve[0] + 2 * one_t * t * curve[2] + t2 * curve[4]; |
| 3378 | } |
caryclark | 1049f12 | 2015-04-20 08:31:59 -0700 | [diff] [blame] | 3379 | if (curve.length == 7) { |
| 3380 | return (one_t2 * curve[0] + 2 * one_t * t * curve[2] * curve[6] + t2 * curve[4]) |
| 3381 | / (one_t2 +2 * one_t * t * curve[6] + t2); |
| 3382 | } |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 3383 | var a = one_t2 * one_t; |
| 3384 | var b = 3 * one_t2 * t; |
| 3385 | var c = 3 * one_t * t2; |
| 3386 | var d = t2 * t; |
| 3387 | return a * curve[0] + b * curve[2] + c * curve[4] + d * curve[6]; |
| 3388 | } |
| 3389 | |
| 3390 | function y_at_t(curve, t) { |
| 3391 | var one_t = 1 - t; |
| 3392 | if (curve.length == 4) { |
| 3393 | return one_t * curve[1] + t * curve[3]; |
| 3394 | } |
| 3395 | var one_t2 = one_t * one_t; |
| 3396 | var t2 = t * t; |
| 3397 | if (curve.length == 6) { |
| 3398 | return one_t2 * curve[1] + 2 * one_t * t * curve[3] + t2 * curve[5]; |
| 3399 | } |
caryclark | 1049f12 | 2015-04-20 08:31:59 -0700 | [diff] [blame] | 3400 | if (curve.length == 7) { |
| 3401 | return (one_t2 * curve[1] + 2 * one_t * t * curve[3] * curve[6] + t2 * curve[5]) |
| 3402 | / (one_t2 +2 * one_t * t * curve[6] + t2); |
| 3403 | } |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 3404 | var a = one_t2 * one_t; |
| 3405 | var b = 3 * one_t2 * t; |
| 3406 | var c = 3 * one_t * t2; |
| 3407 | var d = t2 * t; |
| 3408 | return a * curve[1] + b * curve[3] + c * curve[5] + d * curve[7]; |
| 3409 | } |
| 3410 | |
Cary Clark | ff11428 | 2016-12-14 11:56:16 -0500 | [diff] [blame^] | 3411 | function pt_at_t(curve, t) {
|
| 3412 | var pt = {};
|
| 3413 | pt.x = x_at_t(curve, t);
|
| 3414 | pt.y = y_at_t(curve, t);
|
| 3415 | return pt;
|
| 3416 | } |
| 3417 | |
| 3418 | function drawOrder(curve, t, label) { |
| 3419 | var px = x_at_t(curve, t); |
| 3420 | var py = y_at_t(curve, t); |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 3421 | var _px = (px - srcLeft) * scale; |
| 3422 | var _py = (py - srcTop) * scale; |
| 3423 | ctx.beginPath(); |
| 3424 | ctx.arc(_px, _py, 15, 0, Math.PI * 2, true); |
| 3425 | ctx.closePath(); |
| 3426 | ctx.fillStyle = "white"; |
| 3427 | ctx.fill(); |
| 3428 | if (label == 'L') { |
| 3429 | ctx.strokeStyle = "rgba(255,0,0, 1)"; |
| 3430 | ctx.fillStyle = "rgba(255,0,0, 1)"; |
| 3431 | } else { |
| 3432 | ctx.strokeStyle = "rgba(0,0,255, 1)"; |
| 3433 | ctx.fillStyle = "rgba(0,0,255, 1)"; |
| 3434 | } |
| 3435 | ctx.stroke(); |
| 3436 | ctx.font = "normal 16px Arial"; |
| 3437 | ctx.textAlign = "center"; |
| 3438 | ctx.fillText(label, _px, _py + 5); |
| 3439 | ctx.font = "normal 10px Arial"; |
| 3440 | } |
| 3441 | |
Cary Clark | ff11428 | 2016-12-14 11:56:16 -0500 | [diff] [blame^] | 3442 | function drawVisibleOrder(curve, label) {
|
| 3443 | var s = pt_at_t(curve, 0);
|
| 3444 | var e = pt_at_t(curve, 1);
|
| 3445 | var sOn = ptOnScreen(s);
|
| 3446 | var eOn = ptOnScreen(e);
|
| 3447 | var defaultT = 0.85;
|
| 3448 | if (sOn && eOn)
|
| 3449 | return drawOrder(curve, defaultT, label);
|
| 3450 | if (sOn || eOn) {
|
| 3451 | if (eOn) {
|
| 3452 | defaultT = 1 - defaultT;
|
| 3453 | }
|
| 3454 | var step = sOn ? -defaultT / 2 : (1 - defaultT) / 2;
|
| 3455 | var t = defaultT;
|
| 3456 | var tries = 16;
|
| 3457 | do {
|
| 3458 | var mid = pt_at_t(curve, t);
|
| 3459 | if (ptOnScreen(mid))
|
| 3460 | return drawOrder(curve, t, label);
|
| 3461 | t += step;
|
| 3462 | step /= 2;
|
| 3463 | } while (--tries > 0);
|
| 3464 | drawOrder(curve, defaultT, label);
|
| 3465 | }
|
| 3466 | // scattershot until we find a visible point
|
| 3467 | var denom = 2; // visit odd number num / denom to hit unique pts
|
| 3468 | var tries = 6; // tries 1/2, 1/4, 3/4, 1/8, 3/8, 5/8, 7/8, 1/16 ...
|
| 3469 | do {
|
| 3470 | for (var numer = 1; numer < denom; numer += 2) {
|
| 3471 | var t = numer / denom + 0.1;
|
| 3472 | if (t >= 1) {
|
| 3473 | break;
|
| 3474 | }
|
| 3475 | var mid = pt_at_t(curve, t);
|
| 3476 | if (ptOnScreen(mid))
|
| 3477 | return drawOrder(curve, t, label);
|
| 3478 | }
|
| 3479 | denom *= 2;
|
| 3480 | } while (--tries > 0);
|
| 3481 | drawOrder(curve, defaultT, label);
|
| 3482 | } |
| 3483 | |
| 3484 | function set_length(pt, newLen) {
|
| 3485 | var len = Math.sqrt(pt.x * pt.x + pt.y * pt.y);
|
| 3486 | var scale = newLen / len;
|
| 3487 | var newPt = { x: pt.x * scale, y: pt.y * scale };
|
| 3488 | return newPt;
|
| 3489 | } |
| 3490 | |
| 3491 | function drawDirection(curve, t) {
|
| 3492 | var d = dpt_at_t(curve, t); |
| 3493 | d = set_length(d, 16); |
| 3494 | var pt = localToGlobal(pt_at_t(curve, t));
|
| 3495 | ctx.beginPath(); |
| 3496 | ctx.moveTo(pt.x - d.y, pt.y + d.x); |
| 3497 | ctx.lineTo(pt.x + d.x, pt.y + d.y); |
| 3498 | ctx.lineTo(pt.x + d.y, pt.y - d.x); |
| 3499 | ctx.strokeStyle = "rgba(0,75,0, 0.4)"; |
| 3500 | ctx.stroke(); |
| 3501 | } |
| 3502 | |
| 3503 | function drawVisibleDirection(curve) {
|
| 3504 | var s = pt_at_t(curve, 0);
|
| 3505 | var e = pt_at_t(curve, 1);
|
| 3506 | var sOn = ptOnScreen(s);
|
| 3507 | var eOn = ptOnScreen(e);
|
| 3508 | var defaultT = 0.65;
|
| 3509 | if (sOn && eOn) {
|
| 3510 | return drawDirection(curve, defaultT);
|
| 3511 | }
|
| 3512 | if (sOn || eOn) {
|
| 3513 | if (eOn) {
|
| 3514 | defaultT = 1 - defaultT;
|
| 3515 | }
|
| 3516 | var step = sOn ? -defaultT / 2 : (1 - defaultT) / 2;
|
| 3517 | var t = defaultT;
|
| 3518 | var tries = 16;
|
| 3519 | do {
|
| 3520 | var mid = pt_at_t(curve, t);
|
| 3521 | if (ptOnScreen(mid))
|
| 3522 | return drawDirection(curve, t);
|
| 3523 | t += step;
|
| 3524 | step /= 2;
|
| 3525 | } while (--tries > 0);
|
| 3526 | drawDirection(curve, defaultT);
|
| 3527 | }
|
| 3528 | // scattershot until we find a visible point
|
| 3529 | var denom = 2; // visit odd number num / denom to hit unique pts
|
| 3530 | var tries = 6; // tries 1/2, 1/4, 3/4, 1/8, 3/8, 5/8, 7/8, 1/16 ...
|
| 3531 | do {
|
| 3532 | for (var numer = 1; numer < denom; numer += 2) {
|
| 3533 | var t = numer / denom + 0.1;
|
| 3534 | if (t >= 1) {
|
| 3535 | break;
|
| 3536 | }
|
| 3537 | var mid = pt_at_t(curve, t);
|
| 3538 | if (ptOnScreen(mid))
|
| 3539 | return drawDirection(curve, t);
|
| 3540 | }
|
| 3541 | denom *= 2;
|
| 3542 | } while (--tries > 0);
|
| 3543 | drawDirection(curve, defaultT);
|
| 3544 | } |
| 3545 | |
| 3546 | function drawID(curve, t, id) { |
| 3547 | var px = x_at_t(curve, t); |
| 3548 | var py = y_at_t(curve, t); |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 3549 | var _px = (px - srcLeft) * scale; |
| 3550 | var _py = (py - srcTop) * scale; |
| 3551 | draw_id_at(id, _px, _py); |
| 3552 | } |
| 3553 | |
Cary Clark | ff11428 | 2016-12-14 11:56:16 -0500 | [diff] [blame^] | 3554 | function localToGlobal(local) {
|
| 3555 | var global = {};
|
| 3556 | global.x = (local.x - srcLeft) * scale;
|
| 3557 | global.y = (local.y - srcTop) * scale;
|
| 3558 | return global;
|
| 3559 | } |
| 3560 | |
| 3561 | function ptOnScreen(local) {
|
| 3562 | var pt = localToGlobal(local);
|
| 3563 | return 10 <= pt.x && pt.x <= screenWidth - 10
|
| 3564 | && 10 <= pt.y && pt.y <= screenHeight - 10;
|
| 3565 | } |
| 3566 | |
| 3567 | function drawVisibleID(curve, defaultT, id) {
|
| 3568 | // determine if either or both ends are visible
|
| 3569 | var s = pt_at_t(curve, 0);
|
| 3570 | var e = pt_at_t(curve, 1);
|
| 3571 | var sOn = ptOnScreen(s);
|
| 3572 | var eOn = ptOnScreen(e);
|
| 3573 | if (sOn && eOn)
|
| 3574 | return drawID(curve, defaultT, id);
|
| 3575 | if (sOn || eOn) {
|
| 3576 | var step = sOn ? -defaultT / 2 : (1 - defaultT) / 2;
|
| 3577 | var t = defaultT;
|
| 3578 | var tries = 16;
|
| 3579 | do {
|
| 3580 | var mid = pt_at_t(curve, t);
|
| 3581 | if (ptOnScreen(mid))
|
| 3582 | return drawID(curve, t, id);
|
| 3583 | t += step;
|
| 3584 | step /= 2;
|
| 3585 | } while (--tries > 0);
|
| 3586 | drawID(curve, defaultT, id);
|
| 3587 | }
|
| 3588 | // scattershot until we find a visible point
|
| 3589 | var denom = 2; // visit odd number num / denom to hit unique pts
|
| 3590 | var tries = 6; // tries 1/2, 1/4, 3/4, 1/8, 3/8, 5/8, 7/8, 1/16 ...
|
| 3591 | do {
|
| 3592 | for (var numer = 1; numer < denom; numer += 2) {
|
| 3593 | var t = numer / denom;
|
| 3594 | var mid = pt_at_t(curve, t);
|
| 3595 | if (ptOnScreen(mid))
|
| 3596 | return drawID(curve, t, id);
|
| 3597 | }
|
| 3598 | denom *= 2;
|
| 3599 | } while (--tries > 0);
|
| 3600 | drawID(curve, defaultT, id);
|
| 3601 | } |
| 3602 | |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 3603 | function draw_id_at(id, _px, _py) { |
| 3604 | ctx.beginPath(); |
| 3605 | ctx.arc(_px, _py, 15, 0, Math.PI * 2, true); |
| 3606 | ctx.closePath(); |
| 3607 | ctx.fillStyle = "white"; |
| 3608 | ctx.fill(); |
| 3609 | ctx.strokeStyle = "rgba(127,127,0, 1)"; |
| 3610 | ctx.fillStyle = "rgba(127,127,0, 1)"; |
| 3611 | ctx.stroke(); |
| 3612 | ctx.font = "normal 16px Arial"; |
| 3613 | ctx.textAlign = "center"; |
| 3614 | ctx.fillText(id, _px, _py + 5); |
| 3615 | ctx.font = "normal 10px Arial"; |
| 3616 | } |
| 3617 | |
| 3618 | function drawLinePartialID(id, x1, y1, x2, y2, t1, t2) { |
| 3619 | var curve = [x1, y1, x2, y2]; |
| 3620 | drawCurvePartialID(id, curve, t1, t2); |
| 3621 | } |
| 3622 | |
caryclark | 55888e4 | 2016-07-18 10:01:36 -0700 | [diff] [blame] | 3623 | function drawLineID(id, x1, y1, x2, y2) { |
| 3624 | drawLinePartialID(id, x1, y1, x2, y2, 0, 1); |
| 3625 | } |
| 3626 | |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 3627 | function drawQuadPartialID(id, x1, y1, x2, y2, x3, y3, t1, t2) { |
| 3628 | var curve = [x1, y1, x2, y2, x3, y3]; |
| 3629 | drawCurvePartialID(id, curve, t1, t2); |
| 3630 | } |
| 3631 | |
caryclark | 55888e4 | 2016-07-18 10:01:36 -0700 | [diff] [blame] | 3632 | function drawQuadID(id, x1, y1, x2, y2, x3, y3) { |
| 3633 | drawQuadPartialID(id, x1, y1, x2, y2, x3, y3, 0, 1); |
| 3634 | } |
| 3635 | |
caryclark | 1049f12 | 2015-04-20 08:31:59 -0700 | [diff] [blame] | 3636 | function drawConicPartialID(id, x1, y1, x2, y2, x3, y3, w, t1, t2) { |
| 3637 | var curve = [x1, y1, x2, y2, x3, y3, w]; |
| 3638 | drawCurvePartialID(id, curve, t1, t2); |
| 3639 | } |
| 3640 | |
caryclark | 55888e4 | 2016-07-18 10:01:36 -0700 | [diff] [blame] | 3641 | function drawConicID(id, x1, y1, x2, y2, x3, y3, w) { |
| 3642 | drawConicPartialID(id, x1, y1, x2, y2, x3, y3, w, 0, 1); |
| 3643 | } |
| 3644 | |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 3645 | function drawCubicPartialID(id, x1, y1, x2, y2, x3, y3, x4, y4, t1, t2) { |
| 3646 | var curve = [x1, y1, x2, y2, x3, y3, x4, y4]; |
| 3647 | drawCurvePartialID(id, curve, t1, t2); |
| 3648 | } |
| 3649 | |
caryclark | 55888e4 | 2016-07-18 10:01:36 -0700 | [diff] [blame] | 3650 | function drawCubicID(id, x1, y1, x2, y2, x3, y3, x4, y4) { |
| 3651 | drawCubicPartialID(id, x1, y1, x2, y2, x3, y3, x4, y4, 0, 1); |
| 3652 | } |
| 3653 | |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 3654 | function drawCurvePartialID(id, curve, t1, t2) { |
Cary Clark | ff11428 | 2016-12-14 11:56:16 -0500 | [diff] [blame^] | 3655 | drawVisibleID(curve, (t1 + t2) / 2, id); |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 3656 | } |
| 3657 | |
| 3658 | function drawCurveSpecials(test, curve, type) { |
| 3659 | if (pt_labels) { |
| 3660 | drawPoints(curve, type, pt_labels == 2); |
| 3661 | } |
| 3662 | if (control_lines != 0) { |
| 3663 | drawControlLines(curve, type, control_lines); |
| 3664 | } |
| 3665 | if (curve_t) { |
| 3666 | drawPointAtT(curve, type); |
| 3667 | } |
| 3668 | if (draw_midpoint) { |
| 3669 | var mid = pointAtT(curve, type, 0.5); |
| 3670 | drawPoint(mid.x, mid.y, true); |
| 3671 | } |
| 3672 | if (draw_id) { |
| 3673 | var id = idByCurve(test, curve, type); |
| 3674 | if (id >= 0) { |
Cary Clark | ff11428 | 2016-12-14 11:56:16 -0500 | [diff] [blame^] | 3675 | drawVisibleID(curve, 0.5, id); |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 3676 | } |
| 3677 | } |
Cary Clark | ff11428 | 2016-12-14 11:56:16 -0500 | [diff] [blame^] | 3678 | if (draw_direction) {
|
| 3679 | drawVisibleDirection(curve);
|
| 3680 | } |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 3681 | if (type == PATH_LINE) { |
| 3682 | return; |
| 3683 | } |
| 3684 | if (draw_deriviatives > 0) { |
| 3685 | var d = dxy_at_t(curve, type, 0); |
caryclark | 03b03ca | 2015-04-23 09:13:37 -0700 | [diff] [blame] | 3686 | drawArrow(curve[0], curve[1], d.x, d.y, 1); |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 3687 | if (draw_deriviatives == 2) { |
| 3688 | d = dxy_at_t(curve, type, 1); |
| 3689 | if (type == PATH_CUBIC) { |
caryclark | 03b03ca | 2015-04-23 09:13:37 -0700 | [diff] [blame] | 3690 | drawArrow(curve[6], curve[7], d.x, d.y, 1); |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 3691 | } else { |
caryclark | 03b03ca | 2015-04-23 09:13:37 -0700 | [diff] [blame] | 3692 | drawArrow(curve[4], curve[5], d.x, d.y, 1); |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 3693 | } |
| 3694 | } |
| 3695 | if (draw_midpoint) { |
| 3696 | var mid = pointAtT(curve, type, 0.5); |
| 3697 | d = dxy_at_t(curve, type, 0.5); |
caryclark | 03b03ca | 2015-04-23 09:13:37 -0700 | [diff] [blame] | 3698 | drawArrow(mid.x, mid.y, d.x, d.y, 1); |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 3699 | } |
| 3700 | } |
| 3701 | if (type != PATH_CUBIC) { |
| 3702 | return; |
| 3703 | } |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 3704 | if (draw_sequence) { |
| 3705 | var ymin = Math.min(curve[1], curve[3], curve[5], curve[7]); |
| 3706 | for (var i = 0; i < 8; i+= 2) { |
| 3707 | drawLabelX(ymin, i >> 1, curve[i]); |
| 3708 | } |
| 3709 | var xmin = Math.min(curve[0], curve[2], curve[4], curve[6]); |
| 3710 | for (var i = 1; i < 8; i+= 2) { |
| 3711 | drawLabelY(xmin, i >> 1, curve[i]); |
| 3712 | } |
| 3713 | } |
| 3714 | } |
| 3715 | |
| 3716 | function logCurves(test) { |
| 3717 | for (curves in test) { |
| 3718 | var curve = test[curves]; |
| 3719 | dumpCurve(curve); |
| 3720 | } |
| 3721 | } |
| 3722 | |
| 3723 | function curveToString(curve) { |
| 3724 | var str = "{{"; |
caryclark | 1049f12 | 2015-04-20 08:31:59 -0700 | [diff] [blame] | 3725 | var length = curve.length == 7 ? 6 : curve.length; |
| 3726 | if (curve.length == 7) { |
| 3727 | str += "{"; |
| 3728 | } |
| 3729 | for (i = 0; i < length; i += 2) { |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 3730 | str += curve[i].toFixed(decimal_places) + "," + curve[i + 1].toFixed(decimal_places); |
| 3731 | if (i < curve.length - 2) { |
| 3732 | str += "}, {"; |
| 3733 | } |
| 3734 | } |
caryclark | 1049f12 | 2015-04-20 08:31:59 -0700 | [diff] [blame] | 3735 | str += "}"; |
| 3736 | if (curve.length == 7) { |
| 3737 | str += "}, " + curve[6].toFixed(decimal_places); |
| 3738 | } |
| 3739 | str += "}"; |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 3740 | return str; |
| 3741 | } |
| 3742 | |
| 3743 | function dumpCurve(curve) { |
| 3744 | console.log(curveToString(curve)); |
| 3745 | } |
| 3746 | |
| 3747 | function draw(test, lines, title) { |
| 3748 | ctx.fillStyle = "rgba(0,0,0, 0.1)"; |
| 3749 | ctx.font = "normal 50px Arial"; |
| 3750 | ctx.textAlign = "left"; |
| 3751 | ctx.fillText(title, 50, 50); |
| 3752 | ctx.font = "normal 10px Arial"; |
| 3753 | ctx.lineWidth = "1.001"; "0.999"; |
| 3754 | var secondPath = test.length; |
| 3755 | var closeCount = 0; |
| 3756 | logStart = -1; |
| 3757 | logRange = 0; |
| 3758 | // find last active rec type at this step |
| 3759 | var curType = test[0]; |
| 3760 | var curStep = 0; |
| 3761 | var hasOp = false; |
| 3762 | var lastActive = 0; |
| 3763 | var lastAdd = 0; |
caryclark | 624637c | 2015-05-11 07:21:27 -0700 | [diff] [blame] | 3764 | var lastCoin = 0; |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 3765 | var lastSect = 0; |
| 3766 | var lastSort = 0; |
| 3767 | var lastMark = 0; |
caryclark | 03b03ca | 2015-04-23 09:13:37 -0700 | [diff] [blame] | 3768 | var lastTop = 0; |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 3769 | activeCount = 0; |
| 3770 | addCount = 0; |
| 3771 | angleCount = 0; |
| 3772 | opCount = 0; |
| 3773 | sectCount = 0; |
| 3774 | sortCount = 0; |
caryclark | 03b03ca | 2015-04-23 09:13:37 -0700 | [diff] [blame] | 3775 | topCount = 0; |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 3776 | markCount = 0; |
| 3777 | activeMax = 0; |
| 3778 | addMax = 0; |
| 3779 | angleMax = 0; |
caryclark | 624637c | 2015-05-11 07:21:27 -0700 | [diff] [blame] | 3780 | coinMax = 0; |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 3781 | opMax = 0; |
| 3782 | sectMax = 0; |
| 3783 | sectMax2 = 0; |
| 3784 | sortMax = 0; |
caryclark | 03b03ca | 2015-04-23 09:13:37 -0700 | [diff] [blame] | 3785 | topMax = 0; |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 3786 | markMax = 0; |
| 3787 | lastIndex = test.length - 3; |
| 3788 | for (var tIndex = 0; tIndex < test.length; tIndex += 3) { |
| 3789 | var recType = test[tIndex]; |
| 3790 | if (!typeof recType == 'number' || recType < REC_TYPE_UNKNOWN || recType > REC_TYPE_LAST) { |
| 3791 | console.log("unknown rec type: " + recType); |
| 3792 | throw "stop execution"; |
| 3793 | } |
| 3794 | // if (curType == recType && curType != REC_TYPE_ADD) { |
| 3795 | // continue; |
| 3796 | // } |
| 3797 | var inStepRange = step_limit == 0 || curStep < step_limit; |
| 3798 | curType = recType; |
| 3799 | if (recType == REC_TYPE_OP) { |
| 3800 | hasOp = true; |
| 3801 | continue; |
| 3802 | } |
| 3803 | if (recType == REC_TYPE_UNKNOWN) { |
| 3804 | // these types do not advance step |
| 3805 | continue; |
| 3806 | } |
| 3807 | var bumpStep = false; |
| 3808 | var records = test[tIndex + 2]; |
| 3809 | var fragType = records[0]; |
| 3810 | if (recType == REC_TYPE_ADD) { |
| 3811 | if (records.length != 2) { |
| 3812 | console.log("expect only two elements: " + records.length); |
| 3813 | throw "stop execution"; |
| 3814 | } |
| 3815 | if (fragType == ADD_MOVETO || fragType == ADD_CLOSE) { |
| 3816 | continue; |
| 3817 | } |
| 3818 | ++addMax; |
| 3819 | if (!draw_add || !inStepRange) { |
| 3820 | continue; |
| 3821 | } |
| 3822 | lastAdd = tIndex; |
| 3823 | ++addCount; |
| 3824 | bumpStep = true; |
| 3825 | } |
| 3826 | if (recType == REC_TYPE_PATH && hasOp) { |
| 3827 | secondPath = tIndex; |
| 3828 | } |
caryclark | 5435929 | 2015-03-26 07:52:43 -0700 | [diff] [blame] | 3829 | if (recType == REC_TYPE_PATH2 && hasOp) { |
| 3830 | secondPath = tIndex; |
| 3831 | } |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 3832 | if (recType == REC_TYPE_ACTIVE) { |
| 3833 | ++activeMax; |
| 3834 | if (!draw_active || !inStepRange) { |
| 3835 | continue; |
| 3836 | } |
| 3837 | lastActive = tIndex; |
| 3838 | ++activeCount; |
| 3839 | bumpStep = true; |
| 3840 | } |
| 3841 | if (recType == REC_TYPE_ACTIVE_OP) { |
| 3842 | ++opMax; |
| 3843 | if (!draw_op || !inStepRange) { |
| 3844 | continue; |
| 3845 | } |
| 3846 | lastOp = tIndex; |
| 3847 | ++opCount; |
| 3848 | bumpStep = true; |
| 3849 | } |
caryclark | 5435929 | 2015-03-26 07:52:43 -0700 | [diff] [blame] | 3850 | if (recType == REC_TYPE_AFTERPART) { |
| 3851 | if (draw_angle != 3 || !inStepRange) { |
| 3852 | continue; |
| 3853 | } |
| 3854 | lastAngle = tIndex; |
| 3855 | ++angleCount; |
| 3856 | bumpStep = true; |
| 3857 | } |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 3858 | if (recType == REC_TYPE_ANGLE) { |
| 3859 | ++angleMax; |
caryclark | 5435929 | 2015-03-26 07:52:43 -0700 | [diff] [blame] | 3860 | if (draw_angle == 0 || draw_angle == 3 || !inStepRange) { |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 3861 | continue; |
| 3862 | } |
| 3863 | lastAngle = tIndex; |
| 3864 | ++angleCount; |
| 3865 | bumpStep = true; |
| 3866 | } |
caryclark | 624637c | 2015-05-11 07:21:27 -0700 | [diff] [blame] | 3867 | if (recType == REC_TYPE_COINCIDENCE) { |
| 3868 | ++coinMax; |
| 3869 | if (!draw_coincidence || !inStepRange) { |
| 3870 | continue; |
| 3871 | } |
| 3872 | lastCoin = tIndex; |
| 3873 | ++coinCount; |
| 3874 | bumpStep = true; |
| 3875 | } |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 3876 | if (recType == REC_TYPE_SECT) { |
| 3877 | if (records.length != 2) { |
| 3878 | console.log("expect only two elements: " + records.length); |
| 3879 | throw "stop execution"; |
| 3880 | } |
| 3881 | ++sectMax; |
| 3882 | var sectBump = 1; |
| 3883 | switch (fragType) { |
| 3884 | case INTERSECT_LINE: |
| 3885 | case INTERSECT_QUAD_LINE: |
| 3886 | case INTERSECT_QUAD: |
caryclark | 1049f12 | 2015-04-20 08:31:59 -0700 | [diff] [blame] | 3887 | case INTERSECT_CONIC_LINE: |
caryclark | 55888e4 | 2016-07-18 10:01:36 -0700 | [diff] [blame] | 3888 | case INTERSECT_CONIC_QUAD: |
caryclark | 1049f12 | 2015-04-20 08:31:59 -0700 | [diff] [blame] | 3889 | case INTERSECT_CONIC: |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 3890 | case INTERSECT_SELF_CUBIC: |
| 3891 | case INTERSECT_CUBIC_LINE: |
| 3892 | case INTERSECT_CUBIC_QUAD: |
| 3893 | case INTERSECT_CUBIC: |
| 3894 | sectBump = 1; |
| 3895 | break; |
| 3896 | case INTERSECT_LINE_2: |
| 3897 | case INTERSECT_QUAD_LINE_2: |
| 3898 | case INTERSECT_QUAD_2: |
caryclark | 1049f12 | 2015-04-20 08:31:59 -0700 | [diff] [blame] | 3899 | case INTERSECT_CONIC_LINE_2: |
caryclark | 55888e4 | 2016-07-18 10:01:36 -0700 | [diff] [blame] | 3900 | case INTERSECT_CONIC_QUAD_2: |
caryclark | 1049f12 | 2015-04-20 08:31:59 -0700 | [diff] [blame] | 3901 | case INTERSECT_CONIC_2: |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 3902 | case INTERSECT_CUBIC_LINE_2: |
| 3903 | case INTERSECT_CUBIC_QUAD_2: |
| 3904 | case INTERSECT_CUBIC_2: |
| 3905 | sectBump = 2; |
| 3906 | break; |
| 3907 | case INTERSECT_LINE_NO: |
| 3908 | case INTERSECT_QUAD_LINE_NO: |
| 3909 | case INTERSECT_QUAD_NO: |
caryclark | 1049f12 | 2015-04-20 08:31:59 -0700 | [diff] [blame] | 3910 | case INTERSECT_CONIC_LINE_NO: |
caryclark | 55888e4 | 2016-07-18 10:01:36 -0700 | [diff] [blame] | 3911 | case INTERSECT_CONIC_QUAD_NO: |
caryclark | 1049f12 | 2015-04-20 08:31:59 -0700 | [diff] [blame] | 3912 | case INTERSECT_CONIC_NO: |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 3913 | case INTERSECT_SELF_CUBIC_NO: |
| 3914 | case INTERSECT_CUBIC_LINE_NO: |
| 3915 | case INTERSECT_CUBIC_QUAD_NO: |
| 3916 | case INTERSECT_CUBIC_NO: |
| 3917 | sectBump = 0; |
| 3918 | break; |
caryclark | 6c3b9cd | 2016-09-26 05:36:58 -0700 | [diff] [blame] | 3919 | case INTERSECT_CONIC_QUAD_3: |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 3920 | case INTERSECT_CUBIC_LINE_3: |
| 3921 | case INTERSECT_CUBIC_QUAD_3: |
| 3922 | case INTERSECT_CUBIC_3: |
| 3923 | sectBump = 3; |
| 3924 | break; |
caryclark | 6c3b9cd | 2016-09-26 05:36:58 -0700 | [diff] [blame] | 3925 | case INTERSECT_CONIC_QUAD_4: |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 3926 | case INTERSECT_CUBIC_QUAD_4: |
| 3927 | case INTERSECT_CUBIC_4: |
| 3928 | sectBump = 4; |
| 3929 | break; |
| 3930 | default: |
| 3931 | console.log("missing case " + records.length); |
| 3932 | throw "stop execution"; |
| 3933 | } |
| 3934 | sectMax2 += sectBump; |
| 3935 | if (draw_intersection <= 1 || !inStepRange) { |
| 3936 | continue; |
| 3937 | } |
| 3938 | lastSect = tIndex; |
| 3939 | sectCount += sectBump; |
| 3940 | bumpStep = true; |
| 3941 | } |
| 3942 | if (recType == REC_TYPE_SORT) { |
| 3943 | ++sortMax; |
| 3944 | if (!draw_sort || !inStepRange) { |
| 3945 | continue; |
| 3946 | } |
| 3947 | lastSort = tIndex; |
| 3948 | ++sortCount; |
| 3949 | bumpStep = true; |
| 3950 | } |
caryclark | 03b03ca | 2015-04-23 09:13:37 -0700 | [diff] [blame] | 3951 | if (recType == REC_TYPE_TOP) { |
| 3952 | ++topMax; |
| 3953 | if (!draw_top || !inStepRange) { |
| 3954 | continue; |
| 3955 | } |
| 3956 | lastTop = tIndex; |
| 3957 | ++topCount; |
| 3958 | bumpStep = true; |
| 3959 | } |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 3960 | if (recType == REC_TYPE_MARK) { |
| 3961 | ++markMax; |
| 3962 | if (!draw_mark || !inStepRange) { |
| 3963 | continue; |
| 3964 | } |
| 3965 | lastMark = tIndex; |
| 3966 | ++markCount; |
| 3967 | bumpStep = true; |
| 3968 | } |
| 3969 | if (bumpStep) { |
| 3970 | lastIndex = tIndex; |
| 3971 | logStart = test[tIndex + 1]; |
| 3972 | logRange = records.length / 2; |
| 3973 | ++curStep; |
| 3974 | } |
| 3975 | } |
| 3976 | stepMax = (draw_add ? addMax : 0) |
| 3977 | + (draw_active ? activeMax : 0) |
reed | 0dc4dd6 | 2015-03-24 13:55:33 -0700 | [diff] [blame] | 3978 | + (draw_angle ? angleMax : 0) |
caryclark | 624637c | 2015-05-11 07:21:27 -0700 | [diff] [blame] | 3979 | + (draw_coincidence ? coinMax : 0) |
caryclark | 5435929 | 2015-03-26 07:52:43 -0700 | [diff] [blame] | 3980 | + (draw_op ? opMax : 0) |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 3981 | + (draw_sort ? sortMax : 0) |
caryclark | 03b03ca | 2015-04-23 09:13:37 -0700 | [diff] [blame] | 3982 | + (draw_top ? topMax : 0) |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 3983 | + (draw_mark ? markMax : 0) |
| 3984 | + (draw_intersection == 2 ? sectMax : draw_intersection == 3 ? sectMax2 : 0); |
| 3985 | if (stepMax == 0) { |
caryclark | 624637c | 2015-05-11 07:21:27 -0700 | [diff] [blame] | 3986 | stepMax = addMax + activeMax + angleMax + coinMax + opMax + sortMax + topMax + markMax; |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 3987 | } |
| 3988 | drawnPts = []; |
| 3989 | drawnLines = []; |
| 3990 | drawnQuads = []; |
caryclark | 1049f12 | 2015-04-20 08:31:59 -0700 | [diff] [blame] | 3991 | drawnConics = []; |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 3992 | drawnCubics = []; |
| 3993 | focusXmin = focusYmin = Infinity; |
| 3994 | focusXmax = focusYmax = -Infinity; |
| 3995 | var pathIndex = 0; |
| 3996 | var opLetter = 'S'; |
| 3997 | for (var tIndex = lastIndex; tIndex >= 0; tIndex -= 3) { |
| 3998 | var recType = test[tIndex]; |
| 3999 | var records = test[tIndex + 2]; |
| 4000 | for (var recordIndex = 0; recordIndex < records.length; recordIndex += 2) { |
| 4001 | var fragType = records[recordIndex]; |
| 4002 | if (!typeof fragType == 'number' || fragType < 1 || fragType > FRAG_TYPE_LAST) { |
| 4003 | console.log("unknown in range frag type: " + fragType); |
| 4004 | throw "stop execution"; |
| 4005 | } |
| 4006 | var frags = records[recordIndex + 1]; |
| 4007 | focus_enabled = false; |
| 4008 | switch (recType) { |
| 4009 | case REC_TYPE_COMPUTED: |
| 4010 | if (draw_computed == 0) { |
| 4011 | continue; |
| 4012 | } |
| 4013 | ctx.lineWidth = 1; |
| 4014 | ctx.strokeStyle = pathIndex == 0 ? "black" : "red"; |
| 4015 | ctx.fillStyle = "blue"; |
| 4016 | var drawThis = false; |
| 4017 | switch (fragType) { |
| 4018 | case PATH_QUAD: |
caryclark | 1049f12 | 2015-04-20 08:31:59 -0700 | [diff] [blame] | 4019 | if ((draw_computed & 0x9) == 1 || ((draw_computed & 8) != 0 |
| 4020 | && (draw_computed & 7) == pathIndex)) { |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 4021 | drawQuad(frags[0], frags[1], frags[2], frags[3], |
| 4022 | frags[4], frags[5]); |
| 4023 | drawThis = true; |
| 4024 | } |
| 4025 | break; |
caryclark | 1049f12 | 2015-04-20 08:31:59 -0700 | [diff] [blame] | 4026 | case PATH_CONIC: |
| 4027 | if ((draw_computed & 0xA) == 2 || ((draw_computed & 8) != 0 |
| 4028 | && (draw_computed & 7) == pathIndex)) { |
| 4029 | drawConicWithQuads(frags[0], frags[1], frags[2], frags[3], |
| 4030 | frags[4], frags[5], frags[6]); |
| 4031 | drawThis = true; |
| 4032 | } |
| 4033 | break; |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 4034 | case PATH_CUBIC: |
caryclark | 1049f12 | 2015-04-20 08:31:59 -0700 | [diff] [blame] | 4035 | if ((draw_computed & 0xC) == 4 || ((draw_computed & 8) != 0 |
| 4036 | && (draw_computed & 7) == pathIndex)) { |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 4037 | drawCubic(frags[0], frags[1], frags[2], frags[3], |
| 4038 | frags[4], frags[5], frags[6], frags[7]); |
| 4039 | drawThis = true; |
| 4040 | } |
| 4041 | ++pathIndex; |
| 4042 | break; |
| 4043 | case COMPUTED_SET_1: |
| 4044 | pathIndex = 0; |
| 4045 | break; |
| 4046 | case COMPUTED_SET_2: |
| 4047 | pathIndex = 1; |
| 4048 | break; |
| 4049 | default: |
| 4050 | console.log("unknown REC_TYPE_COMPUTED frag type: " + fragType); |
| 4051 | throw "stop execution"; |
| 4052 | } |
| 4053 | if (!drawThis || collect_bounds) { |
| 4054 | break; |
| 4055 | } |
| 4056 | drawCurveSpecials(test, frags, fragType); |
| 4057 | break; |
caryclark | 26ad22a | 2015-10-16 09:03:38 -0700 | [diff] [blame] | 4058 | case REC_TYPE_ALIGNED: |
| 4059 | if (draw_path < 4) { |
| 4060 | continue; |
| 4061 | } |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 4062 | case REC_TYPE_PATH: |
caryclark | 5435929 | 2015-03-26 07:52:43 -0700 | [diff] [blame] | 4063 | case REC_TYPE_PATH2: |
caryclark | 26ad22a | 2015-10-16 09:03:38 -0700 | [diff] [blame] | 4064 | if (REC_TYPE_ALIGNED != recType && draw_path >= 4) { |
| 4065 | continue; |
| 4066 | } |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 4067 | if (!draw_path) { |
| 4068 | continue; |
| 4069 | } |
| 4070 | var firstPath = tIndex < secondPath; |
| 4071 | if ((draw_path & (firstPath ? 1 : 2)) == 0) { |
| 4072 | continue; |
| 4073 | } |
| 4074 | ctx.lineWidth = 1; |
| 4075 | ctx.strokeStyle = firstPath ? "black" : "red"; |
| 4076 | ctx.fillStyle = "blue"; |
caryclark | 55888e4 | 2016-07-18 10:01:36 -0700 | [diff] [blame] | 4077 | var frags2 = []; |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 4078 | switch (fragType) { |
| 4079 | case PATH_LINE: |
caryclark | 5435929 | 2015-03-26 07:52:43 -0700 | [diff] [blame] | 4080 | for (var i = 0; i < 4; ++ i) { frags2[i] = frags[i + 1]; } |
| 4081 | drawLine(frags2[0], frags2[1], frags2[2], frags2[3]); |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 4082 | break; |
| 4083 | case PATH_QUAD: |
caryclark | 5435929 | 2015-03-26 07:52:43 -0700 | [diff] [blame] | 4084 | for (var i = 0; i < 6; ++ i) { frags2[i] = frags[i + 1]; } |
| 4085 | drawQuad(frags2[0], frags2[1], frags2[2], frags2[3], |
| 4086 | frags2[4], frags2[5]); |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 4087 | break; |
caryclark | 1049f12 | 2015-04-20 08:31:59 -0700 | [diff] [blame] | 4088 | case PATH_CONIC: |
| 4089 | for (var i = 0; i < 7; ++ i) { frags2[i] = frags[i + 1]; } |
| 4090 | drawConicWithQuads(frags2[0], frags2[1], frags2[2], frags2[3], |
| 4091 | frags2[4], frags2[5], frags2[6]); |
| 4092 | break; |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 4093 | case PATH_CUBIC: |
caryclark | 5435929 | 2015-03-26 07:52:43 -0700 | [diff] [blame] | 4094 | for (var i = 0; i < 8; ++ i) { frags2[i] = frags[i + 1]; } |
| 4095 | drawCubic(frags2[0], frags2[1], frags2[2], frags2[3], |
| 4096 | frags2[4], frags2[5], frags2[6], frags2[7]); |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 4097 | break; |
| 4098 | default: |
caryclark | 26ad22a | 2015-10-16 09:03:38 -0700 | [diff] [blame] | 4099 | console.log("unknown " + recType + " frag type: " + fragType); |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 4100 | throw "stop execution"; |
| 4101 | } |
| 4102 | if (collect_bounds) { |
| 4103 | break; |
| 4104 | } |
caryclark | 5435929 | 2015-03-26 07:52:43 -0700 | [diff] [blame] | 4105 | drawCurveSpecials(test, frags2, fragType); |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 4106 | break; |
| 4107 | case REC_TYPE_OP: |
| 4108 | switch (fragType) { |
| 4109 | case OP_INTERSECT: opLetter = 'I'; break; |
| 4110 | case OP_DIFFERENCE: opLetter = 'D'; break; |
| 4111 | case OP_UNION: opLetter = 'U'; break; |
| 4112 | case OP_XOR: opLetter = 'X'; break; |
| 4113 | default: |
| 4114 | console.log("unknown REC_TYPE_OP frag type: " + fragType); |
| 4115 | throw "stop execution"; |
| 4116 | } |
| 4117 | break; |
| 4118 | case REC_TYPE_ACTIVE: |
| 4119 | if (!draw_active || (step_limit > 0 && tIndex < lastActive)) { |
| 4120 | continue; |
| 4121 | } |
| 4122 | var x1 = frags[SPAN_X1]; |
| 4123 | var y1 = frags[SPAN_Y1]; |
| 4124 | var x2 = frags[SPAN_X2]; |
| 4125 | var y2 = frags[SPAN_Y2]; |
caryclark | 55888e4 | 2016-07-18 10:01:36 -0700 | [diff] [blame] | 4126 | var x3, y3, x3, y4, w; |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 4127 | ctx.lineWidth = 3; |
| 4128 | ctx.strokeStyle = "rgba(0,0,255, 0.3)"; |
| 4129 | focus_enabled = true; |
| 4130 | switch (fragType) { |
| 4131 | case ACTIVE_LINE_SPAN: |
caryclark | 55888e4 | 2016-07-18 10:01:36 -0700 | [diff] [blame] | 4132 | drawLine(x1, y1, x2, y2); |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 4133 | if (draw_id) { |
caryclark | 55888e4 | 2016-07-18 10:01:36 -0700 | [diff] [blame] | 4134 | drawLineID(frags[0], x1, y1, x2, y2); |
| 4135 | } |
| 4136 | if (pt_labels) { |
| 4137 | var curve = [x1, y1, x2, y2]; |
| 4138 | ctx.fillStyle = "blue"; |
| 4139 | drawPoints(curve, PATH_LINE, pt_labels == 2); |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 4140 | } |
| 4141 | break; |
| 4142 | case ACTIVE_QUAD_SPAN: |
| 4143 | x3 = frags[SPAN_X3]; |
| 4144 | y3 = frags[SPAN_Y3]; |
caryclark | 55888e4 | 2016-07-18 10:01:36 -0700 | [diff] [blame] | 4145 | drawQuad(x1, y1, x2, y2, x3, y3); |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 4146 | if (draw_id) { |
caryclark | 55888e4 | 2016-07-18 10:01:36 -0700 | [diff] [blame] | 4147 | drawQuadID(frags[0], x1, y1, x2, y2, x3, y3); |
| 4148 | } |
| 4149 | if (pt_labels) { |
| 4150 | var curve = [x1, y1, x2, y2, x3, y3]; |
| 4151 | ctx.fillStyle = "blue"; |
| 4152 | drawPoints(curve, PATH_QUAD, pt_labels == 2); |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 4153 | } |
| 4154 | break; |
caryclark | 1049f12 | 2015-04-20 08:31:59 -0700 | [diff] [blame] | 4155 | case ACTIVE_CONIC_SPAN: |
| 4156 | x3 = frags[SPAN_X3]; |
| 4157 | y3 = frags[SPAN_Y3]; |
caryclark | 1049f12 | 2015-04-20 08:31:59 -0700 | [diff] [blame] | 4158 | w = frags[SPAN_K_W]; |
caryclark | 55888e4 | 2016-07-18 10:01:36 -0700 | [diff] [blame] | 4159 | drawConicWithQuads(x1, y1, x2, y2, x3, y3, w); |
caryclark | 1049f12 | 2015-04-20 08:31:59 -0700 | [diff] [blame] | 4160 | if (draw_id) { |
caryclark | 55888e4 | 2016-07-18 10:01:36 -0700 | [diff] [blame] | 4161 | drawConicID(frags[0], x1, y1, x2, y2, x3, y3, w); |
| 4162 | } |
| 4163 | if (pt_labels) { |
| 4164 | var curve = [x1, y1, x2, y2, x3, y3, w]; |
| 4165 | ctx.fillStyle = "blue"; |
| 4166 | drawPoints(curve, PATH_CONIC, pt_labels == 2); |
caryclark | 1049f12 | 2015-04-20 08:31:59 -0700 | [diff] [blame] | 4167 | } |
| 4168 | break; |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 4169 | case ACTIVE_CUBIC_SPAN: |
| 4170 | x3 = frags[SPAN_X3]; |
| 4171 | y3 = frags[SPAN_Y3]; |
| 4172 | x4 = frags[SPAN_X4]; |
| 4173 | y4 = frags[SPAN_Y4]; |
caryclark | 55888e4 | 2016-07-18 10:01:36 -0700 | [diff] [blame] | 4174 | drawCubic(x1, y1, x2, y2, x3, y3, x4, y4); |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 4175 | if (draw_id) { |
caryclark | 55888e4 | 2016-07-18 10:01:36 -0700 | [diff] [blame] | 4176 | drawCubicID(frags[0], x1, y1, x2, y2, x3, y3, x4, y4); |
| 4177 | } |
| 4178 | if (pt_labels) { |
| 4179 | var curve = [x1, y1, x2, y2, x3, y3, x4, y4]; |
| 4180 | ctx.fillStyle = "blue"; |
| 4181 | drawPoints(curve, PATH_CUBIC, pt_labels == 2); |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 4182 | } |
| 4183 | break; |
| 4184 | default: |
| 4185 | console.log("unknown REC_TYPE_ACTIVE frag type: " + fragType); |
| 4186 | throw "stop execution"; |
| 4187 | } |
| 4188 | break; |
| 4189 | case REC_TYPE_ACTIVE_OP: |
| 4190 | if (!draw_op || (step_limit > 0 && tIndex < lastOp)) { |
| 4191 | continue; |
| 4192 | } |
| 4193 | focus_enabled = true; |
| 4194 | ctx.lineWidth = 3; |
| 4195 | var activeSpan = frags[7] == "1"; |
| 4196 | ctx.strokeStyle = activeSpan ? "rgba(45,160,0, 0.3)" : "rgba(255,45,0, 0.5)"; |
| 4197 | var curve = curvePartialByID(test, frags[0], frags[1], frags[2]); |
| 4198 | drawCurve(curve); |
| 4199 | if (draw_op > 1) { |
| 4200 | drawArc(curve, false, frags[3], frags[4]); |
| 4201 | drawArc(curve, true, frags[5], frags[6]); |
| 4202 | } |
| 4203 | break; |
| 4204 | case REC_TYPE_ADD: |
| 4205 | if (!draw_add) { |
| 4206 | continue; |
| 4207 | } |
| 4208 | ctx.lineWidth = 3; |
| 4209 | ctx.strokeStyle = closeCount == 0 ? "rgba(0,0,255, 0.3)" |
| 4210 | : closeCount == 1 ? "rgba(0,127,0, 0.3)" |
| 4211 | : closeCount == 2 ? "rgba(0,127,127, 0.3)" |
| 4212 | : closeCount == 3 ? "rgba(127,127,0, 0.3)" |
| 4213 | : "rgba(127,0,127, 0.3)"; |
| 4214 | focus_enabled = true; |
| 4215 | switch (fragType) { |
| 4216 | case ADD_MOVETO: |
| 4217 | break; |
| 4218 | case ADD_LINETO: |
| 4219 | if (step_limit == 0 || tIndex >= lastAdd) { |
| 4220 | drawLine(frags[0], frags[1], frags[2], frags[3]); |
| 4221 | } |
| 4222 | break; |
| 4223 | case ADD_QUADTO: |
| 4224 | if (step_limit == 0 || tIndex >= lastAdd) { |
| 4225 | drawQuad(frags[0], frags[1], frags[2], frags[3], frags[4], frags[5]); |
| 4226 | } |
| 4227 | break; |
caryclark | 1049f12 | 2015-04-20 08:31:59 -0700 | [diff] [blame] | 4228 | case ADD_CONICTO: |
| 4229 | if (step_limit == 0 || tIndex >= lastAdd) { |
| 4230 | drawConicWithQuads(frags[0], frags[1], frags[2], frags[3], |
| 4231 | frags[4], frags[5], frags[6]); |
| 4232 | } |
| 4233 | break; |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 4234 | case ADD_CUBICTO: |
| 4235 | if (step_limit == 0 || tIndex >= lastAdd) { |
| 4236 | drawCubic(frags[0], frags[1], frags[2], frags[3], |
| 4237 | frags[4], frags[5], frags[6], frags[7]); |
| 4238 | } |
| 4239 | break; |
| 4240 | case ADD_CLOSE: |
| 4241 | ++closeCount; |
| 4242 | break; |
| 4243 | case ADD_FILL: |
| 4244 | break; |
| 4245 | default: |
| 4246 | console.log("unknown REC_TYPE_ADD frag type: " + fragType); |
| 4247 | throw "stop execution"; |
| 4248 | } |
| 4249 | break; |
| 4250 | case REC_TYPE_ANGLE: |
caryclark | 5435929 | 2015-03-26 07:52:43 -0700 | [diff] [blame] | 4251 | angleBetween = frags[18] == "T"; |
| 4252 | afterIndex = 0; |
| 4253 | if (draw_angle == 0 || draw_angle == 3 || (step_limit > 0 && tIndex < lastAngle)) { |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 4254 | continue; |
| 4255 | } |
| 4256 | focus_enabled = true; |
| 4257 | ctx.lineWidth = 3; |
| 4258 | ctx.strokeStyle = "rgba(127,45,127, 0.3)"; |
caryclark | 5435929 | 2015-03-26 07:52:43 -0700 | [diff] [blame] | 4259 | var leftCurve = curvePartialByID(test, frags[0], frags[4], frags[5]); |
| 4260 | var midCurve = curvePartialByID(test, frags[6], frags[10], frags[11]); |
| 4261 | var rightCurve = curvePartialByID(test, frags[12], frags[16], frags[17]); |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 4262 | drawCurve(leftCurve); |
| 4263 | drawCurve(rightCurve); |
caryclark | 5435929 | 2015-03-26 07:52:43 -0700 | [diff] [blame] | 4264 | ctx.strokeStyle = angleBetween ? "rgba(0,160,45, 0.3)" : "rgba(255,0,45, 0.5)"; |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 4265 | drawCurve(midCurve); |
| 4266 | if (draw_angle > 1) { |
Cary Clark | ff11428 | 2016-12-14 11:56:16 -0500 | [diff] [blame^] | 4267 | drawVisibleOrder(leftCurve, 'L'); |
| 4268 | drawVisibleOrder(rightCurve, 'R'); |
| 4269 | } |
| 4270 | if (draw_id) {
|
| 4271 | drawVisibleID(leftCurve, 0.5, frags[0]);
|
| 4272 | drawVisibleID(midCurve, 0.5, frags[6]);
|
| 4273 | drawVisibleID(rightCurve, 0.5, frags[12]);
|
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 4274 | } |
| 4275 | break; |
caryclark | 5435929 | 2015-03-26 07:52:43 -0700 | [diff] [blame] | 4276 | case REC_TYPE_AFTERPART: |
| 4277 | if (draw_angle != 3 || (step_limit > 0 && tIndex < lastAngle)) { |
| 4278 | continue; |
| 4279 | } |
| 4280 | ctx.strokeStyle = afterIndex == 0 ? "rgba(255,0,0, 1.0)" |
| 4281 | : (afterIndex == 1) == angleBetween ? "rgba(0,128,0, 1.0)" |
Cary Clark | ff11428 | 2016-12-14 11:56:16 -0500 | [diff] [blame^] | 4282 | : "rgba(0,0,255, 1.0)"; |
| 4283 | var curve; |
| 4284 | var id; |
caryclark | 5435929 | 2015-03-26 07:52:43 -0700 | [diff] [blame] | 4285 | switch (fragType) { |
| 4286 | case PATH_LINE: |
Cary Clark | ff11428 | 2016-12-14 11:56:16 -0500 | [diff] [blame^] | 4287 | curve = [ frags[0], frags[1], frags[2], frags[3] ]; |
| 4288 | id = frags[4]; |
caryclark | 5435929 | 2015-03-26 07:52:43 -0700 | [diff] [blame] | 4289 | break; |
| 4290 | case PATH_QUAD: |
Cary Clark | ff11428 | 2016-12-14 11:56:16 -0500 | [diff] [blame^] | 4291 | curve = [ frags[0], frags[1], frags[2], frags[3], |
| 4292 | frags[4], frags[5] ]; |
| 4293 | id = frags[6]; |
caryclark | 5435929 | 2015-03-26 07:52:43 -0700 | [diff] [blame] | 4294 | break; |
caryclark | 1049f12 | 2015-04-20 08:31:59 -0700 | [diff] [blame] | 4295 | case PATH_CONIC: |
Cary Clark | ff11428 | 2016-12-14 11:56:16 -0500 | [diff] [blame^] | 4296 | curve = [ frags[0], frags[1], frags[2], frags[3], |
| 4297 | frags[4], frags[5], frags[6] ]; |
| 4298 | id = frags[7]; |
caryclark | 1049f12 | 2015-04-20 08:31:59 -0700 | [diff] [blame] | 4299 | break; |
caryclark | 5435929 | 2015-03-26 07:52:43 -0700 | [diff] [blame] | 4300 | case PATH_CUBIC: |
Cary Clark | ff11428 | 2016-12-14 11:56:16 -0500 | [diff] [blame^] | 4301 | curve = [ frags[0], frags[1], frags[2], frags[3], |
| 4302 | frags[4], frags[5], frags[6], frags[7] ]; |
| 4303 | id = frags[8]; |
caryclark | 5435929 | 2015-03-26 07:52:43 -0700 | [diff] [blame] | 4304 | break; |
| 4305 | default: |
| 4306 | console.log("unknown REC_TYPE_AFTERPART frag type: " + fragType); |
| 4307 | throw "stop execution"; |
| 4308 | } |
Cary Clark | ff11428 | 2016-12-14 11:56:16 -0500 | [diff] [blame^] | 4309 | drawCurve(curve); |
| 4310 | if (draw_id) {
|
| 4311 | drawVisibleID(curve, 0.5, id);
|
| 4312 | } |
caryclark | 5435929 | 2015-03-26 07:52:43 -0700 | [diff] [blame] | 4313 | ++afterIndex; |
| 4314 | break; |
caryclark | 624637c | 2015-05-11 07:21:27 -0700 | [diff] [blame] | 4315 | case REC_TYPE_COINCIDENCE: |
| 4316 | if (!draw_coincidence || (step_limit > 0 && tIndex < lastCoin)) { |
| 4317 | continue; |
| 4318 | } |
| 4319 | focus_enabled = true; |
| 4320 | ctx.lineWidth = 3; |
| 4321 | ctx.strokeStyle = "rgba(127,45,63, 0.3)"; |
| 4322 | var curve = curvePartialByID(test, frags[0], frags[1], frags[2]); |
| 4323 | drawCurve(curve); |
| 4324 | break; |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 4325 | case REC_TYPE_SECT: |
| 4326 | if (!draw_intersection) { |
| 4327 | continue; |
| 4328 | } |
| 4329 | if (draw_intersection != 1 && (step_limit > 0 && tIndex < lastSect)) { |
| 4330 | continue; |
| 4331 | } |
| 4332 | // draw_intersection == 1 : show all |
| 4333 | // draw_intersection == 2 : step == 0 ? show all : show intersection line #step |
| 4334 | // draw_intersection == 3 : step == 0 ? show all : show intersection #step |
| 4335 | ctx.lineWidth = 1; |
| 4336 | ctx.strokeStyle = "rgba(0,0,255, 0.3)"; |
| 4337 | ctx.fillStyle = "blue"; |
| 4338 | focus_enabled = true; |
| 4339 | var f = []; |
| 4340 | var c1s; |
| 4341 | var c1l; |
| 4342 | var c2s; |
| 4343 | var c2l; |
| 4344 | switch (fragType) { |
| 4345 | case INTERSECT_LINE: |
| 4346 | f.push(5, 6, 0, 7); |
| 4347 | c1s = 1; c1l = 4; c2s = 8; c2l = 4; |
| 4348 | break; |
| 4349 | case INTERSECT_LINE_2: |
| 4350 | f.push(5, 6, 0, 10); |
| 4351 | f.push(8, 9, 7, 15); |
| 4352 | c1s = 1; c1l = 4; c2s = 11; c2l = 4; |
| 4353 | break; |
| 4354 | case INTERSECT_LINE_NO: |
| 4355 | c1s = 0; c1l = 4; c2s = 4; c2l = 4; |
| 4356 | break; |
| 4357 | case INTERSECT_QUAD_LINE: |
| 4358 | f.push(7, 8, 0, 9); |
| 4359 | c1s = 1; c1l = 6; c2s = 10; c2l = 4; |
| 4360 | break; |
| 4361 | case INTERSECT_QUAD_LINE_2: |
| 4362 | f.push(7, 8, 0, 12); |
| 4363 | f.push(10, 11, 9, 17); |
| 4364 | c1s = 1; c1l = 6; c2s = 13; c2l = 4; |
| 4365 | break; |
| 4366 | case INTERSECT_QUAD_LINE_NO: |
| 4367 | c1s = 0; c1l = 6; c2s = 6; c2l = 4; |
| 4368 | break; |
| 4369 | case INTERSECT_QUAD: |
| 4370 | f.push(7, 8, 0, 9); |
| 4371 | c1s = 1; c1l = 6; c2s = 10; c2l = 6; |
| 4372 | break; |
| 4373 | case INTERSECT_QUAD_2: |
| 4374 | f.push(7, 8, 0, 12); |
| 4375 | f.push(10, 11, 9, 19); |
| 4376 | c1s = 1; c1l = 6; c2s = 13; c2l = 6; |
| 4377 | break; |
| 4378 | case INTERSECT_QUAD_NO: |
| 4379 | c1s = 0; c1l = 6; c2s = 6; c2l = 6; |
| 4380 | break; |
caryclark | 1049f12 | 2015-04-20 08:31:59 -0700 | [diff] [blame] | 4381 | case INTERSECT_CONIC_LINE: |
| 4382 | f.push(8, 9, 0, 10); |
| 4383 | c1s = 1; c1l = 7; c2s = 11; c2l = 4; |
| 4384 | break; |
| 4385 | case INTERSECT_CONIC_LINE_2: |
| 4386 | f.push(8, 9, 0, 12); |
| 4387 | f.push(11, 12, 10, 18); |
| 4388 | c1s = 1; c1l = 7; c2s = 14; c2l = 4; |
| 4389 | break; |
| 4390 | case INTERSECT_CONIC_LINE_NO: |
| 4391 | c1s = 0; c1l = 7; c2s = 7; c2l = 4; |
| 4392 | break; |
caryclark | 55888e4 | 2016-07-18 10:01:36 -0700 | [diff] [blame] | 4393 | case INTERSECT_CONIC_QUAD: |
| 4394 | f.push(8, 9, 0, 10); |
| 4395 | c1s = 1; c1l = 7; c2s = 11; c2l = 6; |
| 4396 | break; |
| 4397 | case INTERSECT_CONIC_QUAD_2: |
| 4398 | f.push(8, 9, 0, 12); |
| 4399 | f.push(11, 12, 10, 18); |
| 4400 | c1s = 1; c1l = 7; c2s = 14; c2l = 6; |
| 4401 | break; |
caryclark | 6c3b9cd | 2016-09-26 05:36:58 -0700 | [diff] [blame] | 4402 | case INTERSECT_CONIC_QUAD_3: |
| 4403 | f.push(8, 9, 0, 15); |
| 4404 | f.push(11, 12, 10, 21); |
| 4405 | f.push(14, 15, 13, 22); |
| 4406 | c1s = 1; c1l = 7; c2s = 17; c2l = 6; |
| 4407 | break; |
| 4408 | case INTERSECT_CONIC_QUAD_4: |
| 4409 | f.push(8, 9, 0, 18); |
| 4410 | f.push(11, 12, 10, 24); |
| 4411 | f.push(14, 15, 13, 25); |
| 4412 | f.push(17, 18, 16, 26); |
| 4413 | c1s = 1; c1l = 7; c2s = 20; c2l = 6; |
| 4414 | break; |
caryclark | 55888e4 | 2016-07-18 10:01:36 -0700 | [diff] [blame] | 4415 | case INTERSECT_CONIC_QUAD_NO: |
| 4416 | c1s = 0; c1l = 7; c2s = 7; c2l = 6; |
| 4417 | break; |
caryclark | 1049f12 | 2015-04-20 08:31:59 -0700 | [diff] [blame] | 4418 | case INTERSECT_CONIC: |
| 4419 | f.push(8, 9, 0, 10); |
| 4420 | c1s = 1; c1l = 7; c2s = 11; c2l = 7; |
| 4421 | break; |
| 4422 | case INTERSECT_CONIC_2: |
| 4423 | f.push(8, 9, 0, 13); |
| 4424 | f.push(11, 12, 10, 21); |
| 4425 | c1s = 1; c1l = 7; c2s = 14; c2l = 7; |
| 4426 | break; |
| 4427 | case INTERSECT_CONIC_NO: |
| 4428 | c1s = 0; c1l = 7; c2s = 7; c2l = 7; |
| 4429 | break; |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 4430 | case INTERSECT_SELF_CUBIC: |
| 4431 | f.push(9, 10, 0, 11); |
| 4432 | c1s = 1; c1l = 8; c2s = 0; c2l = 0; |
| 4433 | break; |
| 4434 | case INTERSECT_SELF_CUBIC_NO: |
| 4435 | c1s = 0; c1l = 8; c2s = 0; c2l = 0; |
| 4436 | break; |
| 4437 | case INTERSECT_CUBIC_LINE: |
| 4438 | f.push(9, 10, 0, 11); |
| 4439 | c1s = 1; c1l = 8; c2s = 12; c2l = 4; |
| 4440 | break; |
| 4441 | case INTERSECT_CUBIC_LINE_2: |
| 4442 | f.push(9, 10, 0, 14); |
| 4443 | f.push(12, 13, 11, 19); |
| 4444 | c1s = 1; c1l = 8; c2s = 15; c2l = 4; |
| 4445 | break; |
| 4446 | case INTERSECT_CUBIC_LINE_3: |
| 4447 | f.push(9, 10, 0, 17); |
| 4448 | f.push(12, 13, 11, 22); |
| 4449 | f.push(15, 16, 14, 23); |
| 4450 | c1s = 1; c1l = 8; c2s = 18; c2l = 4; |
| 4451 | break; |
| 4452 | case INTERSECT_CUBIC_QUAD_NO: |
| 4453 | c1s = 0; c1l = 8; c2s = 8; c2l = 6; |
| 4454 | break; |
| 4455 | case INTERSECT_CUBIC_QUAD: |
| 4456 | f.push(9, 10, 0, 11); |
| 4457 | c1s = 1; c1l = 8; c2s = 12; c2l = 6; |
| 4458 | break; |
| 4459 | case INTERSECT_CUBIC_QUAD_2: |
| 4460 | f.push(9, 10, 0, 14); |
| 4461 | f.push(12, 13, 11, 21); |
| 4462 | c1s = 1; c1l = 8; c2s = 15; c2l = 6; |
| 4463 | break; |
| 4464 | case INTERSECT_CUBIC_QUAD_3: |
| 4465 | f.push(9, 10, 0, 17); |
| 4466 | f.push(12, 13, 11, 24); |
| 4467 | f.push(15, 16, 14, 25); |
| 4468 | c1s = 1; c1l = 8; c2s = 18; c2l = 6; |
| 4469 | break; |
| 4470 | case INTERSECT_CUBIC_QUAD_4: |
| 4471 | f.push(9, 10, 0, 20); |
| 4472 | f.push(12, 13, 11, 27); |
| 4473 | f.push(15, 16, 14, 28); |
| 4474 | f.push(18, 19, 17, 29); |
| 4475 | c1s = 1; c1l = 8; c2s = 21; c2l = 6; |
| 4476 | break; |
| 4477 | case INTERSECT_CUBIC_LINE_NO: |
| 4478 | c1s = 0; c1l = 8; c2s = 8; c2l = 4; |
| 4479 | break; |
| 4480 | case INTERSECT_CUBIC: |
| 4481 | f.push(9, 10, 0, 11); |
| 4482 | c1s = 1; c1l = 8; c2s = 12; c2l = 8; |
| 4483 | break; |
| 4484 | case INTERSECT_CUBIC_2: |
| 4485 | f.push(9, 10, 0, 14); |
| 4486 | f.push(12, 13, 11, 23); |
| 4487 | c1s = 1; c1l = 8; c2s = 15; c2l = 8; |
| 4488 | break; |
| 4489 | case INTERSECT_CUBIC_3: |
| 4490 | f.push(9, 10, 0, 17); |
| 4491 | f.push(12, 13, 11, 26); |
| 4492 | f.push(15, 16, 14, 27); |
| 4493 | c1s = 1; c1l = 8; c2s = 18; c2l = 8; |
| 4494 | break; |
| 4495 | case INTERSECT_CUBIC_4: |
| 4496 | f.push(9, 10, 0, 20); |
| 4497 | f.push(12, 13, 11, 29); |
| 4498 | f.push(15, 16, 14, 30); |
| 4499 | f.push(18, 19, 17, 31); |
| 4500 | c1s = 1; c1l = 8; c2s = 21; c2l = 8; |
| 4501 | break; |
| 4502 | case INTERSECT_CUBIC_NO: |
| 4503 | c1s = 0; c1l = 8; c2s = 8; c2l = 8; |
| 4504 | break; |
| 4505 | default: |
| 4506 | console.log("unknown REC_TYPE_SECT frag type: " + fragType); |
| 4507 | throw "stop execution"; |
| 4508 | } |
| 4509 | if (draw_intersection != 1) { |
| 4510 | var id = -1; |
| 4511 | var curve; |
| 4512 | switch (c1l) { |
caryclark | 55888e4 | 2016-07-18 10:01:36 -0700 | [diff] [blame] | 4513 | case 4: |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 4514 | drawLine(frags[c1s], frags[c1s + 1], frags[c1s + 2], frags[c1s + 3]); |
| 4515 | if (draw_id) { |
| 4516 | curve = [frags[c1s], frags[c1s + 1], frags[c1s + 2], frags[c1s + 3]]; |
| 4517 | id = idByCurve(test, curve, PATH_LINE); |
| 4518 | } |
| 4519 | break; |
| 4520 | case 6: |
| 4521 | drawQuad(frags[c1s], frags[c1s + 1], frags[c1s + 2], frags[c1s + 3], |
| 4522 | frags[c1s + 4], frags[c1s + 5]); |
| 4523 | if (draw_id) { |
| 4524 | curve = [frags[c1s], frags[c1s + 1], frags[c1s + 2], frags[c1s + 3], |
| 4525 | frags[c1s + 4], frags[c1s + 5]]; |
| 4526 | id = idByCurve(test, curve, PATH_QUAD); |
| 4527 | } |
| 4528 | break; |
caryclark | 1049f12 | 2015-04-20 08:31:59 -0700 | [diff] [blame] | 4529 | case 7: |
| 4530 | drawConicWithQuads(frags[c1s], frags[c1s + 1], frags[c1s + 2], frags[c1s + 3], |
| 4531 | frags[c1s + 4], frags[c1s + 5], frags[c1s + 6]); |
| 4532 | if (draw_id) { |
| 4533 | curve = [frags[c1s], frags[c1s + 1], frags[c1s + 2], frags[c1s + 3], |
| 4534 | frags[c1s + 4], frags[c1s + 5], frags[c1s + 6]]; |
| 4535 | id = idByCurve(test, curve, PATH_CONIC); |
| 4536 | } |
| 4537 | break; |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 4538 | case 8: |
| 4539 | drawCubic(frags[c1s], frags[c1s + 1], frags[c1s + 2], frags[c1s + 3], |
| 4540 | frags[c1s + 4], frags[c1s + 5], frags[c1s + 6], frags[c1s + 7]); |
| 4541 | if (draw_id) { |
| 4542 | curve = [frags[c1s], frags[c1s + 1], frags[c1s + 2], frags[c1s + 3], |
| 4543 | frags[c1s + 4], frags[c1s + 5], frags[c1s + 6], frags[c1s + 7]]; |
| 4544 | id = idByCurve(test, curve, PATH_CUBIC); |
| 4545 | } |
| 4546 | break; |
| 4547 | } |
| 4548 | if (id >= 0) { |
Cary Clark | ff11428 | 2016-12-14 11:56:16 -0500 | [diff] [blame^] | 4549 | drawVisibleID(curve, 0.5, id); |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 4550 | } |
| 4551 | id = -1; |
| 4552 | switch (c2l) { |
| 4553 | case 0: |
| 4554 | break; |
caryclark | 55888e4 | 2016-07-18 10:01:36 -0700 | [diff] [blame] | 4555 | case 4: |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 4556 | drawLine(frags[c2s], frags[c2s + 1], frags[c2s + 2], frags[c2s + 3]); |
| 4557 | if (draw_id) { |
| 4558 | curve = [frags[c2s], frags[c2s + 1], frags[c2s + 2], frags[c2s + 3]]; |
| 4559 | id = idByCurve(test, curve, PATH_LINE); |
| 4560 | } |
| 4561 | break; |
| 4562 | case 6: |
| 4563 | drawQuad(frags[c2s], frags[c2s + 1], frags[c2s + 2], frags[c2s + 3], |
| 4564 | frags[c2s + 4], frags[c2s + 5]); |
| 4565 | if (draw_id) { |
| 4566 | curve = [frags[c2s], frags[c2s + 1], frags[c2s + 2], frags[c2s + 3], |
| 4567 | frags[c2s + 4], frags[c2s + 5]]; |
| 4568 | id = idByCurve(test, curve, PATH_QUAD); |
| 4569 | } |
| 4570 | break; |
caryclark | 1049f12 | 2015-04-20 08:31:59 -0700 | [diff] [blame] | 4571 | case 7: |
| 4572 | drawConicWithQuads(frags[c2s], frags[c2s + 1], frags[c2s + 2], frags[c2s + 3], |
| 4573 | frags[c2s + 4], frags[c2s + 5], frags[c2s + 6]); |
| 4574 | if (draw_id) { |
| 4575 | curve = [frags[c2s], frags[c2s + 1], frags[c2s + 2], frags[c2s + 3], |
| 4576 | frags[c2s + 4], frags[c2s + 5], frags[c2s + 6]]; |
| 4577 | id = idByCurve(test, curve, PATH_CONIC); |
| 4578 | } |
| 4579 | break; |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 4580 | case 8: |
| 4581 | drawCubic(frags[c2s], frags[c2s + 1], frags[c2s + 2], frags[c2s + 3], |
| 4582 | frags[c2s + 4], frags[c2s + 5], frags[c2s + 6], frags[c2s + 7]); |
| 4583 | if (draw_id) { |
| 4584 | curve = [frags[c2s], frags[c2s + 1], frags[c2s + 2], frags[c2s + 3], |
| 4585 | frags[c2s + 4], frags[c2s + 5], frags[c2s + 6], frags[c2s + 7]]; |
| 4586 | id = idByCurve(test, curve, PATH_CUBIC); |
| 4587 | } |
| 4588 | break; |
| 4589 | } |
| 4590 | if (id >= 0) { |
Cary Clark | ff11428 | 2016-12-14 11:56:16 -0500 | [diff] [blame^] | 4591 | drawVisibleID(curve, 0.5, id); |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 4592 | } |
| 4593 | } |
| 4594 | if (collect_bounds) { |
| 4595 | break; |
| 4596 | } |
caryclark | 5435929 | 2015-03-26 07:52:43 -0700 | [diff] [blame] | 4597 | if (draw_intersection != 3 || step_limit == 0 || tIndex >= lastSect) { |
| 4598 | for (var idx = 0; idx < f.length; idx += 4) { |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 4599 | drawPoint(frags[f[idx]], frags[f[idx + 1]], true); |
| 4600 | } |
| 4601 | } |
| 4602 | if (!draw_intersectT) { |
| 4603 | break; |
| 4604 | } |
| 4605 | ctx.fillStyle = "red"; |
caryclark | 5435929 | 2015-03-26 07:52:43 -0700 | [diff] [blame] | 4606 | if (draw_intersection != 3 || step_limit == 0 || tIndex >= lastSect) { |
| 4607 | for (var idx = 0; idx < f.length; idx += 4) { |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 4608 | drawTAtPointUp(frags[f[idx]], frags[f[idx + 1]], frags[f[idx + 2]]); |
| 4609 | drawTAtPointDown(frags[f[idx]], frags[f[idx + 1]], frags[f[idx + 3]]); |
| 4610 | } |
| 4611 | } |
| 4612 | break; |
| 4613 | case REC_TYPE_SORT: |
| 4614 | if (!draw_sort || (step_limit > 0 && tIndex < lastSort)) { |
| 4615 | continue; |
| 4616 | } |
| 4617 | ctx.lineWidth = 3; |
| 4618 | ctx.strokeStyle = "rgba(127,127,0, 0.5)"; |
| 4619 | focus_enabled = true; |
| 4620 | switch (fragType) { |
| 4621 | case SORT_UNARY: |
| 4622 | case SORT_BINARY: |
| 4623 | var curve = curvePartialByID(test, frags[0], frags[6], frags[8]); |
| 4624 | drawCurve(curve); |
| 4625 | break; |
| 4626 | default: |
| 4627 | console.log("unknown REC_TYPE_SORT frag type: " + fragType); |
| 4628 | throw "stop execution"; |
| 4629 | } |
| 4630 | break; |
caryclark | 03b03ca | 2015-04-23 09:13:37 -0700 | [diff] [blame] | 4631 | case REC_TYPE_TOP: |
| 4632 | if (!draw_top || (step_limit > 0 && tIndex < lastTop)) { |
| 4633 | continue; |
| 4634 | } |
| 4635 | ctx.lineWidth = 3; |
| 4636 | ctx.strokeStyle = "rgba(127,127,0, 0.5)"; |
| 4637 | focus_enabled = true; |
| 4638 | { |
| 4639 | var curve = curvePartialByID(test, frags[0], frags[1], frags[2]); |
| 4640 | drawCurve(curve); |
| 4641 | var type = PATH_LINE + (curve.length / 2 - 2); |
| 4642 | var mid = pointAtT(curve, type, 0.5); |
| 4643 | var d = dxy_at_t(curve, type, 0.5); |
| 4644 | drawArrow(mid.x, mid.y, d.x, d.y, 0.3); |
| 4645 | } |
| 4646 | break; |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 4647 | case REC_TYPE_MARK: |
| 4648 | if (!draw_mark || (step_limit > 0 && tIndex < lastMark)) { |
| 4649 | continue; |
| 4650 | } |
| 4651 | ctx.lineWidth = 3; |
| 4652 | ctx.strokeStyle = fragType >= MARK_DONE_LINE ? |
| 4653 | "rgba(127,0,127, 0.5)" : "rgba(127,127,0, 0.5)"; |
| 4654 | focus_enabled = true; |
| 4655 | switch (fragType) { |
| 4656 | case MARK_LINE: |
| 4657 | case MARK_DONE_LINE: |
| 4658 | case MARK_UNSORTABLE_LINE: |
| 4659 | case MARK_SIMPLE_LINE: |
| 4660 | case MARK_SIMPLE_DONE_LINE: |
| 4661 | case MARK_DONE_UNARY_LINE: |
| 4662 | drawLinePartial(frags[1], frags[2], frags[3], frags[4], |
| 4663 | frags[5], frags[9]); |
| 4664 | if (draw_id) { |
| 4665 | drawLinePartialID(frags[0], frags[1], frags[2], frags[3], frags[4], |
| 4666 | frags[5], frags[9]); |
| 4667 | } |
| 4668 | break; |
| 4669 | case MARK_QUAD: |
| 4670 | case MARK_DONE_QUAD: |
| 4671 | case MARK_UNSORTABLE_QUAD: |
| 4672 | case MARK_SIMPLE_QUAD: |
| 4673 | case MARK_SIMPLE_DONE_QUAD: |
| 4674 | case MARK_DONE_UNARY_QUAD: |
| 4675 | drawQuadPartial(frags[1], frags[2], frags[3], frags[4], |
| 4676 | frags[5], frags[6], frags[7], frags[11]); |
| 4677 | if (draw_id) { |
| 4678 | drawQuadPartialID(frags[0], frags[1], frags[2], frags[3], frags[4], |
| 4679 | frags[5], frags[6], frags[7], frags[11]); |
| 4680 | } |
| 4681 | break; |
| 4682 | case MARK_CUBIC: |
| 4683 | case MARK_DONE_CUBIC: |
| 4684 | case MARK_UNSORTABLE_CUBIC: |
| 4685 | case MARK_SIMPLE_CUBIC: |
| 4686 | case MARK_SIMPLE_DONE_CUBIC: |
| 4687 | case MARK_DONE_UNARY_CUBIC: |
| 4688 | drawCubicPartial(frags[1], frags[2], frags[3], frags[4], |
| 4689 | frags[5], frags[6], frags[7], frags[8], frags[9], frags[13]); |
| 4690 | if (draw_id) { |
| 4691 | drawCubicPartialID(frags[0], frags[1], frags[2], frags[3], frags[4], |
| 4692 | frags[5], frags[6], frags[7], frags[8], frags[9], frags[13]); |
| 4693 | } |
| 4694 | break; |
| 4695 | case MARK_ANGLE_LAST: |
| 4696 | // FIXME: ignored for now |
| 4697 | break; |
| 4698 | default: |
| 4699 | console.log("unknown REC_TYPE_MARK frag type: " + fragType); |
| 4700 | throw "stop execution"; |
| 4701 | } |
| 4702 | break; |
| 4703 | default: |
| 4704 | continue; |
| 4705 | } |
| 4706 | } |
| 4707 | switch (recType) { |
| 4708 | case REC_TYPE_SORT: |
| 4709 | if (!draw_sort || (step_limit > 0 && tIndex < lastSort)) { |
| 4710 | break; |
| 4711 | } |
| 4712 | var angles = []; // use tangent lines to describe arcs |
| 4713 | var windFrom = []; |
| 4714 | var windTo = []; |
| 4715 | var opp = []; |
| 4716 | var minXY = Number.MAX_VALUE; |
| 4717 | var partial; |
| 4718 | focus_enabled = true; |
| 4719 | var someUnsortable = false; |
| 4720 | for (var recordIndex = 0; recordIndex < records.length; recordIndex += 2) { |
| 4721 | var fragType = records[recordIndex]; |
| 4722 | var frags = records[recordIndex + 1]; |
| 4723 | var unsortable = (fragType == SORT_UNARY && frags[14]) || |
| 4724 | (fragType == SORT_BINARY && frags[16]); |
| 4725 | someUnsortable |= unsortable; |
| 4726 | switch (fragType) { |
| 4727 | case SORT_UNARY: |
| 4728 | case SORT_BINARY: |
| 4729 | partial = curvePartialByID(test, frags[0], frags[6], frags[8]); |
| 4730 | break; |
| 4731 | default: |
| 4732 | console.log("unknown REC_TYPE_SORT frag type: " + fragType); |
| 4733 | throw "stop execution"; |
| 4734 | } |
| 4735 | var dx = boundsWidth(partial); |
| 4736 | var dy = boundsHeight(partial); |
| 4737 | minXY = Math.min(minXY, dx * dx + dy * dy); |
| 4738 | if (collect_bounds) { |
| 4739 | continue; |
| 4740 | } |
| 4741 | angles.push(tangent(partial)); |
| 4742 | var from = frags[12]; |
| 4743 | var to = frags[12]; |
| 4744 | var sgn = frags[10]; |
| 4745 | if (sgn < 0) { |
| 4746 | from -= frags[11]; |
| 4747 | } else if (sgn > 0) { |
| 4748 | to -= frags[11]; |
| 4749 | } |
| 4750 | windFrom.push(from + (unsortable ? "!" : "")); |
| 4751 | windTo.push(to + (unsortable ? "!" : "")); |
| 4752 | opp.push(fragType == SORT_BINARY); |
| 4753 | if (draw_sort == 1) { |
Cary Clark | ff11428 | 2016-12-14 11:56:16 -0500 | [diff] [blame^] | 4754 | drawVisibleOrder(partial, frags[12]); |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 4755 | } else { |
Cary Clark | ff11428 | 2016-12-14 11:56:16 -0500 | [diff] [blame^] | 4756 | drawVisibleOrder(partial, (recordIndex / 2) + 1); |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 4757 | } |
| 4758 | } |
| 4759 | var radius = Math.sqrt(minXY) / 2 * scale; |
| 4760 | radius = Math.min(50, radius); |
| 4761 | var scaledRadius = radius / scale; |
| 4762 | var centerX = partial[0]; |
| 4763 | var centerY = partial[1]; |
| 4764 | if (collect_bounds) { |
| 4765 | if (focus_enabled) { |
| 4766 | focusXmin = Math.min(focusXmin, centerX - scaledRadius); |
| 4767 | focusYmin = Math.min(focusYmin, centerY - scaledRadius); |
| 4768 | focusXmax = Math.max(focusXmax, centerX + scaledRadius); |
| 4769 | focusYmax = Math.max(focusYmax, centerY + scaledRadius); |
| 4770 | } |
| 4771 | break; |
| 4772 | } |
| 4773 | break; |
| 4774 | default: |
| 4775 | break; |
| 4776 | } |
| 4777 | } |
| 4778 | if (collect_bounds) { |
| 4779 | return; |
| 4780 | } |
| 4781 | if (draw_log && logStart >= 0) { |
| 4782 | ctx.font = "normal 10px Arial"; |
| 4783 | ctx.textAlign = "left"; |
| 4784 | ctx.beginPath(); |
| 4785 | var top = screenHeight - 20 - (logRange + 2) * 10; |
| 4786 | ctx.rect(50, top, screenWidth - 100, (logRange + 2) * 10); |
| 4787 | ctx.fillStyle = "white"; |
| 4788 | ctx.fill(); |
| 4789 | ctx.fillStyle = "rgba(0,0,0, 0.5)"; |
| 4790 | if (logStart > 0) { |
| 4791 | ctx.fillText(lines[logStart - 1], 50, top + 8); |
| 4792 | } |
| 4793 | ctx.fillStyle = "black"; |
| 4794 | for (var idx = 0; idx < logRange; ++idx) { |
| 4795 | ctx.fillText(lines[logStart + idx], 50, top + 18 + 10 * idx); |
| 4796 | } |
| 4797 | ctx.fillStyle = "rgba(0,0,0, 0.5)"; |
| 4798 | if (logStart + logRange < lines.length) { |
| 4799 | ctx.fillText(lines[logStart + logRange], 50, top + 18 + 10 * logRange); |
| 4800 | } |
| 4801 | } |
| 4802 | if (draw_legend) { |
| 4803 | var pos = 0; |
caryclark | 624637c | 2015-05-11 07:21:27 -0700 | [diff] [blame] | 4804 | var drawSomething = draw_add | draw_active | draw_angle | draw_coincidence | draw_sort | draw_mark; |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 4805 | // drawBox(pos++, "yellow", "black", opLetter, true, ''); |
| 4806 | drawBox(pos++, "rgba(0,0,255, 0.3)", "black", draw_intersection > 1 ? sectCount : sectMax2, draw_intersection, intersectionKey); |
| 4807 | drawBox(pos++, "rgba(0,0,255, 0.3)", "black", draw_add ? addCount : addMax, draw_add, addKey); |
| 4808 | drawBox(pos++, "rgba(0,0,255, 0.3)", "black", draw_active ? activeCount : activeMax, draw_active, activeKey); |
| 4809 | drawBox(pos++, "rgba(127,127,0, 0.3)", "black", draw_angle ? angleCount : angleMax, draw_angle, angleKey); |
caryclark | 624637c | 2015-05-11 07:21:27 -0700 | [diff] [blame] | 4810 | drawBox(pos++, "rgba(127,127,0, 0.3)", "black", draw_coincidence ? coinCount : coinMax, draw_coincidence, coincidenceKey); |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 4811 | drawBox(pos++, "rgba(127,127,0, 0.3)", "black", draw_op ? opCount : opMax, draw_op, opKey); |
| 4812 | drawBox(pos++, "rgba(127,127,0, 0.3)", "black", draw_sort ? sortCount : sortMax, draw_sort, sortKey); |
caryclark | 03b03ca | 2015-04-23 09:13:37 -0700 | [diff] [blame] | 4813 | drawBox(pos++, "rgba(127,127,0, 0.3)", "black", draw_top ? topCount : topMax, draw_top, topKey); |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 4814 | drawBox(pos++, "rgba(127,0,127, 0.3)", "black", draw_mark ? markCount : markMax, draw_mark, markKey); |
caryclark | 55888e4 | 2016-07-18 10:01:36 -0700 | [diff] [blame] | 4815 | drawBox(pos++, "black", "white", |
caryclark | 26ad22a | 2015-10-16 09:03:38 -0700 | [diff] [blame] | 4816 | (new Array('P', 'P1', 'P2', 'P', 'p', 'p1', 'p2'))[draw_path], draw_path != 0, pathKey); |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 4817 | drawBox(pos++, "rgba(0,63,0, 0.7)", "white", |
| 4818 | (new Array('Q', 'Q', 'C', 'QC', 'Qc', 'Cq'))[draw_computed], |
| 4819 | draw_computed != 0, computedKey); |
| 4820 | drawBox(pos++, "green", "black", step_limit, drawSomething, ''); |
| 4821 | drawBox(pos++, "green", "black", stepMax, drawSomething, ''); |
| 4822 | drawBox(pos++, "rgba(255,0,0, 0.6)", "black", lastIndex, drawSomething & draw_log, ''); |
| 4823 | drawBox(pos++, "rgba(255,0,0, 0.6)", "black", test.length - 1, drawSomething & draw_log, ''); |
| 4824 | if (curve_t) { |
| 4825 | drawCurveTControl(); |
| 4826 | } |
| 4827 | ctx.font = "normal 20px Arial"; |
| 4828 | ctx.fillStyle = "rgba(0,0,0, 0.3)"; |
| 4829 | ctx.textAlign = "right"; |
| 4830 | ctx.fillText(scale.toFixed(decimal_places) + 'x' , screenWidth - 10, screenHeight - 5); |
| 4831 | } |
| 4832 | if (draw_hints) { |
| 4833 | ctx.font = "normal 10px Arial"; |
| 4834 | ctx.fillStyle = "rgba(0,0,0, 0.5)"; |
| 4835 | ctx.textAlign = "right"; |
| 4836 | var y = 4; |
| 4837 | ctx.fillText("control lines : " + controlLinesKey, ctx.screenWidthwidth - 10, pos * 50 + y++ * 10); |
| 4838 | ctx.fillText("curve t : " + curveTKey, screenWidth - 10, pos * 50 + y++ * 10); |
| 4839 | ctx.fillText("deriviatives : " + deriviativesKey, screenWidth - 10, pos * 50 + y++ * 10); |
| 4840 | ctx.fillText("intersect t : " + intersectTKey, screenWidth - 10, pos * 50 + y++ * 10); |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 4841 | ctx.fillText("log : " + logKey, screenWidth - 10, pos * 50 + y++ * 10); |
| 4842 | ctx.fillText("log curve : " + logCurvesKey, screenWidth - 10, pos * 50 + y++ * 10); |
| 4843 | ctx.fillText("mid point : " + midpointKey, screenWidth - 10, pos * 50 + y++ * 10); |
| 4844 | ctx.fillText("points : " + ptsKey, screenWidth - 10, pos * 50 + y++ * 10); |
| 4845 | ctx.fillText("sequence : " + sequenceKey, screenWidth - 10, pos * 50 + y++ * 10); |
| 4846 | ctx.fillText("xy : " + xyKey, screenWidth - 10, pos * 50 + y++ * 10); |
| 4847 | } |
| 4848 | } |
| 4849 | |
| 4850 | function drawBox(y, backC, foreC, str, enable, label) { |
| 4851 | ctx.beginPath(); |
| 4852 | ctx.fillStyle = backC; |
| 4853 | ctx.rect(screenWidth - 40, y * 50 + 10, 40, 30); |
| 4854 | ctx.fill(); |
| 4855 | ctx.font = "normal 16px Arial"; |
| 4856 | ctx.fillStyle = foreC; |
| 4857 | ctx.textAlign = "center"; |
| 4858 | ctx.fillText(str, screenWidth - 20, y * 50 + 32); |
| 4859 | if (!enable) { |
| 4860 | ctx.fillStyle = "rgba(255,255,255, 0.5)"; |
| 4861 | ctx.fill(); |
| 4862 | } |
| 4863 | if (label != '') { |
| 4864 | ctx.font = "normal 9px Arial"; |
| 4865 | ctx.fillStyle = "black"; |
| 4866 | ctx.fillText(label, screenWidth - 47, y * 50 + 40); |
| 4867 | } |
| 4868 | } |
| 4869 | |
| 4870 | function drawCurveTControl() { |
| 4871 | ctx.lineWidth = 2; |
| 4872 | ctx.strokeStyle = "rgba(0,0,0, 0.3)"; |
| 4873 | ctx.beginPath(); |
| 4874 | ctx.rect(screenWidth - 80, 40, 28, screenHeight - 80); |
| 4875 | ctx.stroke(); |
| 4876 | var ty = 40 + curveT * (screenHeight - 80); |
| 4877 | ctx.beginPath(); |
| 4878 | ctx.moveTo(screenWidth - 80, ty); |
| 4879 | ctx.lineTo(screenWidth - 85, ty - 5); |
| 4880 | ctx.lineTo(screenWidth - 85, ty + 5); |
| 4881 | ctx.lineTo(screenWidth - 80, ty); |
| 4882 | ctx.fillStyle = "rgba(0,0,0, 0.6)"; |
| 4883 | ctx.fill(); |
| 4884 | var num = curveT.toFixed(decimal_places); |
| 4885 | ctx.font = "normal 10px Arial"; |
| 4886 | ctx.textAlign = "left"; |
| 4887 | ctx.fillText(num, screenWidth - 78, ty); |
| 4888 | } |
| 4889 | |
| 4890 | function ptInTControl() { |
| 4891 | var e = window.event; |
caryclark | 55888e4 | 2016-07-18 10:01:36 -0700 | [diff] [blame] | 4892 | var tgt = e.target || e.srcElement; |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 4893 | var left = tgt.offsetLeft; |
| 4894 | var top = tgt.offsetTop; |
| 4895 | var x = (e.clientX - left); |
| 4896 | var y = (e.clientY - top); |
| 4897 | if (x < screenWidth - 80 || x > screenWidth - 50) { |
| 4898 | return false; |
| 4899 | } |
| 4900 | if (y < 40 || y > screenHeight - 80) { |
| 4901 | return false; |
| 4902 | } |
| 4903 | curveT = (y - 40) / (screenHeight - 120); |
| 4904 | if (curveT < 0 || curveT > 1) { |
| 4905 | throw "stop execution"; |
| 4906 | } |
| 4907 | return true; |
| 4908 | } |
| 4909 | |
| 4910 | function drawTop() { |
| 4911 | if (tests[testIndex] == null) { |
| 4912 | var str = testDivs[testIndex].textContent; |
| 4913 | parse_all(str); |
| 4914 | var title = testDivs[testIndex].id.toString(); |
| 4915 | testTitles[testIndex] = title; |
| 4916 | } |
| 4917 | init(tests[testIndex]); |
| 4918 | redraw(); |
| 4919 | } |
| 4920 | |
| 4921 | function redraw() { |
| 4922 | if (focus_on_selection) { |
| 4923 | collect_bounds = true; |
| 4924 | draw(tests[testIndex], testLines[testIndex], testTitles[testIndex]); |
| 4925 | collect_bounds = false; |
| 4926 | if (focusXmin < focusXmax && focusYmin < focusYmax) { |
| 4927 | setScale(focusXmin, focusXmax, focusYmin, focusYmax); |
| 4928 | } |
| 4929 | } |
| 4930 | ctx.beginPath(); |
| 4931 | ctx.fillStyle = "white"; |
| 4932 | ctx.rect(0, 0, screenWidth, screenHeight); |
| 4933 | ctx.fill(); |
| 4934 | draw(tests[testIndex], testLines[testIndex], testTitles[testIndex]); |
| 4935 | } |
| 4936 | |
| 4937 | function dumpCurvePartial(test, id, t0, t1) { |
| 4938 | var curve = curveByID(test, id); |
| 4939 | var name = ["line", "quad", "cubic"][curve.length / 2 - 2]; |
| 4940 | console.log("id=" + id + " " + name + "=" + curveToString(curve) |
| 4941 | + " t0=" + t0 + " t1=" + t1 |
| 4942 | + " partial=" + curveToString(curvePartialByID(test, id, t0, t1))); |
| 4943 | } |
| 4944 | |
| 4945 | function dumpAngleTest(test, id, t0, t1) { |
| 4946 | var curve = curveByID(test, id); |
caryclark | 55888e4 | 2016-07-18 10:01:36 -0700 | [diff] [blame] | 4947 | console.log(" { {" + curveToString(curve) + "}, " |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 4948 | + curve.length / 2 + ", " + t0 + ", " + t1 + ", {} }, //"); |
| 4949 | } |
| 4950 | |
| 4951 | function dumpLogToConsole() { |
| 4952 | if (logStart < 0) { |
| 4953 | return; |
| 4954 | } |
| 4955 | var test = tests[testIndex]; |
| 4956 | var recType = REC_TYPE_UNKNOWN; |
| 4957 | var records; |
| 4958 | for (var index = 0; index < test.length; index += 3) { |
| 4959 | var lastLineNo = test[index + 1]; |
| 4960 | if (lastLineNo >= logStart && lastLineNo < logStart + logRange) { |
| 4961 | recType = test[index]; |
| 4962 | records = test[index + 2]; |
| 4963 | break; |
| 4964 | } |
| 4965 | } |
| 4966 | if (recType == REC_TYPE_UNKNOWN) { |
| 4967 | return; |
| 4968 | } |
| 4969 | var lines = testLines[testIndex]; |
| 4970 | for (var idx = 0; idx < logRange; ++idx) { |
| 4971 | var line = lines[logStart + idx]; |
| 4972 | console.log(line); |
| 4973 | for (var recordIndex = 0; recordIndex < records.length; recordIndex += 2) { |
| 4974 | var fragType = records[recordIndex]; |
| 4975 | var frags = records[recordIndex + 1]; |
| 4976 | if (recType == REC_TYPE_ANGLE && fragType == ANGLE_AFTER) { |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 4977 | dumpCurvePartial(test, frags[0], frags[4], frags[5]); |
| 4978 | dumpCurvePartial(test, frags[6], frags[10], frags[11]); |
| 4979 | dumpCurvePartial(test, frags[12], frags[16], frags[17]); |
| 4980 | console.log("\nstatic IntersectData intersectDataSet[] = { //"); |
| 4981 | dumpAngleTest(test, frags[0], frags[4], frags[5]); |
| 4982 | dumpAngleTest(test, frags[6], frags[10], frags[11]); |
| 4983 | dumpAngleTest(test, frags[12], frags[16], frags[17]); |
| 4984 | console.log("}; //"); |
| 4985 | } |
| 4986 | } |
| 4987 | } |
| 4988 | } |
| 4989 | |
| 4990 | var activeKey = 'a'; |
| 4991 | var pathKey = 'b'; |
| 4992 | var pathBackKey = 'B'; |
| 4993 | var centerKey = 'c'; |
caryclark | 624637c | 2015-05-11 07:21:27 -0700 | [diff] [blame] | 4994 | var coincidenceKey = 'C'; |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 4995 | var addKey = 'd'; |
| 4996 | var deriviativesKey = 'f'; |
| 4997 | var angleKey = 'g'; |
| 4998 | var angleBackKey = 'G'; |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 4999 | var intersectionKey = 'i'; |
| 5000 | var intersectionBackKey = 'I'; |
| 5001 | var sequenceKey = 'j'; |
| 5002 | var midpointKey = 'k'; |
| 5003 | var logKey = 'l'; |
| 5004 | var logToConsoleKey = 'L'; |
| 5005 | var markKey = 'm'; |
| 5006 | var sortKey = 'o'; |
| 5007 | var opKey = 'p'; |
| 5008 | var opBackKey = 'P'; |
| 5009 | var computedKey = 'q'; |
| 5010 | var computedBackKey = 'Q'; |
Cary Clark | ff11428 | 2016-12-14 11:56:16 -0500 | [diff] [blame^] | 5011 | var directionKey = 'r'; |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 5012 | var stepKey = 's'; |
| 5013 | var stepBackKey = 'S'; |
| 5014 | var intersectTKey = 't'; |
caryclark | 03b03ca | 2015-04-23 09:13:37 -0700 | [diff] [blame] | 5015 | var topKey = 'T'; |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 5016 | var curveTKey = 'u'; |
| 5017 | var controlLinesBackKey = 'V'; |
| 5018 | var controlLinesKey = 'v'; |
| 5019 | var ptsKey = 'x'; |
| 5020 | var xyKey = 'y'; |
| 5021 | var logCurvesKey = 'z'; |
| 5022 | var focusKey = '`'; |
| 5023 | var idKey = '.'; |
| 5024 | var retinaKey = '\\'; |
| 5025 | |
| 5026 | function doKeyPress(evt) { |
| 5027 | var char = String.fromCharCode(evt.charCode); |
| 5028 | var focusWasOn = false; |
| 5029 | switch (char) { |
| 5030 | case '0': |
| 5031 | case '1': |
| 5032 | case '2': |
| 5033 | case '3': |
| 5034 | case '4': |
| 5035 | case '5': |
| 5036 | case '6': |
| 5037 | case '7': |
| 5038 | case '8': |
| 5039 | case '9': |
| 5040 | decimal_places = char - '0'; |
| 5041 | redraw(); |
| 5042 | break; |
| 5043 | case activeKey: |
| 5044 | draw_active ^= true; |
caryclark | 55888e4 | 2016-07-18 10:01:36 -0700 | [diff] [blame] | 5045 | redraw(); |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 5046 | break; |
| 5047 | case addKey: |
| 5048 | draw_add ^= true; |
caryclark | 55888e4 | 2016-07-18 10:01:36 -0700 | [diff] [blame] | 5049 | redraw(); |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 5050 | break; |
| 5051 | case angleKey: |
caryclark | 5435929 | 2015-03-26 07:52:43 -0700 | [diff] [blame] | 5052 | draw_angle = (draw_angle + 1) % 4; |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 5053 | redraw(); |
| 5054 | break; |
| 5055 | case angleBackKey: |
| 5056 | draw_angle = (draw_angle + 2) % 3; |
| 5057 | redraw(); |
| 5058 | break; |
| 5059 | case centerKey: |
| 5060 | setScale(xmin, xmax, ymin, ymax); |
caryclark | 55888e4 | 2016-07-18 10:01:36 -0700 | [diff] [blame] | 5061 | redraw(); |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 5062 | break; |
caryclark | 624637c | 2015-05-11 07:21:27 -0700 | [diff] [blame] | 5063 | case coincidenceKey: |
| 5064 | draw_coincidence ^= true; |
| 5065 | redraw(); |
| 5066 | break; |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 5067 | case controlLinesBackKey: |
| 5068 | control_lines = (control_lines + 3) % 4; |
caryclark | 55888e4 | 2016-07-18 10:01:36 -0700 | [diff] [blame] | 5069 | redraw(); |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 5070 | break; |
| 5071 | case controlLinesKey: |
| 5072 | control_lines = (control_lines + 1) % 4; |
caryclark | 55888e4 | 2016-07-18 10:01:36 -0700 | [diff] [blame] | 5073 | redraw(); |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 5074 | break; |
| 5075 | case computedBackKey: |
| 5076 | draw_computed = (draw_computed + 5) % 6; |
caryclark | 55888e4 | 2016-07-18 10:01:36 -0700 | [diff] [blame] | 5077 | redraw(); |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 5078 | break; |
| 5079 | case computedKey: |
| 5080 | draw_computed = (draw_computed + 1) % 6; |
caryclark | 55888e4 | 2016-07-18 10:01:36 -0700 | [diff] [blame] | 5081 | redraw(); |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 5082 | break; |
| 5083 | case curveTKey: |
| 5084 | curve_t ^= true; |
| 5085 | if (curve_t) { |
| 5086 | draw_legend = true; |
| 5087 | } |
| 5088 | redraw(); |
| 5089 | break; |
| 5090 | case deriviativesKey: |
| 5091 | draw_deriviatives = (draw_deriviatives + 1) % 3; |
| 5092 | redraw(); |
| 5093 | break; |
Cary Clark | ff11428 | 2016-12-14 11:56:16 -0500 | [diff] [blame^] | 5094 | case directionKey: |
| 5095 | draw_direction ^= true; |
| 5096 | redraw(); |
| 5097 | break; |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 5098 | case focusKey: |
| 5099 | focus_on_selection ^= true; |
| 5100 | setScale(xmin, xmax, ymin, ymax); |
| 5101 | redraw(); |
| 5102 | break; |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 5103 | case idKey: |
| 5104 | draw_id ^= true; |
| 5105 | redraw(); |
| 5106 | break; |
| 5107 | case intersectionBackKey: |
| 5108 | draw_intersection = (draw_intersection + 3) % 4; |
caryclark | 55888e4 | 2016-07-18 10:01:36 -0700 | [diff] [blame] | 5109 | redraw(); |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 5110 | break; |
| 5111 | case intersectionKey: |
| 5112 | draw_intersection = (draw_intersection + 1) % 4; |
caryclark | 55888e4 | 2016-07-18 10:01:36 -0700 | [diff] [blame] | 5113 | redraw(); |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 5114 | break; |
| 5115 | case intersectTKey: |
| 5116 | draw_intersectT ^= true; |
| 5117 | redraw(); |
| 5118 | break; |
| 5119 | case logCurvesKey: |
| 5120 | logCurves(tests[testIndex]); |
| 5121 | break; |
| 5122 | case logKey: |
| 5123 | draw_log ^= true; |
| 5124 | redraw(); |
| 5125 | break; |
| 5126 | case logToConsoleKey: |
| 5127 | if (draw_log) { |
| 5128 | dumpLogToConsole(); |
| 5129 | } |
| 5130 | break; |
| 5131 | case markKey: |
| 5132 | draw_mark ^= true; |
| 5133 | redraw(); |
| 5134 | break; |
| 5135 | case midpointKey: |
| 5136 | draw_midpoint ^= true; |
| 5137 | redraw(); |
| 5138 | break; |
| 5139 | case opKey: |
| 5140 | draw_op = (draw_op + 1) % 3; |
| 5141 | redraw(); |
| 5142 | break; |
| 5143 | case opBackKey: |
| 5144 | draw_op = (draw_op + 2) % 3; |
| 5145 | redraw(); |
| 5146 | break; |
| 5147 | case pathKey: |
caryclark | 26ad22a | 2015-10-16 09:03:38 -0700 | [diff] [blame] | 5148 | draw_path = (draw_path + 1) % (4 + (hasAlignedPath ? 3 : 0)); |
caryclark | 55888e4 | 2016-07-18 10:01:36 -0700 | [diff] [blame] | 5149 | redraw(); |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 5150 | break; |
| 5151 | case pathBackKey: |
caryclark | 26ad22a | 2015-10-16 09:03:38 -0700 | [diff] [blame] | 5152 | draw_path = (draw_path + 3 + (hasAlignedPath ? 3 : 0)) % (4 + (hasAlignedPath ? 3 : 0)); |
caryclark | 55888e4 | 2016-07-18 10:01:36 -0700 | [diff] [blame] | 5153 | redraw(); |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 5154 | break; |
| 5155 | case ptsKey: |
| 5156 | pt_labels = (pt_labels + 1) % 3; |
| 5157 | redraw(); |
| 5158 | break; |
| 5159 | case retinaKey: |
| 5160 | retina_scale ^= true; |
| 5161 | drawTop(); |
| 5162 | break; |
| 5163 | case sequenceKey: |
| 5164 | draw_sequence ^= true; |
| 5165 | redraw(); |
| 5166 | break; |
| 5167 | case sortKey: |
| 5168 | draw_sort = (draw_sort + 1) % 3; |
| 5169 | drawTop(); |
| 5170 | break; |
| 5171 | case stepKey: |
| 5172 | step_limit++; |
| 5173 | if (step_limit > stepMax) { |
| 5174 | step_limit = stepMax; |
| 5175 | } |
| 5176 | redraw(); |
| 5177 | break; |
| 5178 | case stepBackKey: |
| 5179 | step_limit--; |
| 5180 | if (step_limit < 0) { |
| 5181 | step_limit = 0; |
| 5182 | } |
| 5183 | redraw(); |
| 5184 | break; |
caryclark | 03b03ca | 2015-04-23 09:13:37 -0700 | [diff] [blame] | 5185 | case topKey: |
| 5186 | draw_top ^= true; |
| 5187 | redraw(); |
| 5188 | break; |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 5189 | case xyKey: |
| 5190 | debug_xy = (debug_xy + 1) % 3; |
| 5191 | redraw(); |
| 5192 | break; |
| 5193 | case '-': |
| 5194 | focusWasOn = focus_on_selection; |
| 5195 | if (focusWasOn) { |
| 5196 | focus_on_selection = false; |
| 5197 | scale /= 1.2; |
| 5198 | } else { |
| 5199 | scale /= 2; |
| 5200 | calcLeftTop(); |
| 5201 | } |
| 5202 | redraw(); |
| 5203 | focus_on_selection = focusWasOn; |
| 5204 | break; |
| 5205 | case '=': |
| 5206 | case '+': |
| 5207 | focusWasOn = focus_on_selection; |
| 5208 | if (focusWasOn) { |
| 5209 | focus_on_selection = false; |
| 5210 | scale *= 1.2; |
| 5211 | } else { |
| 5212 | scale *= 2; |
| 5213 | calcLeftTop(); |
| 5214 | } |
| 5215 | redraw(); |
| 5216 | focus_on_selection = focusWasOn; |
| 5217 | break; |
| 5218 | case '?': |
| 5219 | draw_hints ^= true; |
| 5220 | if (draw_hints && !draw_legend) { |
| 5221 | draw_legend = true; |
| 5222 | } |
| 5223 | redraw(); |
| 5224 | break; |
| 5225 | case '/': |
| 5226 | draw_legend ^= true; |
| 5227 | redraw(); |
| 5228 | break; |
| 5229 | } |
| 5230 | } |
| 5231 | |
| 5232 | function doKeyDown(evt) { |
| 5233 | var char = evt.keyCode; |
| 5234 | var preventDefault = false; |
| 5235 | switch (char) { |
| 5236 | case 37: // left arrow |
| 5237 | if (evt.shiftKey) { |
| 5238 | testIndex -= 9; |
| 5239 | } |
| 5240 | if (--testIndex < 0) |
| 5241 | testIndex = tests.length - 1; |
| 5242 | drawTop(); |
| 5243 | preventDefault = true; |
| 5244 | break; |
| 5245 | case 39: // right arrow |
| 5246 | if (evt.shiftKey) { |
| 5247 | testIndex += 9; |
| 5248 | } |
| 5249 | if (++testIndex >= tests.length) |
| 5250 | testIndex = 0; |
| 5251 | drawTop(); |
| 5252 | preventDefault = true; |
| 5253 | break; |
| 5254 | } |
| 5255 | if (preventDefault) { |
| 5256 | evt.preventDefault(); |
| 5257 | return false; |
| 5258 | } |
| 5259 | return true; |
| 5260 | } |
| 5261 | |
| 5262 | (function() { |
| 5263 | var hidden = "hidden"; |
| 5264 | |
| 5265 | // Standards: |
| 5266 | if (hidden in document) |
| 5267 | document.addEventListener("visibilitychange", onchange); |
| 5268 | else if ((hidden = "mozHidden") in document) |
| 5269 | document.addEventListener("mozvisibilitychange", onchange); |
| 5270 | else if ((hidden = "webkitHidden") in document) |
| 5271 | document.addEventListener("webkitvisibilitychange", onchange); |
| 5272 | else if ((hidden = "msHidden") in document) |
| 5273 | document.addEventListener("msvisibilitychange", onchange); |
| 5274 | // IE 9 and lower: |
| 5275 | else if ('onfocusin' in document) |
| 5276 | document.onfocusin = document.onfocusout = onchange; |
| 5277 | // All others: |
| 5278 | else |
caryclark | 55888e4 | 2016-07-18 10:01:36 -0700 | [diff] [blame] | 5279 | window.onpageshow = window.onpagehide |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 5280 | = window.onfocus = window.onblur = onchange; |
| 5281 | |
| 5282 | function onchange (evt) { |
| 5283 | var v = 'visible', h = 'hidden', |
caryclark | 55888e4 | 2016-07-18 10:01:36 -0700 | [diff] [blame] | 5284 | evtMap = { |
| 5285 | focus:v, focusin:v, pageshow:v, blur:h, focusout:h, pagehide:h |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 5286 | }; |
| 5287 | |
| 5288 | evt = evt || window.event; |
| 5289 | if (evt.type in evtMap) |
| 5290 | document.body.className = evtMap[evt.type]; |
caryclark | 55888e4 | 2016-07-18 10:01:36 -0700 | [diff] [blame] | 5291 | else |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 5292 | document.body.className = this[hidden] ? "hidden" : "visible"; |
| 5293 | } |
| 5294 | })(); |
| 5295 | |
| 5296 | function calcXY() { |
| 5297 | var e = window.event; |
caryclark | 55888e4 | 2016-07-18 10:01:36 -0700 | [diff] [blame] | 5298 | var tgt = e.target || e.srcElement; |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 5299 | var left = tgt.offsetLeft; |
| 5300 | var top = tgt.offsetTop; |
| 5301 | mouseX = (e.clientX - left) / scale + srcLeft; |
| 5302 | mouseY = (e.clientY - top) / scale + srcTop; |
| 5303 | } |
| 5304 | |
| 5305 | function calcLeftTop() { |
| 5306 | srcLeft = mouseX - screenWidth / 2 / scale; |
| 5307 | srcTop = mouseY - screenHeight / 2 / scale; |
| 5308 | } |
| 5309 | |
| 5310 | var disableClick = false; |
| 5311 | |
| 5312 | function handleMouseClick() { |
| 5313 | if (disableClick) { |
| 5314 | return; |
| 5315 | } |
| 5316 | if (!curve_t || !ptInTControl()) { |
| 5317 | calcXY(); |
| 5318 | calcLeftTop(); |
| 5319 | } |
| 5320 | redraw(); |
| 5321 | // if (!curve_t || !ptInTControl()) { |
| 5322 | // mouseX = screenWidth / 2 / scale + srcLeft; |
| 5323 | // mouseY = screenHeight / 2 / scale + srcTop; |
| 5324 | // } |
| 5325 | } |
| 5326 | |
| 5327 | function handleMouseOver() { |
| 5328 | calcXY(); |
| 5329 | if (debug_xy != 2) { |
| 5330 | return; |
| 5331 | } |
| 5332 | var num = mouseX.toFixed(decimal_places) + ", " + mouseY.toFixed(decimal_places); |
| 5333 | ctx.beginPath(); |
| 5334 | ctx.rect(300,100,num.length * 6,10); |
| 5335 | ctx.fillStyle="white"; |
| 5336 | ctx.fill(); |
| 5337 | ctx.font = "normal 10px Arial"; |
| 5338 | ctx.fillStyle="black"; |
| 5339 | ctx.textAlign = "left"; |
| 5340 | ctx.fillText(num, 300, 108); |
| 5341 | } |
| 5342 | |
| 5343 | function start() { |
| 5344 | for (var i = 0; i < testDivs.length; ++i) { |
| 5345 | tests[i] = null; |
| 5346 | } |
| 5347 | testIndex = 0; |
| 5348 | drawTop(); |
| 5349 | window.addEventListener('keypress', doKeyPress, true); |
| 5350 | window.addEventListener('keydown', doKeyDown, true); |
| 5351 | window.onresize = function() { |
| 5352 | drawTop(); |
| 5353 | } |
| 5354 | /* |
| 5355 | window.onpagehide = function() { |
| 5356 | disableClick = true; |
| 5357 | } |
| 5358 | */ |
| 5359 | window.onpageshow = function () { |
| 5360 | disableClick = false; |
| 5361 | } |
| 5362 | } |
| 5363 | |
| 5364 | </script> |
| 5365 | </head> |
| 5366 | |
| 5367 | <body onLoad="start();"> |
| 5368 | <canvas id="canvas" width="750" height="500" |
| 5369 | onmousemove="handleMouseOver()" |
| 5370 | onclick="handleMouseClick()" |
| 5371 | ></canvas > |
| 5372 | </body> |
| 5373 | </html> |