caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 1 | <html> |
| 2 | <head> |
| 3 | <div height="0" hidden="true"> |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 4 | |
caryclark | 6c3b9cd | 2016-09-26 05:36:58 -0700 | [diff] [blame^] | 5 | Skia UnitTests: --match PathOpsSimplify$ --resourcePath resources/ SK_DEBUG |
| 6 | |
| 7 | <div id="tiger8b_h_1"> |
| 8 | seg=1 {{{{494.348663f, 224.583771f}, {494.365143f, 224.633194f}, {494.376404f, 224.684067f}}}, 0.998645842f} |
| 9 | seg=2 {{{494.376404f, 224.684067f}, {494.005188f, 224.055679f}, {494.019165f, 224.046982f}}} |
| 10 | seg=3 {{{494.019165f, 224.046982f}, {494.029083f, 224.040833f}, {494.232056f, 224.345306f}}} |
| 11 | seg=4 {{{494.232056f, 224.345306f}, {494.273193f, 224.406982f}, {494.30481f, 224.474213f}}} |
| 12 | seg=5 {{{494.30481f, 224.474213f}, {494.334961f, 224.538284f}, {494.355774f, 224.605927f}}} |
| 13 | seg=6 {{{494.355774f, 224.605927f}, {494.363708f, 224.631714f}, {494.370148f, 224.657471f}}} |
| 14 | seg=7 {{{494.370148f, 224.657471f}, {494.375275f, 224.679031f}}} |
| 15 | seg=8 {{{494.375275f, 224.679031f}, {494.376038f, 224.682449f}}} |
| 16 | seg=9 {{{494.376038f, 224.682449f}, {494.376221f, 224.683273f}}} |
| 17 | seg=10 {{{494.376221f, 224.683273f}, {494.376007f, 224.682281f}}} |
| 18 | seg=11 {{{494.376007f, 224.682281f}, {494.375671f, 224.680908f}}} |
| 19 | seg=12 {{{494.375671f, 224.680908f}, {494.375397f, 224.67955f}, {494.376495f, 224.683868f}}} |
| 20 | seg=13 {{{494.376495f, 224.683868f}, {494.634338f, 225.414886f}, {494.895874f, 225.840698f}}} |
| 21 | seg=14 {{{494.895874f, 225.840698f}, {495.737305f, 227.210602f}, {497.243317f, 227.90419f}}} |
| 22 | seg=15 {{{497.243317f, 227.90419f}, {502.478027f, 230.314941f}, {513.407471f, 224.129684f}}} |
| 23 | seg=16 {{{513.407471f, 224.129684f}, {513.900024f, 224.999985f}}} |
| 24 | seg=17 {{{513.900024f, 224.999985f}, {494.348663f, 224.583771f}}} |
| 25 | debugShowConicQuadIntersection wtTs[0]=1 {{{{494.348663,224.583771}, {494.365143,224.633194}, {494.376404,224.684067}}}, 0.998645842} {{494.376404,224.684067}} wnTs[0]=0 {{{494.376404,224.684067}, {494.005188,224.055679}, {494.019165,224.046982}}} |
| 26 | debugShowConicQuadIntersection no intersect {{{{494.348663,224.583771}, {494.365143,224.633194}, {494.376404,224.684067}}}, 0.998645842} {{{494.30481,224.474213}, {494.334961,224.538284}, {494.355774,224.605927}}} |
| 27 | debugShowConicQuadIntersection no intersect {{{{494.348663,224.583771}, {494.365143,224.633194}, {494.376404,224.684067}}}, 0.998645842} {{{494.355774,224.605927}, {494.363708,224.631714}, {494.370148,224.657471}}} |
| 28 | debugShowConicLineIntersection wtTs[0]=0.737524311 {{{{494.348663,224.583771}, {494.365143,224.633194}, {494.376404,224.684067}}}, 0.998645842} {{494.370148,224.657471}} wtTs[1]=0.95041534 {{494.375275,224.679031}} wnTs[0]=0 {{{494.370148,224.657471}, {494.375275,224.679031}}} wnTs[1]=1 |
| 29 | addT insert t=0.737524311 segID=1 spanID=35 |
| 30 | addT insert t=0.95041534 segID=1 spanID=36 |
| 31 | debugShowConicLineIntersection wtTs[0]=0.950415458 {{{{494.348663,224.583771}, {494.365143,224.633194}, {494.376404,224.684067}}}, 0.998645842} {{494.375275,224.679031}} wtTs[1]=0.984064836 {{494.376038,224.682449}} wnTs[0]=0 {{{494.375275,224.679031}, {494.376038,224.682449}}} wnTs[1]=1 |
| 32 | addT insert t=0.984064836 segID=1 spanID=37 |
| 33 | debugShowConicLineIntersection wtTs[0]=0.984064896 {{{{494.348663,224.583771}, {494.365143,224.633194}, {494.376404,224.684067}}}, 0.998645842} {{494.376038,224.682449}} wtTs[1]=0.992175496 {{494.376221,224.683273}} wnTs[0]=0 {{{494.376038,224.682449}, {494.376221,224.683273}}} wnTs[1]=1 |
| 34 | addT insert t=0.992175496 segID=1 spanID=38 |
| 35 | debugShowConicLineIntersection wtTs[0]=0.982426882 {{{{494.348663,224.583771}, {494.365143,224.633194}, {494.376404,224.684067}}}, 0.998645842} {{494.376007,224.682281}} wtTs[1]=0.992175933 {{494.376221,224.683273}} wnTs[0]=1 {{{494.376221,224.683273}, {494.376007,224.682281}}} wnTs[1]=0 |
| 36 | debugShowConicLineIntersection wtTs[0]=0.968840505 {{{{494.348663,224.583771}, {494.365143,224.633194}, {494.376404,224.684067}}}, 0.998645842} {{494.375671,224.680908}} wtTs[1]=0.982426925 {{494.376007,224.682281}} wnTs[0]=1 {{{494.376007,224.682281}, {494.375671,224.680908}}} wnTs[1]=0 |
| 37 | addT insert t=0.968840505 segID=1 spanID=39 |
| 38 | debugShowConicQuadIntersection wtTs[0]=0.966796875 {{{{494.348663,224.583771}, {494.365143,224.633194}, {494.376404,224.684067}}}, 0.998645842} {{494.375641,224.680695}} wtTs[1]=1 {{494.376404,224.684067}} wnTs[0]=0.375 {{{494.375671,224.680908}, {494.375397,224.67955}, {494.376495,224.683868}}} wnTs[1]=1 |
| 39 | debugShowConicQuadIntersection no intersect {{{{494.348663,224.583771}, {494.365143,224.633194}, {494.376404,224.684067}}}, 0.998645842} {{{494.376495,224.683868}, {494.634338,225.414886}, {494.895874,225.840698}}} |
| 40 | debugShowConicLineIntersection wtTs[0]=0 {{{{494.348663,224.583771}, {494.365143,224.633194}, {494.376404,224.684067}}}, 0.998645842} {{494.348663,224.583771}} wnTs[0]=1 {{{513.900024,224.999985}, {494.348663,224.583771}}} |
| 41 | debugShowQuadIntersection wtTs[0]=1 {{{494.376404,224.684067}, {494.005188,224.055679}, {494.019165,224.046982}}} {{494.019165,224.046982}} wnTs[0]=0 {{{494.019165,224.046982}, {494.029083,224.040833}, {494.232056,224.345306}}} |
| 42 | debugShowQuadIntersection no intersect {{{494.376404,224.684067}, {494.005188,224.055679}, {494.019165,224.046982}}} {{{494.232056,224.345306}, {494.273193,224.406982}, {494.30481,224.474213}}} |
| 43 | debugShowQuadIntersection no intersect {{{494.376404,224.684067}, {494.005188,224.055679}, {494.019165,224.046982}}} {{{494.30481,224.474213}, {494.334961,224.538284}, {494.355774,224.605927}}} |
| 44 | debugShowQuadIntersection no intersect {{{494.376404,224.684067}, {494.005188,224.055679}, {494.019165,224.046982}}} {{{494.355774,224.605927}, {494.363708,224.631714}, {494.370148,224.657471}}} |
| 45 | debugShowQuadLineIntersection no intersect {{{494.376404,224.684067}, {494.005188,224.055679}, {494.019165,224.046982}}} {{{494.370148,224.657471}, {494.375275,224.679031}}} |
| 46 | debugShowQuadLineIntersection no intersect {{{494.376404,224.684067}, {494.005188,224.055679}, {494.019165,224.046982}}} {{{494.375275,224.679031}, {494.376038,224.682449}}} |
| 47 | debugShowQuadLineIntersection wtTs[0]=0.000586871356 {{{494.376404,224.684067}, {494.005188,224.055679}, {494.019165,224.046982}}} {{494.376221,224.683273}} wnTs[0]=1 {{{494.376038,224.682449}, {494.376221,224.683273}}} |
| 48 | addT insert t=0.000586871356 segID=2 spanID=40 |
| 49 | debugShowQuadLineIntersection wtTs[0]=0.000588090628 {{{494.376404,224.684067}, {494.005188,224.055679}, {494.019165,224.046982}}} {{494.376221,224.683273}} wnTs[0]=0 {{{494.376221,224.683273}, {494.376007,224.682281}}} |
| 50 | debugShowQuadLineIntersection no intersect {{{494.376404,224.684067}, {494.005188,224.055679}, {494.019165,224.046982}}} {{{494.376007,224.682281}, {494.375671,224.680908}}} |
| 51 | debugShowQuadIntersection no intersect {{{494.376404,224.684067}, {494.005188,224.055679}, {494.019165,224.046982}}} {{{494.375671,224.680908}, {494.375397,224.67955}, {494.376495,224.683868}}} |
| 52 | debugShowQuadIntersection no intersect {{{494.376404,224.684067}, {494.005188,224.055679}, {494.019165,224.046982}}} {{{494.376495,224.683868}, {494.634338,225.414886}, {494.895874,225.840698}}} |
| 53 | debugShowQuadLineIntersection no intersect {{{494.376404,224.684067}, {494.005188,224.055679}, {494.019165,224.046982}}} {{{513.900024,224.999985}, {494.348663,224.583771}}} |
| 54 | debugShowQuadIntersection wtTs[0]=1 {{{494.019165,224.046982}, {494.029083,224.040833}, {494.232056,224.345306}}} {{494.232056,224.345306}} wnTs[0]=0 {{{494.232056,224.345306}, {494.273193,224.406982}, {494.30481,224.474213}}} |
| 55 | debugShowQuadIntersection wtTs[0]=1 {{{494.232056,224.345306}, {494.273193,224.406982}, {494.30481,224.474213}}} {{494.30481,224.474213}} wnTs[0]=0 {{{494.30481,224.474213}, {494.334961,224.538284}, {494.355774,224.605927}}} |
| 56 | debugShowQuadIntersection wtTs[0]=1 {{{494.30481,224.474213}, {494.334961,224.538284}, {494.355774,224.605927}}} {{494.355774,224.605927}} wnTs[0]=0 {{{494.355774,224.605927}, {494.363708,224.631714}, {494.370148,224.657471}}} |
| 57 | debugShowQuadLineIntersection wtTs[0]=0.835281662 {{{494.30481,224.474213}, {494.334961,224.538284}, {494.355774,224.605927}}} {{494.348663,224.583771}} wnTs[0]=1 {{{513.900024,224.999985}, {494.348663,224.583771}}} |
| 58 | addT insert t=0.835281662 segID=5 spanID=41 |
| 59 | debugShowQuadLineIntersection wtTs[0]=1 {{{494.355774,224.605927}, {494.363708,224.631714}, {494.370148,224.657471}}} {{494.370148,224.657471}} wnTs[0]=0 {{{494.370148,224.657471}, {494.375275,224.679031}}} |
| 60 | debugShowQuadLineIntersection no intersect {{{494.355774,224.605927}, {494.363708,224.631714}, {494.370148,224.657471}}} {{{513.900024,224.999985}, {494.348663,224.583771}}} |
| 61 | debugShowLineIntersection wtTs[0]=1 {{{494.370148,224.657471}, {494.375275,224.679031}}} {{494.375275,224.679031}} wnTs[0]=0 {{{494.375275,224.679031}, {494.376038,224.682449}}} |
| 62 | debugShowLineIntersection no intersect {{{494.370148,224.657471}, {494.375275,224.679031}}} {{{513.900024,224.999985}, {494.348663,224.583771}}} |
| 63 | debugShowLineIntersection wtTs[0]=1 {{{494.375275,224.679031}, {494.376038,224.682449}}} {{494.376038,224.682449}} wnTs[0]=0 {{{494.376038,224.682449}, {494.376221,224.683273}}} |
| 64 | debugShowLineIntersection wtTs[0]=0.951325082 {{{494.375275,224.679031}, {494.376038,224.682449}}} {{494.376007,224.682281}} wtTs[1]=1 {{494.376038,224.682449}} wnTs[0]=1 {{{494.376221,224.683273}, {494.376007,224.682281}}} wnTs[1]=0.831938475 |
| 65 | debugShowLineIntersection wtTs[0]=0.547725719 {{{494.375275,224.679031}, {494.376038,224.682449}}} {{494.375671,224.680908}} wtTs[1]=0.951325082 {{494.376007,224.682281}} wnTs[0]=1 {{{494.376007,224.682281}, {494.375671,224.680908}}} wnTs[1]=0 |
| 66 | addT insert t=0.547725719 segID=8 spanID=42 |
| 67 | debugShowQuadLineIntersection wtTs[0]=0 {{{494.375671,224.680908}, {494.375397,224.67955}, {494.376495,224.683868}}} {{494.375671,224.680908}} wtTs[1]=0.809546276 {{494.376038,224.682449}} wnTs[0]=0.547726 {{{494.375275,224.679031}, {494.376038,224.682449}}} wnTs[1]=1 |
| 68 | addT insert t=0.809546276 segID=12 spanID=43 |
| 69 | debugShowLineIntersection no intersect {{{494.375275,224.679031}, {494.376038,224.682449}}} {{{513.900024,224.999985}, {494.348663,224.583771}}} |
| 70 | debugShowLineIntersection wtTs[0]=0 {{{494.376038,224.682449}, {494.376221,224.683273}}} {{494.376038,224.682449}} wtTs[1]=1 {{494.376221,224.683273}} wnTs[0]=0.831938 {{{494.376221,224.683273}, {494.376007,224.682281}}} wnTs[1]=0 |
| 71 | debugShowLineIntersection no intersect {{{494.376038,224.682449}, {494.376221,224.683273}}} {{{494.376007,224.682281}, {494.375671,224.680908}}} |
| 72 | debugShowQuadLineIntersection wtTs[0]=0.809559187 {{{494.375671,224.680908}, {494.375397,224.67955}, {494.376495,224.683868}}} {{494.376038,224.682449}} wtTs[1]=0.924341302 {{494.376221,224.683273}} wnTs[0]=0 {{{494.376038,224.682449}, {494.376221,224.683273}}} wnTs[1]=1 |
| 73 | addT insert t=0.924341302 segID=12 spanID=44 |
| 74 | debugShowLineIntersection no intersect {{{494.376038,224.682449}, {494.376221,224.683273}}} {{{513.900024,224.999985}, {494.348663,224.583771}}} |
| 75 | debugShowLineIntersection wtTs[0]=1 {{{494.376221,224.683273}, {494.376007,224.682281}}} {{494.376007,224.682281}} wnTs[0]=0 {{{494.376007,224.682281}, {494.375671,224.680908}}} |
| 76 | debugShowQuadLineIntersection wtTs[0]=0.783538464 {{{494.375671,224.680908}, {494.375397,224.67955}, {494.376495,224.683868}}} {{494.376007,224.682281}} wtTs[1]=0.924438181 {{494.376221,224.683273}} wnTs[0]=1 {{{494.376221,224.683273}, {494.376007,224.682281}}} wnTs[1]=0 |
| 77 | debugShowLineIntersection no intersect {{{494.376221,224.683273}, {494.376007,224.682281}}} {{{513.900024,224.999985}, {494.348663,224.583771}}} |
| 78 | debugShowQuadLineIntersection wtTs[0]=0 {{{494.375671,224.680908}, {494.375397,224.67955}, {494.376495,224.683868}}} {{494.375671,224.680908}} wtTs[1]=0.783197805 {{494.376007,224.682281}} wnTs[0]=1 {{{494.376007,224.682281}, {494.375671,224.680908}}} wnTs[1]=0 |
| 79 | debugShowLineIntersection no intersect {{{494.376007,224.682281}, {494.375671,224.680908}}} {{{513.900024,224.999985}, {494.348663,224.583771}}} |
| 80 | debugShowQuadIntersection wtTs[0]=1 {{{494.375671,224.680908}, {494.375397,224.67955}, {494.376495,224.683868}}} {{494.376495,224.683868}} wnTs[0]=0 {{{494.376495,224.683868}, {494.634338,225.414886}, {494.895874,225.840698}}} |
| 81 | debugShowQuadLineIntersection no intersect {{{494.375671,224.680908}, {494.375397,224.67955}, {494.376495,224.683868}}} {{{513.900024,224.999985}, {494.348663,224.583771}}} |
| 82 | debugShowQuadIntersection wtTs[0]=1 {{{494.376495,224.683868}, {494.634338,225.414886}, {494.895874,225.840698}}} {{494.895874,225.840698}} wnTs[0]=0 {{{494.895874,225.840698}, {495.737305,227.210602}, {497.243317,227.90419}}} |
| 83 | debugShowQuadLineIntersection no intersect {{{494.376495,224.683868}, {494.634338,225.414886}, {494.895874,225.840698}}} {{{513.900024,224.999985}, {494.348663,224.583771}}} |
| 84 | debugShowQuadIntersection wtTs[0]=1 {{{494.895874,225.840698}, {495.737305,227.210602}, {497.243317,227.90419}}} {{497.243317,227.90419}} wnTs[0]=0 {{{497.243317,227.90419}, {502.478027,230.314941}, {513.407471,224.129684}}} |
| 85 | debugShowQuadLineIntersection wtTs[0]=1 {{{497.243317,227.90419}, {502.478027,230.314941}, {513.407471,224.129684}}} {{513.407471,224.129684}} wnTs[0]=0 {{{513.407471,224.129684}, {513.900024,224.999985}}} |
| 86 | debugShowQuadLineIntersection wtTs[0]=0.929653854 {{{497.243317,227.90419}, {502.478027,230.314941}, {513.407471,224.129684}}} {{511.897949,224.957367}} wnTs[0]=0.1024 {{{513.900024,224.999985}, {494.348663,224.583771}}} |
| 87 | addT insert t=0.929653854 segID=15 spanID=45 |
| 88 | addT insert t=0.102400099 segID=17 spanID=46 |
| 89 | debugShowLineIntersection wtTs[0]=1 {{{513.407471,224.129684}, {513.900024,224.999985}}} {{513.900024,224.999985}} wnTs[0]=0 {{{513.900024,224.999985}, {494.348663,224.583771}}} |
| 90 | --x--x---------xx-x--x------------x start |
| 91 | 00: coinSeg/Span/PtT=2/3/3 endSpan=40 oppSeg/Span/PtT=1/2/2 oppEndSpan=38 MissingCoin |
| 92 | 01: coinSeg/Span/PtT=12/44/44 endSpan=24 oppSeg/Span/PtT=2/40/40 oppEndSpan=3 MissingCoin |
| 93 | 02: coinSeg/Span/PtT=1/38/38 endSpan=2 oppSeg/Span/PtT=2/40/40 oppEndSpan=3 MissingCoin |
| 94 | 03: coinSeg/Span/PtT=12/23/23 endSpan=43 oppSeg/Span/PtT=11/22/22 oppEndSpan=21 MissingCoin |
| 95 | 04: coinSeg/Span/PtT=11/21/21 endSpan=22 oppSeg/Span/PtT=12/43/43 oppEndSpan=23 MissingCoin |
| 96 | 05: coinSeg/Span/PtT=2/3/3 endSpan=40 oppSeg/Span/PtT=12/24/24 oppEndSpan=44 MissingCoin |
| 97 | 06: coinSeg/Span/PtT=2/3/3 endSpan=40 oppSeg/Span/PtT=1/2/2 oppEndSpan=38 MissingCoin |
| 98 | 07: coinSeg/Span/PtT=12/44/44 endSpan=24 oppSeg/Span/PtT=2/40/40 oppEndSpan=3 MissingCoin |
| 99 | 08: coinSeg/Span/PtT=1/38/38 endSpan=2 oppSeg/Span/PtT=2/40/40 oppEndSpan=3 MissingCoin |
| 100 | 09: coinSeg/Span/PtT=12/23/23 endSpan=43 oppSeg/Span/PtT=11/22/22 oppEndSpan=21 MissingCoin |
| 101 | 10: coinSeg/Span/PtT=11/21/21 endSpan=22 oppSeg/Span/PtT=12/43/43 oppEndSpan=23 MissingCoin |
| 102 | 11: coinSeg/Span/PtT=2/3/3 endSpan=40 oppSeg/Span/PtT=12/24/24 oppEndSpan=44 MissingCoin |
| 103 | 12: segment=12 AddExpandedFail |
| 104 | 13: segment=12 startT=0 endT=0.809546 segment=11 oppStartT=1 oppEndT=0 AddMissingCoin |
| 105 | 14: segment=12 AddExpandedFail |
| 106 | 15: segment=12 startT=0 endT=0.809546 segment=11 oppStartT=1 oppEndT=0 AddMissingCoin |
| 107 | 16: seg/base=10/19 seg/base=12/43 MarkCoinStart |
| 108 | 17: seg/base=10/20 seg/base=12/44 MarkCoinEnd |
| 109 | 18: seg/base=9/17 seg/base=12/43 MarkCoinStart |
| 110 | 19: seg/base=9/18 seg/base=12/44 MarkCoinEnd |
| 111 | 20: seg/base=9/17 seg/base=10/19 MarkCoinStart |
| 112 | 21: seg/base=9/18 seg/base=10/20 MarkCoinEnd |
| 113 | 22: seg/base=8/42 seg/base=12/23 MarkCoinStart |
| 114 | 23: seg/base=8/16 seg/base=12/43 MarkCoinEnd |
| 115 | 24: seg/base=8/42 seg/base=11/21 MarkCoinStart |
| 116 | 25: seg/base=8/16 seg/base=11/22 MarkCoinEnd |
| 117 | 26: seg/base=12/23 seg/base=1/39 MarkCoinStart |
| 118 | 27: seg/base=12/24 seg/base=1/2 MarkCoinEnd |
| 119 | 28: seg/base=1/37 MarkCoinInsert |
| 120 | 29: seg/base=1/38 MarkCoinInsert |
| 121 | 30: seg/base=12/43 MarkCoinInsert |
| 122 | 31: seg/base=12/44 MarkCoinInsert |
| 123 | 32: seg/base=11/21 seg/base=1/39 MarkCoinStart |
| 124 | 33: seg/base=11/22 seg/base=1/37 MarkCoinEnd |
| 125 | 34: seg/base=10/19 seg/base=1/37 MarkCoinStart |
| 126 | 35: seg/base=10/20 seg/base=1/38 MarkCoinEnd |
| 127 | 36: seg/base=9/17 seg/base=1/37 MarkCoinStart |
| 128 | 37: seg/base=9/18 seg/base=1/38 MarkCoinEnd |
| 129 | 38: seg/base=8/15 seg/base=1/36 MarkCoinStart |
| 130 | 39: seg/base=8/16 seg/base=1/37 MarkCoinEnd |
| 131 | 40: seg/base=1/39 MarkCoinInsert |
| 132 | 41: seg/base=8/42 MarkCoinInsert |
| 133 | 42: seg/base=7/13 seg/base=1/35 MarkCoinStart |
| 134 | 43: seg/base=7/14 seg/base=1/36 MarkCoinEnd |
| 135 | active after start: |
| 136 | debugShowActiveSpans id=1 (494.348663,224.583771 494.360813,224.620209 494.370148,224.657471 0.999263287f) t=0 tEnd=0.737524311 windSum=? windValue=1 |
| 137 | debugShowActiveSpans id=1 (494.370148,224.657471 494.372825,224.668224 494.375275,224.679031 0.999938607f) t=0.737524311 tEnd=0.95041534 windSum=? windValue=1 |
| 138 | debugShowActiveSpans id=1 (494.375275,224.679031 494.375488,224.679966 494.375702,224.680908 0.999999523f) t=0.95041534 tEnd=0.968840505 windSum=? windValue=1 |
| 139 | debugShowActiveSpans id=1 (494.375702,224.680908 494.375872,224.681675 494.376038,224.682449 0.999999702f) t=0.968840505 tEnd=0.984064836 windSum=? windValue=1 |
| 140 | debugShowActiveSpans id=1 (494.376038,224.682449 494.376136,224.68286 494.376221,224.683273 0.99999994f) t=0.984064836 tEnd=0.992175496 windSum=? windValue=1 |
| 141 | debugShowActiveSpans id=1 (494.376221,224.683273 494.376316,224.683669 494.376404,224.684067 0.99999994f) t=0.992175496 tEnd=1 windSum=? windValue=1 |
| 142 | debugShowActiveSpans id=2 (494.376404,224.684067 494.37619,224.6837 494.375977,224.683334) t=0 tEnd=0.000586871356 windSum=? windValue=1 |
| 143 | debugShowActiveSpans id=2 (494.375977,224.683334 494.0052,224.055672 494.019165,224.046982) t=0.000586871356 tEnd=1 windSum=? windValue=1 |
| 144 | debugShowActiveSpans id=3 (494.019165,224.046982 494.029083,224.040833 494.232056,224.345306) t=0 tEnd=1 windSum=? windValue=1 |
| 145 | debugShowActiveSpans id=4 (494.232056,224.345306 494.273193,224.406982 494.30481,224.474213) t=0 tEnd=1 windSum=? windValue=1 |
| 146 | debugShowActiveSpans id=5 (494.30481,224.474213 494.329991,224.527724 494.348663,224.58374) t=0 tEnd=0.835281662 windSum=? windValue=1 |
| 147 | debugShowActiveSpans id=5 (494.348663,224.58374 494.352356,224.594819 494.355774,224.605927) t=0.835281662 tEnd=1 windSum=? windValue=1 |
| 148 | debugShowActiveSpans id=6 (494.355774,224.605927 494.363708,224.631714 494.370148,224.657471) t=0 tEnd=1 windSum=? windValue=1 |
| 149 | debugShowActiveSpans id=7 (494.370148,224.657471 494.375275,224.679031) t=0 tEnd=1 windSum=? windValue=1 |
| 150 | debugShowActiveSpans id=8 (494.375275,224.679031 494.375702,224.680908) t=0 tEnd=0.547725719 windSum=? windValue=1 |
| 151 | debugShowActiveSpans id=8 (494.375702,224.680908 494.376038,224.682449) t=0.547725719 tEnd=1 windSum=? windValue=1 |
| 152 | debugShowActiveSpans id=9 (494.376038,224.682449 494.376221,224.683273) t=0 tEnd=1 windSum=? windValue=1 |
| 153 | debugShowActiveSpans id=10 (494.376221,224.683273 494.376007,224.682281) t=0 tEnd=1 windSum=? windValue=1 |
| 154 | debugShowActiveSpans id=11 (494.376007,224.682281 494.375671,224.680908) t=0 tEnd=1 windSum=? windValue=1 |
| 155 | debugShowActiveSpans id=12 (494.375671,224.680908 494.375445,224.679787 494.376129,224.682434) t=0 tEnd=0.809546276 windSum=? windValue=1 |
| 156 | debugShowActiveSpans id=12 (494.376129,224.682434 494.376227,224.682801 494.376343,224.683243) t=0.809546276 tEnd=0.924341302 windSum=? windValue=1 |
| 157 | debugShowActiveSpans id=12 (494.376343,224.683243 494.376415,224.683539 494.376495,224.683868) t=0.924341302 tEnd=1 windSum=? windValue=1 |
| 158 | debugShowActiveSpans id=13 (494.376495,224.683868 494.634338,225.414886 494.895874,225.840698) t=0 tEnd=1 windSum=? windValue=1 |
| 159 | debugShowActiveSpans id=14 (494.895874,225.840698 495.737305,227.210602 497.243317,227.90419) t=0 tEnd=1 windSum=? windValue=1 |
| 160 | debugShowActiveSpans id=15 (497.243317,227.90419 502.109781,230.145352 511.897949,224.957367) t=0 tEnd=0.929653854 windSum=? windValue=1 |
| 161 | debugShowActiveSpans id=15 (511.897949,224.957367 512.63876,224.564718 513.407471,224.129684) t=0.929653854 tEnd=1 windSum=? windValue=1 |
| 162 | debugShowActiveSpans id=16 (513.407471,224.129684 513.900024,224.999985) t=0 tEnd=1 windSum=? windValue=1 |
| 163 | debugShowActiveSpans id=17 (513.900024,224.999985 511.897949,224.957367) t=0 tEnd=0.102400099 windSum=? windValue=1 |
| 164 | debugShowActiveSpans id=17 (511.897949,224.957367 494.348663,224.583771) t=0.102400099 tEnd=1 windSum=? windValue=1 |
| 165 | --x--x---------xx-x--x------------x addExpanded |
| 166 | 00: coinSeg/Span/PtT=2/3/3 endSpan=40 oppSeg/Span/PtT=1/2/2 oppEndSpan=38 MissingCoin |
| 167 | 01: coinSeg/Span/PtT=12/44/44 endSpan=24 oppSeg/Span/PtT=2/40/40 oppEndSpan=3 MissingCoin |
| 168 | 02: coinSeg/Span/PtT=1/38/38 endSpan=2 oppSeg/Span/PtT=2/40/40 oppEndSpan=3 MissingCoin |
| 169 | 03: coinSeg/Span/PtT=12/23/23 endSpan=43 oppSeg/Span/PtT=11/22/22 oppEndSpan=21 MissingCoin |
| 170 | 04: coinSeg/Span/PtT=11/21/21 endSpan=22 oppSeg/Span/PtT=12/43/43 oppEndSpan=23 MissingCoin |
| 171 | 05: coinSeg/Span/PtT=2/3/3 endSpan=40 oppSeg/Span/PtT=12/24/24 oppEndSpan=44 MissingCoin |
| 172 | 06: coinSeg/Span/PtT=2/3/3 endSpan=40 oppSeg/Span/PtT=1/2/2 oppEndSpan=38 MissingCoin |
| 173 | 07: coinSeg/Span/PtT=12/44/44 endSpan=24 oppSeg/Span/PtT=2/40/40 oppEndSpan=3 MissingCoin |
| 174 | 08: coinSeg/Span/PtT=1/38/38 endSpan=2 oppSeg/Span/PtT=2/40/40 oppEndSpan=3 MissingCoin |
| 175 | 09: coinSeg/Span/PtT=12/23/23 endSpan=43 oppSeg/Span/PtT=11/22/22 oppEndSpan=21 MissingCoin |
| 176 | 10: coinSeg/Span/PtT=11/21/21 endSpan=22 oppSeg/Span/PtT=12/43/43 oppEndSpan=23 MissingCoin |
| 177 | 11: coinSeg/Span/PtT=2/3/3 endSpan=40 oppSeg/Span/PtT=12/24/24 oppEndSpan=44 MissingCoin |
| 178 | 12: segment=12 AddExpandedFail |
| 179 | 13: segment=12 startT=0 endT=0.809546 segment=11 oppStartT=1 oppEndT=0 AddMissingCoin |
| 180 | 14: segment=12 AddExpandedFail |
| 181 | 15: segment=12 startT=0 endT=0.809546 segment=11 oppStartT=1 oppEndT=0 AddMissingCoin |
| 182 | 16: seg/base=10/19 seg/base=12/43 MarkCoinStart |
| 183 | 17: seg/base=10/20 seg/base=12/44 MarkCoinEnd |
| 184 | 18: seg/base=9/17 seg/base=12/43 MarkCoinStart |
| 185 | 19: seg/base=9/18 seg/base=12/44 MarkCoinEnd |
| 186 | 20: seg/base=9/17 seg/base=10/19 MarkCoinStart |
| 187 | 21: seg/base=9/18 seg/base=10/20 MarkCoinEnd |
| 188 | 22: seg/base=8/42 seg/base=12/23 MarkCoinStart |
| 189 | 23: seg/base=8/16 seg/base=12/43 MarkCoinEnd |
| 190 | 24: seg/base=8/42 seg/base=11/21 MarkCoinStart |
| 191 | 25: seg/base=8/16 seg/base=11/22 MarkCoinEnd |
| 192 | 26: seg/base=12/23 seg/base=1/39 MarkCoinStart |
| 193 | 27: seg/base=12/24 seg/base=1/2 MarkCoinEnd |
| 194 | 28: seg/base=1/37 MarkCoinInsert |
| 195 | 29: seg/base=1/38 MarkCoinInsert |
| 196 | 30: seg/base=12/43 MarkCoinInsert |
| 197 | 31: seg/base=12/44 MarkCoinInsert |
| 198 | 32: seg/base=11/21 seg/base=1/39 MarkCoinStart |
| 199 | 33: seg/base=11/22 seg/base=1/37 MarkCoinEnd |
| 200 | 34: seg/base=10/19 seg/base=1/37 MarkCoinStart |
| 201 | 35: seg/base=10/20 seg/base=1/38 MarkCoinEnd |
| 202 | 36: seg/base=9/17 seg/base=1/37 MarkCoinStart |
| 203 | 37: seg/base=9/18 seg/base=1/38 MarkCoinEnd |
| 204 | 38: seg/base=8/15 seg/base=1/36 MarkCoinStart |
| 205 | 39: seg/base=8/16 seg/base=1/37 MarkCoinEnd |
| 206 | 40: seg/base=1/39 MarkCoinInsert |
| 207 | 41: seg/base=8/42 MarkCoinInsert |
| 208 | 42: seg/base=7/13 seg/base=1/35 MarkCoinStart |
| 209 | 43: seg/base=7/14 seg/base=1/36 MarkCoinEnd |
| 210 | active after addExpanded: |
| 211 | debugShowActiveSpans id=1 (494.348663,224.583771 494.360813,224.620209 494.370148,224.657471 0.999263287f) t=0 tEnd=0.737524311 windSum=? windValue=1 |
| 212 | debugShowActiveSpans id=1 (494.370148,224.657471 494.372825,224.668224 494.375275,224.679031 0.999938607f) t=0.737524311 tEnd=0.95041534 windSum=? windValue=1 |
| 213 | debugShowActiveSpans id=1 (494.375275,224.679031 494.375488,224.679966 494.375702,224.680908 0.999999523f) t=0.95041534 tEnd=0.968840505 windSum=? windValue=1 |
| 214 | debugShowActiveSpans id=1 (494.375702,224.680908 494.375872,224.681675 494.376038,224.682449 0.999999702f) t=0.968840505 tEnd=0.984064836 windSum=? windValue=1 |
| 215 | debugShowActiveSpans id=1 (494.376038,224.682449 494.376136,224.68286 494.376221,224.683273 0.99999994f) t=0.984064836 tEnd=0.992175496 windSum=? windValue=1 |
| 216 | debugShowActiveSpans id=1 (494.376221,224.683273 494.376316,224.683669 494.376404,224.684067 0.99999994f) t=0.992175496 tEnd=1 windSum=? windValue=1 |
| 217 | debugShowActiveSpans id=2 (494.376404,224.684067 494.37619,224.6837 494.375977,224.683334) t=0 tEnd=0.000586871356 windSum=? windValue=1 |
| 218 | debugShowActiveSpans id=2 (494.375977,224.683334 494.0052,224.055672 494.019165,224.046982) t=0.000586871356 tEnd=1 windSum=? windValue=1 |
| 219 | debugShowActiveSpans id=3 (494.019165,224.046982 494.029083,224.040833 494.232056,224.345306) t=0 tEnd=1 windSum=? windValue=1 |
| 220 | debugShowActiveSpans id=4 (494.232056,224.345306 494.273193,224.406982 494.30481,224.474213) t=0 tEnd=1 windSum=? windValue=1 |
| 221 | debugShowActiveSpans id=5 (494.30481,224.474213 494.329991,224.527724 494.348663,224.58374) t=0 tEnd=0.835281662 windSum=? windValue=1 |
| 222 | debugShowActiveSpans id=5 (494.348663,224.58374 494.352356,224.594819 494.355774,224.605927) t=0.835281662 tEnd=1 windSum=? windValue=1 |
| 223 | debugShowActiveSpans id=6 (494.355774,224.605927 494.363708,224.631714 494.370148,224.657471) t=0 tEnd=1 windSum=? windValue=1 |
| 224 | debugShowActiveSpans id=7 (494.370148,224.657471 494.375275,224.679031) t=0 tEnd=1 windSum=? windValue=1 |
| 225 | debugShowActiveSpans id=8 (494.375275,224.679031 494.375702,224.680908) t=0 tEnd=0.547725719 windSum=? windValue=1 |
| 226 | debugShowActiveSpans id=8 (494.375702,224.680908 494.376038,224.682449) t=0.547725719 tEnd=1 windSum=? windValue=1 |
| 227 | debugShowActiveSpans id=9 (494.376038,224.682449 494.376221,224.683273) t=0 tEnd=1 windSum=? windValue=1 |
| 228 | debugShowActiveSpans id=10 (494.376221,224.683273 494.376007,224.682281) t=0 tEnd=1 windSum=? windValue=1 |
| 229 | debugShowActiveSpans id=11 (494.376007,224.682281 494.375671,224.680908) t=0 tEnd=1 windSum=? windValue=1 |
| 230 | debugShowActiveSpans id=12 (494.375671,224.680908 494.375445,224.679787 494.376129,224.682434) t=0 tEnd=0.809546276 windSum=? windValue=1 |
| 231 | debugShowActiveSpans id=12 (494.376129,224.682434 494.376227,224.682801 494.376343,224.683243) t=0.809546276 tEnd=0.924341302 windSum=? windValue=1 |
| 232 | debugShowActiveSpans id=12 (494.376343,224.683243 494.376415,224.683539 494.376495,224.683868) t=0.924341302 tEnd=1 windSum=? windValue=1 |
| 233 | debugShowActiveSpans id=13 (494.376495,224.683868 494.634338,225.414886 494.895874,225.840698) t=0 tEnd=1 windSum=? windValue=1 |
| 234 | debugShowActiveSpans id=14 (494.895874,225.840698 495.737305,227.210602 497.243317,227.90419) t=0 tEnd=1 windSum=? windValue=1 |
| 235 | debugShowActiveSpans id=15 (497.243317,227.90419 502.109781,230.145352 511.897949,224.957367) t=0 tEnd=0.929653854 windSum=? windValue=1 |
| 236 | debugShowActiveSpans id=15 (511.897949,224.957367 512.63876,224.564718 513.407471,224.129684) t=0.929653854 tEnd=1 windSum=? windValue=1 |
| 237 | debugShowActiveSpans id=16 (513.407471,224.129684 513.900024,224.999985) t=0 tEnd=1 windSum=? windValue=1 |
| 238 | debugShowActiveSpans id=17 (513.900024,224.999985 511.897949,224.957367) t=0 tEnd=0.102400099 windSum=? windValue=1 |
| 239 | debugShowActiveSpans id=17 (511.897949,224.957367 494.348663,224.583771) t=0.102400099 tEnd=1 windSum=? windValue=1 |
| 240 | --x--x---------xx-x--x------------x moveMultiples |
| 241 | 00: coinSeg/Span/PtT=2/3/3 endSpan=40 oppSeg/Span/PtT=1/2/2 oppEndSpan=38 MissingCoin |
| 242 | 01: coinSeg/Span/PtT=12/44/44 endSpan=24 oppSeg/Span/PtT=2/40/40 oppEndSpan=3 MissingCoin |
| 243 | 02: coinSeg/Span/PtT=1/38/38 endSpan=2 oppSeg/Span/PtT=2/40/40 oppEndSpan=3 MissingCoin |
| 244 | 03: coinSeg/Span/PtT=12/23/23 endSpan=43 oppSeg/Span/PtT=11/22/22 oppEndSpan=21 MissingCoin |
| 245 | 04: coinSeg/Span/PtT=11/21/21 endSpan=22 oppSeg/Span/PtT=12/43/43 oppEndSpan=23 MissingCoin |
| 246 | 05: coinSeg/Span/PtT=2/3/3 endSpan=40 oppSeg/Span/PtT=12/24/24 oppEndSpan=44 MissingCoin |
| 247 | 06: coinSeg/Span/PtT=2/3/3 endSpan=40 oppSeg/Span/PtT=1/2/2 oppEndSpan=38 MissingCoin |
| 248 | 07: coinSeg/Span/PtT=12/44/44 endSpan=24 oppSeg/Span/PtT=2/40/40 oppEndSpan=3 MissingCoin |
| 249 | 08: coinSeg/Span/PtT=1/38/38 endSpan=2 oppSeg/Span/PtT=2/40/40 oppEndSpan=3 MissingCoin |
| 250 | 09: coinSeg/Span/PtT=12/23/23 endSpan=43 oppSeg/Span/PtT=11/22/22 oppEndSpan=21 MissingCoin |
| 251 | 10: coinSeg/Span/PtT=11/21/21 endSpan=22 oppSeg/Span/PtT=12/43/43 oppEndSpan=23 MissingCoin |
| 252 | 11: coinSeg/Span/PtT=2/3/3 endSpan=40 oppSeg/Span/PtT=12/24/24 oppEndSpan=44 MissingCoin |
| 253 | 12: segment=12 AddExpandedFail |
| 254 | 13: segment=12 startT=0 endT=0.809546 segment=11 oppStartT=1 oppEndT=0 AddMissingCoin |
| 255 | 14: segment=12 AddExpandedFail |
| 256 | 15: segment=12 startT=0 endT=0.809546 segment=11 oppStartT=1 oppEndT=0 AddMissingCoin |
| 257 | 16: seg/base=10/19 seg/base=12/43 MarkCoinStart |
| 258 | 17: seg/base=10/20 seg/base=12/44 MarkCoinEnd |
| 259 | 18: seg/base=9/17 seg/base=12/43 MarkCoinStart |
| 260 | 19: seg/base=9/18 seg/base=12/44 MarkCoinEnd |
| 261 | 20: seg/base=9/17 seg/base=10/19 MarkCoinStart |
| 262 | 21: seg/base=9/18 seg/base=10/20 MarkCoinEnd |
| 263 | 22: seg/base=8/42 seg/base=12/23 MarkCoinStart |
| 264 | 23: seg/base=8/16 seg/base=12/43 MarkCoinEnd |
| 265 | 24: seg/base=8/42 seg/base=11/21 MarkCoinStart |
| 266 | 25: seg/base=8/16 seg/base=11/22 MarkCoinEnd |
| 267 | 26: seg/base=12/23 seg/base=1/39 MarkCoinStart |
| 268 | 27: seg/base=12/24 seg/base=1/2 MarkCoinEnd |
| 269 | 28: seg/base=1/37 MarkCoinInsert |
| 270 | 29: seg/base=1/38 MarkCoinInsert |
| 271 | 30: seg/base=12/43 MarkCoinInsert |
| 272 | 31: seg/base=12/44 MarkCoinInsert |
| 273 | 32: seg/base=11/21 seg/base=1/39 MarkCoinStart |
| 274 | 33: seg/base=11/22 seg/base=1/37 MarkCoinEnd |
| 275 | 34: seg/base=10/19 seg/base=1/37 MarkCoinStart |
| 276 | 35: seg/base=10/20 seg/base=1/38 MarkCoinEnd |
| 277 | 36: seg/base=9/17 seg/base=1/37 MarkCoinStart |
| 278 | 37: seg/base=9/18 seg/base=1/38 MarkCoinEnd |
| 279 | 38: seg/base=8/15 seg/base=1/36 MarkCoinStart |
| 280 | 39: seg/base=8/16 seg/base=1/37 MarkCoinEnd |
| 281 | 40: seg/base=1/39 MarkCoinInsert |
| 282 | 41: seg/base=8/42 MarkCoinInsert |
| 283 | 42: seg/base=7/13 seg/base=1/35 MarkCoinStart |
| 284 | 43: seg/base=7/14 seg/base=1/36 MarkCoinEnd |
| 285 | active after moveMultiples: |
| 286 | debugShowActiveSpans id=1 (494.348663,224.583771 494.360813,224.620209 494.370148,224.657471 0.999263287f) t=0 tEnd=0.737524311 windSum=? windValue=1 |
| 287 | debugShowActiveSpans id=1 (494.370148,224.657471 494.372825,224.668224 494.375275,224.679031 0.999938607f) t=0.737524311 tEnd=0.95041534 windSum=? windValue=1 |
| 288 | debugShowActiveSpans id=1 (494.375275,224.679031 494.375488,224.679966 494.375702,224.680908 0.999999523f) t=0.95041534 tEnd=0.968840505 windSum=? windValue=1 |
| 289 | debugShowActiveSpans id=1 (494.375702,224.680908 494.375872,224.681675 494.376038,224.682449 0.999999702f) t=0.968840505 tEnd=0.984064836 windSum=? windValue=1 |
| 290 | debugShowActiveSpans id=1 (494.376038,224.682449 494.376136,224.68286 494.376221,224.683273 0.99999994f) t=0.984064836 tEnd=0.992175496 windSum=? windValue=1 |
| 291 | debugShowActiveSpans id=1 (494.376221,224.683273 494.376316,224.683669 494.376404,224.684067 0.99999994f) t=0.992175496 tEnd=1 windSum=? windValue=1 |
| 292 | debugShowActiveSpans id=2 (494.376404,224.684067 494.37619,224.6837 494.375977,224.683334) t=0 tEnd=0.000586871356 windSum=? windValue=1 |
| 293 | debugShowActiveSpans id=2 (494.375977,224.683334 494.0052,224.055672 494.019165,224.046982) t=0.000586871356 tEnd=1 windSum=? windValue=1 |
| 294 | debugShowActiveSpans id=3 (494.019165,224.046982 494.029083,224.040833 494.232056,224.345306) t=0 tEnd=1 windSum=? windValue=1 |
| 295 | debugShowActiveSpans id=4 (494.232056,224.345306 494.273193,224.406982 494.30481,224.474213) t=0 tEnd=1 windSum=? windValue=1 |
| 296 | debugShowActiveSpans id=5 (494.30481,224.474213 494.329991,224.527724 494.348663,224.58374) t=0 tEnd=0.835281662 windSum=? windValue=1 |
| 297 | debugShowActiveSpans id=5 (494.348663,224.58374 494.352356,224.594819 494.355774,224.605927) t=0.835281662 tEnd=1 windSum=? windValue=1 |
| 298 | debugShowActiveSpans id=6 (494.355774,224.605927 494.363708,224.631714 494.370148,224.657471) t=0 tEnd=1 windSum=? windValue=1 |
| 299 | debugShowActiveSpans id=7 (494.370148,224.657471 494.375275,224.679031) t=0 tEnd=1 windSum=? windValue=1 |
| 300 | debugShowActiveSpans id=8 (494.375275,224.679031 494.375702,224.680908) t=0 tEnd=0.547725719 windSum=? windValue=1 |
| 301 | debugShowActiveSpans id=8 (494.375702,224.680908 494.376038,224.682449) t=0.547725719 tEnd=1 windSum=? windValue=1 |
| 302 | debugShowActiveSpans id=9 (494.376038,224.682449 494.376221,224.683273) t=0 tEnd=1 windSum=? windValue=1 |
| 303 | debugShowActiveSpans id=10 (494.376221,224.683273 494.376007,224.682281) t=0 tEnd=1 windSum=? windValue=1 |
| 304 | debugShowActiveSpans id=11 (494.376007,224.682281 494.375671,224.680908) t=0 tEnd=1 windSum=? windValue=1 |
| 305 | debugShowActiveSpans id=12 (494.375671,224.680908 494.375445,224.679787 494.376129,224.682434) t=0 tEnd=0.809546276 windSum=? windValue=1 |
| 306 | debugShowActiveSpans id=12 (494.376129,224.682434 494.376227,224.682801 494.376343,224.683243) t=0.809546276 tEnd=0.924341302 windSum=? windValue=1 |
| 307 | debugShowActiveSpans id=12 (494.376343,224.683243 494.376415,224.683539 494.376495,224.683868) t=0.924341302 tEnd=1 windSum=? windValue=1 |
| 308 | debugShowActiveSpans id=13 (494.376495,224.683868 494.634338,225.414886 494.895874,225.840698) t=0 tEnd=1 windSum=? windValue=1 |
| 309 | debugShowActiveSpans id=14 (494.895874,225.840698 495.737305,227.210602 497.243317,227.90419) t=0 tEnd=1 windSum=? windValue=1 |
| 310 | debugShowActiveSpans id=15 (497.243317,227.90419 502.109781,230.145352 511.897949,224.957367) t=0 tEnd=0.929653854 windSum=? windValue=1 |
| 311 | debugShowActiveSpans id=15 (511.897949,224.957367 512.63876,224.564718 513.407471,224.129684) t=0.929653854 tEnd=1 windSum=? windValue=1 |
| 312 | debugShowActiveSpans id=16 (513.407471,224.129684 513.900024,224.999985) t=0 tEnd=1 windSum=? windValue=1 |
| 313 | debugShowActiveSpans id=17 (513.900024,224.999985 511.897949,224.957367) t=0 tEnd=0.102400099 windSum=? windValue=1 |
| 314 | debugShowActiveSpans id=17 (511.897949,224.957367 494.348663,224.583771) t=0.102400099 tEnd=1 windSum=? windValue=1 |
| 315 | --x--x---------xx-x--x------------x moveNearby |
| 316 | 00: coinSeg/Span/PtT=2/3/3 endSpan=40 oppSeg/Span/PtT=1/2/2 oppEndSpan=38 MissingCoin |
| 317 | 01: coinSeg/Span/PtT=12/44/44 endSpan=24 oppSeg/Span/PtT=2/40/40 oppEndSpan=3 MissingCoin |
| 318 | 02: coinSeg/Span/PtT=1/38/38 endSpan=2 oppSeg/Span/PtT=2/40/40 oppEndSpan=3 MissingCoin |
| 319 | 03: coinSeg/Span/PtT=12/23/23 endSpan=43 oppSeg/Span/PtT=11/22/22 oppEndSpan=21 MissingCoin |
| 320 | 04: coinSeg/Span/PtT=11/21/21 endSpan=22 oppSeg/Span/PtT=12/43/43 oppEndSpan=23 MissingCoin |
| 321 | 05: coinSeg/Span/PtT=2/3/3 endSpan=40 oppSeg/Span/PtT=12/24/24 oppEndSpan=44 MissingCoin |
| 322 | 06: coinSeg/Span/PtT=2/3/3 endSpan=40 oppSeg/Span/PtT=1/2/2 oppEndSpan=38 MissingCoin |
| 323 | 07: coinSeg/Span/PtT=12/44/44 endSpan=24 oppSeg/Span/PtT=2/40/40 oppEndSpan=3 MissingCoin |
| 324 | 08: coinSeg/Span/PtT=1/38/38 endSpan=2 oppSeg/Span/PtT=2/40/40 oppEndSpan=3 MissingCoin |
| 325 | 09: coinSeg/Span/PtT=12/23/23 endSpan=43 oppSeg/Span/PtT=11/22/22 oppEndSpan=21 MissingCoin |
| 326 | 10: coinSeg/Span/PtT=11/21/21 endSpan=22 oppSeg/Span/PtT=12/43/43 oppEndSpan=23 MissingCoin |
| 327 | 11: coinSeg/Span/PtT=2/3/3 endSpan=40 oppSeg/Span/PtT=12/24/24 oppEndSpan=44 MissingCoin |
| 328 | 12: segment=12 AddExpandedFail |
| 329 | 13: segment=12 startT=0 endT=0.809546 segment=11 oppStartT=1 oppEndT=0 AddMissingCoin |
| 330 | 14: segment=12 AddExpandedFail |
| 331 | 15: segment=12 startT=0 endT=0.809546 segment=11 oppStartT=1 oppEndT=0 AddMissingCoin |
| 332 | 16: seg/base=10/19 seg/base=12/43 MarkCoinStart |
| 333 | 17: seg/base=10/20 seg/base=12/44 MarkCoinEnd |
| 334 | 18: seg/base=9/17 seg/base=12/43 MarkCoinStart |
| 335 | 19: seg/base=9/18 seg/base=12/44 MarkCoinEnd |
| 336 | 20: seg/base=9/17 seg/base=10/19 MarkCoinStart |
| 337 | 21: seg/base=9/18 seg/base=10/20 MarkCoinEnd |
| 338 | 22: seg/base=8/42 seg/base=12/23 MarkCoinStart |
| 339 | 23: seg/base=8/16 seg/base=12/43 MarkCoinEnd |
| 340 | 24: seg/base=8/42 seg/base=11/21 MarkCoinStart |
| 341 | 25: seg/base=8/16 seg/base=11/22 MarkCoinEnd |
| 342 | 26: seg/base=12/23 seg/base=1/39 MarkCoinStart |
| 343 | 27: seg/base=12/24 seg/base=1/2 MarkCoinEnd |
| 344 | 28: seg/base=1/37 MarkCoinInsert |
| 345 | 29: seg/base=1/38 MarkCoinInsert |
| 346 | 30: seg/base=12/43 MarkCoinInsert |
| 347 | 31: seg/base=12/44 MarkCoinInsert |
| 348 | 32: seg/base=11/21 seg/base=1/39 MarkCoinStart |
| 349 | 33: seg/base=11/22 seg/base=1/37 MarkCoinEnd |
| 350 | 34: seg/base=10/19 seg/base=1/37 MarkCoinStart |
| 351 | 35: seg/base=10/20 seg/base=1/38 MarkCoinEnd |
| 352 | 36: seg/base=9/17 seg/base=1/37 MarkCoinStart |
| 353 | 37: seg/base=9/18 seg/base=1/38 MarkCoinEnd |
| 354 | 38: seg/base=8/15 seg/base=1/36 MarkCoinStart |
| 355 | 39: seg/base=8/16 seg/base=1/37 MarkCoinEnd |
| 356 | 40: seg/base=1/39 MarkCoinInsert |
| 357 | 41: seg/base=8/42 MarkCoinInsert |
| 358 | 42: seg/base=7/13 seg/base=1/35 MarkCoinStart |
| 359 | 43: seg/base=7/14 seg/base=1/36 MarkCoinEnd |
| 360 | active after moveNearby: |
| 361 | debugShowActiveSpans id=1 (494.348663,224.583771 494.360813,224.620209 494.370148,224.657471 0.999263287f) t=0 tEnd=0.737524311 windSum=? windValue=1 |
| 362 | debugShowActiveSpans id=1 (494.370148,224.657471 494.372825,224.668224 494.375275,224.679031 0.999938607f) t=0.737524311 tEnd=0.95041534 windSum=? windValue=1 |
| 363 | debugShowActiveSpans id=1 (494.375275,224.679031 494.375488,224.679966 494.375702,224.680908 0.999999523f) t=0.95041534 tEnd=0.968840505 windSum=? windValue=1 |
| 364 | debugShowActiveSpans id=1 (494.375702,224.680908 494.375872,224.681675 494.376038,224.682449 0.999999702f) t=0.968840505 tEnd=0.984064836 windSum=? windValue=1 |
| 365 | debugShowActiveSpans id=1 (494.376038,224.682449 494.376136,224.68286 494.376221,224.683273 0.99999994f) t=0.984064836 tEnd=0.992175496 windSum=? windValue=1 |
| 366 | debugShowActiveSpans id=1 (494.376221,224.683273 494.376316,224.683669 494.376404,224.684067 0.99999994f) t=0.992175496 tEnd=1 windSum=? windValue=1 |
| 367 | debugShowActiveSpans id=2 (494.376404,224.684067 494.37619,224.6837 494.375977,224.683334) t=0 tEnd=0.000586871356 windSum=? windValue=1 |
| 368 | debugShowActiveSpans id=2 (494.375977,224.683334 494.0052,224.055672 494.019165,224.046982) t=0.000586871356 tEnd=1 windSum=? windValue=1 |
| 369 | debugShowActiveSpans id=3 (494.019165,224.046982 494.029083,224.040833 494.232056,224.345306) t=0 tEnd=1 windSum=? windValue=1 |
| 370 | debugShowActiveSpans id=4 (494.232056,224.345306 494.273193,224.406982 494.30481,224.474213) t=0 tEnd=1 windSum=? windValue=1 |
| 371 | debugShowActiveSpans id=5 (494.30481,224.474213 494.329991,224.527724 494.348663,224.58374) t=0 tEnd=0.835281662 windSum=? windValue=1 |
| 372 | debugShowActiveSpans id=5 (494.348663,224.58374 494.352356,224.594819 494.355774,224.605927) t=0.835281662 tEnd=1 windSum=? windValue=1 |
| 373 | debugShowActiveSpans id=6 (494.355774,224.605927 494.363708,224.631714 494.370148,224.657471) t=0 tEnd=1 windSum=? windValue=1 |
| 374 | debugShowActiveSpans id=7 (494.370148,224.657471 494.375275,224.679031) t=0 tEnd=1 windSum=? windValue=1 |
| 375 | debugShowActiveSpans id=8 (494.375275,224.679031 494.375702,224.680908) t=0 tEnd=0.547725719 windSum=? windValue=1 |
| 376 | debugShowActiveSpans id=8 (494.375702,224.680908 494.376038,224.682449) t=0.547725719 tEnd=1 windSum=? windValue=1 |
| 377 | debugShowActiveSpans id=9 (494.376038,224.682449 494.376221,224.683273) t=0 tEnd=1 windSum=? windValue=1 |
| 378 | debugShowActiveSpans id=10 (494.376221,224.683273 494.376007,224.682281) t=0 tEnd=1 windSum=? windValue=1 |
| 379 | debugShowActiveSpans id=11 (494.376007,224.682281 494.375671,224.680908) t=0 tEnd=1 windSum=? windValue=1 |
| 380 | debugShowActiveSpans id=12 (494.375671,224.680908 494.375445,224.679787 494.376129,224.682434) t=0 tEnd=0.809546276 windSum=? windValue=1 |
| 381 | debugShowActiveSpans id=12 (494.376129,224.682434 494.376227,224.682801 494.376343,224.683243) t=0.809546276 tEnd=0.924341302 windSum=? windValue=1 |
| 382 | debugShowActiveSpans id=12 (494.376343,224.683243 494.376415,224.683539 494.376495,224.683868) t=0.924341302 tEnd=1 windSum=? windValue=1 |
| 383 | debugShowActiveSpans id=13 (494.376495,224.683868 494.634338,225.414886 494.895874,225.840698) t=0 tEnd=1 windSum=? windValue=1 |
| 384 | debugShowActiveSpans id=14 (494.895874,225.840698 495.737305,227.210602 497.243317,227.90419) t=0 tEnd=1 windSum=? windValue=1 |
| 385 | debugShowActiveSpans id=15 (497.243317,227.90419 502.109781,230.145352 511.897949,224.957367) t=0 tEnd=0.929653854 windSum=? windValue=1 |
| 386 | debugShowActiveSpans id=15 (511.897949,224.957367 512.63876,224.564718 513.407471,224.129684) t=0.929653854 tEnd=1 windSum=? windValue=1 |
| 387 | debugShowActiveSpans id=16 (513.407471,224.129684 513.900024,224.999985) t=0 tEnd=1 windSum=? windValue=1 |
| 388 | debugShowActiveSpans id=17 (513.900024,224.999985 511.897949,224.957367) t=0 tEnd=0.102400099 windSum=? windValue=1 |
| 389 | debugShowActiveSpans id=17 (511.897949,224.957367 494.348663,224.583771) t=0.102400099 tEnd=1 windSum=? windValue=1 |
| 390 | --x--x---------xx-x--x------------x addEndMovedSpans |
| 391 | 00: coinSeg/Span/PtT=2/3/3 endSpan=40 oppSeg/Span/PtT=1/2/2 oppEndSpan=38 MissingCoin |
| 392 | 01: coinSeg/Span/PtT=12/44/44 endSpan=24 oppSeg/Span/PtT=2/40/40 oppEndSpan=3 MissingCoin |
| 393 | 02: coinSeg/Span/PtT=1/38/38 endSpan=2 oppSeg/Span/PtT=2/40/40 oppEndSpan=3 MissingCoin |
| 394 | 03: coinSeg/Span/PtT=12/23/23 endSpan=43 oppSeg/Span/PtT=11/22/22 oppEndSpan=21 MissingCoin |
| 395 | 04: coinSeg/Span/PtT=11/21/21 endSpan=22 oppSeg/Span/PtT=12/43/43 oppEndSpan=23 MissingCoin |
| 396 | 05: coinSeg/Span/PtT=2/3/3 endSpan=40 oppSeg/Span/PtT=12/24/24 oppEndSpan=44 MissingCoin |
| 397 | 06: coinSeg/Span/PtT=2/3/3 endSpan=40 oppSeg/Span/PtT=1/2/2 oppEndSpan=38 MissingCoin |
| 398 | 07: coinSeg/Span/PtT=12/44/44 endSpan=24 oppSeg/Span/PtT=2/40/40 oppEndSpan=3 MissingCoin |
| 399 | 08: coinSeg/Span/PtT=1/38/38 endSpan=2 oppSeg/Span/PtT=2/40/40 oppEndSpan=3 MissingCoin |
| 400 | 09: coinSeg/Span/PtT=12/23/23 endSpan=43 oppSeg/Span/PtT=11/22/22 oppEndSpan=21 MissingCoin |
| 401 | 10: coinSeg/Span/PtT=11/21/21 endSpan=22 oppSeg/Span/PtT=12/43/43 oppEndSpan=23 MissingCoin |
| 402 | 11: coinSeg/Span/PtT=2/3/3 endSpan=40 oppSeg/Span/PtT=12/24/24 oppEndSpan=44 MissingCoin |
| 403 | 12: segment=12 AddExpandedFail |
| 404 | 13: segment=12 startT=0 endT=0.809546 segment=11 oppStartT=1 oppEndT=0 AddMissingCoin |
| 405 | 14: segment=12 AddExpandedFail |
| 406 | 15: segment=12 startT=0 endT=0.809546 segment=11 oppStartT=1 oppEndT=0 AddMissingCoin |
| 407 | 16: seg/base=10/19 seg/base=12/43 MarkCoinStart |
| 408 | 17: seg/base=10/20 seg/base=12/44 MarkCoinEnd |
| 409 | 18: seg/base=9/17 seg/base=12/43 MarkCoinStart |
| 410 | 19: seg/base=9/18 seg/base=12/44 MarkCoinEnd |
| 411 | 20: seg/base=9/17 seg/base=10/19 MarkCoinStart |
| 412 | 21: seg/base=9/18 seg/base=10/20 MarkCoinEnd |
| 413 | 22: seg/base=8/42 seg/base=12/23 MarkCoinStart |
| 414 | 23: seg/base=8/16 seg/base=12/43 MarkCoinEnd |
| 415 | 24: seg/base=8/42 seg/base=11/21 MarkCoinStart |
| 416 | 25: seg/base=8/16 seg/base=11/22 MarkCoinEnd |
| 417 | 26: seg/base=12/23 seg/base=1/39 MarkCoinStart |
| 418 | 27: seg/base=12/24 seg/base=1/2 MarkCoinEnd |
| 419 | 28: seg/base=1/37 MarkCoinInsert |
| 420 | 29: seg/base=1/38 MarkCoinInsert |
| 421 | 30: seg/base=12/43 MarkCoinInsert |
| 422 | 31: seg/base=12/44 MarkCoinInsert |
| 423 | 32: seg/base=11/21 seg/base=1/39 MarkCoinStart |
| 424 | 33: seg/base=11/22 seg/base=1/37 MarkCoinEnd |
| 425 | 34: seg/base=10/19 seg/base=1/37 MarkCoinStart |
| 426 | 35: seg/base=10/20 seg/base=1/38 MarkCoinEnd |
| 427 | 36: seg/base=9/17 seg/base=1/37 MarkCoinStart |
| 428 | 37: seg/base=9/18 seg/base=1/38 MarkCoinEnd |
| 429 | 38: seg/base=8/15 seg/base=1/36 MarkCoinStart |
| 430 | 39: seg/base=8/16 seg/base=1/37 MarkCoinEnd |
| 431 | 40: seg/base=1/39 MarkCoinInsert |
| 432 | 41: seg/base=8/42 MarkCoinInsert |
| 433 | 42: seg/base=7/13 seg/base=1/35 MarkCoinStart |
| 434 | 43: seg/base=7/14 seg/base=1/36 MarkCoinEnd |
| 435 | active after addEndMovedSpans: |
| 436 | debugShowActiveSpans id=1 (494.348663,224.583771 494.360813,224.620209 494.370148,224.657471 0.999263287f) t=0 tEnd=0.737524311 windSum=? windValue=1 |
| 437 | debugShowActiveSpans id=1 (494.370148,224.657471 494.372825,224.668224 494.375275,224.679031 0.999938607f) t=0.737524311 tEnd=0.95041534 windSum=? windValue=1 |
| 438 | debugShowActiveSpans id=1 (494.375275,224.679031 494.375488,224.679966 494.375702,224.680908 0.999999523f) t=0.95041534 tEnd=0.968840505 windSum=? windValue=1 |
| 439 | debugShowActiveSpans id=1 (494.375702,224.680908 494.375872,224.681675 494.376038,224.682449 0.999999702f) t=0.968840505 tEnd=0.984064836 windSum=? windValue=1 |
| 440 | debugShowActiveSpans id=1 (494.376038,224.682449 494.376136,224.68286 494.376221,224.683273 0.99999994f) t=0.984064836 tEnd=0.992175496 windSum=? windValue=1 |
| 441 | debugShowActiveSpans id=1 (494.376221,224.683273 494.376316,224.683669 494.376404,224.684067 0.99999994f) t=0.992175496 tEnd=1 windSum=? windValue=1 |
| 442 | debugShowActiveSpans id=2 (494.376404,224.684067 494.37619,224.6837 494.375977,224.683334) t=0 tEnd=0.000586871356 windSum=? windValue=1 |
| 443 | debugShowActiveSpans id=2 (494.375977,224.683334 494.0052,224.055672 494.019165,224.046982) t=0.000586871356 tEnd=1 windSum=? windValue=1 |
| 444 | debugShowActiveSpans id=3 (494.019165,224.046982 494.029083,224.040833 494.232056,224.345306) t=0 tEnd=1 windSum=? windValue=1 |
| 445 | debugShowActiveSpans id=4 (494.232056,224.345306 494.273193,224.406982 494.30481,224.474213) t=0 tEnd=1 windSum=? windValue=1 |
| 446 | debugShowActiveSpans id=5 (494.30481,224.474213 494.329991,224.527724 494.348663,224.58374) t=0 tEnd=0.835281662 windSum=? windValue=1 |
| 447 | debugShowActiveSpans id=5 (494.348663,224.58374 494.352356,224.594819 494.355774,224.605927) t=0.835281662 tEnd=1 windSum=? windValue=1 |
| 448 | debugShowActiveSpans id=6 (494.355774,224.605927 494.363708,224.631714 494.370148,224.657471) t=0 tEnd=1 windSum=? windValue=1 |
| 449 | debugShowActiveSpans id=7 (494.370148,224.657471 494.375275,224.679031) t=0 tEnd=1 windSum=? windValue=1 |
| 450 | debugShowActiveSpans id=8 (494.375275,224.679031 494.375702,224.680908) t=0 tEnd=0.547725719 windSum=? windValue=1 |
| 451 | debugShowActiveSpans id=8 (494.375702,224.680908 494.376038,224.682449) t=0.547725719 tEnd=1 windSum=? windValue=1 |
| 452 | debugShowActiveSpans id=9 (494.376038,224.682449 494.376221,224.683273) t=0 tEnd=1 windSum=? windValue=1 |
| 453 | debugShowActiveSpans id=10 (494.376221,224.683273 494.376007,224.682281) t=0 tEnd=1 windSum=? windValue=1 |
| 454 | debugShowActiveSpans id=11 (494.376007,224.682281 494.375671,224.680908) t=0 tEnd=1 windSum=? windValue=1 |
| 455 | debugShowActiveSpans id=12 (494.375671,224.680908 494.375445,224.679787 494.376129,224.682434) t=0 tEnd=0.809546276 windSum=? windValue=1 |
| 456 | debugShowActiveSpans id=12 (494.376129,224.682434 494.376227,224.682801 494.376343,224.683243) t=0.809546276 tEnd=0.924341302 windSum=? windValue=1 |
| 457 | debugShowActiveSpans id=12 (494.376343,224.683243 494.376415,224.683539 494.376495,224.683868) t=0.924341302 tEnd=1 windSum=? windValue=1 |
| 458 | debugShowActiveSpans id=13 (494.376495,224.683868 494.634338,225.414886 494.895874,225.840698) t=0 tEnd=1 windSum=? windValue=1 |
| 459 | debugShowActiveSpans id=14 (494.895874,225.840698 495.737305,227.210602 497.243317,227.90419) t=0 tEnd=1 windSum=? windValue=1 |
| 460 | debugShowActiveSpans id=15 (497.243317,227.90419 502.109781,230.145352 511.897949,224.957367) t=0 tEnd=0.929653854 windSum=? windValue=1 |
| 461 | debugShowActiveSpans id=15 (511.897949,224.957367 512.63876,224.564718 513.407471,224.129684) t=0.929653854 tEnd=1 windSum=? windValue=1 |
| 462 | debugShowActiveSpans id=16 (513.407471,224.129684 513.900024,224.999985) t=0 tEnd=1 windSum=? windValue=1 |
| 463 | debugShowActiveSpans id=17 (513.900024,224.999985 511.897949,224.957367) t=0 tEnd=0.102400099 windSum=? windValue=1 |
| 464 | debugShowActiveSpans id=17 (511.897949,224.957367 494.348663,224.583771) t=0.102400099 tEnd=1 windSum=? windValue=1 |
| 465 | coinSpan - id=11 t=0 tEnd=1 |
| 466 | coinSpan + id=12 t=0.809546276 tEnd=0 |
| 467 | ---------------xx-x--x------------- addMissing |
| 468 | 00: coinSeg/Span/PtT=2/3/3 endSpan=40 oppSeg/Span/PtT=1/2/2 oppEndSpan=38 MissingCoin |
| 469 | 01: coinSeg/Span/PtT=12/44/44 endSpan=24 oppSeg/Span/PtT=2/40/40 oppEndSpan=3 MissingCoin |
| 470 | 02: coinSeg/Span/PtT=1/38/38 endSpan=2 oppSeg/Span/PtT=2/40/40 oppEndSpan=3 MissingCoin |
| 471 | 03: coinSeg/Span/PtT=2/3/3 endSpan=40 oppSeg/Span/PtT=12/24/24 oppEndSpan=44 MissingCoin |
| 472 | 04: coinSeg/Span/PtT=2/3/3 endSpan=40 oppSeg/Span/PtT=1/2/2 oppEndSpan=38 MissingCoin |
| 473 | 05: coinSeg/Span/PtT=12/44/44 endSpan=24 oppSeg/Span/PtT=2/40/40 oppEndSpan=3 MissingCoin |
| 474 | 06: coinSeg/Span/PtT=1/38/38 endSpan=2 oppSeg/Span/PtT=2/40/40 oppEndSpan=3 MissingCoin |
| 475 | 07: coinSeg/Span/PtT=2/3/3 endSpan=40 oppSeg/Span/PtT=12/24/24 oppEndSpan=44 MissingCoin |
| 476 | 08: seg/base=11/21 seg/base=12/23 MarkCoinStart |
| 477 | 09: seg/base=11/22 seg/base=12/43 MarkCoinEnd |
| 478 | 10: seg/base=10/19 seg/base=12/43 MarkCoinStart |
| 479 | 11: seg/base=10/20 seg/base=12/44 MarkCoinEnd |
| 480 | 12: seg/base=9/17 seg/base=12/43 MarkCoinStart |
| 481 | 13: seg/base=9/18 seg/base=12/44 MarkCoinEnd |
| 482 | 14: seg/base=9/17 seg/base=10/19 MarkCoinStart |
| 483 | 15: seg/base=9/18 seg/base=10/20 MarkCoinEnd |
| 484 | 16: seg/base=8/42 seg/base=12/23 MarkCoinStart |
| 485 | 17: seg/base=8/16 seg/base=12/43 MarkCoinEnd |
| 486 | 18: seg/base=8/42 seg/base=11/21 MarkCoinStart |
| 487 | 19: seg/base=8/16 seg/base=11/22 MarkCoinEnd |
| 488 | 20: seg/base=12/23 seg/base=1/39 MarkCoinStart |
| 489 | 21: seg/base=12/24 seg/base=1/2 MarkCoinEnd |
| 490 | 22: seg/base=1/37 MarkCoinInsert |
| 491 | 23: seg/base=1/38 MarkCoinInsert |
| 492 | 24: seg/base=12/43 MarkCoinInsert |
| 493 | 25: seg/base=12/44 MarkCoinInsert |
| 494 | 26: seg/base=11/21 seg/base=1/39 MarkCoinStart |
| 495 | 27: seg/base=11/22 seg/base=1/37 MarkCoinEnd |
| 496 | 28: seg/base=10/19 seg/base=1/37 MarkCoinStart |
| 497 | 29: seg/base=10/20 seg/base=1/38 MarkCoinEnd |
| 498 | 30: seg/base=9/17 seg/base=1/37 MarkCoinStart |
| 499 | 31: seg/base=9/18 seg/base=1/38 MarkCoinEnd |
| 500 | 32: seg/base=8/15 seg/base=1/36 MarkCoinStart |
| 501 | 33: seg/base=8/16 seg/base=1/37 MarkCoinEnd |
| 502 | 34: seg/base=1/39 MarkCoinInsert |
| 503 | 35: seg/base=8/42 MarkCoinInsert |
| 504 | 36: seg/base=7/13 seg/base=1/35 MarkCoinStart |
| 505 | 37: seg/base=7/14 seg/base=1/36 MarkCoinEnd |
| 506 | active after addMissing: |
| 507 | debugShowActiveSpans id=1 (494.348663,224.583771 494.360813,224.620209 494.370148,224.657471 0.999263287f) t=0 tEnd=0.737524311 windSum=? windValue=1 |
| 508 | debugShowActiveSpans id=1 (494.370148,224.657471 494.372825,224.668224 494.375275,224.679031 0.999938607f) t=0.737524311 tEnd=0.95041534 windSum=? windValue=1 |
| 509 | debugShowActiveSpans id=1 (494.375275,224.679031 494.375488,224.679966 494.375702,224.680908 0.999999523f) t=0.95041534 tEnd=0.968840505 windSum=? windValue=1 |
| 510 | debugShowActiveSpans id=1 (494.375702,224.680908 494.375872,224.681675 494.376038,224.682449 0.999999702f) t=0.968840505 tEnd=0.984064836 windSum=? windValue=1 |
| 511 | debugShowActiveSpans id=1 (494.376038,224.682449 494.376136,224.68286 494.376221,224.683273 0.99999994f) t=0.984064836 tEnd=0.992175496 windSum=? windValue=1 |
| 512 | debugShowActiveSpans id=1 (494.376221,224.683273 494.376316,224.683669 494.376404,224.684067 0.99999994f) t=0.992175496 tEnd=1 windSum=? windValue=1 |
| 513 | debugShowActiveSpans id=2 (494.376404,224.684067 494.37619,224.6837 494.375977,224.683334) t=0 tEnd=0.000586871356 windSum=? windValue=1 |
| 514 | debugShowActiveSpans id=2 (494.375977,224.683334 494.0052,224.055672 494.019165,224.046982) t=0.000586871356 tEnd=1 windSum=? windValue=1 |
| 515 | debugShowActiveSpans id=3 (494.019165,224.046982 494.029083,224.040833 494.232056,224.345306) t=0 tEnd=1 windSum=? windValue=1 |
| 516 | debugShowActiveSpans id=4 (494.232056,224.345306 494.273193,224.406982 494.30481,224.474213) t=0 tEnd=1 windSum=? windValue=1 |
| 517 | debugShowActiveSpans id=5 (494.30481,224.474213 494.329991,224.527724 494.348663,224.58374) t=0 tEnd=0.835281662 windSum=? windValue=1 |
| 518 | debugShowActiveSpans id=5 (494.348663,224.58374 494.352356,224.594819 494.355774,224.605927) t=0.835281662 tEnd=1 windSum=? windValue=1 |
| 519 | debugShowActiveSpans id=6 (494.355774,224.605927 494.363708,224.631714 494.370148,224.657471) t=0 tEnd=1 windSum=? windValue=1 |
| 520 | debugShowActiveSpans id=7 (494.370148,224.657471 494.375275,224.679031) t=0 tEnd=1 windSum=? windValue=1 |
| 521 | debugShowActiveSpans id=8 (494.375275,224.679031 494.375702,224.680908) t=0 tEnd=0.547725719 windSum=? windValue=1 |
| 522 | debugShowActiveSpans id=8 (494.375702,224.680908 494.376038,224.682449) t=0.547725719 tEnd=1 windSum=? windValue=1 |
| 523 | debugShowActiveSpans id=9 (494.376038,224.682449 494.376221,224.683273) t=0 tEnd=1 windSum=? windValue=1 |
| 524 | debugShowActiveSpans id=10 (494.376221,224.683273 494.376007,224.682281) t=0 tEnd=1 windSum=? windValue=1 |
| 525 | debugShowActiveSpans id=11 (494.376007,224.682281 494.375671,224.680908) t=0 tEnd=1 windSum=? windValue=1 |
| 526 | debugShowActiveSpans id=12 (494.375671,224.680908 494.375445,224.679787 494.376129,224.682434) t=0 tEnd=0.809546276 windSum=? windValue=1 |
| 527 | debugShowActiveSpans id=12 (494.376129,224.682434 494.376227,224.682801 494.376343,224.683243) t=0.809546276 tEnd=0.924341302 windSum=? windValue=1 |
| 528 | debugShowActiveSpans id=12 (494.376343,224.683243 494.376415,224.683539 494.376495,224.683868) t=0.924341302 tEnd=1 windSum=? windValue=1 |
| 529 | debugShowActiveSpans id=13 (494.376495,224.683868 494.634338,225.414886 494.895874,225.840698) t=0 tEnd=1 windSum=? windValue=1 |
| 530 | debugShowActiveSpans id=14 (494.895874,225.840698 495.737305,227.210602 497.243317,227.90419) t=0 tEnd=1 windSum=? windValue=1 |
| 531 | debugShowActiveSpans id=15 (497.243317,227.90419 502.109781,230.145352 511.897949,224.957367) t=0 tEnd=0.929653854 windSum=? windValue=1 |
| 532 | debugShowActiveSpans id=15 (511.897949,224.957367 512.63876,224.564718 513.407471,224.129684) t=0.929653854 tEnd=1 windSum=? windValue=1 |
| 533 | debugShowActiveSpans id=16 (513.407471,224.129684 513.900024,224.999985) t=0 tEnd=1 windSum=? windValue=1 |
| 534 | debugShowActiveSpans id=17 (513.900024,224.999985 511.897949,224.957367) t=0 tEnd=0.102400099 windSum=? windValue=1 |
| 535 | debugShowActiveSpans id=17 (511.897949,224.957367 494.348663,224.583771) t=0.102400099 tEnd=1 windSum=? windValue=1 |
| 536 | ---------------xx-x--x------------- moveNearby |
| 537 | 00: coinSeg/Span/PtT=2/3/3 endSpan=40 oppSeg/Span/PtT=1/2/2 oppEndSpan=38 MissingCoin |
| 538 | 01: coinSeg/Span/PtT=12/44/44 endSpan=24 oppSeg/Span/PtT=2/40/40 oppEndSpan=3 MissingCoin |
| 539 | 02: coinSeg/Span/PtT=1/38/38 endSpan=2 oppSeg/Span/PtT=2/40/40 oppEndSpan=3 MissingCoin |
| 540 | 03: coinSeg/Span/PtT=2/3/3 endSpan=40 oppSeg/Span/PtT=12/24/24 oppEndSpan=44 MissingCoin |
| 541 | 04: coinSeg/Span/PtT=2/3/3 endSpan=40 oppSeg/Span/PtT=1/2/2 oppEndSpan=38 MissingCoin |
| 542 | 05: coinSeg/Span/PtT=12/44/44 endSpan=24 oppSeg/Span/PtT=2/40/40 oppEndSpan=3 MissingCoin |
| 543 | 06: coinSeg/Span/PtT=1/38/38 endSpan=2 oppSeg/Span/PtT=2/40/40 oppEndSpan=3 MissingCoin |
| 544 | 07: coinSeg/Span/PtT=2/3/3 endSpan=40 oppSeg/Span/PtT=12/24/24 oppEndSpan=44 MissingCoin |
| 545 | 08: seg/base=11/21 seg/base=12/23 MarkCoinStart |
| 546 | 09: seg/base=11/22 seg/base=12/43 MarkCoinEnd |
| 547 | 10: seg/base=10/19 seg/base=12/43 MarkCoinStart |
| 548 | 11: seg/base=10/20 seg/base=12/44 MarkCoinEnd |
| 549 | 12: seg/base=9/17 seg/base=12/43 MarkCoinStart |
| 550 | 13: seg/base=9/18 seg/base=12/44 MarkCoinEnd |
| 551 | 14: seg/base=9/17 seg/base=10/19 MarkCoinStart |
| 552 | 15: seg/base=9/18 seg/base=10/20 MarkCoinEnd |
| 553 | 16: seg/base=8/42 seg/base=12/23 MarkCoinStart |
| 554 | 17: seg/base=8/16 seg/base=12/43 MarkCoinEnd |
| 555 | 18: seg/base=8/42 seg/base=11/21 MarkCoinStart |
| 556 | 19: seg/base=8/16 seg/base=11/22 MarkCoinEnd |
| 557 | 20: seg/base=12/23 seg/base=1/39 MarkCoinStart |
| 558 | 21: seg/base=12/24 seg/base=1/2 MarkCoinEnd |
| 559 | 22: seg/base=1/37 MarkCoinInsert |
| 560 | 23: seg/base=1/38 MarkCoinInsert |
| 561 | 24: seg/base=12/43 MarkCoinInsert |
| 562 | 25: seg/base=12/44 MarkCoinInsert |
| 563 | 26: seg/base=11/21 seg/base=1/39 MarkCoinStart |
| 564 | 27: seg/base=11/22 seg/base=1/37 MarkCoinEnd |
| 565 | 28: seg/base=10/19 seg/base=1/37 MarkCoinStart |
| 566 | 29: seg/base=10/20 seg/base=1/38 MarkCoinEnd |
| 567 | 30: seg/base=9/17 seg/base=1/37 MarkCoinStart |
| 568 | 31: seg/base=9/18 seg/base=1/38 MarkCoinEnd |
| 569 | 32: seg/base=8/15 seg/base=1/36 MarkCoinStart |
| 570 | 33: seg/base=8/16 seg/base=1/37 MarkCoinEnd |
| 571 | 34: seg/base=1/39 MarkCoinInsert |
| 572 | 35: seg/base=8/42 MarkCoinInsert |
| 573 | 36: seg/base=7/13 seg/base=1/35 MarkCoinStart |
| 574 | 37: seg/base=7/14 seg/base=1/36 MarkCoinEnd |
| 575 | active after moveNearby: |
| 576 | debugShowActiveSpans id=1 (494.348663,224.583771 494.360813,224.620209 494.370148,224.657471 0.999263287f) t=0 tEnd=0.737524311 windSum=? windValue=1 |
| 577 | debugShowActiveSpans id=1 (494.370148,224.657471 494.372825,224.668224 494.375275,224.679031 0.999938607f) t=0.737524311 tEnd=0.95041534 windSum=? windValue=1 |
| 578 | debugShowActiveSpans id=1 (494.375275,224.679031 494.375488,224.679966 494.375702,224.680908 0.999999523f) t=0.95041534 tEnd=0.968840505 windSum=? windValue=1 |
| 579 | debugShowActiveSpans id=1 (494.375702,224.680908 494.375872,224.681675 494.376038,224.682449 0.999999702f) t=0.968840505 tEnd=0.984064836 windSum=? windValue=1 |
| 580 | debugShowActiveSpans id=1 (494.376038,224.682449 494.376136,224.68286 494.376221,224.683273 0.99999994f) t=0.984064836 tEnd=0.992175496 windSum=? windValue=1 |
| 581 | debugShowActiveSpans id=1 (494.376221,224.683273 494.376316,224.683669 494.376404,224.684067 0.99999994f) t=0.992175496 tEnd=1 windSum=? windValue=1 |
| 582 | debugShowActiveSpans id=2 (494.376404,224.684067 494.37619,224.6837 494.375977,224.683334) t=0 tEnd=0.000586871356 windSum=? windValue=1 |
| 583 | debugShowActiveSpans id=2 (494.375977,224.683334 494.0052,224.055672 494.019165,224.046982) t=0.000586871356 tEnd=1 windSum=? windValue=1 |
| 584 | debugShowActiveSpans id=3 (494.019165,224.046982 494.029083,224.040833 494.232056,224.345306) t=0 tEnd=1 windSum=? windValue=1 |
| 585 | debugShowActiveSpans id=4 (494.232056,224.345306 494.273193,224.406982 494.30481,224.474213) t=0 tEnd=1 windSum=? windValue=1 |
| 586 | debugShowActiveSpans id=5 (494.30481,224.474213 494.329991,224.527724 494.348663,224.58374) t=0 tEnd=0.835281662 windSum=? windValue=1 |
| 587 | debugShowActiveSpans id=5 (494.348663,224.58374 494.352356,224.594819 494.355774,224.605927) t=0.835281662 tEnd=1 windSum=? windValue=1 |
| 588 | debugShowActiveSpans id=6 (494.355774,224.605927 494.363708,224.631714 494.370148,224.657471) t=0 tEnd=1 windSum=? windValue=1 |
| 589 | debugShowActiveSpans id=7 (494.370148,224.657471 494.375275,224.679031) t=0 tEnd=1 windSum=? windValue=1 |
| 590 | debugShowActiveSpans id=8 (494.375275,224.679031 494.375702,224.680908) t=0 tEnd=0.547725719 windSum=? windValue=1 |
| 591 | debugShowActiveSpans id=8 (494.375702,224.680908 494.376038,224.682449) t=0.547725719 tEnd=1 windSum=? windValue=1 |
| 592 | debugShowActiveSpans id=9 (494.376038,224.682449 494.376221,224.683273) t=0 tEnd=1 windSum=? windValue=1 |
| 593 | debugShowActiveSpans id=10 (494.376221,224.683273 494.376007,224.682281) t=0 tEnd=1 windSum=? windValue=1 |
| 594 | debugShowActiveSpans id=11 (494.376007,224.682281 494.375671,224.680908) t=0 tEnd=1 windSum=? windValue=1 |
| 595 | debugShowActiveSpans id=12 (494.375671,224.680908 494.375445,224.679787 494.376129,224.682434) t=0 tEnd=0.809546276 windSum=? windValue=1 |
| 596 | debugShowActiveSpans id=12 (494.376129,224.682434 494.376227,224.682801 494.376343,224.683243) t=0.809546276 tEnd=0.924341302 windSum=? windValue=1 |
| 597 | debugShowActiveSpans id=12 (494.376343,224.683243 494.376415,224.683539 494.376495,224.683868) t=0.924341302 tEnd=1 windSum=? windValue=1 |
| 598 | debugShowActiveSpans id=13 (494.376495,224.683868 494.634338,225.414886 494.895874,225.840698) t=0 tEnd=1 windSum=? windValue=1 |
| 599 | debugShowActiveSpans id=14 (494.895874,225.840698 495.737305,227.210602 497.243317,227.90419) t=0 tEnd=1 windSum=? windValue=1 |
| 600 | debugShowActiveSpans id=15 (497.243317,227.90419 502.109781,230.145352 511.897949,224.957367) t=0 tEnd=0.929653854 windSum=? windValue=1 |
| 601 | debugShowActiveSpans id=15 (511.897949,224.957367 512.63876,224.564718 513.407471,224.129684) t=0.929653854 tEnd=1 windSum=? windValue=1 |
| 602 | debugShowActiveSpans id=16 (513.407471,224.129684 513.900024,224.999985) t=0 tEnd=1 windSum=? windValue=1 |
| 603 | debugShowActiveSpans id=17 (513.900024,224.999985 511.897949,224.957367) t=0 tEnd=0.102400099 windSum=? windValue=1 |
| 604 | debugShowActiveSpans id=17 (511.897949,224.957367 494.348663,224.583771) t=0.102400099 tEnd=1 windSum=? windValue=1 |
| 605 | ---------------xx-x--x------------- addMissing2 |
| 606 | 00: coinSeg/Span/PtT=2/3/3 endSpan=40 oppSeg/Span/PtT=1/2/2 oppEndSpan=38 MissingCoin |
| 607 | 01: coinSeg/Span/PtT=12/44/44 endSpan=24 oppSeg/Span/PtT=2/40/40 oppEndSpan=3 MissingCoin |
| 608 | 02: coinSeg/Span/PtT=1/38/38 endSpan=2 oppSeg/Span/PtT=2/40/40 oppEndSpan=3 MissingCoin |
| 609 | 03: coinSeg/Span/PtT=2/3/3 endSpan=40 oppSeg/Span/PtT=12/24/24 oppEndSpan=44 MissingCoin |
| 610 | 04: coinSeg/Span/PtT=2/3/3 endSpan=40 oppSeg/Span/PtT=1/2/2 oppEndSpan=38 MissingCoin |
| 611 | 05: coinSeg/Span/PtT=12/44/44 endSpan=24 oppSeg/Span/PtT=2/40/40 oppEndSpan=3 MissingCoin |
| 612 | 06: coinSeg/Span/PtT=1/38/38 endSpan=2 oppSeg/Span/PtT=2/40/40 oppEndSpan=3 MissingCoin |
| 613 | 07: coinSeg/Span/PtT=2/3/3 endSpan=40 oppSeg/Span/PtT=12/24/24 oppEndSpan=44 MissingCoin |
| 614 | 08: seg/base=11/21 seg/base=12/23 MarkCoinStart |
| 615 | 09: seg/base=11/22 seg/base=12/43 MarkCoinEnd |
| 616 | 10: seg/base=10/19 seg/base=12/43 MarkCoinStart |
| 617 | 11: seg/base=10/20 seg/base=12/44 MarkCoinEnd |
| 618 | 12: seg/base=9/17 seg/base=12/43 MarkCoinStart |
| 619 | 13: seg/base=9/18 seg/base=12/44 MarkCoinEnd |
| 620 | 14: seg/base=9/17 seg/base=10/19 MarkCoinStart |
| 621 | 15: seg/base=9/18 seg/base=10/20 MarkCoinEnd |
| 622 | 16: seg/base=8/42 seg/base=12/23 MarkCoinStart |
| 623 | 17: seg/base=8/16 seg/base=12/43 MarkCoinEnd |
| 624 | 18: seg/base=8/42 seg/base=11/21 MarkCoinStart |
| 625 | 19: seg/base=8/16 seg/base=11/22 MarkCoinEnd |
| 626 | 20: seg/base=12/23 seg/base=1/39 MarkCoinStart |
| 627 | 21: seg/base=12/24 seg/base=1/2 MarkCoinEnd |
| 628 | 22: seg/base=1/37 MarkCoinInsert |
| 629 | 23: seg/base=1/38 MarkCoinInsert |
| 630 | 24: seg/base=12/43 MarkCoinInsert |
| 631 | 25: seg/base=12/44 MarkCoinInsert |
| 632 | 26: seg/base=11/21 seg/base=1/39 MarkCoinStart |
| 633 | 27: seg/base=11/22 seg/base=1/37 MarkCoinEnd |
| 634 | 28: seg/base=10/19 seg/base=1/37 MarkCoinStart |
| 635 | 29: seg/base=10/20 seg/base=1/38 MarkCoinEnd |
| 636 | 30: seg/base=9/17 seg/base=1/37 MarkCoinStart |
| 637 | 31: seg/base=9/18 seg/base=1/38 MarkCoinEnd |
| 638 | 32: seg/base=8/15 seg/base=1/36 MarkCoinStart |
| 639 | 33: seg/base=8/16 seg/base=1/37 MarkCoinEnd |
| 640 | 34: seg/base=1/39 MarkCoinInsert |
| 641 | 35: seg/base=8/42 MarkCoinInsert |
| 642 | 36: seg/base=7/13 seg/base=1/35 MarkCoinStart |
| 643 | 37: seg/base=7/14 seg/base=1/36 MarkCoinEnd |
| 644 | active after addMissing2: |
| 645 | debugShowActiveSpans id=1 (494.348663,224.583771 494.360813,224.620209 494.370148,224.657471 0.999263287f) t=0 tEnd=0.737524311 windSum=? windValue=1 |
| 646 | debugShowActiveSpans id=1 (494.370148,224.657471 494.372825,224.668224 494.375275,224.679031 0.999938607f) t=0.737524311 tEnd=0.95041534 windSum=? windValue=1 |
| 647 | debugShowActiveSpans id=1 (494.375275,224.679031 494.375488,224.679966 494.375702,224.680908 0.999999523f) t=0.95041534 tEnd=0.968840505 windSum=? windValue=1 |
| 648 | debugShowActiveSpans id=1 (494.375702,224.680908 494.375872,224.681675 494.376038,224.682449 0.999999702f) t=0.968840505 tEnd=0.984064836 windSum=? windValue=1 |
| 649 | debugShowActiveSpans id=1 (494.376038,224.682449 494.376136,224.68286 494.376221,224.683273 0.99999994f) t=0.984064836 tEnd=0.992175496 windSum=? windValue=1 |
| 650 | debugShowActiveSpans id=1 (494.376221,224.683273 494.376316,224.683669 494.376404,224.684067 0.99999994f) t=0.992175496 tEnd=1 windSum=? windValue=1 |
| 651 | debugShowActiveSpans id=2 (494.376404,224.684067 494.37619,224.6837 494.375977,224.683334) t=0 tEnd=0.000586871356 windSum=? windValue=1 |
| 652 | debugShowActiveSpans id=2 (494.375977,224.683334 494.0052,224.055672 494.019165,224.046982) t=0.000586871356 tEnd=1 windSum=? windValue=1 |
| 653 | debugShowActiveSpans id=3 (494.019165,224.046982 494.029083,224.040833 494.232056,224.345306) t=0 tEnd=1 windSum=? windValue=1 |
| 654 | debugShowActiveSpans id=4 (494.232056,224.345306 494.273193,224.406982 494.30481,224.474213) t=0 tEnd=1 windSum=? windValue=1 |
| 655 | debugShowActiveSpans id=5 (494.30481,224.474213 494.329991,224.527724 494.348663,224.58374) t=0 tEnd=0.835281662 windSum=? windValue=1 |
| 656 | debugShowActiveSpans id=5 (494.348663,224.58374 494.352356,224.594819 494.355774,224.605927) t=0.835281662 tEnd=1 windSum=? windValue=1 |
| 657 | debugShowActiveSpans id=6 (494.355774,224.605927 494.363708,224.631714 494.370148,224.657471) t=0 tEnd=1 windSum=? windValue=1 |
| 658 | debugShowActiveSpans id=7 (494.370148,224.657471 494.375275,224.679031) t=0 tEnd=1 windSum=? windValue=1 |
| 659 | debugShowActiveSpans id=8 (494.375275,224.679031 494.375702,224.680908) t=0 tEnd=0.547725719 windSum=? windValue=1 |
| 660 | debugShowActiveSpans id=8 (494.375702,224.680908 494.376038,224.682449) t=0.547725719 tEnd=1 windSum=? windValue=1 |
| 661 | debugShowActiveSpans id=9 (494.376038,224.682449 494.376221,224.683273) t=0 tEnd=1 windSum=? windValue=1 |
| 662 | debugShowActiveSpans id=10 (494.376221,224.683273 494.376007,224.682281) t=0 tEnd=1 windSum=? windValue=1 |
| 663 | debugShowActiveSpans id=11 (494.376007,224.682281 494.375671,224.680908) t=0 tEnd=1 windSum=? windValue=1 |
| 664 | debugShowActiveSpans id=12 (494.375671,224.680908 494.375445,224.679787 494.376129,224.682434) t=0 tEnd=0.809546276 windSum=? windValue=1 |
| 665 | debugShowActiveSpans id=12 (494.376129,224.682434 494.376227,224.682801 494.376343,224.683243) t=0.809546276 tEnd=0.924341302 windSum=? windValue=1 |
| 666 | debugShowActiveSpans id=12 (494.376343,224.683243 494.376415,224.683539 494.376495,224.683868) t=0.924341302 tEnd=1 windSum=? windValue=1 |
| 667 | debugShowActiveSpans id=13 (494.376495,224.683868 494.634338,225.414886 494.895874,225.840698) t=0 tEnd=1 windSum=? windValue=1 |
| 668 | debugShowActiveSpans id=14 (494.895874,225.840698 495.737305,227.210602 497.243317,227.90419) t=0 tEnd=1 windSum=? windValue=1 |
| 669 | debugShowActiveSpans id=15 (497.243317,227.90419 502.109781,230.145352 511.897949,224.957367) t=0 tEnd=0.929653854 windSum=? windValue=1 |
| 670 | debugShowActiveSpans id=15 (511.897949,224.957367 512.63876,224.564718 513.407471,224.129684) t=0.929653854 tEnd=1 windSum=? windValue=1 |
| 671 | debugShowActiveSpans id=16 (513.407471,224.129684 513.900024,224.999985) t=0 tEnd=1 windSum=? windValue=1 |
| 672 | debugShowActiveSpans id=17 (513.900024,224.999985 511.897949,224.957367) t=0 tEnd=0.102400099 windSum=? windValue=1 |
| 673 | debugShowActiveSpans id=17 (511.897949,224.957367 494.348663,224.583771) t=0.102400099 tEnd=1 windSum=? windValue=1 |
| 674 | ---------------xx-x--x------------- moveNearby2 |
| 675 | 00: coinSeg/Span/PtT=2/3/3 endSpan=40 oppSeg/Span/PtT=1/2/2 oppEndSpan=38 MissingCoin |
| 676 | 01: coinSeg/Span/PtT=12/44/44 endSpan=24 oppSeg/Span/PtT=2/40/40 oppEndSpan=3 MissingCoin |
| 677 | 02: coinSeg/Span/PtT=1/38/38 endSpan=2 oppSeg/Span/PtT=2/40/40 oppEndSpan=3 MissingCoin |
| 678 | 03: coinSeg/Span/PtT=2/3/3 endSpan=40 oppSeg/Span/PtT=12/24/24 oppEndSpan=44 MissingCoin |
| 679 | 04: coinSeg/Span/PtT=2/3/3 endSpan=40 oppSeg/Span/PtT=1/2/2 oppEndSpan=38 MissingCoin |
| 680 | 05: coinSeg/Span/PtT=12/44/44 endSpan=24 oppSeg/Span/PtT=2/40/40 oppEndSpan=3 MissingCoin |
| 681 | 06: coinSeg/Span/PtT=1/38/38 endSpan=2 oppSeg/Span/PtT=2/40/40 oppEndSpan=3 MissingCoin |
| 682 | 07: coinSeg/Span/PtT=2/3/3 endSpan=40 oppSeg/Span/PtT=12/24/24 oppEndSpan=44 MissingCoin |
| 683 | 08: seg/base=11/21 seg/base=12/23 MarkCoinStart |
| 684 | 09: seg/base=11/22 seg/base=12/43 MarkCoinEnd |
| 685 | 10: seg/base=10/19 seg/base=12/43 MarkCoinStart |
| 686 | 11: seg/base=10/20 seg/base=12/44 MarkCoinEnd |
| 687 | 12: seg/base=9/17 seg/base=12/43 MarkCoinStart |
| 688 | 13: seg/base=9/18 seg/base=12/44 MarkCoinEnd |
| 689 | 14: seg/base=9/17 seg/base=10/19 MarkCoinStart |
| 690 | 15: seg/base=9/18 seg/base=10/20 MarkCoinEnd |
| 691 | 16: seg/base=8/42 seg/base=12/23 MarkCoinStart |
| 692 | 17: seg/base=8/16 seg/base=12/43 MarkCoinEnd |
| 693 | 18: seg/base=8/42 seg/base=11/21 MarkCoinStart |
| 694 | 19: seg/base=8/16 seg/base=11/22 MarkCoinEnd |
| 695 | 20: seg/base=12/23 seg/base=1/39 MarkCoinStart |
| 696 | 21: seg/base=12/24 seg/base=1/2 MarkCoinEnd |
| 697 | 22: seg/base=1/37 MarkCoinInsert |
| 698 | 23: seg/base=1/38 MarkCoinInsert |
| 699 | 24: seg/base=12/43 MarkCoinInsert |
| 700 | 25: seg/base=12/44 MarkCoinInsert |
| 701 | 26: seg/base=11/21 seg/base=1/39 MarkCoinStart |
| 702 | 27: seg/base=11/22 seg/base=1/37 MarkCoinEnd |
| 703 | 28: seg/base=10/19 seg/base=1/37 MarkCoinStart |
| 704 | 29: seg/base=10/20 seg/base=1/38 MarkCoinEnd |
| 705 | 30: seg/base=9/17 seg/base=1/37 MarkCoinStart |
| 706 | 31: seg/base=9/18 seg/base=1/38 MarkCoinEnd |
| 707 | 32: seg/base=8/15 seg/base=1/36 MarkCoinStart |
| 708 | 33: seg/base=8/16 seg/base=1/37 MarkCoinEnd |
| 709 | 34: seg/base=1/39 MarkCoinInsert |
| 710 | 35: seg/base=8/42 MarkCoinInsert |
| 711 | 36: seg/base=7/13 seg/base=1/35 MarkCoinStart |
| 712 | 37: seg/base=7/14 seg/base=1/36 MarkCoinEnd |
| 713 | active after moveNearby2: |
| 714 | debugShowActiveSpans id=1 (494.348663,224.583771 494.360813,224.620209 494.370148,224.657471 0.999263287f) t=0 tEnd=0.737524311 windSum=? windValue=1 |
| 715 | debugShowActiveSpans id=1 (494.370148,224.657471 494.372825,224.668224 494.375275,224.679031 0.999938607f) t=0.737524311 tEnd=0.95041534 windSum=? windValue=1 |
| 716 | debugShowActiveSpans id=1 (494.375275,224.679031 494.375488,224.679966 494.375702,224.680908 0.999999523f) t=0.95041534 tEnd=0.968840505 windSum=? windValue=1 |
| 717 | debugShowActiveSpans id=1 (494.375702,224.680908 494.375872,224.681675 494.376038,224.682449 0.999999702f) t=0.968840505 tEnd=0.984064836 windSum=? windValue=1 |
| 718 | debugShowActiveSpans id=1 (494.376038,224.682449 494.376136,224.68286 494.376221,224.683273 0.99999994f) t=0.984064836 tEnd=0.992175496 windSum=? windValue=1 |
| 719 | debugShowActiveSpans id=1 (494.376221,224.683273 494.376316,224.683669 494.376404,224.684067 0.99999994f) t=0.992175496 tEnd=1 windSum=? windValue=1 |
| 720 | debugShowActiveSpans id=2 (494.376404,224.684067 494.37619,224.6837 494.375977,224.683334) t=0 tEnd=0.000586871356 windSum=? windValue=1 |
| 721 | debugShowActiveSpans id=2 (494.375977,224.683334 494.0052,224.055672 494.019165,224.046982) t=0.000586871356 tEnd=1 windSum=? windValue=1 |
| 722 | debugShowActiveSpans id=3 (494.019165,224.046982 494.029083,224.040833 494.232056,224.345306) t=0 tEnd=1 windSum=? windValue=1 |
| 723 | debugShowActiveSpans id=4 (494.232056,224.345306 494.273193,224.406982 494.30481,224.474213) t=0 tEnd=1 windSum=? windValue=1 |
| 724 | debugShowActiveSpans id=5 (494.30481,224.474213 494.329991,224.527724 494.348663,224.58374) t=0 tEnd=0.835281662 windSum=? windValue=1 |
| 725 | debugShowActiveSpans id=5 (494.348663,224.58374 494.352356,224.594819 494.355774,224.605927) t=0.835281662 tEnd=1 windSum=? windValue=1 |
| 726 | debugShowActiveSpans id=6 (494.355774,224.605927 494.363708,224.631714 494.370148,224.657471) t=0 tEnd=1 windSum=? windValue=1 |
| 727 | debugShowActiveSpans id=7 (494.370148,224.657471 494.375275,224.679031) t=0 tEnd=1 windSum=? windValue=1 |
| 728 | debugShowActiveSpans id=8 (494.375275,224.679031 494.375702,224.680908) t=0 tEnd=0.547725719 windSum=? windValue=1 |
| 729 | debugShowActiveSpans id=8 (494.375702,224.680908 494.376038,224.682449) t=0.547725719 tEnd=1 windSum=? windValue=1 |
| 730 | debugShowActiveSpans id=9 (494.376038,224.682449 494.376221,224.683273) t=0 tEnd=1 windSum=? windValue=1 |
| 731 | debugShowActiveSpans id=10 (494.376221,224.683273 494.376007,224.682281) t=0 tEnd=1 windSum=? windValue=1 |
| 732 | debugShowActiveSpans id=11 (494.376007,224.682281 494.375671,224.680908) t=0 tEnd=1 windSum=? windValue=1 |
| 733 | debugShowActiveSpans id=12 (494.375671,224.680908 494.375445,224.679787 494.376129,224.682434) t=0 tEnd=0.809546276 windSum=? windValue=1 |
| 734 | debugShowActiveSpans id=12 (494.376129,224.682434 494.376227,224.682801 494.376343,224.683243) t=0.809546276 tEnd=0.924341302 windSum=? windValue=1 |
| 735 | debugShowActiveSpans id=12 (494.376343,224.683243 494.376415,224.683539 494.376495,224.683868) t=0.924341302 tEnd=1 windSum=? windValue=1 |
| 736 | debugShowActiveSpans id=13 (494.376495,224.683868 494.634338,225.414886 494.895874,225.840698) t=0 tEnd=1 windSum=? windValue=1 |
| 737 | debugShowActiveSpans id=14 (494.895874,225.840698 495.737305,227.210602 497.243317,227.90419) t=0 tEnd=1 windSum=? windValue=1 |
| 738 | debugShowActiveSpans id=15 (497.243317,227.90419 502.109781,230.145352 511.897949,224.957367) t=0 tEnd=0.929653854 windSum=? windValue=1 |
| 739 | debugShowActiveSpans id=15 (511.897949,224.957367 512.63876,224.564718 513.407471,224.129684) t=0.929653854 tEnd=1 windSum=? windValue=1 |
| 740 | debugShowActiveSpans id=16 (513.407471,224.129684 513.900024,224.999985) t=0 tEnd=1 windSum=? windValue=1 |
| 741 | debugShowActiveSpans id=17 (513.900024,224.999985 511.897949,224.957367) t=0 tEnd=0.102400099 windSum=? windValue=1 |
| 742 | debugShowActiveSpans id=17 (511.897949,224.957367 494.348663,224.583771) t=0.102400099 tEnd=1 windSum=? windValue=1 |
| 743 | ---------------xx-x--x------------- expand2 |
| 744 | 00: coinSeg/Span/PtT=2/3/3 endSpan=40 oppSeg/Span/PtT=1/2/2 oppEndSpan=38 MissingCoin |
| 745 | 01: coinSeg/Span/PtT=12/44/44 endSpan=24 oppSeg/Span/PtT=2/40/40 oppEndSpan=3 MissingCoin |
| 746 | 02: coinSeg/Span/PtT=1/38/38 endSpan=2 oppSeg/Span/PtT=2/40/40 oppEndSpan=3 MissingCoin |
| 747 | 03: coinSeg/Span/PtT=2/3/3 endSpan=40 oppSeg/Span/PtT=12/24/24 oppEndSpan=44 MissingCoin |
| 748 | 04: coinSeg/Span/PtT=2/3/3 endSpan=40 oppSeg/Span/PtT=1/2/2 oppEndSpan=38 MissingCoin |
| 749 | 05: coinSeg/Span/PtT=12/44/44 endSpan=24 oppSeg/Span/PtT=2/40/40 oppEndSpan=3 MissingCoin |
| 750 | 06: coinSeg/Span/PtT=1/38/38 endSpan=2 oppSeg/Span/PtT=2/40/40 oppEndSpan=3 MissingCoin |
| 751 | 07: coinSeg/Span/PtT=2/3/3 endSpan=40 oppSeg/Span/PtT=12/24/24 oppEndSpan=44 MissingCoin |
| 752 | 08: seg/base=11/21 seg/base=12/23 MarkCoinStart |
| 753 | 09: seg/base=11/22 seg/base=12/43 MarkCoinEnd |
| 754 | 10: seg/base=10/19 seg/base=12/43 MarkCoinStart |
| 755 | 11: seg/base=10/20 seg/base=12/44 MarkCoinEnd |
| 756 | 12: seg/base=9/17 seg/base=12/43 MarkCoinStart |
| 757 | 13: seg/base=9/18 seg/base=12/44 MarkCoinEnd |
| 758 | 14: seg/base=9/17 seg/base=10/19 MarkCoinStart |
| 759 | 15: seg/base=9/18 seg/base=10/20 MarkCoinEnd |
| 760 | 16: seg/base=8/42 seg/base=12/23 MarkCoinStart |
| 761 | 17: seg/base=8/16 seg/base=12/43 MarkCoinEnd |
| 762 | 18: seg/base=8/42 seg/base=11/21 MarkCoinStart |
| 763 | 19: seg/base=8/16 seg/base=11/22 MarkCoinEnd |
| 764 | 20: seg/base=12/23 seg/base=1/39 MarkCoinStart |
| 765 | 21: seg/base=12/24 seg/base=1/2 MarkCoinEnd |
| 766 | 22: seg/base=1/37 MarkCoinInsert |
| 767 | 23: seg/base=1/38 MarkCoinInsert |
| 768 | 24: seg/base=12/43 MarkCoinInsert |
| 769 | 25: seg/base=12/44 MarkCoinInsert |
| 770 | 26: seg/base=11/21 seg/base=1/39 MarkCoinStart |
| 771 | 27: seg/base=11/22 seg/base=1/37 MarkCoinEnd |
| 772 | 28: seg/base=10/19 seg/base=1/37 MarkCoinStart |
| 773 | 29: seg/base=10/20 seg/base=1/38 MarkCoinEnd |
| 774 | 30: seg/base=9/17 seg/base=1/37 MarkCoinStart |
| 775 | 31: seg/base=9/18 seg/base=1/38 MarkCoinEnd |
| 776 | 32: seg/base=8/15 seg/base=1/36 MarkCoinStart |
| 777 | 33: seg/base=8/16 seg/base=1/37 MarkCoinEnd |
| 778 | 34: seg/base=1/39 MarkCoinInsert |
| 779 | 35: seg/base=8/42 MarkCoinInsert |
| 780 | 36: seg/base=7/13 seg/base=1/35 MarkCoinStart |
| 781 | 37: seg/base=7/14 seg/base=1/36 MarkCoinEnd |
| 782 | active after expand2: |
| 783 | debugShowActiveSpans id=1 (494.348663,224.583771 494.360813,224.620209 494.370148,224.657471 0.999263287f) t=0 tEnd=0.737524311 windSum=? windValue=1 |
| 784 | debugShowActiveSpans id=1 (494.370148,224.657471 494.372825,224.668224 494.375275,224.679031 0.999938607f) t=0.737524311 tEnd=0.95041534 windSum=? windValue=1 |
| 785 | debugShowActiveSpans id=1 (494.375275,224.679031 494.375488,224.679966 494.375702,224.680908 0.999999523f) t=0.95041534 tEnd=0.968840505 windSum=? windValue=1 |
| 786 | debugShowActiveSpans id=1 (494.375702,224.680908 494.375872,224.681675 494.376038,224.682449 0.999999702f) t=0.968840505 tEnd=0.984064836 windSum=? windValue=1 |
| 787 | debugShowActiveSpans id=1 (494.376038,224.682449 494.376136,224.68286 494.376221,224.683273 0.99999994f) t=0.984064836 tEnd=0.992175496 windSum=? windValue=1 |
| 788 | debugShowActiveSpans id=1 (494.376221,224.683273 494.376316,224.683669 494.376404,224.684067 0.99999994f) t=0.992175496 tEnd=1 windSum=? windValue=1 |
| 789 | debugShowActiveSpans id=2 (494.376404,224.684067 494.37619,224.6837 494.375977,224.683334) t=0 tEnd=0.000586871356 windSum=? windValue=1 |
| 790 | debugShowActiveSpans id=2 (494.375977,224.683334 494.0052,224.055672 494.019165,224.046982) t=0.000586871356 tEnd=1 windSum=? windValue=1 |
| 791 | debugShowActiveSpans id=3 (494.019165,224.046982 494.029083,224.040833 494.232056,224.345306) t=0 tEnd=1 windSum=? windValue=1 |
| 792 | debugShowActiveSpans id=4 (494.232056,224.345306 494.273193,224.406982 494.30481,224.474213) t=0 tEnd=1 windSum=? windValue=1 |
| 793 | debugShowActiveSpans id=5 (494.30481,224.474213 494.329991,224.527724 494.348663,224.58374) t=0 tEnd=0.835281662 windSum=? windValue=1 |
| 794 | debugShowActiveSpans id=5 (494.348663,224.58374 494.352356,224.594819 494.355774,224.605927) t=0.835281662 tEnd=1 windSum=? windValue=1 |
| 795 | debugShowActiveSpans id=6 (494.355774,224.605927 494.363708,224.631714 494.370148,224.657471) t=0 tEnd=1 windSum=? windValue=1 |
| 796 | debugShowActiveSpans id=7 (494.370148,224.657471 494.375275,224.679031) t=0 tEnd=1 windSum=? windValue=1 |
| 797 | debugShowActiveSpans id=8 (494.375275,224.679031 494.375702,224.680908) t=0 tEnd=0.547725719 windSum=? windValue=1 |
| 798 | debugShowActiveSpans id=8 (494.375702,224.680908 494.376038,224.682449) t=0.547725719 tEnd=1 windSum=? windValue=1 |
| 799 | debugShowActiveSpans id=9 (494.376038,224.682449 494.376221,224.683273) t=0 tEnd=1 windSum=? windValue=1 |
| 800 | debugShowActiveSpans id=10 (494.376221,224.683273 494.376007,224.682281) t=0 tEnd=1 windSum=? windValue=1 |
| 801 | debugShowActiveSpans id=11 (494.376007,224.682281 494.375671,224.680908) t=0 tEnd=1 windSum=? windValue=1 |
| 802 | debugShowActiveSpans id=12 (494.375671,224.680908 494.375445,224.679787 494.376129,224.682434) t=0 tEnd=0.809546276 windSum=? windValue=1 |
| 803 | debugShowActiveSpans id=12 (494.376129,224.682434 494.376227,224.682801 494.376343,224.683243) t=0.809546276 tEnd=0.924341302 windSum=? windValue=1 |
| 804 | debugShowActiveSpans id=12 (494.376343,224.683243 494.376415,224.683539 494.376495,224.683868) t=0.924341302 tEnd=1 windSum=? windValue=1 |
| 805 | debugShowActiveSpans id=13 (494.376495,224.683868 494.634338,225.414886 494.895874,225.840698) t=0 tEnd=1 windSum=? windValue=1 |
| 806 | debugShowActiveSpans id=14 (494.895874,225.840698 495.737305,227.210602 497.243317,227.90419) t=0 tEnd=1 windSum=? windValue=1 |
| 807 | debugShowActiveSpans id=15 (497.243317,227.90419 502.109781,230.145352 511.897949,224.957367) t=0 tEnd=0.929653854 windSum=? windValue=1 |
| 808 | debugShowActiveSpans id=15 (511.897949,224.957367 512.63876,224.564718 513.407471,224.129684) t=0.929653854 tEnd=1 windSum=? windValue=1 |
| 809 | debugShowActiveSpans id=16 (513.407471,224.129684 513.900024,224.999985) t=0 tEnd=1 windSum=? windValue=1 |
| 810 | debugShowActiveSpans id=17 (513.900024,224.999985 511.897949,224.957367) t=0 tEnd=0.102400099 windSum=? windValue=1 |
| 811 | debugShowActiveSpans id=17 (511.897949,224.957367 494.348663,224.583771) t=0.102400099 tEnd=1 windSum=? windValue=1 |
| 812 | ---------------xx-x--x------------- addExpanded3 |
| 813 | 00: coinSeg/Span/PtT=2/3/3 endSpan=40 oppSeg/Span/PtT=1/2/2 oppEndSpan=38 MissingCoin |
| 814 | 01: coinSeg/Span/PtT=12/44/44 endSpan=24 oppSeg/Span/PtT=2/40/40 oppEndSpan=3 MissingCoin |
| 815 | 02: coinSeg/Span/PtT=1/38/38 endSpan=2 oppSeg/Span/PtT=2/40/40 oppEndSpan=3 MissingCoin |
| 816 | 03: coinSeg/Span/PtT=2/3/3 endSpan=40 oppSeg/Span/PtT=12/24/24 oppEndSpan=44 MissingCoin |
| 817 | 04: coinSeg/Span/PtT=2/3/3 endSpan=40 oppSeg/Span/PtT=1/2/2 oppEndSpan=38 MissingCoin |
| 818 | 05: coinSeg/Span/PtT=12/44/44 endSpan=24 oppSeg/Span/PtT=2/40/40 oppEndSpan=3 MissingCoin |
| 819 | 06: coinSeg/Span/PtT=1/38/38 endSpan=2 oppSeg/Span/PtT=2/40/40 oppEndSpan=3 MissingCoin |
| 820 | 07: coinSeg/Span/PtT=2/3/3 endSpan=40 oppSeg/Span/PtT=12/24/24 oppEndSpan=44 MissingCoin |
| 821 | 08: seg/base=11/21 seg/base=12/23 MarkCoinStart |
| 822 | 09: seg/base=11/22 seg/base=12/43 MarkCoinEnd |
| 823 | 10: seg/base=10/19 seg/base=12/43 MarkCoinStart |
| 824 | 11: seg/base=10/20 seg/base=12/44 MarkCoinEnd |
| 825 | 12: seg/base=9/17 seg/base=12/43 MarkCoinStart |
| 826 | 13: seg/base=9/18 seg/base=12/44 MarkCoinEnd |
| 827 | 14: seg/base=9/17 seg/base=10/19 MarkCoinStart |
| 828 | 15: seg/base=9/18 seg/base=10/20 MarkCoinEnd |
| 829 | 16: seg/base=8/42 seg/base=12/23 MarkCoinStart |
| 830 | 17: seg/base=8/16 seg/base=12/43 MarkCoinEnd |
| 831 | 18: seg/base=8/42 seg/base=11/21 MarkCoinStart |
| 832 | 19: seg/base=8/16 seg/base=11/22 MarkCoinEnd |
| 833 | 20: seg/base=12/23 seg/base=1/39 MarkCoinStart |
| 834 | 21: seg/base=12/24 seg/base=1/2 MarkCoinEnd |
| 835 | 22: seg/base=1/37 MarkCoinInsert |
| 836 | 23: seg/base=1/38 MarkCoinInsert |
| 837 | 24: seg/base=12/43 MarkCoinInsert |
| 838 | 25: seg/base=12/44 MarkCoinInsert |
| 839 | 26: seg/base=11/21 seg/base=1/39 MarkCoinStart |
| 840 | 27: seg/base=11/22 seg/base=1/37 MarkCoinEnd |
| 841 | 28: seg/base=10/19 seg/base=1/37 MarkCoinStart |
| 842 | 29: seg/base=10/20 seg/base=1/38 MarkCoinEnd |
| 843 | 30: seg/base=9/17 seg/base=1/37 MarkCoinStart |
| 844 | 31: seg/base=9/18 seg/base=1/38 MarkCoinEnd |
| 845 | 32: seg/base=8/15 seg/base=1/36 MarkCoinStart |
| 846 | 33: seg/base=8/16 seg/base=1/37 MarkCoinEnd |
| 847 | 34: seg/base=1/39 MarkCoinInsert |
| 848 | 35: seg/base=8/42 MarkCoinInsert |
| 849 | 36: seg/base=7/13 seg/base=1/35 MarkCoinStart |
| 850 | 37: seg/base=7/14 seg/base=1/36 MarkCoinEnd |
| 851 | active after addExpanded3: |
| 852 | debugShowActiveSpans id=1 (494.348663,224.583771 494.360813,224.620209 494.370148,224.657471 0.999263287f) t=0 tEnd=0.737524311 windSum=? windValue=1 |
| 853 | debugShowActiveSpans id=1 (494.370148,224.657471 494.372825,224.668224 494.375275,224.679031 0.999938607f) t=0.737524311 tEnd=0.95041534 windSum=? windValue=1 |
| 854 | debugShowActiveSpans id=1 (494.375275,224.679031 494.375488,224.679966 494.375702,224.680908 0.999999523f) t=0.95041534 tEnd=0.968840505 windSum=? windValue=1 |
| 855 | debugShowActiveSpans id=1 (494.375702,224.680908 494.375872,224.681675 494.376038,224.682449 0.999999702f) t=0.968840505 tEnd=0.984064836 windSum=? windValue=1 |
| 856 | debugShowActiveSpans id=1 (494.376038,224.682449 494.376136,224.68286 494.376221,224.683273 0.99999994f) t=0.984064836 tEnd=0.992175496 windSum=? windValue=1 |
| 857 | debugShowActiveSpans id=1 (494.376221,224.683273 494.376316,224.683669 494.376404,224.684067 0.99999994f) t=0.992175496 tEnd=1 windSum=? windValue=1 |
| 858 | debugShowActiveSpans id=2 (494.376404,224.684067 494.37619,224.6837 494.375977,224.683334) t=0 tEnd=0.000586871356 windSum=? windValue=1 |
| 859 | debugShowActiveSpans id=2 (494.375977,224.683334 494.0052,224.055672 494.019165,224.046982) t=0.000586871356 tEnd=1 windSum=? windValue=1 |
| 860 | debugShowActiveSpans id=3 (494.019165,224.046982 494.029083,224.040833 494.232056,224.345306) t=0 tEnd=1 windSum=? windValue=1 |
| 861 | debugShowActiveSpans id=4 (494.232056,224.345306 494.273193,224.406982 494.30481,224.474213) t=0 tEnd=1 windSum=? windValue=1 |
| 862 | debugShowActiveSpans id=5 (494.30481,224.474213 494.329991,224.527724 494.348663,224.58374) t=0 tEnd=0.835281662 windSum=? windValue=1 |
| 863 | debugShowActiveSpans id=5 (494.348663,224.58374 494.352356,224.594819 494.355774,224.605927) t=0.835281662 tEnd=1 windSum=? windValue=1 |
| 864 | debugShowActiveSpans id=6 (494.355774,224.605927 494.363708,224.631714 494.370148,224.657471) t=0 tEnd=1 windSum=? windValue=1 |
| 865 | debugShowActiveSpans id=7 (494.370148,224.657471 494.375275,224.679031) t=0 tEnd=1 windSum=? windValue=1 |
| 866 | debugShowActiveSpans id=8 (494.375275,224.679031 494.375702,224.680908) t=0 tEnd=0.547725719 windSum=? windValue=1 |
| 867 | debugShowActiveSpans id=8 (494.375702,224.680908 494.376038,224.682449) t=0.547725719 tEnd=1 windSum=? windValue=1 |
| 868 | debugShowActiveSpans id=9 (494.376038,224.682449 494.376221,224.683273) t=0 tEnd=1 windSum=? windValue=1 |
| 869 | debugShowActiveSpans id=10 (494.376221,224.683273 494.376007,224.682281) t=0 tEnd=1 windSum=? windValue=1 |
| 870 | debugShowActiveSpans id=11 (494.376007,224.682281 494.375671,224.680908) t=0 tEnd=1 windSum=? windValue=1 |
| 871 | debugShowActiveSpans id=12 (494.375671,224.680908 494.375445,224.679787 494.376129,224.682434) t=0 tEnd=0.809546276 windSum=? windValue=1 |
| 872 | debugShowActiveSpans id=12 (494.376129,224.682434 494.376227,224.682801 494.376343,224.683243) t=0.809546276 tEnd=0.924341302 windSum=? windValue=1 |
| 873 | debugShowActiveSpans id=12 (494.376343,224.683243 494.376415,224.683539 494.376495,224.683868) t=0.924341302 tEnd=1 windSum=? windValue=1 |
| 874 | debugShowActiveSpans id=13 (494.376495,224.683868 494.634338,225.414886 494.895874,225.840698) t=0 tEnd=1 windSum=? windValue=1 |
| 875 | debugShowActiveSpans id=14 (494.895874,225.840698 495.737305,227.210602 497.243317,227.90419) t=0 tEnd=1 windSum=? windValue=1 |
| 876 | debugShowActiveSpans id=15 (497.243317,227.90419 502.109781,230.145352 511.897949,224.957367) t=0 tEnd=0.929653854 windSum=? windValue=1 |
| 877 | debugShowActiveSpans id=15 (511.897949,224.957367 512.63876,224.564718 513.407471,224.129684) t=0.929653854 tEnd=1 windSum=? windValue=1 |
| 878 | debugShowActiveSpans id=16 (513.407471,224.129684 513.900024,224.999985) t=0 tEnd=1 windSum=? windValue=1 |
| 879 | debugShowActiveSpans id=17 (513.900024,224.999985 511.897949,224.957367) t=0 tEnd=0.102400099 windSum=? windValue=1 |
| 880 | debugShowActiveSpans id=17 (511.897949,224.957367 494.348663,224.583771) t=0.102400099 tEnd=1 windSum=? windValue=1 |
| 881 | ---------------------x------------- mark1 |
| 882 | 00: coinSeg/Span/PtT=2/3/3 endSpan=40 oppSeg/Span/PtT=1/2/2 oppEndSpan=38 MissingCoin |
| 883 | 01: coinSeg/Span/PtT=12/44/44 endSpan=24 oppSeg/Span/PtT=2/40/40 oppEndSpan=3 MissingCoin |
| 884 | 02: coinSeg/Span/PtT=1/38/38 endSpan=2 oppSeg/Span/PtT=2/40/40 oppEndSpan=3 MissingCoin |
| 885 | 03: coinSeg/Span/PtT=2/3/3 endSpan=40 oppSeg/Span/PtT=12/24/24 oppEndSpan=44 MissingCoin |
| 886 | 04: coinSeg/Span/PtT=2/3/3 endSpan=40 oppSeg/Span/PtT=1/2/2 oppEndSpan=38 MissingCoin |
| 887 | 05: coinSeg/Span/PtT=12/44/44 endSpan=24 oppSeg/Span/PtT=2/40/40 oppEndSpan=3 MissingCoin |
| 888 | 06: coinSeg/Span/PtT=1/38/38 endSpan=2 oppSeg/Span/PtT=2/40/40 oppEndSpan=3 MissingCoin |
| 889 | 07: coinSeg/Span/PtT=2/3/3 endSpan=40 oppSeg/Span/PtT=12/24/24 oppEndSpan=44 MissingCoin |
| 890 | active after mark1: |
| 891 | debugShowActiveSpans id=1 (494.348663,224.583771 494.360813,224.620209 494.370148,224.657471 0.999263287f) t=0 tEnd=0.737524311 windSum=? windValue=1 |
| 892 | debugShowActiveSpans id=1 (494.370148,224.657471 494.372825,224.668224 494.375275,224.679031 0.999938607f) t=0.737524311 tEnd=0.95041534 windSum=? windValue=1 |
| 893 | debugShowActiveSpans id=1 (494.375275,224.679031 494.375488,224.679966 494.375702,224.680908 0.999999523f) t=0.95041534 tEnd=0.968840505 windSum=? windValue=1 |
| 894 | debugShowActiveSpans id=1 (494.375702,224.680908 494.375872,224.681675 494.376038,224.682449 0.999999702f) t=0.968840505 tEnd=0.984064836 windSum=? windValue=1 |
| 895 | debugShowActiveSpans id=1 (494.376038,224.682449 494.376136,224.68286 494.376221,224.683273 0.99999994f) t=0.984064836 tEnd=0.992175496 windSum=? windValue=1 |
| 896 | debugShowActiveSpans id=1 (494.376221,224.683273 494.376316,224.683669 494.376404,224.684067 0.99999994f) t=0.992175496 tEnd=1 windSum=? windValue=1 |
| 897 | debugShowActiveSpans id=2 (494.376404,224.684067 494.37619,224.6837 494.375977,224.683334) t=0 tEnd=0.000586871356 windSum=? windValue=1 |
| 898 | debugShowActiveSpans id=2 (494.375977,224.683334 494.0052,224.055672 494.019165,224.046982) t=0.000586871356 tEnd=1 windSum=? windValue=1 |
| 899 | debugShowActiveSpans id=3 (494.019165,224.046982 494.029083,224.040833 494.232056,224.345306) t=0 tEnd=1 windSum=? windValue=1 |
| 900 | debugShowActiveSpans id=4 (494.232056,224.345306 494.273193,224.406982 494.30481,224.474213) t=0 tEnd=1 windSum=? windValue=1 |
| 901 | debugShowActiveSpans id=5 (494.30481,224.474213 494.329991,224.527724 494.348663,224.58374) t=0 tEnd=0.835281662 windSum=? windValue=1 |
| 902 | debugShowActiveSpans id=5 (494.348663,224.58374 494.352356,224.594819 494.355774,224.605927) t=0.835281662 tEnd=1 windSum=? windValue=1 |
| 903 | debugShowActiveSpans id=6 (494.355774,224.605927 494.363708,224.631714 494.370148,224.657471) t=0 tEnd=1 windSum=? windValue=1 |
| 904 | debugShowActiveSpans id=7 (494.370148,224.657471 494.375275,224.679031) t=0 tEnd=1 windSum=? windValue=1 |
| 905 | debugShowActiveSpans id=8 (494.375275,224.679031 494.375702,224.680908) t=0 tEnd=0.547725719 windSum=? windValue=1 |
| 906 | debugShowActiveSpans id=8 (494.375702,224.680908 494.376038,224.682449) t=0.547725719 tEnd=1 windSum=? windValue=1 |
| 907 | debugShowActiveSpans id=9 (494.376038,224.682449 494.376221,224.683273) t=0 tEnd=1 windSum=? windValue=1 |
| 908 | debugShowActiveSpans id=10 (494.376221,224.683273 494.376007,224.682281) t=0 tEnd=1 windSum=? windValue=1 |
| 909 | debugShowActiveSpans id=11 (494.376007,224.682281 494.375671,224.680908) t=0 tEnd=1 windSum=? windValue=1 |
| 910 | debugShowActiveSpans id=12 (494.375671,224.680908 494.375445,224.679787 494.376129,224.682434) t=0 tEnd=0.809546276 windSum=? windValue=1 |
| 911 | debugShowActiveSpans id=12 (494.376129,224.682434 494.376227,224.682801 494.376343,224.683243) t=0.809546276 tEnd=0.924341302 windSum=? windValue=1 |
| 912 | debugShowActiveSpans id=12 (494.376343,224.683243 494.376415,224.683539 494.376495,224.683868) t=0.924341302 tEnd=1 windSum=? windValue=1 |
| 913 | debugShowActiveSpans id=13 (494.376495,224.683868 494.634338,225.414886 494.895874,225.840698) t=0 tEnd=1 windSum=? windValue=1 |
| 914 | debugShowActiveSpans id=14 (494.895874,225.840698 495.737305,227.210602 497.243317,227.90419) t=0 tEnd=1 windSum=? windValue=1 |
| 915 | debugShowActiveSpans id=15 (497.243317,227.90419 502.109781,230.145352 511.897949,224.957367) t=0 tEnd=0.929653854 windSum=? windValue=1 |
| 916 | debugShowActiveSpans id=15 (511.897949,224.957367 512.63876,224.564718 513.407471,224.129684) t=0.929653854 tEnd=1 windSum=? windValue=1 |
| 917 | debugShowActiveSpans id=16 (513.407471,224.129684 513.900024,224.999985) t=0 tEnd=1 windSum=? windValue=1 |
| 918 | debugShowActiveSpans id=17 (513.900024,224.999985 511.897949,224.957367) t=0 tEnd=0.102400099 windSum=? windValue=1 |
| 919 | debugShowActiveSpans id=17 (511.897949,224.957367 494.348663,224.583771) t=0.102400099 tEnd=1 windSum=? windValue=1 |
| 920 | missingCoincidence coinSpan=3 endSpan=40 oppSpan=2 oppEndSpan=38 |
| 921 | missingCoincidence coinSpan=44 endSpan=24 oppSpan=40 oppEndSpan=3 |
| 922 | ---------------x--x---------------- missingCoincidence1 |
| 923 | 00: seg/base=12/44 seg/base=2/3 MarkCoinStart |
| 924 | 01: seg/base=12/24 seg/base=2/40 MarkCoinEnd |
| 925 | 02: seg/base=2/3 seg/base=1/38 MarkCoinStart |
| 926 | 03: seg/base=2/40 seg/base=1/2 MarkCoinEnd |
| 927 | active after missingCoincidence1: |
| 928 | debugShowActiveSpans id=1 (494.348663,224.583771 494.360813,224.620209 494.370148,224.657471 0.999263287f) t=0 tEnd=0.737524311 windSum=? windValue=1 |
| 929 | debugShowActiveSpans id=1 (494.370148,224.657471 494.372825,224.668224 494.375275,224.679031 0.999938607f) t=0.737524311 tEnd=0.95041534 windSum=? windValue=1 |
| 930 | debugShowActiveSpans id=1 (494.375275,224.679031 494.375488,224.679966 494.375702,224.680908 0.999999523f) t=0.95041534 tEnd=0.968840505 windSum=? windValue=1 |
| 931 | debugShowActiveSpans id=1 (494.375702,224.680908 494.375872,224.681675 494.376038,224.682449 0.999999702f) t=0.968840505 tEnd=0.984064836 windSum=? windValue=1 |
| 932 | debugShowActiveSpans id=1 (494.376038,224.682449 494.376136,224.68286 494.376221,224.683273 0.99999994f) t=0.984064836 tEnd=0.992175496 windSum=? windValue=1 |
| 933 | debugShowActiveSpans id=1 (494.376221,224.683273 494.376316,224.683669 494.376404,224.684067 0.99999994f) t=0.992175496 tEnd=1 windSum=? windValue=1 |
| 934 | debugShowActiveSpans id=2 (494.376404,224.684067 494.37619,224.6837 494.375977,224.683334) t=0 tEnd=0.000586871356 windSum=? windValue=1 |
| 935 | debugShowActiveSpans id=2 (494.375977,224.683334 494.0052,224.055672 494.019165,224.046982) t=0.000586871356 tEnd=1 windSum=? windValue=1 |
| 936 | debugShowActiveSpans id=3 (494.019165,224.046982 494.029083,224.040833 494.232056,224.345306) t=0 tEnd=1 windSum=? windValue=1 |
| 937 | debugShowActiveSpans id=4 (494.232056,224.345306 494.273193,224.406982 494.30481,224.474213) t=0 tEnd=1 windSum=? windValue=1 |
| 938 | debugShowActiveSpans id=5 (494.30481,224.474213 494.329991,224.527724 494.348663,224.58374) t=0 tEnd=0.835281662 windSum=? windValue=1 |
| 939 | debugShowActiveSpans id=5 (494.348663,224.58374 494.352356,224.594819 494.355774,224.605927) t=0.835281662 tEnd=1 windSum=? windValue=1 |
| 940 | debugShowActiveSpans id=6 (494.355774,224.605927 494.363708,224.631714 494.370148,224.657471) t=0 tEnd=1 windSum=? windValue=1 |
| 941 | debugShowActiveSpans id=7 (494.370148,224.657471 494.375275,224.679031) t=0 tEnd=1 windSum=? windValue=1 |
| 942 | debugShowActiveSpans id=8 (494.375275,224.679031 494.375702,224.680908) t=0 tEnd=0.547725719 windSum=? windValue=1 |
| 943 | debugShowActiveSpans id=8 (494.375702,224.680908 494.376038,224.682449) t=0.547725719 tEnd=1 windSum=? windValue=1 |
| 944 | debugShowActiveSpans id=9 (494.376038,224.682449 494.376221,224.683273) t=0 tEnd=1 windSum=? windValue=1 |
| 945 | debugShowActiveSpans id=10 (494.376221,224.683273 494.376007,224.682281) t=0 tEnd=1 windSum=? windValue=1 |
| 946 | debugShowActiveSpans id=11 (494.376007,224.682281 494.375671,224.680908) t=0 tEnd=1 windSum=? windValue=1 |
| 947 | debugShowActiveSpans id=12 (494.375671,224.680908 494.375445,224.679787 494.376129,224.682434) t=0 tEnd=0.809546276 windSum=? windValue=1 |
| 948 | debugShowActiveSpans id=12 (494.376129,224.682434 494.376227,224.682801 494.376343,224.683243) t=0.809546276 tEnd=0.924341302 windSum=? windValue=1 |
| 949 | debugShowActiveSpans id=12 (494.376343,224.683243 494.376415,224.683539 494.376495,224.683868) t=0.924341302 tEnd=1 windSum=? windValue=1 |
| 950 | debugShowActiveSpans id=13 (494.376495,224.683868 494.634338,225.414886 494.895874,225.840698) t=0 tEnd=1 windSum=? windValue=1 |
| 951 | debugShowActiveSpans id=14 (494.895874,225.840698 495.737305,227.210602 497.243317,227.90419) t=0 tEnd=1 windSum=? windValue=1 |
| 952 | debugShowActiveSpans id=15 (497.243317,227.90419 502.109781,230.145352 511.897949,224.957367) t=0 tEnd=0.929653854 windSum=? windValue=1 |
| 953 | debugShowActiveSpans id=15 (511.897949,224.957367 512.63876,224.564718 513.407471,224.129684) t=0.929653854 tEnd=1 windSum=? windValue=1 |
| 954 | debugShowActiveSpans id=16 (513.407471,224.129684 513.900024,224.999985) t=0 tEnd=1 windSum=? windValue=1 |
| 955 | debugShowActiveSpans id=17 (513.900024,224.999985 511.897949,224.957367) t=0 tEnd=0.102400099 windSum=? windValue=1 |
| 956 | debugShowActiveSpans id=17 (511.897949,224.957367 494.348663,224.583771) t=0.102400099 tEnd=1 windSum=? windValue=1 |
| 957 | ---------------x--x---------------- expand3 |
| 958 | 00: seg/base=12/44 seg/base=2/3 MarkCoinStart |
| 959 | 01: seg/base=12/24 seg/base=2/40 MarkCoinEnd |
| 960 | 02: seg/base=2/3 seg/base=1/38 MarkCoinStart |
| 961 | 03: seg/base=2/40 seg/base=1/2 MarkCoinEnd |
| 962 | active after expand3: |
| 963 | debugShowActiveSpans id=1 (494.348663,224.583771 494.360813,224.620209 494.370148,224.657471 0.999263287f) t=0 tEnd=0.737524311 windSum=? windValue=1 |
| 964 | debugShowActiveSpans id=1 (494.370148,224.657471 494.372825,224.668224 494.375275,224.679031 0.999938607f) t=0.737524311 tEnd=0.95041534 windSum=? windValue=1 |
| 965 | debugShowActiveSpans id=1 (494.375275,224.679031 494.375488,224.679966 494.375702,224.680908 0.999999523f) t=0.95041534 tEnd=0.968840505 windSum=? windValue=1 |
| 966 | debugShowActiveSpans id=1 (494.375702,224.680908 494.375872,224.681675 494.376038,224.682449 0.999999702f) t=0.968840505 tEnd=0.984064836 windSum=? windValue=1 |
| 967 | debugShowActiveSpans id=1 (494.376038,224.682449 494.376136,224.68286 494.376221,224.683273 0.99999994f) t=0.984064836 tEnd=0.992175496 windSum=? windValue=1 |
| 968 | debugShowActiveSpans id=1 (494.376221,224.683273 494.376316,224.683669 494.376404,224.684067 0.99999994f) t=0.992175496 tEnd=1 windSum=? windValue=1 |
| 969 | debugShowActiveSpans id=2 (494.376404,224.684067 494.37619,224.6837 494.375977,224.683334) t=0 tEnd=0.000586871356 windSum=? windValue=1 |
| 970 | debugShowActiveSpans id=2 (494.375977,224.683334 494.0052,224.055672 494.019165,224.046982) t=0.000586871356 tEnd=1 windSum=? windValue=1 |
| 971 | debugShowActiveSpans id=3 (494.019165,224.046982 494.029083,224.040833 494.232056,224.345306) t=0 tEnd=1 windSum=? windValue=1 |
| 972 | debugShowActiveSpans id=4 (494.232056,224.345306 494.273193,224.406982 494.30481,224.474213) t=0 tEnd=1 windSum=? windValue=1 |
| 973 | debugShowActiveSpans id=5 (494.30481,224.474213 494.329991,224.527724 494.348663,224.58374) t=0 tEnd=0.835281662 windSum=? windValue=1 |
| 974 | debugShowActiveSpans id=5 (494.348663,224.58374 494.352356,224.594819 494.355774,224.605927) t=0.835281662 tEnd=1 windSum=? windValue=1 |
| 975 | debugShowActiveSpans id=6 (494.355774,224.605927 494.363708,224.631714 494.370148,224.657471) t=0 tEnd=1 windSum=? windValue=1 |
| 976 | debugShowActiveSpans id=7 (494.370148,224.657471 494.375275,224.679031) t=0 tEnd=1 windSum=? windValue=1 |
| 977 | debugShowActiveSpans id=8 (494.375275,224.679031 494.375702,224.680908) t=0 tEnd=0.547725719 windSum=? windValue=1 |
| 978 | debugShowActiveSpans id=8 (494.375702,224.680908 494.376038,224.682449) t=0.547725719 tEnd=1 windSum=? windValue=1 |
| 979 | debugShowActiveSpans id=9 (494.376038,224.682449 494.376221,224.683273) t=0 tEnd=1 windSum=? windValue=1 |
| 980 | debugShowActiveSpans id=10 (494.376221,224.683273 494.376007,224.682281) t=0 tEnd=1 windSum=? windValue=1 |
| 981 | debugShowActiveSpans id=11 (494.376007,224.682281 494.375671,224.680908) t=0 tEnd=1 windSum=? windValue=1 |
| 982 | debugShowActiveSpans id=12 (494.375671,224.680908 494.375445,224.679787 494.376129,224.682434) t=0 tEnd=0.809546276 windSum=? windValue=1 |
| 983 | debugShowActiveSpans id=12 (494.376129,224.682434 494.376227,224.682801 494.376343,224.683243) t=0.809546276 tEnd=0.924341302 windSum=? windValue=1 |
| 984 | debugShowActiveSpans id=12 (494.376343,224.683243 494.376415,224.683539 494.376495,224.683868) t=0.924341302 tEnd=1 windSum=? windValue=1 |
| 985 | debugShowActiveSpans id=13 (494.376495,224.683868 494.634338,225.414886 494.895874,225.840698) t=0 tEnd=1 windSum=? windValue=1 |
| 986 | debugShowActiveSpans id=14 (494.895874,225.840698 495.737305,227.210602 497.243317,227.90419) t=0 tEnd=1 windSum=? windValue=1 |
| 987 | debugShowActiveSpans id=15 (497.243317,227.90419 502.109781,230.145352 511.897949,224.957367) t=0 tEnd=0.929653854 windSum=? windValue=1 |
| 988 | debugShowActiveSpans id=15 (511.897949,224.957367 512.63876,224.564718 513.407471,224.129684) t=0.929653854 tEnd=1 windSum=? windValue=1 |
| 989 | debugShowActiveSpans id=16 (513.407471,224.129684 513.900024,224.999985) t=0 tEnd=1 windSum=? windValue=1 |
| 990 | debugShowActiveSpans id=17 (513.900024,224.999985 511.897949,224.957367) t=0 tEnd=0.102400099 windSum=? windValue=1 |
| 991 | debugShowActiveSpans id=17 (511.897949,224.957367 494.348663,224.583771) t=0.102400099 tEnd=1 windSum=? windValue=1 |
| 992 | ---------------x--x---------------- addExpanded3 |
| 993 | 00: seg/base=12/44 seg/base=2/3 MarkCoinStart |
| 994 | 01: seg/base=12/24 seg/base=2/40 MarkCoinEnd |
| 995 | 02: seg/base=2/3 seg/base=1/38 MarkCoinStart |
| 996 | 03: seg/base=2/40 seg/base=1/2 MarkCoinEnd |
| 997 | active after addExpanded3: |
| 998 | debugShowActiveSpans id=1 (494.348663,224.583771 494.360813,224.620209 494.370148,224.657471 0.999263287f) t=0 tEnd=0.737524311 windSum=? windValue=1 |
| 999 | debugShowActiveSpans id=1 (494.370148,224.657471 494.372825,224.668224 494.375275,224.679031 0.999938607f) t=0.737524311 tEnd=0.95041534 windSum=? windValue=1 |
| 1000 | debugShowActiveSpans id=1 (494.375275,224.679031 494.375488,224.679966 494.375702,224.680908 0.999999523f) t=0.95041534 tEnd=0.968840505 windSum=? windValue=1 |
| 1001 | debugShowActiveSpans id=1 (494.375702,224.680908 494.375872,224.681675 494.376038,224.682449 0.999999702f) t=0.968840505 tEnd=0.984064836 windSum=? windValue=1 |
| 1002 | debugShowActiveSpans id=1 (494.376038,224.682449 494.376136,224.68286 494.376221,224.683273 0.99999994f) t=0.984064836 tEnd=0.992175496 windSum=? windValue=1 |
| 1003 | debugShowActiveSpans id=1 (494.376221,224.683273 494.376316,224.683669 494.376404,224.684067 0.99999994f) t=0.992175496 tEnd=1 windSum=? windValue=1 |
| 1004 | debugShowActiveSpans id=2 (494.376404,224.684067 494.37619,224.6837 494.375977,224.683334) t=0 tEnd=0.000586871356 windSum=? windValue=1 |
| 1005 | debugShowActiveSpans id=2 (494.375977,224.683334 494.0052,224.055672 494.019165,224.046982) t=0.000586871356 tEnd=1 windSum=? windValue=1 |
| 1006 | debugShowActiveSpans id=3 (494.019165,224.046982 494.029083,224.040833 494.232056,224.345306) t=0 tEnd=1 windSum=? windValue=1 |
| 1007 | debugShowActiveSpans id=4 (494.232056,224.345306 494.273193,224.406982 494.30481,224.474213) t=0 tEnd=1 windSum=? windValue=1 |
| 1008 | debugShowActiveSpans id=5 (494.30481,224.474213 494.329991,224.527724 494.348663,224.58374) t=0 tEnd=0.835281662 windSum=? windValue=1 |
| 1009 | debugShowActiveSpans id=5 (494.348663,224.58374 494.352356,224.594819 494.355774,224.605927) t=0.835281662 tEnd=1 windSum=? windValue=1 |
| 1010 | debugShowActiveSpans id=6 (494.355774,224.605927 494.363708,224.631714 494.370148,224.657471) t=0 tEnd=1 windSum=? windValue=1 |
| 1011 | debugShowActiveSpans id=7 (494.370148,224.657471 494.375275,224.679031) t=0 tEnd=1 windSum=? windValue=1 |
| 1012 | debugShowActiveSpans id=8 (494.375275,224.679031 494.375702,224.680908) t=0 tEnd=0.547725719 windSum=? windValue=1 |
| 1013 | debugShowActiveSpans id=8 (494.375702,224.680908 494.376038,224.682449) t=0.547725719 tEnd=1 windSum=? windValue=1 |
| 1014 | debugShowActiveSpans id=9 (494.376038,224.682449 494.376221,224.683273) t=0 tEnd=1 windSum=? windValue=1 |
| 1015 | debugShowActiveSpans id=10 (494.376221,224.683273 494.376007,224.682281) t=0 tEnd=1 windSum=? windValue=1 |
| 1016 | debugShowActiveSpans id=11 (494.376007,224.682281 494.375671,224.680908) t=0 tEnd=1 windSum=? windValue=1 |
| 1017 | debugShowActiveSpans id=12 (494.375671,224.680908 494.375445,224.679787 494.376129,224.682434) t=0 tEnd=0.809546276 windSum=? windValue=1 |
| 1018 | debugShowActiveSpans id=12 (494.376129,224.682434 494.376227,224.682801 494.376343,224.683243) t=0.809546276 tEnd=0.924341302 windSum=? windValue=1 |
| 1019 | debugShowActiveSpans id=12 (494.376343,224.683243 494.376415,224.683539 494.376495,224.683868) t=0.924341302 tEnd=1 windSum=? windValue=1 |
| 1020 | debugShowActiveSpans id=13 (494.376495,224.683868 494.634338,225.414886 494.895874,225.840698) t=0 tEnd=1 windSum=? windValue=1 |
| 1021 | debugShowActiveSpans id=14 (494.895874,225.840698 495.737305,227.210602 497.243317,227.90419) t=0 tEnd=1 windSum=? windValue=1 |
| 1022 | debugShowActiveSpans id=15 (497.243317,227.90419 502.109781,230.145352 511.897949,224.957367) t=0 tEnd=0.929653854 windSum=? windValue=1 |
| 1023 | debugShowActiveSpans id=15 (511.897949,224.957367 512.63876,224.564718 513.407471,224.129684) t=0.929653854 tEnd=1 windSum=? windValue=1 |
| 1024 | debugShowActiveSpans id=16 (513.407471,224.129684 513.900024,224.999985) t=0 tEnd=1 windSum=? windValue=1 |
| 1025 | debugShowActiveSpans id=17 (513.900024,224.999985 511.897949,224.957367) t=0 tEnd=0.102400099 windSum=? windValue=1 |
| 1026 | debugShowActiveSpans id=17 (511.897949,224.957367 494.348663,224.583771) t=0.102400099 tEnd=1 windSum=? windValue=1 |
caryclark | 27c015d | 2016-09-23 05:47:20 -0700 | [diff] [blame] | 1027 | ----------------------------------- missingCoincidence3 |
caryclark | 6c3b9cd | 2016-09-26 05:36:58 -0700 | [diff] [blame^] | 1028 | active after missingCoincidence3: |
| 1029 | debugShowActiveSpans id=1 (494.348663,224.583771 494.360813,224.620209 494.370148,224.657471 0.999263287f) t=0 tEnd=0.737524311 windSum=? windValue=1 |
| 1030 | debugShowActiveSpans id=1 (494.370148,224.657471 494.372825,224.668224 494.375275,224.679031 0.999938607f) t=0.737524311 tEnd=0.95041534 windSum=? windValue=1 |
| 1031 | debugShowActiveSpans id=1 (494.375275,224.679031 494.375488,224.679966 494.375702,224.680908 0.999999523f) t=0.95041534 tEnd=0.968840505 windSum=? windValue=1 |
| 1032 | debugShowActiveSpans id=1 (494.375702,224.680908 494.375872,224.681675 494.376038,224.682449 0.999999702f) t=0.968840505 tEnd=0.984064836 windSum=? windValue=1 |
| 1033 | debugShowActiveSpans id=1 (494.376038,224.682449 494.376136,224.68286 494.376221,224.683273 0.99999994f) t=0.984064836 tEnd=0.992175496 windSum=? windValue=1 |
| 1034 | debugShowActiveSpans id=1 (494.376221,224.683273 494.376316,224.683669 494.376404,224.684067 0.99999994f) t=0.992175496 tEnd=1 windSum=? windValue=1 |
| 1035 | debugShowActiveSpans id=2 (494.376404,224.684067 494.37619,224.6837 494.375977,224.683334) t=0 tEnd=0.000586871356 windSum=? windValue=1 |
| 1036 | debugShowActiveSpans id=2 (494.375977,224.683334 494.0052,224.055672 494.019165,224.046982) t=0.000586871356 tEnd=1 windSum=? windValue=1 |
| 1037 | debugShowActiveSpans id=3 (494.019165,224.046982 494.029083,224.040833 494.232056,224.345306) t=0 tEnd=1 windSum=? windValue=1 |
| 1038 | debugShowActiveSpans id=4 (494.232056,224.345306 494.273193,224.406982 494.30481,224.474213) t=0 tEnd=1 windSum=? windValue=1 |
| 1039 | debugShowActiveSpans id=5 (494.30481,224.474213 494.329991,224.527724 494.348663,224.58374) t=0 tEnd=0.835281662 windSum=? windValue=1 |
| 1040 | debugShowActiveSpans id=5 (494.348663,224.58374 494.352356,224.594819 494.355774,224.605927) t=0.835281662 tEnd=1 windSum=? windValue=1 |
| 1041 | debugShowActiveSpans id=6 (494.355774,224.605927 494.363708,224.631714 494.370148,224.657471) t=0 tEnd=1 windSum=? windValue=1 |
| 1042 | debugShowActiveSpans id=7 (494.370148,224.657471 494.375275,224.679031) t=0 tEnd=1 windSum=? windValue=1 |
| 1043 | debugShowActiveSpans id=8 (494.375275,224.679031 494.375702,224.680908) t=0 tEnd=0.547725719 windSum=? windValue=1 |
| 1044 | debugShowActiveSpans id=8 (494.375702,224.680908 494.376038,224.682449) t=0.547725719 tEnd=1 windSum=? windValue=1 |
| 1045 | debugShowActiveSpans id=9 (494.376038,224.682449 494.376221,224.683273) t=0 tEnd=1 windSum=? windValue=1 |
| 1046 | debugShowActiveSpans id=10 (494.376221,224.683273 494.376007,224.682281) t=0 tEnd=1 windSum=? windValue=1 |
| 1047 | debugShowActiveSpans id=11 (494.376007,224.682281 494.375671,224.680908) t=0 tEnd=1 windSum=? windValue=1 |
| 1048 | debugShowActiveSpans id=12 (494.375671,224.680908 494.375445,224.679787 494.376129,224.682434) t=0 tEnd=0.809546276 windSum=? windValue=1 |
| 1049 | debugShowActiveSpans id=12 (494.376129,224.682434 494.376227,224.682801 494.376343,224.683243) t=0.809546276 tEnd=0.924341302 windSum=? windValue=1 |
| 1050 | debugShowActiveSpans id=12 (494.376343,224.683243 494.376415,224.683539 494.376495,224.683868) t=0.924341302 tEnd=1 windSum=? windValue=1 |
| 1051 | debugShowActiveSpans id=13 (494.376495,224.683868 494.634338,225.414886 494.895874,225.840698) t=0 tEnd=1 windSum=? windValue=1 |
| 1052 | debugShowActiveSpans id=14 (494.895874,225.840698 495.737305,227.210602 497.243317,227.90419) t=0 tEnd=1 windSum=? windValue=1 |
| 1053 | debugShowActiveSpans id=15 (497.243317,227.90419 502.109781,230.145352 511.897949,224.957367) t=0 tEnd=0.929653854 windSum=? windValue=1 |
| 1054 | debugShowActiveSpans id=15 (511.897949,224.957367 512.63876,224.564718 513.407471,224.129684) t=0.929653854 tEnd=1 windSum=? windValue=1 |
| 1055 | debugShowActiveSpans id=16 (513.407471,224.129684 513.900024,224.999985) t=0 tEnd=1 windSum=? windValue=1 |
| 1056 | debugShowActiveSpans id=17 (513.900024,224.999985 511.897949,224.957367) t=0 tEnd=0.102400099 windSum=? windValue=1 |
| 1057 | debugShowActiveSpans id=17 (511.897949,224.957367 494.348663,224.583771) t=0.102400099 tEnd=1 windSum=? windValue=1 |
caryclark | 27c015d | 2016-09-23 05:47:20 -0700 | [diff] [blame] | 1058 | ----------------------------------- coincidence.reorder |
caryclark | 6c3b9cd | 2016-09-26 05:36:58 -0700 | [diff] [blame^] | 1059 | active after coincidence.reorder: |
| 1060 | debugShowActiveSpans id=1 (494.348663,224.583771 494.360813,224.620209 494.370148,224.657471 0.999263287f) t=0 tEnd=0.737524311 windSum=? windValue=1 |
| 1061 | debugShowActiveSpans id=1 (494.370148,224.657471 494.372825,224.668224 494.375275,224.679031 0.999938607f) t=0.737524311 tEnd=0.95041534 windSum=? windValue=1 |
| 1062 | debugShowActiveSpans id=1 (494.375275,224.679031 494.375488,224.679966 494.375702,224.680908 0.999999523f) t=0.95041534 tEnd=0.968840505 windSum=? windValue=1 |
| 1063 | debugShowActiveSpans id=1 (494.375702,224.680908 494.375872,224.681675 494.376038,224.682449 0.999999702f) t=0.968840505 tEnd=0.984064836 windSum=? windValue=1 |
| 1064 | debugShowActiveSpans id=1 (494.376038,224.682449 494.376136,224.68286 494.376221,224.683273 0.99999994f) t=0.984064836 tEnd=0.992175496 windSum=? windValue=1 |
| 1065 | debugShowActiveSpans id=1 (494.376221,224.683273 494.376316,224.683669 494.376404,224.684067 0.99999994f) t=0.992175496 tEnd=1 windSum=? windValue=1 |
| 1066 | debugShowActiveSpans id=2 (494.376404,224.684067 494.37619,224.6837 494.375977,224.683334) t=0 tEnd=0.000586871356 windSum=? windValue=1 |
| 1067 | debugShowActiveSpans id=2 (494.375977,224.683334 494.0052,224.055672 494.019165,224.046982) t=0.000586871356 tEnd=1 windSum=? windValue=1 |
| 1068 | debugShowActiveSpans id=3 (494.019165,224.046982 494.029083,224.040833 494.232056,224.345306) t=0 tEnd=1 windSum=? windValue=1 |
| 1069 | debugShowActiveSpans id=4 (494.232056,224.345306 494.273193,224.406982 494.30481,224.474213) t=0 tEnd=1 windSum=? windValue=1 |
| 1070 | debugShowActiveSpans id=5 (494.30481,224.474213 494.329991,224.527724 494.348663,224.58374) t=0 tEnd=0.835281662 windSum=? windValue=1 |
| 1071 | debugShowActiveSpans id=5 (494.348663,224.58374 494.352356,224.594819 494.355774,224.605927) t=0.835281662 tEnd=1 windSum=? windValue=1 |
| 1072 | debugShowActiveSpans id=6 (494.355774,224.605927 494.363708,224.631714 494.370148,224.657471) t=0 tEnd=1 windSum=? windValue=1 |
| 1073 | debugShowActiveSpans id=7 (494.370148,224.657471 494.375275,224.679031) t=0 tEnd=1 windSum=? windValue=1 |
| 1074 | debugShowActiveSpans id=8 (494.375275,224.679031 494.375702,224.680908) t=0 tEnd=0.547725719 windSum=? windValue=1 |
| 1075 | debugShowActiveSpans id=8 (494.375702,224.680908 494.376038,224.682449) t=0.547725719 tEnd=1 windSum=? windValue=1 |
| 1076 | debugShowActiveSpans id=9 (494.376038,224.682449 494.376221,224.683273) t=0 tEnd=1 windSum=? windValue=1 |
| 1077 | debugShowActiveSpans id=10 (494.376221,224.683273 494.376007,224.682281) t=0 tEnd=1 windSum=? windValue=1 |
| 1078 | debugShowActiveSpans id=11 (494.376007,224.682281 494.375671,224.680908) t=0 tEnd=1 windSum=? windValue=1 |
| 1079 | debugShowActiveSpans id=12 (494.375671,224.680908 494.375445,224.679787 494.376129,224.682434) t=0 tEnd=0.809546276 windSum=? windValue=1 |
| 1080 | debugShowActiveSpans id=12 (494.376129,224.682434 494.376227,224.682801 494.376343,224.683243) t=0.809546276 tEnd=0.924341302 windSum=? windValue=1 |
| 1081 | debugShowActiveSpans id=12 (494.376343,224.683243 494.376415,224.683539 494.376495,224.683868) t=0.924341302 tEnd=1 windSum=? windValue=1 |
| 1082 | debugShowActiveSpans id=13 (494.376495,224.683868 494.634338,225.414886 494.895874,225.840698) t=0 tEnd=1 windSum=? windValue=1 |
| 1083 | debugShowActiveSpans id=14 (494.895874,225.840698 495.737305,227.210602 497.243317,227.90419) t=0 tEnd=1 windSum=? windValue=1 |
| 1084 | debugShowActiveSpans id=15 (497.243317,227.90419 502.109781,230.145352 511.897949,224.957367) t=0 tEnd=0.929653854 windSum=? windValue=1 |
| 1085 | debugShowActiveSpans id=15 (511.897949,224.957367 512.63876,224.564718 513.407471,224.129684) t=0.929653854 tEnd=1 windSum=? windValue=1 |
| 1086 | debugShowActiveSpans id=16 (513.407471,224.129684 513.900024,224.999985) t=0 tEnd=1 windSum=? windValue=1 |
| 1087 | debugShowActiveSpans id=17 (513.900024,224.999985 511.897949,224.957367) t=0 tEnd=0.102400099 windSum=? windValue=1 |
| 1088 | debugShowActiveSpans id=17 (511.897949,224.957367 494.348663,224.583771) t=0.102400099 tEnd=1 windSum=? windValue=1 |
| 1089 | markDone id=12 (494.375671,224.680908 494.375397,224.67955 494.376495,224.683868) t=0.924341302 [44] (494.376343,224.683243) tEnd=1 newWindSum=? newOppSum=? oppSum=? windSum=? windValue=0 oppValue=0 |
| 1090 | markDone id=2 (494.376404,224.684067 494.005188,224.055679 494.019165,224.046982) t=0 [3] (494.376404,224.684067) tEnd=0.000586871356 newWindSum=? newOppSum=? oppSum=? windSum=? windValue=0 oppValue=0 |
| 1091 | markDone id=11 (494.376007,224.682281 494.375671,224.680908) t=0 [21] (494.376007,224.682281) tEnd=1 newWindSum=? newOppSum=? oppSum=? windSum=? windValue=0 oppValue=0 |
| 1092 | markDone id=12 (494.375671,224.680908 494.375397,224.67955 494.376495,224.683868) t=0 [23] (494.375671,224.680908) tEnd=0.809546276 newWindSum=? newOppSum=? oppSum=? windSum=? windValue=0 oppValue=0 |
| 1093 | markDone id=10 (494.376221,224.683273 494.376007,224.682281) t=0 [19] (494.376221,224.683273) tEnd=1 newWindSum=? newOppSum=? oppSum=? windSum=? windValue=0 oppValue=0 |
| 1094 | markDone id=12 (494.375671,224.680908 494.375397,224.67955 494.376495,224.683868) t=0.809546276 [43] (494.376129,224.682434) tEnd=0.924341302 newWindSum=? newOppSum=? oppSum=? windSum=? windValue=0 oppValue=0 |
| 1095 | markDone id=1 (494.348663,224.583771 494.365143,224.633194 494.376404,224.684067) t=0.984064836 [37] (494.376038,224.682449) tEnd=0.992175496 newWindSum=? newOppSum=? oppSum=? windSum=? windValue=0 oppValue=0 |
| 1096 | markDone id=1 (494.348663,224.583771 494.365143,224.633194 494.376404,224.684067) t=0.95041534 [36] (494.375275,224.679031) tEnd=0.968840505 newWindSum=? newOppSum=? oppSum=? windSum=? windValue=0 oppValue=0 |
| 1097 | markDone id=1 (494.348663,224.583771 494.365143,224.633194 494.376404,224.684067) t=0.968840505 [39] (494.375702,224.680908) tEnd=0.984064836 newWindSum=? newOppSum=? oppSum=? windSum=? windValue=0 oppValue=0 |
| 1098 | markDone id=1 (494.348663,224.583771 494.365143,224.633194 494.376404,224.684067) t=0.737524311 [35] (494.370148,224.657471) tEnd=0.95041534 newWindSum=? newOppSum=? oppSum=? windSum=? windValue=0 oppValue=0 |
caryclark | 27c015d | 2016-09-23 05:47:20 -0700 | [diff] [blame] | 1099 | ----------------------------------- pairs->apply |
caryclark | 6c3b9cd | 2016-09-26 05:36:58 -0700 | [diff] [blame^] | 1100 | active after pairs->apply: |
| 1101 | debugShowActiveSpans id=1 (494.348663,224.583771 494.360813,224.620209 494.370148,224.657471 0.999263287f) t=0 tEnd=0.737524311 windSum=? windValue=1 |
| 1102 | debugShowActiveSpans id=1 (494.376221,224.683273 494.376316,224.683669 494.376404,224.684067 0.99999994f) t=0.992175496 tEnd=1 windSum=? windValue=1 |
| 1103 | debugShowActiveSpans id=2 (494.375977,224.683334 494.0052,224.055672 494.019165,224.046982) t=0.000586871356 tEnd=1 windSum=? windValue=1 |
| 1104 | debugShowActiveSpans id=3 (494.019165,224.046982 494.029083,224.040833 494.232056,224.345306) t=0 tEnd=1 windSum=? windValue=1 |
| 1105 | debugShowActiveSpans id=4 (494.232056,224.345306 494.273193,224.406982 494.30481,224.474213) t=0 tEnd=1 windSum=? windValue=1 |
| 1106 | debugShowActiveSpans id=5 (494.30481,224.474213 494.329991,224.527724 494.348663,224.58374) t=0 tEnd=0.835281662 windSum=? windValue=1 |
| 1107 | debugShowActiveSpans id=5 (494.348663,224.58374 494.352356,224.594819 494.355774,224.605927) t=0.835281662 tEnd=1 windSum=? windValue=1 |
| 1108 | debugShowActiveSpans id=6 (494.355774,224.605927 494.363708,224.631714 494.370148,224.657471) t=0 tEnd=1 windSum=? windValue=1 |
| 1109 | debugShowActiveSpans id=7 (494.370148,224.657471 494.375275,224.679031) t=0 tEnd=1 windSum=? windValue=2 |
| 1110 | debugShowActiveSpans id=8 (494.375275,224.679031 494.375702,224.680908) t=0 tEnd=0.547725719 windSum=? windValue=2 |
| 1111 | debugShowActiveSpans id=8 (494.375702,224.680908 494.376038,224.682449) t=0.547725719 tEnd=1 windSum=? windValue=2 |
| 1112 | debugShowActiveSpans id=9 (494.376038,224.682449 494.376221,224.683273) t=0 tEnd=1 windSum=? windValue=2 |
| 1113 | debugShowActiveSpans id=13 (494.376495,224.683868 494.634338,225.414886 494.895874,225.840698) t=0 tEnd=1 windSum=? windValue=1 |
| 1114 | debugShowActiveSpans id=14 (494.895874,225.840698 495.737305,227.210602 497.243317,227.90419) t=0 tEnd=1 windSum=? windValue=1 |
| 1115 | debugShowActiveSpans id=15 (497.243317,227.90419 502.109781,230.145352 511.897949,224.957367) t=0 tEnd=0.929653854 windSum=? windValue=1 |
| 1116 | debugShowActiveSpans id=15 (511.897949,224.957367 512.63876,224.564718 513.407471,224.129684) t=0.929653854 tEnd=1 windSum=? windValue=1 |
| 1117 | debugShowActiveSpans id=16 (513.407471,224.129684 513.900024,224.999985) t=0 tEnd=1 windSum=? windValue=1 |
| 1118 | debugShowActiveSpans id=17 (513.900024,224.999985 511.897949,224.957367) t=0 tEnd=0.102400099 windSum=? windValue=1 |
| 1119 | debugShowActiveSpans id=17 (511.897949,224.957367 494.348663,224.583771) t=0.102400099 tEnd=1 windSum=? windValue=1 |
caryclark | 27c015d | 2016-09-23 05:47:20 -0700 | [diff] [blame] | 1120 | ----------------------------------- pairs->findOverlaps |
caryclark | 6c3b9cd | 2016-09-26 05:36:58 -0700 | [diff] [blame^] | 1121 | active after pairs->findOverlaps: |
| 1122 | debugShowActiveSpans id=1 (494.348663,224.583771 494.360813,224.620209 494.370148,224.657471 0.999263287f) t=0 tEnd=0.737524311 windSum=? windValue=1 |
| 1123 | debugShowActiveSpans id=1 (494.376221,224.683273 494.376316,224.683669 494.376404,224.684067 0.99999994f) t=0.992175496 tEnd=1 windSum=? windValue=1 |
| 1124 | debugShowActiveSpans id=2 (494.375977,224.683334 494.0052,224.055672 494.019165,224.046982) t=0.000586871356 tEnd=1 windSum=? windValue=1 |
| 1125 | debugShowActiveSpans id=3 (494.019165,224.046982 494.029083,224.040833 494.232056,224.345306) t=0 tEnd=1 windSum=? windValue=1 |
| 1126 | debugShowActiveSpans id=4 (494.232056,224.345306 494.273193,224.406982 494.30481,224.474213) t=0 tEnd=1 windSum=? windValue=1 |
| 1127 | debugShowActiveSpans id=5 (494.30481,224.474213 494.329991,224.527724 494.348663,224.58374) t=0 tEnd=0.835281662 windSum=? windValue=1 |
| 1128 | debugShowActiveSpans id=5 (494.348663,224.58374 494.352356,224.594819 494.355774,224.605927) t=0.835281662 tEnd=1 windSum=? windValue=1 |
| 1129 | debugShowActiveSpans id=6 (494.355774,224.605927 494.363708,224.631714 494.370148,224.657471) t=0 tEnd=1 windSum=? windValue=1 |
| 1130 | debugShowActiveSpans id=7 (494.370148,224.657471 494.375275,224.679031) t=0 tEnd=1 windSum=? windValue=2 |
| 1131 | debugShowActiveSpans id=8 (494.375275,224.679031 494.375702,224.680908) t=0 tEnd=0.547725719 windSum=? windValue=2 |
| 1132 | debugShowActiveSpans id=8 (494.375702,224.680908 494.376038,224.682449) t=0.547725719 tEnd=1 windSum=? windValue=2 |
| 1133 | debugShowActiveSpans id=9 (494.376038,224.682449 494.376221,224.683273) t=0 tEnd=1 windSum=? windValue=2 |
| 1134 | debugShowActiveSpans id=13 (494.376495,224.683868 494.634338,225.414886 494.895874,225.840698) t=0 tEnd=1 windSum=? windValue=1 |
| 1135 | debugShowActiveSpans id=14 (494.895874,225.840698 495.737305,227.210602 497.243317,227.90419) t=0 tEnd=1 windSum=? windValue=1 |
| 1136 | debugShowActiveSpans id=15 (497.243317,227.90419 502.109781,230.145352 511.897949,224.957367) t=0 tEnd=0.929653854 windSum=? windValue=1 |
| 1137 | debugShowActiveSpans id=15 (511.897949,224.957367 512.63876,224.564718 513.407471,224.129684) t=0.929653854 tEnd=1 windSum=? windValue=1 |
| 1138 | debugShowActiveSpans id=16 (513.407471,224.129684 513.900024,224.999985) t=0 tEnd=1 windSum=? windValue=1 |
| 1139 | debugShowActiveSpans id=17 (513.900024,224.999985 511.897949,224.957367) t=0 tEnd=0.102400099 windSum=? windValue=1 |
| 1140 | debugShowActiveSpans id=17 (511.897949,224.957367 494.348663,224.583771) t=0.102400099 tEnd=1 windSum=? windValue=1 |
| 1141 | sortAngles [1] tStart=0 [1] |
| 1142 | after [1/1] 25/25 tStart=0 tEnd=0.737524311 < [5/7] 25/25 tStart=0.835281662 tEnd=1 < [5/6] 9/9 tStart=0.835281662 tEnd=0 T 12 |
| 1143 | afterPart {{{{494.348663,224.58374}, {494.360813,224.620178}, {494.370148,224.65744}}}, 0.999263287} id=1 |
| 1144 | afterPart {{{494.348663,224.58374}, {494.352356,224.594819}, {494.355774,224.605927}}} id=5 |
| 1145 | afterPart {{{494.348663,224.58374}, {494.329991,224.527724}, {494.30481,224.474213}}} id=5 |
| 1146 | after [1/1] 25/25 tStart=0 tEnd=0.737524311 < [17/22] 29/29 tStart=1 tEnd=0.102400099 < [5/7] 25/25 tStart=0.835281662 tEnd=1 T 5 |
| 1147 | afterPart {{{{494.348663,224.583771}, {494.360813,224.620209}, {494.370148,224.657471}}}, 0.999263287} id=1 |
| 1148 | afterPart {{{494.348663,224.583771}, {511.897949,224.957367}}} id=17 |
| 1149 | afterPart {{{494.348663,224.583771}, {494.352356,224.59485}, {494.355774,224.605957}}} id=5 |
| 1150 | sortAngles [1] tStart=0.737524311 [35] |
| 1151 | after [1/2] 9/9 tStart=0.737524311 tEnd=0 < [7/9] 25/25 tStart=0 tEnd=1 < [6/8] 9/9 tStart=1 tEnd=0 T 5 |
| 1152 | afterPart {{{{494.370148,224.657471}, {494.360813,224.620209}, {494.348663,224.583771}}}, 0.999263287} id=1 |
| 1153 | afterPart {{{494.370148,224.657471}, {494.375275,224.679031}}} id=7 |
| 1154 | afterPart {{{494.370148,224.657471}, {494.363708,224.631714}, {494.355774,224.605927}}} id=6 |
| 1155 | sortAngles [1] tStart=0.992175496 [38] |
| 1156 | after [1/3] 25/25 tStart=0.992175496 tEnd=1 < [9/16] 9/9 tStart=1 tEnd=0 < [2/5] 9/9 tStart=0.000586871356 tEnd=1 T 11 |
| 1157 | afterPart {{{{494.376221,224.683273}, {494.376404,224.684067}, {494.376404,224.684067}}}, 0.99999994} id=1 |
| 1158 | afterPart {{{494.376221,224.683273}, {494.376038,224.682449}}} id=9 |
| 1159 | afterPart {{{494.376221,224.683273}, {494.005444,224.055611}, {494.019409,224.046921}}} id=2 |
| 1160 | sortAngles [1] tStart=1 [2] |
| 1161 | sortAngles [2] tStart=0.000586871356 [40] |
| 1162 | sortAngles [5] tStart=0.835281662 [41] |
| 1163 | sortAngles [6] tStart=1 [12] |
| 1164 | sortAngles [7] tStart=0 [13] |
| 1165 | sortAngles [7] tStart=1 [14] |
| 1166 | sortAngles [8] tStart=0 [15] |
| 1167 | sortAngles [8] tStart=0.547725719 [42] |
| 1168 | sortAngles [8] tStart=1 [16] |
| 1169 | sortAngles [9] tStart=0 [17] |
| 1170 | sortAngles [9] tStart=1 [18] |
| 1171 | sortAngles [13] tStart=0 [25] |
| 1172 | sortAngles [15] tStart=0.929653854 [45] |
| 1173 | after [15/18] 17/17 tStart=0.929653854 tEnd=0 < [17/20] 29/29 tStart=0.102400099 tEnd=0 < [15/19] 1/1 tStart=0.929653854 tEnd=1 T 4 |
| 1174 | afterPart {{{511.897949,224.957367}, {502.109781,230.145352}, {497.243317,227.90419}}} id=15 |
| 1175 | afterPart {{{511.897949,224.957367}, {513.900024,224.999985}}} id=17 |
| 1176 | afterPart {{{511.897949,224.957367}, {512.63876,224.564718}, {513.407471,224.129684}}} id=15 |
| 1177 | after [15/18] 17/17 tStart=0.929653854 tEnd=0 < [17/21] 13/13 tStart=0.102400099 tEnd=1 < [17/20] 29/29 tStart=0.102400099 tEnd=0 F 4 |
| 1178 | afterPart {{{511.897949,224.957367}, {502.109781,230.145352}, {497.243317,227.90419}}} id=15 |
| 1179 | afterPart {{{511.897949,224.957367}, {494.348663,224.583771}}} id=17 |
| 1180 | afterPart {{{511.897949,224.957367}, {513.900024,224.999985}}} id=17 |
| 1181 | after [17/20] 29/29 tStart=0.102400099 tEnd=0 < [17/21] 13/13 tStart=0.102400099 tEnd=1 < [15/19] 1/1 tStart=0.929653854 tEnd=1 F 4 |
| 1182 | afterPart {{{511.897949,224.957367}, {513.900024,224.999985}}} id=17 |
| 1183 | afterPart {{{511.897949,224.957367}, {494.348663,224.583771}}} id=17 |
| 1184 | afterPart {{{511.897949,224.957367}, {512.63876,224.564718}, {513.407471,224.129684}}} id=15 |
| 1185 | after [15/19] 1/1 tStart=0.929653854 tEnd=1 < [17/21] 13/13 tStart=0.102400099 tEnd=1 < [15/18] 17/17 tStart=0.929653854 tEnd=0 T 4 |
| 1186 | afterPart {{{511.897949,224.957367}, {512.63876,224.564718}, {513.407471,224.129684}}} id=15 |
| 1187 | afterPart {{{511.897949,224.957367}, {494.348663,224.583771}}} id=17 |
| 1188 | afterPart {{{511.897949,224.957367}, {502.109781,230.145352}, {497.243317,227.90419}}} id=15 |
| 1189 | sortAngles [17] tStart=0.102400099 [46] |
| 1190 | sortAngles [17] tStart=1 [34] |
| 1191 | coinSpan - id=12 t=0.924341302 tEnd=1 |
| 1192 | coinSpan + id=2 t=0.000586871356 tEnd=0 |
| 1193 | coinSpan - id=2 t=0 tEnd=0.000586871356 |
| 1194 | coinSpan + id=1 t=1 tEnd=0.992175496 |
| 1195 | coinSpan - id=11 t=0 tEnd=1 |
| 1196 | coinSpan + id=12 t=0.809546276 tEnd=0 |
| 1197 | coinSpan - id=10 t=0 tEnd=1 |
| 1198 | coinSpan + id=12 t=0.924341302 tEnd=0.809546276 |
| 1199 | coinSpan - id=9 t=0 tEnd=1 |
| 1200 | coinSpan + id=12 t=0.809546276 tEnd=0.924341302 |
| 1201 | coinSpan - id=9 t=0 tEnd=1 |
| 1202 | coinSpan + id=10 t=1 tEnd=0 |
| 1203 | coinSpan - id=8 t=0.547725719 tEnd=1 |
| 1204 | coinSpan + id=12 t=0 tEnd=0.809546276 |
| 1205 | coinSpan - id=8 t=0.547725719 tEnd=1 |
| 1206 | coinSpan + id=11 t=1 tEnd=0 |
| 1207 | coinSpan - id=12 t=0 tEnd=1 |
| 1208 | coinSpan + id=1 t=0.968840505 tEnd=1 |
| 1209 | coinSpan - id=11 t=0 tEnd=1 |
| 1210 | coinSpan + id=1 t=0.984064836 tEnd=0.968840505 |
| 1211 | coinSpan - id=10 t=0 tEnd=1 |
| 1212 | coinSpan + id=1 t=0.992175496 tEnd=0.984064836 |
| 1213 | coinSpan - id=9 t=0 tEnd=1 |
| 1214 | coinSpan + id=1 t=0.984064836 tEnd=0.992175496 |
| 1215 | coinSpan - id=8 t=0 tEnd=1 |
| 1216 | coinSpan + id=1 t=0.95041534 tEnd=0.984064836 |
| 1217 | coinSpan - id=7 t=0 tEnd=1 |
| 1218 | coinSpan + id=1 t=0.737524311 tEnd=0.95041534 |
| 1219 | debugShowActiveSpans id=1 (494.348663,224.583771 494.360813,224.620209 494.370148,224.657471 0.999263287f) t=0 tEnd=0.737524311 windSum=? windValue=1 |
| 1220 | debugShowActiveSpans id=1 (494.376221,224.683273 494.376316,224.683669 494.376404,224.684067 0.99999994f) t=0.992175496 tEnd=1 windSum=? windValue=1 |
| 1221 | debugShowActiveSpans id=2 (494.375977,224.683334 494.0052,224.055672 494.019165,224.046982) t=0.000586871356 tEnd=1 windSum=? windValue=1 |
| 1222 | debugShowActiveSpans id=3 (494.019165,224.046982 494.029083,224.040833 494.232056,224.345306) t=0 tEnd=1 windSum=? windValue=1 |
| 1223 | debugShowActiveSpans id=4 (494.232056,224.345306 494.273193,224.406982 494.30481,224.474213) t=0 tEnd=1 windSum=? windValue=1 |
| 1224 | debugShowActiveSpans id=5 (494.30481,224.474213 494.329991,224.527724 494.348663,224.58374) t=0 tEnd=0.835281662 windSum=? windValue=1 |
| 1225 | debugShowActiveSpans id=5 (494.348663,224.58374 494.352356,224.594819 494.355774,224.605927) t=0.835281662 tEnd=1 windSum=? windValue=1 |
| 1226 | debugShowActiveSpans id=6 (494.355774,224.605927 494.363708,224.631714 494.370148,224.657471) t=0 tEnd=1 windSum=? windValue=1 |
| 1227 | debugShowActiveSpans id=7 (494.370148,224.657471 494.375275,224.679031) t=0 tEnd=1 windSum=? windValue=2 |
| 1228 | debugShowActiveSpans id=8 (494.375275,224.679031 494.375702,224.680908) t=0 tEnd=0.547725719 windSum=? windValue=2 |
| 1229 | debugShowActiveSpans id=8 (494.375702,224.680908 494.376038,224.682449) t=0.547725719 tEnd=1 windSum=? windValue=2 |
| 1230 | debugShowActiveSpans id=9 (494.376038,224.682449 494.376221,224.683273) t=0 tEnd=1 windSum=? windValue=2 |
| 1231 | debugShowActiveSpans id=13 (494.376495,224.683868 494.634338,225.414886 494.895874,225.840698) t=0 tEnd=1 windSum=? windValue=1 |
| 1232 | debugShowActiveSpans id=14 (494.895874,225.840698 495.737305,227.210602 497.243317,227.90419) t=0 tEnd=1 windSum=? windValue=1 |
| 1233 | debugShowActiveSpans id=15 (497.243317,227.90419 502.109781,230.145352 511.897949,224.957367) t=0 tEnd=0.929653854 windSum=? windValue=1 |
| 1234 | debugShowActiveSpans id=15 (511.897949,224.957367 512.63876,224.564718 513.407471,224.129684) t=0.929653854 tEnd=1 windSum=? windValue=1 |
| 1235 | debugShowActiveSpans id=16 (513.407471,224.129684 513.900024,224.999985) t=0 tEnd=1 windSum=? windValue=1 |
| 1236 | debugShowActiveSpans id=17 (513.900024,224.999985 511.897949,224.957367) t=0 tEnd=0.102400099 windSum=? windValue=1 |
| 1237 | debugShowActiveSpans id=17 (511.897949,224.957367 494.348663,224.583771) t=0.102400099 tEnd=1 windSum=? windValue=1 |
| 1238 | sortableTop dir=kLeft seg=1 t=0.368762156 pt=(494.360107,224.620407) |
| 1239 | sortableTop [0] valid=1 operand=0 span=40 ccw=1 seg=2 {{{494.376404f, 224.684067f}, {494.005188f, 224.055679f}, {494.019165f, 224.046982f}}} t=0.0519857546 pt=(494.338837,224.620407) slope=(-0.351191278,-0.596172402) |
| 1240 | sortableTop [1] valid=0 operand=0 span=11 ccw=1 seg=6 {{{494.355774f, 224.605927f}, {494.363708f, 224.631714f}, {494.370148f, 224.657471f}}} t=0.280815892 pt=(494.360107,224.620407) slope=(0,0) |
| 1241 | sortableTop [2] valid=1 operand=0 span=1 ccw=0 seg=1 {{{{494.348663f, 224.583771f}, {494.365143f, 224.633194f}, {494.376404f, 224.684067f}}}, 0.998645842f} t=0.368762156 pt=(494.360107,224.620407) slope=(0.0145441391,0.0499217341) |
| 1242 | markWinding id=2 (494.376404,224.684067 494.005188,224.055679 494.019165,224.046982) t=0.000586871356 [40] (494.375977,224.683334) tEnd=1 newWindSum=-1 newOppSum=0 oppSum=0 windSum=-1 windValue=1 oppValue=0 |
| 1243 | markWinding id=3 (494.019165,224.046982 494.029083,224.040833 494.232056,224.345306) t=0 [5] (494.019165,224.046982) tEnd=1 newWindSum=-1 newOppSum=0 oppSum=? windSum=? windValue=1 oppValue=0 |
| 1244 | markWinding id=4 (494.232056,224.345306 494.273193,224.406982 494.30481,224.474213) t=0 [7] (494.232056,224.345306) tEnd=1 newWindSum=-1 newOppSum=0 oppSum=? windSum=? windValue=1 oppValue=0 |
| 1245 | markWinding id=5 (494.30481,224.474213 494.334961,224.538284 494.355774,224.605927) t=0 [9] (494.30481,224.474213) tEnd=0.835281662 newWindSum=-1 newOppSum=0 oppSum=? windSum=? windValue=1 oppValue=0 |
| 1246 | markWinding id=2 (494.376404,224.684067 494.005188,224.055679 494.019165,224.046982) t=0.000586871356 [40] (494.375977,224.683334) tEnd=1 newWindSum=-1 newOppSum=0 oppSum=0 windSum=-1 windValue=1 oppValue=0 |
| 1247 | sortableTop dir=kLeft seg=1 t=0.996087748 pt=(494.376312,224.68367) |
| 1248 | sortableTop [0] valid=1 operand=0 span=38 ccw=0 seg=1 {{{{494.348663f, 224.583771f}, {494.365143f, 224.633194f}, {494.376404f, 224.684067f}}}, 0.998645842f} t=0.996087748 pt=(494.376312,224.68367) slope=(0.011266272,0.0507987787) |
| 1249 | markWinding id=1 (494.348663,224.583771 494.365143,224.633194 494.376404,224.684067) t=0.992175496 [38] (494.376221,224.683273) tEnd=1 newWindSum=1 newOppSum=0 oppSum=0 windSum=1 windValue=1 oppValue=0 |
| 1250 | nextChase mismatched signs |
| 1251 | markWinding id=13 (494.376495,224.683868 494.634338,225.414886 494.895874,225.840698) t=0 [25] (494.376495,224.683868) tEnd=1 newWindSum=1 newOppSum=0 oppSum=? windSum=? windValue=1 oppValue=0 |
| 1252 | markWinding id=14 (494.895874,225.840698 495.737305,227.210602 497.243317,227.90419) t=0 [27] (494.895874,225.840698) tEnd=1 newWindSum=1 newOppSum=0 oppSum=? windSum=? windValue=1 oppValue=0 |
| 1253 | markWinding id=15 (497.243317,227.90419 502.478027,230.314941 513.407471,224.129684) t=0 [29] (497.243317,227.90419) tEnd=0.929653854 newWindSum=1 newOppSum=0 oppSum=? windSum=? windValue=1 oppValue=0 |
| 1254 | markWinding id=1 (494.348663,224.583771 494.365143,224.633194 494.376404,224.684067) t=0.992175496 [38] (494.376221,224.683273) tEnd=1 newWindSum=1 newOppSum=0 oppSum=0 windSum=1 windValue=1 oppValue=0 |
| 1255 | markWinding id=9 (494.376038,224.682449 494.376221,224.683273) t=0 [17] (494.376038,224.682449) tEnd=1 newWindSum=1 windSum=? windValue=2 |
| 1256 | nextChase mismatched signs |
| 1257 | markWinding id=8 (494.375275,224.679031 494.376038,224.682449) t=0.547725719 [42] (494.375702,224.680908) tEnd=1 newWindSum=1 windSum=? windValue=2 |
| 1258 | nextChase mismatched signs |
| 1259 | markWinding id=8 (494.375275,224.679031 494.376038,224.682449) t=0 [15] (494.375275,224.679031) tEnd=0.547725719 newWindSum=1 windSum=? windValue=2 |
| 1260 | nextChase mismatched signs |
| 1261 | markWinding id=7 (494.370148,224.657471 494.375275,224.679031) t=0 [13] (494.370148,224.657471) tEnd=1 newWindSum=1 windSum=? windValue=2 |
| 1262 | markAngle last seg=7 span=13 windSum=1 |
| 1263 | findNextWinding |
| 1264 | dumpOne [1/3] next=9/16 sect=25/25 s=0.992175496 [38] e=1 [2] sgn=-1 windVal=1 windSum=1 oppVal=0 oppSum=0 |
| 1265 | dumpOne [9/16] next=2/5 sect=9/9 s=1 [18] e=0 [17] sgn=1 windVal=2 windSum=1 |
| 1266 | dumpOne [2/5] next=1/3 sect=9/9 s=0.000586871356 [40] e=1 [4] sgn=-1 windVal=1 windSum=-1 oppVal=0 oppSum=0 |
| 1267 | markDone id=9 (494.376038,224.682449 494.376221,224.683273) t=0 [17] (494.376038,224.682449) tEnd=1 newWindSum=1 newOppSum=? oppSum=? windSum=1 windValue=2 oppValue=0 |
| 1268 | nextChase mismatched signs |
| 1269 | markDone id=8 (494.375275,224.679031 494.376038,224.682449) t=0.547725719 [42] (494.375702,224.680908) tEnd=1 newWindSum=1 newOppSum=? oppSum=? windSum=1 windValue=2 oppValue=0 |
| 1270 | nextChase mismatched signs |
| 1271 | markDone id=8 (494.375275,224.679031 494.376038,224.682449) t=0 [15] (494.375275,224.679031) tEnd=0.547725719 newWindSum=1 newOppSum=? oppSum=? windSum=1 windValue=2 oppValue=0 |
| 1272 | nextChase mismatched signs |
| 1273 | markDone id=7 (494.370148,224.657471 494.375275,224.679031) t=0 [13] (494.370148,224.657471) tEnd=1 newWindSum=1 newOppSum=? oppSum=? windSum=1 windValue=2 oppValue=0 |
| 1274 | findNextWinding chase.append segment=7 span=13 windSum=1 |
| 1275 | markDone id=1 (494.348663,224.583771 494.365143,224.633194 494.376404,224.684067) t=0.992175496 [38] (494.376221,224.683273) tEnd=1 newWindSum=1 newOppSum=0 oppSum=0 windSum=1 windValue=1 oppValue=0 |
| 1276 | findNextWinding from:[1] to:[2] start=83893016 end=83886272 |
| 1277 | bridgeWinding current id=1 from=(494.376404,224.684067) to=(494.376221,224.683273) |
| 1278 | findNextWinding simple |
| 1279 | markDone id=2 (494.376404,224.684067 494.005188,224.055679 494.019165,224.046982) t=0.000586871356 [40] (494.375977,224.683334) tEnd=1 newWindSum=-1 newOppSum=0 oppSum=0 windSum=-1 windValue=1 oppValue=0 |
| 1280 | bridgeWinding current id=2 from=(494.375977,224.683334) to=(494.019165,224.046982) |
| 1281 | path.moveTo(494.376404,224.684067); |
| 1282 | path.lineTo(494.376221,224.683273); |
| 1283 | path.quadTo(494.005188,224.055679, 494.019165,224.046982); |
| 1284 | findNextWinding simple |
| 1285 | markDone id=3 (494.019165,224.046982 494.029083,224.040833 494.232056,224.345306) t=0 [5] (494.019165,224.046982) tEnd=1 newWindSum=-1 newOppSum=0 oppSum=0 windSum=-1 windValue=1 oppValue=0 |
| 1286 | bridgeWinding current id=3 from=(494.019165,224.046982) to=(494.232056,224.345306) |
| 1287 | path.quadTo(494.029083,224.040833, 494.232056,224.345306); |
| 1288 | findNextWinding simple |
| 1289 | markDone id=4 (494.232056,224.345306 494.273193,224.406982 494.30481,224.474213) t=0 [7] (494.232056,224.345306) tEnd=1 newWindSum=-1 newOppSum=0 oppSum=0 windSum=-1 windValue=1 oppValue=0 |
| 1290 | bridgeWinding current id=4 from=(494.232056,224.345306) to=(494.30481,224.474213) |
| 1291 | path.quadTo(494.273193,224.406982, 494.30481,224.474213); |
| 1292 | markWinding id=1 (494.348663,224.583771 494.365143,224.633194 494.376404,224.684067) t=0 [1] (494.348663,224.583771) tEnd=0.737524311 newWindSum=-1 windSum=? windValue=1 |
| 1293 | markAngle last seg=1 span=35 windSum=? |
| 1294 | markWinding id=17 (513.900024,224.999985 494.348663,224.583771) t=0.102400099 [46] (511.897949,224.957367) tEnd=1 newWindSum=-1 windSum=? windValue=1 |
| 1295 | markAngle last seg=17 span=46 windSum=-1 |
| 1296 | markWinding id=5 (494.30481,224.474213 494.334961,224.538284 494.355774,224.605927) t=0.835281662 [41] (494.348663,224.58374) tEnd=1 newWindSum=-1 windSum=? windValue=1 |
| 1297 | markWinding id=6 (494.355774,224.605927 494.363708,224.631714 494.370148,224.657471) t=0 [11] (494.355774,224.605927) tEnd=1 newWindSum=-1 windSum=? windValue=1 |
| 1298 | markAngle last seg=6 span=12 |
| 1299 | findNextWinding |
| 1300 | dumpOne [5/6] next=1/1 sect=9/9 s=0.835281662 [41] e=0 [9] sgn=1 windVal=1 windSum=-1 oppVal=0 oppSum=0 |
| 1301 | dumpOne [1/1] next=17/22 sect=25/25 s=0 [1] e=0.737524311 [35] sgn=-1 windVal=1 windSum=-1 |
| 1302 | dumpOne [17/22] next=5/7 sect=29/29 s=1 [34] e=0.102400099 [46] sgn=1 windVal=1 windSum=-1 |
| 1303 | dumpOne [5/7] next=5/6 sect=25/25 s=0.835281662 [41] e=1 [10] sgn=-1 windVal=1 windSum=-1 |
| 1304 | findNextWinding chase.append segment=1 span=35 windSum=-2147483647 |
| 1305 | findNextWinding chase.append segment=17 span=46 windSum=-1 |
| 1306 | findNextWinding chase.append segment=6 span=12 |
| 1307 | markDone id=5 (494.30481,224.474213 494.334961,224.538284 494.355774,224.605927) t=0 [9] (494.30481,224.474213) tEnd=0.835281662 newWindSum=-1 newOppSum=0 oppSum=0 windSum=-1 windValue=1 oppValue=0 |
| 1308 | findNextWinding from:[5] to:[1] start=4281728 end=83891960 |
| 1309 | bridgeWinding current id=5 from=(494.30481,224.474213) to=(494.348663,224.58374) |
| 1310 | path.quadTo(494.329987,224.527725, 494.348663,224.58374); |
| 1311 | findNextWinding |
| 1312 | dumpOne [1/2] next=7/9 sect=9/9 s=0.737524311 [35] e=0 [1] sgn=1 windVal=1 windSum=-1 |
| 1313 | dumpOne [7/9] next=6/8 sect=25/25 s=0 [13] e=1 [14] sgn=-1 windVal=2 windSum=1 done |
| 1314 | dumpOne [6/8] next=1/2 sect=9/9 s=1 [12] e=0 [11] sgn=1 windVal=1 windSum=-1 |
| 1315 | markDone id=1 (494.348663,224.583771 494.365143,224.633194 494.376404,224.684067) t=0 [1] (494.348663,224.583771) tEnd=0.737524311 newWindSum=-1 newOppSum=? oppSum=? windSum=-1 windValue=1 oppValue=0 |
| 1316 | findNextWinding from:[1] to:[6] start=83887544 end=83887400 |
| 1317 | bridgeWinding current id=1 from=(494.348663,224.583771) to=(494.370148,224.657471) |
| 1318 | path.conicTo(494.360809,224.620209, 494.370148,224.657471, 0.999263287); |
| 1319 | findNextWinding simple |
| 1320 | markDone id=6 (494.355774,224.605927 494.363708,224.631714 494.370148,224.657471) t=0 [11] (494.355774,224.605927) tEnd=1 newWindSum=-1 newOppSum=? oppSum=? windSum=-1 windValue=1 oppValue=0 |
| 1321 | bridgeWinding current id=6 from=(494.370148,224.657471) to=(494.355774,224.605927) |
| 1322 | path.quadTo(494.363708,224.631714, 494.355774,224.605927); |
| 1323 | findNextWinding |
| 1324 | dumpOne [5/7] next=5/6 sect=25/25 s=0.835281662 [41] e=1 [10] sgn=-1 windVal=1 windSum=-1 |
| 1325 | dumpOne [5/6] next=1/1 sect=9/9 s=0.835281662 [41] e=0 [9] sgn=1 windVal=1 windSum=-1 oppVal=0 oppSum=0 done |
| 1326 | dumpOne [1/1] next=17/22 sect=25/25 s=0 [1] e=0.737524311 [35] sgn=-1 windVal=1 windSum=-1 done |
| 1327 | dumpOne [17/22] next=5/7 sect=29/29 s=1 [34] e=0.102400099 [46] sgn=1 windVal=1 windSum=-1 |
| 1328 | markDone id=5 (494.30481,224.474213 494.334961,224.538284 494.355774,224.605927) t=0.835281662 [41] (494.348663,224.58374) tEnd=1 newWindSum=-1 newOppSum=? oppSum=? windSum=-1 windValue=1 oppValue=0 |
| 1329 | findNextWinding from:[5] to:[17] start=83891792 end=83894160 |
| 1330 | bridgeWinding current id=5 from=(494.355774,224.605927) to=(494.348663,224.58374) |
| 1331 | path.quadTo(494.352356,224.594818, 494.348663,224.58374); |
| 1332 | markWinding id=17 (513.900024,224.999985 494.348663,224.583771) t=0 [33] (513.900024,224.999985) tEnd=0.102400099 newWindSum=-1 windSum=? windValue=1 |
| 1333 | markWinding id=16 (513.407471,224.129684 513.900024,224.999985) t=0 [31] (513.407471,224.129684) tEnd=1 newWindSum=-1 windSum=? windValue=1 |
| 1334 | markWinding id=15 (497.243317,227.90419 502.478027,230.314941 513.407471,224.129684) t=0.929653854 [45] (511.897949,224.957367) tEnd=1 newWindSum=-1 windSum=? windValue=1 |
| 1335 | markAngle last seg=15 span=45 windSum=-1 |
| 1336 | findNextWinding |
| 1337 | dumpOne [17/21] next=15/18 sect=13/13 s=0.102400099 [46] e=1 [34] sgn=-1 windVal=1 windSum=-1 |
| 1338 | dumpOne [15/18] next=17/20 sect=17/17 s=0.929653854 [45] e=0 [29] sgn=1 windVal=1 windSum=1 oppVal=0 oppSum=0 |
| 1339 | dumpOne [17/20] next=15/19 sect=29/29 s=0.102400099 [46] e=0 [33] sgn=1 windVal=1 windSum=-1 |
| 1340 | dumpOne [15/19] next=17/21 sect=1/1 s=0.929653854 [45] e=1 [30] sgn=-1 windVal=1 windSum=-1 |
| 1341 | markDone id=17 (513.900024,224.999985 494.348663,224.583771) t=0 [33] (513.900024,224.999985) tEnd=0.102400099 newWindSum=-1 newOppSum=? oppSum=? windSum=-1 windValue=1 oppValue=0 |
| 1342 | markDone id=16 (513.407471,224.129684 513.900024,224.999985) t=0 [31] (513.407471,224.129684) tEnd=1 newWindSum=-1 newOppSum=? oppSum=? windSum=-1 windValue=1 oppValue=0 |
| 1343 | markDone id=15 (497.243317,227.90419 502.478027,230.314941 513.407471,224.129684) t=0.929653854 [45] (511.897949,224.957367) tEnd=1 newWindSum=-1 newOppSum=? oppSum=? windSum=-1 windValue=1 oppValue=0 |
| 1344 | findNextWinding chase.append segment=15 span=45 windSum=-1 |
| 1345 | markDone id=17 (513.900024,224.999985 494.348663,224.583771) t=0.102400099 [46] (511.897949,224.957367) tEnd=1 newWindSum=-1 newOppSum=? oppSum=? windSum=-1 windValue=1 oppValue=0 |
| 1346 | findNextWinding from:[17] to:[15] start=83894016 end=83891024 |
| 1347 | bridgeWinding current id=17 from=(494.348663,224.583771) to=(511.897949,224.957367) |
| 1348 | findNextWinding simple |
| 1349 | markDone id=15 (497.243317,227.90419 502.478027,230.314941 513.407471,224.129684) t=0 [29] (497.243317,227.90419) tEnd=0.929653854 newWindSum=1 newOppSum=0 oppSum=0 windSum=1 windValue=1 oppValue=0 |
| 1350 | bridgeWinding current id=15 from=(511.897949,224.957367) to=(497.243317,227.90419) |
| 1351 | path.lineTo(511.897949,224.957367); |
| 1352 | path.quadTo(502.109772,230.145355, 497.243317,227.90419); |
| 1353 | findNextWinding simple |
| 1354 | markDone id=14 (494.895874,225.840698 495.737305,227.210602 497.243317,227.90419) t=0 [27] (494.895874,225.840698) tEnd=1 newWindSum=1 newOppSum=0 oppSum=0 windSum=1 windValue=1 oppValue=0 |
| 1355 | bridgeWinding current id=14 from=(497.243317,227.90419) to=(494.895874,225.840698) |
| 1356 | path.quadTo(495.737305,227.210602, 494.895874,225.840698); |
| 1357 | nextChase mismatched signs |
| 1358 | findNextWinding simple |
| 1359 | markDone id=13 (494.376495,224.683868 494.634338,225.414886 494.895874,225.840698) t=0 [25] (494.376495,224.683868) tEnd=1 newWindSum=1 newOppSum=0 oppSum=0 windSum=1 windValue=1 oppValue=0 |
| 1360 | bridgeWinding current id=13 from=(494.895874,225.840698) to=(494.376495,224.683868) |
| 1361 | path.quadTo(494.634338,225.414886, 494.376495,224.683868); |
caryclark | 27c015d | 2016-09-23 05:47:20 -0700 | [diff] [blame] | 1362 | path.close(); |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 1363 | </div> |
caryclark | 26ad22a | 2015-10-16 09:03:38 -0700 | [diff] [blame] | 1364 | |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 1365 | </div> |
| 1366 | |
| 1367 | <script type="text/javascript"> |
| 1368 | |
caryclark | 55888e4 | 2016-07-18 10:01:36 -0700 | [diff] [blame] | 1369 | var testDivs = [ |
caryclark | 6c3b9cd | 2016-09-26 05:36:58 -0700 | [diff] [blame^] | 1370 | tiger8b_h_1, |
caryclark | 30b9fdd | 2016-08-31 14:36:29 -0700 | [diff] [blame] | 1371 | ]; |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 1372 | |
| 1373 | var decimal_places = 3; // make this 3 to show more precision |
| 1374 | |
| 1375 | var tests = []; |
| 1376 | var testLines = []; |
| 1377 | var testTitles = []; |
| 1378 | var testIndex = 0; |
| 1379 | var ctx; |
| 1380 | |
| 1381 | var xmin, xmax, focusXmin, focusXmax; |
| 1382 | var ymin, ymax, focusYmin, focusYmax; |
| 1383 | var scale; |
| 1384 | var mouseX, mouseY; |
| 1385 | var srcLeft, srcTop; |
| 1386 | var screenWidth, screenHeight; |
caryclark | 1049f12 | 2015-04-20 08:31:59 -0700 | [diff] [blame] | 1387 | var drawnPts, drawnLines, drawnQuads, drawnConics, drawnCubics; |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 1388 | var curveT = 0; |
| 1389 | |
| 1390 | var pt_labels = 2; |
| 1391 | var collect_bounds = false; |
| 1392 | var control_lines = 0; |
| 1393 | var curve_t = false; |
| 1394 | var debug_xy = 1; |
| 1395 | var focus_enabled = false; |
| 1396 | var focus_on_selection = false; |
| 1397 | var step_limit = 0; |
| 1398 | var draw_active = false; |
| 1399 | var draw_add = false; |
| 1400 | var draw_angle = 0; |
caryclark | 624637c | 2015-05-11 07:21:27 -0700 | [diff] [blame] | 1401 | var draw_coincidence = false; |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 1402 | var draw_deriviatives = 0; |
| 1403 | var draw_hints = false; |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 1404 | var draw_id = false; |
| 1405 | var draw_intersection = 0; |
| 1406 | var draw_intersectT = false; |
| 1407 | var draw_legend = true; |
| 1408 | var draw_log = false; |
| 1409 | var draw_mark = false; |
| 1410 | var draw_midpoint = false; |
| 1411 | var draw_op = 0; |
| 1412 | var draw_sequence = false; |
| 1413 | var draw_sort = 0; |
caryclark | 03b03ca | 2015-04-23 09:13:37 -0700 | [diff] [blame] | 1414 | var draw_top = false; |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 1415 | var draw_path = 3; |
| 1416 | var draw_computed = 0; |
| 1417 | var retina_scale = !!window.devicePixelRatio; |
| 1418 | |
| 1419 | var activeCount = 0; |
| 1420 | var addCount = 0; |
| 1421 | var angleCount = 0; |
caryclark | 624637c | 2015-05-11 07:21:27 -0700 | [diff] [blame] | 1422 | var coinCount = 0; |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 1423 | var opCount = 0; |
| 1424 | var sectCount = 0; |
| 1425 | var sortCount = 0; |
caryclark | 03b03ca | 2015-04-23 09:13:37 -0700 | [diff] [blame] | 1426 | var topCount = 0; |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 1427 | var markCount = 0; |
| 1428 | var activeMax = 0; |
| 1429 | var addMax = 0; |
| 1430 | var angleMax = 0; |
caryclark | 624637c | 2015-05-11 07:21:27 -0700 | [diff] [blame] | 1431 | var coinMax = 0; |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 1432 | var sectMax = 0; |
| 1433 | var sectMax2 = 0; |
| 1434 | var sortMax = 0; |
caryclark | 03b03ca | 2015-04-23 09:13:37 -0700 | [diff] [blame] | 1435 | var topMax = 0; |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 1436 | var markMax = 0; |
| 1437 | var opMax = 0; |
| 1438 | var stepMax = 0; |
| 1439 | var lastIndex = 0; |
| 1440 | var hasPath = false; |
caryclark | 26ad22a | 2015-10-16 09:03:38 -0700 | [diff] [blame] | 1441 | var hasAlignedPath = false; |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 1442 | var hasComputedPath = false; |
caryclark | 5435929 | 2015-03-26 07:52:43 -0700 | [diff] [blame] | 1443 | var angleBetween = false; |
| 1444 | var afterIndex = 0; |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 1445 | |
| 1446 | var firstActiveSpan = -1; |
| 1447 | var logStart = -1; |
| 1448 | var logRange = 0; |
| 1449 | |
| 1450 | var SPAN_ID = 0; |
| 1451 | var SPAN_X1 = SPAN_ID + 1; |
| 1452 | var SPAN_Y1 = SPAN_X1 + 1; |
| 1453 | var SPAN_X2 = SPAN_Y1 + 1; |
| 1454 | var SPAN_Y2 = SPAN_X2 + 1; |
caryclark | 1049f12 | 2015-04-20 08:31:59 -0700 | [diff] [blame] | 1455 | |
caryclark | 55888e4 | 2016-07-18 10:01:36 -0700 | [diff] [blame] | 1456 | var SPAN_L_TX = SPAN_Y2 + 1; |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 1457 | var SPAN_L_TY = SPAN_L_TX + 1; |
caryclark | 55888e4 | 2016-07-18 10:01:36 -0700 | [diff] [blame] | 1458 | var SPAN_L_OTHER = SPAN_L_TY + 1; |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 1459 | var SPAN_L_OTHERT = SPAN_L_OTHER + 1; |
| 1460 | var SPAN_L_OTHERI = SPAN_L_OTHERT + 1; |
| 1461 | var SPAN_L_SUM = SPAN_L_OTHERI + 1; |
| 1462 | var SPAN_L_VAL = SPAN_L_SUM + 1; |
| 1463 | var SPAN_L_OPP = SPAN_L_VAL + 1; |
| 1464 | |
| 1465 | var SPAN_X3 = SPAN_Y2 + 1; |
| 1466 | var SPAN_Y3 = SPAN_X3 + 1; |
caryclark | 1049f12 | 2015-04-20 08:31:59 -0700 | [diff] [blame] | 1467 | |
caryclark | 55888e4 | 2016-07-18 10:01:36 -0700 | [diff] [blame] | 1468 | var SPAN_Q_TX = SPAN_Y3 + 1; |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 1469 | var SPAN_Q_TY = SPAN_Q_TX + 1; |
caryclark | 55888e4 | 2016-07-18 10:01:36 -0700 | [diff] [blame] | 1470 | var SPAN_Q_OTHER = SPAN_Q_TY + 1; |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 1471 | var SPAN_Q_OTHERT = SPAN_Q_OTHER + 1; |
| 1472 | var SPAN_Q_OTHERI = SPAN_Q_OTHERT + 1; |
| 1473 | var SPAN_Q_SUM = SPAN_Q_OTHERI + 1; |
| 1474 | var SPAN_Q_VAL = SPAN_Q_SUM + 1; |
| 1475 | var SPAN_Q_OPP = SPAN_Q_VAL + 1; |
| 1476 | |
caryclark | 1049f12 | 2015-04-20 08:31:59 -0700 | [diff] [blame] | 1477 | var SPAN_K_W = SPAN_Y3 + 1; |
caryclark | 55888e4 | 2016-07-18 10:01:36 -0700 | [diff] [blame] | 1478 | var SPAN_K_TX = SPAN_K_W + 1; |
caryclark | 1049f12 | 2015-04-20 08:31:59 -0700 | [diff] [blame] | 1479 | var SPAN_K_TY = SPAN_K_TX + 1; |
caryclark | 55888e4 | 2016-07-18 10:01:36 -0700 | [diff] [blame] | 1480 | var SPAN_K_OTHER = SPAN_K_TY + 1; |
caryclark | 1049f12 | 2015-04-20 08:31:59 -0700 | [diff] [blame] | 1481 | var SPAN_K_OTHERT = SPAN_K_OTHER + 1; |
| 1482 | var SPAN_K_OTHERI = SPAN_K_OTHERT + 1; |
| 1483 | var SPAN_K_SUM = SPAN_K_OTHERI + 1; |
| 1484 | var SPAN_K_VAL = SPAN_K_SUM + 1; |
| 1485 | var SPAN_K_OPP = SPAN_K_VAL + 1; |
| 1486 | |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 1487 | var SPAN_X4 = SPAN_Y3 + 1; |
| 1488 | var SPAN_Y4 = SPAN_X4 + 1; |
caryclark | 1049f12 | 2015-04-20 08:31:59 -0700 | [diff] [blame] | 1489 | |
caryclark | 55888e4 | 2016-07-18 10:01:36 -0700 | [diff] [blame] | 1490 | var SPAN_C_TX = SPAN_Y4 + 1; |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 1491 | var SPAN_C_TY = SPAN_C_TX + 1; |
caryclark | 55888e4 | 2016-07-18 10:01:36 -0700 | [diff] [blame] | 1492 | var SPAN_C_OTHER = SPAN_C_TY + 1; |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 1493 | var SPAN_C_OTHERT = SPAN_C_OTHER + 1; |
| 1494 | var SPAN_C_OTHERI = SPAN_C_OTHERT + 1; |
| 1495 | var SPAN_C_SUM = SPAN_C_OTHERI + 1; |
| 1496 | var SPAN_C_VAL = SPAN_C_SUM + 1; |
| 1497 | var SPAN_C_OPP = SPAN_C_VAL + 1; |
| 1498 | |
| 1499 | var ACTIVE_LINE_SPAN = 1; |
| 1500 | var ACTIVE_QUAD_SPAN = ACTIVE_LINE_SPAN + 1; |
caryclark | 1049f12 | 2015-04-20 08:31:59 -0700 | [diff] [blame] | 1501 | var ACTIVE_CONIC_SPAN = ACTIVE_QUAD_SPAN + 1; |
| 1502 | var ACTIVE_CUBIC_SPAN = ACTIVE_CONIC_SPAN + 1; |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 1503 | |
| 1504 | var ADD_MOVETO = ACTIVE_CUBIC_SPAN + 1; |
| 1505 | var ADD_LINETO = ADD_MOVETO + 1; |
| 1506 | var ADD_QUADTO = ADD_LINETO + 1; |
caryclark | 1049f12 | 2015-04-20 08:31:59 -0700 | [diff] [blame] | 1507 | var ADD_CONICTO = ADD_QUADTO + 1; |
| 1508 | var ADD_CUBICTO = ADD_CONICTO + 1; |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 1509 | var ADD_CLOSE = ADD_CUBICTO + 1; |
| 1510 | var ADD_FILL = ADD_CLOSE + 1; |
| 1511 | |
| 1512 | var PATH_LINE = ADD_FILL + 1; |
| 1513 | var PATH_QUAD = PATH_LINE + 1; |
caryclark | 1049f12 | 2015-04-20 08:31:59 -0700 | [diff] [blame] | 1514 | var PATH_CONIC = PATH_QUAD + 1; |
| 1515 | var PATH_CUBIC = PATH_CONIC + 1; |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 1516 | |
| 1517 | var INTERSECT_LINE = PATH_CUBIC + 1; |
| 1518 | var INTERSECT_LINE_2 = INTERSECT_LINE + 1; |
| 1519 | var INTERSECT_LINE_NO = INTERSECT_LINE_2 + 1; |
| 1520 | var INTERSECT_QUAD_LINE = INTERSECT_LINE_NO + 1; |
| 1521 | var INTERSECT_QUAD_LINE_2 = INTERSECT_QUAD_LINE + 1; |
| 1522 | var INTERSECT_QUAD_LINE_NO = INTERSECT_QUAD_LINE_2 + 1; |
| 1523 | var INTERSECT_QUAD = INTERSECT_QUAD_LINE_NO + 1; |
| 1524 | var INTERSECT_QUAD_2 = INTERSECT_QUAD + 1; |
| 1525 | var INTERSECT_QUAD_NO = INTERSECT_QUAD_2 + 1; |
caryclark | 1049f12 | 2015-04-20 08:31:59 -0700 | [diff] [blame] | 1526 | var INTERSECT_CONIC_LINE = INTERSECT_QUAD_NO + 1; |
| 1527 | var INTERSECT_CONIC_LINE_2 = INTERSECT_CONIC_LINE + 1; |
| 1528 | var INTERSECT_CONIC_LINE_NO = INTERSECT_CONIC_LINE_2 + 1; |
caryclark | 55888e4 | 2016-07-18 10:01:36 -0700 | [diff] [blame] | 1529 | var INTERSECT_CONIC_QUAD = INTERSECT_CONIC_LINE_NO + 1; |
| 1530 | var INTERSECT_CONIC_QUAD_2 = INTERSECT_CONIC_QUAD + 1; |
caryclark | 6c3b9cd | 2016-09-26 05:36:58 -0700 | [diff] [blame^] | 1531 | var INTERSECT_CONIC_QUAD_3 = INTERSECT_CONIC_QUAD_2 + 1; |
| 1532 | var INTERSECT_CONIC_QUAD_4 = INTERSECT_CONIC_QUAD_3 + 1; |
| 1533 | var INTERSECT_CONIC_QUAD_NO = INTERSECT_CONIC_QUAD_4 + 1; |
caryclark | 55888e4 | 2016-07-18 10:01:36 -0700 | [diff] [blame] | 1534 | var INTERSECT_CONIC = INTERSECT_CONIC_QUAD_NO + 1; |
caryclark | 1049f12 | 2015-04-20 08:31:59 -0700 | [diff] [blame] | 1535 | var INTERSECT_CONIC_2 = INTERSECT_CONIC + 1; |
| 1536 | var INTERSECT_CONIC_NO = INTERSECT_CONIC_2 + 1; |
| 1537 | var INTERSECT_SELF_CUBIC = INTERSECT_CONIC_NO + 1; |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 1538 | var INTERSECT_SELF_CUBIC_NO = INTERSECT_SELF_CUBIC + 1; |
| 1539 | var INTERSECT_CUBIC_LINE = INTERSECT_SELF_CUBIC_NO + 1; |
| 1540 | var INTERSECT_CUBIC_LINE_2 = INTERSECT_CUBIC_LINE + 1; |
| 1541 | var INTERSECT_CUBIC_LINE_3 = INTERSECT_CUBIC_LINE_2 + 1; |
| 1542 | var INTERSECT_CUBIC_LINE_NO = INTERSECT_CUBIC_LINE_3 + 1; |
| 1543 | var INTERSECT_CUBIC_QUAD = INTERSECT_CUBIC_LINE_NO + 1; |
| 1544 | var INTERSECT_CUBIC_QUAD_2 = INTERSECT_CUBIC_QUAD + 1; |
| 1545 | var INTERSECT_CUBIC_QUAD_3 = INTERSECT_CUBIC_QUAD_2 + 1; |
| 1546 | var INTERSECT_CUBIC_QUAD_4 = INTERSECT_CUBIC_QUAD_3 + 1; |
| 1547 | var INTERSECT_CUBIC_QUAD_NO = INTERSECT_CUBIC_QUAD_4 + 1; |
| 1548 | var INTERSECT_CUBIC = INTERSECT_CUBIC_QUAD_NO + 1; |
| 1549 | var INTERSECT_CUBIC_2 = INTERSECT_CUBIC + 1; |
| 1550 | var INTERSECT_CUBIC_3 = INTERSECT_CUBIC_2 + 1; |
| 1551 | var INTERSECT_CUBIC_4 = INTERSECT_CUBIC_3 + 1; |
| 1552 | // FIXME: add cubic 5- 9 |
| 1553 | var INTERSECT_CUBIC_NO = INTERSECT_CUBIC_4 + 1; |
| 1554 | |
| 1555 | var SORT_UNARY = INTERSECT_CUBIC_NO + 1; |
| 1556 | var SORT_BINARY = SORT_UNARY + 1; |
| 1557 | |
| 1558 | var OP_DIFFERENCE = SORT_BINARY + 1; |
| 1559 | var OP_INTERSECT = OP_DIFFERENCE + 1; |
| 1560 | var OP_UNION = OP_INTERSECT + 1; |
| 1561 | var OP_XOR = OP_UNION + 1; |
| 1562 | |
| 1563 | var MARK_LINE = OP_XOR + 1; |
| 1564 | var MARK_QUAD = MARK_LINE + 1; |
caryclark | 1049f12 | 2015-04-20 08:31:59 -0700 | [diff] [blame] | 1565 | var MARK_CONIC = MARK_QUAD + 1; |
| 1566 | var MARK_CUBIC = MARK_CONIC + 1; |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 1567 | var MARK_DONE_LINE = MARK_CUBIC + 1; |
| 1568 | var MARK_DONE_QUAD = MARK_DONE_LINE + 1; |
caryclark | 1049f12 | 2015-04-20 08:31:59 -0700 | [diff] [blame] | 1569 | var MARK_DONE_CONIC = MARK_DONE_QUAD + 1; |
| 1570 | var MARK_DONE_CUBIC = MARK_DONE_CONIC + 1; |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 1571 | var MARK_UNSORTABLE_LINE = MARK_DONE_CUBIC + 1; |
| 1572 | var MARK_UNSORTABLE_QUAD = MARK_UNSORTABLE_LINE + 1; |
caryclark | 1049f12 | 2015-04-20 08:31:59 -0700 | [diff] [blame] | 1573 | var MARK_UNSORTABLE_CONIC = MARK_UNSORTABLE_QUAD + 1; |
| 1574 | var MARK_UNSORTABLE_CUBIC = MARK_UNSORTABLE_CONIC + 1; |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 1575 | var MARK_SIMPLE_LINE = MARK_UNSORTABLE_CUBIC + 1; |
| 1576 | var MARK_SIMPLE_QUAD = MARK_SIMPLE_LINE + 1; |
caryclark | 1049f12 | 2015-04-20 08:31:59 -0700 | [diff] [blame] | 1577 | var MARK_SIMPLE_CONIC = MARK_SIMPLE_QUAD + 1; |
| 1578 | var MARK_SIMPLE_CUBIC = MARK_SIMPLE_CONIC + 1; |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 1579 | var MARK_SIMPLE_DONE_LINE = MARK_SIMPLE_CUBIC + 1; |
| 1580 | var MARK_SIMPLE_DONE_QUAD = MARK_SIMPLE_DONE_LINE + 1; |
caryclark | 1049f12 | 2015-04-20 08:31:59 -0700 | [diff] [blame] | 1581 | var MARK_SIMPLE_DONE_CONIC = MARK_SIMPLE_DONE_QUAD + 1; |
| 1582 | var MARK_SIMPLE_DONE_CUBIC = MARK_SIMPLE_DONE_CONIC + 1; |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 1583 | var MARK_DONE_UNARY_LINE = MARK_SIMPLE_DONE_CUBIC + 1; |
| 1584 | var MARK_DONE_UNARY_QUAD = MARK_DONE_UNARY_LINE + 1; |
caryclark | 1049f12 | 2015-04-20 08:31:59 -0700 | [diff] [blame] | 1585 | var MARK_DONE_UNARY_CONIC = MARK_DONE_UNARY_QUAD + 1; |
| 1586 | var MARK_DONE_UNARY_CUBIC = MARK_DONE_UNARY_CONIC + 1; |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 1587 | var MARK_ANGLE_LAST = MARK_DONE_UNARY_CUBIC + 1; |
| 1588 | |
| 1589 | var COMPUTED_SET_1 = MARK_ANGLE_LAST + 1; |
| 1590 | var COMPUTED_SET_2 = COMPUTED_SET_1 + 1; |
| 1591 | |
caryclark | 624637c | 2015-05-11 07:21:27 -0700 | [diff] [blame] | 1592 | var ANGLE_AFTER = COMPUTED_SET_2 + 1; |
caryclark | 5435929 | 2015-03-26 07:52:43 -0700 | [diff] [blame] | 1593 | var ANGLE_AFTERPART = ANGLE_AFTER + 1; |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 1594 | |
caryclark | 5435929 | 2015-03-26 07:52:43 -0700 | [diff] [blame] | 1595 | var ACTIVE_OP = ANGLE_AFTERPART + 1; |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 1596 | |
caryclark | 624637c | 2015-05-11 07:21:27 -0700 | [diff] [blame] | 1597 | var COIN_MAIN_SPAN = ACTIVE_OP + 1; |
| 1598 | var COIN_OPP_SPAN = COIN_MAIN_SPAN + 1; |
| 1599 | |
| 1600 | var FRAG_TYPE_LAST = COIN_OPP_SPAN; |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 1601 | |
| 1602 | var REC_TYPE_UNKNOWN = -1; |
| 1603 | var REC_TYPE_PATH = 0; |
caryclark | 5435929 | 2015-03-26 07:52:43 -0700 | [diff] [blame] | 1604 | var REC_TYPE_PATH2 = 1; |
| 1605 | var REC_TYPE_SECT = 2; |
| 1606 | var REC_TYPE_ACTIVE = 3; |
| 1607 | var REC_TYPE_ADD = 4; |
| 1608 | var REC_TYPE_SORT = 5; |
| 1609 | var REC_TYPE_OP = 6; |
| 1610 | var REC_TYPE_MARK = 7; |
| 1611 | var REC_TYPE_COMPUTED = 8; |
| 1612 | var REC_TYPE_COIN = 9; |
| 1613 | var REC_TYPE_ANGLE = 10; |
| 1614 | var REC_TYPE_ACTIVE_OP = 11; |
| 1615 | var REC_TYPE_AFTERPART = 12; |
caryclark | 03b03ca | 2015-04-23 09:13:37 -0700 | [diff] [blame] | 1616 | var REC_TYPE_TOP = 13; |
caryclark | 624637c | 2015-05-11 07:21:27 -0700 | [diff] [blame] | 1617 | var REC_TYPE_COINCIDENCE = 14; |
caryclark | 26ad22a | 2015-10-16 09:03:38 -0700 | [diff] [blame] | 1618 | var REC_TYPE_ALIGNED = 15; |
| 1619 | var REC_TYPE_LAST = REC_TYPE_ALIGNED; |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 1620 | |
| 1621 | function strs_to_nums(strs) { |
| 1622 | var result = []; |
| 1623 | for (var idx = 1; idx < strs.length; ++idx) { |
| 1624 | var str = strs[idx]; |
| 1625 | var num = parseFloat(str); |
| 1626 | if (isNaN(num)) { |
| 1627 | result.push(str); |
| 1628 | } else { |
| 1629 | result.push(num); |
| 1630 | } |
| 1631 | } |
| 1632 | return result; |
| 1633 | } |
| 1634 | |
| 1635 | function filter_str_by(id, str, regex, array) { |
| 1636 | if (regex.test(str)) { |
| 1637 | var strs = regex.exec(str); |
| 1638 | var result = strs_to_nums(strs); |
| 1639 | array.push(id); |
| 1640 | array.push(result); |
| 1641 | return true; |
| 1642 | } |
| 1643 | return false; |
| 1644 | } |
| 1645 | |
| 1646 | function construct_regexp2(pattern) { |
| 1647 | var escape = pattern.replace(/[-/\\^$*+?.()|[\]{}]/g, '\\$&'); |
| 1648 | escape = escape.replace(/UNSORTABLE/g, "\\*\\*\\* UNSORTABLE \\*\\*\\*"); |
| 1649 | escape = escape.replace(/CUBIC_VAL/g, "\\(P_VAL P_VAL P_VAL P_VAL\\)"); |
caryclark | 1049f12 | 2015-04-20 08:31:59 -0700 | [diff] [blame] | 1650 | 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] | 1651 | escape = escape.replace(/QUAD_VAL/g, "\\(P_VAL P_VAL P_VAL\\)"); |
| 1652 | escape = escape.replace(/LINE_VAL/g, "\\(P_VAL P_VAL\\)"); |
| 1653 | escape = escape.replace(/FILL_TYPE/g, "SkPath::k[a-zA-Z]+_FillType"); |
caryclark | 5435929 | 2015-03-26 07:52:43 -0700 | [diff] [blame] | 1654 | escape = escape.replace(/PTR_VAL/g, "0x[0-9A-F]+"); |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 1655 | escape = escape.replace(/PT_VAL/g, "\\(P_VAL\\)"); |
| 1656 | escape = escape.replace(/P_VAL/g, "(-?\\d+\\.?\\d*(?:e-?\\d+)?)[Ff]?, ?(-?\\d+\\.?\\d*(?:e-?\\d+)?)[Ff]?"); |
| 1657 | escape = escape.replace(/T_VAL/g, "(-?\\d+\\.?\\d*(?:e-?\\d+)?)"); |
caryclark | 1049f12 | 2015-04-20 08:31:59 -0700 | [diff] [blame] | 1658 | escape = escape.replace(/W_VAL/g, "(-?\\d+\\.?\\d*(?:e-?\\d+)?)[Ff]?"); |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 1659 | escape = escape.replace(/PATH/g, "pathB?"); |
caryclark | 1049f12 | 2015-04-20 08:31:59 -0700 | [diff] [blame] | 1660 | escape = escape.replace(/IDX/g, "(-?\\d+)"); |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 1661 | escape = escape.replace(/NUM/g, "(-?\\d+)"); |
| 1662 | escape = escape.replace(/OPT/g, "(\\?|-?\\d+)"); |
| 1663 | return new RegExp(escape, 'i'); |
| 1664 | } |
| 1665 | |
| 1666 | function construct_regexp2c(pattern) { |
| 1667 | var escape = pattern.replace(/[-/\\^$*+?.()|[\]{}]/g, '\\$&'); |
| 1668 | escape = escape.replace(/UNSORTABLE/g, "\\*\\*\\* UNSORTABLE \\*\\*\\*"); |
caryclark | 5435929 | 2015-03-26 07:52:43 -0700 | [diff] [blame] | 1669 | 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] | 1670 | 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] | 1671 | escape = escape.replace(/QUAD_VAL/g, "(?:\\$\\d = )?\\{\\{\\{P_VAL\\}, \\{P_VAL\\}, \\{P_VAL\\}\\}\\}"); |
| 1672 | escape = escape.replace(/LINE_VAL/g, "(?:\\$\\d = )?\\{\\{\\{P_VAL\\}, \\{P_VAL\\}\\}\\}"); |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 1673 | escape = escape.replace(/FILL_TYPE/g, "SkPath::k[a-zA-Z]+_FillType"); |
caryclark | 5435929 | 2015-03-26 07:52:43 -0700 | [diff] [blame] | 1674 | escape = escape.replace(/PTR_VAL/g, "0x[0-9A-F]+"); |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 1675 | escape = escape.replace(/PT_VAL/g, "\\{\\{P_VAL\\}\\}"); |
caryclark | 5435929 | 2015-03-26 07:52:43 -0700 | [diff] [blame] | 1676 | 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] | 1677 | escape = escape.replace(/T_VAL/g, "(-?\\d+\\.?\\d*(?:e-?\\d+)?)"); |
caryclark | 1049f12 | 2015-04-20 08:31:59 -0700 | [diff] [blame] | 1678 | escape = escape.replace(/W_VAL/g, "(-?\\d+\\.?\\d*(?:e-?\\d+)?)[Ff]?"); |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 1679 | escape = escape.replace(/OPER/g, "[a-z]+"); |
| 1680 | escape = escape.replace(/PATH/g, "pathB?"); |
| 1681 | escape = escape.replace(/T_F/g, "([TF])"); |
caryclark | 1049f12 | 2015-04-20 08:31:59 -0700 | [diff] [blame] | 1682 | escape = escape.replace(/IDX/g, "(-?\\d+)"); |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 1683 | escape = escape.replace(/NUM/g, "(-?\\d+)"); |
| 1684 | escape = escape.replace(/OPT/g, "(\\?|-?\\d+)"); |
| 1685 | return new RegExp(escape, 'i'); |
| 1686 | } |
| 1687 | |
| 1688 | function match_regexp(str, lineNo, array, id, pattern) { |
| 1689 | var regex = construct_regexp2(pattern); |
| 1690 | if (filter_str_by(id, str, regex, array)) { |
| 1691 | return true; |
| 1692 | } |
| 1693 | regex = construct_regexp2c(pattern); |
| 1694 | return filter_str_by(id, str, regex, array); |
| 1695 | } |
| 1696 | |
| 1697 | function endsWith(str, suffix) { |
| 1698 | return str.indexOf(suffix, str.length - suffix.length) !== -1; |
| 1699 | } |
| 1700 | |
| 1701 | function parse_all(test) { |
| 1702 | var lines = test.match(/[^\r\n]+/g); |
| 1703 | var records = []; // a rec can be the original paths, a set of intersections, a set of active spans, a sort, or a path add |
| 1704 | var record = []; |
| 1705 | var recType = REC_TYPE_UNKNOWN; |
| 1706 | var lastLineNo; |
| 1707 | var moveX, moveY; |
| 1708 | for (var lineNo = 0; lineNo < lines.length; ++lineNo) { |
| 1709 | var line = lines[lineNo]; |
| 1710 | if (line.length == 0) { |
| 1711 | continue; |
| 1712 | } |
| 1713 | var opStart = "SkOpSegment::"; |
| 1714 | if (line.lastIndexOf(opStart, 0) === 0) { |
| 1715 | line = line.substr(opStart.length); |
| 1716 | } |
| 1717 | var angleStart = "SkOpAngle::"; |
| 1718 | if (line.lastIndexOf(angleStart, 0) === 0) { |
| 1719 | line = line.substr(angleStart.length); |
| 1720 | } |
caryclark | 624637c | 2015-05-11 07:21:27 -0700 | [diff] [blame] | 1721 | var coinStart = "SkOpCoincidence::"; |
| 1722 | if (line.lastIndexOf(coinStart, 0) === 0) { |
| 1723 | line = line.substr(coinStart.length); |
| 1724 | } |
caryclark | 5435929 | 2015-03-26 07:52:43 -0700 | [diff] [blame] | 1725 | var type = line.lastIndexOf("debugShowActiveSpans", 0) === 0 ? REC_TYPE_ACTIVE |
caryclark | 624637c | 2015-05-11 07:21:27 -0700 | [diff] [blame] | 1726 | : line.lastIndexOf("debugShowCoincidence", 0) === 0 ? REC_TYPE_COINCIDENCE |
caryclark | 5435929 | 2015-03-26 07:52:43 -0700 | [diff] [blame] | 1727 | : line.lastIndexOf("((SkOpSegment*)", 0) === 0 ? REC_TYPE_PATH2 |
caryclark | 55888e4 | 2016-07-18 10:01:36 -0700 | [diff] [blame] | 1728 | : line.lastIndexOf("debugShowTs", 0) === 0 ? REC_TYPE_COIN |
caryclark | 5435929 | 2015-03-26 07:52:43 -0700 | [diff] [blame] | 1729 | : line.lastIndexOf("afterPart", 0) === 0 ? REC_TYPE_AFTERPART |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 1730 | : line.lastIndexOf("debugShow", 0) === 0 ? REC_TYPE_SECT |
| 1731 | : line.lastIndexOf("activeOp", 0) === 0 ? REC_TYPE_ACTIVE_OP |
| 1732 | : line.lastIndexOf("computed", 0) === 0 ? REC_TYPE_COMPUTED |
| 1733 | : line.lastIndexOf("debugOne", 0) === 0 ? REC_TYPE_SORT |
caryclark | 26ad22a | 2015-10-16 09:03:38 -0700 | [diff] [blame] | 1734 | : line.lastIndexOf("aligned=", 0) === 0 ? REC_TYPE_ALIGNED |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 1735 | : line.lastIndexOf("dumpOne", 0) === 0 ? REC_TYPE_SORT |
caryclark | 03b03ca | 2015-04-23 09:13:37 -0700 | [diff] [blame] | 1736 | : line.lastIndexOf("findTop", 0) === 0 ? REC_TYPE_TOP |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 1737 | : line.lastIndexOf("pathB.", 0) === 0 ? REC_TYPE_ADD |
| 1738 | : line.lastIndexOf("path.", 0) === 0 ? REC_TYPE_ADD |
| 1739 | : line.lastIndexOf("after", 0) === 0 ? REC_TYPE_ANGLE |
| 1740 | : line.lastIndexOf("mark", 0) === 0 ? REC_TYPE_MARK |
| 1741 | : line.lastIndexOf(" {{", 0) === 0 ? REC_TYPE_COMPUTED |
caryclark | 5435929 | 2015-03-26 07:52:43 -0700 | [diff] [blame] | 1742 | : line.lastIndexOf("seg=", 0) === 0 ? REC_TYPE_PATH |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 1743 | : line.lastIndexOf("op", 0) === 0 ? REC_TYPE_OP |
| 1744 | : line.lastIndexOf("$", 0) === 0 ? REC_TYPE_PATH |
| 1745 | : REC_TYPE_UNKNOWN; |
| 1746 | if (recType != type || recType == REC_TYPE_ADD || recType == REC_TYPE_SECT |
| 1747 | || recType == REC_TYPE_ACTIVE_OP || recType == REC_TYPE_ANGLE) { |
| 1748 | if (recType != REC_TYPE_UNKNOWN) { |
| 1749 | records.push(recType); |
| 1750 | records.push(lastLineNo); |
| 1751 | records.push(record); |
| 1752 | } |
| 1753 | record = []; |
| 1754 | recType = type; |
| 1755 | lastLineNo = lineNo; |
| 1756 | } |
| 1757 | var found = false; |
| 1758 | switch (recType) { |
| 1759 | case REC_TYPE_ACTIVE: |
| 1760 | found = match_regexp(line, lineNo, record, ACTIVE_LINE_SPAN, "debugShowActiveSpans" + |
caryclark | 55888e4 | 2016-07-18 10:01:36 -0700 | [diff] [blame] | 1761 | " 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] | 1762 | ) || match_regexp(line, lineNo, record, ACTIVE_QUAD_SPAN, "debugShowActiveSpans" + |
caryclark | 55888e4 | 2016-07-18 10:01:36 -0700 | [diff] [blame] | 1763 | " 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] | 1764 | ) || match_regexp(line, lineNo, record, ACTIVE_CONIC_SPAN, "debugShowActiveSpans" + |
caryclark | 55888e4 | 2016-07-18 10:01:36 -0700 | [diff] [blame] | 1765 | " 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] | 1766 | ) || match_regexp(line, lineNo, record, ACTIVE_CUBIC_SPAN, "debugShowActiveSpans" + |
caryclark | 55888e4 | 2016-07-18 10:01:36 -0700 | [diff] [blame] | 1767 | " 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] | 1768 | ) || match_regexp(line, lineNo, record, ACTIVE_LINE_SPAN, "debugShowActiveSpans" + |
caryclark | 55888e4 | 2016-07-18 10:01:36 -0700 | [diff] [blame] | 1769 | " 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] | 1770 | ) || match_regexp(line, lineNo, record, ACTIVE_QUAD_SPAN, "debugShowActiveSpans" + |
caryclark | 55888e4 | 2016-07-18 10:01:36 -0700 | [diff] [blame] | 1771 | " 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] | 1772 | ) || match_regexp(line, lineNo, record, ACTIVE_CONIC_SPAN, "debugShowActiveSpans" + |
caryclark | 55888e4 | 2016-07-18 10:01:36 -0700 | [diff] [blame] | 1773 | " 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] | 1774 | ) || match_regexp(line, lineNo, record, ACTIVE_CUBIC_SPAN, "debugShowActiveSpans" + |
caryclark | 55888e4 | 2016-07-18 10:01:36 -0700 | [diff] [blame] | 1775 | " 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] | 1776 | ); |
| 1777 | break; |
| 1778 | case REC_TYPE_ACTIVE_OP: |
| 1779 | found = match_regexp(line, lineNo, record, ACTIVE_OP, "activeOp" + |
| 1780 | " id=IDX t=T_VAL tEnd=T_VAL op=OPER miFrom=NUM miTo=NUM suFrom=NUM suTo=NUM result=IDX" |
| 1781 | ); |
| 1782 | break; |
| 1783 | case REC_TYPE_ADD: |
| 1784 | if (match_regexp(line, lineNo, record, ADD_MOVETO, "PATH.moveTo(P_VAL);")) { |
| 1785 | moveX = record[1][0]; |
| 1786 | moveY = record[1][1]; |
| 1787 | found = true; |
| 1788 | } else if (match_regexp(line, lineNo, record, ADD_LINETO, "PATH.lineTo(P_VAL);")) { |
| 1789 | record[1].unshift(moveY); |
| 1790 | record[1].unshift(moveX); |
| 1791 | moveX = record[1][2]; |
| 1792 | moveY = record[1][3]; |
| 1793 | found = true; |
| 1794 | } else if (match_regexp(line, lineNo, record, ADD_QUADTO, "PATH.quadTo(P_VAL, P_VAL);")) { |
| 1795 | record[1].unshift(moveY); |
| 1796 | record[1].unshift(moveX); |
| 1797 | moveX = record[1][4]; |
| 1798 | moveY = record[1][5]; |
| 1799 | found = true; |
caryclark | 1049f12 | 2015-04-20 08:31:59 -0700 | [diff] [blame] | 1800 | } else if (match_regexp(line, lineNo, record, ADD_CONICTO, "PATH.conicTo(P_VAL, P_VAL, T_VAL);")) { |
| 1801 | record[1].unshift(moveY); |
| 1802 | record[1].unshift(moveX); |
| 1803 | moveX = record[1][4]; |
| 1804 | moveY = record[1][5]; |
| 1805 | found = true; |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 1806 | } else if (match_regexp(line, lineNo, record, ADD_CUBICTO, "PATH.cubicTo(P_VAL, P_VAL, P_VAL);")) { |
| 1807 | record[1].unshift(moveY); |
| 1808 | record[1].unshift(moveX); |
| 1809 | moveX = record[1][6]; |
| 1810 | moveY = record[1][7]; |
| 1811 | found = true; |
| 1812 | } else if (match_regexp(line, lineNo, record, ADD_FILL, "PATH.setFillType(FILL_TYPE);")) { |
| 1813 | found = true; |
| 1814 | } else { |
| 1815 | found = match_regexp(line, lineNo, record, ADD_CLOSE, "PATH.close();"); |
| 1816 | } |
| 1817 | break; |
caryclark | 5435929 | 2015-03-26 07:52:43 -0700 | [diff] [blame] | 1818 | case REC_TYPE_AFTERPART: |
| 1819 | found = match_regexp(line, lineNo, record, PATH_LINE, "afterPart LINE_VAL") |
| 1820 | || match_regexp(line, lineNo, record, PATH_QUAD, "afterPart QUAD_VAL") |
caryclark | 1049f12 | 2015-04-20 08:31:59 -0700 | [diff] [blame] | 1821 | || match_regexp(line, lineNo, record, PATH_CONIC, "afterPart CONIC_VAL") |
caryclark | 5435929 | 2015-03-26 07:52:43 -0700 | [diff] [blame] | 1822 | || match_regexp(line, lineNo, record, PATH_CUBIC, "afterPart CUBIC_VAL") |
| 1823 | break; |
caryclark | 26ad22a | 2015-10-16 09:03:38 -0700 | [diff] [blame] | 1824 | case REC_TYPE_ALIGNED: |
| 1825 | found = match_regexp(line, lineNo, record, PATH_LINE, "aligned=IDX LINE_VAL" |
| 1826 | ) || match_regexp(line, lineNo, record, PATH_QUAD, "aligned=IDX QUAD_VAL" |
| 1827 | ) || match_regexp(line, lineNo, record, PATH_CONIC, "aligned=IDX CONIC_VAL" |
| 1828 | ) || match_regexp(line, lineNo, record, PATH_CUBIC, "aligned=IDX CUBIC_VAL" |
| 1829 | ); |
| 1830 | break; |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 1831 | case REC_TYPE_ANGLE: |
| 1832 | found = match_regexp(line, lineNo, record, ANGLE_AFTER, "after " + |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 1833 | "[IDX/IDX] NUM/NUM tStart=T_VAL tEnd=T_VAL < [IDX/IDX] NUM/NUM tStart=T_VAL tEnd=T_VAL < [IDX/IDX] NUM/NUM tStart=T_VAL tEnd=T_VAL T_F IDX"); |
| 1834 | break; |
| 1835 | case REC_TYPE_COIN: |
| 1836 | found = true; |
| 1837 | break; |
caryclark | 624637c | 2015-05-11 07:21:27 -0700 | [diff] [blame] | 1838 | case REC_TYPE_COINCIDENCE: |
| 1839 | found = match_regexp(line, lineNo, record, COIN_MAIN_SPAN, "debugShowCoincidence" + |
| 1840 | " + id=IDX t=T_VAL tEnd=T_VAL" |
| 1841 | ) || match_regexp(line, lineNo, record, COIN_OPP_SPAN, "debugShowCoincidence" + |
| 1842 | " - id=IDX t=T_VAL tEnd=T_VAL" |
| 1843 | ); |
| 1844 | break; |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 1845 | case REC_TYPE_COMPUTED: |
| 1846 | found = line == "computed quadratics given" |
| 1847 | || match_regexp(line, lineNo, record, COMPUTED_SET_1, "computed quadratics set 1" |
| 1848 | ) || match_regexp(line, lineNo, record, COMPUTED_SET_2, "computed quadratics set 2" |
| 1849 | ) || match_regexp(line, lineNo, record, PATH_QUAD, " QUAD_VAL," |
caryclark | 1049f12 | 2015-04-20 08:31:59 -0700 | [diff] [blame] | 1850 | ) || match_regexp(line, lineNo, record, PATH_CONIC, " CONIC_VAL," |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 1851 | ) || match_regexp(line, lineNo, record, PATH_CUBIC, " CUBIC_VAL," |
| 1852 | ); |
| 1853 | break; |
| 1854 | case REC_TYPE_PATH: |
caryclark | 5435929 | 2015-03-26 07:52:43 -0700 | [diff] [blame] | 1855 | found = match_regexp(line, lineNo, record, PATH_LINE, "seg=IDX LINE_VAL" |
| 1856 | ) || match_regexp(line, lineNo, record, PATH_QUAD, "seg=IDX QUAD_VAL" |
caryclark | 1049f12 | 2015-04-20 08:31:59 -0700 | [diff] [blame] | 1857 | ) || match_regexp(line, lineNo, record, PATH_CONIC, "seg=IDX CONIC_VAL" |
caryclark | 5435929 | 2015-03-26 07:52:43 -0700 | [diff] [blame] | 1858 | ) || match_regexp(line, lineNo, record, PATH_CUBIC, "seg=IDX CUBIC_VAL" |
| 1859 | ); |
| 1860 | break; |
| 1861 | case REC_TYPE_PATH2: |
| 1862 | found = match_regexp(line, lineNo, record, PATH_LINE, "((SkOpSegment*) PTR_VAL) [IDX] {LINE_VAL}" |
| 1863 | ) || match_regexp(line, lineNo, record, PATH_QUAD, "((SkOpSegment*) PTR_VAL) [IDX] {QUAD_VAL}" |
caryclark | 1049f12 | 2015-04-20 08:31:59 -0700 | [diff] [blame] | 1864 | ) || match_regexp(line, lineNo, record, PATH_CONIC, "((SkOpSegment*) PTR_VAL) [IDX] {CONIC_VAL}" |
caryclark | 5435929 | 2015-03-26 07:52:43 -0700 | [diff] [blame] | 1865 | ) || match_regexp(line, lineNo, record, PATH_CUBIC, "((SkOpSegment*) PTR_VAL) [IDX] {CUBIC_VAL}" |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 1866 | ); |
| 1867 | break; |
| 1868 | case REC_TYPE_SECT: |
| 1869 | found = match_regexp(line, lineNo, record, INTERSECT_LINE, "debugShowLineIntersection" + |
| 1870 | " wtTs[0]=T_VAL LINE_VAL PT_VAL wnTs[0]=T_VAL LINE_VAL" |
| 1871 | ) || match_regexp(line, lineNo, record, INTERSECT_LINE_2, "debugShowLineIntersection" + |
| 1872 | " wtTs[0]=T_VAL LINE_VAL PT_VAL wtTs[1]=T_VAL PT_VAL wnTs[0]=T_VAL LINE_VAL wnTs[1]=T_VAL" |
| 1873 | ) || match_regexp(line, lineNo, record, INTERSECT_LINE_NO, "debugShowLineIntersection" + |
| 1874 | " no intersect LINE_VAL LINE_VAL" |
| 1875 | ) || match_regexp(line, lineNo, record, INTERSECT_QUAD_LINE, "debugShowQuadLineIntersection" + |
| 1876 | " wtTs[0]=T_VAL QUAD_VAL PT_VAL wnTs[0]=T_VAL LINE_VAL" |
| 1877 | ) || match_regexp(line, lineNo, record, INTERSECT_QUAD_LINE_2, "debugShowQuadLineIntersection" + |
| 1878 | " wtTs[0]=T_VAL QUAD_VAL PT_VAL wtTs[1]=T_VAL PT_VAL wnTs[0]=T_VAL LINE_VAL wnTs[1]=T_VAL" |
| 1879 | ) || match_regexp(line, lineNo, record, INTERSECT_QUAD_LINE_NO, "debugShowQuadLineIntersection" + |
| 1880 | " no intersect QUAD_VAL LINE_VAL" |
| 1881 | ) || match_regexp(line, lineNo, record, INTERSECT_QUAD, "debugShowQuadIntersection" + |
| 1882 | " wtTs[0]=T_VAL QUAD_VAL PT_VAL wnTs[0]=T_VAL QUAD_VAL" |
| 1883 | ) || match_regexp(line, lineNo, record, INTERSECT_QUAD_2, "debugShowQuadIntersection" + |
| 1884 | " wtTs[0]=T_VAL QUAD_VAL PT_VAL wtTs[1]=T_VAL PT_VAL wnTs[0]=T_VAL QUAD_VAL wnTs[1]=T_VAL" |
| 1885 | ) || match_regexp(line, lineNo, record, INTERSECT_QUAD_NO, "debugShowQuadIntersection" + |
| 1886 | " no intersect QUAD_VAL QUAD_VAL" |
caryclark | 55888e4 | 2016-07-18 10:01:36 -0700 | [diff] [blame] | 1887 | |
caryclark | 1049f12 | 2015-04-20 08:31:59 -0700 | [diff] [blame] | 1888 | ) || match_regexp(line, lineNo, record, INTERSECT_CONIC_LINE, "debugShowConicLineIntersection" + |
| 1889 | " wtTs[0]=T_VAL CONIC_VAL PT_VAL wnTs[0]=T_VAL LINE_VAL" |
| 1890 | ) || match_regexp(line, lineNo, record, INTERSECT_CONIC_LINE_2, "debugShowConicLineIntersection" + |
| 1891 | " wtTs[0]=T_VAL CONIC_VAL PT_VAL wtTs[1]=T_VAL PT_VAL wnTs[0]=T_VAL LINE_VAL wnTs[1]=T_VAL" |
| 1892 | ) || match_regexp(line, lineNo, record, INTERSECT_CONIC_LINE_NO, "debugShowConicLineIntersection" + |
| 1893 | " no intersect CONIC_VAL LINE_VAL" |
caryclark | 55888e4 | 2016-07-18 10:01:36 -0700 | [diff] [blame] | 1894 | |
| 1895 | ) || match_regexp(line, lineNo, record, INTERSECT_CONIC_QUAD, "debugShowConicQuadIntersection" + |
| 1896 | " wtTs[0]=T_VAL CONIC_VAL PT_VAL wnTs[0]=T_VAL QUAD_VAL" |
| 1897 | ) || match_regexp(line, lineNo, record, INTERSECT_CONIC_QUAD_2, "debugShowConicQuadIntersection" + |
| 1898 | " wtTs[0]=T_VAL CONIC_VAL PT_VAL wtTs[1]=T_VAL PT_VAL wnTs[0]=T_VAL QUAD_VAL wnTs[1]=T_VAL" |
caryclark | 6c3b9cd | 2016-09-26 05:36:58 -0700 | [diff] [blame^] | 1899 | ) || match_regexp(line, lineNo, record, INTERSECT_CONIC_QUAD_3, "debugShowConicQuadIntersection" + |
| 1900 | " wtTs[0]=T_VAL CONIC_VAL PT_VAL wtTs[1]=T_VAL PT_VAL wtTs[2]=T_VAL PT_VAL wnTs[0]=T_VAL QUAD_VAL wnTs[1]=T_VAL wnTs[2]=T_VAL" |
| 1901 | ) || match_regexp(line, lineNo, record, INTERSECT_CONIC_QUAD_4, "debugShowConicQuadIntersection" + |
| 1902 | " wtTs[0]=T_VAL CONIC_VAL PT_VAL wtTs[1]=T_VAL PT_VAL wtTs[2]=T_VAL PT_VAL wtTs[3]=T_VAL PT_VAL wnTs[0]=T_VAL QUAD_VAL wnTs[1]=T_VAL wnTs[2]=T_VAL wnTs[3]=T_VAL" |
caryclark | 55888e4 | 2016-07-18 10:01:36 -0700 | [diff] [blame] | 1903 | ) || match_regexp(line, lineNo, record, INTERSECT_CONIC_QUAD_NO, "debugShowConicQuadIntersection" + |
| 1904 | " no intersect CONIC_VAL QUAD_VAL" |
| 1905 | |
caryclark | 1049f12 | 2015-04-20 08:31:59 -0700 | [diff] [blame] | 1906 | ) || match_regexp(line, lineNo, record, INTERSECT_CONIC, "debugShowConicIntersection" + |
| 1907 | " wtTs[0]=T_VAL CONIC_VAL PT_VAL wnTs[0]=T_VAL CONIC_VAL" |
| 1908 | ) || match_regexp(line, lineNo, record, INTERSECT_CONIC_2, "debugShowConicIntersection" + |
| 1909 | " wtTs[0]=T_VAL CONIC_VAL PT_VAL wtTs[1]=T_VAL PT_VAL wnTs[0]=T_VAL CONIC_VAL wnTs[1]=T_VAL" |
| 1910 | ) || match_regexp(line, lineNo, record, INTERSECT_CONIC_NO, "debugShowConicIntersection" + |
| 1911 | " no intersect CONIC_VAL CONIC_VAL" |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 1912 | ) || match_regexp(line, lineNo, record, INTERSECT_CUBIC_LINE, "debugShowCubicLineIntersection" + |
| 1913 | " wtTs[0]=T_VAL CUBIC_VAL PT_VAL wnTs[0]=T_VAL LINE_VAL" |
| 1914 | ) || match_regexp(line, lineNo, record, INTERSECT_CUBIC_LINE_2, "debugShowCubicLineIntersection" + |
| 1915 | " wtTs[0]=T_VAL CUBIC_VAL PT_VAL wtTs[1]=T_VAL PT_VAL wnTs[0]=T_VAL LINE_VAL wnTs[1]=T_VAL" |
| 1916 | ) || match_regexp(line, lineNo, record, INTERSECT_CUBIC_LINE_3, "debugShowCubicLineIntersection" + |
| 1917 | " wtTs[0]=T_VAL CUBIC_VAL PT_VAL wtTs[1]=T_VAL PT_VAL wtTs[2]=T_VAL PT_VAL wnTs[0]=T_VAL LINE_VAL wnTs[1]=T_VAL wnTs[2]=T_VAL" |
| 1918 | ) || match_regexp(line, lineNo, record, INTERSECT_CUBIC_LINE_NO, "debugShowCubicLineIntersection" + |
| 1919 | " no intersect CUBIC_VAL LINE_VAL" |
| 1920 | ) || match_regexp(line, lineNo, record, INTERSECT_CUBIC_QUAD, "debugShowCubicQuadIntersection" + |
| 1921 | " wtTs[0]=T_VAL CUBIC_VAL PT_VAL wnTs[0]=T_VAL QUAD_VAL" |
| 1922 | ) || match_regexp(line, lineNo, record, INTERSECT_CUBIC_QUAD_2, "debugShowCubicQuadIntersection" + |
| 1923 | " wtTs[0]=T_VAL CUBIC_VAL PT_VAL wtTs[1]=T_VAL PT_VAL wnTs[0]=T_VAL QUAD_VAL wnTs[1]=T_VAL" |
| 1924 | ) || match_regexp(line, lineNo, record, INTERSECT_CUBIC_QUAD_3, "debugShowCubicQuadIntersection" + |
| 1925 | " wtTs[0]=T_VAL CUBIC_VAL PT_VAL wtTs[1]=T_VAL PT_VAL wtTs[2]=T_VAL PT_VAL wnTs[0]=T_VAL QUAD_VAL wnTs[1]=T_VAL wnTs[2]=T_VAL" |
| 1926 | ) || match_regexp(line, lineNo, record, INTERSECT_CUBIC_QUAD_4, "debugShowCubicQuadIntersection" + |
| 1927 | " wtTs[0]=T_VAL CUBIC_VAL PT_VAL wtTs[1]=T_VAL PT_VAL wtTs[2]=T_VAL wtTs[3]=T_VAL PT_VAL wnTs[0]=T_VAL QUAD_VAL wnTs[1]=T_VAL wnTs[2]=T_VAL wnTs[3]=T_VAL" |
| 1928 | ) || match_regexp(line, lineNo, record, INTERSECT_CUBIC_QUAD_NO, "debugShowCubicQuadIntersection" + |
| 1929 | " no intersect CUBIC_VAL QUAD_VAL" |
| 1930 | ) || match_regexp(line, lineNo, record, INTERSECT_CUBIC, "debugShowCubicIntersection" + |
| 1931 | " wtTs[0]=T_VAL CUBIC_VAL PT_VAL wnTs[0]=T_VAL CUBIC_VAL" |
| 1932 | ) || match_regexp(line, lineNo, record, INTERSECT_CUBIC_2, "debugShowCubicIntersection" + |
| 1933 | " wtTs[0]=T_VAL CUBIC_VAL PT_VAL wtTs[1]=T_VAL PT_VAL wnTs[0]=T_VAL CUBIC_VAL wnTs[1]=T_VAL" |
| 1934 | ) || match_regexp(line, lineNo, record, INTERSECT_CUBIC_3, "debugShowCubicIntersection" + |
| 1935 | " wtTs[0]=T_VAL CUBIC_VAL PT_VAL wtTs[1]=T_VAL PT_VAL wtTs[2]=T_VAL PT_VAL wnTs[0]=T_VAL CUBIC_VAL wnTs[1]=T_VAL wnTs[2]=T_VAL" |
| 1936 | ) || match_regexp(line, lineNo, record, INTERSECT_CUBIC_4, "debugShowCubicIntersection" + |
| 1937 | " wtTs[0]=T_VAL CUBIC_VAL PT_VAL wtTs[1]=T_VAL PT_VAL wtTs[2]=T_VAL PT_VAL wtTs[3]=T_VAL PT_VAL wnTs[0]=T_VAL CUBIC_VAL wnTs[1]=T_VAL wnTs[2]=T_VAL wnTs[3]=T_VAL" |
| 1938 | ) || match_regexp(line, lineNo, record, INTERSECT_CUBIC_NO, "debugShowCubicIntersection" + |
| 1939 | " no intersect CUBIC_VAL CUBIC_VAL" |
| 1940 | ) || match_regexp(line, lineNo, record, INTERSECT_SELF_CUBIC, "debugShowCubicIntersection" + |
| 1941 | " wtTs[0]=T_VAL CUBIC_VAL PT_VAL wtTs[1]=T_VAL" |
| 1942 | ) || match_regexp(line, lineNo, record, INTERSECT_SELF_CUBIC_NO, "debugShowCubicIntersection" + |
| 1943 | " no self intersect CUBIC_VAL" |
| 1944 | ); |
| 1945 | break; |
| 1946 | case REC_TYPE_SORT: |
| 1947 | var hasDone = / done/.test(line); |
| 1948 | var hasUnorderable = / unorderable/.test(line); |
| 1949 | var hasSmall = / small/.test(line); |
| 1950 | var hasTiny = / tiny/.test(line); |
| 1951 | var hasOperand = / operand/.test(line); |
| 1952 | var hasStop = / stop/.test(line); |
| 1953 | line.replace(/[ a-z]+$/, ""); |
| 1954 | found = match_regexp(line, lineNo, record, SORT_UNARY, "debugOne" + |
| 1955 | " [IDX/IDX] next=IDX/IDX sect=IDX/IDX s=T_VAL [IDX] e=T_VAL [IDX] sgn=NUM windVal=IDX windSum=OPT" |
| 1956 | ) || match_regexp(line, lineNo, record, SORT_BINARY, "debugOne" + |
| 1957 | " [IDX/IDX] next=IDX/IDX sect=IDX/IDX s=T_VAL [IDX] e=T_VAL [IDX] sgn=NUM windVal=IDX windSum=OPT oppVal=IDX oppSum=OPT" |
| 1958 | ) || match_regexp(line, lineNo, record, SORT_UNARY, "dumpOne" + |
| 1959 | " [IDX/IDX] next=IDX/IDX sect=NUM/NUM s=T_VAL [IDX] e=T_VAL [IDX] sgn=NUM windVal=IDX windSum=OPT" |
| 1960 | ) || match_regexp(line, lineNo, record, SORT_BINARY, "dumpOne" + |
| 1961 | " [IDX/IDX] next=IDX/IDX sect=NUM/NUM s=T_VAL [IDX] e=T_VAL [IDX] sgn=NUM windVal=IDX windSum=OPT oppVal=IDX oppSum=OPT" |
| 1962 | ); |
| 1963 | if (found) { |
| 1964 | record[1].push(hasDone); |
| 1965 | record[1].push(hasUnorderable); |
| 1966 | record[1].push(hasSmall); |
| 1967 | record[1].push(hasTiny); |
| 1968 | record[1].push(hasOperand); |
| 1969 | record[1].push(hasStop); |
| 1970 | } |
| 1971 | break; |
caryclark | 03b03ca | 2015-04-23 09:13:37 -0700 | [diff] [blame] | 1972 | case REC_TYPE_TOP: |
| 1973 | found = match_regexp(line, lineNo, record, ACTIVE_OP, "findTop" + |
| 1974 | " id=IDX s=T_VAL e=T_VAL cw=NUM swap=NUM inflections=NUM monotonic=NUM" |
| 1975 | ) || match_regexp(line, lineNo, record, ACTIVE_OP, "findTop" + |
| 1976 | " id=IDX s=T_VAL e=T_VAL (-) cw=NUM swap=NUM inflections=NUM monotonic=NUM" |
| 1977 | ) || match_regexp(line, lineNo, record, ACTIVE_OP, "findTop" + |
| 1978 | " id=IDX s=T_VAL e=T_VAL (+) cw=NUM swap=NUM inflections=NUM monotonic=NUM" |
| 1979 | ); |
| 1980 | break; |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 1981 | case REC_TYPE_MARK: |
| 1982 | found = match_regexp(line, lineNo, record, MARK_LINE, "markWinding" + |
caryclark | 5435929 | 2015-03-26 07:52:43 -0700 | [diff] [blame] | 1983 | " 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] | 1984 | ) || match_regexp(line, lineNo, record, MARK_QUAD, "markWinding" + |
caryclark | 5435929 | 2015-03-26 07:52:43 -0700 | [diff] [blame] | 1985 | " 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] | 1986 | ) || match_regexp(line, lineNo, record, MARK_CONIC, "markWinding" + |
| 1987 | " id=IDX CONIC_VAL t=T_VAL [IDX] PT_VAL tEnd=T_VAL newWindSum=NUM newOppSum=OPT oppSum=OPT windSum=OPT windValue=IDX" |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 1988 | ) || match_regexp(line, lineNo, record, MARK_CUBIC, "markWinding" + |
caryclark | 5435929 | 2015-03-26 07:52:43 -0700 | [diff] [blame] | 1989 | " id=IDX CUBIC_VAL t=T_VAL [IDX] PT_VAL tEnd=T_VAL newWindSum=NUM newOppSum=OPT oppSum=OPT windSum=OPT windValue=IDX" |
| 1990 | ) || match_regexp(line, lineNo, record, MARK_DONE_LINE, "markDone" + |
| 1991 | " id=IDX LINE_VAL t=T_VAL [IDX] PT_VAL tEnd=T_VAL newWindSum=OPT newOppSum=OPT oppSum=OPT windSum=OPT windValue=IDX oppValue=OPT" |
| 1992 | ) || match_regexp(line, lineNo, record, MARK_DONE_QUAD, "markDone" + |
| 1993 | " id=IDX QUAD_VAL t=T_VAL [IDX] PT_VAL tEnd=T_VAL newWindSum=OPT newOppSum=OPT oppSum=OPT windSum=OPT windValue=IDX oppValue=OPT" |
caryclark | 1049f12 | 2015-04-20 08:31:59 -0700 | [diff] [blame] | 1994 | ) || match_regexp(line, lineNo, record, MARK_DONE_CONIC, "markDone" + |
| 1995 | " id=IDX CONIC_VAL t=T_VAL [IDX] PT_VAL tEnd=T_VAL newWindSum=OPT newOppSum=OPT oppSum=OPT windSum=OPT windValue=IDX oppValue=OPT" |
caryclark | 5435929 | 2015-03-26 07:52:43 -0700 | [diff] [blame] | 1996 | ) || match_regexp(line, lineNo, record, MARK_DONE_CUBIC, "markDone" + |
| 1997 | " id=IDX CUBIC_VAL t=T_VAL [IDX] PT_VAL tEnd=T_VAL newWindSum=OPT newOppSum=OPT oppSum=OPT windSum=OPT windValue=IDX oppValue=OPT" |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 1998 | ) || match_regexp(line, lineNo, record, MARK_SIMPLE_LINE, "markWinding" + |
| 1999 | " id=IDX LINE_VAL t=T_VAL [IDX] PT_VAL tEnd=T_VAL newWindSum=NUM windSum=OPT windValue=IDX" |
| 2000 | ) || match_regexp(line, lineNo, record, MARK_SIMPLE_QUAD, "markWinding" + |
| 2001 | " id=IDX QUAD_VAL t=T_VAL [IDX] PT_VAL tEnd=T_VAL newWindSum=NUM windSum=OPT windValue=IDX" |
caryclark | 1049f12 | 2015-04-20 08:31:59 -0700 | [diff] [blame] | 2002 | ) || match_regexp(line, lineNo, record, MARK_SIMPLE_CONIC, "markWinding" + |
| 2003 | " id=IDX CONIC_VAL t=T_VAL [IDX] PT_VAL tEnd=T_VAL newWindSum=NUM windSum=OPT windValue=IDX" |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 2004 | ) || match_regexp(line, lineNo, record, MARK_SIMPLE_CUBIC, "markWinding" + |
| 2005 | " id=IDX CUBIC_VAL t=T_VAL [IDX] PT_VAL tEnd=T_VAL newWindSum=NUM windSum=OPT windValue=IDX" |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 2006 | ) || match_regexp(line, lineNo, record, MARK_ANGLE_LAST, "markAngle" + |
caryclark | 1049f12 | 2015-04-20 08:31:59 -0700 | [diff] [blame] | 2007 | " last segment=IDX span=IDX" |
caryclark | 5435929 | 2015-03-26 07:52:43 -0700 | [diff] [blame] | 2008 | ) || match_regexp(line, lineNo, record, MARK_ANGLE_LAST, "markAngle" + |
caryclark | 55888e4 | 2016-07-18 10:01:36 -0700 | [diff] [blame] | 2009 | " last seg=IDX span=IDX" |
| 2010 | ) || match_regexp(line, lineNo, record, MARK_ANGLE_LAST, "markAngle" + |
| 2011 | " last segment=IDX span=IDX windSum=OPT" |
| 2012 | ) || match_regexp(line, lineNo, record, MARK_ANGLE_LAST, "markAngle" + |
| 2013 | " last seg=IDX span=IDX windSum=OPT" |
| 2014 | ); |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 2015 | break; |
| 2016 | case REC_TYPE_OP: |
| 2017 | if (line.lastIndexOf("oppSign oppSign=", 0) === 0 |
| 2018 | || line.lastIndexOf("operator<", 0) === 0) { |
| 2019 | found = true; |
| 2020 | break; |
| 2021 | } |
caryclark | 5435929 | 2015-03-26 07:52:43 -0700 | [diff] [blame] | 2022 | found = match_regexp(line, lineNo, record, OP_DIFFERENCE, "op diff" |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 2023 | ) || match_regexp(line, lineNo, record, OP_INTERSECT, "op intersect" |
caryclark | 5435929 | 2015-03-26 07:52:43 -0700 | [diff] [blame] | 2024 | ) || match_regexp(line, lineNo, record, OP_INTERSECT, "op sect" |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 2025 | ) || match_regexp(line, lineNo, record, OP_UNION, "op union" |
| 2026 | ) || match_regexp(line, lineNo, record, OP_XOR, "op xor" |
| 2027 | ); |
| 2028 | break; |
| 2029 | case REC_TYPE_UNKNOWN: |
| 2030 | found = true; |
| 2031 | break; |
| 2032 | } |
| 2033 | if (!found) { |
| 2034 | console.log(line + " [" + lineNo + "] of type " + type + " not found"); |
| 2035 | } |
| 2036 | } |
| 2037 | if (recType != REC_TYPE_UNKNOWN) { |
| 2038 | records.push(recType); |
| 2039 | records.push(lastLineNo); |
| 2040 | records.push(record); |
| 2041 | } |
| 2042 | if (records.length >= 1) { |
| 2043 | tests[testIndex] = records; |
| 2044 | testLines[testIndex] = lines; |
| 2045 | } |
| 2046 | } |
| 2047 | |
| 2048 | function init(test) { |
| 2049 | var canvas = document.getElementById('canvas'); |
| 2050 | if (!canvas.getContext) return; |
| 2051 | ctx = canvas.getContext('2d'); |
| 2052 | var resScale = retina_scale && window.devicePixelRatio ? window.devicePixelRatio : 1; |
| 2053 | var unscaledWidth = window.innerWidth - 20; |
| 2054 | var unscaledHeight = window.innerHeight - 20; |
| 2055 | screenWidth = unscaledWidth; |
| 2056 | screenHeight = unscaledHeight; |
| 2057 | canvas.width = unscaledWidth * resScale; |
| 2058 | canvas.height = unscaledHeight * resScale; |
| 2059 | canvas.style.width = unscaledWidth + 'px'; |
| 2060 | canvas.style.height = unscaledHeight + 'px'; |
| 2061 | if (resScale != 1) { |
| 2062 | ctx.scale(resScale, resScale); |
| 2063 | } |
| 2064 | xmin = Infinity; |
| 2065 | xmax = -Infinity; |
| 2066 | ymin = Infinity; |
| 2067 | ymax = -Infinity; |
caryclark | 26ad22a | 2015-10-16 09:03:38 -0700 | [diff] [blame] | 2068 | hasPath = hasAlignedPath = hasComputedPath = false; |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 2069 | firstActiveSpan = -1; |
| 2070 | for (var tIndex = 0; tIndex < test.length; tIndex += 3) { |
| 2071 | var recType = test[tIndex]; |
| 2072 | if (!typeof recType == 'number' || recType < REC_TYPE_UNKNOWN || recType > REC_TYPE_LAST) { |
| 2073 | console.log("unknown rec type: " + recType); |
| 2074 | throw "stop execution"; |
| 2075 | } |
| 2076 | var records = test[tIndex + 2]; |
| 2077 | for (var recordIndex = 0; recordIndex < records.length; recordIndex += 2) { |
| 2078 | var fragType = records[recordIndex]; |
| 2079 | if (!typeof fragType == 'number' || fragType < 1 || fragType > FRAG_TYPE_LAST) { |
| 2080 | console.log("unknown in range frag type: " + fragType); |
| 2081 | throw "stop execution"; |
| 2082 | } |
| 2083 | var frags = records[recordIndex + 1]; |
| 2084 | var first = 0; |
| 2085 | var last = -1; |
| 2086 | var first2 = 0; |
| 2087 | var last2 = 0; |
| 2088 | switch (recType) { |
caryclark | 26ad22a | 2015-10-16 09:03:38 -0700 | [diff] [blame] | 2089 | case REC_TYPE_ALIGNED: |
| 2090 | hasAlignedPath = true; |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 2091 | case REC_TYPE_COMPUTED: |
| 2092 | if (fragType == COMPUTED_SET_1 || fragType == COMPUTED_SET_2) { |
| 2093 | break; |
| 2094 | } |
caryclark | 26ad22a | 2015-10-16 09:03:38 -0700 | [diff] [blame] | 2095 | if (REC_TYPE_COMPUTED == recType) { |
| 2096 | hasComputedPath = true; |
| 2097 | } |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 2098 | case REC_TYPE_PATH: |
caryclark | 5435929 | 2015-03-26 07:52:43 -0700 | [diff] [blame] | 2099 | first = 1; |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 2100 | switch (fragType) { |
| 2101 | case PATH_LINE: |
caryclark | 5435929 | 2015-03-26 07:52:43 -0700 | [diff] [blame] | 2102 | last = 5; |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 2103 | break; |
caryclark | 1049f12 | 2015-04-20 08:31:59 -0700 | [diff] [blame] | 2104 | case PATH_CONIC: |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 2105 | case PATH_QUAD: |
caryclark | 5435929 | 2015-03-26 07:52:43 -0700 | [diff] [blame] | 2106 | last = 7; |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 2107 | break; |
| 2108 | case PATH_CUBIC: |
caryclark | 5435929 | 2015-03-26 07:52:43 -0700 | [diff] [blame] | 2109 | last = 9; |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 2110 | break; |
| 2111 | default: |
caryclark | 55888e4 | 2016-07-18 10:01:36 -0700 | [diff] [blame] | 2112 | console.log("unknown " + (recType == REC_TYPE_PATH ? "REC_TYPE_PATH" |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 2113 | : "REC_TYPE_COMPUTED") + " frag type:" + fragType); |
| 2114 | throw "stop execution"; |
| 2115 | } |
| 2116 | if (recType == REC_TYPE_PATH) { |
| 2117 | hasPath = true; |
| 2118 | } |
| 2119 | break; |
caryclark | 5435929 | 2015-03-26 07:52:43 -0700 | [diff] [blame] | 2120 | case REC_TYPE_PATH2: |
| 2121 | first = 1; |
| 2122 | switch (fragType) { |
| 2123 | case PATH_LINE: |
| 2124 | last = 5; |
| 2125 | break; |
caryclark | 1049f12 | 2015-04-20 08:31:59 -0700 | [diff] [blame] | 2126 | case PATH_CONIC: |
caryclark | 5435929 | 2015-03-26 07:52:43 -0700 | [diff] [blame] | 2127 | case PATH_QUAD: |
| 2128 | last = 7; |
| 2129 | break; |
| 2130 | case PATH_CUBIC: |
| 2131 | last = 9; |
| 2132 | break; |
| 2133 | default: |
caryclark | 55888e4 | 2016-07-18 10:01:36 -0700 | [diff] [blame] | 2134 | console.log("unknown " + (recType == REC_TYPE_PATH2 ? "REC_TYPE_PATH2" |
caryclark | 5435929 | 2015-03-26 07:52:43 -0700 | [diff] [blame] | 2135 | : "REC_TYPE_COMPUTED") + " frag type:" + fragType); |
| 2136 | throw "stop execution"; |
| 2137 | } |
| 2138 | if (recType == REC_TYPE_PATH2) { |
| 2139 | hasPath = true; |
| 2140 | } |
| 2141 | break; |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 2142 | case REC_TYPE_ACTIVE: |
| 2143 | if (firstActiveSpan < 0) { |
| 2144 | firstActiveSpan = tIndex; |
| 2145 | } |
| 2146 | first = 1; |
| 2147 | switch (fragType) { |
| 2148 | case ACTIVE_LINE_SPAN: |
| 2149 | last = 5; |
| 2150 | break; |
caryclark | 1049f12 | 2015-04-20 08:31:59 -0700 | [diff] [blame] | 2151 | case ACTIVE_CONIC_SPAN: |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 2152 | case ACTIVE_QUAD_SPAN: |
| 2153 | last = 7; |
| 2154 | break; |
| 2155 | case ACTIVE_CUBIC_SPAN: |
| 2156 | last = 9; |
| 2157 | break; |
| 2158 | default: |
| 2159 | console.log("unknown REC_TYPE_ACTIVE frag type: " + fragType); |
| 2160 | throw "stop execution"; |
| 2161 | } |
| 2162 | break; |
| 2163 | case REC_TYPE_ADD: |
| 2164 | switch (fragType) { |
| 2165 | case ADD_MOVETO: |
| 2166 | break; |
| 2167 | case ADD_LINETO: |
| 2168 | last = 4; |
| 2169 | break; |
caryclark | 1049f12 | 2015-04-20 08:31:59 -0700 | [diff] [blame] | 2170 | case ADD_CONICTO: |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 2171 | case ADD_QUADTO: |
| 2172 | last = 6; |
| 2173 | break; |
| 2174 | case ADD_CUBICTO: |
| 2175 | last = 8; |
| 2176 | break; |
| 2177 | case ADD_CLOSE: |
| 2178 | case ADD_FILL: |
| 2179 | break; |
| 2180 | default: |
| 2181 | console.log("unknown REC_TYPE_ADD frag type: " + fragType); |
| 2182 | throw "stop execution"; |
| 2183 | } |
| 2184 | break; |
caryclark | 5435929 | 2015-03-26 07:52:43 -0700 | [diff] [blame] | 2185 | case REC_TYPE_AFTERPART: |
| 2186 | switch (fragType) { |
| 2187 | case PATH_LINE: |
| 2188 | last = 4; |
| 2189 | break; |
caryclark | 1049f12 | 2015-04-20 08:31:59 -0700 | [diff] [blame] | 2190 | case PATH_CONIC: |
caryclark | 5435929 | 2015-03-26 07:52:43 -0700 | [diff] [blame] | 2191 | case PATH_QUAD: |
| 2192 | last = 6; |
| 2193 | break; |
| 2194 | case PATH_CUBIC: |
| 2195 | last = 8; |
| 2196 | break; |
| 2197 | default: |
| 2198 | console.log("unknown REC_TYPE_ACTIVEPART frag type: " + fragType); |
| 2199 | throw "stop execution"; |
| 2200 | } |
| 2201 | break; |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 2202 | case REC_TYPE_SECT: |
| 2203 | switch (fragType) { |
| 2204 | case INTERSECT_LINE: |
| 2205 | first = 1; last = 5; first2 = 8; last2 = 12; |
| 2206 | break; |
| 2207 | case INTERSECT_LINE_2: |
| 2208 | first = 1; last = 5; first2 = 11; last2 = 15; |
| 2209 | break; |
| 2210 | case INTERSECT_LINE_NO: |
| 2211 | first = 0; last = 4; first2 = 4; last2 = 8; |
| 2212 | break; |
caryclark | 1049f12 | 2015-04-20 08:31:59 -0700 | [diff] [blame] | 2213 | case INTERSECT_CONIC_LINE: |
| 2214 | first = 1; last = 7; first2 = 11; last2 = 15; |
| 2215 | break; |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 2216 | case INTERSECT_QUAD_LINE: |
| 2217 | first = 1; last = 7; first2 = 10; last2 = 14; |
| 2218 | break; |
caryclark | 1049f12 | 2015-04-20 08:31:59 -0700 | [diff] [blame] | 2219 | case INTERSECT_CONIC_LINE_2: |
| 2220 | first = 1; last = 7; first2 = 14; last2 = 18; |
| 2221 | break; |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 2222 | case INTERSECT_QUAD_LINE_2: |
| 2223 | first = 1; last = 7; first2 = 13; last2 = 17; |
| 2224 | break; |
caryclark | 1049f12 | 2015-04-20 08:31:59 -0700 | [diff] [blame] | 2225 | case INTERSECT_CONIC_LINE_NO: |
| 2226 | first = 0; last = 6; first2 = 7; last2 = 11; |
| 2227 | break; |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 2228 | case INTERSECT_QUAD_LINE_NO: |
| 2229 | first = 0; last = 6; first2 = 6; last2 = 10; |
| 2230 | break; |
caryclark | 1049f12 | 2015-04-20 08:31:59 -0700 | [diff] [blame] | 2231 | case INTERSECT_CONIC: |
| 2232 | first = 1; last = 7; first2 = 11; last2 = 17; |
| 2233 | break; |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 2234 | case INTERSECT_QUAD: |
| 2235 | first = 1; last = 7; first2 = 10; last2 = 16; |
| 2236 | break; |
caryclark | 1049f12 | 2015-04-20 08:31:59 -0700 | [diff] [blame] | 2237 | case INTERSECT_CONIC_2: |
| 2238 | first = 1; last = 7; first2 = 14; last2 = 20; |
| 2239 | break; |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 2240 | case INTERSECT_QUAD_2: |
| 2241 | first = 1; last = 7; first2 = 13; last2 = 19; |
| 2242 | break; |
caryclark | 1049f12 | 2015-04-20 08:31:59 -0700 | [diff] [blame] | 2243 | case INTERSECT_CONIC_NO: |
| 2244 | first = 0; last = 6; first2 = 7; last2 = 13; |
| 2245 | break; |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 2246 | case INTERSECT_QUAD_NO: |
| 2247 | first = 0; last = 6; first2 = 6; last2 = 12; |
| 2248 | break; |
| 2249 | case INTERSECT_SELF_CUBIC: |
| 2250 | first = 1; last = 9; |
| 2251 | break; |
| 2252 | case INTERSECT_SELF_CUBIC_NO: |
| 2253 | first = 0; last = 8; |
| 2254 | break; |
| 2255 | case INTERSECT_CUBIC_LINE: |
| 2256 | first = 1; last = 9; first2 = 12; last2 = 16; |
| 2257 | break; |
| 2258 | case INTERSECT_CUBIC_LINE_2: |
| 2259 | first = 1; last = 9; first2 = 15; last2 = 19; |
| 2260 | break; |
| 2261 | case INTERSECT_CUBIC_LINE_3: |
| 2262 | first = 1; last = 9; first2 = 18; last2 = 22; |
| 2263 | break; |
| 2264 | case INTERSECT_CUBIC_LINE_NO: |
| 2265 | first = 0; last = 8; first2 = 8; last2 = 12; |
| 2266 | break; |
caryclark | 55888e4 | 2016-07-18 10:01:36 -0700 | [diff] [blame] | 2267 | case INTERSECT_CONIC_QUAD: |
| 2268 | first = 1; last = 7; first2 = 11; last2 = 17; |
| 2269 | break; |
| 2270 | case INTERSECT_CONIC_QUAD_2: |
| 2271 | first = 1; last = 7; first2 = 14; last2 = 20; |
| 2272 | break; |
caryclark | 6c3b9cd | 2016-09-26 05:36:58 -0700 | [diff] [blame^] | 2273 | case INTERSECT_CONIC_QUAD_3: |
| 2274 | first = 1; last = 7; first2 = 17; last2 = 23; |
| 2275 | break; |
| 2276 | case INTERSECT_CONIC_QUAD_4: |
| 2277 | first = 1; last = 7; first2 = 20; last2 = 26; |
| 2278 | break; |
caryclark | 55888e4 | 2016-07-18 10:01:36 -0700 | [diff] [blame] | 2279 | case INTERSECT_CONIC_QUAD_NO: |
| 2280 | first = 0; last = 6; first2 = 7; last2 = 13; |
| 2281 | break; |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 2282 | case INTERSECT_CUBIC_QUAD: |
| 2283 | first = 1; last = 9; first2 = 12; last2 = 18; |
| 2284 | break; |
| 2285 | case INTERSECT_CUBIC_QUAD_2: |
| 2286 | first = 1; last = 9; first2 = 15; last2 = 21; |
| 2287 | break; |
| 2288 | case INTERSECT_CUBIC_QUAD_3: |
| 2289 | first = 1; last = 9; first2 = 18; last2 = 24; |
| 2290 | break; |
| 2291 | case INTERSECT_CUBIC_QUAD_4: |
| 2292 | first = 1; last = 9; first2 = 21; last2 = 27; |
| 2293 | break; |
| 2294 | case INTERSECT_CUBIC_QUAD_NO: |
| 2295 | first = 0; last = 8; first2 = 8; last2 = 14; |
| 2296 | break; |
| 2297 | case INTERSECT_CUBIC: |
| 2298 | first = 1; last = 9; first2 = 12; last2 = 20; |
| 2299 | break; |
| 2300 | case INTERSECT_CUBIC_2: |
| 2301 | first = 1; last = 9; first2 = 15; last2 = 23; |
| 2302 | break; |
| 2303 | case INTERSECT_CUBIC_3: |
| 2304 | first = 1; last = 9; first2 = 18; last2 = 26; |
| 2305 | break; |
| 2306 | case INTERSECT_CUBIC_4: |
| 2307 | first = 1; last = 9; first2 = 21; last2 = 29; |
| 2308 | break; |
| 2309 | case INTERSECT_CUBIC_NO: |
| 2310 | first = 0; last = 8; first2 = 8; last2 = 16; |
| 2311 | break; |
| 2312 | default: |
| 2313 | console.log("unknown REC_TYPE_SECT frag type: " + fragType); |
| 2314 | throw "stop execution"; |
| 2315 | } |
| 2316 | break; |
| 2317 | default: |
| 2318 | continue; |
| 2319 | } |
| 2320 | for (var idx = first; idx < last; idx += 2) { |
| 2321 | xmin = Math.min(xmin, frags[idx]); |
| 2322 | xmax = Math.max(xmax, frags[idx]); |
| 2323 | ymin = Math.min(ymin, frags[idx + 1]); |
| 2324 | ymax = Math.max(ymax, frags[idx + 1]); |
| 2325 | } |
| 2326 | for (var idx = first2; idx < last2; idx += 2) { |
| 2327 | xmin = Math.min(xmin, frags[idx]); |
| 2328 | xmax = Math.max(xmax, frags[idx]); |
| 2329 | ymin = Math.min(ymin, frags[idx + 1]); |
| 2330 | ymax = Math.max(ymax, frags[idx + 1]); |
| 2331 | } |
| 2332 | } |
| 2333 | } |
| 2334 | var angleBounds = [Infinity, Infinity, -Infinity, -Infinity]; |
| 2335 | for (var tIndex = 0; tIndex < test.length; tIndex += 3) { |
| 2336 | var recType = test[tIndex]; |
| 2337 | var records = test[tIndex + 2]; |
| 2338 | for (var recordIndex = 0; recordIndex < records.length; recordIndex += 2) { |
| 2339 | var fragType = records[recordIndex]; |
| 2340 | var frags = records[recordIndex + 1]; |
| 2341 | switch (recType) { |
| 2342 | case REC_TYPE_ACTIVE_OP: |
| 2343 | if (!draw_op) { |
| 2344 | break; |
| 2345 | } |
| 2346 | { |
| 2347 | var curve = curvePartialByID(test, frags[0], frags[1], frags[2]); |
| 2348 | curve_extremes(curve, angleBounds); |
| 2349 | } |
| 2350 | break; |
| 2351 | case REC_TYPE_ANGLE: |
| 2352 | if (!draw_angle) { |
| 2353 | break; |
| 2354 | } |
caryclark | 5435929 | 2015-03-26 07:52:43 -0700 | [diff] [blame] | 2355 | { |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 2356 | var curve = curvePartialByID(test, frags[0], frags[4], frags[5]); |
| 2357 | curve_extremes(curve, angleBounds); |
| 2358 | curve = curvePartialByID(test, frags[6], frags[10], frags[11]); |
| 2359 | curve_extremes(curve, angleBounds); |
| 2360 | curve = curvePartialByID(test, frags[12], frags[16], frags[17]); |
| 2361 | } |
| 2362 | break; |
caryclark | 624637c | 2015-05-11 07:21:27 -0700 | [diff] [blame] | 2363 | case REC_TYPE_COINCIDENCE: |
| 2364 | if (!draw_coincidence) { |
| 2365 | break; |
| 2366 | } |
| 2367 | { |
| 2368 | var curve = curvePartialByID(test, frags[0], frags[1], frags[2]); |
| 2369 | curve_extremes(curve, angleBounds); |
| 2370 | } |
| 2371 | break; |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 2372 | case REC_TYPE_SORT: |
| 2373 | if (!draw_sort) { |
| 2374 | break; |
| 2375 | } |
| 2376 | if (fragType == SORT_UNARY || fragType == SORT_BINARY) { |
| 2377 | var curve = curvePartialByID(test, frags[0], frags[6], frags[8]); |
| 2378 | curve_extremes(curve, angleBounds); |
| 2379 | } |
| 2380 | break; |
caryclark | 03b03ca | 2015-04-23 09:13:37 -0700 | [diff] [blame] | 2381 | case REC_TYPE_TOP: |
| 2382 | if (!draw_top) { |
| 2383 | break; |
| 2384 | } |
| 2385 | { |
| 2386 | var curve = curvePartialByID(test, frags[0], frags[1], frags[2]); |
| 2387 | curve_extremes(curve, angleBounds); |
| 2388 | } |
| 2389 | break; |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 2390 | } |
| 2391 | } |
| 2392 | } |
| 2393 | xmin = Math.min(xmin, angleBounds[0]); |
| 2394 | ymin = Math.min(ymin, angleBounds[1]); |
| 2395 | xmax = Math.max(xmax, angleBounds[2]); |
| 2396 | ymax = Math.max(ymax, angleBounds[3]); |
| 2397 | setScale(xmin, xmax, ymin, ymax); |
| 2398 | if (hasPath == false && hasComputedPath == true && !draw_computed) { |
caryclark | 1049f12 | 2015-04-20 08:31:59 -0700 | [diff] [blame] | 2399 | draw_computed = 7; // show quadratics, conics, and cubics |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 2400 | } |
| 2401 | if (hasPath == true && hasComputedPath == false && draw_computed) { |
| 2402 | draw_computed = 0; |
| 2403 | } |
| 2404 | } |
| 2405 | |
caryclark | 26ad22a | 2015-10-16 09:03:38 -0700 | [diff] [blame] | 2406 | function curveByIDMatch(test, id, recMatch) { |
caryclark | 5435929 | 2015-03-26 07:52:43 -0700 | [diff] [blame] | 2407 | var tIndex = -3; |
| 2408 | while ((tIndex += 3) < test.length) { |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 2409 | var recType = test[tIndex]; |
caryclark | 5435929 | 2015-03-26 07:52:43 -0700 | [diff] [blame] | 2410 | if (recType == REC_TYPE_OP) { |
| 2411 | continue; |
| 2412 | } |
caryclark | 26ad22a | 2015-10-16 09:03:38 -0700 | [diff] [blame] | 2413 | if (recType != recMatch) { |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 2414 | return []; |
| 2415 | } |
| 2416 | var records = test[tIndex + 2]; |
| 2417 | for (var recordIndex = 0; recordIndex < records.length; recordIndex += 2) { |
| 2418 | var fragType = records[recordIndex]; |
| 2419 | var frags = records[recordIndex + 1]; |
| 2420 | if (frags[0] == id) { |
| 2421 | switch (fragType) { |
caryclark | 5435929 | 2015-03-26 07:52:43 -0700 | [diff] [blame] | 2422 | case PATH_LINE: |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 2423 | return [frags[1], frags[2], frags[3], frags[4]]; |
caryclark | 5435929 | 2015-03-26 07:52:43 -0700 | [diff] [blame] | 2424 | case PATH_QUAD: |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 2425 | return [frags[1], frags[2], frags[3], frags[4], |
| 2426 | frags[5], frags[6]]; |
caryclark | 1049f12 | 2015-04-20 08:31:59 -0700 | [diff] [blame] | 2427 | case PATH_CONIC: |
| 2428 | return [frags[1], frags[2], frags[3], frags[4], |
| 2429 | frags[5], frags[6], frags[7]]; |
caryclark | 5435929 | 2015-03-26 07:52:43 -0700 | [diff] [blame] | 2430 | case PATH_CUBIC: |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 2431 | return [frags[1], frags[2], frags[3], frags[4], |
| 2432 | frags[5], frags[6], frags[7], frags[8]]; |
| 2433 | } |
| 2434 | } |
| 2435 | } |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 2436 | } |
| 2437 | return []; |
| 2438 | } |
| 2439 | |
caryclark | 26ad22a | 2015-10-16 09:03:38 -0700 | [diff] [blame] | 2440 | function curveByID(test, id) { |
| 2441 | var result = draw_path >= 4 ? curveByIDMatch(test, id, REC_TYPE_ALIGNED) : []; |
| 2442 | if (!result.length) { |
| 2443 | result = curveByIDMatch(test, id, REC_TYPE_PATH); |
| 2444 | } |
| 2445 | return result; |
| 2446 | } |
| 2447 | |
| 2448 | function curvePartialByIDMatch(test, id, t0, t1, recMatch) { |
caryclark | 5435929 | 2015-03-26 07:52:43 -0700 | [diff] [blame] | 2449 | var tIndex = -3; |
| 2450 | while ((tIndex += 3) < test.length) { |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 2451 | var recType = test[tIndex]; |
caryclark | 5435929 | 2015-03-26 07:52:43 -0700 | [diff] [blame] | 2452 | if (recType == REC_TYPE_OP) { |
| 2453 | continue; |
| 2454 | } |
caryclark | 26ad22a | 2015-10-16 09:03:38 -0700 | [diff] [blame] | 2455 | if (recType != recMatch) { |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 2456 | return []; |
| 2457 | } |
| 2458 | var records = test[tIndex + 2]; |
| 2459 | for (var recordIndex = 0; recordIndex < records.length; recordIndex += 2) { |
| 2460 | var fragType = records[recordIndex]; |
| 2461 | var frags = records[recordIndex + 1]; |
| 2462 | if (frags[0] == id) { |
| 2463 | switch (fragType) { |
caryclark | 5435929 | 2015-03-26 07:52:43 -0700 | [diff] [blame] | 2464 | case PATH_LINE: |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 2465 | return linePartial(frags[1], frags[2], frags[3], frags[4], t0, t1); |
caryclark | 5435929 | 2015-03-26 07:52:43 -0700 | [diff] [blame] | 2466 | case PATH_QUAD: |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 2467 | return quadPartial(frags[1], frags[2], frags[3], frags[4], |
| 2468 | frags[5], frags[6], t0, t1); |
caryclark | 1049f12 | 2015-04-20 08:31:59 -0700 | [diff] [blame] | 2469 | case PATH_CONIC: |
| 2470 | return conicPartial(frags[1], frags[2], frags[3], frags[4], |
| 2471 | frags[5], frags[6], frags[7], t0, t1); |
caryclark | 5435929 | 2015-03-26 07:52:43 -0700 | [diff] [blame] | 2472 | case PATH_CUBIC: |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 2473 | return cubicPartial(frags[1], frags[2], frags[3], frags[4], |
| 2474 | frags[5], frags[6], frags[7], frags[8], t0, t1); |
| 2475 | } |
| 2476 | } |
| 2477 | } |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 2478 | } |
| 2479 | return []; |
| 2480 | } |
| 2481 | |
caryclark | 26ad22a | 2015-10-16 09:03:38 -0700 | [diff] [blame] | 2482 | function curvePartialByID(test, id, t0, t1) { |
| 2483 | var result = draw_path >= 4 ? curvePartialByIDMatch(test, id, t0, t1, REC_TYPE_ALIGNED) : []; |
| 2484 | if (!result.length) { |
| 2485 | result = curvePartialByIDMatch(test, id, t0, t1, REC_TYPE_PATH); |
| 2486 | } |
| 2487 | return result; |
| 2488 | } |
| 2489 | |
| 2490 | function idByCurveIDMatch(test, frag, type, recMatch) { |
caryclark | 5435929 | 2015-03-26 07:52:43 -0700 | [diff] [blame] | 2491 | var tIndex = 0; |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 2492 | while (tIndex < test.length) { |
| 2493 | var recType = test[tIndex]; |
caryclark | 26ad22a | 2015-10-16 09:03:38 -0700 | [diff] [blame] | 2494 | if (recType != recMatch) { |
caryclark | 5435929 | 2015-03-26 07:52:43 -0700 | [diff] [blame] | 2495 | ++tIndex; |
| 2496 | continue; |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 2497 | } |
| 2498 | var records = test[tIndex + 2]; |
| 2499 | for (var recordIndex = 0; recordIndex < records.length; recordIndex += 2) { |
| 2500 | var fragType = records[recordIndex]; |
| 2501 | var frags = records[recordIndex + 1]; |
caryclark | 5435929 | 2015-03-26 07:52:43 -0700 | [diff] [blame] | 2502 | if (frag.length != frags.length - 1) { |
| 2503 | continue; |
| 2504 | } |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 2505 | switch (fragType) { |
caryclark | 5435929 | 2015-03-26 07:52:43 -0700 | [diff] [blame] | 2506 | case PATH_LINE: |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 2507 | if (frag[0] != frags[1] || frag[1] != frags[2] |
| 2508 | || frag[2] != frags[3] || frag[3] != frags[4]) { |
| 2509 | continue; |
| 2510 | } |
| 2511 | return frags[0]; |
caryclark | 5435929 | 2015-03-26 07:52:43 -0700 | [diff] [blame] | 2512 | case PATH_QUAD: |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 2513 | if (frag[0] != frags[1] || frag[1] != frags[2] |
| 2514 | || frag[2] != frags[3] || frag[3] != frags[4] |
| 2515 | || frag[4] != frags[5] || frag[5] != frags[6]) { |
| 2516 | continue; |
| 2517 | } |
| 2518 | return frags[0]; |
caryclark | 1049f12 | 2015-04-20 08:31:59 -0700 | [diff] [blame] | 2519 | case PATH_CONIC: |
| 2520 | if (frag[0] != frags[1] || frag[1] != frags[2] |
| 2521 | || frag[2] != frags[3] || frag[3] != frags[4] |
| 2522 | || frag[4] != frags[5] || frag[5] != frags[6] |
| 2523 | || frag[6] != frags[7]) { |
| 2524 | continue; |
| 2525 | } |
| 2526 | return frags[0]; |
caryclark | 5435929 | 2015-03-26 07:52:43 -0700 | [diff] [blame] | 2527 | case PATH_CUBIC: |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 2528 | if (frag[0] != frags[1] || frag[1] != frags[2] |
| 2529 | || frag[2] != frags[3] || frag[3] != frags[4] |
| 2530 | || frag[4] != frags[5] || frag[5] != frags[6] |
| 2531 | || frag[6] != frags[7] || frag[7] != frags[8]) { |
| 2532 | continue; |
| 2533 | } |
| 2534 | return frags[0]; |
| 2535 | } |
| 2536 | } |
| 2537 | ++tIndex; |
| 2538 | } |
| 2539 | return -1; |
| 2540 | } |
| 2541 | |
caryclark | 26ad22a | 2015-10-16 09:03:38 -0700 | [diff] [blame] | 2542 | function idByCurve(test, frag, type) { |
| 2543 | var result = draw_path >= 4 ? idByCurveIDMatch(test, frag, type, REC_TYPE_ALIGNED) : []; |
| 2544 | if (!result.length) { |
| 2545 | result = idByCurveIDMatch(test, frag, type, REC_TYPE_PATH); |
| 2546 | } |
| 2547 | return result; |
| 2548 | } |
| 2549 | |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 2550 | function curve_extremes(curve, bounds) { |
caryclark | 1049f12 | 2015-04-20 08:31:59 -0700 | [diff] [blame] | 2551 | var length = curve.length == 7 ? 6 : curve.length; |
caryclark | ed0935a | 2015-10-22 07:23:52 -0700 | [diff] [blame] | 2552 | for (var index = 0; index < length; index += 2) { |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 2553 | var x = curve[index]; |
| 2554 | var y = curve[index + 1]; |
| 2555 | bounds[0] = Math.min(bounds[0], x); |
| 2556 | bounds[1] = Math.min(bounds[1], y); |
| 2557 | bounds[2] = Math.max(bounds[2], x); |
| 2558 | bounds[3] = Math.max(bounds[3], y); |
| 2559 | } |
| 2560 | } |
| 2561 | |
| 2562 | function setScale(x0, x1, y0, y1) { |
| 2563 | var srcWidth = x1 - x0; |
| 2564 | var srcHeight = y1 - y0; |
| 2565 | var usableWidth = screenWidth; |
| 2566 | var xDigits = Math.ceil(Math.log(Math.abs(xmax)) / Math.log(10)); |
| 2567 | var yDigits = Math.ceil(Math.log(Math.abs(ymax)) / Math.log(10)); |
| 2568 | usableWidth -= (xDigits + yDigits) * 10; |
| 2569 | usableWidth -= decimal_places * 10; |
| 2570 | if (draw_legend) { |
| 2571 | usableWidth -= 40; |
| 2572 | } |
| 2573 | var hscale = usableWidth / srcWidth; |
| 2574 | var vscale = screenHeight / srcHeight; |
| 2575 | scale = Math.min(hscale, vscale); |
| 2576 | var invScale = 1 / scale; |
| 2577 | var sxmin = x0 - invScale * 5; |
| 2578 | var symin = y0 - invScale * 10; |
| 2579 | var sxmax = x1 + invScale * (6 * decimal_places + 10); |
| 2580 | var symax = y1 + invScale * 10; |
| 2581 | srcWidth = sxmax - sxmin; |
| 2582 | srcHeight = symax - symin; |
| 2583 | hscale = usableWidth / srcWidth; |
| 2584 | vscale = screenHeight / srcHeight; |
| 2585 | scale = Math.min(hscale, vscale); |
| 2586 | srcLeft = sxmin; |
| 2587 | srcTop = symin; |
| 2588 | } |
| 2589 | |
| 2590 | function drawArc(curve, op, from, to) { |
| 2591 | var type = PATH_LINE + (curve.length / 2 - 2); |
| 2592 | var pt = pointAtT(curve, type, op ? 0.4 : 0.6); |
| 2593 | var dy = pt.y - curve[1]; |
| 2594 | var dx = pt.x - curve[0]; |
| 2595 | var dist = Math.sqrt(dy * dy + dx * dx); |
| 2596 | var _dist = dist * scale; |
| 2597 | var angle = Math.atan2(dy, dx); |
| 2598 | var _px = (curve[0] - srcLeft) * scale; |
| 2599 | var _py = (curve[1] - srcTop) * scale; |
| 2600 | var divisor = 4; |
| 2601 | var endDist; |
| 2602 | do { |
| 2603 | var ends = []; |
| 2604 | for (var index = -1; index <= 1; index += 2) { |
| 2605 | var px = Math.cos(index * Math.PI / divisor); |
| 2606 | var py = Math.sin(index * Math.PI / divisor); |
| 2607 | ends.push(px); |
| 2608 | ends.push(py); |
| 2609 | } |
| 2610 | var endDx = (ends[2] - ends[0]) * scale * dist; |
| 2611 | var endDy = (ends[3] - ends[1]) * scale * dist; |
| 2612 | endDist = Math.sqrt(endDx * endDx + endDy * endDy); |
| 2613 | if (endDist < 100) { |
| 2614 | break; |
| 2615 | } |
| 2616 | divisor *= 2; |
| 2617 | } while (true); |
| 2618 | if (endDist < 30) { |
| 2619 | return; |
| 2620 | } |
| 2621 | if (op) { |
| 2622 | divisor *= 2; |
| 2623 | } |
| 2624 | ctx.strokeStyle = op ? "rgba(210,0,45, 0.4)" : "rgba(90,90,90, 0.5)"; |
| 2625 | ctx.beginPath(); |
| 2626 | ctx.arc(_px, _py, _dist, angle - Math.PI / divisor, angle + Math.PI / divisor, false); |
| 2627 | ctx.stroke(); |
| 2628 | var saveAlign = ctx.textAlign; |
| 2629 | var saveStyle = ctx.fillStyle; |
| 2630 | var saveFont = ctx.font; |
| 2631 | ctx.textAlign = "center"; |
| 2632 | ctx.fillStyle = "black"; |
| 2633 | ctx.font = "normal 24px Arial"; |
| 2634 | divisor *= 0.8; |
| 2635 | for (var index = -1; index <= 1; index += 2) { |
| 2636 | var px = curve[0] + Math.cos(angle + index * Math.PI / divisor) * dist; |
| 2637 | var py = curve[1] + Math.sin(angle + index * Math.PI / divisor) * dist; |
| 2638 | var _px = (px - srcLeft) * scale; |
| 2639 | var _py = (py - srcTop) * scale; |
| 2640 | ctx.fillText(index < 0 ? to.toString() : from.toString(), _px, _py + 8); |
| 2641 | } |
| 2642 | ctx.textAlign = saveAlign; |
| 2643 | ctx.fillStyle = saveStyle; |
| 2644 | ctx.font = saveFont; |
| 2645 | } |
| 2646 | |
| 2647 | function drawPoint(px, py, end) { |
caryclark | 1049f12 | 2015-04-20 08:31:59 -0700 | [diff] [blame] | 2648 | var length = drawnPts.length == 7 ? 6 : drawnPts.length; |
| 2649 | for (var pts = 0; pts < length; pts += 2) { |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 2650 | var x = drawnPts[pts]; |
| 2651 | var y = drawnPts[pts + 1]; |
| 2652 | if (px == x && py == y) { |
| 2653 | return; |
| 2654 | } |
| 2655 | } |
| 2656 | drawnPts.push(px); |
| 2657 | drawnPts.push(py); |
| 2658 | var label = px.toFixed(decimal_places) + ", " + py.toFixed(decimal_places); |
| 2659 | var _px = (px - srcLeft) * scale; |
| 2660 | var _py = (py - srcTop) * scale; |
| 2661 | ctx.beginPath(); |
| 2662 | ctx.arc(_px, _py, 3, 0, Math.PI*2, true); |
| 2663 | ctx.closePath(); |
| 2664 | if (end) { |
| 2665 | ctx.fill(); |
| 2666 | } else { |
| 2667 | ctx.stroke(); |
| 2668 | } |
| 2669 | if (debug_xy) { |
| 2670 | ctx.textAlign = "left"; |
| 2671 | ctx.fillText(label, _px + 5, _py); |
| 2672 | } |
| 2673 | } |
| 2674 | |
caryclark | 1049f12 | 2015-04-20 08:31:59 -0700 | [diff] [blame] | 2675 | function coordCount(curveType) { |
| 2676 | switch (curveType) { |
| 2677 | case PATH_LINE: |
| 2678 | return 4; |
| 2679 | case PATH_QUAD: |
| 2680 | return 6; |
| 2681 | case PATH_CONIC: |
| 2682 | return 6; |
| 2683 | case PATH_CUBIC: |
| 2684 | return 8; |
| 2685 | } |
| 2686 | return -1; |
| 2687 | } |
| 2688 | |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 2689 | function drawPoints(ptArray, curveType, drawControls) { |
caryclark | 1049f12 | 2015-04-20 08:31:59 -0700 | [diff] [blame] | 2690 | var count = coordCount(curveType); |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 2691 | for (var idx = 0; idx < count; idx += 2) { |
| 2692 | if (!drawControls && idx != 0 && idx != count - 2) { |
| 2693 | continue; |
| 2694 | } |
| 2695 | drawPoint(ptArray[idx], ptArray[idx + 1], idx == 0 || idx == count - 2); |
| 2696 | } |
| 2697 | } |
| 2698 | |
| 2699 | function drawControlLines(curve, curveType, drawEnd) { |
| 2700 | if (curveType == PATH_LINE) { |
| 2701 | return; |
| 2702 | } |
| 2703 | ctx.strokeStyle = "rgba(0,0,0, 0.3)"; |
| 2704 | drawLine(curve[0], curve[1], curve[2], curve[3]); |
| 2705 | drawLine(curve[2], curve[3], curve[4], curve[5]); |
| 2706 | if (curveType == PATH_CUBIC) { |
| 2707 | drawLine(curve[4], curve[5], curve[6], curve[7]); |
| 2708 | if (drawEnd > 1) { |
| 2709 | drawLine(curve[6], curve[7], curve[0], curve[1]); |
| 2710 | if (drawEnd > 2) { |
| 2711 | drawLine(curve[0], curve[1], curve[4], curve[5]); |
| 2712 | drawLine(curve[6], curve[7], curve[2], curve[3]); |
| 2713 | } |
| 2714 | } |
| 2715 | } else if (drawEnd > 1) { |
| 2716 | drawLine(curve[4], curve[5], curve[0], curve[1]); |
| 2717 | } |
| 2718 | } |
| 2719 | |
| 2720 | function pointAtT(curve, curveType, t) { |
| 2721 | var xy = {}; |
| 2722 | switch (curveType) { |
| 2723 | case PATH_LINE: |
| 2724 | var a = 1 - t; |
| 2725 | var b = t; |
| 2726 | xy.x = a * curve[0] + b * curve[2]; |
| 2727 | xy.y = a * curve[1] + b * curve[3]; |
| 2728 | break; |
| 2729 | case PATH_QUAD: |
| 2730 | var one_t = 1 - t; |
| 2731 | var a = one_t * one_t; |
| 2732 | var b = 2 * one_t * t; |
| 2733 | var c = t * t; |
| 2734 | xy.x = a * curve[0] + b * curve[2] + c * curve[4]; |
| 2735 | xy.y = a * curve[1] + b * curve[3] + c * curve[5]; |
| 2736 | break; |
caryclark | 1049f12 | 2015-04-20 08:31:59 -0700 | [diff] [blame] | 2737 | case PATH_CONIC: |
| 2738 | var one_t = 1 - t; |
| 2739 | var a = one_t * one_t; |
| 2740 | var b = 2 * one_t * t; |
| 2741 | var c = t * t; |
| 2742 | xy.x = a * curve[0] + b * curve[2] * curve[6] + c * curve[4]; |
| 2743 | xy.y = a * curve[1] + b * curve[3] * curve[6] + c * curve[5]; |
| 2744 | var d = a + b * curve[6] + c; |
| 2745 | xy.x /= d; |
| 2746 | xy.y /= d; |
| 2747 | break; |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 2748 | case PATH_CUBIC: |
| 2749 | var one_t = 1 - t; |
| 2750 | var one_t2 = one_t * one_t; |
| 2751 | var a = one_t2 * one_t; |
| 2752 | var b = 3 * one_t2 * t; |
| 2753 | var t2 = t * t; |
| 2754 | var c = 3 * one_t * t2; |
| 2755 | var d = t2 * t; |
| 2756 | xy.x = a * curve[0] + b * curve[2] + c * curve[4] + d * curve[6]; |
| 2757 | xy.y = a * curve[1] + b * curve[3] + c * curve[5] + d * curve[7]; |
| 2758 | break; |
| 2759 | } |
| 2760 | return xy; |
| 2761 | } |
caryclark | 55888e4 | 2016-07-18 10:01:36 -0700 | [diff] [blame] | 2762 | |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 2763 | function drawPointAtT(curve, curveType) { |
| 2764 | var x, y; |
| 2765 | var xy = pointAtT(curve, curveType, curveT); |
| 2766 | drawPoint(xy.x, xy.y, true); |
| 2767 | if (!draw_intersectT) { |
| 2768 | return; |
| 2769 | } |
| 2770 | ctx.fillStyle = "red"; |
| 2771 | drawTAtPointUp(xy.x, xy.y, curveT); |
| 2772 | } |
| 2773 | |
| 2774 | function drawTAtPointUp(px, py, t) { |
| 2775 | var label = t.toFixed(decimal_places); |
| 2776 | var _px = (px - srcLeft)* scale; |
| 2777 | var _py = (py - srcTop) * scale; |
| 2778 | ctx.fillText(label, _px + 5, _py - 10); |
| 2779 | } |
| 2780 | |
| 2781 | function drawTAtPointDown(px, py, t) { |
| 2782 | var label = t.toFixed(decimal_places); |
| 2783 | var _px = (px - srcLeft)* scale; |
| 2784 | var _py = (py - srcTop) * scale; |
| 2785 | ctx.fillText(label, _px + 5, _py + 10); |
| 2786 | } |
| 2787 | |
| 2788 | function alreadyDrawnLine(x1, y1, x2, y2) { |
| 2789 | if (collect_bounds) { |
| 2790 | if (focus_enabled) { |
| 2791 | focusXmin = Math.min(focusXmin, x1, x2); |
| 2792 | focusYmin = Math.min(focusYmin, y1, y2); |
| 2793 | focusXmax = Math.max(focusXmax, x1, x2); |
| 2794 | focusYmax = Math.max(focusYmax, y1, y2); |
| 2795 | } |
| 2796 | return true; |
| 2797 | } |
| 2798 | for (var pts = 0; pts < drawnLines.length; pts += 4) { |
| 2799 | if (x1 == drawnLines[pts] && y1 == drawnLines[pts + 1] |
| 2800 | && x2 == drawnLines[pts + 2] && y2 == drawnLines[pts + 3]) { |
| 2801 | return true; |
| 2802 | } |
| 2803 | } |
| 2804 | drawnLines.push(x1); |
| 2805 | drawnLines.push(y1); |
| 2806 | drawnLines.push(x2); |
| 2807 | drawnLines.push(y2); |
| 2808 | return false; |
| 2809 | } |
| 2810 | |
| 2811 | function drawLine(x1, y1, x2, y2) { |
| 2812 | if (alreadyDrawnLine(x1, y1, x2, y2)) { |
| 2813 | return; |
| 2814 | } |
| 2815 | ctx.beginPath(); |
| 2816 | ctx.moveTo((x1 - srcLeft) * scale, |
| 2817 | (y1 - srcTop) * scale); |
| 2818 | ctx.lineTo((x2 - srcLeft) * scale, |
| 2819 | (y2 - srcTop) * scale); |
| 2820 | ctx.stroke(); |
| 2821 | } |
| 2822 | |
| 2823 | function linePartial(x1, y1, x2, y2, t1, t2) { |
| 2824 | var dx = x1 - x2; |
| 2825 | var dy = y1 - y2; |
| 2826 | var array = [ |
| 2827 | x1 - t1 * dx, |
| 2828 | y1 - t1 * dy, |
| 2829 | x1 - t2 * dx, |
| 2830 | y1 - t2 * dy |
| 2831 | ]; |
| 2832 | return array; |
| 2833 | } |
| 2834 | |
| 2835 | function drawLinePartial(x1, y1, x2, y2, t1, t2) { |
| 2836 | var a = linePartial(x1, y1, x2, y2, t1, t2); |
| 2837 | var ax = a[0]; |
| 2838 | var ay = a[1]; |
| 2839 | var bx = a[2]; |
| 2840 | var by = a[3]; |
| 2841 | if (alreadyDrawnLine(ax, ay, bx, by)) { |
| 2842 | return; |
| 2843 | } |
| 2844 | ctx.beginPath(); |
| 2845 | ctx.moveTo((ax - srcLeft) * scale, |
| 2846 | (ay - srcTop) * scale); |
| 2847 | ctx.lineTo((bx - srcLeft) * scale, |
| 2848 | (by - srcTop) * scale); |
| 2849 | ctx.stroke(); |
| 2850 | } |
| 2851 | |
| 2852 | function alreadyDrawnQuad(x1, y1, x2, y2, x3, y3) { |
| 2853 | if (collect_bounds) { |
| 2854 | if (focus_enabled) { |
| 2855 | focusXmin = Math.min(focusXmin, x1, x2, x3); |
| 2856 | focusYmin = Math.min(focusYmin, y1, y2, y3); |
| 2857 | focusXmax = Math.max(focusXmax, x1, x2, x3); |
| 2858 | focusYmax = Math.max(focusYmax, y1, y2, y3); |
| 2859 | } |
| 2860 | return true; |
| 2861 | } |
| 2862 | for (var pts = 0; pts < drawnQuads.length; pts += 6) { |
| 2863 | if (x1 == drawnQuads[pts] && y1 == drawnQuads[pts + 1] |
| 2864 | && x2 == drawnQuads[pts + 2] && y2 == drawnQuads[pts + 3] |
| 2865 | && x3 == drawnQuads[pts + 4] && y3 == drawnQuads[pts + 5]) { |
| 2866 | return true; |
| 2867 | } |
| 2868 | } |
| 2869 | drawnQuads.push(x1); |
| 2870 | drawnQuads.push(y1); |
| 2871 | drawnQuads.push(x2); |
| 2872 | drawnQuads.push(y2); |
| 2873 | drawnQuads.push(x3); |
| 2874 | drawnQuads.push(y3); |
| 2875 | return false; |
| 2876 | } |
| 2877 | |
| 2878 | function drawQuad(x1, y1, x2, y2, x3, y3) { |
| 2879 | if (alreadyDrawnQuad(x1, y1, x2, y2, x3, y3)) { |
| 2880 | return; |
| 2881 | } |
| 2882 | ctx.beginPath(); |
| 2883 | ctx.moveTo((x1 - srcLeft) * scale, |
| 2884 | (y1 - srcTop) * scale); |
| 2885 | ctx.quadraticCurveTo((x2 - srcLeft) * scale, |
| 2886 | (y2 - srcTop) * scale, |
| 2887 | (x3 - srcLeft) * scale, |
| 2888 | (y3 - srcTop) * scale); |
| 2889 | ctx.stroke(); |
| 2890 | } |
| 2891 | |
| 2892 | function interp(A, B, t) { |
| 2893 | return A + (B - A) * t; |
| 2894 | } |
| 2895 | |
| 2896 | function interp_quad_coords(x1, x2, x3, t) |
| 2897 | { |
| 2898 | var ab = interp(x1, x2, t); |
| 2899 | var bc = interp(x2, x3, t); |
| 2900 | var abc = interp(ab, bc, t); |
| 2901 | return abc; |
| 2902 | } |
| 2903 | |
| 2904 | function quadPartial(x1, y1, x2, y2, x3, y3, t1, t2) { |
| 2905 | var ax = interp_quad_coords(x1, x2, x3, t1); |
| 2906 | var ay = interp_quad_coords(y1, y2, y3, t1); |
| 2907 | var dx = interp_quad_coords(x1, x2, x3, (t1 + t2) / 2); |
| 2908 | var dy = interp_quad_coords(y1, y2, y3, (t1 + t2) / 2); |
| 2909 | var cx = interp_quad_coords(x1, x2, x3, t2); |
| 2910 | var cy = interp_quad_coords(y1, y2, y3, t2); |
| 2911 | var bx = 2*dx - (ax + cx)/2; |
| 2912 | var by = 2*dy - (ay + cy)/2; |
| 2913 | var array = [ |
| 2914 | ax, ay, bx, by, cx, cy |
| 2915 | ]; |
| 2916 | return array; |
| 2917 | } |
| 2918 | |
| 2919 | function drawQuadPartial(x1, y1, x2, y2, x3, y3, t1, t2) { |
| 2920 | var a = quadPartial(x1, y1, x2, y2, x3, y3, t1, t2); |
| 2921 | var ax = a[0]; |
| 2922 | var ay = a[1]; |
| 2923 | var bx = a[2]; |
| 2924 | var by = a[3]; |
| 2925 | var cx = a[4]; |
| 2926 | var cy = a[5]; |
| 2927 | if (alreadyDrawnQuad(ax, ay, bx, by, cx, cy)) { |
| 2928 | return; |
| 2929 | } |
| 2930 | ctx.beginPath(); |
| 2931 | ctx.moveTo((ax - srcLeft) * scale, |
| 2932 | (ay - srcTop) * scale); |
| 2933 | ctx.quadraticCurveTo((bx - srcLeft) * scale, |
| 2934 | (by - srcTop) * scale, |
| 2935 | (cx - srcLeft) * scale, |
| 2936 | (cy - srcTop) * scale); |
| 2937 | ctx.stroke(); |
| 2938 | } |
| 2939 | |
caryclark | 1049f12 | 2015-04-20 08:31:59 -0700 | [diff] [blame] | 2940 | function alreadyDrawnConic(x1, y1, x2, y2, x3, y3, w) { |
| 2941 | if (collect_bounds) { |
| 2942 | if (focus_enabled) { |
| 2943 | focusXmin = Math.min(focusXmin, x1, x2, x3); |
| 2944 | focusYmin = Math.min(focusYmin, y1, y2, y3); |
| 2945 | focusXmax = Math.max(focusXmax, x1, x2, x3); |
| 2946 | focusYmax = Math.max(focusYmax, y1, y2, y3); |
| 2947 | } |
| 2948 | return true; |
| 2949 | } |
| 2950 | for (var pts = 0; pts < drawnConics.length; pts += 8) { |
| 2951 | if (x1 == drawnConics[pts] && y1 == drawnCubics[pts + 1] |
caryclark | 55888e4 | 2016-07-18 10:01:36 -0700 | [diff] [blame] | 2952 | && x2 == drawnCubics[pts + 2] && y2 == drawnCubics[pts + 3] |
| 2953 | && x3 == drawnCubics[pts + 4] && y3 == drawnCubics[pts + 5] |
caryclark | 1049f12 | 2015-04-20 08:31:59 -0700 | [diff] [blame] | 2954 | && w == drawnCubics[pts + 6]) { |
| 2955 | return true; |
| 2956 | } |
| 2957 | } |
| 2958 | drawnConics.push(x1); |
| 2959 | drawnConics.push(y1); |
| 2960 | drawnConics.push(x2); |
| 2961 | drawnConics.push(y2); |
| 2962 | drawnConics.push(x3); |
| 2963 | drawnConics.push(y3); |
| 2964 | drawnCubics.push(w); |
| 2965 | return false; |
| 2966 | } |
| 2967 | |
| 2968 | var kMaxConicToQuadPOW2 = 5; |
| 2969 | |
| 2970 | function computeQuadPOW2(curve, tol) { |
| 2971 | var a = curve[6] - 1; |
| 2972 | var k = a / (4 * (2 + a)); |
| 2973 | var x = k * (curve[0] - 2 * curve[2] + curve[4]); |
| 2974 | var y = k * (curve[1] - 2 * curve[3] + curve[5]); |
| 2975 | |
| 2976 | var error = Math.sqrt(x * x + y * y); |
| 2977 | var pow2; |
| 2978 | for (pow2 = 0; pow2 < kMaxConicToQuadPOW2; ++pow2) { |
| 2979 | if (error <= tol) { |
| 2980 | break; |
| 2981 | } |
| 2982 | error *= 0.25; |
| 2983 | } |
| 2984 | return pow2; |
| 2985 | } |
| 2986 | |
| 2987 | function subdivide_w_value(w) { |
| 2988 | return Math.sqrt(0.5 + w * 0.5); |
| 2989 | } |
| 2990 | |
| 2991 | function chop(curve, part1, part2) { |
| 2992 | var w = curve[6]; |
| 2993 | var scale = 1 / (1 + w); |
| 2994 | part1[0] = curve[0]; |
| 2995 | part1[1] = curve[1]; |
| 2996 | part1[2] = (curve[0] + curve[2] * w) * scale; |
| 2997 | part1[3] = (curve[1] + curve[3] * w) * scale; |
| 2998 | part1[4] = part2[0] = (curve[0] + (curve[2] * w) * 2 + curve[4]) * scale * 0.5; |
| 2999 | part1[5] = part2[1] = (curve[1] + (curve[3] * w) * 2 + curve[5]) * scale * 0.5; |
| 3000 | part2[2] = (curve[2] * w + curve[4]) * scale; |
| 3001 | part2[3] = (curve[3] * w + curve[5]) * scale; |
| 3002 | part2[4] = curve[4]; |
| 3003 | part2[5] = curve[5]; |
| 3004 | part1[6] = part2[6] = subdivide_w_value(w); |
| 3005 | } |
| 3006 | |
| 3007 | function subdivide(curve, level, pts) { |
| 3008 | if (0 == level) { |
| 3009 | pts.push(curve[2]); |
| 3010 | pts.push(curve[3]); |
| 3011 | pts.push(curve[4]); |
| 3012 | pts.push(curve[5]); |
| 3013 | } else { |
| 3014 | var part1 = [], part2 = []; |
| 3015 | chop(curve, part1, part2); |
| 3016 | --level; |
| 3017 | subdivide(part1, level, pts); |
| 3018 | subdivide(part2, level, pts); |
| 3019 | } |
| 3020 | } |
| 3021 | |
| 3022 | function chopIntoQuadsPOW2(curve, pow2, pts) { |
| 3023 | subdivide(curve, pow2, pts); |
| 3024 | return 1 << pow2; |
| 3025 | } |
| 3026 | |
| 3027 | function drawConicWithQuads(x1, y1, x2, y2, x3, y3, w) { |
| 3028 | if (alreadyDrawnConic(x1, y1, x2, y2, x3, y3, w)) { |
| 3029 | return; |
| 3030 | } |
| 3031 | ctx.beginPath(); |
| 3032 | ctx.moveTo((x1 - srcLeft) * scale, |
| 3033 | (y1 - srcTop) * scale); |
| 3034 | var tol = 1 / scale; |
| 3035 | var curve = [x1, y1, x2, y2, x3, y3, w]; |
| 3036 | var pow2 = computeQuadPOW2(curve, tol); |
| 3037 | var pts = []; |
| 3038 | chopIntoQuadsPOW2(curve, pow2, pts); |
| 3039 | for (var i = 0; i < pts.length; i += 4) { |
| 3040 | ctx.quadraticCurveTo( |
| 3041 | (pts[i + 0] - srcLeft) * scale, (pts[i + 1] - srcTop) * scale, |
| 3042 | (pts[i + 2] - srcLeft) * scale, (pts[i + 3] - srcTop) * scale); |
| 3043 | } |
| 3044 | ctx.stroke(); |
| 3045 | } |
| 3046 | |
| 3047 | function conic_eval_numerator(x1, x2, x3, w, t) { |
| 3048 | var src2w = x2 * w; |
| 3049 | var C = x1; |
| 3050 | var A = x3 - 2 * src2w + C; |
| 3051 | var B = 2 * (src2w - C); |
| 3052 | return (A * t + B) * t + C; |
| 3053 | } |
| 3054 | |
| 3055 | |
| 3056 | function conic_eval_denominator(w, t) { |
| 3057 | var B = 2 * (w - 1); |
| 3058 | var C = 1; |
| 3059 | var A = -B; |
| 3060 | return (A * t + B) * t + C; |
| 3061 | } |
| 3062 | |
| 3063 | function conicPartial(x1, y1, x2, y2, x3, y3, w, t1, t2) { |
| 3064 | var ax = conic_eval_numerator(x1, x2, x3, w, t1); |
| 3065 | var ay = conic_eval_numerator(y1, y2, y3, w, t1); |
| 3066 | var az = conic_eval_denominator(w, t1); |
| 3067 | var midT = (t1 + t2) / 2; |
| 3068 | var dx = conic_eval_numerator(x1, x2, x3, w, midT); |
| 3069 | var dy = conic_eval_numerator(y1, y2, y3, w, midT); |
| 3070 | var dz = conic_eval_denominator(w, midT); |
| 3071 | var cx = conic_eval_numerator(x1, x2, x3, w, t2); |
| 3072 | var cy = conic_eval_numerator(y1, y2, y3, w, t2); |
| 3073 | var cz = conic_eval_denominator(w, t2); |
| 3074 | var bx = 2 * dx - (ax + cx) / 2; |
| 3075 | var by = 2 * dy - (ay + cy) / 2; |
| 3076 | var bz = 2 * dz - (az + cz) / 2; |
| 3077 | var dt = t2 - t1; |
| 3078 | var dt_1 = 1 - dt; |
caryclark | 1049f12 | 2015-04-20 08:31:59 -0700 | [diff] [blame] | 3079 | var array = [ |
caryclark | ed0935a | 2015-10-22 07:23:52 -0700 | [diff] [blame] | 3080 | ax / az, ay / az, bx / bz, by / bz, cx / cz, cy / cz, 0 |
caryclark | 1049f12 | 2015-04-20 08:31:59 -0700 | [diff] [blame] | 3081 | ]; |
caryclark | ed0935a | 2015-10-22 07:23:52 -0700 | [diff] [blame] | 3082 | var dMidAC = { x:(array[0] + array[4]) / 2, y:(array[1] + array[5]) / 2 }; |
| 3083 | var dMid = { x:dx / dz, y:dy / dz }; |
| 3084 | var dWNumer = { x:dMidAC.x - dMid.x, y:dMidAC.y - dMid.y }; |
| 3085 | var dWDenom = { x:dMid.x - array[2], y:dMid.y - array[3] }; |
| 3086 | var partW = Math.sqrt(dWNumer.x * dWNumer.x + dWNumer.y * dWNumer.y) |
| 3087 | / Math.sqrt(dWDenom.x * dWDenom.x + dWDenom.y * dWDenom.y); |
| 3088 | array[6] = partW; |
caryclark | 1049f12 | 2015-04-20 08:31:59 -0700 | [diff] [blame] | 3089 | return array; |
| 3090 | } |
caryclark | 55888e4 | 2016-07-18 10:01:36 -0700 | [diff] [blame] | 3091 | |
caryclark | 1049f12 | 2015-04-20 08:31:59 -0700 | [diff] [blame] | 3092 | function drawConicPartial(x1, y1, x2, y2, x3, y3, w, t1, t2) { |
| 3093 | var a = conicPartial(x1, y1, x2, y2, x3, y3, w, t1, t2); |
| 3094 | var ax = a[0]; |
| 3095 | var ay = a[1]; |
| 3096 | var bx = a[2]; |
| 3097 | var by = a[3]; |
| 3098 | var cx = a[4]; |
| 3099 | var cy = a[5]; |
| 3100 | var w_ = a[6]; |
| 3101 | drawConicWithQuads(ax, ay, bx, by, cx, cy, w_); |
| 3102 | } |
| 3103 | |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 3104 | function alreadyDrawnCubic(x1, y1, x2, y2, x3, y3, x4, y4) { |
| 3105 | if (collect_bounds) { |
| 3106 | if (focus_enabled) { |
| 3107 | focusXmin = Math.min(focusXmin, x1, x2, x3, x4); |
| 3108 | focusYmin = Math.min(focusYmin, y1, y2, y3, y4); |
| 3109 | focusXmax = Math.max(focusXmax, x1, x2, x3, x4); |
| 3110 | focusYmax = Math.max(focusYmax, y1, y2, y3, y4); |
| 3111 | } |
| 3112 | return true; |
| 3113 | } |
| 3114 | for (var pts = 0; pts < drawnCubics.length; pts += 8) { |
| 3115 | if (x1 == drawnCubics[pts] && y1 == drawnCubics[pts + 1] |
caryclark | 55888e4 | 2016-07-18 10:01:36 -0700 | [diff] [blame] | 3116 | && x2 == drawnCubics[pts + 2] && y2 == drawnCubics[pts + 3] |
| 3117 | && x3 == drawnCubics[pts + 4] && y3 == drawnCubics[pts + 5] |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 3118 | && x4 == drawnCubics[pts + 6] && y4 == drawnCubics[pts + 7]) { |
| 3119 | return true; |
| 3120 | } |
| 3121 | } |
| 3122 | drawnCubics.push(x1); |
| 3123 | drawnCubics.push(y1); |
| 3124 | drawnCubics.push(x2); |
| 3125 | drawnCubics.push(y2); |
| 3126 | drawnCubics.push(x3); |
| 3127 | drawnCubics.push(y3); |
| 3128 | drawnCubics.push(x4); |
| 3129 | drawnCubics.push(y4); |
| 3130 | return false; |
| 3131 | } |
| 3132 | |
| 3133 | function drawCubic(x1, y1, x2, y2, x3, y3, x4, y4) { |
| 3134 | if (alreadyDrawnCubic(x1, y1, x2, y2, x3, y3, x4, y4)) { |
| 3135 | return; |
| 3136 | } |
| 3137 | ctx.beginPath(); |
| 3138 | ctx.moveTo((x1 - srcLeft) * scale, |
| 3139 | (y1 - srcTop) * scale); |
| 3140 | ctx.bezierCurveTo((x2 - srcLeft) * scale, |
| 3141 | (y2 - srcTop) * scale, |
| 3142 | (x3 - srcLeft) * scale, |
| 3143 | (y3 - srcTop) * scale, |
| 3144 | (x4 - srcLeft) * scale, |
| 3145 | (y4 - srcTop) * scale); |
| 3146 | ctx.stroke(); |
| 3147 | } |
| 3148 | |
| 3149 | function interp_cubic_coords(x1, x2, x3, x4, t) |
| 3150 | { |
| 3151 | var ab = interp(x1, x2, t); |
| 3152 | var bc = interp(x2, x3, t); |
| 3153 | var cd = interp(x3, x4, t); |
| 3154 | var abc = interp(ab, bc, t); |
| 3155 | var bcd = interp(bc, cd, t); |
| 3156 | var abcd = interp(abc, bcd, t); |
| 3157 | return abcd; |
| 3158 | } |
| 3159 | |
| 3160 | function cubicPartial(x1, y1, x2, y2, x3, y3, x4, y4, t1, t2) { |
| 3161 | var ax = interp_cubic_coords(x1, x2, x3, x4, t1); |
| 3162 | var ay = interp_cubic_coords(y1, y2, y3, y4, t1); |
| 3163 | var ex = interp_cubic_coords(x1, x2, x3, x4, (t1*2+t2)/3); |
| 3164 | var ey = interp_cubic_coords(y1, y2, y3, y4, (t1*2+t2)/3); |
| 3165 | var fx = interp_cubic_coords(x1, x2, x3, x4, (t1+t2*2)/3); |
| 3166 | var fy = interp_cubic_coords(y1, y2, y3, y4, (t1+t2*2)/3); |
| 3167 | var dx = interp_cubic_coords(x1, x2, x3, x4, t2); |
| 3168 | var dy = interp_cubic_coords(y1, y2, y3, y4, t2); |
| 3169 | var mx = ex * 27 - ax * 8 - dx; |
| 3170 | var my = ey * 27 - ay * 8 - dy; |
| 3171 | var nx = fx * 27 - ax - dx * 8; |
| 3172 | var ny = fy * 27 - ay - dy * 8; |
| 3173 | var bx = (mx * 2 - nx) / 18; |
| 3174 | var by = (my * 2 - ny) / 18; |
| 3175 | var cx = (nx * 2 - mx) / 18; |
| 3176 | var cy = (ny * 2 - my) / 18; |
| 3177 | var array = [ |
| 3178 | ax, ay, bx, by, cx, cy, dx, dy |
| 3179 | ]; |
| 3180 | return array; |
| 3181 | } |
caryclark | 55888e4 | 2016-07-18 10:01:36 -0700 | [diff] [blame] | 3182 | |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 3183 | function drawCubicPartial(x1, y1, x2, y2, x3, y3, x4, y4, t1, t2) { |
| 3184 | var a = cubicPartial(x1, y1, x2, y2, x3, y3, x4, y4, t1, t2); |
| 3185 | var ax = a[0]; |
| 3186 | var ay = a[1]; |
| 3187 | var bx = a[2]; |
| 3188 | var by = a[3]; |
| 3189 | var cx = a[4]; |
| 3190 | var cy = a[5]; |
| 3191 | var dx = a[6]; |
| 3192 | var dy = a[7]; |
| 3193 | if (alreadyDrawnCubic(ax, ay, bx, by, cx, cy, dx, dy)) { |
| 3194 | return; |
| 3195 | } |
| 3196 | ctx.beginPath(); |
| 3197 | ctx.moveTo((ax - srcLeft) * scale, |
| 3198 | (ay - srcTop) * scale); |
| 3199 | ctx.bezierCurveTo((bx - srcLeft) * scale, |
| 3200 | (by - srcTop) * scale, |
| 3201 | (cx - srcLeft) * scale, |
| 3202 | (cy - srcTop) * scale, |
| 3203 | (dx - srcLeft) * scale, |
| 3204 | (dy - srcTop) * scale); |
| 3205 | ctx.stroke(); |
| 3206 | } |
| 3207 | |
| 3208 | function drawCurve(c) { |
| 3209 | switch (c.length) { |
| 3210 | case 4: |
| 3211 | drawLine(c[0], c[1], c[2], c[3]); |
| 3212 | break; |
| 3213 | case 6: |
| 3214 | drawQuad(c[0], c[1], c[2], c[3], c[4], c[5]); |
| 3215 | break; |
caryclark | 1049f12 | 2015-04-20 08:31:59 -0700 | [diff] [blame] | 3216 | case 7: |
| 3217 | drawConicWithQuads(c[0], c[1], c[2], c[3], c[4], c[5], c[6]); |
| 3218 | break; |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 3219 | case 8: |
| 3220 | drawCubic(c[0], c[1], c[2], c[3], c[4], c[5], c[6], c[7]); |
| 3221 | break; |
| 3222 | } |
| 3223 | } |
| 3224 | |
| 3225 | function boundsWidth(pts) { |
| 3226 | var min = pts[0]; |
| 3227 | var max = pts[0]; |
caryclark | 1049f12 | 2015-04-20 08:31:59 -0700 | [diff] [blame] | 3228 | var length = pts.length == 7 ? 6 : pts.length; |
| 3229 | for (var idx = 2; idx < length; idx += 2) { |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 3230 | min = Math.min(min, pts[idx]); |
| 3231 | max = Math.max(max, pts[idx]); |
| 3232 | } |
| 3233 | return max - min; |
| 3234 | } |
| 3235 | |
| 3236 | function boundsHeight(pts) { |
| 3237 | var min = pts[1]; |
| 3238 | var max = pts[1]; |
caryclark | 1049f12 | 2015-04-20 08:31:59 -0700 | [diff] [blame] | 3239 | var length = pts.length == 7 ? 6 : pts.length; |
| 3240 | for (var idx = 3; idx < length; idx += 2) { |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 3241 | min = Math.min(min, pts[idx]); |
| 3242 | max = Math.max(max, pts[idx]); |
| 3243 | } |
| 3244 | return max - min; |
| 3245 | } |
| 3246 | |
| 3247 | function tangent(pts) { |
| 3248 | var dx = pts[2] - pts[0]; |
| 3249 | var dy = pts[3] - pts[1]; |
| 3250 | if (dx == 0 && dy == 0 && pts.length > 4) { |
| 3251 | dx = pts[4] - pts[0]; |
| 3252 | dy = pts[5] - pts[1]; |
caryclark | 1049f12 | 2015-04-20 08:31:59 -0700 | [diff] [blame] | 3253 | if (dx == 0 && dy == 0 && pts.length == 8) { |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 3254 | dx = pts[6] - pts[0]; |
| 3255 | dy = pts[7] - pts[1]; |
| 3256 | } |
| 3257 | } |
| 3258 | return Math.atan2(-dy, dx); |
| 3259 | } |
| 3260 | |
| 3261 | function hodograph(cubic) { |
| 3262 | var hodo = []; |
| 3263 | hodo[0] = 3 * (cubic[2] - cubic[0]); |
| 3264 | hodo[1] = 3 * (cubic[3] - cubic[1]); |
| 3265 | hodo[2] = 3 * (cubic[4] - cubic[2]); |
| 3266 | hodo[3] = 3 * (cubic[5] - cubic[3]); |
| 3267 | hodo[4] = 3 * (cubic[6] - cubic[4]); |
| 3268 | hodo[5] = 3 * (cubic[7] - cubic[5]); |
| 3269 | return hodo; |
| 3270 | } |
| 3271 | |
| 3272 | function hodograph2(cubic) { |
| 3273 | var quad = hodograph(cubic); |
| 3274 | var hodo = []; |
| 3275 | hodo[0] = 2 * (quad[2] - quad[0]); |
| 3276 | hodo[1] = 2 * (quad[3] - quad[1]); |
| 3277 | hodo[2] = 2 * (quad[4] - quad[2]); |
| 3278 | hodo[3] = 2 * (quad[5] - quad[3]); |
| 3279 | return hodo; |
| 3280 | } |
| 3281 | |
| 3282 | function quadraticRootsReal(A, B, C, s) { |
| 3283 | if (A == 0) { |
| 3284 | if (B == 0) { |
| 3285 | s[0] = 0; |
| 3286 | return C == 0; |
| 3287 | } |
| 3288 | s[0] = -C / B; |
| 3289 | return 1; |
| 3290 | } |
| 3291 | /* normal form: x^2 + px + q = 0 */ |
| 3292 | var p = B / (2 * A); |
| 3293 | var q = C / A; |
| 3294 | var p2 = p * p; |
| 3295 | if (p2 < q) { |
| 3296 | return 0; |
| 3297 | } |
| 3298 | var sqrt_D = 0; |
| 3299 | if (p2 > q) { |
| 3300 | sqrt_D = sqrt(p2 - q); |
| 3301 | } |
| 3302 | s[0] = sqrt_D - p; |
| 3303 | s[1] = -sqrt_D - p; |
| 3304 | return 1 + s[0] != s[1]; |
| 3305 | } |
| 3306 | |
| 3307 | function add_valid_ts(s, realRoots, t) { |
| 3308 | var foundRoots = 0; |
| 3309 | for (var index = 0; index < realRoots; ++index) { |
| 3310 | var tValue = s[index]; |
| 3311 | if (tValue >= 0 && tValue <= 1) { |
| 3312 | for (var idx2 = 0; idx2 < foundRoots; ++idx2) { |
| 3313 | if (t[idx2] != tValue) { |
| 3314 | t[foundRoots++] = tValue; |
| 3315 | } |
| 3316 | } |
| 3317 | } |
| 3318 | } |
| 3319 | return foundRoots; |
| 3320 | } |
| 3321 | |
| 3322 | function quadraticRootsValidT(a, b, c, t) { |
| 3323 | var s = []; |
| 3324 | var realRoots = quadraticRootsReal(A, B, C, s); |
| 3325 | var foundRoots = add_valid_ts(s, realRoots, t); |
| 3326 | return foundRoots != 0; |
| 3327 | } |
| 3328 | |
| 3329 | function find_cubic_inflections(cubic, tValues) { |
| 3330 | var Ax = src[2] - src[0]; |
| 3331 | var Ay = src[3] - src[1]; |
| 3332 | var Bx = src[4] - 2 * src[2] + src[0]; |
| 3333 | var By = src[5] - 2 * src[3] + src[1]; |
| 3334 | var Cx = src[6] + 3 * (src[2] - src[4]) - src[0]; |
| 3335 | var Cy = src[7] + 3 * (src[3] - src[5]) - src[1]; |
| 3336 | return quadraticRootsValidT(Bx * Cy - By * Cx, (Ax * Cy - Ay * Cx), |
| 3337 | Ax * By - Ay * Bx, tValues); |
| 3338 | } |
| 3339 | |
| 3340 | function dxy_at_t(curve, type, t) { |
| 3341 | var dxy = {}; |
| 3342 | if (type == PATH_QUAD) { |
| 3343 | var a = t - 1; |
| 3344 | var b = 1 - 2 * t; |
| 3345 | var c = t; |
| 3346 | dxy.x = a * curve[0] + b * curve[2] + c * curve[4]; |
| 3347 | dxy.y = a * curve[1] + b * curve[3] + c * curve[5]; |
caryclark | 1049f12 | 2015-04-20 08:31:59 -0700 | [diff] [blame] | 3348 | } else if (type == PATH_CONIC) { |
| 3349 | var p20x = curve[4] - curve[0]; |
| 3350 | var p20y = curve[5] - curve[1]; |
| 3351 | var p10xw = (curve[2] - curve[0]) * curve[6]; |
| 3352 | var p10yw = (curve[3] - curve[1]) * curve[6]; |
| 3353 | var coeff0x = curve[6] * p20x - p20x; |
| 3354 | var coeff0y = curve[6] * p20y - p20y; |
| 3355 | var coeff1x = p20x - 2 * p10xw; |
| 3356 | var coeff1y = p20y - 2 * p10yw; |
| 3357 | dxy.x = t * (t * coeff0x + coeff1x) + p10xw; |
| 3358 | dxy.y = t * (t * coeff0y + coeff1y) + p10yw; |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 3359 | } else if (type == PATH_CUBIC) { |
| 3360 | var one_t = 1 - t; |
| 3361 | var a = curve[0]; |
| 3362 | var b = curve[2]; |
| 3363 | var c = curve[4]; |
| 3364 | var d = curve[6]; |
| 3365 | dxy.x = 3 * ((b - a) * one_t * one_t + 2 * (c - b) * t * one_t + (d - c) * t * t); |
| 3366 | a = curve[1]; |
| 3367 | b = curve[3]; |
| 3368 | c = curve[5]; |
| 3369 | d = curve[7]; |
| 3370 | dxy.y = 3 * ((b - a) * one_t * one_t + 2 * (c - b) * t * one_t + (d - c) * t * t); |
| 3371 | } |
| 3372 | return dxy; |
| 3373 | } |
| 3374 | |
| 3375 | function drawLabel(num, px, py) { |
| 3376 | ctx.beginPath(); |
| 3377 | ctx.arc(px, py, 8, 0, Math.PI*2, true); |
| 3378 | ctx.closePath(); |
| 3379 | ctx.strokeStyle = "rgba(0,0,0, 0.4)"; |
| 3380 | ctx.lineWidth = num == 0 || num == 3 ? 2 : 1; |
| 3381 | ctx.stroke(); |
| 3382 | ctx.fillStyle = "black"; |
| 3383 | ctx.font = "normal 10px Arial"; |
| 3384 | // ctx.rotate(0.001); |
| 3385 | ctx.fillText(num, px - 2, py + 3); |
| 3386 | // ctx.rotate(-0.001); |
| 3387 | } |
| 3388 | |
| 3389 | function drawLabelX(ymin, num, loc) { |
| 3390 | var px = (loc - srcLeft) * scale; |
| 3391 | var py = (ymin - srcTop) * scale - 20; |
| 3392 | drawLabel(num, px, py); |
| 3393 | } |
| 3394 | |
| 3395 | function drawLabelY(xmin, num, loc) { |
| 3396 | var px = (xmin - srcLeft) * scale - 20; |
| 3397 | var py = (loc - srcTop) * scale; |
| 3398 | drawLabel(num, px, py); |
| 3399 | } |
| 3400 | |
| 3401 | function drawHodoOrigin(hx, hy, hMinX, hMinY, hMaxX, hMaxY) { |
| 3402 | ctx.beginPath(); |
| 3403 | ctx.moveTo(hx, hy - 100); |
| 3404 | ctx.lineTo(hx, hy); |
| 3405 | ctx.strokeStyle = hMinY < 0 ? "green" : "blue"; |
| 3406 | ctx.stroke(); |
| 3407 | ctx.beginPath(); |
| 3408 | ctx.moveTo(hx, hy); |
| 3409 | ctx.lineTo(hx, hy + 100); |
| 3410 | ctx.strokeStyle = hMaxY > 0 ? "green" : "blue"; |
| 3411 | ctx.stroke(); |
| 3412 | ctx.beginPath(); |
| 3413 | ctx.moveTo(hx - 100, hy); |
| 3414 | ctx.lineTo(hx, hy); |
| 3415 | ctx.strokeStyle = hMinX < 0 ? "green" : "blue"; |
| 3416 | ctx.stroke(); |
| 3417 | ctx.beginPath(); |
| 3418 | ctx.moveTo(hx, hy); |
| 3419 | ctx.lineTo(hx + 100, hy); |
| 3420 | ctx.strokeStyle = hMaxX > 0 ? "green" : "blue"; |
| 3421 | ctx.stroke(); |
| 3422 | } |
| 3423 | |
| 3424 | function scalexy(x, y, mag) { |
| 3425 | var length = Math.sqrt(x * x + y * y); |
| 3426 | return mag / length; |
| 3427 | } |
| 3428 | |
caryclark | 03b03ca | 2015-04-23 09:13:37 -0700 | [diff] [blame] | 3429 | function drawArrow(x, y, dx, dy, s) { |
| 3430 | var dscale = scalexy(dx, dy, 1 / scale * 100 * s); |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 3431 | dx *= dscale; |
| 3432 | dy *= dscale; |
| 3433 | ctx.beginPath(); |
| 3434 | ctx.moveTo((x - srcLeft) * scale, (y - srcTop) * scale); |
| 3435 | x += dx; |
| 3436 | y += dy; |
| 3437 | ctx.lineTo((x - srcLeft) * scale, (y - srcTop) * scale); |
| 3438 | dx /= 10; |
| 3439 | dy /= 10; |
| 3440 | ctx.lineTo((x - dy - srcLeft) * scale, (y + dx - srcTop) * scale); |
| 3441 | ctx.lineTo((x + dx * 2 - srcLeft) * scale, (y + dy * 2 - srcTop) * scale); |
| 3442 | ctx.lineTo((x + dy - srcLeft) * scale, (y - dx - srcTop) * scale); |
| 3443 | ctx.lineTo((x - srcLeft) * scale, (y - srcTop) * scale); |
| 3444 | ctx.strokeStyle = "rgba(0,75,0, 0.4)"; |
| 3445 | ctx.stroke(); |
| 3446 | } |
| 3447 | |
| 3448 | function x_at_t(curve, t) { |
| 3449 | var one_t = 1 - t; |
| 3450 | if (curve.length == 4) { |
| 3451 | return one_t * curve[0] + t * curve[2]; |
| 3452 | } |
| 3453 | var one_t2 = one_t * one_t; |
| 3454 | var t2 = t * t; |
| 3455 | if (curve.length == 6) { |
| 3456 | return one_t2 * curve[0] + 2 * one_t * t * curve[2] + t2 * curve[4]; |
| 3457 | } |
caryclark | 1049f12 | 2015-04-20 08:31:59 -0700 | [diff] [blame] | 3458 | if (curve.length == 7) { |
| 3459 | return (one_t2 * curve[0] + 2 * one_t * t * curve[2] * curve[6] + t2 * curve[4]) |
| 3460 | / (one_t2 +2 * one_t * t * curve[6] + t2); |
| 3461 | } |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 3462 | var a = one_t2 * one_t; |
| 3463 | var b = 3 * one_t2 * t; |
| 3464 | var c = 3 * one_t * t2; |
| 3465 | var d = t2 * t; |
| 3466 | return a * curve[0] + b * curve[2] + c * curve[4] + d * curve[6]; |
| 3467 | } |
| 3468 | |
| 3469 | function y_at_t(curve, t) { |
| 3470 | var one_t = 1 - t; |
| 3471 | if (curve.length == 4) { |
| 3472 | return one_t * curve[1] + t * curve[3]; |
| 3473 | } |
| 3474 | var one_t2 = one_t * one_t; |
| 3475 | var t2 = t * t; |
| 3476 | if (curve.length == 6) { |
| 3477 | return one_t2 * curve[1] + 2 * one_t * t * curve[3] + t2 * curve[5]; |
| 3478 | } |
caryclark | 1049f12 | 2015-04-20 08:31:59 -0700 | [diff] [blame] | 3479 | if (curve.length == 7) { |
| 3480 | return (one_t2 * curve[1] + 2 * one_t * t * curve[3] * curve[6] + t2 * curve[5]) |
| 3481 | / (one_t2 +2 * one_t * t * curve[6] + t2); |
| 3482 | } |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 3483 | var a = one_t2 * one_t; |
| 3484 | var b = 3 * one_t2 * t; |
| 3485 | var c = 3 * one_t * t2; |
| 3486 | var d = t2 * t; |
| 3487 | return a * curve[1] + b * curve[3] + c * curve[5] + d * curve[7]; |
| 3488 | } |
| 3489 | |
| 3490 | function drawOrder(curve, label) { |
| 3491 | var px = x_at_t(curve, 0.75); |
| 3492 | var py = y_at_t(curve, 0.75); |
| 3493 | var _px = (px - srcLeft) * scale; |
| 3494 | var _py = (py - srcTop) * scale; |
| 3495 | ctx.beginPath(); |
| 3496 | ctx.arc(_px, _py, 15, 0, Math.PI * 2, true); |
| 3497 | ctx.closePath(); |
| 3498 | ctx.fillStyle = "white"; |
| 3499 | ctx.fill(); |
| 3500 | if (label == 'L') { |
| 3501 | ctx.strokeStyle = "rgba(255,0,0, 1)"; |
| 3502 | ctx.fillStyle = "rgba(255,0,0, 1)"; |
| 3503 | } else { |
| 3504 | ctx.strokeStyle = "rgba(0,0,255, 1)"; |
| 3505 | ctx.fillStyle = "rgba(0,0,255, 1)"; |
| 3506 | } |
| 3507 | ctx.stroke(); |
| 3508 | ctx.font = "normal 16px Arial"; |
| 3509 | ctx.textAlign = "center"; |
| 3510 | ctx.fillText(label, _px, _py + 5); |
| 3511 | ctx.font = "normal 10px Arial"; |
| 3512 | } |
| 3513 | |
| 3514 | function drawID(curve, id) { |
| 3515 | var px = x_at_t(curve, 0.5); |
| 3516 | var py = y_at_t(curve, 0.5); |
| 3517 | var _px = (px - srcLeft) * scale; |
| 3518 | var _py = (py - srcTop) * scale; |
| 3519 | draw_id_at(id, _px, _py); |
| 3520 | } |
| 3521 | |
| 3522 | function draw_id_at(id, _px, _py) { |
| 3523 | ctx.beginPath(); |
| 3524 | ctx.arc(_px, _py, 15, 0, Math.PI * 2, true); |
| 3525 | ctx.closePath(); |
| 3526 | ctx.fillStyle = "white"; |
| 3527 | ctx.fill(); |
| 3528 | ctx.strokeStyle = "rgba(127,127,0, 1)"; |
| 3529 | ctx.fillStyle = "rgba(127,127,0, 1)"; |
| 3530 | ctx.stroke(); |
| 3531 | ctx.font = "normal 16px Arial"; |
| 3532 | ctx.textAlign = "center"; |
| 3533 | ctx.fillText(id, _px, _py + 5); |
| 3534 | ctx.font = "normal 10px Arial"; |
| 3535 | } |
| 3536 | |
| 3537 | function drawLinePartialID(id, x1, y1, x2, y2, t1, t2) { |
| 3538 | var curve = [x1, y1, x2, y2]; |
| 3539 | drawCurvePartialID(id, curve, t1, t2); |
| 3540 | } |
| 3541 | |
caryclark | 55888e4 | 2016-07-18 10:01:36 -0700 | [diff] [blame] | 3542 | function drawLineID(id, x1, y1, x2, y2) { |
| 3543 | drawLinePartialID(id, x1, y1, x2, y2, 0, 1); |
| 3544 | } |
| 3545 | |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 3546 | function drawQuadPartialID(id, x1, y1, x2, y2, x3, y3, t1, t2) { |
| 3547 | var curve = [x1, y1, x2, y2, x3, y3]; |
| 3548 | drawCurvePartialID(id, curve, t1, t2); |
| 3549 | } |
| 3550 | |
caryclark | 55888e4 | 2016-07-18 10:01:36 -0700 | [diff] [blame] | 3551 | function drawQuadID(id, x1, y1, x2, y2, x3, y3) { |
| 3552 | drawQuadPartialID(id, x1, y1, x2, y2, x3, y3, 0, 1); |
| 3553 | } |
| 3554 | |
caryclark | 1049f12 | 2015-04-20 08:31:59 -0700 | [diff] [blame] | 3555 | function drawConicPartialID(id, x1, y1, x2, y2, x3, y3, w, t1, t2) { |
| 3556 | var curve = [x1, y1, x2, y2, x3, y3, w]; |
| 3557 | drawCurvePartialID(id, curve, t1, t2); |
| 3558 | } |
| 3559 | |
caryclark | 55888e4 | 2016-07-18 10:01:36 -0700 | [diff] [blame] | 3560 | function drawConicID(id, x1, y1, x2, y2, x3, y3, w) { |
| 3561 | drawConicPartialID(id, x1, y1, x2, y2, x3, y3, w, 0, 1); |
| 3562 | } |
| 3563 | |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 3564 | function drawCubicPartialID(id, x1, y1, x2, y2, x3, y3, x4, y4, t1, t2) { |
| 3565 | var curve = [x1, y1, x2, y2, x3, y3, x4, y4]; |
| 3566 | drawCurvePartialID(id, curve, t1, t2); |
| 3567 | } |
| 3568 | |
caryclark | 55888e4 | 2016-07-18 10:01:36 -0700 | [diff] [blame] | 3569 | function drawCubicID(id, x1, y1, x2, y2, x3, y3, x4, y4) { |
| 3570 | drawCubicPartialID(id, x1, y1, x2, y2, x3, y3, x4, y4, 0, 1); |
| 3571 | } |
| 3572 | |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 3573 | function drawCurvePartialID(id, curve, t1, t2) { |
| 3574 | var px = x_at_t(curve, (t1 + t2) / 2); |
| 3575 | var py = y_at_t(curve, (t1 + t2) / 2); |
| 3576 | var _px = (px - srcLeft) * scale; |
| 3577 | var _py = (py - srcTop) * scale; |
| 3578 | draw_id_at(id, _px, _py); |
| 3579 | } |
| 3580 | |
| 3581 | function drawCurveSpecials(test, curve, type) { |
| 3582 | if (pt_labels) { |
| 3583 | drawPoints(curve, type, pt_labels == 2); |
| 3584 | } |
| 3585 | if (control_lines != 0) { |
| 3586 | drawControlLines(curve, type, control_lines); |
| 3587 | } |
| 3588 | if (curve_t) { |
| 3589 | drawPointAtT(curve, type); |
| 3590 | } |
| 3591 | if (draw_midpoint) { |
| 3592 | var mid = pointAtT(curve, type, 0.5); |
| 3593 | drawPoint(mid.x, mid.y, true); |
| 3594 | } |
| 3595 | if (draw_id) { |
| 3596 | var id = idByCurve(test, curve, type); |
| 3597 | if (id >= 0) { |
| 3598 | drawID(curve, id); |
| 3599 | } |
| 3600 | } |
| 3601 | if (type == PATH_LINE) { |
| 3602 | return; |
| 3603 | } |
| 3604 | if (draw_deriviatives > 0) { |
| 3605 | var d = dxy_at_t(curve, type, 0); |
caryclark | 03b03ca | 2015-04-23 09:13:37 -0700 | [diff] [blame] | 3606 | drawArrow(curve[0], curve[1], d.x, d.y, 1); |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 3607 | if (draw_deriviatives == 2) { |
| 3608 | d = dxy_at_t(curve, type, 1); |
| 3609 | if (type == PATH_CUBIC) { |
caryclark | 03b03ca | 2015-04-23 09:13:37 -0700 | [diff] [blame] | 3610 | drawArrow(curve[6], curve[7], d.x, d.y, 1); |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 3611 | } else { |
caryclark | 03b03ca | 2015-04-23 09:13:37 -0700 | [diff] [blame] | 3612 | drawArrow(curve[4], curve[5], d.x, d.y, 1); |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 3613 | } |
| 3614 | } |
| 3615 | if (draw_midpoint) { |
| 3616 | var mid = pointAtT(curve, type, 0.5); |
| 3617 | d = dxy_at_t(curve, type, 0.5); |
caryclark | 03b03ca | 2015-04-23 09:13:37 -0700 | [diff] [blame] | 3618 | drawArrow(mid.x, mid.y, d.x, d.y, 1); |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 3619 | } |
| 3620 | } |
| 3621 | if (type != PATH_CUBIC) { |
| 3622 | return; |
| 3623 | } |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 3624 | if (draw_sequence) { |
| 3625 | var ymin = Math.min(curve[1], curve[3], curve[5], curve[7]); |
| 3626 | for (var i = 0; i < 8; i+= 2) { |
| 3627 | drawLabelX(ymin, i >> 1, curve[i]); |
| 3628 | } |
| 3629 | var xmin = Math.min(curve[0], curve[2], curve[4], curve[6]); |
| 3630 | for (var i = 1; i < 8; i+= 2) { |
| 3631 | drawLabelY(xmin, i >> 1, curve[i]); |
| 3632 | } |
| 3633 | } |
| 3634 | } |
| 3635 | |
| 3636 | function logCurves(test) { |
| 3637 | for (curves in test) { |
| 3638 | var curve = test[curves]; |
| 3639 | dumpCurve(curve); |
| 3640 | } |
| 3641 | } |
| 3642 | |
| 3643 | function curveToString(curve) { |
| 3644 | var str = "{{"; |
caryclark | 1049f12 | 2015-04-20 08:31:59 -0700 | [diff] [blame] | 3645 | var length = curve.length == 7 ? 6 : curve.length; |
| 3646 | if (curve.length == 7) { |
| 3647 | str += "{"; |
| 3648 | } |
| 3649 | for (i = 0; i < length; i += 2) { |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 3650 | str += curve[i].toFixed(decimal_places) + "," + curve[i + 1].toFixed(decimal_places); |
| 3651 | if (i < curve.length - 2) { |
| 3652 | str += "}, {"; |
| 3653 | } |
| 3654 | } |
caryclark | 1049f12 | 2015-04-20 08:31:59 -0700 | [diff] [blame] | 3655 | str += "}"; |
| 3656 | if (curve.length == 7) { |
| 3657 | str += "}, " + curve[6].toFixed(decimal_places); |
| 3658 | } |
| 3659 | str += "}"; |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 3660 | return str; |
| 3661 | } |
| 3662 | |
| 3663 | function dumpCurve(curve) { |
| 3664 | console.log(curveToString(curve)); |
| 3665 | } |
| 3666 | |
| 3667 | function draw(test, lines, title) { |
| 3668 | ctx.fillStyle = "rgba(0,0,0, 0.1)"; |
| 3669 | ctx.font = "normal 50px Arial"; |
| 3670 | ctx.textAlign = "left"; |
| 3671 | ctx.fillText(title, 50, 50); |
| 3672 | ctx.font = "normal 10px Arial"; |
| 3673 | ctx.lineWidth = "1.001"; "0.999"; |
| 3674 | var secondPath = test.length; |
| 3675 | var closeCount = 0; |
| 3676 | logStart = -1; |
| 3677 | logRange = 0; |
| 3678 | // find last active rec type at this step |
| 3679 | var curType = test[0]; |
| 3680 | var curStep = 0; |
| 3681 | var hasOp = false; |
| 3682 | var lastActive = 0; |
| 3683 | var lastAdd = 0; |
caryclark | 624637c | 2015-05-11 07:21:27 -0700 | [diff] [blame] | 3684 | var lastCoin = 0; |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 3685 | var lastSect = 0; |
| 3686 | var lastSort = 0; |
| 3687 | var lastMark = 0; |
caryclark | 03b03ca | 2015-04-23 09:13:37 -0700 | [diff] [blame] | 3688 | var lastTop = 0; |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 3689 | activeCount = 0; |
| 3690 | addCount = 0; |
| 3691 | angleCount = 0; |
| 3692 | opCount = 0; |
| 3693 | sectCount = 0; |
| 3694 | sortCount = 0; |
caryclark | 03b03ca | 2015-04-23 09:13:37 -0700 | [diff] [blame] | 3695 | topCount = 0; |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 3696 | markCount = 0; |
| 3697 | activeMax = 0; |
| 3698 | addMax = 0; |
| 3699 | angleMax = 0; |
caryclark | 624637c | 2015-05-11 07:21:27 -0700 | [diff] [blame] | 3700 | coinMax = 0; |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 3701 | opMax = 0; |
| 3702 | sectMax = 0; |
| 3703 | sectMax2 = 0; |
| 3704 | sortMax = 0; |
caryclark | 03b03ca | 2015-04-23 09:13:37 -0700 | [diff] [blame] | 3705 | topMax = 0; |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 3706 | markMax = 0; |
| 3707 | lastIndex = test.length - 3; |
| 3708 | for (var tIndex = 0; tIndex < test.length; tIndex += 3) { |
| 3709 | var recType = test[tIndex]; |
| 3710 | if (!typeof recType == 'number' || recType < REC_TYPE_UNKNOWN || recType > REC_TYPE_LAST) { |
| 3711 | console.log("unknown rec type: " + recType); |
| 3712 | throw "stop execution"; |
| 3713 | } |
| 3714 | // if (curType == recType && curType != REC_TYPE_ADD) { |
| 3715 | // continue; |
| 3716 | // } |
| 3717 | var inStepRange = step_limit == 0 || curStep < step_limit; |
| 3718 | curType = recType; |
| 3719 | if (recType == REC_TYPE_OP) { |
| 3720 | hasOp = true; |
| 3721 | continue; |
| 3722 | } |
| 3723 | if (recType == REC_TYPE_UNKNOWN) { |
| 3724 | // these types do not advance step |
| 3725 | continue; |
| 3726 | } |
| 3727 | var bumpStep = false; |
| 3728 | var records = test[tIndex + 2]; |
| 3729 | var fragType = records[0]; |
| 3730 | if (recType == REC_TYPE_ADD) { |
| 3731 | if (records.length != 2) { |
| 3732 | console.log("expect only two elements: " + records.length); |
| 3733 | throw "stop execution"; |
| 3734 | } |
| 3735 | if (fragType == ADD_MOVETO || fragType == ADD_CLOSE) { |
| 3736 | continue; |
| 3737 | } |
| 3738 | ++addMax; |
| 3739 | if (!draw_add || !inStepRange) { |
| 3740 | continue; |
| 3741 | } |
| 3742 | lastAdd = tIndex; |
| 3743 | ++addCount; |
| 3744 | bumpStep = true; |
| 3745 | } |
| 3746 | if (recType == REC_TYPE_PATH && hasOp) { |
| 3747 | secondPath = tIndex; |
| 3748 | } |
caryclark | 5435929 | 2015-03-26 07:52:43 -0700 | [diff] [blame] | 3749 | if (recType == REC_TYPE_PATH2 && hasOp) { |
| 3750 | secondPath = tIndex; |
| 3751 | } |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 3752 | if (recType == REC_TYPE_ACTIVE) { |
| 3753 | ++activeMax; |
| 3754 | if (!draw_active || !inStepRange) { |
| 3755 | continue; |
| 3756 | } |
| 3757 | lastActive = tIndex; |
| 3758 | ++activeCount; |
| 3759 | bumpStep = true; |
| 3760 | } |
| 3761 | if (recType == REC_TYPE_ACTIVE_OP) { |
| 3762 | ++opMax; |
| 3763 | if (!draw_op || !inStepRange) { |
| 3764 | continue; |
| 3765 | } |
| 3766 | lastOp = tIndex; |
| 3767 | ++opCount; |
| 3768 | bumpStep = true; |
| 3769 | } |
caryclark | 5435929 | 2015-03-26 07:52:43 -0700 | [diff] [blame] | 3770 | if (recType == REC_TYPE_AFTERPART) { |
| 3771 | if (draw_angle != 3 || !inStepRange) { |
| 3772 | continue; |
| 3773 | } |
| 3774 | lastAngle = tIndex; |
| 3775 | ++angleCount; |
| 3776 | bumpStep = true; |
| 3777 | } |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 3778 | if (recType == REC_TYPE_ANGLE) { |
| 3779 | ++angleMax; |
caryclark | 5435929 | 2015-03-26 07:52:43 -0700 | [diff] [blame] | 3780 | if (draw_angle == 0 || draw_angle == 3 || !inStepRange) { |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 3781 | continue; |
| 3782 | } |
| 3783 | lastAngle = tIndex; |
| 3784 | ++angleCount; |
| 3785 | bumpStep = true; |
| 3786 | } |
caryclark | 624637c | 2015-05-11 07:21:27 -0700 | [diff] [blame] | 3787 | if (recType == REC_TYPE_COINCIDENCE) { |
| 3788 | ++coinMax; |
| 3789 | if (!draw_coincidence || !inStepRange) { |
| 3790 | continue; |
| 3791 | } |
| 3792 | lastCoin = tIndex; |
| 3793 | ++coinCount; |
| 3794 | bumpStep = true; |
| 3795 | } |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 3796 | if (recType == REC_TYPE_SECT) { |
| 3797 | if (records.length != 2) { |
| 3798 | console.log("expect only two elements: " + records.length); |
| 3799 | throw "stop execution"; |
| 3800 | } |
| 3801 | ++sectMax; |
| 3802 | var sectBump = 1; |
| 3803 | switch (fragType) { |
| 3804 | case INTERSECT_LINE: |
| 3805 | case INTERSECT_QUAD_LINE: |
| 3806 | case INTERSECT_QUAD: |
caryclark | 1049f12 | 2015-04-20 08:31:59 -0700 | [diff] [blame] | 3807 | case INTERSECT_CONIC_LINE: |
caryclark | 55888e4 | 2016-07-18 10:01:36 -0700 | [diff] [blame] | 3808 | case INTERSECT_CONIC_QUAD: |
caryclark | 1049f12 | 2015-04-20 08:31:59 -0700 | [diff] [blame] | 3809 | case INTERSECT_CONIC: |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 3810 | case INTERSECT_SELF_CUBIC: |
| 3811 | case INTERSECT_CUBIC_LINE: |
| 3812 | case INTERSECT_CUBIC_QUAD: |
| 3813 | case INTERSECT_CUBIC: |
| 3814 | sectBump = 1; |
| 3815 | break; |
| 3816 | case INTERSECT_LINE_2: |
| 3817 | case INTERSECT_QUAD_LINE_2: |
| 3818 | case INTERSECT_QUAD_2: |
caryclark | 1049f12 | 2015-04-20 08:31:59 -0700 | [diff] [blame] | 3819 | case INTERSECT_CONIC_LINE_2: |
caryclark | 55888e4 | 2016-07-18 10:01:36 -0700 | [diff] [blame] | 3820 | case INTERSECT_CONIC_QUAD_2: |
caryclark | 1049f12 | 2015-04-20 08:31:59 -0700 | [diff] [blame] | 3821 | case INTERSECT_CONIC_2: |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 3822 | case INTERSECT_CUBIC_LINE_2: |
| 3823 | case INTERSECT_CUBIC_QUAD_2: |
| 3824 | case INTERSECT_CUBIC_2: |
| 3825 | sectBump = 2; |
| 3826 | break; |
| 3827 | case INTERSECT_LINE_NO: |
| 3828 | case INTERSECT_QUAD_LINE_NO: |
| 3829 | case INTERSECT_QUAD_NO: |
caryclark | 1049f12 | 2015-04-20 08:31:59 -0700 | [diff] [blame] | 3830 | case INTERSECT_CONIC_LINE_NO: |
caryclark | 55888e4 | 2016-07-18 10:01:36 -0700 | [diff] [blame] | 3831 | case INTERSECT_CONIC_QUAD_NO: |
caryclark | 1049f12 | 2015-04-20 08:31:59 -0700 | [diff] [blame] | 3832 | case INTERSECT_CONIC_NO: |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 3833 | case INTERSECT_SELF_CUBIC_NO: |
| 3834 | case INTERSECT_CUBIC_LINE_NO: |
| 3835 | case INTERSECT_CUBIC_QUAD_NO: |
| 3836 | case INTERSECT_CUBIC_NO: |
| 3837 | sectBump = 0; |
| 3838 | break; |
caryclark | 6c3b9cd | 2016-09-26 05:36:58 -0700 | [diff] [blame^] | 3839 | case INTERSECT_CONIC_QUAD_3: |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 3840 | case INTERSECT_CUBIC_LINE_3: |
| 3841 | case INTERSECT_CUBIC_QUAD_3: |
| 3842 | case INTERSECT_CUBIC_3: |
| 3843 | sectBump = 3; |
| 3844 | break; |
caryclark | 6c3b9cd | 2016-09-26 05:36:58 -0700 | [diff] [blame^] | 3845 | case INTERSECT_CONIC_QUAD_4: |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 3846 | case INTERSECT_CUBIC_QUAD_4: |
| 3847 | case INTERSECT_CUBIC_4: |
| 3848 | sectBump = 4; |
| 3849 | break; |
| 3850 | default: |
| 3851 | console.log("missing case " + records.length); |
| 3852 | throw "stop execution"; |
| 3853 | } |
| 3854 | sectMax2 += sectBump; |
| 3855 | if (draw_intersection <= 1 || !inStepRange) { |
| 3856 | continue; |
| 3857 | } |
| 3858 | lastSect = tIndex; |
| 3859 | sectCount += sectBump; |
| 3860 | bumpStep = true; |
| 3861 | } |
| 3862 | if (recType == REC_TYPE_SORT) { |
| 3863 | ++sortMax; |
| 3864 | if (!draw_sort || !inStepRange) { |
| 3865 | continue; |
| 3866 | } |
| 3867 | lastSort = tIndex; |
| 3868 | ++sortCount; |
| 3869 | bumpStep = true; |
| 3870 | } |
caryclark | 03b03ca | 2015-04-23 09:13:37 -0700 | [diff] [blame] | 3871 | if (recType == REC_TYPE_TOP) { |
| 3872 | ++topMax; |
| 3873 | if (!draw_top || !inStepRange) { |
| 3874 | continue; |
| 3875 | } |
| 3876 | lastTop = tIndex; |
| 3877 | ++topCount; |
| 3878 | bumpStep = true; |
| 3879 | } |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 3880 | if (recType == REC_TYPE_MARK) { |
| 3881 | ++markMax; |
| 3882 | if (!draw_mark || !inStepRange) { |
| 3883 | continue; |
| 3884 | } |
| 3885 | lastMark = tIndex; |
| 3886 | ++markCount; |
| 3887 | bumpStep = true; |
| 3888 | } |
| 3889 | if (bumpStep) { |
| 3890 | lastIndex = tIndex; |
| 3891 | logStart = test[tIndex + 1]; |
| 3892 | logRange = records.length / 2; |
| 3893 | ++curStep; |
| 3894 | } |
| 3895 | } |
| 3896 | stepMax = (draw_add ? addMax : 0) |
| 3897 | + (draw_active ? activeMax : 0) |
reed | 0dc4dd6 | 2015-03-24 13:55:33 -0700 | [diff] [blame] | 3898 | + (draw_angle ? angleMax : 0) |
caryclark | 624637c | 2015-05-11 07:21:27 -0700 | [diff] [blame] | 3899 | + (draw_coincidence ? coinMax : 0) |
caryclark | 5435929 | 2015-03-26 07:52:43 -0700 | [diff] [blame] | 3900 | + (draw_op ? opMax : 0) |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 3901 | + (draw_sort ? sortMax : 0) |
caryclark | 03b03ca | 2015-04-23 09:13:37 -0700 | [diff] [blame] | 3902 | + (draw_top ? topMax : 0) |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 3903 | + (draw_mark ? markMax : 0) |
| 3904 | + (draw_intersection == 2 ? sectMax : draw_intersection == 3 ? sectMax2 : 0); |
| 3905 | if (stepMax == 0) { |
caryclark | 624637c | 2015-05-11 07:21:27 -0700 | [diff] [blame] | 3906 | stepMax = addMax + activeMax + angleMax + coinMax + opMax + sortMax + topMax + markMax; |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 3907 | } |
| 3908 | drawnPts = []; |
| 3909 | drawnLines = []; |
| 3910 | drawnQuads = []; |
caryclark | 1049f12 | 2015-04-20 08:31:59 -0700 | [diff] [blame] | 3911 | drawnConics = []; |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 3912 | drawnCubics = []; |
| 3913 | focusXmin = focusYmin = Infinity; |
| 3914 | focusXmax = focusYmax = -Infinity; |
| 3915 | var pathIndex = 0; |
| 3916 | var opLetter = 'S'; |
| 3917 | for (var tIndex = lastIndex; tIndex >= 0; tIndex -= 3) { |
| 3918 | var recType = test[tIndex]; |
| 3919 | var records = test[tIndex + 2]; |
| 3920 | for (var recordIndex = 0; recordIndex < records.length; recordIndex += 2) { |
| 3921 | var fragType = records[recordIndex]; |
| 3922 | if (!typeof fragType == 'number' || fragType < 1 || fragType > FRAG_TYPE_LAST) { |
| 3923 | console.log("unknown in range frag type: " + fragType); |
| 3924 | throw "stop execution"; |
| 3925 | } |
| 3926 | var frags = records[recordIndex + 1]; |
| 3927 | focus_enabled = false; |
| 3928 | switch (recType) { |
| 3929 | case REC_TYPE_COMPUTED: |
| 3930 | if (draw_computed == 0) { |
| 3931 | continue; |
| 3932 | } |
| 3933 | ctx.lineWidth = 1; |
| 3934 | ctx.strokeStyle = pathIndex == 0 ? "black" : "red"; |
| 3935 | ctx.fillStyle = "blue"; |
| 3936 | var drawThis = false; |
| 3937 | switch (fragType) { |
| 3938 | case PATH_QUAD: |
caryclark | 1049f12 | 2015-04-20 08:31:59 -0700 | [diff] [blame] | 3939 | if ((draw_computed & 0x9) == 1 || ((draw_computed & 8) != 0 |
| 3940 | && (draw_computed & 7) == pathIndex)) { |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 3941 | drawQuad(frags[0], frags[1], frags[2], frags[3], |
| 3942 | frags[4], frags[5]); |
| 3943 | drawThis = true; |
| 3944 | } |
| 3945 | break; |
caryclark | 1049f12 | 2015-04-20 08:31:59 -0700 | [diff] [blame] | 3946 | case PATH_CONIC: |
| 3947 | if ((draw_computed & 0xA) == 2 || ((draw_computed & 8) != 0 |
| 3948 | && (draw_computed & 7) == pathIndex)) { |
| 3949 | drawConicWithQuads(frags[0], frags[1], frags[2], frags[3], |
| 3950 | frags[4], frags[5], frags[6]); |
| 3951 | drawThis = true; |
| 3952 | } |
| 3953 | break; |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 3954 | case PATH_CUBIC: |
caryclark | 1049f12 | 2015-04-20 08:31:59 -0700 | [diff] [blame] | 3955 | if ((draw_computed & 0xC) == 4 || ((draw_computed & 8) != 0 |
| 3956 | && (draw_computed & 7) == pathIndex)) { |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 3957 | drawCubic(frags[0], frags[1], frags[2], frags[3], |
| 3958 | frags[4], frags[5], frags[6], frags[7]); |
| 3959 | drawThis = true; |
| 3960 | } |
| 3961 | ++pathIndex; |
| 3962 | break; |
| 3963 | case COMPUTED_SET_1: |
| 3964 | pathIndex = 0; |
| 3965 | break; |
| 3966 | case COMPUTED_SET_2: |
| 3967 | pathIndex = 1; |
| 3968 | break; |
| 3969 | default: |
| 3970 | console.log("unknown REC_TYPE_COMPUTED frag type: " + fragType); |
| 3971 | throw "stop execution"; |
| 3972 | } |
| 3973 | if (!drawThis || collect_bounds) { |
| 3974 | break; |
| 3975 | } |
| 3976 | drawCurveSpecials(test, frags, fragType); |
| 3977 | break; |
caryclark | 26ad22a | 2015-10-16 09:03:38 -0700 | [diff] [blame] | 3978 | case REC_TYPE_ALIGNED: |
| 3979 | if (draw_path < 4) { |
| 3980 | continue; |
| 3981 | } |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 3982 | case REC_TYPE_PATH: |
caryclark | 5435929 | 2015-03-26 07:52:43 -0700 | [diff] [blame] | 3983 | case REC_TYPE_PATH2: |
caryclark | 26ad22a | 2015-10-16 09:03:38 -0700 | [diff] [blame] | 3984 | if (REC_TYPE_ALIGNED != recType && draw_path >= 4) { |
| 3985 | continue; |
| 3986 | } |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 3987 | if (!draw_path) { |
| 3988 | continue; |
| 3989 | } |
| 3990 | var firstPath = tIndex < secondPath; |
| 3991 | if ((draw_path & (firstPath ? 1 : 2)) == 0) { |
| 3992 | continue; |
| 3993 | } |
| 3994 | ctx.lineWidth = 1; |
| 3995 | ctx.strokeStyle = firstPath ? "black" : "red"; |
| 3996 | ctx.fillStyle = "blue"; |
caryclark | 55888e4 | 2016-07-18 10:01:36 -0700 | [diff] [blame] | 3997 | var frags2 = []; |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 3998 | switch (fragType) { |
| 3999 | case PATH_LINE: |
caryclark | 5435929 | 2015-03-26 07:52:43 -0700 | [diff] [blame] | 4000 | for (var i = 0; i < 4; ++ i) { frags2[i] = frags[i + 1]; } |
| 4001 | drawLine(frags2[0], frags2[1], frags2[2], frags2[3]); |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 4002 | break; |
| 4003 | case PATH_QUAD: |
caryclark | 5435929 | 2015-03-26 07:52:43 -0700 | [diff] [blame] | 4004 | for (var i = 0; i < 6; ++ i) { frags2[i] = frags[i + 1]; } |
| 4005 | drawQuad(frags2[0], frags2[1], frags2[2], frags2[3], |
| 4006 | frags2[4], frags2[5]); |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 4007 | break; |
caryclark | 1049f12 | 2015-04-20 08:31:59 -0700 | [diff] [blame] | 4008 | case PATH_CONIC: |
| 4009 | for (var i = 0; i < 7; ++ i) { frags2[i] = frags[i + 1]; } |
| 4010 | drawConicWithQuads(frags2[0], frags2[1], frags2[2], frags2[3], |
| 4011 | frags2[4], frags2[5], frags2[6]); |
| 4012 | break; |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 4013 | case PATH_CUBIC: |
caryclark | 5435929 | 2015-03-26 07:52:43 -0700 | [diff] [blame] | 4014 | for (var i = 0; i < 8; ++ i) { frags2[i] = frags[i + 1]; } |
| 4015 | drawCubic(frags2[0], frags2[1], frags2[2], frags2[3], |
| 4016 | frags2[4], frags2[5], frags2[6], frags2[7]); |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 4017 | break; |
| 4018 | default: |
caryclark | 26ad22a | 2015-10-16 09:03:38 -0700 | [diff] [blame] | 4019 | console.log("unknown " + recType + " frag type: " + fragType); |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 4020 | throw "stop execution"; |
| 4021 | } |
| 4022 | if (collect_bounds) { |
| 4023 | break; |
| 4024 | } |
caryclark | 5435929 | 2015-03-26 07:52:43 -0700 | [diff] [blame] | 4025 | drawCurveSpecials(test, frags2, fragType); |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 4026 | break; |
| 4027 | case REC_TYPE_OP: |
| 4028 | switch (fragType) { |
| 4029 | case OP_INTERSECT: opLetter = 'I'; break; |
| 4030 | case OP_DIFFERENCE: opLetter = 'D'; break; |
| 4031 | case OP_UNION: opLetter = 'U'; break; |
| 4032 | case OP_XOR: opLetter = 'X'; break; |
| 4033 | default: |
| 4034 | console.log("unknown REC_TYPE_OP frag type: " + fragType); |
| 4035 | throw "stop execution"; |
| 4036 | } |
| 4037 | break; |
| 4038 | case REC_TYPE_ACTIVE: |
| 4039 | if (!draw_active || (step_limit > 0 && tIndex < lastActive)) { |
| 4040 | continue; |
| 4041 | } |
| 4042 | var x1 = frags[SPAN_X1]; |
| 4043 | var y1 = frags[SPAN_Y1]; |
| 4044 | var x2 = frags[SPAN_X2]; |
| 4045 | var y2 = frags[SPAN_Y2]; |
caryclark | 55888e4 | 2016-07-18 10:01:36 -0700 | [diff] [blame] | 4046 | var x3, y3, x3, y4, w; |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 4047 | ctx.lineWidth = 3; |
| 4048 | ctx.strokeStyle = "rgba(0,0,255, 0.3)"; |
| 4049 | focus_enabled = true; |
| 4050 | switch (fragType) { |
| 4051 | case ACTIVE_LINE_SPAN: |
caryclark | 55888e4 | 2016-07-18 10:01:36 -0700 | [diff] [blame] | 4052 | drawLine(x1, y1, x2, y2); |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 4053 | if (draw_id) { |
caryclark | 55888e4 | 2016-07-18 10:01:36 -0700 | [diff] [blame] | 4054 | drawLineID(frags[0], x1, y1, x2, y2); |
| 4055 | } |
| 4056 | if (pt_labels) { |
| 4057 | var curve = [x1, y1, x2, y2]; |
| 4058 | ctx.fillStyle = "blue"; |
| 4059 | drawPoints(curve, PATH_LINE, pt_labels == 2); |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 4060 | } |
| 4061 | break; |
| 4062 | case ACTIVE_QUAD_SPAN: |
| 4063 | x3 = frags[SPAN_X3]; |
| 4064 | y3 = frags[SPAN_Y3]; |
caryclark | 55888e4 | 2016-07-18 10:01:36 -0700 | [diff] [blame] | 4065 | drawQuad(x1, y1, x2, y2, x3, y3); |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 4066 | if (draw_id) { |
caryclark | 55888e4 | 2016-07-18 10:01:36 -0700 | [diff] [blame] | 4067 | drawQuadID(frags[0], x1, y1, x2, y2, x3, y3); |
| 4068 | } |
| 4069 | if (pt_labels) { |
| 4070 | var curve = [x1, y1, x2, y2, x3, y3]; |
| 4071 | ctx.fillStyle = "blue"; |
| 4072 | drawPoints(curve, PATH_QUAD, pt_labels == 2); |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 4073 | } |
| 4074 | break; |
caryclark | 1049f12 | 2015-04-20 08:31:59 -0700 | [diff] [blame] | 4075 | case ACTIVE_CONIC_SPAN: |
| 4076 | x3 = frags[SPAN_X3]; |
| 4077 | y3 = frags[SPAN_Y3]; |
caryclark | 1049f12 | 2015-04-20 08:31:59 -0700 | [diff] [blame] | 4078 | w = frags[SPAN_K_W]; |
caryclark | 55888e4 | 2016-07-18 10:01:36 -0700 | [diff] [blame] | 4079 | drawConicWithQuads(x1, y1, x2, y2, x3, y3, w); |
caryclark | 1049f12 | 2015-04-20 08:31:59 -0700 | [diff] [blame] | 4080 | if (draw_id) { |
caryclark | 55888e4 | 2016-07-18 10:01:36 -0700 | [diff] [blame] | 4081 | drawConicID(frags[0], x1, y1, x2, y2, x3, y3, w); |
| 4082 | } |
| 4083 | if (pt_labels) { |
| 4084 | var curve = [x1, y1, x2, y2, x3, y3, w]; |
| 4085 | ctx.fillStyle = "blue"; |
| 4086 | drawPoints(curve, PATH_CONIC, pt_labels == 2); |
caryclark | 1049f12 | 2015-04-20 08:31:59 -0700 | [diff] [blame] | 4087 | } |
| 4088 | break; |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 4089 | case ACTIVE_CUBIC_SPAN: |
| 4090 | x3 = frags[SPAN_X3]; |
| 4091 | y3 = frags[SPAN_Y3]; |
| 4092 | x4 = frags[SPAN_X4]; |
| 4093 | y4 = frags[SPAN_Y4]; |
caryclark | 55888e4 | 2016-07-18 10:01:36 -0700 | [diff] [blame] | 4094 | drawCubic(x1, y1, x2, y2, x3, y3, x4, y4); |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 4095 | if (draw_id) { |
caryclark | 55888e4 | 2016-07-18 10:01:36 -0700 | [diff] [blame] | 4096 | drawCubicID(frags[0], x1, y1, x2, y2, x3, y3, x4, y4); |
| 4097 | } |
| 4098 | if (pt_labels) { |
| 4099 | var curve = [x1, y1, x2, y2, x3, y3, x4, y4]; |
| 4100 | ctx.fillStyle = "blue"; |
| 4101 | drawPoints(curve, PATH_CUBIC, pt_labels == 2); |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 4102 | } |
| 4103 | break; |
| 4104 | default: |
| 4105 | console.log("unknown REC_TYPE_ACTIVE frag type: " + fragType); |
| 4106 | throw "stop execution"; |
| 4107 | } |
| 4108 | break; |
| 4109 | case REC_TYPE_ACTIVE_OP: |
| 4110 | if (!draw_op || (step_limit > 0 && tIndex < lastOp)) { |
| 4111 | continue; |
| 4112 | } |
| 4113 | focus_enabled = true; |
| 4114 | ctx.lineWidth = 3; |
| 4115 | var activeSpan = frags[7] == "1"; |
| 4116 | ctx.strokeStyle = activeSpan ? "rgba(45,160,0, 0.3)" : "rgba(255,45,0, 0.5)"; |
| 4117 | var curve = curvePartialByID(test, frags[0], frags[1], frags[2]); |
| 4118 | drawCurve(curve); |
| 4119 | if (draw_op > 1) { |
| 4120 | drawArc(curve, false, frags[3], frags[4]); |
| 4121 | drawArc(curve, true, frags[5], frags[6]); |
| 4122 | } |
| 4123 | break; |
| 4124 | case REC_TYPE_ADD: |
| 4125 | if (!draw_add) { |
| 4126 | continue; |
| 4127 | } |
| 4128 | ctx.lineWidth = 3; |
| 4129 | ctx.strokeStyle = closeCount == 0 ? "rgba(0,0,255, 0.3)" |
| 4130 | : closeCount == 1 ? "rgba(0,127,0, 0.3)" |
| 4131 | : closeCount == 2 ? "rgba(0,127,127, 0.3)" |
| 4132 | : closeCount == 3 ? "rgba(127,127,0, 0.3)" |
| 4133 | : "rgba(127,0,127, 0.3)"; |
| 4134 | focus_enabled = true; |
| 4135 | switch (fragType) { |
| 4136 | case ADD_MOVETO: |
| 4137 | break; |
| 4138 | case ADD_LINETO: |
| 4139 | if (step_limit == 0 || tIndex >= lastAdd) { |
| 4140 | drawLine(frags[0], frags[1], frags[2], frags[3]); |
| 4141 | } |
| 4142 | break; |
| 4143 | case ADD_QUADTO: |
| 4144 | if (step_limit == 0 || tIndex >= lastAdd) { |
| 4145 | drawQuad(frags[0], frags[1], frags[2], frags[3], frags[4], frags[5]); |
| 4146 | } |
| 4147 | break; |
caryclark | 1049f12 | 2015-04-20 08:31:59 -0700 | [diff] [blame] | 4148 | case ADD_CONICTO: |
| 4149 | if (step_limit == 0 || tIndex >= lastAdd) { |
| 4150 | drawConicWithQuads(frags[0], frags[1], frags[2], frags[3], |
| 4151 | frags[4], frags[5], frags[6]); |
| 4152 | } |
| 4153 | break; |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 4154 | case ADD_CUBICTO: |
| 4155 | if (step_limit == 0 || tIndex >= lastAdd) { |
| 4156 | drawCubic(frags[0], frags[1], frags[2], frags[3], |
| 4157 | frags[4], frags[5], frags[6], frags[7]); |
| 4158 | } |
| 4159 | break; |
| 4160 | case ADD_CLOSE: |
| 4161 | ++closeCount; |
| 4162 | break; |
| 4163 | case ADD_FILL: |
| 4164 | break; |
| 4165 | default: |
| 4166 | console.log("unknown REC_TYPE_ADD frag type: " + fragType); |
| 4167 | throw "stop execution"; |
| 4168 | } |
| 4169 | break; |
| 4170 | case REC_TYPE_ANGLE: |
caryclark | 5435929 | 2015-03-26 07:52:43 -0700 | [diff] [blame] | 4171 | angleBetween = frags[18] == "T"; |
| 4172 | afterIndex = 0; |
| 4173 | if (draw_angle == 0 || draw_angle == 3 || (step_limit > 0 && tIndex < lastAngle)) { |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 4174 | continue; |
| 4175 | } |
| 4176 | focus_enabled = true; |
| 4177 | ctx.lineWidth = 3; |
| 4178 | ctx.strokeStyle = "rgba(127,45,127, 0.3)"; |
caryclark | 5435929 | 2015-03-26 07:52:43 -0700 | [diff] [blame] | 4179 | var leftCurve = curvePartialByID(test, frags[0], frags[4], frags[5]); |
| 4180 | var midCurve = curvePartialByID(test, frags[6], frags[10], frags[11]); |
| 4181 | var rightCurve = curvePartialByID(test, frags[12], frags[16], frags[17]); |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 4182 | drawCurve(leftCurve); |
| 4183 | drawCurve(rightCurve); |
caryclark | 5435929 | 2015-03-26 07:52:43 -0700 | [diff] [blame] | 4184 | 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] | 4185 | drawCurve(midCurve); |
| 4186 | if (draw_angle > 1) { |
| 4187 | drawOrder(leftCurve, 'L'); |
| 4188 | drawOrder(rightCurve, 'R'); |
| 4189 | } |
| 4190 | break; |
caryclark | 5435929 | 2015-03-26 07:52:43 -0700 | [diff] [blame] | 4191 | case REC_TYPE_AFTERPART: |
| 4192 | if (draw_angle != 3 || (step_limit > 0 && tIndex < lastAngle)) { |
| 4193 | continue; |
| 4194 | } |
| 4195 | ctx.strokeStyle = afterIndex == 0 ? "rgba(255,0,0, 1.0)" |
| 4196 | : (afterIndex == 1) == angleBetween ? "rgba(0,128,0, 1.0)" |
| 4197 | : "rgba(0,0,255, 1.0)"; |
| 4198 | switch (fragType) { |
| 4199 | case PATH_LINE: |
| 4200 | drawLine(frags[0], frags[1], frags[2], frags[3]); |
| 4201 | break; |
| 4202 | case PATH_QUAD: |
| 4203 | drawQuad(frags[0], frags[1], frags[2], frags[3], |
| 4204 | frags[4], frags[5]); |
| 4205 | break; |
caryclark | 1049f12 | 2015-04-20 08:31:59 -0700 | [diff] [blame] | 4206 | case PATH_CONIC: |
| 4207 | drawConicWithQuads(frags[0], frags[1], frags[2], frags[3], |
| 4208 | frags[4], frags[5], frags[6]); |
| 4209 | break; |
caryclark | 5435929 | 2015-03-26 07:52:43 -0700 | [diff] [blame] | 4210 | case PATH_CUBIC: |
| 4211 | drawCubic(frags[0], frags[1], frags[2], frags[3], |
caryclark | 1049f12 | 2015-04-20 08:31:59 -0700 | [diff] [blame] | 4212 | frags[4], frags[5], frags[6], frags[7]); |
caryclark | 5435929 | 2015-03-26 07:52:43 -0700 | [diff] [blame] | 4213 | break; |
| 4214 | default: |
| 4215 | console.log("unknown REC_TYPE_AFTERPART frag type: " + fragType); |
| 4216 | throw "stop execution"; |
| 4217 | } |
| 4218 | ++afterIndex; |
| 4219 | break; |
caryclark | 624637c | 2015-05-11 07:21:27 -0700 | [diff] [blame] | 4220 | case REC_TYPE_COINCIDENCE: |
| 4221 | if (!draw_coincidence || (step_limit > 0 && tIndex < lastCoin)) { |
| 4222 | continue; |
| 4223 | } |
| 4224 | focus_enabled = true; |
| 4225 | ctx.lineWidth = 3; |
| 4226 | ctx.strokeStyle = "rgba(127,45,63, 0.3)"; |
| 4227 | var curve = curvePartialByID(test, frags[0], frags[1], frags[2]); |
| 4228 | drawCurve(curve); |
| 4229 | break; |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 4230 | case REC_TYPE_SECT: |
| 4231 | if (!draw_intersection) { |
| 4232 | continue; |
| 4233 | } |
| 4234 | if (draw_intersection != 1 && (step_limit > 0 && tIndex < lastSect)) { |
| 4235 | continue; |
| 4236 | } |
| 4237 | // draw_intersection == 1 : show all |
| 4238 | // draw_intersection == 2 : step == 0 ? show all : show intersection line #step |
| 4239 | // draw_intersection == 3 : step == 0 ? show all : show intersection #step |
| 4240 | ctx.lineWidth = 1; |
| 4241 | ctx.strokeStyle = "rgba(0,0,255, 0.3)"; |
| 4242 | ctx.fillStyle = "blue"; |
| 4243 | focus_enabled = true; |
| 4244 | var f = []; |
| 4245 | var c1s; |
| 4246 | var c1l; |
| 4247 | var c2s; |
| 4248 | var c2l; |
| 4249 | switch (fragType) { |
| 4250 | case INTERSECT_LINE: |
| 4251 | f.push(5, 6, 0, 7); |
| 4252 | c1s = 1; c1l = 4; c2s = 8; c2l = 4; |
| 4253 | break; |
| 4254 | case INTERSECT_LINE_2: |
| 4255 | f.push(5, 6, 0, 10); |
| 4256 | f.push(8, 9, 7, 15); |
| 4257 | c1s = 1; c1l = 4; c2s = 11; c2l = 4; |
| 4258 | break; |
| 4259 | case INTERSECT_LINE_NO: |
| 4260 | c1s = 0; c1l = 4; c2s = 4; c2l = 4; |
| 4261 | break; |
| 4262 | case INTERSECT_QUAD_LINE: |
| 4263 | f.push(7, 8, 0, 9); |
| 4264 | c1s = 1; c1l = 6; c2s = 10; c2l = 4; |
| 4265 | break; |
| 4266 | case INTERSECT_QUAD_LINE_2: |
| 4267 | f.push(7, 8, 0, 12); |
| 4268 | f.push(10, 11, 9, 17); |
| 4269 | c1s = 1; c1l = 6; c2s = 13; c2l = 4; |
| 4270 | break; |
| 4271 | case INTERSECT_QUAD_LINE_NO: |
| 4272 | c1s = 0; c1l = 6; c2s = 6; c2l = 4; |
| 4273 | break; |
| 4274 | case INTERSECT_QUAD: |
| 4275 | f.push(7, 8, 0, 9); |
| 4276 | c1s = 1; c1l = 6; c2s = 10; c2l = 6; |
| 4277 | break; |
| 4278 | case INTERSECT_QUAD_2: |
| 4279 | f.push(7, 8, 0, 12); |
| 4280 | f.push(10, 11, 9, 19); |
| 4281 | c1s = 1; c1l = 6; c2s = 13; c2l = 6; |
| 4282 | break; |
| 4283 | case INTERSECT_QUAD_NO: |
| 4284 | c1s = 0; c1l = 6; c2s = 6; c2l = 6; |
| 4285 | break; |
caryclark | 1049f12 | 2015-04-20 08:31:59 -0700 | [diff] [blame] | 4286 | case INTERSECT_CONIC_LINE: |
| 4287 | f.push(8, 9, 0, 10); |
| 4288 | c1s = 1; c1l = 7; c2s = 11; c2l = 4; |
| 4289 | break; |
| 4290 | case INTERSECT_CONIC_LINE_2: |
| 4291 | f.push(8, 9, 0, 12); |
| 4292 | f.push(11, 12, 10, 18); |
| 4293 | c1s = 1; c1l = 7; c2s = 14; c2l = 4; |
| 4294 | break; |
| 4295 | case INTERSECT_CONIC_LINE_NO: |
| 4296 | c1s = 0; c1l = 7; c2s = 7; c2l = 4; |
| 4297 | break; |
caryclark | 55888e4 | 2016-07-18 10:01:36 -0700 | [diff] [blame] | 4298 | case INTERSECT_CONIC_QUAD: |
| 4299 | f.push(8, 9, 0, 10); |
| 4300 | c1s = 1; c1l = 7; c2s = 11; c2l = 6; |
| 4301 | break; |
| 4302 | case INTERSECT_CONIC_QUAD_2: |
| 4303 | f.push(8, 9, 0, 12); |
| 4304 | f.push(11, 12, 10, 18); |
| 4305 | c1s = 1; c1l = 7; c2s = 14; c2l = 6; |
| 4306 | break; |
caryclark | 6c3b9cd | 2016-09-26 05:36:58 -0700 | [diff] [blame^] | 4307 | case INTERSECT_CONIC_QUAD_3: |
| 4308 | f.push(8, 9, 0, 15); |
| 4309 | f.push(11, 12, 10, 21); |
| 4310 | f.push(14, 15, 13, 22); |
| 4311 | c1s = 1; c1l = 7; c2s = 17; c2l = 6; |
| 4312 | break; |
| 4313 | case INTERSECT_CONIC_QUAD_4: |
| 4314 | f.push(8, 9, 0, 18); |
| 4315 | f.push(11, 12, 10, 24); |
| 4316 | f.push(14, 15, 13, 25); |
| 4317 | f.push(17, 18, 16, 26); |
| 4318 | c1s = 1; c1l = 7; c2s = 20; c2l = 6; |
| 4319 | break; |
caryclark | 55888e4 | 2016-07-18 10:01:36 -0700 | [diff] [blame] | 4320 | case INTERSECT_CONIC_QUAD_NO: |
| 4321 | c1s = 0; c1l = 7; c2s = 7; c2l = 6; |
| 4322 | break; |
caryclark | 1049f12 | 2015-04-20 08:31:59 -0700 | [diff] [blame] | 4323 | case INTERSECT_CONIC: |
| 4324 | f.push(8, 9, 0, 10); |
| 4325 | c1s = 1; c1l = 7; c2s = 11; c2l = 7; |
| 4326 | break; |
| 4327 | case INTERSECT_CONIC_2: |
| 4328 | f.push(8, 9, 0, 13); |
| 4329 | f.push(11, 12, 10, 21); |
| 4330 | c1s = 1; c1l = 7; c2s = 14; c2l = 7; |
| 4331 | break; |
| 4332 | case INTERSECT_CONIC_NO: |
| 4333 | c1s = 0; c1l = 7; c2s = 7; c2l = 7; |
| 4334 | break; |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 4335 | case INTERSECT_SELF_CUBIC: |
| 4336 | f.push(9, 10, 0, 11); |
| 4337 | c1s = 1; c1l = 8; c2s = 0; c2l = 0; |
| 4338 | break; |
| 4339 | case INTERSECT_SELF_CUBIC_NO: |
| 4340 | c1s = 0; c1l = 8; c2s = 0; c2l = 0; |
| 4341 | break; |
| 4342 | case INTERSECT_CUBIC_LINE: |
| 4343 | f.push(9, 10, 0, 11); |
| 4344 | c1s = 1; c1l = 8; c2s = 12; c2l = 4; |
| 4345 | break; |
| 4346 | case INTERSECT_CUBIC_LINE_2: |
| 4347 | f.push(9, 10, 0, 14); |
| 4348 | f.push(12, 13, 11, 19); |
| 4349 | c1s = 1; c1l = 8; c2s = 15; c2l = 4; |
| 4350 | break; |
| 4351 | case INTERSECT_CUBIC_LINE_3: |
| 4352 | f.push(9, 10, 0, 17); |
| 4353 | f.push(12, 13, 11, 22); |
| 4354 | f.push(15, 16, 14, 23); |
| 4355 | c1s = 1; c1l = 8; c2s = 18; c2l = 4; |
| 4356 | break; |
| 4357 | case INTERSECT_CUBIC_QUAD_NO: |
| 4358 | c1s = 0; c1l = 8; c2s = 8; c2l = 6; |
| 4359 | break; |
| 4360 | case INTERSECT_CUBIC_QUAD: |
| 4361 | f.push(9, 10, 0, 11); |
| 4362 | c1s = 1; c1l = 8; c2s = 12; c2l = 6; |
| 4363 | break; |
| 4364 | case INTERSECT_CUBIC_QUAD_2: |
| 4365 | f.push(9, 10, 0, 14); |
| 4366 | f.push(12, 13, 11, 21); |
| 4367 | c1s = 1; c1l = 8; c2s = 15; c2l = 6; |
| 4368 | break; |
| 4369 | case INTERSECT_CUBIC_QUAD_3: |
| 4370 | f.push(9, 10, 0, 17); |
| 4371 | f.push(12, 13, 11, 24); |
| 4372 | f.push(15, 16, 14, 25); |
| 4373 | c1s = 1; c1l = 8; c2s = 18; c2l = 6; |
| 4374 | break; |
| 4375 | case INTERSECT_CUBIC_QUAD_4: |
| 4376 | f.push(9, 10, 0, 20); |
| 4377 | f.push(12, 13, 11, 27); |
| 4378 | f.push(15, 16, 14, 28); |
| 4379 | f.push(18, 19, 17, 29); |
| 4380 | c1s = 1; c1l = 8; c2s = 21; c2l = 6; |
| 4381 | break; |
| 4382 | case INTERSECT_CUBIC_LINE_NO: |
| 4383 | c1s = 0; c1l = 8; c2s = 8; c2l = 4; |
| 4384 | break; |
| 4385 | case INTERSECT_CUBIC: |
| 4386 | f.push(9, 10, 0, 11); |
| 4387 | c1s = 1; c1l = 8; c2s = 12; c2l = 8; |
| 4388 | break; |
| 4389 | case INTERSECT_CUBIC_2: |
| 4390 | f.push(9, 10, 0, 14); |
| 4391 | f.push(12, 13, 11, 23); |
| 4392 | c1s = 1; c1l = 8; c2s = 15; c2l = 8; |
| 4393 | break; |
| 4394 | case INTERSECT_CUBIC_3: |
| 4395 | f.push(9, 10, 0, 17); |
| 4396 | f.push(12, 13, 11, 26); |
| 4397 | f.push(15, 16, 14, 27); |
| 4398 | c1s = 1; c1l = 8; c2s = 18; c2l = 8; |
| 4399 | break; |
| 4400 | case INTERSECT_CUBIC_4: |
| 4401 | f.push(9, 10, 0, 20); |
| 4402 | f.push(12, 13, 11, 29); |
| 4403 | f.push(15, 16, 14, 30); |
| 4404 | f.push(18, 19, 17, 31); |
| 4405 | c1s = 1; c1l = 8; c2s = 21; c2l = 8; |
| 4406 | break; |
| 4407 | case INTERSECT_CUBIC_NO: |
| 4408 | c1s = 0; c1l = 8; c2s = 8; c2l = 8; |
| 4409 | break; |
| 4410 | default: |
| 4411 | console.log("unknown REC_TYPE_SECT frag type: " + fragType); |
| 4412 | throw "stop execution"; |
| 4413 | } |
| 4414 | if (draw_intersection != 1) { |
| 4415 | var id = -1; |
| 4416 | var curve; |
| 4417 | switch (c1l) { |
caryclark | 55888e4 | 2016-07-18 10:01:36 -0700 | [diff] [blame] | 4418 | case 4: |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 4419 | drawLine(frags[c1s], frags[c1s + 1], frags[c1s + 2], frags[c1s + 3]); |
| 4420 | if (draw_id) { |
| 4421 | curve = [frags[c1s], frags[c1s + 1], frags[c1s + 2], frags[c1s + 3]]; |
| 4422 | id = idByCurve(test, curve, PATH_LINE); |
| 4423 | } |
| 4424 | break; |
| 4425 | case 6: |
| 4426 | drawQuad(frags[c1s], frags[c1s + 1], frags[c1s + 2], frags[c1s + 3], |
| 4427 | frags[c1s + 4], frags[c1s + 5]); |
| 4428 | if (draw_id) { |
| 4429 | curve = [frags[c1s], frags[c1s + 1], frags[c1s + 2], frags[c1s + 3], |
| 4430 | frags[c1s + 4], frags[c1s + 5]]; |
| 4431 | id = idByCurve(test, curve, PATH_QUAD); |
| 4432 | } |
| 4433 | break; |
caryclark | 1049f12 | 2015-04-20 08:31:59 -0700 | [diff] [blame] | 4434 | case 7: |
| 4435 | drawConicWithQuads(frags[c1s], frags[c1s + 1], frags[c1s + 2], frags[c1s + 3], |
| 4436 | frags[c1s + 4], frags[c1s + 5], frags[c1s + 6]); |
| 4437 | if (draw_id) { |
| 4438 | curve = [frags[c1s], frags[c1s + 1], frags[c1s + 2], frags[c1s + 3], |
| 4439 | frags[c1s + 4], frags[c1s + 5], frags[c1s + 6]]; |
| 4440 | id = idByCurve(test, curve, PATH_CONIC); |
| 4441 | } |
| 4442 | break; |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 4443 | case 8: |
| 4444 | drawCubic(frags[c1s], frags[c1s + 1], frags[c1s + 2], frags[c1s + 3], |
| 4445 | frags[c1s + 4], frags[c1s + 5], frags[c1s + 6], frags[c1s + 7]); |
| 4446 | if (draw_id) { |
| 4447 | curve = [frags[c1s], frags[c1s + 1], frags[c1s + 2], frags[c1s + 3], |
| 4448 | frags[c1s + 4], frags[c1s + 5], frags[c1s + 6], frags[c1s + 7]]; |
| 4449 | id = idByCurve(test, curve, PATH_CUBIC); |
| 4450 | } |
| 4451 | break; |
| 4452 | } |
| 4453 | if (id >= 0) { |
| 4454 | drawID(curve, id); |
| 4455 | } |
| 4456 | id = -1; |
| 4457 | switch (c2l) { |
| 4458 | case 0: |
| 4459 | break; |
caryclark | 55888e4 | 2016-07-18 10:01:36 -0700 | [diff] [blame] | 4460 | case 4: |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 4461 | drawLine(frags[c2s], frags[c2s + 1], frags[c2s + 2], frags[c2s + 3]); |
| 4462 | if (draw_id) { |
| 4463 | curve = [frags[c2s], frags[c2s + 1], frags[c2s + 2], frags[c2s + 3]]; |
| 4464 | id = idByCurve(test, curve, PATH_LINE); |
| 4465 | } |
| 4466 | break; |
| 4467 | case 6: |
| 4468 | drawQuad(frags[c2s], frags[c2s + 1], frags[c2s + 2], frags[c2s + 3], |
| 4469 | frags[c2s + 4], frags[c2s + 5]); |
| 4470 | if (draw_id) { |
| 4471 | curve = [frags[c2s], frags[c2s + 1], frags[c2s + 2], frags[c2s + 3], |
| 4472 | frags[c2s + 4], frags[c2s + 5]]; |
| 4473 | id = idByCurve(test, curve, PATH_QUAD); |
| 4474 | } |
| 4475 | break; |
caryclark | 1049f12 | 2015-04-20 08:31:59 -0700 | [diff] [blame] | 4476 | case 7: |
| 4477 | drawConicWithQuads(frags[c2s], frags[c2s + 1], frags[c2s + 2], frags[c2s + 3], |
| 4478 | frags[c2s + 4], frags[c2s + 5], frags[c2s + 6]); |
| 4479 | if (draw_id) { |
| 4480 | curve = [frags[c2s], frags[c2s + 1], frags[c2s + 2], frags[c2s + 3], |
| 4481 | frags[c2s + 4], frags[c2s + 5], frags[c2s + 6]]; |
| 4482 | id = idByCurve(test, curve, PATH_CONIC); |
| 4483 | } |
| 4484 | break; |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 4485 | case 8: |
| 4486 | drawCubic(frags[c2s], frags[c2s + 1], frags[c2s + 2], frags[c2s + 3], |
| 4487 | frags[c2s + 4], frags[c2s + 5], frags[c2s + 6], frags[c2s + 7]); |
| 4488 | if (draw_id) { |
| 4489 | curve = [frags[c2s], frags[c2s + 1], frags[c2s + 2], frags[c2s + 3], |
| 4490 | frags[c2s + 4], frags[c2s + 5], frags[c2s + 6], frags[c2s + 7]]; |
| 4491 | id = idByCurve(test, curve, PATH_CUBIC); |
| 4492 | } |
| 4493 | break; |
| 4494 | } |
| 4495 | if (id >= 0) { |
| 4496 | drawID(curve, id); |
| 4497 | } |
| 4498 | } |
| 4499 | if (collect_bounds) { |
| 4500 | break; |
| 4501 | } |
caryclark | 5435929 | 2015-03-26 07:52:43 -0700 | [diff] [blame] | 4502 | if (draw_intersection != 3 || step_limit == 0 || tIndex >= lastSect) { |
| 4503 | for (var idx = 0; idx < f.length; idx += 4) { |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 4504 | drawPoint(frags[f[idx]], frags[f[idx + 1]], true); |
| 4505 | } |
| 4506 | } |
| 4507 | if (!draw_intersectT) { |
| 4508 | break; |
| 4509 | } |
| 4510 | ctx.fillStyle = "red"; |
caryclark | 5435929 | 2015-03-26 07:52:43 -0700 | [diff] [blame] | 4511 | if (draw_intersection != 3 || step_limit == 0 || tIndex >= lastSect) { |
| 4512 | for (var idx = 0; idx < f.length; idx += 4) { |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 4513 | drawTAtPointUp(frags[f[idx]], frags[f[idx + 1]], frags[f[idx + 2]]); |
| 4514 | drawTAtPointDown(frags[f[idx]], frags[f[idx + 1]], frags[f[idx + 3]]); |
| 4515 | } |
| 4516 | } |
| 4517 | break; |
| 4518 | case REC_TYPE_SORT: |
| 4519 | if (!draw_sort || (step_limit > 0 && tIndex < lastSort)) { |
| 4520 | continue; |
| 4521 | } |
| 4522 | ctx.lineWidth = 3; |
| 4523 | ctx.strokeStyle = "rgba(127,127,0, 0.5)"; |
| 4524 | focus_enabled = true; |
| 4525 | switch (fragType) { |
| 4526 | case SORT_UNARY: |
| 4527 | case SORT_BINARY: |
| 4528 | var curve = curvePartialByID(test, frags[0], frags[6], frags[8]); |
| 4529 | drawCurve(curve); |
| 4530 | break; |
| 4531 | default: |
| 4532 | console.log("unknown REC_TYPE_SORT frag type: " + fragType); |
| 4533 | throw "stop execution"; |
| 4534 | } |
| 4535 | break; |
caryclark | 03b03ca | 2015-04-23 09:13:37 -0700 | [diff] [blame] | 4536 | case REC_TYPE_TOP: |
| 4537 | if (!draw_top || (step_limit > 0 && tIndex < lastTop)) { |
| 4538 | continue; |
| 4539 | } |
| 4540 | ctx.lineWidth = 3; |
| 4541 | ctx.strokeStyle = "rgba(127,127,0, 0.5)"; |
| 4542 | focus_enabled = true; |
| 4543 | { |
| 4544 | var curve = curvePartialByID(test, frags[0], frags[1], frags[2]); |
| 4545 | drawCurve(curve); |
| 4546 | var type = PATH_LINE + (curve.length / 2 - 2); |
| 4547 | var mid = pointAtT(curve, type, 0.5); |
| 4548 | var d = dxy_at_t(curve, type, 0.5); |
| 4549 | drawArrow(mid.x, mid.y, d.x, d.y, 0.3); |
| 4550 | } |
| 4551 | break; |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 4552 | case REC_TYPE_MARK: |
| 4553 | if (!draw_mark || (step_limit > 0 && tIndex < lastMark)) { |
| 4554 | continue; |
| 4555 | } |
| 4556 | ctx.lineWidth = 3; |
| 4557 | ctx.strokeStyle = fragType >= MARK_DONE_LINE ? |
| 4558 | "rgba(127,0,127, 0.5)" : "rgba(127,127,0, 0.5)"; |
| 4559 | focus_enabled = true; |
| 4560 | switch (fragType) { |
| 4561 | case MARK_LINE: |
| 4562 | case MARK_DONE_LINE: |
| 4563 | case MARK_UNSORTABLE_LINE: |
| 4564 | case MARK_SIMPLE_LINE: |
| 4565 | case MARK_SIMPLE_DONE_LINE: |
| 4566 | case MARK_DONE_UNARY_LINE: |
| 4567 | drawLinePartial(frags[1], frags[2], frags[3], frags[4], |
| 4568 | frags[5], frags[9]); |
| 4569 | if (draw_id) { |
| 4570 | drawLinePartialID(frags[0], frags[1], frags[2], frags[3], frags[4], |
| 4571 | frags[5], frags[9]); |
| 4572 | } |
| 4573 | break; |
| 4574 | case MARK_QUAD: |
| 4575 | case MARK_DONE_QUAD: |
| 4576 | case MARK_UNSORTABLE_QUAD: |
| 4577 | case MARK_SIMPLE_QUAD: |
| 4578 | case MARK_SIMPLE_DONE_QUAD: |
| 4579 | case MARK_DONE_UNARY_QUAD: |
| 4580 | drawQuadPartial(frags[1], frags[2], frags[3], frags[4], |
| 4581 | frags[5], frags[6], frags[7], frags[11]); |
| 4582 | if (draw_id) { |
| 4583 | drawQuadPartialID(frags[0], frags[1], frags[2], frags[3], frags[4], |
| 4584 | frags[5], frags[6], frags[7], frags[11]); |
| 4585 | } |
| 4586 | break; |
| 4587 | case MARK_CUBIC: |
| 4588 | case MARK_DONE_CUBIC: |
| 4589 | case MARK_UNSORTABLE_CUBIC: |
| 4590 | case MARK_SIMPLE_CUBIC: |
| 4591 | case MARK_SIMPLE_DONE_CUBIC: |
| 4592 | case MARK_DONE_UNARY_CUBIC: |
| 4593 | drawCubicPartial(frags[1], frags[2], frags[3], frags[4], |
| 4594 | frags[5], frags[6], frags[7], frags[8], frags[9], frags[13]); |
| 4595 | if (draw_id) { |
| 4596 | drawCubicPartialID(frags[0], frags[1], frags[2], frags[3], frags[4], |
| 4597 | frags[5], frags[6], frags[7], frags[8], frags[9], frags[13]); |
| 4598 | } |
| 4599 | break; |
| 4600 | case MARK_ANGLE_LAST: |
| 4601 | // FIXME: ignored for now |
| 4602 | break; |
| 4603 | default: |
| 4604 | console.log("unknown REC_TYPE_MARK frag type: " + fragType); |
| 4605 | throw "stop execution"; |
| 4606 | } |
| 4607 | break; |
| 4608 | default: |
| 4609 | continue; |
| 4610 | } |
| 4611 | } |
| 4612 | switch (recType) { |
| 4613 | case REC_TYPE_SORT: |
| 4614 | if (!draw_sort || (step_limit > 0 && tIndex < lastSort)) { |
| 4615 | break; |
| 4616 | } |
| 4617 | var angles = []; // use tangent lines to describe arcs |
| 4618 | var windFrom = []; |
| 4619 | var windTo = []; |
| 4620 | var opp = []; |
| 4621 | var minXY = Number.MAX_VALUE; |
| 4622 | var partial; |
| 4623 | focus_enabled = true; |
| 4624 | var someUnsortable = false; |
| 4625 | for (var recordIndex = 0; recordIndex < records.length; recordIndex += 2) { |
| 4626 | var fragType = records[recordIndex]; |
| 4627 | var frags = records[recordIndex + 1]; |
| 4628 | var unsortable = (fragType == SORT_UNARY && frags[14]) || |
| 4629 | (fragType == SORT_BINARY && frags[16]); |
| 4630 | someUnsortable |= unsortable; |
| 4631 | switch (fragType) { |
| 4632 | case SORT_UNARY: |
| 4633 | case SORT_BINARY: |
| 4634 | partial = curvePartialByID(test, frags[0], frags[6], frags[8]); |
| 4635 | break; |
| 4636 | default: |
| 4637 | console.log("unknown REC_TYPE_SORT frag type: " + fragType); |
| 4638 | throw "stop execution"; |
| 4639 | } |
| 4640 | var dx = boundsWidth(partial); |
| 4641 | var dy = boundsHeight(partial); |
| 4642 | minXY = Math.min(minXY, dx * dx + dy * dy); |
| 4643 | if (collect_bounds) { |
| 4644 | continue; |
| 4645 | } |
| 4646 | angles.push(tangent(partial)); |
| 4647 | var from = frags[12]; |
| 4648 | var to = frags[12]; |
| 4649 | var sgn = frags[10]; |
| 4650 | if (sgn < 0) { |
| 4651 | from -= frags[11]; |
| 4652 | } else if (sgn > 0) { |
| 4653 | to -= frags[11]; |
| 4654 | } |
| 4655 | windFrom.push(from + (unsortable ? "!" : "")); |
| 4656 | windTo.push(to + (unsortable ? "!" : "")); |
| 4657 | opp.push(fragType == SORT_BINARY); |
| 4658 | if (draw_sort == 1) { |
| 4659 | drawOrder(partial, frags[12]); |
| 4660 | } else { |
| 4661 | drawOrder(partial, (recordIndex / 2) + 1); |
| 4662 | } |
| 4663 | } |
| 4664 | var radius = Math.sqrt(minXY) / 2 * scale; |
| 4665 | radius = Math.min(50, radius); |
| 4666 | var scaledRadius = radius / scale; |
| 4667 | var centerX = partial[0]; |
| 4668 | var centerY = partial[1]; |
| 4669 | if (collect_bounds) { |
| 4670 | if (focus_enabled) { |
| 4671 | focusXmin = Math.min(focusXmin, centerX - scaledRadius); |
| 4672 | focusYmin = Math.min(focusYmin, centerY - scaledRadius); |
| 4673 | focusXmax = Math.max(focusXmax, centerX + scaledRadius); |
| 4674 | focusYmax = Math.max(focusYmax, centerY + scaledRadius); |
| 4675 | } |
| 4676 | break; |
| 4677 | } |
| 4678 | break; |
| 4679 | default: |
| 4680 | break; |
| 4681 | } |
| 4682 | } |
| 4683 | if (collect_bounds) { |
| 4684 | return; |
| 4685 | } |
| 4686 | if (draw_log && logStart >= 0) { |
| 4687 | ctx.font = "normal 10px Arial"; |
| 4688 | ctx.textAlign = "left"; |
| 4689 | ctx.beginPath(); |
| 4690 | var top = screenHeight - 20 - (logRange + 2) * 10; |
| 4691 | ctx.rect(50, top, screenWidth - 100, (logRange + 2) * 10); |
| 4692 | ctx.fillStyle = "white"; |
| 4693 | ctx.fill(); |
| 4694 | ctx.fillStyle = "rgba(0,0,0, 0.5)"; |
| 4695 | if (logStart > 0) { |
| 4696 | ctx.fillText(lines[logStart - 1], 50, top + 8); |
| 4697 | } |
| 4698 | ctx.fillStyle = "black"; |
| 4699 | for (var idx = 0; idx < logRange; ++idx) { |
| 4700 | ctx.fillText(lines[logStart + idx], 50, top + 18 + 10 * idx); |
| 4701 | } |
| 4702 | ctx.fillStyle = "rgba(0,0,0, 0.5)"; |
| 4703 | if (logStart + logRange < lines.length) { |
| 4704 | ctx.fillText(lines[logStart + logRange], 50, top + 18 + 10 * logRange); |
| 4705 | } |
| 4706 | } |
| 4707 | if (draw_legend) { |
| 4708 | var pos = 0; |
caryclark | 624637c | 2015-05-11 07:21:27 -0700 | [diff] [blame] | 4709 | 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] | 4710 | // drawBox(pos++, "yellow", "black", opLetter, true, ''); |
| 4711 | drawBox(pos++, "rgba(0,0,255, 0.3)", "black", draw_intersection > 1 ? sectCount : sectMax2, draw_intersection, intersectionKey); |
| 4712 | drawBox(pos++, "rgba(0,0,255, 0.3)", "black", draw_add ? addCount : addMax, draw_add, addKey); |
| 4713 | drawBox(pos++, "rgba(0,0,255, 0.3)", "black", draw_active ? activeCount : activeMax, draw_active, activeKey); |
| 4714 | drawBox(pos++, "rgba(127,127,0, 0.3)", "black", draw_angle ? angleCount : angleMax, draw_angle, angleKey); |
caryclark | 624637c | 2015-05-11 07:21:27 -0700 | [diff] [blame] | 4715 | 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] | 4716 | drawBox(pos++, "rgba(127,127,0, 0.3)", "black", draw_op ? opCount : opMax, draw_op, opKey); |
| 4717 | drawBox(pos++, "rgba(127,127,0, 0.3)", "black", draw_sort ? sortCount : sortMax, draw_sort, sortKey); |
caryclark | 03b03ca | 2015-04-23 09:13:37 -0700 | [diff] [blame] | 4718 | 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] | 4719 | 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] | 4720 | drawBox(pos++, "black", "white", |
caryclark | 26ad22a | 2015-10-16 09:03:38 -0700 | [diff] [blame] | 4721 | (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] | 4722 | drawBox(pos++, "rgba(0,63,0, 0.7)", "white", |
| 4723 | (new Array('Q', 'Q', 'C', 'QC', 'Qc', 'Cq'))[draw_computed], |
| 4724 | draw_computed != 0, computedKey); |
| 4725 | drawBox(pos++, "green", "black", step_limit, drawSomething, ''); |
| 4726 | drawBox(pos++, "green", "black", stepMax, drawSomething, ''); |
| 4727 | drawBox(pos++, "rgba(255,0,0, 0.6)", "black", lastIndex, drawSomething & draw_log, ''); |
| 4728 | drawBox(pos++, "rgba(255,0,0, 0.6)", "black", test.length - 1, drawSomething & draw_log, ''); |
| 4729 | if (curve_t) { |
| 4730 | drawCurveTControl(); |
| 4731 | } |
| 4732 | ctx.font = "normal 20px Arial"; |
| 4733 | ctx.fillStyle = "rgba(0,0,0, 0.3)"; |
| 4734 | ctx.textAlign = "right"; |
| 4735 | ctx.fillText(scale.toFixed(decimal_places) + 'x' , screenWidth - 10, screenHeight - 5); |
| 4736 | } |
| 4737 | if (draw_hints) { |
| 4738 | ctx.font = "normal 10px Arial"; |
| 4739 | ctx.fillStyle = "rgba(0,0,0, 0.5)"; |
| 4740 | ctx.textAlign = "right"; |
| 4741 | var y = 4; |
| 4742 | ctx.fillText("control lines : " + controlLinesKey, ctx.screenWidthwidth - 10, pos * 50 + y++ * 10); |
| 4743 | ctx.fillText("curve t : " + curveTKey, screenWidth - 10, pos * 50 + y++ * 10); |
| 4744 | ctx.fillText("deriviatives : " + deriviativesKey, screenWidth - 10, pos * 50 + y++ * 10); |
| 4745 | ctx.fillText("intersect t : " + intersectTKey, screenWidth - 10, pos * 50 + y++ * 10); |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 4746 | ctx.fillText("log : " + logKey, screenWidth - 10, pos * 50 + y++ * 10); |
| 4747 | ctx.fillText("log curve : " + logCurvesKey, screenWidth - 10, pos * 50 + y++ * 10); |
| 4748 | ctx.fillText("mid point : " + midpointKey, screenWidth - 10, pos * 50 + y++ * 10); |
| 4749 | ctx.fillText("points : " + ptsKey, screenWidth - 10, pos * 50 + y++ * 10); |
| 4750 | ctx.fillText("sequence : " + sequenceKey, screenWidth - 10, pos * 50 + y++ * 10); |
| 4751 | ctx.fillText("xy : " + xyKey, screenWidth - 10, pos * 50 + y++ * 10); |
| 4752 | } |
| 4753 | } |
| 4754 | |
| 4755 | function drawBox(y, backC, foreC, str, enable, label) { |
| 4756 | ctx.beginPath(); |
| 4757 | ctx.fillStyle = backC; |
| 4758 | ctx.rect(screenWidth - 40, y * 50 + 10, 40, 30); |
| 4759 | ctx.fill(); |
| 4760 | ctx.font = "normal 16px Arial"; |
| 4761 | ctx.fillStyle = foreC; |
| 4762 | ctx.textAlign = "center"; |
| 4763 | ctx.fillText(str, screenWidth - 20, y * 50 + 32); |
| 4764 | if (!enable) { |
| 4765 | ctx.fillStyle = "rgba(255,255,255, 0.5)"; |
| 4766 | ctx.fill(); |
| 4767 | } |
| 4768 | if (label != '') { |
| 4769 | ctx.font = "normal 9px Arial"; |
| 4770 | ctx.fillStyle = "black"; |
| 4771 | ctx.fillText(label, screenWidth - 47, y * 50 + 40); |
| 4772 | } |
| 4773 | } |
| 4774 | |
| 4775 | function drawCurveTControl() { |
| 4776 | ctx.lineWidth = 2; |
| 4777 | ctx.strokeStyle = "rgba(0,0,0, 0.3)"; |
| 4778 | ctx.beginPath(); |
| 4779 | ctx.rect(screenWidth - 80, 40, 28, screenHeight - 80); |
| 4780 | ctx.stroke(); |
| 4781 | var ty = 40 + curveT * (screenHeight - 80); |
| 4782 | ctx.beginPath(); |
| 4783 | ctx.moveTo(screenWidth - 80, ty); |
| 4784 | ctx.lineTo(screenWidth - 85, ty - 5); |
| 4785 | ctx.lineTo(screenWidth - 85, ty + 5); |
| 4786 | ctx.lineTo(screenWidth - 80, ty); |
| 4787 | ctx.fillStyle = "rgba(0,0,0, 0.6)"; |
| 4788 | ctx.fill(); |
| 4789 | var num = curveT.toFixed(decimal_places); |
| 4790 | ctx.font = "normal 10px Arial"; |
| 4791 | ctx.textAlign = "left"; |
| 4792 | ctx.fillText(num, screenWidth - 78, ty); |
| 4793 | } |
| 4794 | |
| 4795 | function ptInTControl() { |
| 4796 | var e = window.event; |
caryclark | 55888e4 | 2016-07-18 10:01:36 -0700 | [diff] [blame] | 4797 | var tgt = e.target || e.srcElement; |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 4798 | var left = tgt.offsetLeft; |
| 4799 | var top = tgt.offsetTop; |
| 4800 | var x = (e.clientX - left); |
| 4801 | var y = (e.clientY - top); |
| 4802 | if (x < screenWidth - 80 || x > screenWidth - 50) { |
| 4803 | return false; |
| 4804 | } |
| 4805 | if (y < 40 || y > screenHeight - 80) { |
| 4806 | return false; |
| 4807 | } |
| 4808 | curveT = (y - 40) / (screenHeight - 120); |
| 4809 | if (curveT < 0 || curveT > 1) { |
| 4810 | throw "stop execution"; |
| 4811 | } |
| 4812 | return true; |
| 4813 | } |
| 4814 | |
| 4815 | function drawTop() { |
| 4816 | if (tests[testIndex] == null) { |
| 4817 | var str = testDivs[testIndex].textContent; |
| 4818 | parse_all(str); |
| 4819 | var title = testDivs[testIndex].id.toString(); |
| 4820 | testTitles[testIndex] = title; |
| 4821 | } |
| 4822 | init(tests[testIndex]); |
| 4823 | redraw(); |
| 4824 | } |
| 4825 | |
| 4826 | function redraw() { |
| 4827 | if (focus_on_selection) { |
| 4828 | collect_bounds = true; |
| 4829 | draw(tests[testIndex], testLines[testIndex], testTitles[testIndex]); |
| 4830 | collect_bounds = false; |
| 4831 | if (focusXmin < focusXmax && focusYmin < focusYmax) { |
| 4832 | setScale(focusXmin, focusXmax, focusYmin, focusYmax); |
| 4833 | } |
| 4834 | } |
| 4835 | ctx.beginPath(); |
| 4836 | ctx.fillStyle = "white"; |
| 4837 | ctx.rect(0, 0, screenWidth, screenHeight); |
| 4838 | ctx.fill(); |
| 4839 | draw(tests[testIndex], testLines[testIndex], testTitles[testIndex]); |
| 4840 | } |
| 4841 | |
| 4842 | function dumpCurvePartial(test, id, t0, t1) { |
| 4843 | var curve = curveByID(test, id); |
| 4844 | var name = ["line", "quad", "cubic"][curve.length / 2 - 2]; |
| 4845 | console.log("id=" + id + " " + name + "=" + curveToString(curve) |
| 4846 | + " t0=" + t0 + " t1=" + t1 |
| 4847 | + " partial=" + curveToString(curvePartialByID(test, id, t0, t1))); |
| 4848 | } |
| 4849 | |
| 4850 | function dumpAngleTest(test, id, t0, t1) { |
| 4851 | var curve = curveByID(test, id); |
caryclark | 55888e4 | 2016-07-18 10:01:36 -0700 | [diff] [blame] | 4852 | console.log(" { {" + curveToString(curve) + "}, " |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 4853 | + curve.length / 2 + ", " + t0 + ", " + t1 + ", {} }, //"); |
| 4854 | } |
| 4855 | |
| 4856 | function dumpLogToConsole() { |
| 4857 | if (logStart < 0) { |
| 4858 | return; |
| 4859 | } |
| 4860 | var test = tests[testIndex]; |
| 4861 | var recType = REC_TYPE_UNKNOWN; |
| 4862 | var records; |
| 4863 | for (var index = 0; index < test.length; index += 3) { |
| 4864 | var lastLineNo = test[index + 1]; |
| 4865 | if (lastLineNo >= logStart && lastLineNo < logStart + logRange) { |
| 4866 | recType = test[index]; |
| 4867 | records = test[index + 2]; |
| 4868 | break; |
| 4869 | } |
| 4870 | } |
| 4871 | if (recType == REC_TYPE_UNKNOWN) { |
| 4872 | return; |
| 4873 | } |
| 4874 | var lines = testLines[testIndex]; |
| 4875 | for (var idx = 0; idx < logRange; ++idx) { |
| 4876 | var line = lines[logStart + idx]; |
| 4877 | console.log(line); |
| 4878 | for (var recordIndex = 0; recordIndex < records.length; recordIndex += 2) { |
| 4879 | var fragType = records[recordIndex]; |
| 4880 | var frags = records[recordIndex + 1]; |
| 4881 | if (recType == REC_TYPE_ANGLE && fragType == ANGLE_AFTER) { |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 4882 | dumpCurvePartial(test, frags[0], frags[4], frags[5]); |
| 4883 | dumpCurvePartial(test, frags[6], frags[10], frags[11]); |
| 4884 | dumpCurvePartial(test, frags[12], frags[16], frags[17]); |
| 4885 | console.log("\nstatic IntersectData intersectDataSet[] = { //"); |
| 4886 | dumpAngleTest(test, frags[0], frags[4], frags[5]); |
| 4887 | dumpAngleTest(test, frags[6], frags[10], frags[11]); |
| 4888 | dumpAngleTest(test, frags[12], frags[16], frags[17]); |
| 4889 | console.log("}; //"); |
| 4890 | } |
| 4891 | } |
| 4892 | } |
| 4893 | } |
| 4894 | |
| 4895 | var activeKey = 'a'; |
| 4896 | var pathKey = 'b'; |
| 4897 | var pathBackKey = 'B'; |
| 4898 | var centerKey = 'c'; |
caryclark | 624637c | 2015-05-11 07:21:27 -0700 | [diff] [blame] | 4899 | var coincidenceKey = 'C'; |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 4900 | var addKey = 'd'; |
| 4901 | var deriviativesKey = 'f'; |
| 4902 | var angleKey = 'g'; |
| 4903 | var angleBackKey = 'G'; |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 4904 | var intersectionKey = 'i'; |
| 4905 | var intersectionBackKey = 'I'; |
| 4906 | var sequenceKey = 'j'; |
| 4907 | var midpointKey = 'k'; |
| 4908 | var logKey = 'l'; |
| 4909 | var logToConsoleKey = 'L'; |
| 4910 | var markKey = 'm'; |
| 4911 | var sortKey = 'o'; |
| 4912 | var opKey = 'p'; |
| 4913 | var opBackKey = 'P'; |
| 4914 | var computedKey = 'q'; |
| 4915 | var computedBackKey = 'Q'; |
| 4916 | var stepKey = 's'; |
| 4917 | var stepBackKey = 'S'; |
| 4918 | var intersectTKey = 't'; |
caryclark | 03b03ca | 2015-04-23 09:13:37 -0700 | [diff] [blame] | 4919 | var topKey = 'T'; |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 4920 | var curveTKey = 'u'; |
| 4921 | var controlLinesBackKey = 'V'; |
| 4922 | var controlLinesKey = 'v'; |
| 4923 | var ptsKey = 'x'; |
| 4924 | var xyKey = 'y'; |
| 4925 | var logCurvesKey = 'z'; |
| 4926 | var focusKey = '`'; |
| 4927 | var idKey = '.'; |
| 4928 | var retinaKey = '\\'; |
| 4929 | |
| 4930 | function doKeyPress(evt) { |
| 4931 | var char = String.fromCharCode(evt.charCode); |
| 4932 | var focusWasOn = false; |
| 4933 | switch (char) { |
| 4934 | case '0': |
| 4935 | case '1': |
| 4936 | case '2': |
| 4937 | case '3': |
| 4938 | case '4': |
| 4939 | case '5': |
| 4940 | case '6': |
| 4941 | case '7': |
| 4942 | case '8': |
| 4943 | case '9': |
| 4944 | decimal_places = char - '0'; |
| 4945 | redraw(); |
| 4946 | break; |
| 4947 | case activeKey: |
| 4948 | draw_active ^= true; |
caryclark | 55888e4 | 2016-07-18 10:01:36 -0700 | [diff] [blame] | 4949 | redraw(); |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 4950 | break; |
| 4951 | case addKey: |
| 4952 | draw_add ^= true; |
caryclark | 55888e4 | 2016-07-18 10:01:36 -0700 | [diff] [blame] | 4953 | redraw(); |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 4954 | break; |
| 4955 | case angleKey: |
caryclark | 5435929 | 2015-03-26 07:52:43 -0700 | [diff] [blame] | 4956 | draw_angle = (draw_angle + 1) % 4; |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 4957 | redraw(); |
| 4958 | break; |
| 4959 | case angleBackKey: |
| 4960 | draw_angle = (draw_angle + 2) % 3; |
| 4961 | redraw(); |
| 4962 | break; |
| 4963 | case centerKey: |
| 4964 | setScale(xmin, xmax, ymin, ymax); |
caryclark | 55888e4 | 2016-07-18 10:01:36 -0700 | [diff] [blame] | 4965 | redraw(); |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 4966 | break; |
caryclark | 624637c | 2015-05-11 07:21:27 -0700 | [diff] [blame] | 4967 | case coincidenceKey: |
| 4968 | draw_coincidence ^= true; |
| 4969 | redraw(); |
| 4970 | break; |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 4971 | case controlLinesBackKey: |
| 4972 | control_lines = (control_lines + 3) % 4; |
caryclark | 55888e4 | 2016-07-18 10:01:36 -0700 | [diff] [blame] | 4973 | redraw(); |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 4974 | break; |
| 4975 | case controlLinesKey: |
| 4976 | control_lines = (control_lines + 1) % 4; |
caryclark | 55888e4 | 2016-07-18 10:01:36 -0700 | [diff] [blame] | 4977 | redraw(); |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 4978 | break; |
| 4979 | case computedBackKey: |
| 4980 | draw_computed = (draw_computed + 5) % 6; |
caryclark | 55888e4 | 2016-07-18 10:01:36 -0700 | [diff] [blame] | 4981 | redraw(); |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 4982 | break; |
| 4983 | case computedKey: |
| 4984 | draw_computed = (draw_computed + 1) % 6; |
caryclark | 55888e4 | 2016-07-18 10:01:36 -0700 | [diff] [blame] | 4985 | redraw(); |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 4986 | break; |
| 4987 | case curveTKey: |
| 4988 | curve_t ^= true; |
| 4989 | if (curve_t) { |
| 4990 | draw_legend = true; |
| 4991 | } |
| 4992 | redraw(); |
| 4993 | break; |
| 4994 | case deriviativesKey: |
| 4995 | draw_deriviatives = (draw_deriviatives + 1) % 3; |
| 4996 | redraw(); |
| 4997 | break; |
| 4998 | case focusKey: |
| 4999 | focus_on_selection ^= true; |
| 5000 | setScale(xmin, xmax, ymin, ymax); |
| 5001 | redraw(); |
| 5002 | break; |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 5003 | case idKey: |
| 5004 | draw_id ^= true; |
| 5005 | redraw(); |
| 5006 | break; |
| 5007 | case intersectionBackKey: |
| 5008 | draw_intersection = (draw_intersection + 3) % 4; |
caryclark | 55888e4 | 2016-07-18 10:01:36 -0700 | [diff] [blame] | 5009 | redraw(); |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 5010 | break; |
| 5011 | case intersectionKey: |
| 5012 | draw_intersection = (draw_intersection + 1) % 4; |
caryclark | 55888e4 | 2016-07-18 10:01:36 -0700 | [diff] [blame] | 5013 | redraw(); |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 5014 | break; |
| 5015 | case intersectTKey: |
| 5016 | draw_intersectT ^= true; |
| 5017 | redraw(); |
| 5018 | break; |
| 5019 | case logCurvesKey: |
| 5020 | logCurves(tests[testIndex]); |
| 5021 | break; |
| 5022 | case logKey: |
| 5023 | draw_log ^= true; |
| 5024 | redraw(); |
| 5025 | break; |
| 5026 | case logToConsoleKey: |
| 5027 | if (draw_log) { |
| 5028 | dumpLogToConsole(); |
| 5029 | } |
| 5030 | break; |
| 5031 | case markKey: |
| 5032 | draw_mark ^= true; |
| 5033 | redraw(); |
| 5034 | break; |
| 5035 | case midpointKey: |
| 5036 | draw_midpoint ^= true; |
| 5037 | redraw(); |
| 5038 | break; |
| 5039 | case opKey: |
| 5040 | draw_op = (draw_op + 1) % 3; |
| 5041 | redraw(); |
| 5042 | break; |
| 5043 | case opBackKey: |
| 5044 | draw_op = (draw_op + 2) % 3; |
| 5045 | redraw(); |
| 5046 | break; |
| 5047 | case pathKey: |
caryclark | 26ad22a | 2015-10-16 09:03:38 -0700 | [diff] [blame] | 5048 | draw_path = (draw_path + 1) % (4 + (hasAlignedPath ? 3 : 0)); |
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 pathBackKey: |
caryclark | 26ad22a | 2015-10-16 09:03:38 -0700 | [diff] [blame] | 5052 | draw_path = (draw_path + 3 + (hasAlignedPath ? 3 : 0)) % (4 + (hasAlignedPath ? 3 : 0)); |
caryclark | 55888e4 | 2016-07-18 10:01:36 -0700 | [diff] [blame] | 5053 | redraw(); |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 5054 | break; |
| 5055 | case ptsKey: |
| 5056 | pt_labels = (pt_labels + 1) % 3; |
| 5057 | redraw(); |
| 5058 | break; |
| 5059 | case retinaKey: |
| 5060 | retina_scale ^= true; |
| 5061 | drawTop(); |
| 5062 | break; |
| 5063 | case sequenceKey: |
| 5064 | draw_sequence ^= true; |
| 5065 | redraw(); |
| 5066 | break; |
| 5067 | case sortKey: |
| 5068 | draw_sort = (draw_sort + 1) % 3; |
| 5069 | drawTop(); |
| 5070 | break; |
| 5071 | case stepKey: |
| 5072 | step_limit++; |
| 5073 | if (step_limit > stepMax) { |
| 5074 | step_limit = stepMax; |
| 5075 | } |
| 5076 | redraw(); |
| 5077 | break; |
| 5078 | case stepBackKey: |
| 5079 | step_limit--; |
| 5080 | if (step_limit < 0) { |
| 5081 | step_limit = 0; |
| 5082 | } |
| 5083 | redraw(); |
| 5084 | break; |
caryclark | 03b03ca | 2015-04-23 09:13:37 -0700 | [diff] [blame] | 5085 | case topKey: |
| 5086 | draw_top ^= true; |
| 5087 | redraw(); |
| 5088 | break; |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 5089 | case xyKey: |
| 5090 | debug_xy = (debug_xy + 1) % 3; |
| 5091 | redraw(); |
| 5092 | break; |
| 5093 | case '-': |
| 5094 | focusWasOn = focus_on_selection; |
| 5095 | if (focusWasOn) { |
| 5096 | focus_on_selection = false; |
| 5097 | scale /= 1.2; |
| 5098 | } else { |
| 5099 | scale /= 2; |
| 5100 | calcLeftTop(); |
| 5101 | } |
| 5102 | redraw(); |
| 5103 | focus_on_selection = focusWasOn; |
| 5104 | break; |
| 5105 | case '=': |
| 5106 | case '+': |
| 5107 | focusWasOn = focus_on_selection; |
| 5108 | if (focusWasOn) { |
| 5109 | focus_on_selection = false; |
| 5110 | scale *= 1.2; |
| 5111 | } else { |
| 5112 | scale *= 2; |
| 5113 | calcLeftTop(); |
| 5114 | } |
| 5115 | redraw(); |
| 5116 | focus_on_selection = focusWasOn; |
| 5117 | break; |
| 5118 | case '?': |
| 5119 | draw_hints ^= true; |
| 5120 | if (draw_hints && !draw_legend) { |
| 5121 | draw_legend = true; |
| 5122 | } |
| 5123 | redraw(); |
| 5124 | break; |
| 5125 | case '/': |
| 5126 | draw_legend ^= true; |
| 5127 | redraw(); |
| 5128 | break; |
| 5129 | } |
| 5130 | } |
| 5131 | |
| 5132 | function doKeyDown(evt) { |
| 5133 | var char = evt.keyCode; |
| 5134 | var preventDefault = false; |
| 5135 | switch (char) { |
| 5136 | case 37: // left arrow |
| 5137 | if (evt.shiftKey) { |
| 5138 | testIndex -= 9; |
| 5139 | } |
| 5140 | if (--testIndex < 0) |
| 5141 | testIndex = tests.length - 1; |
| 5142 | drawTop(); |
| 5143 | preventDefault = true; |
| 5144 | break; |
| 5145 | case 39: // right arrow |
| 5146 | if (evt.shiftKey) { |
| 5147 | testIndex += 9; |
| 5148 | } |
| 5149 | if (++testIndex >= tests.length) |
| 5150 | testIndex = 0; |
| 5151 | drawTop(); |
| 5152 | preventDefault = true; |
| 5153 | break; |
| 5154 | } |
| 5155 | if (preventDefault) { |
| 5156 | evt.preventDefault(); |
| 5157 | return false; |
| 5158 | } |
| 5159 | return true; |
| 5160 | } |
| 5161 | |
| 5162 | (function() { |
| 5163 | var hidden = "hidden"; |
| 5164 | |
| 5165 | // Standards: |
| 5166 | if (hidden in document) |
| 5167 | document.addEventListener("visibilitychange", onchange); |
| 5168 | else if ((hidden = "mozHidden") in document) |
| 5169 | document.addEventListener("mozvisibilitychange", onchange); |
| 5170 | else if ((hidden = "webkitHidden") in document) |
| 5171 | document.addEventListener("webkitvisibilitychange", onchange); |
| 5172 | else if ((hidden = "msHidden") in document) |
| 5173 | document.addEventListener("msvisibilitychange", onchange); |
| 5174 | // IE 9 and lower: |
| 5175 | else if ('onfocusin' in document) |
| 5176 | document.onfocusin = document.onfocusout = onchange; |
| 5177 | // All others: |
| 5178 | else |
caryclark | 55888e4 | 2016-07-18 10:01:36 -0700 | [diff] [blame] | 5179 | window.onpageshow = window.onpagehide |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 5180 | = window.onfocus = window.onblur = onchange; |
| 5181 | |
| 5182 | function onchange (evt) { |
| 5183 | var v = 'visible', h = 'hidden', |
caryclark | 55888e4 | 2016-07-18 10:01:36 -0700 | [diff] [blame] | 5184 | evtMap = { |
| 5185 | focus:v, focusin:v, pageshow:v, blur:h, focusout:h, pagehide:h |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 5186 | }; |
| 5187 | |
| 5188 | evt = evt || window.event; |
| 5189 | if (evt.type in evtMap) |
| 5190 | document.body.className = evtMap[evt.type]; |
caryclark | 55888e4 | 2016-07-18 10:01:36 -0700 | [diff] [blame] | 5191 | else |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 5192 | document.body.className = this[hidden] ? "hidden" : "visible"; |
| 5193 | } |
| 5194 | })(); |
| 5195 | |
| 5196 | function calcXY() { |
| 5197 | var e = window.event; |
caryclark | 55888e4 | 2016-07-18 10:01:36 -0700 | [diff] [blame] | 5198 | var tgt = e.target || e.srcElement; |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 5199 | var left = tgt.offsetLeft; |
| 5200 | var top = tgt.offsetTop; |
| 5201 | mouseX = (e.clientX - left) / scale + srcLeft; |
| 5202 | mouseY = (e.clientY - top) / scale + srcTop; |
| 5203 | } |
| 5204 | |
| 5205 | function calcLeftTop() { |
| 5206 | srcLeft = mouseX - screenWidth / 2 / scale; |
| 5207 | srcTop = mouseY - screenHeight / 2 / scale; |
| 5208 | } |
| 5209 | |
| 5210 | var disableClick = false; |
| 5211 | |
| 5212 | function handleMouseClick() { |
| 5213 | if (disableClick) { |
| 5214 | return; |
| 5215 | } |
| 5216 | if (!curve_t || !ptInTControl()) { |
| 5217 | calcXY(); |
| 5218 | calcLeftTop(); |
| 5219 | } |
| 5220 | redraw(); |
| 5221 | // if (!curve_t || !ptInTControl()) { |
| 5222 | // mouseX = screenWidth / 2 / scale + srcLeft; |
| 5223 | // mouseY = screenHeight / 2 / scale + srcTop; |
| 5224 | // } |
| 5225 | } |
| 5226 | |
| 5227 | function handleMouseOver() { |
| 5228 | calcXY(); |
| 5229 | if (debug_xy != 2) { |
| 5230 | return; |
| 5231 | } |
| 5232 | var num = mouseX.toFixed(decimal_places) + ", " + mouseY.toFixed(decimal_places); |
| 5233 | ctx.beginPath(); |
| 5234 | ctx.rect(300,100,num.length * 6,10); |
| 5235 | ctx.fillStyle="white"; |
| 5236 | ctx.fill(); |
| 5237 | ctx.font = "normal 10px Arial"; |
| 5238 | ctx.fillStyle="black"; |
| 5239 | ctx.textAlign = "left"; |
| 5240 | ctx.fillText(num, 300, 108); |
| 5241 | } |
| 5242 | |
| 5243 | function start() { |
| 5244 | for (var i = 0; i < testDivs.length; ++i) { |
| 5245 | tests[i] = null; |
| 5246 | } |
| 5247 | testIndex = 0; |
| 5248 | drawTop(); |
| 5249 | window.addEventListener('keypress', doKeyPress, true); |
| 5250 | window.addEventListener('keydown', doKeyDown, true); |
| 5251 | window.onresize = function() { |
| 5252 | drawTop(); |
| 5253 | } |
| 5254 | /* |
| 5255 | window.onpagehide = function() { |
| 5256 | disableClick = true; |
| 5257 | } |
| 5258 | */ |
| 5259 | window.onpageshow = function () { |
| 5260 | disableClick = false; |
| 5261 | } |
| 5262 | } |
| 5263 | |
| 5264 | </script> |
| 5265 | </head> |
| 5266 | |
| 5267 | <body onLoad="start();"> |
| 5268 | <canvas id="canvas" width="750" height="500" |
| 5269 | onmousemove="handleMouseOver()" |
| 5270 | onclick="handleMouseClick()" |
| 5271 | ></canvas > |
| 5272 | </body> |
| 5273 | </html> |