caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 1 | <html> |
| 2 | <head> |
| 3 | <div height="0" hidden="true"> |
Cary Clark | 7eb01e0 | 2016-12-08 14:36:32 -0500 | [diff] [blame] | 4 |
|
Cary Clark | ab2d73b | 2016-12-16 17:17:25 -0500 | [diff] [blame^] | 5 | <div id="joel_11">
|
Cary Clark | 7eb01e0 | 2016-12-08 14:36:32 -0500 | [diff] [blame] | 6 | SkDCubic::ComplexBreak
|
Cary Clark | ab2d73b | 2016-12-16 17:17:25 -0500 | [diff] [blame^] | 7 | {{{407.66400146484375, 586.52301025390625}, {406.718994140625, 585.91400146484375}, {405.56201171875, 585.6710205078125}, {404.38299560546875, 585.9210205078125}}},
|
| 8 | maxCurvature[0]=0.210691815 {{{410.1179280337341311, 587.5354084049533867}, {403.9625372513739308, 584.8405979797089458}}},
|
Cary Clark | 7eb01e0 | 2016-12-08 14:36:32 -0500 | [diff] [blame] | 9 | SkDCubic::ComplexBreak
|
Cary Clark | ab2d73b | 2016-12-16 17:17:25 -0500 | [diff] [blame^] | 10 | {{{403.625, 582.36602783203125}, {407.9530029296875, 581.4520263671875}, {412.17999267578125, 584.2020263671875}, {413.10198974609375, 588.5140380859375}}},
|
| 11 | maxCurvature[0]=0.505742375 {{{399.4806060513494685, 576.7555289603596975}, {419.9185900147107304, 590.2821868178559725}}},
|
Cary Clark | ff11428 | 2016-12-14 11:56:16 -0500 | [diff] [blame] | 12 | SkDCubic::ComplexBreak
|
Cary Clark | ab2d73b | 2016-12-16 17:17:25 -0500 | [diff] [blame^] | 13 | {{{408.92901611328125, 592.5469970703125}, {409.53802490234375, 591.60198974609375}, {409.78802490234375, 590.4530029296875}, {409.53802490234375, 589.27398681640625}}},
|
| 14 | maxCurvature[0]=0.2464997 {{{408.0414711863251682, 594.9185862710903621}, {410.5821756824746558, 588.7085892000006879}}},
|
Cary Clark | ff11428 | 2016-12-14 11:56:16 -0500 | [diff] [blame] | 15 | SkDCubic::ComplexBreak
|
Cary Clark | ab2d73b | 2016-12-16 17:17:25 -0500 | [diff] [blame^] | 16 | {{{413.10003662109375, 588.5159912109375}, {414.00604248046875, 592.83599853515625}, {411.27203369140625, 597.06298828125}, {406.94403076171875, 597.9849853515625}}},
|
| 17 | maxCurvature[0]=0.50027635 {{{418.6547935965468241, 584.2584103487866969}, {405.3110940414140941, 604.7967504597730795}}},
|
| 18 | SkDCubic::ComplexBreak
|
| 19 | {{{402.91400146484375, 593.82000732421875}, {403.8590087890625, 594.42901611328125}, {405.0159912109375, 594.67901611328125}, {406.19500732421875, 594.42901611328125}}},
|
| 20 | maxCurvature[0]=0.20172566 {{{400.4418179242405245, 592.7682938621098856}, {406.5786156780874876, 595.518866839962584}}},
|
| 21 | SkDCubic::ComplexBreak
|
| 22 | {{{406.94500732421875, 597.9840087890625}, {402.625, 598.89801025390625}, {398.39801025390625, 596.156005859375}, {397.47601318359375, 591.83599853515625}}},
|
| 23 | maxCurvature[0]=0.500281451 {{{411.2024837739085115, 603.5428096059653171}, {390.6642477196397749, 590.1989499052259589}}},
|
| 24 | SkDCubic::ComplexBreak
|
| 25 | {{{401.6409912109375, 587.81298828125}, {401.031982421875, 588.7509765625}, {400.781982421875, 589.89898681640625}, {401.031982421875, 591.0789794921875}}},
|
| 26 | maxCurvature[0]=0.208772223 {{{402.6666692341399312, 585.3725424991555428}, {399.9489005783761968, 591.4800732145131406}}},
|
| 27 | SkDCubic::ComplexBreak
|
| 28 | {{{397.47698974609375, 591.83697509765625}, {396.56298828125, 587.5169677734375}, {399.30499267578125, 583.28997802734375}, {403.625, 582.36798095703125}}},
|
| 29 | maxCurvature[0]=0.500281451 {{{391.9181889291909329, 596.0944515473461252}, {405.2620486299302911, 575.5562154930773886}}},
|
| 30 | <empty>
|
| 31 | <empty>
|
| 32 | seg=1 {{{409.539001f, 589.27301f}, {409.296997f, 588.085022f}, {408.593994f, 587.140015f}, {407.664001f, 586.52301f}}}
|
| 33 | seg=2 {{{407.664001f, 586.52301f}, {406.718994f, 585.914001f}, {405.562012f, 585.671021f}, {404.382996f, 585.921021f}}}
|
| 34 | seg=3 {{{404.382996f, 585.921021f}, {403.625f, 582.366028f}}}
|
| 35 | seg=4 {{{403.625f, 582.366028f}, {407.953003f, 581.452026f}, {412.179993f, 584.202026f}, {413.10199f, 588.514038f}}}
|
| 36 | seg=5 {{{413.10199f, 588.514038f}, {409.539001f, 589.27301f}}}
|
| 37 | <empty>
|
| 38 | seg=6 {{{406.195007f, 594.429993f}, {407.375f, 594.179993f}, {408.320007f, 593.484985f}, {408.929016f, 592.546997f}}}
|
| 39 | seg=7 {{{408.929016f, 592.546997f}, {409.538025f, 591.60199f}, {409.788025f, 590.453003f}, {409.538025f, 589.273987f}}}
|
| 40 | seg=8 {{{409.538025f, 589.273987f}, {413.100037f, 588.515991f}}}
|
| 41 | seg=9 {{{413.100037f, 588.515991f}, {414.006042f, 592.835999f}, {411.272034f, 597.062988f}, {406.944031f, 597.984985f}}}
|
| 42 | seg=10 {{{406.944031f, 597.984985f}, {406.195007f, 594.429993f}}}
|
| 43 | <empty>
|
| 44 | seg=11 {{{401.031006f, 591.078003f}, {401.289001f, 592.257996f}, {401.984009f, 593.210999f}, {402.914001f, 593.820007f}}}
|
| 45 | seg=12 {{{402.914001f, 593.820007f}, {403.859009f, 594.429016f}, {405.015991f, 594.679016f}, {406.195007f, 594.429016f}}}
|
| 46 | seg=13 {{{406.195007f, 594.429016f}, {406.945007f, 597.984009f}}}
|
| 47 | seg=14 {{{406.945007f, 597.984009f}, {402.625f, 598.89801f}, {398.39801f, 596.156006f}, {397.476013f, 591.835999f}}}
|
| 48 | seg=15 {{{397.476013f, 591.835999f}, {401.031006f, 591.078003f}}}
|
| 49 | seg=16 {{{404.382996f, 585.921997f}, {403.203003f, 586.171997f}, {402.25f, 586.867004f}, {401.640991f, 587.812988f}}}
|
| 50 | seg=17 {{{401.640991f, 587.812988f}, {401.031982f, 588.750977f}, {400.781982f, 589.898987f}, {401.031982f, 591.078979f}}}
|
| 51 | seg=18 {{{401.031982f, 591.078979f}, {397.47699f, 591.836975f}}}
|
| 52 | seg=19 {{{397.47699f, 591.836975f}, {396.562988f, 587.516968f}, {399.304993f, 583.289978f}, {403.625f, 582.367981f}}}
|
| 53 | seg=20 {{{403.625f, 582.367981f}, {404.382996f, 585.921997f}}}
|
| 54 | debugShowCubicIntersection wtTs[0]=1 {{{409.539001,589.27301}, {409.296997,588.085022}, {408.593994,587.140015}, {407.664001,586.52301}}} {{407.664001,586.52301}} wnTs[0]=0 {{{407.664001,586.52301}, {406.718994,585.914001}, {405.562012,585.671021}, {404.382996,585.921021}}}
|
| 55 | debugShowCubicIntersection no intersect {{{409.539001,589.27301}, {409.296997,588.085022}, {408.593994,587.140015}, {407.664001,586.52301}}} {{{403.625,582.366028}, {407.953003,581.452026}, {412.179993,584.202026}, {413.10199,588.514038}}}
|
| 56 | debugShowCubicLineIntersection wtTs[0]=0 {{{409.539001,589.27301}, {409.296997,588.085022}, {408.593994,587.140015}, {407.664001,586.52301}}} {{409.539001,589.27301}} wnTs[0]=1 {{{413.10199,588.514038}, {409.539001,589.27301}}}
|
| 57 | debugShowCubicLineIntersection wtTs[0]=1 {{{407.664001,586.52301}, {406.718994,585.914001}, {405.562012,585.671021}, {404.382996,585.921021}}} {{404.382996,585.921021}} wnTs[0]=0 {{{404.382996,585.921021}, {403.625,582.366028}}}
|
| 58 | debugShowCubicIntersection no intersect {{{407.664001,586.52301}, {406.718994,585.914001}, {405.562012,585.671021}, {404.382996,585.921021}}} {{{403.625,582.366028}, {407.953003,581.452026}, {412.179993,584.202026}, {413.10199,588.514038}}}
|
| 59 | debugShowCubicLineIntersection wtTs[0]=0 {{{403.625,582.366028}, {407.953003,581.452026}, {412.179993,584.202026}, {413.10199,588.514038}}} {{403.625,582.366028}} wnTs[0]=1 {{{404.382996,585.921021}, {403.625,582.366028}}}
|
| 60 | debugShowCubicLineIntersection wtTs[0]=1 {{{403.625,582.366028}, {407.953003,581.452026}, {412.179993,584.202026}, {413.10199,588.514038}}} {{413.10199,588.514038}} wnTs[0]=0 {{{413.10199,588.514038}, {409.539001,589.27301}}}
|
| 61 | debugShowCubicIntersection no intersect {{{407.664001,586.52301}, {406.718994,585.914001}, {405.562012,585.671021}, {404.382996,585.921021}}} {{{404.382996,585.921997}, {403.203003,586.171997}, {402.25,586.867004}, {401.640991,587.812988}}}
|
| 62 | debugShowCubicLineIntersection wtTs[0]=1 {{{407.664001,586.52301}, {406.718994,585.914001}, {405.562012,585.671021}, {404.382996,585.921021}}} {{404.382996,585.921021}} wnTs[0]=0.999737 {{{403.625,582.367981}, {404.382996,585.921997}}}
|
| 63 | debugShowCubicLineIntersection wtTs[0]=1 {{{397.47699,591.836975}, {396.562988,587.516968}, {399.304993,583.289978}, {403.625,582.367981}}} {{403.625,582.367981}} wnTs[0]=0.999474 {{{404.382996,585.921021}, {403.625,582.366028}}}
|
| 64 | SkOpSegment::addT insert t=0.999474488 segID=3 spanID=41
|
| 65 | debugShowLineIntersection wtTs[0]=0 {{{404.382996,585.921021}, {403.625,582.366028}}} {{404.382996,585.921021}} wtTs[1]=0.999474488 {{403.625,582.367981}} wnTs[0]=0.999737 {{{403.625,582.367981}, {404.382996,585.921997}}} wnTs[1]=0
|
| 66 | debugShowCubicIntersection no intersect {{{403.625,582.366028}, {407.953003,581.452026}, {412.179993,584.202026}, {413.10199,588.514038}}} {{{404.382996,585.921997}, {403.203003,586.171997}, {402.25,586.867004}, {401.640991,587.812988}}}
|
| 67 | debugShowCubicIntersection no intersect {{{403.625,582.366028}, {407.953003,581.452026}, {412.179993,584.202026}, {413.10199,588.514038}}} {{{397.47699,591.836975}, {396.562988,587.516968}, {399.304993,583.289978}, {403.625,582.367981}}}
|
| 68 | debugShowCubicLineIntersection no intersect {{{403.625,582.366028}, {407.953003,581.452026}, {412.179993,584.202026}, {413.10199,588.514038}}} {{{403.625,582.367981}, {404.382996,585.921997}}}
|
| 69 | debugShowCubicLineIntersection wtTs[0]=0 {{{409.539001,589.27301}, {409.296997,588.085022}, {408.593994,587.140015}, {407.664001,586.52301}}} {{409.539001,589.27301}} wnTs[0]=0.000318097 {{{409.538025,589.273987}, {413.100037,588.515991}}}
|
| 70 | SkOpSegment::addT insert t=0.000318097039 segID=8 spanID=42
|
| 71 | debugShowCubicIntersection no intersect {{{409.539001,589.27301}, {409.296997,588.085022}, {408.593994,587.140015}, {407.664001,586.52301}}} {{{413.100037,588.515991}, {414.006042,592.835999}, {411.272034,597.062988}, {406.944031,597.984985}}}
|
| 72 | debugShowLineIntersection wtTs[0]=1 {{{413.10199,588.514038}, {409.539001,589.27301}}} {{409.539001,589.27301}} wnTs[0]=0.000318097 {{{409.538025,589.273987}, {413.100037,588.515991}}}
|
| 73 | debugShowCubicLineIntersection no intersect {{{413.100037,588.515991}, {414.006042,592.835999}, {411.272034,597.062988}, {406.944031,597.984985}}} {{{413.10199,588.514038}, {409.539001,589.27301}}}
|
| 74 | debugShowCubicIntersection wtTs[0]=1 {{{404.382996,585.921997}, {403.203003,586.171997}, {402.25,586.867004}, {401.640991,587.812988}}} {{401.640991,587.812988}} wnTs[0]=0 {{{401.640991,587.812988}, {401.031982,588.750977}, {400.781982,589.898987}, {401.031982,591.078979}}}
|
| 75 | debugShowCubicIntersection no intersect {{{404.382996,585.921997}, {403.203003,586.171997}, {402.25,586.867004}, {401.640991,587.812988}}} {{{397.47699,591.836975}, {396.562988,587.516968}, {399.304993,583.289978}, {403.625,582.367981}}}
|
| 76 | debugShowCubicLineIntersection wtTs[0]=0 {{{404.382996,585.921997}, {403.203003,586.171997}, {402.25,586.867004}, {401.640991,587.812988}}} {{404.382996,585.921997}} wnTs[0]=1 {{{403.625,582.367981}, {404.382996,585.921997}}}
|
| 77 | debugShowCubicLineIntersection wtTs[0]=1 {{{401.640991,587.812988}, {401.031982,588.750977}, {400.781982,589.898987}, {401.031982,591.078979}}} {{401.031982,591.078979}} wnTs[0]=0 {{{401.031982,591.078979}, {397.47699,591.836975}}}
|
| 78 | debugShowCubicIntersection no intersect {{{401.640991,587.812988}, {401.031982,588.750977}, {400.781982,589.898987}, {401.031982,591.078979}}} {{{397.47699,591.836975}, {396.562988,587.516968}, {399.304993,583.289978}, {403.625,582.367981}}}
|
| 79 | debugShowCubicLineIntersection wtTs[0]=0 {{{397.47699,591.836975}, {396.562988,587.516968}, {399.304993,583.289978}, {403.625,582.367981}}} {{397.47699,591.836975}} wnTs[0]=1 {{{401.031982,591.078979}, {397.47699,591.836975}}}
|
| 80 | debugShowCubicLineIntersection wtTs[0]=1 {{{397.47699,591.836975}, {396.562988,587.516968}, {399.304993,583.289978}, {403.625,582.367981}}} {{403.625,582.367981}} wnTs[0]=0 {{{403.625,582.367981}, {404.382996,585.921997}}}
|
| 81 | debugShowCubicIntersection no intersect {{{401.640991,587.812988}, {401.031982,588.750977}, {400.781982,589.898987}, {401.031982,591.078979}}} {{{401.031006,591.078003}, {401.289001,592.257996}, {401.984009,593.210999}, {402.914001,593.820007}}}
|
| 82 | debugShowCubicLineIntersection no intersect {{{401.640991,587.812988}, {401.031982,588.750977}, {400.781982,589.898987}, {401.031982,591.078979}}} {{{397.476013,591.835999}, {401.031006,591.078003}}}
|
| 83 | debugShowCubicLineIntersection wtTs[0]=0.000319790508 {{{401.031006,591.078003}, {401.289001,592.257996}, {401.984009,593.210999}, {402.914001,593.820007}}} {{401.03125,591.079163}} wnTs[0]=0.00020504 {{{401.031982,591.078979}, {397.47699,591.836975}}}
|
| 84 | SkOpSegment::addT insert t=0.000319790508 segID=11 spanID=43
|
| 85 | debugShowCubicLineIntersection no intersect {{{406.945007,597.984009}, {402.625,598.89801}, {398.39801,596.156006}, {397.476013,591.835999}}} {{{401.031982,591.078979}, {397.47699,591.836975}}}
|
| 86 | debugShowLineIntersection no intersect {{{401.031982,591.078979}, {397.47699,591.836975}}} {{{397.476013,591.835999}, {401.031006,591.078003}}}
|
| 87 | debugShowCubicIntersection no intersect {{{397.47699,591.836975}, {396.562988,587.516968}, {399.304993,583.289978}, {403.625,582.367981}}} {{{401.031006,591.078003}, {401.289001,592.257996}, {401.984009,593.210999}, {402.914001,593.820007}}}
|
| 88 | debugShowCubicIntersection no intersect {{{397.47699,591.836975}, {396.562988,587.516968}, {399.304993,583.289978}, {403.625,582.367981}}} {{{406.945007,597.984009}, {402.625,598.89801}, {398.39801,596.156006}, {397.476013,591.835999}}}
|
| 89 | debugShowCubicLineIntersection wtTs[0]=8.74738929e-05 {{{397.47699,591.836975}, {396.562988,587.516968}, {399.304993,583.289978}, {403.625,582.367981}}} {{397.476746,591.835815}} wnTs[0]=0.000207256 {{{397.476013,591.835999}, {401.031006,591.078003}}}
|
| 90 | SkOpSegment::addT insert t=8.74738929e-05 segID=19 spanID=44
|
| 91 | debugShowCubicIntersection wtTs[0]=1 {{{406.195007,594.429993}, {407.375,594.179993}, {408.320007,593.484985}, {408.929016,592.546997}}} {{408.929016,592.546997}} wnTs[0]=0 {{{408.929016,592.546997}, {409.538025,591.60199}, {409.788025,590.453003}, {409.538025,589.273987}}}
|
| 92 | debugShowCubicIntersection no intersect {{{406.195007,594.429993}, {407.375,594.179993}, {408.320007,593.484985}, {408.929016,592.546997}}} {{{413.100037,588.515991}, {414.006042,592.835999}, {411.272034,597.062988}, {406.944031,597.984985}}}
|
| 93 | debugShowCubicLineIntersection wtTs[0]=0 {{{406.195007,594.429993}, {407.375,594.179993}, {408.320007,593.484985}, {408.929016,592.546997}}} {{406.195007,594.429993}} wnTs[0]=1 {{{406.944031,597.984985}, {406.195007,594.429993}}}
|
| 94 | debugShowCubicLineIntersection wtTs[0]=1 {{{408.929016,592.546997}, {409.538025,591.60199}, {409.788025,590.453003}, {409.538025,589.273987}}} {{409.538025,589.273987}} wnTs[0]=0 {{{409.538025,589.273987}, {413.100037,588.515991}}}
|
| 95 | debugShowCubicIntersection no intersect {{{408.929016,592.546997}, {409.538025,591.60199}, {409.788025,590.453003}, {409.538025,589.273987}}} {{{413.100037,588.515991}, {414.006042,592.835999}, {411.272034,597.062988}, {406.944031,597.984985}}}
|
| 96 | debugShowCubicLineIntersection wtTs[0]=0 {{{413.100037,588.515991}, {414.006042,592.835999}, {411.272034,597.062988}, {406.944031,597.984985}}} {{413.100037,588.515991}} wnTs[0]=1 {{{409.538025,589.273987}, {413.100037,588.515991}}}
|
| 97 | debugShowCubicLineIntersection wtTs[0]=1 {{{413.100037,588.515991}, {414.006042,592.835999}, {411.272034,597.062988}, {406.944031,597.984985}}} {{406.944031,597.984985}} wnTs[0]=0 {{{406.944031,597.984985}, {406.195007,594.429993}}}
|
| 98 | debugShowCubicIntersection no intersect {{{406.195007,594.429993}, {407.375,594.179993}, {408.320007,593.484985}, {408.929016,592.546997}}} {{{402.914001,593.820007}, {403.859009,594.429016}, {405.015991,594.679016}, {406.195007,594.429016}}}
|
| 99 | debugShowCubicLineIntersection wtTs[0]=0 {{{406.195007,594.429993}, {407.375,594.179993}, {408.320007,593.484985}, {408.929016,592.546997}}} {{406.195007,594.429993}} wtTs[1]=5.57101392e-05 {{406.19519,594.429932}} wnTs[0]=0.000262996 {{{406.195007,594.429016}, {406.945007,597.984009}}} wnTs[1]=0.000262947308
|
| 100 | debugShowCubicIntersection no intersect {{{406.195007,594.429993}, {407.375,594.179993}, {408.320007,593.484985}, {408.929016,592.546997}}} {{{406.945007,597.984009}, {402.625,598.89801}, {398.39801,596.156006}, {397.476013,591.835999}}}
|
| 101 | debugShowCubicLineIntersection no intersect {{{413.100037,588.515991}, {414.006042,592.835999}, {411.272034,597.062988}, {406.944031,597.984985}}} {{{406.195007,594.429016}, {406.945007,597.984009}}}
|
| 102 | debugShowCubicIntersection no intersect {{{413.100037,588.515991}, {414.006042,592.835999}, {411.272034,597.062988}, {406.944031,597.984985}}} {{{406.945007,597.984009}, {402.625,598.89801}, {398.39801,596.156006}, {397.476013,591.835999}}}
|
| 103 | debugShowCubicLineIntersection no intersect {{{402.914001,593.820007}, {403.859009,594.429016}, {405.015991,594.679016}, {406.195007,594.429016}}} {{{406.944031,597.984985}, {406.195007,594.429993}}}
|
| 104 | debugShowLineIntersection wtTs[0]=1 {{{406.944031,597.984985}, {406.195007,594.429993}}} {{406.195007,594.429993}} wnTs[0]=0.000262996 {{{406.195007,594.429016}, {406.945007,597.984009}}}
|
| 105 | debugShowCubicLineIntersection wtTs[0]=8.73365293e-05 {{{406.945007,597.984009}, {402.625,598.89801}, {398.39801,596.156006}, {397.476013,591.835999}}} {{406.943878,597.984253}} wnTs[0]=0.000207362 {{{406.944031,597.984985}, {406.195007,594.429993}}}
|
| 106 | SkOpSegment::addT insert t=8.73365293e-05 segID=14 spanID=45
|
| 107 | debugShowCubicIntersection wtTs[0]=1 {{{401.031006,591.078003}, {401.289001,592.257996}, {401.984009,593.210999}, {402.914001,593.820007}}} {{402.914001,593.820007}} wnTs[0]=0 {{{402.914001,593.820007}, {403.859009,594.429016}, {405.015991,594.679016}, {406.195007,594.429016}}}
|
| 108 | debugShowCubicIntersection no intersect {{{401.031006,591.078003}, {401.289001,592.257996}, {401.984009,593.210999}, {402.914001,593.820007}}} {{{406.945007,597.984009}, {402.625,598.89801}, {398.39801,596.156006}, {397.476013,591.835999}}}
|
| 109 | debugShowCubicLineIntersection wtTs[0]=0 {{{401.031006,591.078003}, {401.289001,592.257996}, {401.984009,593.210999}, {402.914001,593.820007}}} {{401.031006,591.078003}} wnTs[0]=1 {{{397.476013,591.835999}, {401.031006,591.078003}}}
|
| 110 | debugShowCubicLineIntersection wtTs[0]=1 {{{402.914001,593.820007}, {403.859009,594.429016}, {405.015991,594.679016}, {406.195007,594.429016}}} {{406.195007,594.429016}} wnTs[0]=0 {{{406.195007,594.429016}, {406.945007,597.984009}}}
|
| 111 | debugShowCubicIntersection no intersect {{{402.914001,593.820007}, {403.859009,594.429016}, {405.015991,594.679016}, {406.195007,594.429016}}} {{{406.945007,597.984009}, {402.625,598.89801}, {398.39801,596.156006}, {397.476013,591.835999}}}
|
| 112 | debugShowCubicLineIntersection wtTs[0]=0 {{{406.945007,597.984009}, {402.625,598.89801}, {398.39801,596.156006}, {397.476013,591.835999}}} {{406.945007,597.984009}} wnTs[0]=1 {{{406.195007,594.429016}, {406.945007,597.984009}}}
|
| 113 | debugShowCubicLineIntersection wtTs[0]=1 {{{406.945007,597.984009}, {402.625,598.89801}, {398.39801,596.156006}, {397.476013,591.835999}}} {{397.476013,591.835999}} wnTs[0]=0 {{{397.476013,591.835999}, {401.031006,591.078003}}}
|
Cary Clark | ff11428 | 2016-12-14 11:56:16 -0500 | [diff] [blame] | 114 | ------------------x--x---------------- addExpanded
|
Cary Clark | ab2d73b | 2016-12-16 17:17:25 -0500 | [diff] [blame^] | 115 | 00: seg/base=20/39 seg/base=3/5 MarkCoinStart
|
| 116 | 01: seg/base=20/40 seg/base=3/41 MarkCoinEnd
|
| 117 | SkOpSegment::debugShowActiveSpans id=1 (409.539001,589.27301 409.296997,588.085022 408.593994,587.140015 407.664001,586.52301) t=0 tEnd=1 windSum=? windValue=1
|
| 118 | SkOpSegment::debugShowActiveSpans id=2 (407.664001,586.52301 406.718994,585.914001 405.562012,585.671021 404.382996,585.921021) t=0 tEnd=1 windSum=? windValue=1
|
| 119 | SkOpSegment::debugShowActiveSpans id=3 (404.382996,585.921021 403.625397,582.36792) t=0 tEnd=0.999474488 windSum=? windValue=1
|
| 120 | SkOpSegment::debugShowActiveSpans id=3 (403.625397,582.36792 403.625,582.366028) t=0.999474488 tEnd=1 windSum=? windValue=1
|
| 121 | SkOpSegment::debugShowActiveSpans id=4 (403.625,582.366028 407.953003,581.452026 412.179993,584.202026 413.10199,588.514038) t=0 tEnd=1 windSum=? windValue=1
|
| 122 | SkOpSegment::debugShowActiveSpans id=5 (413.10199,588.514038 409.539001,589.27301) t=0 tEnd=1 windSum=? windValue=1
|
| 123 | SkOpSegment::debugShowActiveSpans id=16 (404.382996,585.921997 403.203003,586.171997 402.25,586.867004 401.640991,587.812988) t=0 tEnd=1 windSum=? windValue=1
|
| 124 | SkOpSegment::debugShowActiveSpans id=17 (401.640991,587.812988 401.031982,588.750977 400.781982,589.898987 401.031982,591.078979) t=0 tEnd=1 windSum=? windValue=1
|
| 125 | SkOpSegment::debugShowActiveSpans id=18 (401.031982,591.078979 397.47699,591.836975) t=0 tEnd=1 windSum=? windValue=1
|
| 126 | SkOpSegment::debugShowActiveSpans id=19 (397.47699,591.836975 397.47691,591.836597 397.476826,591.836193 397.476746,591.835815) t=0 tEnd=8.74738929e-05 windSum=? windValue=1
|
| 127 | SkOpSegment::debugShowActiveSpans id=19 (397.476746,591.835815 396.563464,587.516202 399.305371,583.289897 403.625,582.367981) t=8.74738929e-05 tEnd=1 windSum=? windValue=1
|
| 128 | SkOpSegment::debugShowActiveSpans id=20 (403.625,582.367981 404.382996,585.921997) t=0 tEnd=1 windSum=? windValue=1
|
| 129 | SkOpSegment::debugShowActiveSpans id=6 (406.195007,594.429993 407.375,594.179993 408.320007,593.484985 408.929016,592.546997) t=0 tEnd=1 windSum=? windValue=1
|
| 130 | SkOpSegment::debugShowActiveSpans id=7 (408.929016,592.546997 409.538025,591.60199 409.788025,590.453003 409.538025,589.273987) t=0 tEnd=1 windSum=? windValue=1
|
| 131 | SkOpSegment::debugShowActiveSpans id=8 (409.538025,589.273987 409.539154,589.273743) t=0 tEnd=0.000318097039 windSum=? windValue=1
|
| 132 | SkOpSegment::debugShowActiveSpans id=8 (409.539154,589.273743 413.100037,588.515991) t=0.000318097039 tEnd=1 windSum=? windValue=1
|
| 133 | SkOpSegment::debugShowActiveSpans id=9 (413.100037,588.515991 414.006042,592.835999 411.272034,597.062988 406.944031,597.984985) t=0 tEnd=1 windSum=? windValue=1
|
| 134 | SkOpSegment::debugShowActiveSpans id=10 (406.944031,597.984985 406.195007,594.429993) t=0 tEnd=1 windSum=? windValue=1
|
| 135 | SkOpSegment::debugShowActiveSpans id=11 (401.031006,591.078003 401.031088,591.07838 401.031167,591.078785 401.03125,591.079163) t=0 tEnd=0.000319790508 windSum=? windValue=1
|
| 136 | SkOpSegment::debugShowActiveSpans id=11 (401.03125,591.079163 401.289442,592.258633 401.984306,593.211193 402.914001,593.820007) t=0.000319790508 tEnd=1 windSum=? windValue=1
|
| 137 | SkOpSegment::debugShowActiveSpans id=12 (402.914001,593.820007 403.859009,594.429016 405.015991,594.679016 406.195007,594.429016) t=0 tEnd=1 windSum=? windValue=1
|
| 138 | SkOpSegment::debugShowActiveSpans id=13 (406.195007,594.429016 406.945007,597.984009) t=0 tEnd=1 windSum=? windValue=1
|
| 139 | SkOpSegment::debugShowActiveSpans id=14 (406.945007,597.984009 406.94463,597.984009 406.944255,597.984253 406.943878,597.984253) t=0 tEnd=8.73365293e-05 windSum=? windValue=1
|
| 140 | SkOpSegment::debugShowActiveSpans id=14 (406.943878,597.984253 402.624264,598.897536 398.39793,596.155629 397.476013,591.835999) t=8.73365293e-05 tEnd=1 windSum=? windValue=1
|
| 141 | SkOpSegment::debugShowActiveSpans id=15 (397.476013,591.835999 401.031006,591.078003) t=0 tEnd=1 windSum=? windValue=1
|
Cary Clark | ff11428 | 2016-12-14 11:56:16 -0500 | [diff] [blame] | 142 | ------------------x--x---------------- move_multiples
|
Cary Clark | ab2d73b | 2016-12-16 17:17:25 -0500 | [diff] [blame^] | 143 | 00: seg/base=20/39 seg/base=3/5 MarkCoinStart
|
| 144 | 01: seg/base=20/40 seg/base=3/41 MarkCoinEnd
|
Cary Clark | ff11428 | 2016-12-14 11:56:16 -0500 | [diff] [blame] | 145 | ------------------x--x---------------- move_nearby
|
Cary Clark | ab2d73b | 2016-12-16 17:17:25 -0500 | [diff] [blame^] | 146 | 00: seg/base=20/39 seg/base=3/5 MarkCoinStart
|
| 147 | 01: seg/base=20/40 seg/base=3/41 MarkCoinEnd
|
Cary Clark | ff11428 | 2016-12-14 11:56:16 -0500 | [diff] [blame] | 148 | ------------------x--x---------------- correctEnds
|
Cary Clark | ab2d73b | 2016-12-16 17:17:25 -0500 | [diff] [blame^] | 149 | 00: seg/base=20/39 seg/base=3/5 MarkCoinStart
|
| 150 | 01: seg/base=20/40 seg/base=3/41 MarkCoinEnd
|
Cary Clark | ff11428 | 2016-12-14 11:56:16 -0500 | [diff] [blame] | 151 | ------------------x--x---------------- addEndMovedSpans
|
Cary Clark | ab2d73b | 2016-12-16 17:17:25 -0500 | [diff] [blame^] | 152 | 00: seg/base=20/39 seg/base=3/5 MarkCoinStart
|
| 153 | 01: seg/base=20/40 seg/base=3/41 MarkCoinEnd
|
Cary Clark | ff11428 | 2016-12-14 11:56:16 -0500 | [diff] [blame] | 154 | ------------------x--x---------------- expand
|
Cary Clark | ab2d73b | 2016-12-16 17:17:25 -0500 | [diff] [blame^] | 155 | 00: seg/base=20/39 seg/base=3/5 MarkCoinStart
|
| 156 | 01: seg/base=20/40 seg/base=3/41 MarkCoinEnd
|
Cary Clark | ff11428 | 2016-12-14 11:56:16 -0500 | [diff] [blame] | 157 | ------------------x--x---------------- addExpanded
|
Cary Clark | ab2d73b | 2016-12-16 17:17:25 -0500 | [diff] [blame^] | 158 | 00: seg/base=20/39 seg/base=3/5 MarkCoinStart
|
| 159 | 01: seg/base=20/40 seg/base=3/41 MarkCoinEnd
|
Cary Clark | ff11428 | 2016-12-14 11:56:16 -0500 | [diff] [blame] | 160 | ------------------x--x---------------- mark
|
Cary Clark | ab2d73b | 2016-12-16 17:17:25 -0500 | [diff] [blame^] | 161 | 00: seg/base=20/39 seg/base=3/5 MarkCoinStart
|
| 162 | 01: seg/base=20/40 seg/base=3/41 MarkCoinEnd
|
Cary Clark | ff11428 | 2016-12-14 11:56:16 -0500 | [diff] [blame] | 163 | -------------------------------------- missing_coincidence
|
| 164 | -------------------------------------- expand
|
| 165 | -------------------------------------- expand
|
| 166 | -------------------------------------- apply
|
Cary Clark | ab2d73b | 2016-12-16 17:17:25 -0500 | [diff] [blame^] | 167 | SkOpSegment::markDone id=20 (403.625,582.367981 404.382996,585.921997) t=0 [39] (403.625,582.367981) tEnd=1 newWindSum=? newOppSum=? oppSum=? windSum=? windValue=0 oppValue=0
|
| 168 | SkOpSegment::markDone id=3 (404.382996,585.921021 403.625,582.366028) t=0 [5] (404.382996,585.921021) tEnd=0.999474488 newWindSum=? newOppSum=? oppSum=? windSum=? windValue=0 oppValue=0
|
Cary Clark | ff11428 | 2016-12-14 11:56:16 -0500 | [diff] [blame] | 169 | -------------------------------------- findOverlaps
|
Cary Clark | ab2d73b | 2016-12-16 17:17:25 -0500 | [diff] [blame^] | 170 | SkOpSegment::debugShowActiveSpans id=1 (409.539001,589.27301 409.296997,588.085022 408.593994,587.140015 407.664001,586.52301) t=0 tEnd=1 windSum=? windValue=1
|
| 171 | SkOpSegment::debugShowActiveSpans id=2 (407.664001,586.52301 406.718994,585.914001 405.562012,585.671021 404.382996,585.921021) t=0 tEnd=1 windSum=? windValue=1
|
| 172 | SkOpSegment::debugShowActiveSpans id=3 (403.625397,582.36792 403.625,582.366028) t=0.999474488 tEnd=1 windSum=? windValue=1
|
| 173 | SkOpSegment::debugShowActiveSpans id=4 (403.625,582.366028 407.953003,581.452026 412.179993,584.202026 413.10199,588.514038) t=0 tEnd=1 windSum=? windValue=1
|
| 174 | SkOpSegment::debugShowActiveSpans id=5 (413.10199,588.514038 409.539001,589.27301) t=0 tEnd=1 windSum=? windValue=1
|
| 175 | SkOpSegment::debugShowActiveSpans id=16 (404.382996,585.921997 403.203003,586.171997 402.25,586.867004 401.640991,587.812988) t=0 tEnd=1 windSum=? windValue=1
|
| 176 | SkOpSegment::debugShowActiveSpans id=17 (401.640991,587.812988 401.031982,588.750977 400.781982,589.898987 401.031982,591.078979) t=0 tEnd=1 windSum=? windValue=1
|
| 177 | SkOpSegment::debugShowActiveSpans id=18 (401.031982,591.078979 397.47699,591.836975) t=0 tEnd=1 windSum=? windValue=1
|
| 178 | SkOpSegment::debugShowActiveSpans id=19 (397.47699,591.836975 397.47691,591.836597 397.476826,591.836193 397.476746,591.835815) t=0 tEnd=8.74738929e-05 windSum=? windValue=1
|
| 179 | SkOpSegment::debugShowActiveSpans id=19 (397.476746,591.835815 396.563464,587.516202 399.305371,583.289897 403.625,582.367981) t=8.74738929e-05 tEnd=1 windSum=? windValue=1
|
| 180 | SkOpSegment::debugShowActiveSpans id=6 (406.195007,594.429993 407.375,594.179993 408.320007,593.484985 408.929016,592.546997) t=0 tEnd=1 windSum=? windValue=1
|
| 181 | SkOpSegment::debugShowActiveSpans id=7 (408.929016,592.546997 409.538025,591.60199 409.788025,590.453003 409.538025,589.273987) t=0 tEnd=1 windSum=? windValue=1
|
| 182 | SkOpSegment::debugShowActiveSpans id=8 (409.538025,589.273987 409.539154,589.273743) t=0 tEnd=0.000318097039 windSum=? windValue=1
|
| 183 | SkOpSegment::debugShowActiveSpans id=8 (409.539154,589.273743 413.100037,588.515991) t=0.000318097039 tEnd=1 windSum=? windValue=1
|
| 184 | SkOpSegment::debugShowActiveSpans id=9 (413.100037,588.515991 414.006042,592.835999 411.272034,597.062988 406.944031,597.984985) t=0 tEnd=1 windSum=? windValue=1
|
| 185 | SkOpSegment::debugShowActiveSpans id=10 (406.944031,597.984985 406.195007,594.429993) t=0 tEnd=1 windSum=? windValue=1
|
| 186 | SkOpSegment::debugShowActiveSpans id=11 (401.031006,591.078003 401.031088,591.07838 401.031167,591.078785 401.03125,591.079163) t=0 tEnd=0.000319790508 windSum=? windValue=1
|
| 187 | SkOpSegment::debugShowActiveSpans id=11 (401.03125,591.079163 401.289442,592.258633 401.984306,593.211193 402.914001,593.820007) t=0.000319790508 tEnd=1 windSum=? windValue=1
|
| 188 | SkOpSegment::debugShowActiveSpans id=12 (402.914001,593.820007 403.859009,594.429016 405.015991,594.679016 406.195007,594.429016) t=0 tEnd=1 windSum=? windValue=1
|
| 189 | SkOpSegment::debugShowActiveSpans id=13 (406.195007,594.429016 406.945007,597.984009) t=0 tEnd=1 windSum=? windValue=1
|
| 190 | SkOpSegment::debugShowActiveSpans id=14 (406.945007,597.984009 406.94463,597.984009 406.944255,597.984253 406.943878,597.984253) t=0 tEnd=8.73365293e-05 windSum=? windValue=1
|
| 191 | SkOpSegment::debugShowActiveSpans id=14 (406.943878,597.984253 402.624264,598.897536 398.39793,596.155629 397.476013,591.835999) t=8.73365293e-05 tEnd=1 windSum=? windValue=1
|
| 192 | SkOpSegment::debugShowActiveSpans id=15 (397.476013,591.835999 401.031006,591.078003) t=0 tEnd=1 windSum=? windValue=1
|
Cary Clark | ff11428 | 2016-12-14 11:56:16 -0500 | [diff] [blame] | 193 | -------------------------------------- calc_angles
|
Cary Clark | ab2d73b | 2016-12-16 17:17:25 -0500 | [diff] [blame^] | 194 | SkOpSegment::sortAngles [1] tStart=0 [1]
|
| 195 | SkOpAngle::after [1/1] 9/9 tStart=0 tEnd=1 < [8/13] 1/1 tStart=0.000318097039 tEnd=1 < [8/12] 17/17 tStart=0.000318097039 tEnd=0 F 4
|
| 196 | SkOpAngle::afterPart {{{409.539154,589.273743}, {409.29715,588.085754}, {408.594147,587.140747}, {407.664154,586.523743}}} id=1
|
| 197 | SkOpAngle::afterPart {{{409.539154,589.273743}, {413.100037,588.515991}}} id=8
|
| 198 | SkOpAngle::afterPart {{{409.539154,589.273743}, {409.538025,589.273987}}} id=8
|
| 199 | SkOpAngle::after [1/1] 9/9 tStart=0 tEnd=1 < [5/4] 1/1 tStart=1 tEnd=0 < [8/12] 17/17 tStart=0.000318097039 tEnd=0 F 4
|
| 200 | SkOpAngle::afterPart {{{409.539001,589.27301}, {409.296997,588.085022}, {408.593994,587.140015}, {407.664001,586.52301}}} id=1
|
| 201 | SkOpAngle::afterPart {{{409.539001,589.27301}, {413.10199,588.514038}}} id=5
|
| 202 | SkOpAngle::afterPart {{{409.539001,589.27301}, {409.537872,589.273254}}} id=8
|
| 203 | SkOpAngle::after [8/12] 17/17 tStart=0.000318097039 tEnd=0 < [5/4] 1/1 tStart=1 tEnd=0 < [8/13] 1/1 tStart=0.000318097039 tEnd=1 F 11
|
| 204 | SkOpAngle::afterPart {{{409.539001,589.27301}, {409.537872,589.273254}}} id=8
|
| 205 | SkOpAngle::afterPart {{{409.539001,589.27301}, {413.10199,588.514038}}} id=5
|
| 206 | SkOpAngle::afterPart {{{409.539001,589.27301}, {413.099884,588.515259}}} id=8
|
| 207 | SkOpAngle::after [8/13] 1/1 tStart=0.000318097039 tEnd=1 < [5/4] 1/1 tStart=1 tEnd=0 < [1/1] 9/9 tStart=0 tEnd=1 T 7
|
| 208 | SkOpAngle::afterPart {{{409.539001,589.27301}, {413.099884,588.515259}}} id=8
|
| 209 | SkOpAngle::afterPart {{{409.539001,589.27301}, {413.10199,588.514038}}} id=5
|
| 210 | SkOpAngle::afterPart {{{409.539001,589.27301}, {409.296997,588.085022}, {408.593994,587.140015}, {407.664001,586.52301}}} id=1
|
| 211 | SkOpSegment::sortAngles [2] tStart=1 [4]
|
| 212 | SkOpSegment::sortAngles [3] tStart=0.999474488 [41]
|
Cary Clark | ff11428 | 2016-12-14 11:56:16 -0500 | [diff] [blame] | 213 | SkOpSegment::sortAngles [5] tStart=1 [10]
|
Cary Clark | ab2d73b | 2016-12-16 17:17:25 -0500 | [diff] [blame^] | 214 | SkOpSegment::sortAngles [16] tStart=0 [31]
|
| 215 | SkOpSegment::sortAngles [17] tStart=1 [34]
|
| 216 | SkOpAngle::after [17/6] 9/5 tStart=1 tEnd=0 < [11/17] 9/9 tStart=0.000319790508 tEnd=0 < [18/7] 17/17 tStart=0 tEnd=1 T 7
|
| 217 | SkOpAngle::afterPart {{{401.03125,591.079163}, {400.78125,589.89917}, {401.03125,588.75116}, {401.640259,587.813171}}} id=17
|
| 218 | SkOpAngle::afterPart {{{401.03125,591.079163}, {401.031006,591.078003}, {401.031088,591.07838}, {401.031006,591.078003}}} id=11
|
| 219 | SkOpAngle::afterPart {{{401.03125,591.079163}, {397.476257,591.837158}}} id=18
|
| 220 | SkOpAngle::after [17/6] 9/5 tStart=1 tEnd=0 < [11/18] 25/25 tStart=0.000319790508 tEnd=1 < [11/17] 9/9 tStart=0.000319790508 tEnd=0 F 5
|
| 221 | SkOpAngle::afterPart {{{401.03125,591.079163}, {400.78125,589.89917}, {401.03125,588.75116}, {401.640259,587.813171}}} id=17
|
| 222 | SkOpAngle::afterPart {{{401.03125,591.079163}, {401.289442,592.258633}, {401.984306,593.211193}, {402.914001,593.820007}}} id=11
|
| 223 | SkOpAngle::afterPart {{{401.03125,591.079163}, {401.031006,591.078003}, {401.031088,591.07838}, {401.031006,591.078003}}} id=11
|
| 224 | SkOpAngle::after [11/17] 9/9 tStart=0.000319790508 tEnd=0 < [11/18] 25/25 tStart=0.000319790508 tEnd=1 < [18/7] 17/17 tStart=0 tEnd=1 F 4
|
| 225 | SkOpAngle::afterPart {{{401.03125,591.079163}, {401.031006,591.078003}, {401.031088,591.07838}, {401.031006,591.078003}}} id=11
|
| 226 | SkOpAngle::afterPart {{{401.03125,591.079163}, {401.289442,592.258633}, {401.984306,593.211193}, {402.914001,593.820007}}} id=11
|
| 227 | SkOpAngle::afterPart {{{401.03125,591.079163}, {397.476257,591.837158}}} id=18
|
| 228 | SkOpAngle::after [18/7] 17/17 tStart=0 tEnd=1 < [11/18] 25/25 tStart=0.000319790508 tEnd=1 < [17/6] 9/5 tStart=1 tEnd=0 T 4
|
| 229 | SkOpAngle::afterPart {{{401.03125,591.079163}, {397.476257,591.837158}}} id=18
|
| 230 | SkOpAngle::afterPart {{{401.03125,591.079163}, {401.289442,592.258633}, {401.984306,593.211193}, {402.914001,593.820007}}} id=11
|
| 231 | SkOpAngle::afterPart {{{401.03125,591.079163}, {400.78125,589.89917}, {401.03125,588.75116}, {401.640259,587.813171}}} id=17
|
| 232 | SkOpSegment::sortAngles [18] tStart=0 [35]
|
| 233 | SkOpSegment::sortAngles [19] tStart=8.74738929e-05 [44]
|
| 234 | SkOpAngle::after [19/8] 25/25 tStart=8.74738929e-05 tEnd=0 < [14/23] 25/29 tStart=1 tEnd=8.73365293e-05 < [19/9] 9/5 tStart=8.74738929e-05 tEnd=1 T 12
|
| 235 | SkOpAngle::afterPart {{{397.476013,591.835999}, {397.476257,591.837158}, {397.476177,591.83678}, {397.476257,591.837158}}} id=19
|
| 236 | SkOpAngle::afterPart {{{397.476013,591.835999}, {398.39793,596.155629}, {402.624264,598.897536}, {406.943878,597.984253}}} id=14
|
| 237 | SkOpAngle::afterPart {{{397.476013,591.835999}, {396.562731,587.516385}, {399.304638,583.29008}, {403.624268,582.368164}}} id=19
|
| 238 | SkOpAngle::after [19/8] 25/25 tStart=8.74738929e-05 tEnd=0 < [15/24] 1/1 tStart=0 tEnd=1 < [14/23] 25/29 tStart=1 tEnd=8.73365293e-05 F 5
|
| 239 | SkOpAngle::afterPart {{{397.476013,591.835999}, {397.476257,591.837158}, {397.476177,591.83678}, {397.476257,591.837158}}} id=19
|
| 240 | SkOpAngle::afterPart {{{397.476013,591.835999}, {401.031006,591.078003}}} id=15
|
| 241 | SkOpAngle::afterPart {{{397.476013,591.835999}, {398.39793,596.155629}, {402.624264,598.897536}, {406.943878,597.984253}}} id=14
|
| 242 | SkOpAngle::after [14/23] 25/29 tStart=1 tEnd=8.73365293e-05 < [15/24] 1/1 tStart=0 tEnd=1 < [19/9] 9/5 tStart=8.74738929e-05 tEnd=1 T 4
|
| 243 | SkOpAngle::afterPart {{{397.476013,591.835999}, {398.39793,596.155629}, {402.624264,598.897536}, {406.943878,597.984253}}} id=14
|
| 244 | SkOpAngle::afterPart {{{397.476013,591.835999}, {401.031006,591.078003}}} id=15
|
| 245 | SkOpAngle::afterPart {{{397.476013,591.835999}, {396.562731,587.516385}, {399.304638,583.29008}, {403.624268,582.368164}}} id=19
|
| 246 | SkOpSegment::sortAngles [19] tStart=1 [38]
|
| 247 | SkOpSegment::sortAngles [6] tStart=0 [11]
|
| 248 | SkOpAngle::after [6/11] 1/1 tStart=0 tEnd=1 < [13/20] 25/25 tStart=0 tEnd=1 < [12/19] 17/13 tStart=1 tEnd=0 F 4
|
| 249 | SkOpAngle::afterPart {{{406.195007,594.429016}, {407.375,594.179016}, {408.320007,593.484009}, {408.929016,592.546021}}} id=6
|
| 250 | SkOpAngle::afterPart {{{406.195007,594.429016}, {406.945007,597.984009}}} id=13
|
| 251 | SkOpAngle::afterPart {{{406.195007,594.429016}, {405.015991,594.679016}, {403.859009,594.429016}, {402.914001,593.820007}}} id=12
|
| 252 | SkOpAngle::after [6/11] 1/1 tStart=0 tEnd=1 < [10/16] 25/25 tStart=1 tEnd=0 < [12/19] 17/13 tStart=1 tEnd=0 F 4
|
| 253 | SkOpAngle::afterPart {{{406.195007,594.429993}, {407.375,594.179993}, {408.320007,593.484985}, {408.929016,592.546997}}} id=6
|
| 254 | SkOpAngle::afterPart {{{406.195007,594.429993}, {406.944031,597.984985}}} id=10
|
| 255 | SkOpAngle::afterPart {{{406.195007,594.429993}, {405.015991,594.679993}, {403.859009,594.429993}, {402.914001,593.820984}}} id=12
|
| 256 | SkOpAngle::after [12/19] 17/13 tStart=1 tEnd=0 < [10/16] 25/25 tStart=1 tEnd=0 < [13/20] 25/25 tStart=0 tEnd=1 T 7
|
| 257 | SkOpAngle::afterPart {{{406.195007,594.429993}, {405.015991,594.679993}, {403.859009,594.429993}, {402.914001,593.820984}}} id=12
|
| 258 | SkOpAngle::afterPart {{{406.195007,594.429993}, {406.944031,597.984985}}} id=10
|
| 259 | SkOpAngle::afterPart {{{406.195007,594.429993}, {406.945007,597.984985}}} id=13
|
| 260 | SkOpSegment::sortAngles [8] tStart=0.000318097039 [42]
|
| 261 | SkOpSegment::sortAngles [9] tStart=1 [18]
|
| 262 | SkOpAngle::after [9/14] 1/5 tStart=1 tEnd=0 < [14/21] 31/31 tStart=8.73365293e-05 tEnd=0 < [10/15] 9/9 tStart=0 tEnd=1 F 4
|
| 263 | SkOpAngle::afterPart {{{406.943878,597.984253}, {411.271881,597.062256}, {414.00589,592.835266}, {413.099884,588.515259}}} id=9
|
| 264 | SkOpAngle::afterPart {{{406.943878,597.984253}, {406.945007,597.984009}, {406.94463,597.984009}, {406.945007,597.984009}}} id=14
|
| 265 | SkOpAngle::afterPart {{{406.943878,597.984253}, {406.194855,594.42926}}} id=10
|
| 266 | SkOpAngle::after [9/14] 1/5 tStart=1 tEnd=0 < [14/22] 17/13 tStart=8.73365293e-05 tEnd=1 < [10/15] 9/9 tStart=0 tEnd=1 F 4
|
| 267 | SkOpAngle::afterPart {{{406.943878,597.984253}, {411.271881,597.062256}, {414.00589,592.835266}, {413.099884,588.515259}}} id=9
|
| 268 | SkOpAngle::afterPart {{{406.943878,597.984253}, {402.624264,598.897536}, {398.39793,596.155629}, {397.476013,591.835999}}} id=14
|
| 269 | SkOpAngle::afterPart {{{406.943878,597.984253}, {406.194855,594.42926}}} id=10
|
| 270 | SkOpAngle::after [10/15] 9/9 tStart=0 tEnd=1 < [14/22] 17/13 tStart=8.73365293e-05 tEnd=1 < [14/21] 31/31 tStart=8.73365293e-05 tEnd=0 T 4
|
| 271 | SkOpAngle::afterPart {{{406.943878,597.984253}, {406.194855,594.42926}}} id=10
|
| 272 | SkOpAngle::afterPart {{{406.943878,597.984253}, {402.624264,598.897536}, {398.39793,596.155629}, {397.476013,591.835999}}} id=14
|
| 273 | SkOpAngle::afterPart {{{406.943878,597.984253}, {406.945007,597.984009}, {406.94463,597.984009}, {406.945007,597.984009}}} id=14
|
Cary Clark | ff11428 | 2016-12-14 11:56:16 -0500 | [diff] [blame] | 274 | SkOpSegment::sortAngles [10] tStart=0 [19]
|
| 275 | SkOpSegment::sortAngles [10] tStart=1 [20]
|
Cary Clark | ab2d73b | 2016-12-16 17:17:25 -0500 | [diff] [blame^] | 276 | SkOpSegment::sortAngles [11] tStart=0.000319790508 [43]
|
Cary Clark | ff11428 | 2016-12-14 11:56:16 -0500 | [diff] [blame] | 277 | SkOpSegment::sortAngles [12] tStart=1 [24]
|
Cary Clark | ab2d73b | 2016-12-16 17:17:25 -0500 | [diff] [blame^] | 278 | SkOpSegment::sortAngles [13] tStart=0 [25]
|
| 279 | SkOpSegment::sortAngles [14] tStart=8.73365293e-05 [45]
|
| 280 | SkOpSegment::sortAngles [14] tStart=1 [28]
|
| 281 | SkOpSegment::sortAngles [15] tStart=0 [29]
|
| 282 | coinSpan - id=20 t=0 tEnd=1
|
| 283 | coinSpan + id=3 t=0.999474488 tEnd=0
|
| 284 | SkOpSpan::sortableTop dir=kLeft seg=1 t=0.5 pt=(408.859497,587.683899)
|
| 285 | SkOpSpan::sortableTop [0] valid=1 operand=0 span=44 ccw=1 seg=19 {{{397.47699f, 591.836975f}, {396.562988f, 587.516968f}, {399.304993f, 583.289978f}, {403.625f, 582.367981f}}} t=0.33188452 pt=(397.699097,587.683899) slope=(3.85156666,-11.7134239)
|
| 286 | SkOpSpan::sortableTop [1] valid=1 operand=0 span=31 ccw=0 seg=16 {{{404.382996f, 585.921997f}, {403.203003f, 586.171997f}, {402.25f, 586.867004f}, {401.640991f, 587.812988f}}} t=0.953943751 pt=(401.727325,587.683899) slope=(-1.92134028,2.7673627)
|
| 287 | SkOpSpan::sortableTop [2] valid=1 operand=0 span=1 ccw=1 seg=1 {{{409.539001f, 589.27301f}, {409.296997f, 588.085022f}, {408.593994f, 587.140015f}, {407.664001f, 586.52301f}}} t=0.5 pt=(408.859497,587.683899) slope=(-1.9335022,-2.77125549)
|
| 288 | SkOpSegment::markWinding id=19 (397.47699,591.836975 396.562988,587.516968 399.304993,583.289978 403.625,582.367981) t=8.74738929e-05 [44] (397.476746,591.835815) tEnd=1 newWindSum=-1 newOppSum=0 oppSum=0 windSum=-1 windValue=1 oppValue=0
|
| 289 | SkOpSegment::nextChase mismatched signs
|
| 290 | SkOpSegment::markWinding id=3 (404.382996,585.921021 403.625,582.366028) t=0.999474488 [41] (403.625397,582.36792) tEnd=1 newWindSum=-1 newOppSum=0 oppSum=? windSum=? windValue=1 oppValue=0
|
| 291 | SkOpSegment::markWinding id=4 (403.625,582.366028 407.953003,581.452026 412.179993,584.202026 413.10199,588.514038) t=0 [7] (403.625,582.366028) tEnd=1 newWindSum=-1 newOppSum=0 oppSum=? windSum=? windValue=1 oppValue=0
|
| 292 | SkOpSegment::markWinding id=5 (413.10199,588.514038 409.539001,589.27301) t=0 [9] (413.10199,588.514038) tEnd=1 newWindSum=-1 newOppSum=0 oppSum=? windSum=? windValue=1 oppValue=0
|
| 293 | SkOpSegment::markWinding id=19 (397.47699,591.836975 396.562988,587.516968 399.304993,583.289978 403.625,582.367981) t=8.74738929e-05 [44] (397.476746,591.835815) tEnd=1 newWindSum=-1 newOppSum=0 oppSum=0 windSum=-1 windValue=1 oppValue=0
|
| 294 | SkOpSegment::markWinding id=16 (404.382996,585.921997 403.203003,586.171997 402.25,586.867004 401.640991,587.812988) t=0 [31] (404.382996,585.921997) tEnd=1 newWindSum=-1 newOppSum=0 oppSum=0 windSum=-1 windValue=1 oppValue=0
|
| 295 | SkOpSegment::markWinding id=17 (401.640991,587.812988 401.031982,588.750977 400.781982,589.898987 401.031982,591.078979) t=0 [33] (401.640991,587.812988) tEnd=1 newWindSum=-1 newOppSum=0 oppSum=? windSum=? windValue=1 oppValue=0
|
| 296 | SkOpSegment::markWinding id=16 (404.382996,585.921997 403.203003,586.171997 402.25,586.867004 401.640991,587.812988) t=0 [31] (404.382996,585.921997) tEnd=1 newWindSum=-1 newOppSum=0 oppSum=0 windSum=-1 windValue=1 oppValue=0
|
| 297 | SkOpSegment::nextChase mismatched signs
|
| 298 | SkOpSegment::markWinding id=2 (407.664001,586.52301 406.718994,585.914001 405.562012,585.671021 404.382996,585.921021) t=0 [3] (407.664001,586.52301) tEnd=1 newWindSum=-1 newOppSum=0 oppSum=? windSum=? windValue=1 oppValue=0
|
| 299 | SkOpSegment::markWinding id=1 (409.539001,589.27301 409.296997,588.085022 408.593994,587.140015 407.664001,586.52301) t=0 [1] (409.539001,589.27301) tEnd=1 newWindSum=-1 newOppSum=0 oppSum=? windSum=? windValue=1 oppValue=0
|
| 300 | SkOpSegment::markWinding id=8 (409.538025,589.273987 413.100037,588.515991) t=0 [15] (409.538025,589.273987) tEnd=0.000318097039 newWindSum=-1 windSum=? windValue=1
|
| 301 | SkOpSegment::markWinding id=7 (408.929016,592.546997 409.538025,591.60199 409.788025,590.453003 409.538025,589.273987) t=0 [13] (408.929016,592.546997) tEnd=1 newWindSum=-1 windSum=? windValue=1
|
| 302 | SkOpSegment::markWinding id=6 (406.195007,594.429993 407.375,594.179993 408.320007,593.484985 408.929016,592.546997) t=0 [11] (406.195007,594.429993) tEnd=1 newWindSum=-1 windSum=? windValue=1
|
| 303 | SkOpSegment::markAngle last seg=6 span=11 windSum=-1
|
| 304 | SkOpSegment::markWinding id=8 (409.538025,589.273987 413.100037,588.515991) t=0.000318097039 [42] (409.539154,589.273743) tEnd=1 newWindSum=-1 windSum=? windValue=1
|
| 305 | SkOpSegment::markWinding id=9 (413.100037,588.515991 414.006042,592.835999 411.272034,597.062988 406.944031,597.984985) t=0 [17] (413.100037,588.515991) tEnd=1 newWindSum=-1 windSum=? windValue=1
|
| 306 | SkOpSegment::markAngle last seg=9 span=18
|
| 307 | SkOpSegment::findNextWinding
|
| 308 | SkOpAngle::dumpOne [1/1] next=8/12 sect=9/9 s=0 [1] e=1 [2] sgn=-1 windVal=1 windSum=-1 oppVal=0 oppSum=0
|
| 309 | SkOpAngle::dumpOne [8/12] next=8/13 sect=17/17 s=0.000318097039 [42] e=0 [15] sgn=1 windVal=1 windSum=-1
|
| 310 | SkOpAngle::dumpOne [8/13] next=5/4 sect=1/1 s=0.000318097039 [42] e=1 [16] sgn=-1 windVal=1 windSum=-1
|
| 311 | SkOpAngle::dumpOne [5/4] next=1/1 sect=1/1 s=1 [10] e=0 [9] sgn=1 windVal=1 windSum=-1 oppVal=0 oppSum=0
|
| 312 | SkOpSegment::findNextWinding chase.append segment=6 span=11 windSum=-1
|
| 313 | SkOpSegment::findNextWinding chase.append segment=9 span=18
|
| 314 | SkOpSegment::markDone id=1 (409.539001,589.27301 409.296997,588.085022 408.593994,587.140015 407.664001,586.52301) t=0 [1] (409.539001,589.27301) tEnd=1 newWindSum=-1 newOppSum=0 oppSum=0 windSum=-1 windValue=1 oppValue=0
|
| 315 | SkOpSegment::findNextWinding from:[1] to:[8] start=4291816 end=4286928
|
| 316 | bridgeWinding current id=1 from=(407.664001,586.52301) to=(409.539001,589.27301)
|
| 317 | path.moveTo(407.664001,586.52301);
|
| 318 | path.cubicTo(408.593994,587.140015, 409.296997,588.085022, 409.539001,589.27301);
|
| 319 | SkOpSegment::findNextWinding simple
|
| 320 | SkOpSegment::markDone id=8 (409.538025,589.273987 413.100037,588.515991) t=0 [15] (409.538025,589.273987) tEnd=0.000318097039 newWindSum=-1 newOppSum=? oppSum=? windSum=-1 windValue=1 oppValue=0
|
| 321 | bridgeWinding current id=8 from=(409.539154,589.273743) to=(409.538025,589.273987)
|
| 322 | SkOpSegment::findNextWinding simple
|
| 323 | SkOpSegment::markDone id=7 (408.929016,592.546997 409.538025,591.60199 409.788025,590.453003 409.538025,589.273987) t=0 [13] (408.929016,592.546997) tEnd=1 newWindSum=-1 newOppSum=? oppSum=? windSum=-1 windValue=1 oppValue=0
|
| 324 | bridgeWinding current id=7 from=(409.538025,589.273987) to=(408.929016,592.546997)
|
| 325 | path.lineTo(409.538025,589.273987);
|
| 326 | path.cubicTo(409.788025,590.453003, 409.538025,591.60199, 408.929016,592.546997);
|
| 327 | SkOpSegment::markWinding id=12 (402.914001,593.820007 403.859009,594.429016 405.015991,594.679016 406.195007,594.429016) t=0 [23] (402.914001,593.820007) tEnd=1 newWindSum=-1 windSum=? windValue=1
|
| 328 | SkOpSegment::markWinding id=11 (401.031006,591.078003 401.289001,592.257996 401.984009,593.210999 402.914001,593.820007) t=0.000319790508 [43] (401.03125,591.079163) tEnd=1 newWindSum=-1 windSum=? windValue=1
|
| 329 | SkOpSegment::markAngle last seg=11 span=43 windSum=-1
|
| 330 | SkOpSegment::markWinding id=10 (406.944031,597.984985 406.195007,594.429993) t=0 [19] (406.944031,597.984985) tEnd=1 newWindSum=-2 windSum=? windValue=1
|
| 331 | SkOpSegment::markAngle last seg=10 span=19 windSum=-2
|
| 332 | SkOpSegment::markWinding id=13 (406.195007,594.429016 406.945007,597.984009) t=0 [25] (406.195007,594.429016) tEnd=1 newWindSum=-2 windSum=? windValue=1
|
| 333 | SkOpSegment::markWinding id=14 (406.945007,597.984009 402.625,598.89801 398.39801,596.156006 397.476013,591.835999) t=0 [27] (406.945007,597.984009) tEnd=8.73365293e-05 newWindSum=-2 windSum=? windValue=1
|
| 334 | SkOpSegment::markAngle last seg=14 span=45 windSum=?
|
| 335 | SkOpSegment::findNextWinding
|
| 336 | SkOpAngle::dumpOne [6/11] next=12/19 sect=1/1 s=0 [11] e=1 [12] sgn=-1 windVal=1 windSum=-1
|
| 337 | SkOpAngle::dumpOne [12/19] next=10/16 sect=17/13 s=1 [24] e=0 [23] sgn=1 windVal=1 windSum=-1
|
| 338 | SkOpAngle::dumpOne [10/16] next=13/20 sect=25/25 s=1 [20] e=0 [19] sgn=1 windVal=1 windSum=-2
|
| 339 | SkOpAngle::dumpOne [13/20] next=6/11 sect=25/25 s=0 [25] e=1 [26] sgn=-1 windVal=1 windSum=-2
|
| 340 | SkOpSegment::findNextWinding chase.append segment=11 span=43 windSum=-1
|
| 341 | SkOpSegment::markDone id=10 (406.944031,597.984985 406.195007,594.429993) t=0 [19] (406.944031,597.984985) tEnd=1 newWindSum=-2 newOppSum=? oppSum=? windSum=-2 windValue=1 oppValue=0
|
| 342 | SkOpSegment::findNextWinding chase.append segment=10 span=19 windSum=-2
|
| 343 | SkOpSegment::markDone id=13 (406.195007,594.429016 406.945007,597.984009) t=0 [25] (406.195007,594.429016) tEnd=1 newWindSum=-2 newOppSum=? oppSum=? windSum=-2 windValue=1 oppValue=0
|
| 344 | SkOpSegment::markDone id=14 (406.945007,597.984009 402.625,598.89801 398.39801,596.156006 397.476013,591.835999) t=0 [27] (406.945007,597.984009) tEnd=8.73365293e-05 newWindSum=-2 newOppSum=? oppSum=? windSum=-2 windValue=1 oppValue=0
|
| 345 | SkOpSegment::findNextWinding chase.append segment=14 span=45 windSum=-2147483647
|
| 346 | SkOpSegment::markDone id=6 (406.195007,594.429993 407.375,594.179993 408.320007,593.484985 408.929016,592.546997) t=0 [11] (406.195007,594.429993) tEnd=1 newWindSum=-1 newOppSum=? oppSum=? windSum=-1 windValue=1 oppValue=0
|
| 347 | SkOpSegment::findNextWinding from:[6] to:[12] start=4288824 end=4288680
|
| 348 | bridgeWinding current id=6 from=(408.929016,592.546997) to=(406.195007,594.429993)
|
| 349 | path.cubicTo(408.320007,593.484985, 407.375,594.179993, 406.195007,594.429993);
|
| 350 | SkOpSegment::findNextWinding simple
|
| 351 | SkOpSegment::markDone id=12 (402.914001,593.820007 403.859009,594.429016 405.015991,594.679016 406.195007,594.429016) t=0 [23] (402.914001,593.820007) tEnd=1 newWindSum=-1 newOppSum=? oppSum=? windSum=-1 windValue=1 oppValue=0
|
| 352 | bridgeWinding current id=12 from=(406.195007,594.429016) to=(402.914001,593.820007)
|
| 353 | path.cubicTo(405.015991,594.679016, 403.859009,594.429016, 402.914001,593.820007);
|
| 354 | SkOpSegment::markWinding id=11 (401.031006,591.078003 401.289001,592.257996 401.984009,593.210999 402.914001,593.820007) t=0 [21] (401.031006,591.078003) tEnd=0.000319790508 newWindSum=-2 windSum=? windValue=1
|
| 355 | SkOpSegment::markWinding id=15 (397.476013,591.835999 401.031006,591.078003) t=0 [29] (397.476013,591.835999) tEnd=1 newWindSum=-2 windSum=? windValue=1
|
| 356 | SkOpSegment::markAngle last seg=15 span=29 windSum=-2
|
| 357 | SkOpSegment::markWinding id=18 (401.031982,591.078979 397.47699,591.836975) t=0 [35] (401.031982,591.078979) tEnd=1 newWindSum=-2 windSum=? windValue=1
|
| 358 | SkOpSegment::markWinding id=19 (397.47699,591.836975 396.562988,587.516968 399.304993,583.289978 403.625,582.367981) t=0 [37] (397.47699,591.836975) tEnd=8.74738929e-05 newWindSum=-2 windSum=? windValue=1
|
| 359 | SkOpSegment::markAngle last seg=19 span=44 windSum=-1
|
| 360 | SkOpSegment::findNextWinding
|
| 361 | SkOpAngle::dumpOne [11/18] next=17/6 sect=25/25 s=0.000319790508 [43] e=1 [22] sgn=-1 windVal=1 windSum=-1
|
| 362 | SkOpAngle::dumpOne [17/6] next=11/17 sect=9/5 s=1 [34] e=0 [33] sgn=1 windVal=1 windSum=-1 oppVal=0 oppSum=0
|
| 363 | SkOpAngle::dumpOne [11/17] next=18/7 sect=9/9 s=0.000319790508 [43] e=0 [21] sgn=1 windVal=1 windSum=-2
|
| 364 | SkOpAngle::dumpOne [18/7] next=11/18 sect=17/17 s=0 [35] e=1 [36] sgn=-1 windVal=1 windSum=-2
|
| 365 | SkOpSegment::markDone id=11 (401.031006,591.078003 401.289001,592.257996 401.984009,593.210999 402.914001,593.820007) t=0 [21] (401.031006,591.078003) tEnd=0.000319790508 newWindSum=-2 newOppSum=? oppSum=? windSum=-2 windValue=1 oppValue=0
|
| 366 | SkOpSegment::markDone id=15 (397.476013,591.835999 401.031006,591.078003) t=0 [29] (397.476013,591.835999) tEnd=1 newWindSum=-2 newOppSum=? oppSum=? windSum=-2 windValue=1 oppValue=0
|
| 367 | SkOpSegment::findNextWinding chase.append segment=15 span=29 windSum=-2
|
| 368 | SkOpSegment::markDone id=18 (401.031982,591.078979 397.47699,591.836975) t=0 [35] (401.031982,591.078979) tEnd=1 newWindSum=-2 newOppSum=? oppSum=? windSum=-2 windValue=1 oppValue=0
|
| 369 | SkOpSegment::markDone id=19 (397.47699,591.836975 396.562988,587.516968 399.304993,583.289978 403.625,582.367981) t=0 [37] (397.47699,591.836975) tEnd=8.74738929e-05 newWindSum=-2 newOppSum=? oppSum=? windSum=-2 windValue=1 oppValue=0
|
| 370 | SkOpSegment::findNextWinding chase.append segment=19 span=44 windSum=-1
|
| 371 | SkOpSegment::markDone id=11 (401.031006,591.078003 401.289001,592.257996 401.984009,593.210999 402.914001,593.820007) t=0.000319790508 [43] (401.03125,591.079163) tEnd=1 newWindSum=-1 newOppSum=? oppSum=? windSum=-1 windValue=1 oppValue=0
|
| 372 | SkOpSegment::findNextWinding from:[11] to:[17] start=4290488 end=4290344
|
| 373 | bridgeWinding current id=11 from=(402.914001,593.820007) to=(401.03125,591.079163)
|
| 374 | path.cubicTo(401.984314,593.211182, 401.289429,592.258606, 401.03125,591.079163);
|
| 375 | SkOpSegment::findNextWinding simple
|
| 376 | SkOpSegment::markDone id=17 (401.640991,587.812988 401.031982,588.750977 400.781982,589.898987 401.031982,591.078979) t=0 [33] (401.640991,587.812988) tEnd=1 newWindSum=-1 newOppSum=0 oppSum=0 windSum=-1 windValue=1 oppValue=0
|
| 377 | bridgeWinding current id=17 from=(401.031982,591.078979) to=(401.640991,587.812988)
|
| 378 | path.cubicTo(400.781982,589.898987, 401.031982,588.750977, 401.640991,587.812988);
|
| 379 | SkOpSegment::nextChase mismatched signs
|
| 380 | SkOpSegment::findNextWinding simple
|
| 381 | SkOpSegment::markDone id=16 (404.382996,585.921997 403.203003,586.171997 402.25,586.867004 401.640991,587.812988) t=0 [31] (404.382996,585.921997) tEnd=1 newWindSum=-1 newOppSum=0 oppSum=0 windSum=-1 windValue=1 oppValue=0
|
| 382 | bridgeWinding current id=16 from=(401.640991,587.812988) to=(404.382996,585.921997)
|
| 383 | path.cubicTo(402.25,586.867004, 403.203003,586.171997, 404.382996,585.921997);
|
| 384 | SkOpSegment::findNextWinding simple
|
| 385 | SkOpSegment::markDone id=2 (407.664001,586.52301 406.718994,585.914001 405.562012,585.671021 404.382996,585.921021) t=0 [3] (407.664001,586.52301) tEnd=1 newWindSum=-1 newOppSum=0 oppSum=0 windSum=-1 windValue=1 oppValue=0
|
| 386 | bridgeWinding current id=2 from=(404.382996,585.921021) to=(407.664001,586.52301)
|
| 387 | path.cubicTo(405.562012,585.671021, 406.718994,585.914001, 407.664001,586.52301);
|
| 388 | path.close();
|
| 389 | SkOpSegment::markWinding id=19 (397.47699,591.836975 396.562988,587.516968 399.304993,583.289978 403.625,582.367981) t=8.74738929e-05 [44] (397.476746,591.835815) tEnd=1 newWindSum=-1 windSum=-1 windValue=1
|
| 390 | SkOpSegment::nextChase mismatched signs
|
| 391 | SkOpSegment::markWinding id=14 (406.945007,597.984009 402.625,598.89801 398.39801,596.156006 397.476013,591.835999) t=8.73365293e-05 [45] (406.943878,597.984253) tEnd=1 newWindSum=-2 windSum=? windValue=1
|
| 392 | SkOpSegment::markAngle last seg=14 span=45 windSum=-2
|
| 393 | SkOpSegment::debugShowActiveSpans id=3 (403.625397,582.36792 403.625,582.366028) t=0.999474488 tEnd=1 windSum=-1 oppSum=0 windValue=1 oppValue=0
|
| 394 | SkOpSegment::debugShowActiveSpans id=4 (403.625,582.366028 407.953003,581.452026 412.179993,584.202026 413.10199,588.514038) t=0 tEnd=1 windSum=-1 oppSum=0 windValue=1 oppValue=0
|
| 395 | SkOpSegment::debugShowActiveSpans id=5 (413.10199,588.514038 409.539001,589.27301) t=0 tEnd=1 windSum=-1 oppSum=0 windValue=1 oppValue=0
|
| 396 | SkOpSegment::debugShowActiveSpans id=19 (397.476746,591.835815 396.563464,587.516202 399.305371,583.289897 403.625,582.367981) t=8.74738929e-05 tEnd=1 windSum=-1 oppSum=0 windValue=1 oppValue=0
|
| 397 | SkOpSegment::debugShowActiveSpans id=8 (409.539154,589.273743 413.100037,588.515991) t=0.000318097039 tEnd=1 windSum=-1 windValue=1
|
| 398 | SkOpSegment::debugShowActiveSpans id=9 (413.100037,588.515991 414.006042,592.835999 411.272034,597.062988 406.944031,597.984985) t=0 tEnd=1 windSum=-1 windValue=1
|
| 399 | SkOpSegment::debugShowActiveSpans id=14 (406.943878,597.984253 402.624264,598.897536 398.39793,596.155629 397.476013,591.835999) t=8.73365293e-05 tEnd=1 windSum=-2 windValue=1
|
| 400 | SkOpSegment::nextChase mismatched signs
|
| 401 | SkOpSegment::findNextWinding simple
|
| 402 | SkOpSegment::markDone id=19 (397.47699,591.836975 396.562988,587.516968 399.304993,583.289978 403.625,582.367981) t=8.74738929e-05 [44] (397.476746,591.835815) tEnd=1 newWindSum=-1 newOppSum=0 oppSum=0 windSum=-1 windValue=1 oppValue=0
|
| 403 | bridgeWinding current id=19 from=(397.476746,591.835815) to=(403.625,582.367981)
|
| 404 | path.moveTo(397.476746,591.835815);
|
| 405 | path.cubicTo(396.563477,587.516174, 399.305359,583.289917, 403.625,582.367981);
|
| 406 | SkOpSegment::findNextWinding simple
|
| 407 | SkOpSegment::markDone id=3 (404.382996,585.921021 403.625,582.366028) t=0.999474488 [41] (403.625397,582.36792) tEnd=1 newWindSum=-1 newOppSum=0 oppSum=0 windSum=-1 windValue=1 oppValue=0
|
| 408 | bridgeWinding current id=3 from=(403.625397,582.36792) to=(403.625,582.366028)
|
| 409 | SkOpSegment::findNextWinding simple
|
| 410 | SkOpSegment::markDone id=4 (403.625,582.366028 407.953003,581.452026 412.179993,584.202026 413.10199,588.514038) t=0 [7] (403.625,582.366028) tEnd=1 newWindSum=-1 newOppSum=0 oppSum=0 windSum=-1 windValue=1 oppValue=0
|
| 411 | bridgeWinding current id=4 from=(403.625,582.366028) to=(413.10199,588.514038)
|
| 412 | path.lineTo(403.625,582.366028);
|
| 413 | path.cubicTo(407.953003,581.452026, 412.179993,584.202026, 413.10199,588.514038);
|
| 414 | SkOpSegment::findNextWinding
|
| 415 | SkOpAngle::dumpOne [5/4] next=1/1 sect=1/1 s=1 [10] e=0 [9] sgn=1 windVal=1 windSum=-1 oppVal=0 oppSum=0
|
| 416 | SkOpAngle::dumpOne [1/1] next=8/12 sect=9/9 s=0 [1] e=1 [2] sgn=-1 windVal=1 windSum=-1 oppVal=0 oppSum=0 done
|
| 417 | SkOpAngle::dumpOne [8/12] next=8/13 sect=17/17 s=0.000318097039 [42] e=0 [15] sgn=1 windVal=1 windSum=-1 done
|
| 418 | SkOpAngle::dumpOne [8/13] next=5/4 sect=1/1 s=0.000318097039 [42] e=1 [16] sgn=-1 windVal=1 windSum=-1
|
| 419 | SkOpSegment::markDone id=5 (413.10199,588.514038 409.539001,589.27301) t=0 [9] (413.10199,588.514038) tEnd=1 newWindSum=-1 newOppSum=0 oppSum=0 windSum=-1 windValue=1 oppValue=0
|
| 420 | SkOpSegment::findNextWinding from:[5] to:[8] start=4291816 end=4287072
|
| 421 | bridgeWinding current id=5 from=(413.10199,588.514038) to=(409.539001,589.27301)
|
| 422 | SkOpSegment::findNextWinding simple
|
| 423 | SkOpSegment::markDone id=8 (409.538025,589.273987 413.100037,588.515991) t=0.000318097039 [42] (409.539154,589.273743) tEnd=1 newWindSum=-1 newOppSum=? oppSum=? windSum=-1 windValue=1 oppValue=0
|
| 424 | bridgeWinding current id=8 from=(409.539154,589.273743) to=(413.100037,588.515991)
|
| 425 | path.lineTo(409.539001,589.27301);
|
| 426 | SkOpSegment::findNextWinding
|
| 427 | SkOpAngle::dumpOne [9/14] next=10/15 sect=1/5 s=1 [18] e=0 [17] sgn=1 windVal=1 windSum=-1
|
| 428 | SkOpAngle::dumpOne [10/15] next=14/22 sect=9/9 s=0 [19] e=1 [20] sgn=-1 windVal=1 windSum=-2 done
|
| 429 | SkOpAngle::dumpOne [14/22] next=14/21 sect=17/13 s=8.73365293e-05 [45] e=1 [28] sgn=-1 windVal=1 windSum=-2
|
| 430 | SkOpAngle::dumpOne [14/21] next=9/14 sect=31/31 s=8.73365293e-05 [45] e=0 [27] sgn=1 windVal=1 windSum=-2 done
|
| 431 | SkOpSegment::markDone id=9 (413.100037,588.515991 414.006042,592.835999 411.272034,597.062988 406.944031,597.984985) t=0 [17] (413.100037,588.515991) tEnd=1 newWindSum=-1 newOppSum=? oppSum=? windSum=-1 windValue=1 oppValue=0
|
| 432 | SkOpSegment::findNextWinding from:[9] to:[14] start=4292248 end=4289320
|
| 433 | bridgeWinding current id=9 from=(413.100037,588.515991) to=(406.944031,597.984985)
|
| 434 | path.lineTo(413.100037,588.515991);
|
| 435 | path.cubicTo(414.006042,592.835999, 411.272034,597.062988, 406.944031,597.984985);
|
| 436 | SkOpSegment::findNextWinding simple
|
| 437 | SkOpSegment::debugShowActiveSpans id=14 (406.943878,597.984253 402.624264,598.897536 398.39793,596.155629 397.476013,591.835999) t=8.73365293e-05 tEnd=1 windSum=-2 windValue=1
|
| 438 | SkOpSegment::markDone id=14 (406.945007,597.984009 402.625,598.89801 398.39801,596.156006 397.476013,591.835999) t=8.73365293e-05 [45] (406.943878,597.984253) tEnd=1 newWindSum=-2 newOppSum=? oppSum=? windSum=-2 windValue=1 oppValue=0
|
| 439 | </div>
|
| 440 | |
| 441 | <div id="joel_10">
|
| 442 | SkDCubic::ComplexBreak
|
| 443 | {{{584.08599853515625, 431.33599853515625}, {582.93798828125, 430.96099853515625}, {581.75799560546875, 431.08599853515625}, {580.7659912109375, 431.593994140625}}},
|
| 444 | maxCurvature[0]=0.908113421 {{{584.1181209116214177, 430.1538818130687787}, {577.969954809597084, 432.7736222667205084}}},
|
| 445 | SkDCubic::ComplexBreak
|
| 446 | {{{575.14801025390625, 433}, {576.5150146484375, 428.7969970703125}, {581.0150146484375, 426.5159912109375}, {585.21002197265625, 427.875}}},
|
| 447 | maxCurvature[0]=0.50036075 {{{568.1978874470240726, 433.8982271481503972}, {590.0470235470908165, 422.8012586633995511}}},
|
| 448 | SkDCubic::ComplexBreak
|
| 449 | {{{586.875, 436.81201171875}, {587.25, 435.66400146484375}, {587.125, 434.5}, {586.61700439453125, 433.49200439453125}}},
|
| 450 | maxCurvature[0]=0.709758914 {{{587.7871278617965345, 437.6571056882418702}, {586.1322255770696756, 431.1527144185091061}}},
|
| 451 | SkDCubic::ComplexBreak
|
| 452 | {{{585.21099853515625, 427.875}, {589.406005859375, 429.24200439453125}, {591.69500732421875, 433.7340087890625}, {590.3280029296875, 437.93701171875}}},
|
| 453 | maxCurvature[0]=0.49729326 {{{584.2405287567108871, 420.9205840752692325}, {595.4397901231312744, 442.7054003127302053}}},
|
| 454 | SkDCubic::ComplexBreak
|
| 455 | {{{581.39801025390625, 439.60198974609375}, {582.53900146484375, 439.968994140625}, {583.71002197265625, 439.85198974609375}, {584.71002197265625, 439.343994140625}}},
|
| 456 | maxCurvature[0]=0.769822111 {{{580.7905223461929154, 440.6007184045780036}, {587.1989920634028977, 438.6622846164399903}}},
|
| 457 | SkDCubic::ComplexBreak
|
| 458 | {{{590.3270263671875, 437.93798828125}, {588.9520263671875, 442.13299560546875}, {584.468017578125, 444.4219970703125}, {580.2650146484375, 443.05499267578125}}},
|
| 459 | maxCurvature[0]=0.50179849 {{{597.2616281410381589, 437.0677298509480124}, {575.4121463613508922, 448.1166853435209987}}},
|
| 460 | SkDCubic::ComplexBreak
|
| 461 | {{{578.60198974609375, 434.125}, {578.2349853515625, 435.27301025390625}, {578.35198974609375, 436.43701171875}, {578.8599853515625, 437.44500732421875}}},
|
| 462 | maxCurvature[0]=0.714831074 {{{577.6906339162001132, 433.299635239093675}, {579.3552391524597169, 439.7975429835167347}}},
|
| 463 | SkDCubic::ComplexBreak
|
| 464 | {{{580.2659912109375, 443.05401611328125}, {576.07098388671875, 441.68701171875}, {573.781982421875, 437.2020263671875}, {575.14898681640625, 432.9990234375}}},
|
| 465 | maxCurvature[0]=0.498616268 {{{581.2070198879381451, 449.9982918524905813}, {570.0518531862154532, 428.2119094507434625}}},
|
| 466 | <empty>
|
| 467 | <empty>
|
| 468 | seg=1 {{{584.085999f, 431.335999f}, {582.937988f, 430.960999f}, {581.757996f, 431.085999f}, {580.765991f, 431.593994f}}}
|
| 469 | seg=2 {{{580.765991f, 431.593994f}, {579.773987f, 432.10199f}, {578.97699f, 432.97699f}, {578.60199f, 434.125f}}}
|
| 470 | seg=3 {{{578.60199f, 434.125f}, {575.14801f, 433}}}
|
| 471 | seg=4 {{{575.14801f, 433}, {576.515015f, 428.796997f}, {581.015015f, 426.515991f}, {585.210022f, 427.875f}}}
|
| 472 | seg=5 {{{585.210022f, 427.875f}, {584.085999f, 431.335999f}}}
|
| 473 | <empty>
|
| 474 | seg=6 {{{586.875f, 436.812012f}, {587.25f, 435.664001f}, {587.125f, 434.5f}, {586.617004f, 433.492004f}}}
|
| 475 | seg=7 {{{586.617004f, 433.492004f}, {586.101013f, 432.5f}, {585.234009f, 431.703003f}, {584.085999f, 431.335999f}}}
|
| 476 | seg=8 {{{584.085999f, 431.335999f}, {585.210999f, 427.875f}}}
|
| 477 | seg=9 {{{585.210999f, 427.875f}, {589.406006f, 429.242004f}, {591.695007f, 433.734009f}, {590.328003f, 437.937012f}}}
|
| 478 | seg=10 {{{590.328003f, 437.937012f}, {586.875f, 436.812012f}}}
|
| 479 | <empty>
|
| 480 | seg=11 {{{581.39801f, 439.60199f}, {582.539001f, 439.968994f}, {583.710022f, 439.85199f}, {584.710022f, 439.343994f}}}
|
| 481 | seg=12 {{{584.710022f, 439.343994f}, {585.702026f, 438.835999f}, {586.499023f, 437.960999f}, {586.874023f, 436.812988f}}}
|
| 482 | seg=13 {{{586.874023f, 436.812988f}, {590.327026f, 437.937988f}}}
|
| 483 | seg=14 {{{590.327026f, 437.937988f}, {588.952026f, 442.132996f}, {584.468018f, 444.421997f}, {580.265015f, 443.054993f}}}
|
| 484 | seg=15 {{{580.265015f, 443.054993f}, {581.39801f, 439.60199f}}}
|
| 485 | seg=16 {{{578.60199f, 434.125f}, {578.234985f, 435.27301f}, {578.35199f, 436.437012f}, {578.859985f, 437.445007f}}}
|
| 486 | seg=17 {{{578.859985f, 437.445007f}, {579.367981f, 438.437012f}, {580.250977f, 439.226013f}, {581.398987f, 439.601013f}}}
|
| 487 | seg=18 {{{581.398987f, 439.601013f}, {580.265991f, 443.054016f}}}
|
| 488 | seg=19 {{{580.265991f, 443.054016f}, {576.070984f, 441.687012f}, {573.781982f, 437.202026f}, {575.148987f, 432.999023f}}}
|
| 489 | seg=20 {{{575.148987f, 432.999023f}, {578.60199f, 434.125f}}}
|
| 490 | debugShowCubicIntersection wtTs[0]=1 {{{584.085999,431.335999}, {582.937988,430.960999}, {581.757996,431.085999}, {580.765991,431.593994}}} {{580.765991,431.593994}} wnTs[0]=0 {{{580.765991,431.593994}, {579.773987,432.10199}, {578.97699,432.97699}, {578.60199,434.125}}}
|
| 491 | debugShowCubicIntersection no intersect {{{584.085999,431.335999}, {582.937988,430.960999}, {581.757996,431.085999}, {580.765991,431.593994}}} {{{575.14801,433}, {576.515015,428.796997}, {581.015015,426.515991}, {585.210022,427.875}}}
|
| 492 | debugShowCubicLineIntersection wtTs[0]=0 {{{584.085999,431.335999}, {582.937988,430.960999}, {581.757996,431.085999}, {580.765991,431.593994}}} {{584.085999,431.335999}} wnTs[0]=1 {{{585.210022,427.875}, {584.085999,431.335999}}}
|
| 493 | debugShowCubicLineIntersection wtTs[0]=1 {{{580.765991,431.593994}, {579.773987,432.10199}, {578.97699,432.97699}, {578.60199,434.125}}} {{578.60199,434.125}} wnTs[0]=0 {{{578.60199,434.125}, {575.14801,433}}}
|
| 494 | debugShowCubicIntersection no intersect {{{580.765991,431.593994}, {579.773987,432.10199}, {578.97699,432.97699}, {578.60199,434.125}}} {{{575.14801,433}, {576.515015,428.796997}, {581.015015,426.515991}, {585.210022,427.875}}}
|
| 495 | debugShowCubicLineIntersection wtTs[0]=0 {{{575.14801,433}, {576.515015,428.796997}, {581.015015,426.515991}, {585.210022,427.875}}} {{575.14801,433}} wnTs[0]=1 {{{578.60199,434.125}, {575.14801,433}}}
|
| 496 | debugShowCubicLineIntersection wtTs[0]=1 {{{575.14801,433}, {576.515015,428.796997}, {581.015015,426.515991}, {585.210022,427.875}}} {{585.210022,427.875}} wnTs[0]=0 {{{585.210022,427.875}, {584.085999,431.335999}}}
|
| 497 | debugShowCubicIntersection wtTs[0]=0 {{{584.085999,431.335999}, {582.937988,430.960999}, {581.757996,431.085999}, {580.765991,431.593994}}} {{584.085999,431.335999}} wnTs[0]=1 {{{586.617004,433.492004}, {586.101013,432.5}, {585.234009,431.703003}, {584.085999,431.335999}}}
|
| 498 | debugShowCubicLineIntersection wtTs[0]=0 {{{584.085999,431.335999}, {582.937988,430.960999}, {581.757996,431.085999}, {580.765991,431.593994}}} {{584.085999,431.335999}} wnTs[0]=0 {{{584.085999,431.335999}, {585.210999,427.875}}}
|
| 499 | debugShowCubicIntersection no intersect {{{575.14801,433}, {576.515015,428.796997}, {581.015015,426.515991}, {585.210022,427.875}}} {{{586.617004,433.492004}, {586.101013,432.5}, {585.234009,431.703003}, {584.085999,431.335999}}}
|
| 500 | debugShowCubicLineIntersection wtTs[0]=1 {{{575.14801,433}, {576.515015,428.796997}, {581.015015,426.515991}, {585.210022,427.875}}} {{585.210022,427.875}} wnTs[0]=0.999917 {{{584.085999,431.335999}, {585.210999,427.875}}}
|
| 501 | debugShowCubicLineIntersection wtTs[0]=1 {{{586.617004,433.492004}, {586.101013,432.5}, {585.234009,431.703003}, {584.085999,431.335999}}} {{584.085999,431.335999}} wnTs[0]=1 {{{585.210022,427.875}, {584.085999,431.335999}}}
|
| 502 | debugShowLineIntersection wtTs[0]=0 {{{585.210022,427.875}, {584.085999,431.335999}}} {{585.210022,427.875}} wtTs[1]=1 {{584.085999,431.335999}} wnTs[0]=0.999917 {{{584.085999,431.335999}, {585.210999,427.875}}} wnTs[1]=0
|
| 503 | debugShowCubicIntersection wtTs[0]=1 {{{580.765991,431.593994}, {579.773987,432.10199}, {578.97699,432.97699}, {578.60199,434.125}}} {{578.60199,434.125}} wnTs[0]=0 {{{578.60199,434.125}, {578.234985,435.27301}, {578.35199,436.437012}, {578.859985,437.445007}}}
|
| 504 | debugShowCubicIntersection no intersect {{{580.765991,431.593994}, {579.773987,432.10199}, {578.97699,432.97699}, {578.60199,434.125}}} {{{580.265991,443.054016}, {576.070984,441.687012}, {573.781982,437.202026}, {575.148987,432.999023}}}
|
| 505 | debugShowCubicLineIntersection wtTs[0]=1 {{{580.765991,431.593994}, {579.773987,432.10199}, {578.97699,432.97699}, {578.60199,434.125}}} {{578.60199,434.125}} wnTs[0]=1 {{{575.148987,432.999023}, {578.60199,434.125}}}
|
| 506 | debugShowCubicLineIntersection wtTs[0]=0 {{{578.60199,434.125}, {578.234985,435.27301}, {578.35199,436.437012}, {578.859985,437.445007}}} {{578.60199,434.125}} wnTs[0]=0 {{{578.60199,434.125}, {575.14801,433}}}
|
| 507 | debugShowCubicLineIntersection wtTs[0]=0.999907158 {{{580.265991,443.054016}, {576.070984,441.687012}, {573.781982,437.202026}, {575.148987,432.999023}}} {{575.148621,433.000183}} wnTs[0]=0.999827 {{{578.60199,434.125}, {575.14801,433}}}
|
| 508 | SkOpSegment::addT insert t=0.999907158 segID=19 spanID=41
|
| 509 | debugShowLineIntersection wtTs[0]=0 {{{578.60199,434.125}, {575.14801,433}}} {{578.60199,434.125}} wnTs[0]=1 {{{575.148987,432.999023}, {578.60199,434.125}}}
|
| 510 | debugShowCubicIntersection no intersect {{{575.14801,433}, {576.515015,428.796997}, {581.015015,426.515991}, {585.210022,427.875}}} {{{580.265991,443.054016}, {576.070984,441.687012}, {573.781982,437.202026}, {575.148987,432.999023}}}
|
| 511 | debugShowCubicLineIntersection no intersect {{{575.14801,433}, {576.515015,428.796997}, {581.015015,426.515991}, {585.210022,427.875}}} {{{575.148987,432.999023}, {578.60199,434.125}}}
|
| 512 | debugShowCubicIntersection wtTs[0]=1 {{{586.875,436.812012}, {587.25,435.664001}, {587.125,434.5}, {586.617004,433.492004}}} {{586.617004,433.492004}} wnTs[0]=0 {{{586.617004,433.492004}, {586.101013,432.5}, {585.234009,431.703003}, {584.085999,431.335999}}}
|
| 513 | debugShowCubicIntersection no intersect {{{586.875,436.812012}, {587.25,435.664001}, {587.125,434.5}, {586.617004,433.492004}}} {{{585.210999,427.875}, {589.406006,429.242004}, {591.695007,433.734009}, {590.328003,437.937012}}}
|
| 514 | debugShowCubicLineIntersection wtTs[0]=0 {{{586.875,436.812012}, {587.25,435.664001}, {587.125,434.5}, {586.617004,433.492004}}} {{586.875,436.812012}} wnTs[0]=1 {{{590.328003,437.937012}, {586.875,436.812012}}}
|
| 515 | debugShowCubicLineIntersection wtTs[0]=1 {{{586.617004,433.492004}, {586.101013,432.5}, {585.234009,431.703003}, {584.085999,431.335999}}} {{584.085999,431.335999}} wnTs[0]=0 {{{584.085999,431.335999}, {585.210999,427.875}}}
|
| 516 | debugShowCubicIntersection no intersect {{{586.617004,433.492004}, {586.101013,432.5}, {585.234009,431.703003}, {584.085999,431.335999}}} {{{585.210999,427.875}, {589.406006,429.242004}, {591.695007,433.734009}, {590.328003,437.937012}}}
|
| 517 | debugShowCubicLineIntersection wtTs[0]=0 {{{585.210999,427.875}, {589.406006,429.242004}, {591.695007,433.734009}, {590.328003,437.937012}}} {{585.210999,427.875}} wnTs[0]=1 {{{584.085999,431.335999}, {585.210999,427.875}}}
|
| 518 | debugShowCubicLineIntersection wtTs[0]=1 {{{585.210999,427.875}, {589.406006,429.242004}, {591.695007,433.734009}, {590.328003,437.937012}}} {{590.328003,437.937012}} wnTs[0]=0 {{{590.328003,437.937012}, {586.875,436.812012}}}
|
| 519 | debugShowCubicIntersection no intersect {{{585.210999,427.875}, {589.406006,429.242004}, {591.695007,433.734009}, {590.328003,437.937012}}} {{{584.710022,439.343994}, {585.702026,438.835999}, {586.499023,437.960999}, {586.874023,436.812988}}}
|
| 520 | debugShowCubicLineIntersection no intersect {{{585.210999,427.875}, {589.406006,429.242004}, {591.695007,433.734009}, {590.328003,437.937012}}} {{{586.874023,436.812988}, {590.327026,437.937988}}}
|
| 521 | debugShowLineIntersection no intersect {{{590.328003,437.937012}, {586.875,436.812012}}} {{{586.874023,436.812988}, {590.327026,437.937988}}}
|
| 522 | debugShowCubicIntersection wtTs[0]=1 {{{578.60199,434.125}, {578.234985,435.27301}, {578.35199,436.437012}, {578.859985,437.445007}}} {{578.859985,437.445007}} wnTs[0]=0 {{{578.859985,437.445007}, {579.367981,438.437012}, {580.250977,439.226013}, {581.398987,439.601013}}}
|
| 523 | debugShowCubicIntersection no intersect {{{578.60199,434.125}, {578.234985,435.27301}, {578.35199,436.437012}, {578.859985,437.445007}}} {{{580.265991,443.054016}, {576.070984,441.687012}, {573.781982,437.202026}, {575.148987,432.999023}}}
|
| 524 | debugShowCubicLineIntersection wtTs[0]=0 {{{578.60199,434.125}, {578.234985,435.27301}, {578.35199,436.437012}, {578.859985,437.445007}}} {{578.60199,434.125}} wnTs[0]=1 {{{575.148987,432.999023}, {578.60199,434.125}}}
|
| 525 | debugShowCubicLineIntersection wtTs[0]=1 {{{578.859985,437.445007}, {579.367981,438.437012}, {580.250977,439.226013}, {581.398987,439.601013}}} {{581.398987,439.601013}} wnTs[0]=0 {{{581.398987,439.601013}, {580.265991,443.054016}}}
|
| 526 | debugShowCubicIntersection no intersect {{{578.859985,437.445007}, {579.367981,438.437012}, {580.250977,439.226013}, {581.398987,439.601013}}} {{{580.265991,443.054016}, {576.070984,441.687012}, {573.781982,437.202026}, {575.148987,432.999023}}}
|
| 527 | debugShowCubicLineIntersection wtTs[0]=0 {{{580.265991,443.054016}, {576.070984,441.687012}, {573.781982,437.202026}, {575.148987,432.999023}}} {{580.265991,443.054016}} wnTs[0]=1 {{{581.398987,439.601013}, {580.265991,443.054016}}}
|
| 528 | debugShowCubicLineIntersection wtTs[0]=1 {{{580.265991,443.054016}, {576.070984,441.687012}, {573.781982,437.202026}, {575.148987,432.999023}}} {{575.148987,432.999023}} wnTs[0]=0 {{{575.148987,432.999023}, {578.60199,434.125}}}
|
| 529 | debugShowCubicIntersection no intersect {{{578.859985,437.445007}, {579.367981,438.437012}, {580.250977,439.226013}, {581.398987,439.601013}}} {{{581.39801,439.60199}, {582.539001,439.968994}, {583.710022,439.85199}, {584.710022,439.343994}}}
|
| 530 | debugShowCubicIntersection no intersect {{{578.859985,437.445007}, {579.367981,438.437012}, {580.250977,439.226013}, {581.398987,439.601013}}} {{{590.327026,437.937988}, {588.952026,442.132996}, {584.468018,444.421997}, {580.265015,443.054993}}}
|
| 531 | debugShowCubicLineIntersection wtTs[0]=0 {{{581.39801,439.60199}, {582.539001,439.968994}, {583.710022,439.85199}, {584.710022,439.343994}}} {{581.39801,439.60199}} wtTs[1]=0.000173389113 {{581.398621,439.602173}} wnTs[0]=0.000339104 {{{581.398987,439.601013}, {580.265991,443.054016}}} wnTs[1]=0.000338089069
|
| 532 | SkOpSegment::addT insert t=0.000339103907 segID=18 spanID=42
|
| 533 | debugShowCubicLineIntersection no intersect {{{590.327026,437.937988}, {588.952026,442.132996}, {584.468018,444.421997}, {580.265015,443.054993}}} {{{581.398987,439.601013}, {580.265991,443.054016}}}
|
| 534 | debugShowLineIntersection wtTs[0]=0.000339103907 {{{581.398987,439.601013}, {580.265991,443.054016}}} {{581.39801,439.60199}} wtTs[1]=1 {{580.265991,443.054016}} wnTs[0]=1 {{{580.265015,443.054993}, {581.39801,439.60199}}} wnTs[1]=0.000339103907
|
| 535 | SkOpSegment::addT insert t=0.000339103907 segID=15 spanID=43
|
| 536 | debugShowCubicIntersection no intersect {{{580.265991,443.054016}, {576.070984,441.687012}, {573.781982,437.202026}, {575.148987,432.999023}}} {{{590.327026,437.937988}, {588.952026,442.132996}, {584.468018,444.421997}, {580.265015,443.054993}}}
|
| 537 | debugShowCubicLineIntersection wtTs[0]=0 {{{580.265991,443.054016}, {576.070984,441.687012}, {573.781982,437.202026}, {575.148987,432.999023}}} {{580.265991,443.054016}} wtTs[1]=4.71004667e-05 {{580.265381,443.053833}} wnTs[0]=0.000339104 {{{580.265015,443.054993}, {581.39801,439.60199}}} wnTs[1]=0.000338761046
|
| 538 | debugShowCubicIntersection wtTs[0]=1 {{{581.39801,439.60199}, {582.539001,439.968994}, {583.710022,439.85199}, {584.710022,439.343994}}} {{584.710022,439.343994}} wnTs[0]=0 {{{584.710022,439.343994}, {585.702026,438.835999}, {586.499023,437.960999}, {586.874023,436.812988}}}
|
| 539 | debugShowCubicIntersection no intersect {{{581.39801,439.60199}, {582.539001,439.968994}, {583.710022,439.85199}, {584.710022,439.343994}}} {{{590.327026,437.937988}, {588.952026,442.132996}, {584.468018,444.421997}, {580.265015,443.054993}}}
|
| 540 | debugShowCubicLineIntersection wtTs[0]=0 {{{581.39801,439.60199}, {582.539001,439.968994}, {583.710022,439.85199}, {584.710022,439.343994}}} {{581.39801,439.60199}} wnTs[0]=1 {{{580.265015,443.054993}, {581.39801,439.60199}}}
|
| 541 | debugShowCubicLineIntersection wtTs[0]=1 {{{584.710022,439.343994}, {585.702026,438.835999}, {586.499023,437.960999}, {586.874023,436.812988}}} {{586.874023,436.812988}} wnTs[0]=0 {{{586.874023,436.812988}, {590.327026,437.937988}}}
|
| 542 | debugShowCubicIntersection no intersect {{{584.710022,439.343994}, {585.702026,438.835999}, {586.499023,437.960999}, {586.874023,436.812988}}} {{{590.327026,437.937988}, {588.952026,442.132996}, {584.468018,444.421997}, {580.265015,443.054993}}}
|
| 543 | debugShowCubicLineIntersection wtTs[0]=0 {{{590.327026,437.937988}, {588.952026,442.132996}, {584.468018,444.421997}, {580.265015,443.054993}}} {{590.327026,437.937988}} wnTs[0]=1 {{{586.874023,436.812988}, {590.327026,437.937988}}}
|
| 544 | debugShowCubicLineIntersection wtTs[0]=1 {{{590.327026,437.937988}, {588.952026,442.132996}, {584.468018,444.421997}, {580.265015,443.054993}}} {{580.265015,443.054993}} wnTs[0]=0 {{{580.265015,443.054993}, {581.39801,439.60199}}}
|
| 545 | ------------------x--x---------------- addExpanded
|
| 546 | 00: seg/base=15/43 seg/base=18/42 MarkCoinStart
|
| 547 | 01: seg/base=15/30 seg/base=18/36 MarkCoinEnd
|
| 548 | 02: seg/base=8/15 seg/base=5/9 MarkCoinStart
|
| 549 | 03: seg/base=8/16 seg/base=5/10 MarkCoinEnd
|
| 550 | SkOpSegment::debugShowActiveSpans id=1 (584.085999,431.335999 582.937988,430.960999 581.757996,431.085999 580.765991,431.593994) t=0 tEnd=1 windSum=? windValue=1
|
| 551 | SkOpSegment::debugShowActiveSpans id=2 (580.765991,431.593994 579.773987,432.10199 578.97699,432.97699 578.60199,434.125) t=0 tEnd=1 windSum=? windValue=1
|
| 552 | SkOpSegment::debugShowActiveSpans id=3 (578.60199,434.125 575.14801,433) t=0 tEnd=1 windSum=? windValue=1
|
| 553 | SkOpSegment::debugShowActiveSpans id=4 (575.14801,433 576.515015,428.796997 581.015015,426.515991 585.210022,427.875) t=0 tEnd=1 windSum=? windValue=1
|
| 554 | SkOpSegment::debugShowActiveSpans id=5 (585.210022,427.875 584.085999,431.335999) t=0 tEnd=1 windSum=? windValue=1
|
| 555 | SkOpSegment::debugShowActiveSpans id=6 (586.875,436.812012 587.25,435.664001 587.125,434.5 586.617004,433.492004) t=0 tEnd=1 windSum=? windValue=1
|
| 556 | SkOpSegment::debugShowActiveSpans id=7 (586.617004,433.492004 586.101013,432.5 585.234009,431.703003 584.085999,431.335999) t=0 tEnd=1 windSum=? windValue=1
|
| 557 | SkOpSegment::debugShowActiveSpans id=8 (584.085999,431.335999 585.210999,427.875) t=0 tEnd=1 windSum=? windValue=1
|
| 558 | SkOpSegment::debugShowActiveSpans id=9 (585.210999,427.875 589.406006,429.242004 591.695007,433.734009 590.328003,437.937012) t=0 tEnd=1 windSum=? windValue=1
|
| 559 | SkOpSegment::debugShowActiveSpans id=10 (590.328003,437.937012 586.875,436.812012) t=0 tEnd=1 windSum=? windValue=1
|
| 560 | SkOpSegment::debugShowActiveSpans id=16 (578.60199,434.125 578.234985,435.27301 578.35199,436.437012 578.859985,437.445007) t=0 tEnd=1 windSum=? windValue=1
|
| 561 | SkOpSegment::debugShowActiveSpans id=17 (578.859985,437.445007 579.367981,438.437012 580.250977,439.226013 581.398987,439.601013) t=0 tEnd=1 windSum=? windValue=1
|
| 562 | SkOpSegment::debugShowActiveSpans id=18 (581.398987,439.601013 581.398621,439.602173) t=0 tEnd=0.000339103907 windSum=? windValue=1
|
| 563 | SkOpSegment::debugShowActiveSpans id=18 (581.398621,439.602173 580.265991,443.054016) t=0.000339103907 tEnd=1 windSum=? windValue=1
|
| 564 | SkOpSegment::debugShowActiveSpans id=19 (580.265991,443.054016 576.071373,441.687139 573.782422,437.202848 575.148621,433.000183) t=0 tEnd=0.999907158 windSum=? windValue=1
|
| 565 | SkOpSegment::debugShowActiveSpans id=19 (575.148621,433.000183 575.148747,432.999793 575.14886,432.999414 575.148987,432.999023) t=0.999907158 tEnd=1 windSum=? windValue=1
|
| 566 | SkOpSegment::debugShowActiveSpans id=20 (575.148987,432.999023 578.60199,434.125) t=0 tEnd=1 windSum=? windValue=1
|
| 567 | SkOpSegment::debugShowActiveSpans id=11 (581.39801,439.60199 582.539001,439.968994 583.710022,439.85199 584.710022,439.343994) t=0 tEnd=1 windSum=? windValue=1
|
| 568 | SkOpSegment::debugShowActiveSpans id=12 (584.710022,439.343994 585.702026,438.835999 586.499023,437.960999 586.874023,436.812988) t=0 tEnd=1 windSum=? windValue=1
|
| 569 | SkOpSegment::debugShowActiveSpans id=13 (586.874023,436.812988 590.327026,437.937988) t=0 tEnd=1 windSum=? windValue=1
|
| 570 | SkOpSegment::debugShowActiveSpans id=14 (590.327026,437.937988 588.952026,442.132996 584.468018,444.421997 580.265015,443.054993) t=0 tEnd=1 windSum=? windValue=1
|
| 571 | SkOpSegment::debugShowActiveSpans id=15 (580.265015,443.054993 580.265381,443.053833) t=0 tEnd=0.000339103907 windSum=? windValue=1
|
| 572 | SkOpSegment::debugShowActiveSpans id=15 (580.265381,443.053833 581.39801,439.60199) t=0.000339103907 tEnd=1 windSum=? windValue=1
|
| 573 | ------------------x--x---------------- move_multiples
|
| 574 | 00: seg/base=15/43 seg/base=18/42 MarkCoinStart
|
| 575 | 01: seg/base=15/30 seg/base=18/36 MarkCoinEnd
|
| 576 | 02: seg/base=8/15 seg/base=5/9 MarkCoinStart
|
| 577 | 03: seg/base=8/16 seg/base=5/10 MarkCoinEnd
|
| 578 | ------------------x--x---------------- move_nearby
|
| 579 | 00: seg/base=15/43 seg/base=18/42 MarkCoinStart
|
| 580 | 01: seg/base=15/30 seg/base=18/36 MarkCoinEnd
|
| 581 | 02: seg/base=8/15 seg/base=5/9 MarkCoinStart
|
| 582 | 03: seg/base=8/16 seg/base=5/10 MarkCoinEnd
|
| 583 | ------------------x--x---------------- correctEnds
|
| 584 | 00: seg/base=15/43 seg/base=18/42 MarkCoinStart
|
| 585 | 01: seg/base=15/30 seg/base=18/36 MarkCoinEnd
|
| 586 | 02: seg/base=8/15 seg/base=5/9 MarkCoinStart
|
| 587 | 03: seg/base=8/16 seg/base=5/10 MarkCoinEnd
|
| 588 | ------------------x--x---------------- addEndMovedSpans
|
| 589 | 00: seg/base=15/43 seg/base=18/42 MarkCoinStart
|
| 590 | 01: seg/base=15/30 seg/base=18/36 MarkCoinEnd
|
| 591 | 02: seg/base=8/15 seg/base=5/9 MarkCoinStart
|
| 592 | 03: seg/base=8/16 seg/base=5/10 MarkCoinEnd
|
| 593 | ------------------x--x---------------- expand
|
| 594 | 00: seg/base=15/43 seg/base=18/42 MarkCoinStart
|
| 595 | 01: seg/base=15/30 seg/base=18/36 MarkCoinEnd
|
| 596 | 02: seg/base=8/15 seg/base=5/9 MarkCoinStart
|
| 597 | 03: seg/base=8/16 seg/base=5/10 MarkCoinEnd
|
| 598 | ------------------x--x---------------- addExpanded
|
| 599 | 00: seg/base=15/43 seg/base=18/42 MarkCoinStart
|
| 600 | 01: seg/base=15/30 seg/base=18/36 MarkCoinEnd
|
| 601 | 02: seg/base=8/15 seg/base=5/9 MarkCoinStart
|
| 602 | 03: seg/base=8/16 seg/base=5/10 MarkCoinEnd
|
| 603 | ------------------x--x---------------- mark
|
| 604 | 00: seg/base=15/43 seg/base=18/42 MarkCoinStart
|
| 605 | 01: seg/base=15/30 seg/base=18/36 MarkCoinEnd
|
| 606 | 02: seg/base=8/15 seg/base=5/9 MarkCoinStart
|
| 607 | 03: seg/base=8/16 seg/base=5/10 MarkCoinEnd
|
| 608 | -------------------------------------- missing_coincidence
|
| 609 | -------------------------------------- expand
|
| 610 | -------------------------------------- expand
|
| 611 | -------------------------------------- apply
|
| 612 | SkOpSegment::markDone id=15 (580.265015,443.054993 581.39801,439.60199) t=0.000339103907 [43] (580.265381,443.053833) tEnd=1 newWindSum=? newOppSum=? oppSum=? windSum=? windValue=0 oppValue=0
|
| 613 | SkOpSegment::markDone id=18 (581.398987,439.601013 580.265991,443.054016) t=0.000339103907 [42] (581.398621,439.602173) tEnd=1 newWindSum=? newOppSum=? oppSum=? windSum=? windValue=0 oppValue=0
|
| 614 | SkOpSegment::markDone id=8 (584.085999,431.335999 585.210999,427.875) t=0 [15] (584.085999,431.335999) tEnd=1 newWindSum=? newOppSum=? oppSum=? windSum=? windValue=0 oppValue=0
|
| 615 | SkOpSegment::markDone id=5 (585.210022,427.875 584.085999,431.335999) t=0 [9] (585.210022,427.875) tEnd=1 newWindSum=? newOppSum=? oppSum=? windSum=? windValue=0 oppValue=0
|
| 616 | -------------------------------------- findOverlaps
|
| 617 | SkOpSegment::debugShowActiveSpans id=1 (584.085999,431.335999 582.937988,430.960999 581.757996,431.085999 580.765991,431.593994) t=0 tEnd=1 windSum=? windValue=1
|
| 618 | SkOpSegment::debugShowActiveSpans id=2 (580.765991,431.593994 579.773987,432.10199 578.97699,432.97699 578.60199,434.125) t=0 tEnd=1 windSum=? windValue=1
|
| 619 | SkOpSegment::debugShowActiveSpans id=3 (578.60199,434.125 575.14801,433) t=0 tEnd=1 windSum=? windValue=1
|
| 620 | SkOpSegment::debugShowActiveSpans id=4 (575.14801,433 576.515015,428.796997 581.015015,426.515991 585.210022,427.875) t=0 tEnd=1 windSum=? windValue=1
|
| 621 | SkOpSegment::debugShowActiveSpans id=6 (586.875,436.812012 587.25,435.664001 587.125,434.5 586.617004,433.492004) t=0 tEnd=1 windSum=? windValue=1
|
| 622 | SkOpSegment::debugShowActiveSpans id=7 (586.617004,433.492004 586.101013,432.5 585.234009,431.703003 584.085999,431.335999) t=0 tEnd=1 windSum=? windValue=1
|
| 623 | SkOpSegment::debugShowActiveSpans id=9 (585.210999,427.875 589.406006,429.242004 591.695007,433.734009 590.328003,437.937012) t=0 tEnd=1 windSum=? windValue=1
|
| 624 | SkOpSegment::debugShowActiveSpans id=10 (590.328003,437.937012 586.875,436.812012) t=0 tEnd=1 windSum=? windValue=1
|
| 625 | SkOpSegment::debugShowActiveSpans id=16 (578.60199,434.125 578.234985,435.27301 578.35199,436.437012 578.859985,437.445007) t=0 tEnd=1 windSum=? windValue=1
|
| 626 | SkOpSegment::debugShowActiveSpans id=17 (578.859985,437.445007 579.367981,438.437012 580.250977,439.226013 581.398987,439.601013) t=0 tEnd=1 windSum=? windValue=1
|
| 627 | SkOpSegment::debugShowActiveSpans id=18 (581.398987,439.601013 581.398621,439.602173) t=0 tEnd=0.000339103907 windSum=? windValue=1
|
| 628 | SkOpSegment::debugShowActiveSpans id=19 (580.265991,443.054016 576.071373,441.687139 573.782422,437.202848 575.148621,433.000183) t=0 tEnd=0.999907158 windSum=? windValue=1
|
| 629 | SkOpSegment::debugShowActiveSpans id=19 (575.148621,433.000183 575.148747,432.999793 575.14886,432.999414 575.148987,432.999023) t=0.999907158 tEnd=1 windSum=? windValue=1
|
| 630 | SkOpSegment::debugShowActiveSpans id=20 (575.148987,432.999023 578.60199,434.125) t=0 tEnd=1 windSum=? windValue=1
|
| 631 | SkOpSegment::debugShowActiveSpans id=11 (581.39801,439.60199 582.539001,439.968994 583.710022,439.85199 584.710022,439.343994) t=0 tEnd=1 windSum=? windValue=1
|
| 632 | SkOpSegment::debugShowActiveSpans id=12 (584.710022,439.343994 585.702026,438.835999 586.499023,437.960999 586.874023,436.812988) t=0 tEnd=1 windSum=? windValue=1
|
| 633 | SkOpSegment::debugShowActiveSpans id=13 (586.874023,436.812988 590.327026,437.937988) t=0 tEnd=1 windSum=? windValue=1
|
| 634 | SkOpSegment::debugShowActiveSpans id=14 (590.327026,437.937988 588.952026,442.132996 584.468018,444.421997 580.265015,443.054993) t=0 tEnd=1 windSum=? windValue=1
|
| 635 | SkOpSegment::debugShowActiveSpans id=15 (580.265015,443.054993 580.265381,443.053833) t=0 tEnd=0.000339103907 windSum=? windValue=1
|
| 636 | -------------------------------------- calc_angles
|
| 637 | SkOpSegment::sortAngles [1] tStart=0 [1]
|
| 638 | SkOpSegment::sortAngles [2] tStart=1 [4]
|
| 639 | SkOpAngle::after [2/2] 5/5 tStart=1 tEnd=0 < [16/9] 21/25 tStart=0 tEnd=1 < [20/14] 13/13 tStart=1 tEnd=0 F 4
|
| 640 | SkOpAngle::afterPart {{{578.60199,434.125}, {578.97699,432.97699}, {579.773987,432.10199}, {580.765991,431.593994}}} id=2
|
| 641 | SkOpAngle::afterPart {{{578.60199,434.125}, {578.234985,435.27301}, {578.35199,436.437012}, {578.859985,437.445007}}} id=16
|
| 642 | SkOpAngle::afterPart {{{578.60199,434.125}, {575.148987,432.999023}}} id=20
|
| 643 | SkOpAngle::after [2/2] 5/5 tStart=1 tEnd=0 < [3/3] 13/13 tStart=0 tEnd=1 < [20/14] 13/13 tStart=1 tEnd=0 F 7
|
| 644 | SkOpAngle::afterPart {{{578.60199,434.125}, {578.97699,432.97699}, {579.773987,432.10199}, {580.765991,431.593994}}} id=2
|
| 645 | SkOpAngle::afterPart {{{578.60199,434.125}, {575.14801,433}}} id=3
|
| 646 | SkOpAngle::afterPart {{{578.60199,434.125}, {575.148987,432.999023}}} id=20
|
| 647 | SkOpAngle::after [20/14] 13/13 tStart=1 tEnd=0 < [3/3] 13/13 tStart=0 tEnd=1 < [16/9] 21/25 tStart=0 tEnd=1 T 7
|
| 648 | SkOpAngle::afterPart {{{578.60199,434.125}, {575.148987,432.999023}}} id=20
|
| 649 | SkOpAngle::afterPart {{{578.60199,434.125}, {575.14801,433}}} id=3
|
| 650 | SkOpAngle::afterPart {{{578.60199,434.125}, {578.234985,435.27301}, {578.35199,436.437012}, {578.859985,437.445007}}} id=16
|
| 651 | SkOpSegment::sortAngles [3] tStart=0 [5]
|
| 652 | SkOpSegment::sortAngles [3] tStart=1 [6]
|
| 653 | SkOpAngle::after [3/4] 29/29 tStart=1 tEnd=0 < [19/13] 5/5 tStart=0.999907158 tEnd=1 < [19/12] 21/25 tStart=0.999907158 tEnd=0 T 4
|
| 654 | SkOpAngle::afterPart {{{575.148621,433.000183}, {578.6026,434.125183}}} id=3
|
| 655 | SkOpAngle::afterPart {{{575.148621,433.000183}, {575.148987,432.999023}, {575.14886,432.999414}, {575.148987,432.999023}}} id=19
|
| 656 | SkOpAngle::afterPart {{{575.148621,433.000183}, {573.782422,437.202848}, {576.071373,441.687139}, {580.265991,443.054016}}} id=19
|
| 657 | SkOpAngle::after [3/4] 29/29 tStart=1 tEnd=0 < [4/5] 5/1 tStart=0 tEnd=1 < [19/13] 5/5 tStart=0.999907158 tEnd=1 T 7
|
| 658 | SkOpAngle::afterPart {{{575.14801,433}, {578.60199,434.125}}} id=3
|
| 659 | SkOpAngle::afterPart {{{575.14801,433}, {576.515015,428.796997}, {581.015015,426.515991}, {585.210022,427.875}}} id=4
|
| 660 | SkOpAngle::afterPart {{{575.14801,433}, {575.148376,432.99884}, {575.14825,432.999231}, {575.148376,432.99884}}} id=19
|
| 661 | SkOpSegment::sortAngles [4] tStart=0 [7]
|
| 662 | SkOpSegment::sortAngles [4] tStart=1 [8]
|
| 663 | SkOpSegment::sortAngles [7] tStart=1 [14]
|
| 664 | SkOpSegment::sortAngles [9] tStart=0 [17]
|
| 665 | SkOpSegment::sortAngles [16] tStart=0 [31]
|
| 666 | SkOpSegment::sortAngles [18] tStart=0.000339103907 [42]
|
| 667 | SkOpSegment::sortAngles [19] tStart=0 [37]
|
| 668 | SkOpSegment::sortAngles [19] tStart=0.999907158 [41]
|
| 669 | SkOpSegment::sortAngles [20] tStart=1 [40]
|
| 670 | SkOpSegment::sortAngles [11] tStart=0 [21]
|
| 671 | SkOpSegment::sortAngles [15] tStart=0.000339103907 [43]
|
| 672 | coinSpan - id=15 t=0.000339103907 tEnd=1
|
| 673 | coinSpan + id=18 t=1 tEnd=0.000339103907
|
| 674 | coinSpan - id=8 t=0 tEnd=1
|
| 675 | coinSpan + id=5 t=1 tEnd=0
|
| 676 | SkOpSpan::sortableTop dir=kTop seg=1 t=0.5 pt=(582.367493,431.133881)
|
| 677 | SkOpSpan::sortableTop [0] valid=1 operand=0 span=7 ccw=1 seg=4 {{{575.14801f, 433}, {576.515015f, 428.796997f}, {581.015015f, 426.515991f}, {585.210022f, 427.875f}}} t=0.774700227 pt=(582.367493,427.491089) slope=(12.4737739,-0.581920821)
|
| 678 | SkOpSpan::sortableTop [1] valid=1 operand=0 span=1 ccw=0 seg=1 {{{584.085999f, 431.335999f}, {582.937988f, 430.960999f}, {581.757996f, 431.085999f}, {580.765991f, 431.593994f}}} t=0.5 pt=(582.367493,431.133881) slope=(-3.375,0.287246704)
|
| 679 | SkOpSegment::markWinding id=4 (575.14801,433 576.515015,428.796997 581.015015,426.515991 585.210022,427.875) t=0 [7] (575.14801,433) tEnd=1 newWindSum=-1 newOppSum=0 oppSum=0 windSum=-1 windValue=1 oppValue=0
|
| 680 | SkOpSegment::nextChase mismatched signs
|
| 681 | SkOpSegment::markWinding id=9 (585.210999,427.875 589.406006,429.242004 591.695007,433.734009 590.328003,437.937012) t=0 [17] (585.210999,427.875) tEnd=1 newWindSum=-1 newOppSum=0 oppSum=? windSum=? windValue=1 oppValue=0
|
| 682 | SkOpSegment::markWinding id=10 (590.328003,437.937012 586.875,436.812012) t=0 [19] (590.328003,437.937012) tEnd=1 newWindSum=-1 newOppSum=0 oppSum=? windSum=? windValue=1 oppValue=0
|
| 683 | SkOpSegment::markWinding id=6 (586.875,436.812012 587.25,435.664001 587.125,434.5 586.617004,433.492004) t=0 [11] (586.875,436.812012) tEnd=1 newWindSum=-1 newOppSum=0 oppSum=? windSum=? windValue=1 oppValue=0
|
| 684 | SkOpSegment::markWinding id=7 (586.617004,433.492004 586.101013,432.5 585.234009,431.703003 584.085999,431.335999) t=0 [13] (586.617004,433.492004) tEnd=1 newWindSum=-1 newOppSum=0 oppSum=? windSum=? windValue=1 oppValue=0
|
| 685 | SkOpSegment::nextChase mismatched signs
|
| 686 | SkOpSegment::markWinding id=1 (584.085999,431.335999 582.937988,430.960999 581.757996,431.085999 580.765991,431.593994) t=0 [1] (584.085999,431.335999) tEnd=1 newWindSum=-1 newOppSum=0 oppSum=? windSum=? windValue=1 oppValue=0
|
| 687 | SkOpSegment::markWinding id=2 (580.765991,431.593994 579.773987,432.10199 578.97699,432.97699 578.60199,434.125) t=0 [3] (580.765991,431.593994) tEnd=1 newWindSum=-1 newOppSum=0 oppSum=? windSum=? windValue=1 oppValue=0
|
| 688 | SkOpSegment::markWinding id=4 (575.14801,433 576.515015,428.796997 581.015015,426.515991 585.210022,427.875) t=0 [7] (575.14801,433) tEnd=1 newWindSum=-1 newOppSum=0 oppSum=0 windSum=-1 windValue=1 oppValue=0
|
| 689 | SkOpSegment::nextChase mismatched signs
|
| 690 | SkOpSegment::findNextWinding simple
|
| 691 | SkOpSegment::markDone id=1 (584.085999,431.335999 582.937988,430.960999 581.757996,431.085999 580.765991,431.593994) t=0 [1] (584.085999,431.335999) tEnd=1 newWindSum=-1 newOppSum=0 oppSum=0 windSum=-1 windValue=1 oppValue=0
|
| 692 | bridgeWinding current id=1 from=(580.765991,431.593994) to=(584.085999,431.335999)
|
| 693 | path.moveTo(580.765991,431.593994);
|
| 694 | path.cubicTo(581.757996,431.085999, 582.937988,430.960999, 584.085999,431.335999);
|
| 695 | SkOpSegment::findNextWinding simple
|
| 696 | SkOpSegment::markDone id=7 (586.617004,433.492004 586.101013,432.5 585.234009,431.703003 584.085999,431.335999) t=0 [13] (586.617004,433.492004) tEnd=1 newWindSum=-1 newOppSum=0 oppSum=0 windSum=-1 windValue=1 oppValue=0
|
| 697 | bridgeWinding current id=7 from=(584.085999,431.335999) to=(586.617004,433.492004)
|
| 698 | path.cubicTo(585.234009,431.703003, 586.101013,432.5, 586.617004,433.492004);
|
| 699 | SkOpSegment::findNextWinding simple
|
| 700 | SkOpSegment::markDone id=6 (586.875,436.812012 587.25,435.664001 587.125,434.5 586.617004,433.492004) t=0 [11] (586.875,436.812012) tEnd=1 newWindSum=-1 newOppSum=0 oppSum=0 windSum=-1 windValue=1 oppValue=0
|
| 701 | bridgeWinding current id=6 from=(586.617004,433.492004) to=(586.875,436.812012)
|
| 702 | path.cubicTo(587.125,434.5, 587.25,435.664001, 586.875,436.812012);
|
| 703 | SkOpSegment::findNextWinding simple
|
| 704 | SkOpSegment::markDone id=10 (590.328003,437.937012 586.875,436.812012) t=0 [19] (590.328003,437.937012) tEnd=1 newWindSum=-1 newOppSum=0 oppSum=0 windSum=-1 windValue=1 oppValue=0
|
| 705 | bridgeWinding current id=10 from=(586.875,436.812012) to=(590.328003,437.937012)
|
| 706 | SkOpSegment::nextChase mismatched signs
|
| 707 | SkOpSegment::findNextWinding simple
|
| 708 | SkOpSegment::markDone id=9 (585.210999,427.875 589.406006,429.242004 591.695007,433.734009 590.328003,437.937012) t=0 [17] (585.210999,427.875) tEnd=1 newWindSum=-1 newOppSum=0 oppSum=0 windSum=-1 windValue=1 oppValue=0
|
| 709 | bridgeWinding current id=9 from=(590.328003,437.937012) to=(585.210999,427.875)
|
| 710 | path.lineTo(590.328003,437.937012);
|
| 711 | path.cubicTo(591.695007,433.734009, 589.406006,429.242004, 585.210999,427.875);
|
| 712 | SkOpSegment::markWinding id=19 (580.265991,443.054016 576.070984,441.687012 573.781982,437.202026 575.148987,432.999023) t=0.999907158 [41] (575.148621,433.000183) tEnd=1 newWindSum=1 windSum=? windValue=1
|
| 713 | SkOpSegment::markWinding id=20 (575.148987,432.999023 578.60199,434.125) t=0 [39] (575.148987,432.999023) tEnd=1 newWindSum=1 windSum=? windValue=1
|
| 714 | SkOpSegment::markAngle last seg=20 span=40
|
| 715 | SkOpSegment::markWinding id=19 (580.265991,443.054016 576.070984,441.687012 573.781982,437.202026 575.148987,432.999023) t=0 [37] (580.265991,443.054016) tEnd=0.999907158 newWindSum=1 windSum=? windValue=1
|
| 716 | SkOpSegment::nextChase mismatched signs
|
| 717 | SkOpSegment::markWinding id=15 (580.265015,443.054993 581.39801,439.60199) t=0 [29] (580.265015,443.054993) tEnd=0.000339103907 newWindSum=1 windSum=? windValue=1
|
| 718 | SkOpSegment::markWinding id=14 (590.327026,437.937988 588.952026,442.132996 584.468018,444.421997 580.265015,443.054993) t=0 [27] (590.327026,437.937988) tEnd=1 newWindSum=1 windSum=? windValue=1
|
| 719 | SkOpSegment::markWinding id=13 (586.874023,436.812988 590.327026,437.937988) t=0 [25] (586.874023,436.812988) tEnd=1 newWindSum=1 windSum=? windValue=1
|
| 720 | SkOpSegment::markWinding id=12 (584.710022,439.343994 585.702026,438.835999 586.499023,437.960999 586.874023,436.812988) t=0 [23] (584.710022,439.343994) tEnd=1 newWindSum=1 windSum=? windValue=1
|
| 721 | SkOpSegment::markWinding id=11 (581.39801,439.60199 582.539001,439.968994 583.710022,439.85199 584.710022,439.343994) t=0 [21] (581.39801,439.60199) tEnd=1 newWindSum=1 windSum=? windValue=1
|
| 722 | SkOpSegment::nextChase mismatched signs
|
| 723 | SkOpSegment::markWinding id=18 (581.398987,439.601013 580.265991,443.054016) t=0 [35] (581.398987,439.601013) tEnd=0.000339103907 newWindSum=1 windSum=? windValue=1
|
| 724 | SkOpSegment::markWinding id=17 (578.859985,437.445007 579.367981,438.437012 580.250977,439.226013 581.398987,439.601013) t=0 [33] (578.859985,437.445007) tEnd=1 newWindSum=1 windSum=? windValue=1
|
| 725 | SkOpSegment::markWinding id=16 (578.60199,434.125 578.234985,435.27301 578.35199,436.437012 578.859985,437.445007) t=0 [31] (578.60199,434.125) tEnd=1 newWindSum=1 windSum=? windValue=1
|
| 726 | SkOpSegment::markAngle last seg=16 span=31 windSum=1
|
| 727 | SkOpSegment::markWinding id=3 (578.60199,434.125 575.14801,433) t=0 [5] (578.60199,434.125) tEnd=1 newWindSum=-1 windSum=? windValue=1
|
| 728 | SkOpSegment::markAngle last seg=3 span=5 windSum=-1
|
| 729 | SkOpSegment::findNextWinding
|
| 730 | SkOpAngle::dumpOne [4/5] next=19/13 sect=5/1 s=0 [7] e=1 [8] sgn=-1 windVal=1 windSum=-1 oppVal=0 oppSum=0
|
| 731 | SkOpAngle::dumpOne [19/13] next=19/12 sect=5/5 s=0.999907158 [41] e=1 [38] sgn=-1 windVal=1 windSum=1
|
| 732 | SkOpAngle::dumpOne [19/12] next=3/4 sect=21/25 s=0.999907158 [41] e=0 [37] sgn=1 windVal=1 windSum=1
|
| 733 | SkOpAngle::dumpOne [3/4] next=4/5 sect=29/29 s=1 [6] e=0 [5] sgn=1 windVal=1 windSum=-1
|
| 734 | SkOpSegment::findNextWinding chase.append segment=20 span=40
|
| 735 | SkOpSegment::findNextWinding chase.append segment=16 span=31 windSum=1
|
| 736 | SkOpSegment::findNextWinding chase.append segment=3 span=5 windSum=-1
|
| 737 | SkOpSegment::markDone id=4 (575.14801,433 576.515015,428.796997 581.015015,426.515991 585.210022,427.875) t=0 [7] (575.14801,433) tEnd=1 newWindSum=-1 newOppSum=0 oppSum=0 windSum=-1 windValue=1 oppValue=0
|
| 738 | SkOpSegment::findNextWinding from:[4] to:[19] start=107589448 end=107588904
|
| 739 | bridgeWinding current id=4 from=(585.210022,427.875) to=(575.14801,433)
|
| 740 | path.cubicTo(581.015015,426.515991, 576.515015,428.796997, 575.14801,433);
|
| 741 | SkOpSegment::findNextWinding simple
|
| 742 | SkOpSegment::markDone id=19 (580.265991,443.054016 576.070984,441.687012 573.781982,437.202026 575.148987,432.999023) t=0.999907158 [41] (575.148621,433.000183) tEnd=1 newWindSum=1 newOppSum=? oppSum=? windSum=1 windValue=1 oppValue=0
|
| 743 | bridgeWinding current id=19 from=(575.148621,433.000183) to=(575.148987,432.999023)
|
| 744 | SkOpSegment::findNextWinding
|
| 745 | SkOpAngle::dumpOne [20/14] next=3/3 sect=13/13 s=1 [40] e=0 [39] sgn=1 windVal=1 windSum=1
|
| 746 | SkOpAngle::dumpOne [3/3] next=16/9 sect=13/13 s=0 [5] e=1 [6] sgn=-1 windVal=1 windSum=-1
|
| 747 | SkOpAngle::dumpOne [16/9] next=2/2 sect=21/25 s=0 [31] e=1 [32] sgn=-1 windVal=1 windSum=1
|
| 748 | SkOpAngle::dumpOne [2/2] next=20/14 sect=5/5 s=1 [4] e=0 [3] sgn=1 windVal=1 windSum=-1 oppVal=0 oppSum=0
|
| 749 | SkOpSegment::markDone id=16 (578.60199,434.125 578.234985,435.27301 578.35199,436.437012 578.859985,437.445007) t=0 [31] (578.60199,434.125) tEnd=1 newWindSum=1 newOppSum=? oppSum=? windSum=1 windValue=1 oppValue=0
|
| 750 | SkOpSegment::markDone id=17 (578.859985,437.445007 579.367981,438.437012 580.250977,439.226013 581.398987,439.601013) t=0 [33] (578.859985,437.445007) tEnd=1 newWindSum=1 newOppSum=? oppSum=? windSum=1 windValue=1 oppValue=0
|
| 751 | SkOpSegment::markDone id=18 (581.398987,439.601013 580.265991,443.054016) t=0 [35] (581.398987,439.601013) tEnd=0.000339103907 newWindSum=1 newOppSum=? oppSum=? windSum=1 windValue=1 oppValue=0
|
| 752 | SkOpSegment::nextChase mismatched signs
|
| 753 | SkOpSegment::markDone id=11 (581.39801,439.60199 582.539001,439.968994 583.710022,439.85199 584.710022,439.343994) t=0 [21] (581.39801,439.60199) tEnd=1 newWindSum=1 newOppSum=? oppSum=? windSum=1 windValue=1 oppValue=0
|
| 754 | SkOpSegment::markDone id=12 (584.710022,439.343994 585.702026,438.835999 586.499023,437.960999 586.874023,436.812988) t=0 [23] (584.710022,439.343994) tEnd=1 newWindSum=1 newOppSum=? oppSum=? windSum=1 windValue=1 oppValue=0
|
| 755 | SkOpSegment::markDone id=13 (586.874023,436.812988 590.327026,437.937988) t=0 [25] (586.874023,436.812988) tEnd=1 newWindSum=1 newOppSum=? oppSum=? windSum=1 windValue=1 oppValue=0
|
| 756 | SkOpSegment::markDone id=14 (590.327026,437.937988 588.952026,442.132996 584.468018,444.421997 580.265015,443.054993) t=0 [27] (590.327026,437.937988) tEnd=1 newWindSum=1 newOppSum=? oppSum=? windSum=1 windValue=1 oppValue=0
|
| 757 | SkOpSegment::markDone id=15 (580.265015,443.054993 581.39801,439.60199) t=0 [29] (580.265015,443.054993) tEnd=0.000339103907 newWindSum=1 newOppSum=? oppSum=? windSum=1 windValue=1 oppValue=0
|
| 758 | SkOpSegment::nextChase mismatched signs
|
| 759 | SkOpSegment::markDone id=19 (580.265991,443.054016 576.070984,441.687012 573.781982,437.202026 575.148987,432.999023) t=0 [37] (580.265991,443.054016) tEnd=0.999907158 newWindSum=1 newOppSum=? oppSum=? windSum=1 windValue=1 oppValue=0
|
| 760 | SkOpSegment::markDone id=2 (580.765991,431.593994 579.773987,432.10199 578.97699,432.97699 578.60199,434.125) t=0 [3] (580.765991,431.593994) tEnd=1 newWindSum=-1 newOppSum=0 oppSum=0 windSum=-1 windValue=1 oppValue=0
|
| 761 | SkOpSegment::markDone id=20 (575.148987,432.999023 578.60199,434.125) t=0 [39] (575.148987,432.999023) tEnd=1 newWindSum=1 newOppSum=? oppSum=? windSum=1 windValue=1 oppValue=0
|
| 762 | SkOpSegment::findNextWinding from:[20] to:[3] start=84323264 end=84323408
|
| 763 | bridgeWinding current id=20 from=(575.148987,432.999023) to=(578.60199,434.125)
|
| 764 | path.lineTo(575.148987,432.999023);
|
| 765 | SkOpSegment::findNextWinding
|
| 766 | SkOpAngle::dumpOne [3/4] next=4/5 sect=29/29 s=1 [6] e=0 [5] sgn=1 windVal=1 windSum=-1
|
| 767 | SkOpAngle::dumpOne [4/5] next=19/13 sect=5/1 s=0 [7] e=1 [8] sgn=-1 windVal=1 windSum=-1 oppVal=0 oppSum=0 done
|
| 768 | SkOpAngle::dumpOne [19/13] next=19/12 sect=5/5 s=0.999907158 [41] e=1 [38] sgn=-1 windVal=1 windSum=1 done
|
| 769 | SkOpAngle::dumpOne [19/12] next=3/4 sect=21/25 s=0.999907158 [41] e=0 [37] sgn=1 windVal=1 windSum=1 done
|
| 770 | SkOpSegment::markDone id=3 (578.60199,434.125 575.14801,433) t=0 [5] (578.60199,434.125) tEnd=1 newWindSum=-1 newOppSum=? oppSum=? windSum=-1 windValue=1 oppValue=0
|
| 771 | SkOpSegment::findNextWinding from:[3] to:[19] start=107589448 end=107588760
|
| 772 | bridgeWinding current id=3 from=(578.60199,434.125) to=(575.14801,433)
|
| 773 | path.lineTo(578.60199,434.125);
|
| 774 | path.lineTo(575.14801,433);
|
| 775 | </div> |
| 776 | |
| 777 | <div id="joel_9">
|
| 778 | SkDCubic::ComplexBreak
|
| 779 | {{{135.9219970703125, 286.843994140625}, {137.0699920654296875, 287.218994140625}, {138.24200439453125, 287.08599853515625}, {139.24200439453125, 286.5780029296875}}},
|
| 780 | maxCurvature[0]=0.792934788 {{{135.4119318213115264, 287.8851344587143899}, {141.7889152443062528, 285.8031681979956034}}},
|
| 781 | SkDCubic::ComplexBreak
|
| 782 | {{{144.8590087890625, 285.1719970703125}, {143.49200439453125, 289.375}, {138.99200439453125, 291.656005859375}, {134.7970123291015625, 290.2969970703125}}},
|
| 783 | maxCurvature[0]=0.500369557 {{{151.8091004853574191, 284.2739657784525775}, {129.9598379993292951, 295.3706402825127384}}},
|
| 784 | SkDCubic::ComplexBreak
|
| 785 | {{{133.13299560546875, 281.36700439453125}, {132.75799560546875, 282.50799560546875}, {132.88299560546875, 283.68701171875}, {133.3909912109375, 284.67901611328125}}},
|
| 786 | maxCurvature[0]=0.890138394 {{{131.9702953334127074, 281.2544561239553218}, {134.504877661677142, 287.4367308089338735}}},
|
| 787 | SkDCubic::ComplexBreak
|
| 788 | {{{134.7969970703125, 290.2960205078125}, {130.60198974609375, 288.92901611328125}, {128.3130035400390625, 284.43701171875}, {129.67999267578125, 280.24102783203125}}},
|
| 789 | maxCurvature[0]=0.501284828 {{{135.6786690755316727, 297.2365018076872047}, {124.6125777463847015, 275.3942315809875936}}},
|
| 790 | SkDCubic::ComplexBreak
|
| 791 | {{{138.6089935302734375, 278.57000732421875}, {137.46099853515625, 278.2030029296875}, {136.2969970703125, 278.3280029296875}, {135.2969970703125, 278.83599853515625}}},
|
| 792 | maxCurvature[0]=0.752685444 {{{139.2766403970662736, 277.5953584796508267}, {132.8559815638245141, 279.4666826521223584}}},
|
| 793 | SkDCubic::ComplexBreak
|
| 794 | {{{129.67999267578125, 280.24200439453125}, {131.0469970703125, 276.03900146484375}, {135.5389862060546875, 273.75799560546875}, {139.7419891357421875, 275.11700439453125}}},
|
| 795 | maxCurvature[0]=0.497337863 {{{122.7256959778976722, 281.2074843176263244}, {144.5112303093615367, 270.009707570421881}}},
|
| 796 | SkDCubic::ComplexBreak
|
| 797 | {{{141.406005859375, 284.05499267578125}, {141.77301025390625, 282.906982421875}, {141.64801025390625, 281.7349853515625}, {141.14801025390625, 280.7349853515625}}},
|
| 798 | maxCurvature[0]=0.832410427 {{{142.480311641757794, 284.4077599725231948}, {140.2541820165808417, 278.0948877187078097}}},
|
| 799 | SkDCubic::ComplexBreak
|
| 800 | {{{139.74200439453125, 275.11798095703125}, {143.93701171875, 276.49298095703125}, {146.2190093994140625, 280.97698974609375}, {144.8590087890625, 285.1729736328125}}},
|
| 801 | maxCurvature[0]=0.502822735 {{{138.8970629124157199, 268.1903632194039346}, {149.9014014889614828, 290.0464803476303359}}},
|
| 802 | <empty>
|
| 803 | <empty>
|
| 804 | seg=1 {{{135.921997f, 286.843994f}, {137.069992f, 287.218994f}, {138.242004f, 287.085999f}, {139.242004f, 286.578003f}}}
|
| 805 | seg=2 {{{139.242004f, 286.578003f}, {140.234009f, 286.078003f}, {141.031006f, 285.203003f}, {141.406006f, 284.054993f}}}
|
| 806 | seg=3 {{{141.406006f, 284.054993f}, {144.859009f, 285.171997f}}}
|
| 807 | seg=4 {{{144.859009f, 285.171997f}, {143.492004f, 289.375f}, {138.992004f, 291.656006f}, {134.797012f, 290.296997f}}}
|
| 808 | seg=5 {{{134.797012f, 290.296997f}, {135.921997f, 286.843994f}}}
|
| 809 | <empty>
|
| 810 | seg=6 {{{133.132996f, 281.367004f}, {132.757996f, 282.507996f}, {132.882996f, 283.687012f}, {133.390991f, 284.679016f}}}
|
| 811 | seg=7 {{{133.390991f, 284.679016f}, {133.906998f, 285.679016f}, {134.773987f, 286.468018f}, {135.921997f, 286.843018f}}}
|
| 812 | seg=8 {{{135.921997f, 286.843018f}, {134.796997f, 290.296021f}}}
|
| 813 | seg=9 {{{134.796997f, 290.296021f}, {130.60199f, 288.929016f}, {128.313004f, 284.437012f}, {129.679993f, 280.241028f}}}
|
| 814 | seg=10 {{{129.679993f, 280.241028f}, {133.132996f, 281.367004f}}}
|
| 815 | <empty>
|
| 816 | seg=11 {{{138.608994f, 278.570007f}, {137.460999f, 278.203003f}, {136.296997f, 278.328003f}, {135.296997f, 278.835999f}}}
|
| 817 | seg=12 {{{135.296997f, 278.835999f}, {134.296997f, 279.343994f}, {133.507996f, 280.218994f}, {133.132996f, 281.367004f}}}
|
| 818 | seg=13 {{{133.132996f, 281.367004f}, {129.679993f, 280.242004f}}}
|
| 819 | seg=14 {{{129.679993f, 280.242004f}, {131.046997f, 276.039001f}, {135.538986f, 273.757996f}, {139.741989f, 275.117004f}}}
|
| 820 | seg=15 {{{139.741989f, 275.117004f}, {138.608994f, 278.570007f}}}
|
| 821 | seg=16 {{{141.406006f, 284.054993f}, {141.77301f, 282.906982f}, {141.64801f, 281.734985f}, {141.14801f, 280.734985f}}}
|
| 822 | seg=17 {{{141.14801f, 280.734985f}, {140.625015f, 279.734985f}, {139.757004f, 278.945984f}, {138.609009f, 278.570984f}}}
|
| 823 | seg=18 {{{138.609009f, 278.570984f}, {139.742004f, 275.117981f}}}
|
| 824 | seg=19 {{{139.742004f, 275.117981f}, {143.937012f, 276.492981f}, {146.219009f, 280.97699f}, {144.859009f, 285.172974f}}}
|
| 825 | seg=20 {{{144.859009f, 285.172974f}, {141.406006f, 284.054993f}}}
|
| 826 | debugShowCubicIntersection wtTs[0]=1 {{{138.608994,278.570007}, {137.460999,278.203003}, {136.296997,278.328003}, {135.296997,278.835999}}} {{135.296997,278.835999}} wnTs[0]=0 {{{135.296997,278.835999}, {134.296997,279.343994}, {133.507996,280.218994}, {133.132996,281.367004}}}
|
| 827 | debugShowCubicIntersection no intersect {{{138.608994,278.570007}, {137.460999,278.203003}, {136.296997,278.328003}, {135.296997,278.835999}}} {{{129.679993,280.242004}, {131.046997,276.039001}, {135.538986,273.757996}, {139.741989,275.117004}}}
|
| 828 | debugShowCubicLineIntersection wtTs[0]=0 {{{138.608994,278.570007}, {137.460999,278.203003}, {136.296997,278.328003}, {135.296997,278.835999}}} {{138.608994,278.570007}} wnTs[0]=1 {{{139.741989,275.117004}, {138.608994,278.570007}}}
|
| 829 | debugShowCubicLineIntersection wtTs[0]=1 {{{135.296997,278.835999}, {134.296997,279.343994}, {133.507996,280.218994}, {133.132996,281.367004}}} {{133.132996,281.367004}} wnTs[0]=0 {{{133.132996,281.367004}, {129.679993,280.242004}}}
|
| 830 | debugShowCubicIntersection no intersect {{{135.296997,278.835999}, {134.296997,279.343994}, {133.507996,280.218994}, {133.132996,281.367004}}} {{{129.679993,280.242004}, {131.046997,276.039001}, {135.538986,273.757996}, {139.741989,275.117004}}}
|
| 831 | debugShowCubicLineIntersection wtTs[0]=0 {{{129.679993,280.242004}, {131.046997,276.039001}, {135.538986,273.757996}, {139.741989,275.117004}}} {{129.679993,280.242004}} wnTs[0]=1 {{{133.132996,281.367004}, {129.679993,280.242004}}}
|
| 832 | debugShowCubicLineIntersection wtTs[0]=1 {{{129.679993,280.242004}, {131.046997,276.039001}, {135.538986,273.757996}, {139.741989,275.117004}}} {{139.741989,275.117004}} wnTs[0]=0 {{{139.741989,275.117004}, {138.608994,278.570007}}}
|
| 833 | debugShowCubicIntersection no intersect {{{138.608994,278.570007}, {137.460999,278.203003}, {136.296997,278.328003}, {135.296997,278.835999}}} {{{141.14801,280.734985}, {140.625015,279.734985}, {139.757004,278.945984}, {138.609009,278.570984}}}
|
| 834 | debugShowCubicLineIntersection wtTs[0]=0 {{{138.608994,278.570007}, {137.460999,278.203003}, {136.296997,278.328003}, {135.296997,278.835999}}} {{138.608994,278.570007}} wnTs[0]=0.000254017 {{{138.609009,278.570984}, {139.742004,275.117981}}}
|
| 835 | SkOpSegment::addT insert t=0.00025401744 segID=18 spanID=41
|
| 836 | debugShowCubicIntersection no intersect {{{129.679993,280.242004}, {131.046997,276.039001}, {135.538986,273.757996}, {139.741989,275.117004}}} {{{141.14801,280.734985}, {140.625015,279.734985}, {139.757004,278.945984}, {138.609009,278.570984}}}
|
| 837 | debugShowCubicLineIntersection no intersect {{{129.679993,280.242004}, {131.046997,276.039001}, {135.538986,273.757996}, {139.741989,275.117004}}} {{{138.609009,278.570984}, {139.742004,275.117981}}}
|
| 838 | debugShowCubicIntersection no intersect {{{129.679993,280.242004}, {131.046997,276.039001}, {135.538986,273.757996}, {139.741989,275.117004}}} {{{139.742004,275.117981}, {143.937012,276.492981}, {146.219009,280.97699}, {144.859009,285.172974}}}
|
| 839 | debugShowLineIntersection wtTs[0]=0.00025401744 {{{139.741989,275.117004}, {138.608994,278.570007}}} {{139.742004,275.117981}} wtTs[1]=1 {{138.608994,278.570007}} wnTs[0]=1 {{{138.609009,278.570984}, {139.742004,275.117981}}} wnTs[1]=0.00025401744
|
| 840 | SkOpSegment::addT insert t=0.00025401744 segID=15 spanID=42
|
| 841 | debugShowCubicLineIntersection wtTs[0]=0 {{{139.742004,275.117981}, {143.937012,276.492981}, {146.219009,280.97699}, {144.859009,285.172974}}} {{139.742004,275.117981}} wnTs[0]=0.000254017 {{{139.741989,275.117004}, {138.608994,278.570007}}}
|
| 842 | debugShowCubicIntersection wtTs[0]=1 {{{135.296997,278.835999}, {134.296997,279.343994}, {133.507996,280.218994}, {133.132996,281.367004}}} {{133.132996,281.367004}} wnTs[0]=0 {{{133.132996,281.367004}, {132.757996,282.507996}, {132.882996,283.687012}, {133.390991,284.679016}}}
|
| 843 | debugShowCubicIntersection no intersect {{{135.296997,278.835999}, {134.296997,279.343994}, {133.507996,280.218994}, {133.132996,281.367004}}} {{{134.796997,290.296021}, {130.60199,288.929016}, {128.313004,284.437012}, {129.679993,280.241028}}}
|
| 844 | debugShowCubicLineIntersection wtTs[0]=1 {{{135.296997,278.835999}, {134.296997,279.343994}, {133.507996,280.218994}, {133.132996,281.367004}}} {{133.132996,281.367004}} wnTs[0]=1 {{{129.679993,280.241028}, {133.132996,281.367004}}}
|
| 845 | debugShowCubicLineIntersection wtTs[0]=0 {{{133.132996,281.367004}, {132.757996,282.507996}, {132.882996,283.687012}, {133.390991,284.679016}}} {{133.132996,281.367004}} wnTs[0]=0 {{{133.132996,281.367004}, {129.679993,280.242004}}}
|
| 846 | debugShowCubicLineIntersection no intersect {{{134.796997,290.296021}, {130.60199,288.929016}, {128.313004,284.437012}, {129.679993,280.241028}}} {{{133.132996,281.367004}, {129.679993,280.242004}}}
|
| 847 | debugShowLineIntersection wtTs[0]=0 {{{133.132996,281.367004}, {129.679993,280.242004}}} {{133.132996,281.367004}} wnTs[0]=1 {{{129.679993,280.241028}, {133.132996,281.367004}}}
|
| 848 | debugShowCubicIntersection no intersect {{{129.679993,280.242004}, {131.046997,276.039001}, {135.538986,273.757996}, {139.741989,275.117004}}} {{{134.796997,290.296021}, {130.60199,288.929016}, {128.313004,284.437012}, {129.679993,280.241028}}}
|
| 849 | debugShowCubicLineIntersection wtTs[0]=7.00240426e-05 {{{129.679993,280.242004}, {131.046997,276.039001}, {135.538986,273.757996}, {139.741989,275.117004}}} {{129.680283,280.241119}} wnTs[0]=8.31785e-05 {{{129.679993,280.241028}, {133.132996,281.367004}}}
|
| 850 | SkOpSegment::addT insert t=7.00240426e-05 segID=14 spanID=43
|
| 851 | debugShowCubicIntersection wtTs[0]=1 {{{141.406006,284.054993}, {141.77301,282.906982}, {141.64801,281.734985}, {141.14801,280.734985}}} {{141.14801,280.734985}} wnTs[0]=0 {{{141.14801,280.734985}, {140.625015,279.734985}, {139.757004,278.945984}, {138.609009,278.570984}}}
|
| 852 | debugShowCubicIntersection no intersect {{{141.406006,284.054993}, {141.77301,282.906982}, {141.64801,281.734985}, {141.14801,280.734985}}} {{{139.742004,275.117981}, {143.937012,276.492981}, {146.219009,280.97699}, {144.859009,285.172974}}}
|
| 853 | debugShowCubicLineIntersection wtTs[0]=0 {{{141.406006,284.054993}, {141.77301,282.906982}, {141.64801,281.734985}, {141.14801,280.734985}}} {{141.406006,284.054993}} wnTs[0]=1 {{{144.859009,285.172974}, {141.406006,284.054993}}}
|
| 854 | debugShowCubicLineIntersection wtTs[0]=1 {{{141.14801,280.734985}, {140.625015,279.734985}, {139.757004,278.945984}, {138.609009,278.570984}}} {{138.609009,278.570984}} wnTs[0]=0 {{{138.609009,278.570984}, {139.742004,275.117981}}}
|
| 855 | debugShowCubicIntersection no intersect {{{141.14801,280.734985}, {140.625015,279.734985}, {139.757004,278.945984}, {138.609009,278.570984}}} {{{139.742004,275.117981}, {143.937012,276.492981}, {146.219009,280.97699}, {144.859009,285.172974}}}
|
| 856 | debugShowCubicLineIntersection wtTs[0]=0 {{{139.742004,275.117981}, {143.937012,276.492981}, {146.219009,280.97699}, {144.859009,285.172974}}} {{139.742004,275.117981}} wnTs[0]=1 {{{138.609009,278.570984}, {139.742004,275.117981}}}
|
| 857 | debugShowCubicLineIntersection wtTs[0]=1 {{{139.742004,275.117981}, {143.937012,276.492981}, {146.219009,280.97699}, {144.859009,285.172974}}} {{144.859009,285.172974}} wnTs[0]=0 {{{144.859009,285.172974}, {141.406006,284.054993}}}
|
| 858 | debugShowCubicIntersection wtTs[0]=0 {{{141.406006,284.054993}, {141.77301,282.906982}, {141.64801,281.734985}, {141.14801,280.734985}}} {{141.406006,284.054993}} wnTs[0]=1 {{{139.242004,286.578003}, {140.234009,286.078003}, {141.031006,285.203003}, {141.406006,284.054993}}}
|
| 859 | debugShowCubicLineIntersection wtTs[0]=0 {{{141.406006,284.054993}, {141.77301,282.906982}, {141.64801,281.734985}, {141.14801,280.734985}}} {{141.406006,284.054993}} wnTs[0]=0 {{{141.406006,284.054993}, {144.859009,285.171997}}}
|
| 860 | debugShowCubicIntersection no intersect {{{139.742004,275.117981}, {143.937012,276.492981}, {146.219009,280.97699}, {144.859009,285.172974}}} {{{139.242004,286.578003}, {140.234009,286.078003}, {141.031006,285.203003}, {141.406006,284.054993}}}
|
| 861 | debugShowCubicLineIntersection no intersect {{{139.742004,275.117981}, {143.937012,276.492981}, {146.219009,280.97699}, {144.859009,285.172974}}} {{{141.406006,284.054993}, {144.859009,285.171997}}}
|
| 862 | debugShowCubicIntersection no intersect {{{139.742004,275.117981}, {143.937012,276.492981}, {146.219009,280.97699}, {144.859009,285.172974}}} {{{144.859009,285.171997}, {143.492004,289.375}, {138.992004,291.656006}, {134.797012,290.296997}}}
|
| 863 | debugShowCubicLineIntersection wtTs[0]=1 {{{139.242004,286.578003}, {140.234009,286.078003}, {141.031006,285.203003}, {141.406006,284.054993}}} {{141.406006,284.054993}} wnTs[0]=1 {{{144.859009,285.172974}, {141.406006,284.054993}}}
|
| 864 | debugShowLineIntersection wtTs[0]=1 {{{144.859009,285.172974}, {141.406006,284.054993}}} {{141.406006,284.054993}} wnTs[0]=0 {{{141.406006,284.054993}, {144.859009,285.171997}}}
|
| 865 | debugShowCubicLineIntersection wtTs[0]=7.00717611e-05 {{{144.859009,285.171997}, {143.492004,289.375}, {138.992004,291.656006}, {134.797012,290.296997}}} {{144.858719,285.172882}} wnTs[0]=8.32352e-05 {{{144.859009,285.172974}, {141.406006,284.054993}}}
|
| 866 | SkOpSegment::addT insert t=7.00717611e-05 segID=4 spanID=44
|
| 867 | debugShowCubicIntersection wtTs[0]=1 {{{133.132996,281.367004}, {132.757996,282.507996}, {132.882996,283.687012}, {133.390991,284.679016}}} {{133.390991,284.679016}} wnTs[0]=0 {{{133.390991,284.679016}, {133.906998,285.679016}, {134.773987,286.468018}, {135.921997,286.843018}}}
|
| 868 | debugShowCubicIntersection no intersect {{{133.132996,281.367004}, {132.757996,282.507996}, {132.882996,283.687012}, {133.390991,284.679016}}} {{{134.796997,290.296021}, {130.60199,288.929016}, {128.313004,284.437012}, {129.679993,280.241028}}}
|
| 869 | debugShowCubicLineIntersection wtTs[0]=0 {{{133.132996,281.367004}, {132.757996,282.507996}, {132.882996,283.687012}, {133.390991,284.679016}}} {{133.132996,281.367004}} wnTs[0]=1 {{{129.679993,280.241028}, {133.132996,281.367004}}}
|
| 870 | debugShowCubicLineIntersection wtTs[0]=1 {{{133.390991,284.679016}, {133.906998,285.679016}, {134.773987,286.468018}, {135.921997,286.843018}}} {{135.921997,286.843018}} wnTs[0]=0 {{{135.921997,286.843018}, {134.796997,290.296021}}}
|
| 871 | debugShowCubicIntersection no intersect {{{133.390991,284.679016}, {133.906998,285.679016}, {134.773987,286.468018}, {135.921997,286.843018}}} {{{134.796997,290.296021}, {130.60199,288.929016}, {128.313004,284.437012}, {129.679993,280.241028}}}
|
| 872 | debugShowCubicLineIntersection wtTs[0]=0 {{{134.796997,290.296021}, {130.60199,288.929016}, {128.313004,284.437012}, {129.679993,280.241028}}} {{134.796997,290.296021}} wnTs[0]=1 {{{135.921997,286.843018}, {134.796997,290.296021}}}
|
| 873 | debugShowCubicLineIntersection wtTs[0]=1 {{{134.796997,290.296021}, {130.60199,288.929016}, {128.313004,284.437012}, {129.679993,280.241028}}} {{129.679993,280.241028}} wnTs[0]=0 {{{129.679993,280.241028}, {133.132996,281.367004}}}
|
| 874 | debugShowCubicIntersection no intersect {{{133.390991,284.679016}, {133.906998,285.679016}, {134.773987,286.468018}, {135.921997,286.843018}}} {{{135.921997,286.843994}, {137.069992,287.218994}, {138.242004,287.085999}, {139.242004,286.578003}}}
|
| 875 | debugShowCubicIntersection no intersect {{{133.390991,284.679016}, {133.906998,285.679016}, {134.773987,286.468018}, {135.921997,286.843018}}} {{{144.859009,285.171997}, {143.492004,289.375}, {138.992004,291.656006}, {134.797012,290.296997}}}
|
| 876 | debugShowCubicLineIntersection wtTs[0]=0 {{{135.921997,286.843994}, {137.069992,287.218994}, {138.242004,287.085999}, {139.242004,286.578003}}} {{135.921997,286.843994}} wnTs[0]=0.000255676 {{{135.921997,286.843018}, {134.796997,290.296021}}}
|
| 877 | SkOpSegment::addT insert t=0.000255675976 segID=8 spanID=45
|
| 878 | debugShowCubicLineIntersection no intersect {{{144.859009,285.171997}, {143.492004,289.375}, {138.992004,291.656006}, {134.797012,290.296997}}} {{{135.921997,286.843018}, {134.796997,290.296021}}}
|
| 879 | debugShowLineIntersection wtTs[0]=0.000255675976 {{{135.921997,286.843018}, {134.796997,290.296021}}} {{135.921997,286.843994}} wtTs[1]=1 {{134.796997,290.296021}} wnTs[0]=1 {{{134.797012,290.296997}, {135.921997,286.843994}}} wnTs[1]=0.000254375091
|
| 880 | SkOpSegment::addT insert t=0.000254375091 segID=5 spanID=46
|
| 881 | debugShowCubicIntersection no intersect {{{134.796997,290.296021}, {130.60199,288.929016}, {128.313004,284.437012}, {129.679993,280.241028}}} {{{144.859009,285.171997}, {143.492004,289.375}, {138.992004,291.656006}, {134.797012,290.296997}}}
|
| 882 | debugShowCubicLineIntersection wtTs[0]=0 {{{134.796997,290.296021}, {130.60199,288.929016}, {128.313004,284.437012}, {129.679993,280.241028}}} {{134.796997,290.296021}} wnTs[0]=0.000254375 {{{134.797012,290.296997}, {135.921997,286.843994}}}
|
| 883 | debugShowCubicIntersection wtTs[0]=1 {{{135.921997,286.843994}, {137.069992,287.218994}, {138.242004,287.085999}, {139.242004,286.578003}}} {{139.242004,286.578003}} wnTs[0]=0 {{{139.242004,286.578003}, {140.234009,286.078003}, {141.031006,285.203003}, {141.406006,284.054993}}}
|
| 884 | debugShowCubicIntersection no intersect {{{135.921997,286.843994}, {137.069992,287.218994}, {138.242004,287.085999}, {139.242004,286.578003}}} {{{144.859009,285.171997}, {143.492004,289.375}, {138.992004,291.656006}, {134.797012,290.296997}}}
|
| 885 | debugShowCubicLineIntersection wtTs[0]=0 {{{135.921997,286.843994}, {137.069992,287.218994}, {138.242004,287.085999}, {139.242004,286.578003}}} {{135.921997,286.843994}} wnTs[0]=1 {{{134.797012,290.296997}, {135.921997,286.843994}}}
|
| 886 | debugShowCubicLineIntersection wtTs[0]=1 {{{139.242004,286.578003}, {140.234009,286.078003}, {141.031006,285.203003}, {141.406006,284.054993}}} {{141.406006,284.054993}} wnTs[0]=0 {{{141.406006,284.054993}, {144.859009,285.171997}}}
|
| 887 | debugShowCubicIntersection no intersect {{{139.242004,286.578003}, {140.234009,286.078003}, {141.031006,285.203003}, {141.406006,284.054993}}} {{{144.859009,285.171997}, {143.492004,289.375}, {138.992004,291.656006}, {134.797012,290.296997}}}
|
| 888 | debugShowCubicLineIntersection wtTs[0]=0 {{{144.859009,285.171997}, {143.492004,289.375}, {138.992004,291.656006}, {134.797012,290.296997}}} {{144.859009,285.171997}} wnTs[0]=1 {{{141.406006,284.054993}, {144.859009,285.171997}}}
|
| 889 | debugShowCubicLineIntersection wtTs[0]=1 {{{144.859009,285.171997}, {143.492004,289.375}, {138.992004,291.656006}, {134.797012,290.296997}}} {{134.797012,290.296997}} wnTs[0]=0 {{{134.797012,290.296997}, {135.921997,286.843994}}}
|
| 890 | ------------------x--x---------------- addExpanded
|
| 891 | 00: seg/base=5/46 seg/base=8/45 MarkCoinStart
|
| 892 | 01: seg/base=5/10 seg/base=8/16 MarkCoinEnd
|
| 893 | 02: seg/base=18/41 seg/base=15/42 MarkCoinStart
|
| 894 | 03: seg/base=18/36 seg/base=15/30 MarkCoinEnd
|
| 895 | SkOpSegment::debugShowActiveSpans id=11 (138.608994,278.570007 137.460999,278.203003 136.296997,278.328003 135.296997,278.835999) t=0 tEnd=1 windSum=? windValue=1
|
| 896 | SkOpSegment::debugShowActiveSpans id=12 (135.296997,278.835999 134.296997,279.343994 133.507996,280.218994 133.132996,281.367004) t=0 tEnd=1 windSum=? windValue=1
|
| 897 | SkOpSegment::debugShowActiveSpans id=13 (133.132996,281.367004 129.679993,280.242004) t=0 tEnd=1 windSum=? windValue=1
|
| 898 | SkOpSegment::debugShowActiveSpans id=14 (129.679993,280.242004 129.680088,280.24171 129.680187,280.241414 129.680283,280.241119) t=0 tEnd=7.00240426e-05 windSum=? windValue=1
|
| 899 | SkOpSegment::debugShowActiveSpans id=14 (129.680283,280.241119 131.047629,276.03868 135.539281,273.758091 139.741989,275.117004) t=7.00240426e-05 tEnd=1 windSum=? windValue=1
|
| 900 | SkOpSegment::debugShowActiveSpans id=15 (139.741989,275.117004 139.741699,275.117889) t=0 tEnd=0.00025401744 windSum=? windValue=1
|
| 901 | SkOpSegment::debugShowActiveSpans id=15 (139.741699,275.117889 138.608994,278.570007) t=0.00025401744 tEnd=1 windSum=? windValue=1
|
| 902 | SkOpSegment::debugShowActiveSpans id=16 (141.406006,284.054993 141.77301,282.906982 141.64801,281.734985 141.14801,280.734985) t=0 tEnd=1 windSum=? windValue=1
|
| 903 | SkOpSegment::debugShowActiveSpans id=17 (141.14801,280.734985 140.625015,279.734985 139.757004,278.945984 138.609009,278.570984) t=0 tEnd=1 windSum=? windValue=1
|
| 904 | SkOpSegment::debugShowActiveSpans id=18 (138.609009,278.570984 138.609299,278.570099) t=0 tEnd=0.00025401744 windSum=? windValue=1
|
| 905 | SkOpSegment::debugShowActiveSpans id=18 (138.609299,278.570099 139.742004,275.117981) t=0.00025401744 tEnd=1 windSum=? windValue=1
|
| 906 | SkOpSegment::debugShowActiveSpans id=19 (139.742004,275.117981 143.937012,276.492981 146.219009,280.97699 144.859009,285.172974) t=0 tEnd=1 windSum=? windValue=1
|
| 907 | SkOpSegment::debugShowActiveSpans id=20 (144.859009,285.172974 141.406006,284.054993) t=0 tEnd=1 windSum=? windValue=1
|
| 908 | SkOpSegment::debugShowActiveSpans id=6 (133.132996,281.367004 132.757996,282.507996 132.882996,283.687012 133.390991,284.679016) t=0 tEnd=1 windSum=? windValue=1
|
| 909 | SkOpSegment::debugShowActiveSpans id=7 (133.390991,284.679016 133.906998,285.679016 134.773987,286.468018 135.921997,286.843018) t=0 tEnd=1 windSum=? windValue=1
|
| 910 | SkOpSegment::debugShowActiveSpans id=8 (135.921997,286.843018 135.921707,286.843903) t=0 tEnd=0.000255675976 windSum=? windValue=1
|
| 911 | SkOpSegment::debugShowActiveSpans id=8 (135.921707,286.843903 134.796997,290.296021) t=0.000255675976 tEnd=1 windSum=? windValue=1
|
| 912 | SkOpSegment::debugShowActiveSpans id=9 (134.796997,290.296021 130.60199,288.929016 128.313004,284.437012 129.679993,280.241028) t=0 tEnd=1 windSum=? windValue=1
|
| 913 | SkOpSegment::debugShowActiveSpans id=10 (129.679993,280.241028 133.132996,281.367004) t=0 tEnd=1 windSum=? windValue=1
|
| 914 | SkOpSegment::debugShowActiveSpans id=1 (135.921997,286.843994 137.069992,287.218994 138.242004,287.085999 139.242004,286.578003) t=0 tEnd=1 windSum=? windValue=1
|
| 915 | SkOpSegment::debugShowActiveSpans id=2 (139.242004,286.578003 140.234009,286.078003 141.031006,285.203003 141.406006,284.054993) t=0 tEnd=1 windSum=? windValue=1
|
| 916 | SkOpSegment::debugShowActiveSpans id=3 (141.406006,284.054993 144.859009,285.171997) t=0 tEnd=1 windSum=? windValue=1
|
| 917 | SkOpSegment::debugShowActiveSpans id=4 (144.859009,285.171997 144.858913,285.172292 144.858815,285.172588 144.858719,285.172882) t=0 tEnd=7.00717611e-05 windSum=? windValue=1
|
| 918 | SkOpSegment::debugShowActiveSpans id=4 (144.858719,285.172882 143.491371,289.375321 138.99171,291.655911 134.797012,290.296997) t=7.00717611e-05 tEnd=1 windSum=? windValue=1
|
| 919 | SkOpSegment::debugShowActiveSpans id=5 (134.797012,290.296997 134.797302,290.296112) t=0 tEnd=0.000254375091 windSum=? windValue=1
|
| 920 | SkOpSegment::debugShowActiveSpans id=5 (134.797302,290.296112 135.921997,286.843994) t=0.000254375091 tEnd=1 windSum=? windValue=1
|
| 921 | ------------------x--x---------------- move_multiples
|
| 922 | 00: seg/base=5/46 seg/base=8/45 MarkCoinStart
|
| 923 | 01: seg/base=5/10 seg/base=8/16 MarkCoinEnd
|
| 924 | 02: seg/base=18/41 seg/base=15/42 MarkCoinStart
|
| 925 | 03: seg/base=18/36 seg/base=15/30 MarkCoinEnd
|
| 926 | ------------------x--x---------------- move_nearby
|
| 927 | 00: seg/base=5/46 seg/base=8/45 MarkCoinStart
|
| 928 | 01: seg/base=5/10 seg/base=8/16 MarkCoinEnd
|
| 929 | 02: seg/base=18/41 seg/base=15/42 MarkCoinStart
|
| 930 | 03: seg/base=18/36 seg/base=15/30 MarkCoinEnd
|
| 931 | ------------------x--x---------------- correctEnds
|
| 932 | 00: seg/base=5/46 seg/base=8/45 MarkCoinStart
|
| 933 | 01: seg/base=5/10 seg/base=8/16 MarkCoinEnd
|
| 934 | 02: seg/base=18/41 seg/base=15/42 MarkCoinStart
|
| 935 | 03: seg/base=18/36 seg/base=15/30 MarkCoinEnd
|
| 936 | ------------------x--x---------------- addEndMovedSpans
|
| 937 | 00: seg/base=5/46 seg/base=8/45 MarkCoinStart
|
| 938 | 01: seg/base=5/10 seg/base=8/16 MarkCoinEnd
|
| 939 | 02: seg/base=18/41 seg/base=15/42 MarkCoinStart
|
| 940 | 03: seg/base=18/36 seg/base=15/30 MarkCoinEnd
|
| 941 | ------------------x--x---------------- expand
|
| 942 | 00: seg/base=5/46 seg/base=8/45 MarkCoinStart
|
| 943 | 01: seg/base=5/10 seg/base=8/16 MarkCoinEnd
|
| 944 | 02: seg/base=18/41 seg/base=15/42 MarkCoinStart
|
| 945 | 03: seg/base=18/36 seg/base=15/30 MarkCoinEnd
|
| 946 | ------------------x--x---------------- addExpanded
|
| 947 | 00: seg/base=5/46 seg/base=8/45 MarkCoinStart
|
| 948 | 01: seg/base=5/10 seg/base=8/16 MarkCoinEnd
|
| 949 | 02: seg/base=18/41 seg/base=15/42 MarkCoinStart
|
| 950 | 03: seg/base=18/36 seg/base=15/30 MarkCoinEnd
|
| 951 | ------------------x--x---------------- mark
|
| 952 | 00: seg/base=5/46 seg/base=8/45 MarkCoinStart
|
| 953 | 01: seg/base=5/10 seg/base=8/16 MarkCoinEnd
|
| 954 | 02: seg/base=18/41 seg/base=15/42 MarkCoinStart
|
| 955 | 03: seg/base=18/36 seg/base=15/30 MarkCoinEnd
|
| 956 | -------------------------------------- missing_coincidence
|
| 957 | -------------------------------------- expand
|
| 958 | -------------------------------------- expand
|
| 959 | -------------------------------------- apply
|
| 960 | SkOpSegment::markDone id=5 (134.797012,290.296997 135.921997,286.843994) t=0.000254375091 [46] (134.797302,290.296112) tEnd=1 newWindSum=? newOppSum=? oppSum=? windSum=? windValue=0 oppValue=0
|
| 961 | SkOpSegment::markDone id=8 (135.921997,286.843018 134.796997,290.296021) t=0.000255675976 [45] (135.921707,286.843903) tEnd=1 newWindSum=? newOppSum=? oppSum=? windSum=? windValue=0 oppValue=0
|
| 962 | SkOpSegment::markDone id=18 (138.609009,278.570984 139.742004,275.117981) t=0.00025401744 [41] (138.609299,278.570099) tEnd=1 newWindSum=? newOppSum=? oppSum=? windSum=? windValue=0 oppValue=0
|
| 963 | SkOpSegment::markDone id=15 (139.741989,275.117004 138.608994,278.570007) t=0.00025401744 [42] (139.741699,275.117889) tEnd=1 newWindSum=? newOppSum=? oppSum=? windSum=? windValue=0 oppValue=0
|
| 964 | -------------------------------------- findOverlaps
|
| 965 | SkOpSegment::debugShowActiveSpans id=11 (138.608994,278.570007 137.460999,278.203003 136.296997,278.328003 135.296997,278.835999) t=0 tEnd=1 windSum=? windValue=1
|
| 966 | SkOpSegment::debugShowActiveSpans id=12 (135.296997,278.835999 134.296997,279.343994 133.507996,280.218994 133.132996,281.367004) t=0 tEnd=1 windSum=? windValue=1
|
| 967 | SkOpSegment::debugShowActiveSpans id=13 (133.132996,281.367004 129.679993,280.242004) t=0 tEnd=1 windSum=? windValue=1
|
| 968 | SkOpSegment::debugShowActiveSpans id=14 (129.679993,280.242004 129.680088,280.24171 129.680187,280.241414 129.680283,280.241119) t=0 tEnd=7.00240426e-05 windSum=? windValue=1
|
| 969 | SkOpSegment::debugShowActiveSpans id=14 (129.680283,280.241119 131.047629,276.03868 135.539281,273.758091 139.741989,275.117004) t=7.00240426e-05 tEnd=1 windSum=? windValue=1
|
| 970 | SkOpSegment::debugShowActiveSpans id=15 (139.741989,275.117004 139.741699,275.117889) t=0 tEnd=0.00025401744 windSum=? windValue=1
|
| 971 | SkOpSegment::debugShowActiveSpans id=16 (141.406006,284.054993 141.77301,282.906982 141.64801,281.734985 141.14801,280.734985) t=0 tEnd=1 windSum=? windValue=1
|
| 972 | SkOpSegment::debugShowActiveSpans id=17 (141.14801,280.734985 140.625015,279.734985 139.757004,278.945984 138.609009,278.570984) t=0 tEnd=1 windSum=? windValue=1
|
| 973 | SkOpSegment::debugShowActiveSpans id=18 (138.609009,278.570984 138.609299,278.570099) t=0 tEnd=0.00025401744 windSum=? windValue=1
|
| 974 | SkOpSegment::debugShowActiveSpans id=19 (139.742004,275.117981 143.937012,276.492981 146.219009,280.97699 144.859009,285.172974) t=0 tEnd=1 windSum=? windValue=1
|
| 975 | SkOpSegment::debugShowActiveSpans id=20 (144.859009,285.172974 141.406006,284.054993) t=0 tEnd=1 windSum=? windValue=1
|
| 976 | SkOpSegment::debugShowActiveSpans id=6 (133.132996,281.367004 132.757996,282.507996 132.882996,283.687012 133.390991,284.679016) t=0 tEnd=1 windSum=? windValue=1
|
| 977 | SkOpSegment::debugShowActiveSpans id=7 (133.390991,284.679016 133.906998,285.679016 134.773987,286.468018 135.921997,286.843018) t=0 tEnd=1 windSum=? windValue=1
|
| 978 | SkOpSegment::debugShowActiveSpans id=8 (135.921997,286.843018 135.921707,286.843903) t=0 tEnd=0.000255675976 windSum=? windValue=1
|
| 979 | SkOpSegment::debugShowActiveSpans id=9 (134.796997,290.296021 130.60199,288.929016 128.313004,284.437012 129.679993,280.241028) t=0 tEnd=1 windSum=? windValue=1
|
| 980 | SkOpSegment::debugShowActiveSpans id=10 (129.679993,280.241028 133.132996,281.367004) t=0 tEnd=1 windSum=? windValue=1
|
| 981 | SkOpSegment::debugShowActiveSpans id=1 (135.921997,286.843994 137.069992,287.218994 138.242004,287.085999 139.242004,286.578003) t=0 tEnd=1 windSum=? windValue=1
|
| 982 | SkOpSegment::debugShowActiveSpans id=2 (139.242004,286.578003 140.234009,286.078003 141.031006,285.203003 141.406006,284.054993) t=0 tEnd=1 windSum=? windValue=1
|
| 983 | SkOpSegment::debugShowActiveSpans id=3 (141.406006,284.054993 144.859009,285.171997) t=0 tEnd=1 windSum=? windValue=1
|
| 984 | SkOpSegment::debugShowActiveSpans id=4 (144.859009,285.171997 144.858913,285.172292 144.858815,285.172588 144.858719,285.172882) t=0 tEnd=7.00717611e-05 windSum=? windValue=1
|
| 985 | SkOpSegment::debugShowActiveSpans id=4 (144.858719,285.172882 143.491371,289.375321 138.99171,291.655911 134.797012,290.296997) t=7.00717611e-05 tEnd=1 windSum=? windValue=1
|
| 986 | SkOpSegment::debugShowActiveSpans id=5 (134.797012,290.296997 134.797302,290.296112) t=0 tEnd=0.000254375091 windSum=? windValue=1
|
| 987 | -------------------------------------- calc_angles
|
| 988 | SkOpSegment::sortAngles [11] tStart=0 [21]
|
| 989 | SkOpSegment::sortAngles [12] tStart=1 [24]
|
| 990 | SkOpAngle::after [12/2] 5/5 tStart=1 tEnd=0 < [6/13] 21/25 tStart=0 tEnd=1 < [10/18] 13/13 tStart=1 tEnd=0 F 4
|
| 991 | SkOpAngle::afterPart {{{133.132996,281.367004}, {133.507996,280.218994}, {134.296997,279.343994}, {135.296997,278.835999}}} id=12
|
| 992 | SkOpAngle::afterPart {{{133.132996,281.367004}, {132.757996,282.507996}, {132.882996,283.687012}, {133.390991,284.679016}}} id=6
|
| 993 | SkOpAngle::afterPart {{{133.132996,281.367004}, {129.679993,280.241028}}} id=10
|
| 994 | SkOpAngle::after [12/2] 5/5 tStart=1 tEnd=0 < [13/3] 13/13 tStart=0 tEnd=1 < [10/18] 13/13 tStart=1 tEnd=0 F 7
|
| 995 | SkOpAngle::afterPart {{{133.132996,281.367004}, {133.507996,280.218994}, {134.296997,279.343994}, {135.296997,278.835999}}} id=12
|
| 996 | SkOpAngle::afterPart {{{133.132996,281.367004}, {129.679993,280.242004}}} id=13
|
| 997 | SkOpAngle::afterPart {{{133.132996,281.367004}, {129.679993,280.241028}}} id=10
|
| 998 | SkOpAngle::after [10/18] 13/13 tStart=1 tEnd=0 < [13/3] 13/13 tStart=0 tEnd=1 < [6/13] 21/25 tStart=0 tEnd=1 T 7
|
| 999 | SkOpAngle::afterPart {{{133.132996,281.367004}, {129.679993,280.241028}}} id=10
|
| 1000 | SkOpAngle::afterPart {{{133.132996,281.367004}, {129.679993,280.242004}}} id=13
|
| 1001 | SkOpAngle::afterPart {{{133.132996,281.367004}, {132.757996,282.507996}, {132.882996,283.687012}, {133.390991,284.679016}}} id=6
|
| 1002 | SkOpSegment::sortAngles [13] tStart=0 [25]
|
| 1003 | SkOpSegment::sortAngles [14] tStart=7.00240426e-05 [43]
|
| 1004 | SkOpAngle::after [14/4] 21/21 tStart=7.00240426e-05 tEnd=0 < [9/16] 21/25 tStart=1 tEnd=0 < [14/5] 5/1 tStart=7.00240426e-05 tEnd=1 T 12
|
| 1005 | SkOpAngle::afterPart {{{129.679993,280.241028}, {129.679703,280.241913}, {129.679798,280.241619}, {129.679703,280.241913}}} id=14
|
| 1006 | SkOpAngle::afterPart {{{129.679993,280.241028}, {128.313004,284.437012}, {130.60199,288.929016}, {134.796997,290.296021}}} id=9
|
| 1007 | SkOpAngle::afterPart {{{129.679993,280.241028}, {131.047339,276.038588}, {135.538991,273.757999}, {139.741699,275.116913}}} id=14
|
| 1008 | SkOpAngle::after [14/4] 21/21 tStart=7.00240426e-05 tEnd=0 < [10/17] 29/29 tStart=0 tEnd=1 < [9/16] 21/25 tStart=1 tEnd=0 F 5
|
| 1009 | SkOpAngle::afterPart {{{129.679993,280.241028}, {129.679703,280.241913}, {129.679798,280.241619}, {129.679703,280.241913}}} id=14
|
| 1010 | SkOpAngle::afterPart {{{129.679993,280.241028}, {133.132996,281.367004}}} id=10
|
| 1011 | SkOpAngle::afterPart {{{129.679993,280.241028}, {128.313004,284.437012}, {130.60199,288.929016}, {134.796997,290.296021}}} id=9
|
| 1012 | SkOpAngle::after [9/16] 21/25 tStart=1 tEnd=0 < [10/17] 29/29 tStart=0 tEnd=1 < [14/5] 5/1 tStart=7.00240426e-05 tEnd=1 T 4
|
| 1013 | SkOpAngle::afterPart {{{129.679993,280.241028}, {128.313004,284.437012}, {130.60199,288.929016}, {134.796997,290.296021}}} id=9
|
| 1014 | SkOpAngle::afterPart {{{129.679993,280.241028}, {133.132996,281.367004}}} id=10
|
| 1015 | SkOpAngle::afterPart {{{129.679993,280.241028}, {131.047339,276.038588}, {135.538991,273.757999}, {139.741699,275.116913}}} id=14
|
| 1016 | SkOpSegment::sortAngles [15] tStart=0.00025401744 [42]
|
| 1017 | SkOpSegment::sortAngles [16] tStart=0 [31]
|
| 1018 | SkOpAngle::after [16/7] 5/9 tStart=0 tEnd=1 < [2/20] 21/21 tStart=1 tEnd=0 < [3/21] 29/29 tStart=0 tEnd=1 T 4
|
| 1019 | SkOpAngle::afterPart {{{141.406006,284.054993}, {141.77301,282.906982}, {141.64801,281.734985}, {141.14801,280.734985}}} id=16
|
| 1020 | SkOpAngle::afterPart {{{141.406006,284.054993}, {141.031006,285.203003}, {140.234009,286.078003}, {139.242004,286.578003}}} id=2
|
| 1021 | SkOpAngle::afterPart {{{141.406006,284.054993}, {144.859009,285.171997}}} id=3
|
| 1022 | SkOpAngle::after [16/7] 5/9 tStart=0 tEnd=1 < [20/12] 29/29 tStart=1 tEnd=0 < [2/20] 21/21 tStart=1 tEnd=0 F 4
|
| 1023 | SkOpAngle::afterPart {{{141.406006,284.054993}, {141.77301,282.906982}, {141.64801,281.734985}, {141.14801,280.734985}}} id=16
|
| 1024 | SkOpAngle::afterPart {{{141.406006,284.054993}, {144.859009,285.172974}}} id=20
|
| 1025 | SkOpAngle::afterPart {{{141.406006,284.054993}, {141.031006,285.203003}, {140.234009,286.078003}, {139.242004,286.578003}}} id=2
|
| 1026 | SkOpAngle::after [2/20] 21/21 tStart=1 tEnd=0 < [20/12] 29/29 tStart=1 tEnd=0 < [3/21] 29/29 tStart=0 tEnd=1 T 7
|
| 1027 | SkOpAngle::afterPart {{{141.406006,284.054993}, {141.031006,285.203003}, {140.234009,286.078003}, {139.242004,286.578003}}} id=2
|
| 1028 | SkOpAngle::afterPart {{{141.406006,284.054993}, {144.859009,285.172974}}} id=20
|
| 1029 | SkOpAngle::afterPart {{{141.406006,284.054993}, {144.859009,285.171997}}} id=3
|
| 1030 | SkOpSegment::sortAngles [18] tStart=0.00025401744 [41]
|
| 1031 | SkOpSegment::sortAngles [19] tStart=0 [37]
|
| 1032 | SkOpSegment::sortAngles [19] tStart=1 [38]
|
| 1033 | SkOpAngle::after [19/10] 5/9 tStart=1 tEnd=0 < [4/22] 5/5 tStart=7.00717611e-05 tEnd=0 < [20/11] 13/13 tStart=0 tEnd=1 F 7
|
| 1034 | SkOpAngle::afterPart {{{144.858719,285.172882}, {146.218719,280.976898}, {143.936722,276.492889}, {139.741714,275.117889}}} id=19
|
| 1035 | SkOpAngle::afterPart {{{144.858719,285.172882}, {144.859009,285.171997}, {144.858913,285.172292}, {144.859009,285.171997}}} id=4
|
| 1036 | SkOpAngle::afterPart {{{144.858719,285.172882}, {141.405716,284.054901}}} id=20
|
| 1037 | SkOpAngle::after [19/10] 5/9 tStart=1 tEnd=0 < [4/23] 21/17 tStart=7.00717611e-05 tEnd=1 < [20/11] 13/13 tStart=0 tEnd=1 F 4
|
| 1038 | SkOpAngle::afterPart {{{144.858719,285.172882}, {146.218719,280.976898}, {143.936722,276.492889}, {139.741714,275.117889}}} id=19
|
| 1039 | SkOpAngle::afterPart {{{144.858719,285.172882}, {143.491371,289.375321}, {138.99171,291.655911}, {134.797012,290.296997}}} id=4
|
| 1040 | SkOpAngle::afterPart {{{144.858719,285.172882}, {141.405716,284.054901}}} id=20
|
| 1041 | SkOpAngle::after [20/11] 13/13 tStart=0 tEnd=1 < [4/23] 21/17 tStart=7.00717611e-05 tEnd=1 < [4/22] 5/5 tStart=7.00717611e-05 tEnd=0 T 4
|
| 1042 | SkOpAngle::afterPart {{{144.858719,285.172882}, {141.405716,284.054901}}} id=20
|
| 1043 | SkOpAngle::afterPart {{{144.858719,285.172882}, {143.491371,289.375321}, {138.99171,291.655911}, {134.797012,290.296997}}} id=4
|
| 1044 | SkOpAngle::afterPart {{{144.858719,285.172882}, {144.859009,285.171997}, {144.858913,285.172292}, {144.859009,285.171997}}} id=4
|
| 1045 | SkOpSegment::sortAngles [20] tStart=0 [39]
|
| 1046 | SkOpSegment::sortAngles [20] tStart=1 [40]
|
| 1047 | SkOpSegment::sortAngles [6] tStart=0 [11]
|
| 1048 | SkOpSegment::sortAngles [8] tStart=0.000255675976 [45]
|
| 1049 | SkOpSegment::sortAngles [9] tStart=0 [17]
|
| 1050 | SkOpSegment::sortAngles [9] tStart=1 [18]
|
| 1051 | SkOpSegment::sortAngles [10] tStart=0 [19]
|
| 1052 | SkOpSegment::sortAngles [10] tStart=1 [20]
|
| 1053 | SkOpSegment::sortAngles [1] tStart=0 [1]
|
| 1054 | SkOpSegment::sortAngles [2] tStart=1 [4]
|
| 1055 | SkOpSegment::sortAngles [3] tStart=0 [5]
|
| 1056 | SkOpSegment::sortAngles [4] tStart=7.00717611e-05 [44]
|
| 1057 | SkOpSegment::sortAngles [5] tStart=0.000254375091 [46]
|
| 1058 | coinSpan - id=5 t=0.000254375091 tEnd=1
|
| 1059 | coinSpan + id=8 t=1 tEnd=0.000255675976
|
| 1060 | coinSpan - id=18 t=0.00025401744 tEnd=1
|
| 1061 | coinSpan + id=15 t=1 tEnd=0.00025401744
|
| 1062 | SkOpSpan::sortableTop dir=kTop seg=11 t=0.5 pt=(136.897491,278.374878)
|
| 1063 | SkOpSpan::sortableTop [0] valid=1 operand=0 span=43 ccw=1 seg=14 {{{129.679993f, 280.242004f}, {131.046997f, 276.039001f}, {135.538986f, 273.757996f}, {139.741989f, 275.117004f}}} t=0.774802234 pt=(136.897491,274.733032) slope=(12.4800744,-0.579929823)
|
| 1064 | SkOpSpan::sortableTop [1] valid=1 operand=0 span=21 ccw=0 seg=11 {{{138.608994f, 278.570007f}, {137.460999f, 278.203003f}, {136.296997f, 278.328003f}, {135.296997f, 278.835999f}}} t=0.5 pt=(136.897491,278.374878) slope=(-3.35699844,0.293243408)
|
| 1065 | SkOpSegment::markWinding id=14 (129.679993,280.242004 131.046997,276.039001 135.538986,273.757996 139.741989,275.117004) t=7.00240426e-05 [43] (129.680283,280.241119) tEnd=1 newWindSum=-1 newOppSum=0 oppSum=0 windSum=-1 windValue=1 oppValue=0
|
| 1066 | SkOpSegment::markWinding id=15 (139.741989,275.117004 138.608994,278.570007) t=0 [29] (139.741989,275.117004) tEnd=0.00025401744 newWindSum=-1 newOppSum=0 oppSum=? windSum=? windValue=1 oppValue=0
|
| 1067 | SkOpSegment::nextChase mismatched signs
|
| 1068 | SkOpSegment::markWinding id=19 (139.742004,275.117981 143.937012,276.492981 146.219009,280.97699 144.859009,285.172974) t=0 [37] (139.742004,275.117981) tEnd=1 newWindSum=-1 newOppSum=0 oppSum=? windSum=? windValue=1 oppValue=0
|
| 1069 | SkOpSegment::markWinding id=14 (129.679993,280.242004 131.046997,276.039001 135.538986,273.757996 139.741989,275.117004) t=7.00240426e-05 [43] (129.680283,280.241119) tEnd=1 newWindSum=-1 newOppSum=0 oppSum=0 windSum=-1 windValue=1 oppValue=0
|
| 1070 | SkOpSegment::markWinding id=11 (138.608994,278.570007 137.460999,278.203003 136.296997,278.328003 135.296997,278.835999) t=0 [21] (138.608994,278.570007) tEnd=1 newWindSum=-1 newOppSum=0 oppSum=0 windSum=-1 windValue=1 oppValue=0
|
| 1071 | SkOpSegment::markWinding id=12 (135.296997,278.835999 134.296997,279.343994 133.507996,280.218994 133.132996,281.367004) t=0 [23] (135.296997,278.835999) tEnd=1 newWindSum=-1 newOppSum=0 oppSum=? windSum=? windValue=1 oppValue=0
|
| 1072 | SkOpSegment::markWinding id=11 (138.608994,278.570007 137.460999,278.203003 136.296997,278.328003 135.296997,278.835999) t=0 [21] (138.608994,278.570007) tEnd=1 newWindSum=-1 newOppSum=0 oppSum=0 windSum=-1 windValue=1 oppValue=0
|
| 1073 | SkOpSegment::nextChase mismatched signs
|
| 1074 | SkOpSegment::markWinding id=18 (138.609009,278.570984 139.742004,275.117981) t=0 [35] (138.609009,278.570984) tEnd=0.00025401744 newWindSum=-1 newOppSum=0 oppSum=? windSum=? windValue=1 oppValue=0
|
| 1075 | SkOpSegment::markWinding id=17 (141.14801,280.734985 140.625015,279.734985 139.757004,278.945984 138.609009,278.570984) t=0 [33] (141.14801,280.734985) tEnd=1 newWindSum=-1 newOppSum=0 oppSum=? windSum=? windValue=1 oppValue=0
|
| 1076 | SkOpSegment::markWinding id=16 (141.406006,284.054993 141.77301,282.906982 141.64801,281.734985 141.14801,280.734985) t=0 [31] (141.406006,284.054993) tEnd=1 newWindSum=-1 newOppSum=0 oppSum=? windSum=? windValue=1 oppValue=0
|
| 1077 | SkOpSegment::nextChase mismatched signs
|
| 1078 | SkOpSegment::findNextWinding simple
|
| 1079 | SkOpSegment::markDone id=11 (138.608994,278.570007 137.460999,278.203003 136.296997,278.328003 135.296997,278.835999) t=0 [21] (138.608994,278.570007) tEnd=1 newWindSum=-1 newOppSum=0 oppSum=0 windSum=-1 windValue=1 oppValue=0
|
| 1080 | bridgeWinding current id=11 from=(135.296997,278.835999) to=(138.608994,278.570007)
|
| 1081 | path.moveTo(135.296997,278.835999);
|
| 1082 | path.cubicTo(136.296997,278.328003, 137.460999,278.203003, 138.608994,278.570007);
|
| 1083 | SkOpSegment::findNextWinding simple
|
| 1084 | SkOpSegment::markDone id=18 (138.609009,278.570984 139.742004,275.117981) t=0 [35] (138.609009,278.570984) tEnd=0.00025401744 newWindSum=-1 newOppSum=0 oppSum=0 windSum=-1 windValue=1 oppValue=0
|
| 1085 | bridgeWinding current id=18 from=(138.609299,278.570099) to=(138.609009,278.570984)
|
| 1086 | SkOpSegment::findNextWinding simple
|
| 1087 | SkOpSegment::markDone id=17 (141.14801,280.734985 140.625015,279.734985 139.757004,278.945984 138.609009,278.570984) t=0 [33] (141.14801,280.734985) tEnd=1 newWindSum=-1 newOppSum=0 oppSum=0 windSum=-1 windValue=1 oppValue=0
|
| 1088 | bridgeWinding current id=17 from=(138.609009,278.570984) to=(141.14801,280.734985)
|
| 1089 | path.lineTo(138.609009,278.570984);
|
| 1090 | path.cubicTo(139.757004,278.945984, 140.625015,279.734985, 141.14801,280.734985);
|
| 1091 | SkOpSegment::markWinding id=2 (139.242004,286.578003 140.234009,286.078003 141.031006,285.203003 141.406006,284.054993) t=0 [3] (139.242004,286.578003) tEnd=1 newWindSum=-1 windSum=? windValue=1
|
| 1092 | SkOpSegment::markWinding id=1 (135.921997,286.843994 137.069992,287.218994 138.242004,287.085999 139.242004,286.578003) t=0 [1] (135.921997,286.843994) tEnd=1 newWindSum=-1 windSum=? windValue=1
|
| 1093 | SkOpSegment::nextChase mismatched signs
|
| 1094 | SkOpSegment::markWinding id=8 (135.921997,286.843018 134.796997,290.296021) t=0 [15] (135.921997,286.843018) tEnd=0.000255675976 newWindSum=-1 windSum=? windValue=1
|
| 1095 | SkOpSegment::markWinding id=7 (133.390991,284.679016 133.906998,285.679016 134.773987,286.468018 135.921997,286.843018) t=0 [13] (133.390991,284.679016) tEnd=1 newWindSum=-1 windSum=? windValue=1
|
| 1096 | SkOpSegment::markWinding id=6 (133.132996,281.367004 132.757996,282.507996 132.882996,283.687012 133.390991,284.679016) t=0 [11] (133.132996,281.367004) tEnd=1 newWindSum=-1 windSum=? windValue=1
|
| 1097 | SkOpSegment::markAngle last seg=6 span=11 windSum=-1
|
| 1098 | SkOpSegment::markWinding id=20 (144.859009,285.172974 141.406006,284.054993) t=0 [39] (144.859009,285.172974) tEnd=1 newWindSum=-2 windSum=? windValue=1
|
| 1099 | SkOpSegment::markAngle last seg=20 span=39 windSum=-2
|
| 1100 | SkOpSegment::markWinding id=3 (141.406006,284.054993 144.859009,285.171997) t=0 [5] (141.406006,284.054993) tEnd=1 newWindSum=-2 windSum=? windValue=1
|
| 1101 | SkOpSegment::markWinding id=4 (144.859009,285.171997 143.492004,289.375 138.992004,291.656006 134.797012,290.296997) t=0 [7] (144.859009,285.171997) tEnd=7.00717611e-05 newWindSum=-2 windSum=? windValue=1
|
| 1102 | SkOpSegment::markAngle last seg=4 span=44 windSum=?
|
| 1103 | SkOpSegment::findNextWinding
|
| 1104 | SkOpAngle::dumpOne [16/7] next=2/20 sect=5/9 s=0 [31] e=1 [32] sgn=-1 windVal=1 windSum=-1 oppVal=0 oppSum=0
|
| 1105 | SkOpAngle::dumpOne [2/20] next=20/12 sect=21/21 s=1 [4] e=0 [3] sgn=1 windVal=1 windSum=-1
|
| 1106 | SkOpAngle::dumpOne [20/12] next=3/21 sect=29/29 s=1 [40] e=0 [39] sgn=1 windVal=1 windSum=-2
|
| 1107 | SkOpAngle::dumpOne [3/21] next=16/7 sect=29/29 s=0 [5] e=1 [6] sgn=-1 windVal=1 windSum=-2
|
| 1108 | SkOpSegment::findNextWinding chase.append segment=6 span=11 windSum=-1
|
| 1109 | SkOpSegment::markDone id=20 (144.859009,285.172974 141.406006,284.054993) t=0 [39] (144.859009,285.172974) tEnd=1 newWindSum=-2 newOppSum=? oppSum=? windSum=-2 windValue=1 oppValue=0
|
| 1110 | SkOpSegment::findNextWinding chase.append segment=20 span=39 windSum=-2
|
| 1111 | SkOpSegment::markDone id=3 (141.406006,284.054993 144.859009,285.171997) t=0 [5] (141.406006,284.054993) tEnd=1 newWindSum=-2 newOppSum=? oppSum=? windSum=-2 windValue=1 oppValue=0
|
| 1112 | SkOpSegment::markDone id=4 (144.859009,285.171997 143.492004,289.375 138.992004,291.656006 134.797012,290.296997) t=0 [7] (144.859009,285.171997) tEnd=7.00717611e-05 newWindSum=-2 newOppSum=? oppSum=? windSum=-2 windValue=1 oppValue=0
|
| 1113 | SkOpSegment::findNextWinding chase.append segment=4 span=44 windSum=-2147483647
|
| 1114 | SkOpSegment::markDone id=16 (141.406006,284.054993 141.77301,282.906982 141.64801,281.734985 141.14801,280.734985) t=0 [31] (141.406006,284.054993) tEnd=1 newWindSum=-1 newOppSum=0 oppSum=0 windSum=-1 windValue=1 oppValue=0
|
| 1115 | SkOpSegment::findNextWinding from:[16] to:[2] start=84323080 end=84322936
|
| 1116 | bridgeWinding current id=16 from=(141.14801,280.734985) to=(141.406006,284.054993)
|
| 1117 | path.cubicTo(141.64801,281.734985, 141.77301,282.906982, 141.406006,284.054993);
|
| 1118 | SkOpSegment::findNextWinding simple
|
| 1119 | SkOpSegment::markDone id=2 (139.242004,286.578003 140.234009,286.078003 141.031006,285.203003 141.406006,284.054993) t=0 [3] (139.242004,286.578003) tEnd=1 newWindSum=-1 newOppSum=? oppSum=? windSum=-1 windValue=1 oppValue=0
|
| 1120 | bridgeWinding current id=2 from=(141.406006,284.054993) to=(139.242004,286.578003)
|
| 1121 | path.cubicTo(141.031006,285.203003, 140.234009,286.078003, 139.242004,286.578003);
|
| 1122 | SkOpSegment::nextChase mismatched signs
|
| 1123 | SkOpSegment::findNextWinding simple
|
| 1124 | SkOpSegment::markDone id=1 (135.921997,286.843994 137.069992,287.218994 138.242004,287.085999 139.242004,286.578003) t=0 [1] (135.921997,286.843994) tEnd=1 newWindSum=-1 newOppSum=? oppSum=? windSum=-1 windValue=1 oppValue=0
|
| 1125 | bridgeWinding current id=1 from=(139.242004,286.578003) to=(135.921997,286.843994)
|
| 1126 | path.cubicTo(138.242004,287.085999, 137.069992,287.218994, 135.921997,286.843994);
|
| 1127 | SkOpSegment::findNextWinding simple
|
| 1128 | SkOpSegment::markDone id=8 (135.921997,286.843018 134.796997,290.296021) t=0 [15] (135.921997,286.843018) tEnd=0.000255675976 newWindSum=-1 newOppSum=? oppSum=? windSum=-1 windValue=1 oppValue=0
|
| 1129 | bridgeWinding current id=8 from=(135.921707,286.843903) to=(135.921997,286.843018)
|
| 1130 | SkOpSegment::findNextWinding simple
|
| 1131 | SkOpSegment::markDone id=7 (133.390991,284.679016 133.906998,285.679016 134.773987,286.468018 135.921997,286.843018) t=0 [13] (133.390991,284.679016) tEnd=1 newWindSum=-1 newOppSum=? oppSum=? windSum=-1 windValue=1 oppValue=0
|
| 1132 | bridgeWinding current id=7 from=(135.921997,286.843018) to=(133.390991,284.679016)
|
| 1133 | path.lineTo(135.921997,286.843018);
|
| 1134 | path.cubicTo(134.773987,286.468018, 133.906998,285.679016, 133.390991,284.679016);
|
| 1135 | SkOpSegment::markWinding id=10 (129.679993,280.241028 133.132996,281.367004) t=0 [19] (129.679993,280.241028) tEnd=1 newWindSum=-2 windSum=? windValue=1
|
| 1136 | SkOpSegment::markAngle last seg=10 span=19 windSum=-2
|
| 1137 | SkOpSegment::markWinding id=13 (133.132996,281.367004 129.679993,280.242004) t=0 [25] (133.132996,281.367004) tEnd=1 newWindSum=-2 windSum=? windValue=1
|
| 1138 | SkOpSegment::markWinding id=14 (129.679993,280.242004 131.046997,276.039001 135.538986,273.757996 139.741989,275.117004) t=0 [27] (129.679993,280.242004) tEnd=7.00240426e-05 newWindSum=-2 windSum=? windValue=1
|
| 1139 | SkOpSegment::markAngle last seg=14 span=43 windSum=-1
|
| 1140 | SkOpSegment::findNextWinding
|
| 1141 | SkOpAngle::dumpOne [6/13] next=12/2 sect=21/25 s=0 [11] e=1 [12] sgn=-1 windVal=1 windSum=-1
|
| 1142 | SkOpAngle::dumpOne [12/2] next=10/18 sect=5/5 s=1 [24] e=0 [23] sgn=1 windVal=1 windSum=-1 oppVal=0 oppSum=0
|
| 1143 | SkOpAngle::dumpOne [10/18] next=13/3 sect=13/13 s=1 [20] e=0 [19] sgn=1 windVal=1 windSum=-2
|
| 1144 | SkOpAngle::dumpOne [13/3] next=6/13 sect=13/13 s=0 [25] e=1 [26] sgn=-1 windVal=1 windSum=-2
|
| 1145 | SkOpSegment::markDone id=10 (129.679993,280.241028 133.132996,281.367004) t=0 [19] (129.679993,280.241028) tEnd=1 newWindSum=-2 newOppSum=? oppSum=? windSum=-2 windValue=1 oppValue=0
|
| 1146 | SkOpSegment::findNextWinding chase.append segment=10 span=19 windSum=-2
|
| 1147 | SkOpSegment::markDone id=13 (133.132996,281.367004 129.679993,280.242004) t=0 [25] (133.132996,281.367004) tEnd=1 newWindSum=-2 newOppSum=? oppSum=? windSum=-2 windValue=1 oppValue=0
|
| 1148 | SkOpSegment::markDone id=14 (129.679993,280.242004 131.046997,276.039001 135.538986,273.757996 139.741989,275.117004) t=0 [27] (129.679993,280.242004) tEnd=7.00240426e-05 newWindSum=-2 newOppSum=? oppSum=? windSum=-2 windValue=1 oppValue=0
|
| 1149 | SkOpSegment::findNextWinding chase.append segment=14 span=43 windSum=-1
|
| 1150 | SkOpSegment::markDone id=6 (133.132996,281.367004 132.757996,282.507996 132.882996,283.687012 133.390991,284.679016) t=0 [11] (133.132996,281.367004) tEnd=1 newWindSum=-1 newOppSum=? oppSum=? windSum=-1 windValue=1 oppValue=0
|
| 1151 | SkOpSegment::findNextWinding from:[6] to:[12] start=107586600 end=107586456
|
| 1152 | bridgeWinding current id=6 from=(133.390991,284.679016) to=(133.132996,281.367004)
|
| 1153 | path.cubicTo(132.882996,283.687012, 132.757996,282.507996, 133.132996,281.367004);
|
| 1154 | SkOpSegment::findNextWinding simple
|
| 1155 | SkOpSegment::markDone id=12 (135.296997,278.835999 134.296997,279.343994 133.507996,280.218994 133.132996,281.367004) t=0 [23] (135.296997,278.835999) tEnd=1 newWindSum=-1 newOppSum=0 oppSum=0 windSum=-1 windValue=1 oppValue=0
|
| 1156 | bridgeWinding current id=12 from=(133.132996,281.367004) to=(135.296997,278.835999)
|
| 1157 | path.cubicTo(133.507996,280.218994, 134.296997,279.343994, 135.296997,278.835999);
|
| 1158 | path.close();
|
| 1159 | SkOpSegment::markWinding id=14 (129.679993,280.242004 131.046997,276.039001 135.538986,273.757996 139.741989,275.117004) t=7.00240426e-05 [43] (129.680283,280.241119) tEnd=1 newWindSum=-1 windSum=-1 windValue=1
|
| 1160 | SkOpSegment::markWinding id=9 (134.796997,290.296021 130.60199,288.929016 128.313004,284.437012 129.679993,280.241028) t=0 [17] (134.796997,290.296021) tEnd=1 newWindSum=-2 windSum=? windValue=1
|
| 1161 | SkOpSegment::nextChase mismatched signs
|
| 1162 | SkOpSegment::markWinding id=5 (134.797012,290.296997 135.921997,286.843994) t=0 [9] (134.797012,290.296997) tEnd=0.000254375091 newWindSum=-2 windSum=? windValue=1
|
| 1163 | SkOpSegment::markWinding id=4 (144.859009,285.171997 143.492004,289.375 138.992004,291.656006 134.797012,290.296997) t=7.00717611e-05 [44] (144.858719,285.172882) tEnd=1 newWindSum=-2 windSum=? windValue=1
|
| 1164 | SkOpSegment::markAngle last seg=4 span=44 windSum=-2
|
| 1165 | SkOpSegment::debugShowActiveSpans id=14 (129.680283,280.241119 131.047629,276.03868 135.539281,273.758091 139.741989,275.117004) t=7.00240426e-05 tEnd=1 windSum=-1 oppSum=0 windValue=1 oppValue=0
|
| 1166 | SkOpSegment::debugShowActiveSpans id=15 (139.741989,275.117004 139.741699,275.117889) t=0 tEnd=0.00025401744 windSum=-1 oppSum=0 windValue=1 oppValue=0
|
| 1167 | SkOpSegment::debugShowActiveSpans id=19 (139.742004,275.117981 143.937012,276.492981 146.219009,280.97699 144.859009,285.172974) t=0 tEnd=1 windSum=-1 oppSum=0 windValue=1 oppValue=0
|
| 1168 | SkOpSegment::debugShowActiveSpans id=9 (134.796997,290.296021 130.60199,288.929016 128.313004,284.437012 129.679993,280.241028) t=0 tEnd=1 windSum=-2 windValue=1
|
| 1169 | SkOpSegment::debugShowActiveSpans id=4 (144.858719,285.172882 143.491371,289.375321 138.99171,291.655911 134.797012,290.296997) t=7.00717611e-05 tEnd=1 windSum=-2 windValue=1
|
| 1170 | SkOpSegment::debugShowActiveSpans id=5 (134.797012,290.296997 134.797302,290.296112) t=0 tEnd=0.000254375091 windSum=-2 windValue=1
|
| 1171 | SkOpSegment::findNextWinding simple
|
| 1172 | SkOpSegment::markDone id=14 (129.679993,280.242004 131.046997,276.039001 135.538986,273.757996 139.741989,275.117004) t=7.00240426e-05 [43] (129.680283,280.241119) tEnd=1 newWindSum=-1 newOppSum=0 oppSum=0 windSum=-1 windValue=1 oppValue=0
|
| 1173 | bridgeWinding current id=14 from=(129.680283,280.241119) to=(139.741989,275.117004)
|
| 1174 | path.moveTo(129.680283,280.241119);
|
| 1175 | path.cubicTo(131.047623,276.038666, 135.539276,273.758087, 139.741989,275.117004);
|
| 1176 | SkOpSegment::nextChase mismatched signs
|
| 1177 | SkOpSegment::findNextWinding simple
|
| 1178 | SkOpSegment::markDone id=15 (139.741989,275.117004 138.608994,278.570007) t=0 [29] (139.741989,275.117004) tEnd=0.00025401744 newWindSum=-1 newOppSum=0 oppSum=0 windSum=-1 windValue=1 oppValue=0
|
| 1179 | bridgeWinding current id=15 from=(139.741989,275.117004) to=(139.741699,275.117889)
|
| 1180 | SkOpSegment::findNextWinding
|
| 1181 | SkOpAngle::dumpOne [19/10] next=20/11 sect=5/9 s=1 [38] e=0 [37] sgn=1 windVal=1 windSum=-1 oppVal=0 oppSum=0
|
| 1182 | SkOpAngle::dumpOne [20/11] next=4/23 sect=13/13 s=0 [39] e=1 [40] sgn=-1 windVal=1 windSum=-2 done
|
| 1183 | SkOpAngle::dumpOne [4/23] next=4/22 sect=21/17 s=7.00717611e-05 [44] e=1 [8] sgn=-1 windVal=1 windSum=-2
|
| 1184 | SkOpAngle::dumpOne [4/22] next=19/10 sect=5/5 s=7.00717611e-05 [44] e=0 [7] sgn=1 windVal=1 windSum=-2 done
|
| 1185 | SkOpSegment::markDone id=19 (139.742004,275.117981 143.937012,276.492981 146.219009,280.97699 144.859009,285.172974) t=0 [37] (139.742004,275.117981) tEnd=1 newWindSum=-1 newOppSum=0 oppSum=0 windSum=-1 windValue=1 oppValue=0
|
| 1186 | SkOpSegment::findNextWinding from:[19] to:[4] start=107589880 end=84323576
|
| 1187 | bridgeWinding current id=19 from=(139.742004,275.117981) to=(144.859009,285.172974)
|
| 1188 | path.lineTo(139.741699,275.117889);
|
| 1189 | path.cubicTo(143.937012,276.492981, 146.219009,280.97699, 144.859009,285.172974);
|
| 1190 | SkOpSegment::findNextWinding simple
|
| 1191 | SkOpSegment::debugShowActiveSpans id=9 (134.796997,290.296021 130.60199,288.929016 128.313004,284.437012 129.679993,280.241028) t=0 tEnd=1 windSum=-2 windValue=1
|
| 1192 | SkOpSegment::debugShowActiveSpans id=4 (144.858719,285.172882 143.491371,289.375321 138.99171,291.655911 134.797012,290.296997) t=7.00717611e-05 tEnd=1 windSum=-2 windValue=1
|
| 1193 | SkOpSegment::debugShowActiveSpans id=5 (134.797012,290.296997 134.797302,290.296112) t=0 tEnd=0.000254375091 windSum=-2 windValue=1
|
| 1194 | SkOpSegment::markDone id=9 (134.796997,290.296021 130.60199,288.929016 128.313004,284.437012 129.679993,280.241028) t=0 [17] (134.796997,290.296021) tEnd=1 newWindSum=-2 newOppSum=? oppSum=? windSum=-2 windValue=1 oppValue=0
|
| 1195 | SkOpSegment::nextChase mismatched signs
|
| 1196 | SkOpSegment::markDone id=5 (134.797012,290.296997 135.921997,286.843994) t=0 [9] (134.797012,290.296997) tEnd=0.000254375091 newWindSum=-2 newOppSum=? oppSum=? windSum=-2 windValue=1 oppValue=0
|
| 1197 | SkOpSegment::markDone id=4 (144.859009,285.171997 143.492004,289.375 138.992004,291.656006 134.797012,290.296997) t=7.00717611e-05 [44] (144.858719,285.172882) tEnd=1 newWindSum=-2 newOppSum=? oppSum=? windSum=-2 windValue=1 oppValue=0
|
| 1198 | </div>
|
| 1199 | |
| 1200 | <div id="issue3838">
|
| 1201 | seg=1 {{{200, 170}, {220, 170}}}
|
| 1202 | seg=2 {{{220, 170}, {220, 230}}}
|
| 1203 | seg=3 {{{220, 230}, {240, 230}}}
|
| 1204 | seg=4 {{{240, 230}, {240, 210}}}
|
| 1205 | seg=5 {{{240, 210}, {180, 210}}}
|
| 1206 | seg=6 {{{180, 210}, {180, 190}}}
|
| 1207 | seg=7 {{{180, 190}, {260, 190}}}
|
| 1208 | seg=8 {{{260, 190}, {260, 250}}}
|
| 1209 | seg=9 {{{260, 250}, {200, 250}}}
|
| 1210 | seg=10 {{{200, 250}, {200, 170}}}
|
| 1211 | debugShowLineIntersection wtTs[0]=0 {{{220,170}, {220,230}}} {{220,170}} wnTs[0]=1 {{{200,170}, {220,170}}}
|
| 1212 | debugShowLineIntersection wtTs[0]=1 {{{200,250}, {200,170}}} {{200,170}} wnTs[0]=0 {{{200,170}, {220,170}}}
|
| 1213 | debugShowLineIntersection wtTs[0]=0 {{{220,230}, {240,230}}} {{220,230}} wnTs[0]=1 {{{220,170}, {220,230}}}
|
| 1214 | debugShowLineIntersection wtTs[0]=0.333333333 {{{240,210}, {180,210}}} {{220,210}} wnTs[0]=0.666667 {{{220,170}, {220,230}}}
|
| 1215 | SkOpSegment::addT insert t=0.666666667 segID=2 spanID=21
|
| 1216 | SkOpSegment::addT insert t=0.333333333 segID=5 spanID=22
|
| 1217 | debugShowLineIntersection wtTs[0]=0.5 {{{180,190}, {260,190}}} {{220,190}} wnTs[0]=0.333333 {{{220,170}, {220,230}}}
|
| 1218 | SkOpSegment::addT insert t=0.333333333 segID=2 spanID=23
|
| 1219 | SkOpSegment::addT insert t=0.5 segID=7 spanID=24
|
| 1220 | debugShowLineIntersection wtTs[0]=0 {{{240,230}, {240,210}}} {{240,230}} wnTs[0]=1 {{{220,230}, {240,230}}}
|
| 1221 | debugShowLineIntersection wtTs[0]=0 {{{240,210}, {180,210}}} {{240,210}} wnTs[0]=1 {{{240,230}, {240,210}}}
|
| 1222 | debugShowLineIntersection wtTs[0]=0 {{{180,210}, {180,190}}} {{180,210}} wnTs[0]=1 {{{240,210}, {180,210}}}
|
| 1223 | debugShowLineIntersection wtTs[0]=0.5 {{{200,250}, {200,170}}} {{200,210}} wnTs[0]=0.666667 {{{240,210}, {180,210}}}
|
| 1224 | SkOpSegment::addT insert t=0.666666667 segID=5 spanID=25
|
| 1225 | SkOpSegment::addT insert t=0.5 segID=10 spanID=26
|
| 1226 | debugShowLineIntersection wtTs[0]=0 {{{180,190}, {260,190}}} {{180,190}} wnTs[0]=1 {{{180,210}, {180,190}}}
|
| 1227 | debugShowLineIntersection wtTs[0]=0 {{{260,190}, {260,250}}} {{260,190}} wnTs[0]=1 {{{180,190}, {260,190}}}
|
| 1228 | debugShowLineIntersection wtTs[0]=0.75 {{{200,250}, {200,170}}} {{200,190}} wnTs[0]=0.25 {{{180,190}, {260,190}}}
|
| 1229 | SkOpSegment::addT insert t=0.25 segID=7 spanID=27
|
| 1230 | SkOpSegment::addT insert t=0.75 segID=10 spanID=28
|
| 1231 | debugShowLineIntersection wtTs[0]=0 {{{260,250}, {200,250}}} {{260,250}} wnTs[0]=1 {{{260,190}, {260,250}}}
|
| 1232 | debugShowLineIntersection wtTs[0]=0 {{{200,250}, {200,170}}} {{200,250}} wnTs[0]=1 {{{260,250}, {200,250}}}
|
| 1233 | -------------------------------------- addExpanded
|
| 1234 | SkOpSegment::debugShowActiveSpans id=1 (200,170 220,170) t=0 tEnd=1 windSum=? windValue=1
|
| 1235 | SkOpSegment::debugShowActiveSpans id=2 (220,170 220,190) t=0 tEnd=0.333333333 windSum=? windValue=1
|
| 1236 | SkOpSegment::debugShowActiveSpans id=2 (220,190 220,210) t=0.333333333 tEnd=0.666666667 windSum=? windValue=1
|
| 1237 | SkOpSegment::debugShowActiveSpans id=2 (220,210 220,230) t=0.666666667 tEnd=1 windSum=? windValue=1
|
| 1238 | SkOpSegment::debugShowActiveSpans id=3 (220,230 240,230) t=0 tEnd=1 windSum=? windValue=1
|
| 1239 | SkOpSegment::debugShowActiveSpans id=4 (240,230 240,210) t=0 tEnd=1 windSum=? windValue=1
|
| 1240 | SkOpSegment::debugShowActiveSpans id=5 (240,210 220,210) t=0 tEnd=0.333333333 windSum=? windValue=1
|
| 1241 | SkOpSegment::debugShowActiveSpans id=5 (220,210 200,210) t=0.333333333 tEnd=0.666666667 windSum=? windValue=1
|
| 1242 | SkOpSegment::debugShowActiveSpans id=5 (200,210 180,210) t=0.666666667 tEnd=1 windSum=? windValue=1
|
| 1243 | SkOpSegment::debugShowActiveSpans id=6 (180,210 180,190) t=0 tEnd=1 windSum=? windValue=1
|
| 1244 | SkOpSegment::debugShowActiveSpans id=7 (180,190 200,190) t=0 tEnd=0.25 windSum=? windValue=1
|
| 1245 | SkOpSegment::debugShowActiveSpans id=7 (200,190 220,190) t=0.25 tEnd=0.5 windSum=? windValue=1
|
| 1246 | SkOpSegment::debugShowActiveSpans id=7 (220,190 260,190) t=0.5 tEnd=1 windSum=? windValue=1
|
| 1247 | SkOpSegment::debugShowActiveSpans id=8 (260,190 260,250) t=0 tEnd=1 windSum=? windValue=1
|
| 1248 | SkOpSegment::debugShowActiveSpans id=9 (260,250 200,250) t=0 tEnd=1 windSum=? windValue=1
|
| 1249 | SkOpSegment::debugShowActiveSpans id=10 (200,250 200,210) t=0 tEnd=0.5 windSum=? windValue=1
|
| 1250 | SkOpSegment::debugShowActiveSpans id=10 (200,210 200,190) t=0.5 tEnd=0.75 windSum=? windValue=1
|
| 1251 | SkOpSegment::debugShowActiveSpans id=10 (200,190 200,170) t=0.75 tEnd=1 windSum=? windValue=1
|
| 1252 | -------------------------------------- move_multiples
|
| 1253 | -------------------------------------- move_nearby
|
| 1254 | -------------------------------------- correctEnds
|
| 1255 | -------------------------------------- addEndMovedSpans
|
| 1256 | -------------------------------------- expand
|
| 1257 | -------------------------------------- addExpanded
|
| 1258 | -------------------------------------- mark
|
| 1259 | -------------------------------------- missing_coincidence
|
| 1260 | -------------------------------------- expand
|
| 1261 | -------------------------------------- expand
|
| 1262 | -------------------------------------- apply
|
| 1263 | -------------------------------------- findOverlaps
|
| 1264 | -------------------------------------- calc_angles
|
| 1265 | SkOpSegment::sortAngles [2] tStart=0.333333333 [23]
|
| 1266 | SkOpAngle::after [2/1] 7/7 tStart=0.333333333 tEnd=0 < [7/11] 15/15 tStart=0.5 tEnd=0.25 < [2/2] 23/23 tStart=0.333333333 tEnd=0.666666667 T 4
|
| 1267 | SkOpAngle::afterPart {{{220,190}, {220,170}}} id=2
|
| 1268 | SkOpAngle::afterPart {{{220,190}, {200,190}}} id=7
|
| 1269 | SkOpAngle::afterPart {{{220,190}, {220,210}}} id=2
|
| 1270 | SkOpAngle::after [2/1] 7/7 tStart=0.333333333 tEnd=0 < [7/12] 31/31 tStart=0.5 tEnd=1 < [7/11] 15/15 tStart=0.5 tEnd=0.25 F 4
|
| 1271 | SkOpAngle::afterPart {{{220,190}, {220,170}}} id=2
|
| 1272 | SkOpAngle::afterPart {{{220,190}, {260,190}}} id=7
|
| 1273 | SkOpAngle::afterPart {{{220,190}, {200,190}}} id=7
|
| 1274 | SkOpAngle::after [7/11] 15/15 tStart=0.5 tEnd=0.25 < [7/12] 31/31 tStart=0.5 tEnd=1 < [2/2] 23/23 tStart=0.333333333 tEnd=0.666666667 F 4
|
| 1275 | SkOpAngle::afterPart {{{220,190}, {200,190}}} id=7
|
| 1276 | SkOpAngle::afterPart {{{220,190}, {260,190}}} id=7
|
| 1277 | SkOpAngle::afterPart {{{220,190}, {220,210}}} id=2
|
| 1278 | SkOpAngle::after [2/2] 23/23 tStart=0.333333333 tEnd=0.666666667 < [7/12] 31/31 tStart=0.5 tEnd=1 < [2/1] 7/7 tStart=0.333333333 tEnd=0 T 4
|
| 1279 | SkOpAngle::afterPart {{{220,190}, {220,210}}} id=2
|
| 1280 | SkOpAngle::afterPart {{{220,190}, {260,190}}} id=7
|
| 1281 | SkOpAngle::afterPart {{{220,190}, {220,170}}} id=2
|
| 1282 | SkOpSegment::sortAngles [2] tStart=0.666666667 [21]
|
| 1283 | SkOpAngle::after [2/3] 7/7 tStart=0.666666667 tEnd=0.333333333 < [5/5] 31/31 tStart=0.333333333 tEnd=0 < [2/4] 23/23 tStart=0.666666667 tEnd=1 F 4
|
| 1284 | SkOpAngle::afterPart {{{220,210}, {220,190}}} id=2
|
| 1285 | SkOpAngle::afterPart {{{220,210}, {240,210}}} id=5
|
| 1286 | SkOpAngle::afterPart {{{220,210}, {220,230}}} id=2
|
| 1287 | SkOpAngle::after [2/3] 7/7 tStart=0.666666667 tEnd=0.333333333 < [5/6] 15/15 tStart=0.333333333 tEnd=0.666666667 < [2/4] 23/23 tStart=0.666666667 tEnd=1 T 4
|
| 1288 | SkOpAngle::afterPart {{{220,210}, {220,190}}} id=2
|
| 1289 | SkOpAngle::afterPart {{{220,210}, {200,210}}} id=5
|
| 1290 | SkOpAngle::afterPart {{{220,210}, {220,230}}} id=2
|
| 1291 | SkOpSegment::sortAngles [5] tStart=0.333333333 [22]
|
| 1292 | SkOpSegment::sortAngles [5] tStart=0.666666667 [25]
|
| 1293 | SkOpAngle::after [5/7] 31/31 tStart=0.666666667 tEnd=0.333333333 < [10/13] 23/23 tStart=0.5 tEnd=0 < [5/8] 15/15 tStart=0.666666667 tEnd=1 F 4
|
| 1294 | SkOpAngle::afterPart {{{200,210}, {220,210}}} id=5
|
| 1295 | SkOpAngle::afterPart {{{200,210}, {200,250}}} id=10
|
| 1296 | SkOpAngle::afterPart {{{200,210}, {180,210}}} id=5
|
| 1297 | SkOpAngle::after [5/7] 31/31 tStart=0.666666667 tEnd=0.333333333 < [10/14] 7/7 tStart=0.5 tEnd=0.75 < [5/8] 15/15 tStart=0.666666667 tEnd=1 T 4
|
| 1298 | SkOpAngle::afterPart {{{200,210}, {220,210}}} id=5
|
| 1299 | SkOpAngle::afterPart {{{200,210}, {200,190}}} id=10
|
| 1300 | SkOpAngle::afterPart {{{200,210}, {180,210}}} id=5
|
| 1301 | SkOpSegment::sortAngles [7] tStart=0.25 [27]
|
| 1302 | SkOpAngle::after [7/9] 15/15 tStart=0.25 tEnd=0 < [10/15] 23/23 tStart=0.75 tEnd=0.5 < [7/10] 31/31 tStart=0.25 tEnd=0.5 T 4
|
| 1303 | SkOpAngle::afterPart {{{200,190}, {180,190}}} id=7
|
| 1304 | SkOpAngle::afterPart {{{200,190}, {200,210}}} id=10
|
| 1305 | SkOpAngle::afterPart {{{200,190}, {220,190}}} id=7
|
| 1306 | SkOpAngle::after [7/9] 15/15 tStart=0.25 tEnd=0 < [10/16] 7/7 tStart=0.75 tEnd=1 < [10/15] 23/23 tStart=0.75 tEnd=0.5 F 4
|
| 1307 | SkOpAngle::afterPart {{{200,190}, {180,190}}} id=7
|
| 1308 | SkOpAngle::afterPart {{{200,190}, {200,170}}} id=10
|
| 1309 | SkOpAngle::afterPart {{{200,190}, {200,210}}} id=10
|
| 1310 | SkOpAngle::after [10/15] 23/23 tStart=0.75 tEnd=0.5 < [10/16] 7/7 tStart=0.75 tEnd=1 < [7/10] 31/31 tStart=0.25 tEnd=0.5 F 4
|
| 1311 | SkOpAngle::afterPart {{{200,190}, {200,210}}} id=10
|
| 1312 | SkOpAngle::afterPart {{{200,190}, {200,170}}} id=10
|
| 1313 | SkOpAngle::afterPart {{{200,190}, {220,190}}} id=7
|
| 1314 | SkOpAngle::after [7/10] 31/31 tStart=0.25 tEnd=0.5 < [10/16] 7/7 tStart=0.75 tEnd=1 < [7/9] 15/15 tStart=0.25 tEnd=0 T 4
|
| 1315 | SkOpAngle::afterPart {{{200,190}, {220,190}}} id=7
|
| 1316 | SkOpAngle::afterPart {{{200,190}, {200,170}}} id=10
|
| 1317 | SkOpAngle::afterPart {{{200,190}, {180,190}}} id=7
|
| 1318 | SkOpSegment::sortAngles [7] tStart=0.5 [24]
|
| 1319 | SkOpSegment::sortAngles [10] tStart=0.5 [26]
|
| 1320 | SkOpSegment::sortAngles [10] tStart=0.75 [28]
|
| 1321 | SkOpSpan::sortableTop dir=kTop seg=1 t=0.5 pt=(210,170)
|
| 1322 | SkOpSpan::sortableTop [0] valid=1 operand=0 span=1 ccw=1 seg=1 {{{200, 170}, {220, 170}}} t=0.5 pt=(210,170) slope=(20,0)
|
| 1323 | SkOpSegment::markWinding id=1 (200,170 220,170) t=0 [1] (200,170) tEnd=1 newWindSum=-1 newOppSum=0 oppSum=0 windSum=-1 windValue=1 oppValue=0
|
| 1324 | SkOpSegment::markWinding id=2 (220,170 220,230) t=0 [3] (220,170) tEnd=0.333333333 newWindSum=-1 newOppSum=0 oppSum=? windSum=? windValue=1 oppValue=0
|
| 1325 | SkOpSegment::markWinding id=1 (200,170 220,170) t=0 [1] (200,170) tEnd=1 newWindSum=-1 newOppSum=0 oppSum=0 windSum=-1 windValue=1 oppValue=0
|
| 1326 | SkOpSegment::markWinding id=10 (200,250 200,170) t=0.75 [28] (200,190) tEnd=1 newWindSum=-1 newOppSum=0 oppSum=? windSum=? windValue=1 oppValue=0
|
| 1327 | SkOpSegment::findNextWinding simple
|
| 1328 | SkOpSegment::markDone id=1 (200,170 220,170) t=0 [1] (200,170) tEnd=1 newWindSum=-1 newOppSum=0 oppSum=0 windSum=-1 windValue=1 oppValue=0
|
| 1329 | bridgeWinding current id=1 from=(220,170) to=(200,170)
|
| 1330 | SkOpSegment::markWinding id=7 (180,190 260,190) t=0 [13] (180,190) tEnd=0.25 newWindSum=-1 windSum=? windValue=1
|
| 1331 | SkOpSegment::markWinding id=6 (180,210 180,190) t=0 [11] (180,210) tEnd=1 newWindSum=-1 windSum=? windValue=1
|
| 1332 | SkOpSegment::markWinding id=5 (240,210 180,210) t=0.666666667 [25] (200,210) tEnd=1 newWindSum=-1 windSum=? windValue=1
|
| 1333 | SkOpSegment::markAngle last seg=5 span=25 windSum=-1
|
| 1334 | SkOpSegment::markWinding id=10 (200,250 200,170) t=0.5 [26] (200,210) tEnd=0.75 newWindSum=-2 windSum=? windValue=1
|
| 1335 | SkOpSegment::markAngle last seg=10 span=26 windSum=-2
|
| 1336 | SkOpSegment::markWinding id=7 (180,190 260,190) t=0.25 [27] (200,190) tEnd=0.5 newWindSum=-2 windSum=? windValue=1
|
| 1337 | SkOpSegment::markAngle last seg=7 span=24 windSum=?
|
| 1338 | SkOpSegment::findNextWinding
|
| 1339 | SkOpAngle::dumpOne [10/16] next=7/9 sect=7/7 s=0.75 [28] e=1 [20] sgn=-1 windVal=1 windSum=-1 oppVal=0 oppSum=0
|
| 1340 | SkOpAngle::dumpOne [7/9] next=10/15 sect=15/15 s=0.25 [27] e=0 [13] sgn=1 windVal=1 windSum=-1
|
| 1341 | SkOpAngle::dumpOne [10/15] next=7/10 sect=23/23 s=0.75 [28] e=0.5 [26] sgn=1 windVal=1 windSum=-2
|
| 1342 | SkOpAngle::dumpOne [7/10] next=10/16 sect=31/31 s=0.25 [27] e=0.5 [24] sgn=-1 windVal=1 windSum=-2
|
| 1343 | SkOpSegment::findNextWinding chase.append segment=5 span=25 windSum=-1
|
| 1344 | SkOpSegment::markDone id=10 (200,250 200,170) t=0.5 [26] (200,210) tEnd=0.75 newWindSum=-2 newOppSum=? oppSum=? windSum=-2 windValue=1 oppValue=0
|
| 1345 | SkOpSegment::findNextWinding chase.append segment=10 span=26 windSum=-2
|
| 1346 | SkOpSegment::markDone id=7 (180,190 260,190) t=0.25 [27] (200,190) tEnd=0.5 newWindSum=-2 newOppSum=? oppSum=? windSum=-2 windValue=1 oppValue=0
|
| 1347 | SkOpSegment::findNextWinding chase.append segment=7 span=24 windSum=-2147483647
|
| 1348 | SkOpSegment::markDone id=10 (200,250 200,170) t=0.75 [28] (200,190) tEnd=1 newWindSum=-1 newOppSum=0 oppSum=0 windSum=-1 windValue=1 oppValue=0
|
| 1349 | SkOpSegment::findNextWinding from:[10] to:[7] start=5333632 end=5331472
|
| 1350 | bridgeWinding current id=10 from=(200,170) to=(200,190)
|
| 1351 | path.moveTo(220,170);
|
| 1352 | path.lineTo(200,170);
|
| 1353 | SkOpSegment::findNextWinding simple
|
| 1354 | SkOpSegment::markDone id=7 (180,190 260,190) t=0 [13] (180,190) tEnd=0.25 newWindSum=-1 newOppSum=? oppSum=? windSum=-1 windValue=1 oppValue=0
|
| 1355 | bridgeWinding current id=7 from=(200,190) to=(180,190)
|
| 1356 | path.lineTo(200,190);
|
| 1357 | SkOpSegment::findNextWinding simple
|
| 1358 | SkOpSegment::markDone id=6 (180,210 180,190) t=0 [11] (180,210) tEnd=1 newWindSum=-1 newOppSum=? oppSum=? windSum=-1 windValue=1 oppValue=0
|
| 1359 | bridgeWinding current id=6 from=(180,190) to=(180,210)
|
| 1360 | path.lineTo(180,190);
|
| 1361 | SkOpSegment::markWinding id=10 (200,250 200,170) t=0 [19] (200,250) tEnd=0.5 newWindSum=-1 windSum=? windValue=1
|
| 1362 | SkOpSegment::markWinding id=9 (260,250 200,250) t=0 [17] (260,250) tEnd=1 newWindSum=-1 windSum=? windValue=1
|
| 1363 | SkOpSegment::markWinding id=8 (260,190 260,250) t=0 [15] (260,190) tEnd=1 newWindSum=-1 windSum=? windValue=1
|
| 1364 | SkOpSegment::markWinding id=7 (180,190 260,190) t=0.5 [24] (220,190) tEnd=1 newWindSum=-1 windSum=? windValue=1
|
| 1365 | SkOpSegment::markAngle last seg=7 span=24 windSum=-1
|
| 1366 | SkOpSegment::markWinding id=5 (240,210 180,210) t=0.333333333 [22] (220,210) tEnd=0.666666667 newWindSum=-2 windSum=? windValue=1
|
| 1367 | SkOpSegment::markAngle last seg=5 span=22 windSum=-2
|
| 1368 | SkOpSegment::findNextWinding
|
| 1369 | SkOpAngle::dumpOne [5/8] next=10/13 sect=15/15 s=0.666666667 [25] e=1 [10] sgn=-1 windVal=1 windSum=-1
|
| 1370 | SkOpAngle::dumpOne [10/13] next=5/7 sect=23/23 s=0.5 [26] e=0 [19] sgn=1 windVal=1 windSum=-1
|
| 1371 | SkOpAngle::dumpOne [5/7] next=10/14 sect=31/31 s=0.666666667 [25] e=0.333333333 [22] sgn=1 windVal=1 windSum=-2
|
| 1372 | SkOpAngle::dumpOne [10/14] next=5/8 sect=7/7 s=0.5 [26] e=0.75 [28] sgn=-1 windVal=1 windSum=-2 done
|
| 1373 | SkOpSegment::markDone id=5 (240,210 180,210) t=0.333333333 [22] (220,210) tEnd=0.666666667 newWindSum=-2 newOppSum=? oppSum=? windSum=-2 windValue=1 oppValue=0
|
| 1374 | SkOpSegment::findNextWinding chase.append segment=5 span=22 windSum=-2
|
| 1375 | SkOpSegment::markDone id=5 (240,210 180,210) t=0.666666667 [25] (200,210) tEnd=1 newWindSum=-1 newOppSum=? oppSum=? windSum=-1 windValue=1 oppValue=0
|
| 1376 | SkOpSegment::findNextWinding from:[5] to:[10] start=5333488 end=5332456
|
| 1377 | bridgeWinding current id=5 from=(180,210) to=(200,210)
|
| 1378 | path.lineTo(180,210);
|
| 1379 | SkOpSegment::findNextWinding simple
|
| 1380 | SkOpSegment::markDone id=10 (200,250 200,170) t=0 [19] (200,250) tEnd=0.5 newWindSum=-1 newOppSum=? oppSum=? windSum=-1 windValue=1 oppValue=0
|
| 1381 | bridgeWinding current id=10 from=(200,210) to=(200,250)
|
| 1382 | path.lineTo(200,210);
|
| 1383 | SkOpSegment::findNextWinding simple
|
| 1384 | SkOpSegment::markDone id=9 (260,250 200,250) t=0 [17] (260,250) tEnd=1 newWindSum=-1 newOppSum=? oppSum=? windSum=-1 windValue=1 oppValue=0
|
| 1385 | bridgeWinding current id=9 from=(200,250) to=(260,250)
|
| 1386 | path.lineTo(200,250);
|
| 1387 | SkOpSegment::findNextWinding simple
|
| 1388 | SkOpSegment::markDone id=8 (260,190 260,250) t=0 [15] (260,190) tEnd=1 newWindSum=-1 newOppSum=? oppSum=? windSum=-1 windValue=1 oppValue=0
|
| 1389 | bridgeWinding current id=8 from=(260,250) to=(260,190)
|
| 1390 | path.lineTo(260,250);
|
| 1391 | SkOpSegment::markWinding id=2 (220,170 220,230) t=0.333333333 [23] (220,190) tEnd=0.666666667 newWindSum=-2 windSum=? windValue=1
|
| 1392 | SkOpSegment::markAngle last seg=2 span=21 windSum=?
|
| 1393 | SkOpSegment::findNextWinding
|
| 1394 | SkOpAngle::dumpOne [7/12] next=2/1 sect=31/31 s=0.5 [24] e=1 [14] sgn=-1 windVal=1 windSum=-1
|
| 1395 | SkOpAngle::dumpOne [2/1] next=7/11 sect=7/7 s=0.333333333 [23] e=0 [3] sgn=1 windVal=1 windSum=-1 oppVal=0 oppSum=0
|
| 1396 | SkOpAngle::dumpOne [7/11] next=2/2 sect=15/15 s=0.5 [24] e=0.25 [27] sgn=1 windVal=1 windSum=-2 done
|
| 1397 | SkOpAngle::dumpOne [2/2] next=7/12 sect=23/23 s=0.333333333 [23] e=0.666666667 [21] sgn=-1 windVal=1 windSum=-2
|
| 1398 | SkOpSegment::markDone id=2 (220,170 220,230) t=0.333333333 [23] (220,190) tEnd=0.666666667 newWindSum=-2 newOppSum=? oppSum=? windSum=-2 windValue=1 oppValue=0
|
| 1399 | SkOpSegment::findNextWinding chase.append segment=2 span=21 windSum=-2147483647
|
| 1400 | SkOpSegment::markDone id=7 (180,190 260,190) t=0.5 [24] (220,190) tEnd=1 newWindSum=-1 newOppSum=? oppSum=? windSum=-1 windValue=1 oppValue=0
|
| 1401 | SkOpSegment::findNextWinding from:[7] to:[2] start=5333056 end=5329832
|
| 1402 | bridgeWinding current id=7 from=(260,190) to=(220,190)
|
| 1403 | path.lineTo(260,190);
|
| 1404 | SkOpSegment::findNextWinding simple
|
| 1405 | SkOpSegment::markDone id=2 (220,170 220,230) t=0 [3] (220,170) tEnd=0.333333333 newWindSum=-1 newOppSum=0 oppSum=0 windSum=-1 windValue=1 oppValue=0
|
| 1406 | bridgeWinding current id=2 from=(220,190) to=(220,170)
|
| 1407 | path.lineTo(220,190);
|
| 1408 | path.lineTo(220,170);
|
| 1409 | path.close();
|
| 1410 | SkOpSegment::markWinding id=2 (220,170 220,230) t=0.666666667 [21] (220,210) tEnd=1 newWindSum=-1 windSum=? windValue=1
|
| 1411 | SkOpSegment::markWinding id=3 (220,230 240,230) t=0 [5] (220,230) tEnd=1 newWindSum=-1 windSum=? windValue=1
|
| 1412 | SkOpSegment::markWinding id=4 (240,230 240,210) t=0 [7] (240,230) tEnd=1 newWindSum=-1 windSum=? windValue=1
|
| 1413 | SkOpSegment::markWinding id=5 (240,210 180,210) t=0 [9] (240,210) tEnd=0.333333333 newWindSum=-1 windSum=? windValue=1
|
| 1414 | SkOpSegment::markAngle last seg=5 span=22 windSum=-2
|
| 1415 | SkOpSegment::markWinding id=5 (240,210 180,210) t=0 [9] (240,210) tEnd=0.333333333 newWindSum=-1 windSum=-1 windValue=1
|
| 1416 | SkOpSegment::debugShowActiveSpans id=2 (220,210 220,230) t=0.666666667 tEnd=1 windSum=-1 windValue=1
|
| 1417 | SkOpSegment::debugShowActiveSpans id=3 (220,230 240,230) t=0 tEnd=1 windSum=-1 windValue=1
|
| 1418 | SkOpSegment::debugShowActiveSpans id=4 (240,230 240,210) t=0 tEnd=1 windSum=-1 windValue=1
|
| 1419 | SkOpSegment::debugShowActiveSpans id=5 (240,210 220,210) t=0 tEnd=0.333333333 windSum=-1 windValue=1
|
| 1420 | SkOpSegment::findNextWinding simple
|
| 1421 | SkOpSegment::markDone id=2 (220,170 220,230) t=0.666666667 [21] (220,210) tEnd=1 newWindSum=-1 newOppSum=? oppSum=? windSum=-1 windValue=1 oppValue=0
|
| 1422 | bridgeWinding current id=2 from=(220,210) to=(220,230)
|
| 1423 | SkOpSegment::findNextWinding simple
|
| 1424 | SkOpSegment::markDone id=3 (220,230 240,230) t=0 [5] (220,230) tEnd=1 newWindSum=-1 newOppSum=? oppSum=? windSum=-1 windValue=1 oppValue=0
|
| 1425 | bridgeWinding current id=3 from=(220,230) to=(240,230)
|
| 1426 | path.moveTo(220,210);
|
| 1427 | path.lineTo(220,230);
|
| 1428 | SkOpSegment::findNextWinding simple
|
| 1429 | SkOpSegment::markDone id=4 (240,230 240,210) t=0 [7] (240,230) tEnd=1 newWindSum=-1 newOppSum=? oppSum=? windSum=-1 windValue=1 oppValue=0
|
| 1430 | bridgeWinding current id=4 from=(240,230) to=(240,210)
|
| 1431 | path.lineTo(240,230);
|
| 1432 | SkOpSegment::findNextWinding
|
| 1433 | SkOpAngle::dumpOne [5/5] next=2/3 sect=31/31 s=0.333333333 [22] e=0 [9] sgn=1 windVal=1 windSum=-1
|
| 1434 | SkOpAngle::dumpOne [2/3] next=5/6 sect=7/7 s=0.666666667 [21] e=0.333333333 [23] sgn=1 windVal=1 windSum=-2 done
|
| 1435 | SkOpAngle::dumpOne [5/6] next=2/4 sect=15/15 s=0.333333333 [22] e=0.666666667 [25] sgn=-1 windVal=1 windSum=-2 done
|
| 1436 | SkOpAngle::dumpOne [2/4] next=5/5 sect=23/23 s=0.666666667 [21] e=1 [4] sgn=-1 windVal=1 windSum=-1 done
|
| 1437 | SkOpSegment::markDone id=5 (240,210 180,210) t=0 [9] (240,210) tEnd=0.333333333 newWindSum=-1 newOppSum=? oppSum=? windSum=-1 windValue=1 oppValue=0
|
| 1438 | SkOpSegment::findNextWinding from:[5] to:[2] start=5332768 end=5329976
|
| 1439 | bridgeWinding current id=5 from=(240,210) to=(220,210)
|
| 1440 | path.lineTo(240,210);
|
| 1441 | path.lineTo(220,210);
|
| 1442 | path.close();
|
| 1443 | </div>
|
| 1444 |
|
| 1445 | <div id="issue3838_a">
|
| 1446 | SkOpSpan::sortableTop dir=kTop seg=1 t=0.5 pt=(210,170)
|
| 1447 | SkOpSpan::sortableTop [0] valid=1 operand=0 span=1 ccw=0 seg=1 {{{220, 170}, {200, 170}}} t=0.5 pt=(210,170) slope=(-20,0)
|
| 1448 | SkOpBuilder::FixWinding id=1 nested=1 ccw=0
|
| 1449 | SkOpSegment::markDone id=1 (220,170 200,170) t=0 [1] (220,170) tEnd=1 newWindSum=1 newOppSum=0 oppSum=0 windSum=1 windValue=1 oppValue=0
|
| 1450 | SkOpSegment::markDone id=2 (200,170 200,190) t=0 [3] (200,170) tEnd=1 newWindSum=? newOppSum=? oppSum=? windSum=? windValue=1 oppValue=0
|
| 1451 | SkOpSegment::markDone id=3 (200,190 180,190) t=0 [5] (200,190) tEnd=1 newWindSum=? newOppSum=? oppSum=? windSum=? windValue=1 oppValue=0
|
| 1452 | SkOpSegment::markDone id=4 (180,190 180,210) t=0 [7] (180,190) tEnd=1 newWindSum=? newOppSum=? oppSum=? windSum=? windValue=1 oppValue=0
|
| 1453 | SkOpSegment::markDone id=5 (180,210 200,210) t=0 [9] (180,210) tEnd=1 newWindSum=? newOppSum=? oppSum=? windSum=? windValue=1 oppValue=0
|
| 1454 | SkOpSegment::markDone id=6 (200,210 200,250) t=0 [11] (200,210) tEnd=1 newWindSum=? newOppSum=? oppSum=? windSum=? windValue=1 oppValue=0
|
| 1455 | SkOpSegment::markDone id=7 (200,250 260,250) t=0 [13] (200,250) tEnd=1 newWindSum=? newOppSum=? oppSum=? windSum=? windValue=1 oppValue=0
|
| 1456 | SkOpSegment::markDone id=8 (260,250 260,190) t=0 [15] (260,250) tEnd=1 newWindSum=? newOppSum=? oppSum=? windSum=? windValue=1 oppValue=0
|
| 1457 | SkOpSegment::markDone id=9 (260,190 220,190) t=0 [17] (260,190) tEnd=1 newWindSum=? newOppSum=? oppSum=? windSum=? windValue=1 oppValue=0
|
| 1458 | SkOpSegment::markDone id=10 (220,190 220,170) t=0 [19] (220,190) tEnd=1 newWindSum=? newOppSum=? oppSum=? windSum=? windValue=1 oppValue=0
|
| 1459 | SkOpSpan::sortableTop dir=kLeft seg=11 t=0.5 pt=(220,220)
|
| 1460 | SkOpSpan::sortableTop [0] valid=1 operand=0 span=11 ccw=0 seg=6 {{{200, 210}, {200, 250}}} t=0.25 pt=(200,220) slope=(0,40)
|
| 1461 | SkOpSpan::sortableTop [1] valid=1 operand=0 span=21 ccw=0 seg=11 {{{220, 210}, {220, 230}}} t=0.5 pt=(220,220) slope=(0,20)
|
| 1462 | SkOpBuilder::FixWinding id=11 nested=2 ccw=0
|
| 1463 | SkOpSegment::markDone id=11 (220,210 220,230) t=0 [21] (220,210) tEnd=1 newWindSum=2 newOppSum=0 oppSum=0 windSum=2 windValue=1 oppValue=0
|
| 1464 | SkOpSegment::markDone id=12 (220,230 240,230) t=0 [23] (220,230) tEnd=1 newWindSum=? newOppSum=? oppSum=? windSum=? windValue=1 oppValue=0
|
| 1465 | SkOpSegment::markDone id=13 (240,230 240,210) t=0 [25] (240,230) tEnd=1 newWindSum=? newOppSum=? oppSum=? windSum=? windValue=1 oppValue=0
|
| 1466 | SkOpSegment::markDone id=14 (240,210 220,210) t=0 [27] (240,210) tEnd=1 newWindSum=? newOppSum=? oppSum=? windSum=? windValue=1 oppValue=0
|
| 1467 | path.moveTo(220,170);
|
| 1468 | path.lineTo(220,190);
|
| 1469 | path.lineTo(260,190);
|
| 1470 | path.lineTo(260,250);
|
| 1471 | path.lineTo(200,250);
|
| 1472 | path.lineTo(200,210);
|
| 1473 | path.lineTo(180,210);
|
| 1474 | path.lineTo(180,190);
|
| 1475 | path.lineTo(200,190);
|
| 1476 | path.lineTo(200,170);
|
| 1477 | path.lineTo(220,170);
|
| 1478 | path.close();
|
| 1479 | </div>
|
| 1480 |
|
| 1481 | <div id="issue3838_b">
|
| 1482 | seg=1 {{{220, 170}, {220, 190}}}
|
| 1483 | seg=2 {{{220, 190}, {260, 190}}}
|
| 1484 | seg=3 {{{260, 190}, {260, 250}}}
|
| 1485 | seg=4 {{{260, 250}, {200, 250}}}
|
| 1486 | seg=5 {{{200, 250}, {200, 210}}}
|
| 1487 | seg=6 {{{200, 210}, {180, 210}}}
|
| 1488 | seg=7 {{{180, 210}, {180, 190}}}
|
| 1489 | seg=8 {{{180, 190}, {200, 190}}}
|
| 1490 | seg=9 {{{200, 190}, {200, 170}}}
|
| 1491 | seg=10 {{{200, 170}, {220, 170}}}
|
| 1492 | debugShowLineIntersection wtTs[0]=0 {{{220,190}, {260,190}}} {{220,190}} wnTs[0]=1 {{{220,170}, {220,190}}}
|
| 1493 | debugShowLineIntersection wtTs[0]=1 {{{200,170}, {220,170}}} {{220,170}} wnTs[0]=0 {{{220,170}, {220,190}}}
|
| 1494 | debugShowLineIntersection wtTs[0]=0 {{{260,190}, {260,250}}} {{260,190}} wnTs[0]=1 {{{220,190}, {260,190}}}
|
| 1495 | debugShowLineIntersection wtTs[0]=0 {{{260,250}, {200,250}}} {{260,250}} wnTs[0]=1 {{{260,190}, {260,250}}}
|
| 1496 | debugShowLineIntersection wtTs[0]=0 {{{200,250}, {200,210}}} {{200,250}} wnTs[0]=1 {{{260,250}, {200,250}}}
|
| 1497 | debugShowLineIntersection wtTs[0]=0 {{{200,210}, {180,210}}} {{200,210}} wnTs[0]=1 {{{200,250}, {200,210}}}
|
| 1498 | debugShowLineIntersection wtTs[0]=0 {{{180,210}, {180,190}}} {{180,210}} wnTs[0]=1 {{{200,210}, {180,210}}}
|
| 1499 | debugShowLineIntersection wtTs[0]=0 {{{180,190}, {200,190}}} {{180,190}} wnTs[0]=1 {{{180,210}, {180,190}}}
|
| 1500 | debugShowLineIntersection wtTs[0]=0 {{{200,190}, {200,170}}} {{200,190}} wnTs[0]=1 {{{180,190}, {200,190}}}
|
| 1501 | debugShowLineIntersection wtTs[0]=0 {{{200,170}, {220,170}}} {{200,170}} wnTs[0]=1 {{{200,190}, {200,170}}}
|
| 1502 | -------------------------------------- addExpanded
|
| 1503 | SkOpSegment::debugShowActiveSpans id=1 (220,170 220,190) t=0 tEnd=1 windSum=? windValue=1
|
| 1504 | SkOpSegment::debugShowActiveSpans id=2 (220,190 260,190) t=0 tEnd=1 windSum=? windValue=1
|
| 1505 | SkOpSegment::debugShowActiveSpans id=3 (260,190 260,250) t=0 tEnd=1 windSum=? windValue=1
|
| 1506 | SkOpSegment::debugShowActiveSpans id=4 (260,250 200,250) t=0 tEnd=1 windSum=? windValue=1
|
| 1507 | SkOpSegment::debugShowActiveSpans id=5 (200,250 200,210) t=0 tEnd=1 windSum=? windValue=1
|
| 1508 | SkOpSegment::debugShowActiveSpans id=6 (200,210 180,210) t=0 tEnd=1 windSum=? windValue=1
|
| 1509 | SkOpSegment::debugShowActiveSpans id=7 (180,210 180,190) t=0 tEnd=1 windSum=? windValue=1
|
| 1510 | SkOpSegment::debugShowActiveSpans id=8 (180,190 200,190) t=0 tEnd=1 windSum=? windValue=1
|
| 1511 | SkOpSegment::debugShowActiveSpans id=9 (200,190 200,170) t=0 tEnd=1 windSum=? windValue=1
|
| 1512 | SkOpSegment::debugShowActiveSpans id=10 (200,170 220,170) t=0 tEnd=1 windSum=? windValue=1
|
| 1513 | -------------------------------------- move_multiples
|
| 1514 | -------------------------------------- move_nearby
|
| 1515 | -------------------------------------- correctEnds
|
| 1516 | -------------------------------------- addEndMovedSpans
|
| 1517 | -------------------------------------- expand
|
| 1518 | -------------------------------------- addExpanded
|
| 1519 | -------------------------------------- mark
|
| 1520 | -------------------------------------- missing_coincidence
|
| 1521 | -------------------------------------- expand
|
| 1522 | -------------------------------------- expand
|
| 1523 | -------------------------------------- apply
|
| 1524 | -------------------------------------- findOverlaps
|
| 1525 | -------------------------------------- calc_angles
|
| 1526 | SkOpSpan::sortableTop dir=kLeft seg=1 t=0.5 pt=(220,180)
|
| 1527 | SkOpSpan::sortableTop [0] valid=1 operand=0 span=17 ccw=1 seg=9 {{{200, 190}, {200, 170}}} t=0.5 pt=(200,180) slope=(0,-20)
|
| 1528 | SkOpSpan::sortableTop [1] valid=1 operand=0 span=1 ccw=0 seg=1 {{{220, 170}, {220, 190}}} t=0.5 pt=(220,180) slope=(0,20)
|
| 1529 | SkOpSegment::markWinding id=9 (200,190 200,170) t=0 [17] (200,190) tEnd=1 newWindSum=-1 newOppSum=0 oppSum=0 windSum=-1 windValue=1 oppValue=0
|
| 1530 | SkOpSegment::markWinding id=10 (200,170 220,170) t=0 [19] (200,170) tEnd=1 newWindSum=-1 newOppSum=0 oppSum=? windSum=? windValue=1 oppValue=0
|
| 1531 | SkOpSegment::markWinding id=1 (220,170 220,190) t=0 [1] (220,170) tEnd=1 newWindSum=-1 newOppSum=0 oppSum=? windSum=? windValue=1 oppValue=0
|
| 1532 | SkOpSegment::markWinding id=2 (220,190 260,190) t=0 [3] (220,190) tEnd=1 newWindSum=-1 newOppSum=0 oppSum=? windSum=? windValue=1 oppValue=0
|
| 1533 | SkOpSegment::markWinding id=3 (260,190 260,250) t=0 [5] (260,190) tEnd=1 newWindSum=-1 newOppSum=0 oppSum=? windSum=? windValue=1 oppValue=0
|
| 1534 | SkOpSegment::markWinding id=4 (260,250 200,250) t=0 [7] (260,250) tEnd=1 newWindSum=-1 newOppSum=0 oppSum=? windSum=? windValue=1 oppValue=0
|
| 1535 | SkOpSegment::markWinding id=5 (200,250 200,210) t=0 [9] (200,250) tEnd=1 newWindSum=-1 newOppSum=0 oppSum=? windSum=? windValue=1 oppValue=0
|
| 1536 | SkOpSegment::markWinding id=6 (200,210 180,210) t=0 [11] (200,210) tEnd=1 newWindSum=-1 newOppSum=0 oppSum=? windSum=? windValue=1 oppValue=0
|
| 1537 | SkOpSegment::markWinding id=7 (180,210 180,190) t=0 [13] (180,210) tEnd=1 newWindSum=-1 newOppSum=0 oppSum=? windSum=? windValue=1 oppValue=0
|
| 1538 | SkOpSegment::markWinding id=8 (180,190 200,190) t=0 [15] (180,190) tEnd=1 newWindSum=-1 newOppSum=0 oppSum=? windSum=? windValue=1 oppValue=0
|
| 1539 | SkOpSegment::markWinding id=9 (200,190 200,170) t=0 [17] (200,190) tEnd=1 newWindSum=-1 newOppSum=0 oppSum=0 windSum=-1 windValue=1 oppValue=0
|
| 1540 | SkOpSegment::findNextWinding simple
|
| 1541 | SkOpSegment::markDone id=1 (220,170 220,190) t=0 [1] (220,170) tEnd=1 newWindSum=-1 newOppSum=0 oppSum=0 windSum=-1 windValue=1 oppValue=0
|
| 1542 | bridgeWinding current id=1 from=(220,190) to=(220,170)
|
| 1543 | SkOpSegment::findNextWinding simple
|
| 1544 | SkOpSegment::markDone id=10 (200,170 220,170) t=0 [19] (200,170) tEnd=1 newWindSum=-1 newOppSum=0 oppSum=0 windSum=-1 windValue=1 oppValue=0
|
| 1545 | bridgeWinding current id=10 from=(220,170) to=(200,170)
|
| 1546 | path.moveTo(220,190);
|
| 1547 | path.lineTo(220,170);
|
| 1548 | SkOpSegment::findNextWinding simple
|
| 1549 | SkOpSegment::markDone id=9 (200,190 200,170) t=0 [17] (200,190) tEnd=1 newWindSum=-1 newOppSum=0 oppSum=0 windSum=-1 windValue=1 oppValue=0
|
| 1550 | bridgeWinding current id=9 from=(200,170) to=(200,190)
|
| 1551 | path.lineTo(200,170);
|
| 1552 | SkOpSegment::findNextWinding simple
|
| 1553 | SkOpSegment::markDone id=8 (180,190 200,190) t=0 [15] (180,190) tEnd=1 newWindSum=-1 newOppSum=0 oppSum=0 windSum=-1 windValue=1 oppValue=0
|
| 1554 | bridgeWinding current id=8 from=(200,190) to=(180,190)
|
| 1555 | path.lineTo(200,190);
|
| 1556 | SkOpSegment::findNextWinding simple
|
| 1557 | SkOpSegment::markDone id=7 (180,210 180,190) t=0 [13] (180,210) tEnd=1 newWindSum=-1 newOppSum=0 oppSum=0 windSum=-1 windValue=1 oppValue=0
|
| 1558 | bridgeWinding current id=7 from=(180,190) to=(180,210)
|
| 1559 | path.lineTo(180,190);
|
| 1560 | SkOpSegment::findNextWinding simple
|
| 1561 | SkOpSegment::markDone id=6 (200,210 180,210) t=0 [11] (200,210) tEnd=1 newWindSum=-1 newOppSum=0 oppSum=0 windSum=-1 windValue=1 oppValue=0
|
| 1562 | bridgeWinding current id=6 from=(180,210) to=(200,210)
|
| 1563 | path.lineTo(180,210);
|
| 1564 | SkOpSegment::findNextWinding simple
|
| 1565 | SkOpSegment::markDone id=5 (200,250 200,210) t=0 [9] (200,250) tEnd=1 newWindSum=-1 newOppSum=0 oppSum=0 windSum=-1 windValue=1 oppValue=0
|
| 1566 | bridgeWinding current id=5 from=(200,210) to=(200,250)
|
| 1567 | path.lineTo(200,210);
|
| 1568 | SkOpSegment::findNextWinding simple
|
| 1569 | SkOpSegment::markDone id=4 (260,250 200,250) t=0 [7] (260,250) tEnd=1 newWindSum=-1 newOppSum=0 oppSum=0 windSum=-1 windValue=1 oppValue=0
|
| 1570 | bridgeWinding current id=4 from=(200,250) to=(260,250)
|
| 1571 | path.lineTo(200,250);
|
| 1572 | SkOpSegment::findNextWinding simple
|
| 1573 | SkOpSegment::markDone id=3 (260,190 260,250) t=0 [5] (260,190) tEnd=1 newWindSum=-1 newOppSum=0 oppSum=0 windSum=-1 windValue=1 oppValue=0
|
| 1574 | bridgeWinding current id=3 from=(260,250) to=(260,190)
|
| 1575 | path.lineTo(260,250);
|
| 1576 | SkOpSegment::findNextWinding simple
|
| 1577 | SkOpSegment::markDone id=2 (220,190 260,190) t=0 [3] (220,190) tEnd=1 newWindSum=-1 newOppSum=0 oppSum=0 windSum=-1 windValue=1 oppValue=0
|
| 1578 | bridgeWinding current id=2 from=(260,190) to=(220,190)
|
| 1579 | path.lineTo(260,190);
|
| 1580 | path.lineTo(220,190);
|
| 1581 | path.close();
|
Cary Clark | 7eb01e0 | 2016-12-08 14:36:32 -0500 | [diff] [blame] | 1582 | </div>
|
caryclark | 26ad22a | 2015-10-16 09:03:38 -0700 | [diff] [blame] | 1583 | |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 1584 | </div> |
| 1585 | |
| 1586 | <script type="text/javascript"> |
| 1587 | |
caryclark | 55888e4 | 2016-07-18 10:01:36 -0700 | [diff] [blame] | 1588 | var testDivs = [ |
Cary Clark | ab2d73b | 2016-12-16 17:17:25 -0500 | [diff] [blame^] | 1589 | issue3838, |
| 1590 | issue3838_a, |
| 1591 | issue3838_b, |
| 1592 | joel_11, |
| 1593 | joel_10, |
| 1594 | joel_9, |
caryclark | 30b9fdd | 2016-08-31 14:36:29 -0700 | [diff] [blame] | 1595 | ]; |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 1596 | |
| 1597 | var decimal_places = 3; // make this 3 to show more precision |
| 1598 | |
| 1599 | var tests = []; |
| 1600 | var testLines = []; |
| 1601 | var testTitles = []; |
| 1602 | var testIndex = 0; |
| 1603 | var ctx; |
| 1604 | |
| 1605 | var xmin, xmax, focusXmin, focusXmax; |
| 1606 | var ymin, ymax, focusYmin, focusYmax; |
| 1607 | var scale; |
| 1608 | var mouseX, mouseY; |
| 1609 | var srcLeft, srcTop; |
| 1610 | var screenWidth, screenHeight; |
caryclark | 1049f12 | 2015-04-20 08:31:59 -0700 | [diff] [blame] | 1611 | var drawnPts, drawnLines, drawnQuads, drawnConics, drawnCubics; |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 1612 | var curveT = 0; |
| 1613 | |
| 1614 | var pt_labels = 2; |
| 1615 | var collect_bounds = false; |
| 1616 | var control_lines = 0; |
| 1617 | var curve_t = false; |
| 1618 | var debug_xy = 1; |
| 1619 | var focus_enabled = false; |
| 1620 | var focus_on_selection = false; |
| 1621 | var step_limit = 0; |
| 1622 | var draw_active = false; |
| 1623 | var draw_add = false; |
| 1624 | var draw_angle = 0; |
caryclark | 624637c | 2015-05-11 07:21:27 -0700 | [diff] [blame] | 1625 | var draw_coincidence = false; |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 1626 | var draw_deriviatives = 0; |
Cary Clark | ff11428 | 2016-12-14 11:56:16 -0500 | [diff] [blame] | 1627 | var draw_direction = false; |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 1628 | var draw_hints = false; |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 1629 | var draw_id = false; |
| 1630 | var draw_intersection = 0; |
| 1631 | var draw_intersectT = false; |
| 1632 | var draw_legend = true; |
| 1633 | var draw_log = false; |
| 1634 | var draw_mark = false; |
| 1635 | var draw_midpoint = false; |
| 1636 | var draw_op = 0; |
| 1637 | var draw_sequence = false; |
| 1638 | var draw_sort = 0; |
caryclark | 03b03ca | 2015-04-23 09:13:37 -0700 | [diff] [blame] | 1639 | var draw_top = false; |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 1640 | var draw_path = 3; |
| 1641 | var draw_computed = 0; |
| 1642 | var retina_scale = !!window.devicePixelRatio; |
| 1643 | |
| 1644 | var activeCount = 0; |
| 1645 | var addCount = 0; |
| 1646 | var angleCount = 0; |
caryclark | 624637c | 2015-05-11 07:21:27 -0700 | [diff] [blame] | 1647 | var coinCount = 0; |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 1648 | var opCount = 0; |
| 1649 | var sectCount = 0; |
| 1650 | var sortCount = 0; |
caryclark | 03b03ca | 2015-04-23 09:13:37 -0700 | [diff] [blame] | 1651 | var topCount = 0; |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 1652 | var markCount = 0; |
| 1653 | var activeMax = 0; |
| 1654 | var addMax = 0; |
| 1655 | var angleMax = 0; |
caryclark | 624637c | 2015-05-11 07:21:27 -0700 | [diff] [blame] | 1656 | var coinMax = 0; |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 1657 | var sectMax = 0; |
| 1658 | var sectMax2 = 0; |
| 1659 | var sortMax = 0; |
caryclark | 03b03ca | 2015-04-23 09:13:37 -0700 | [diff] [blame] | 1660 | var topMax = 0; |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 1661 | var markMax = 0; |
| 1662 | var opMax = 0; |
| 1663 | var stepMax = 0; |
| 1664 | var lastIndex = 0; |
| 1665 | var hasPath = false; |
caryclark | 26ad22a | 2015-10-16 09:03:38 -0700 | [diff] [blame] | 1666 | var hasAlignedPath = false; |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 1667 | var hasComputedPath = false; |
caryclark | 5435929 | 2015-03-26 07:52:43 -0700 | [diff] [blame] | 1668 | var angleBetween = false; |
| 1669 | var afterIndex = 0; |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 1670 | |
| 1671 | var firstActiveSpan = -1; |
| 1672 | var logStart = -1; |
| 1673 | var logRange = 0; |
| 1674 | |
| 1675 | var SPAN_ID = 0; |
| 1676 | var SPAN_X1 = SPAN_ID + 1; |
| 1677 | var SPAN_Y1 = SPAN_X1 + 1; |
| 1678 | var SPAN_X2 = SPAN_Y1 + 1; |
| 1679 | var SPAN_Y2 = SPAN_X2 + 1; |
caryclark | 1049f12 | 2015-04-20 08:31:59 -0700 | [diff] [blame] | 1680 | |
caryclark | 55888e4 | 2016-07-18 10:01:36 -0700 | [diff] [blame] | 1681 | var SPAN_L_TX = SPAN_Y2 + 1; |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 1682 | var SPAN_L_TY = SPAN_L_TX + 1; |
caryclark | 55888e4 | 2016-07-18 10:01:36 -0700 | [diff] [blame] | 1683 | var SPAN_L_OTHER = SPAN_L_TY + 1; |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 1684 | var SPAN_L_OTHERT = SPAN_L_OTHER + 1; |
| 1685 | var SPAN_L_OTHERI = SPAN_L_OTHERT + 1; |
| 1686 | var SPAN_L_SUM = SPAN_L_OTHERI + 1; |
| 1687 | var SPAN_L_VAL = SPAN_L_SUM + 1; |
| 1688 | var SPAN_L_OPP = SPAN_L_VAL + 1; |
| 1689 | |
| 1690 | var SPAN_X3 = SPAN_Y2 + 1; |
| 1691 | var SPAN_Y3 = SPAN_X3 + 1; |
caryclark | 1049f12 | 2015-04-20 08:31:59 -0700 | [diff] [blame] | 1692 | |
caryclark | 55888e4 | 2016-07-18 10:01:36 -0700 | [diff] [blame] | 1693 | var SPAN_Q_TX = SPAN_Y3 + 1; |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 1694 | var SPAN_Q_TY = SPAN_Q_TX + 1; |
caryclark | 55888e4 | 2016-07-18 10:01:36 -0700 | [diff] [blame] | 1695 | var SPAN_Q_OTHER = SPAN_Q_TY + 1; |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 1696 | var SPAN_Q_OTHERT = SPAN_Q_OTHER + 1; |
| 1697 | var SPAN_Q_OTHERI = SPAN_Q_OTHERT + 1; |
| 1698 | var SPAN_Q_SUM = SPAN_Q_OTHERI + 1; |
| 1699 | var SPAN_Q_VAL = SPAN_Q_SUM + 1; |
| 1700 | var SPAN_Q_OPP = SPAN_Q_VAL + 1; |
| 1701 | |
caryclark | 1049f12 | 2015-04-20 08:31:59 -0700 | [diff] [blame] | 1702 | var SPAN_K_W = SPAN_Y3 + 1; |
caryclark | 55888e4 | 2016-07-18 10:01:36 -0700 | [diff] [blame] | 1703 | var SPAN_K_TX = SPAN_K_W + 1; |
caryclark | 1049f12 | 2015-04-20 08:31:59 -0700 | [diff] [blame] | 1704 | var SPAN_K_TY = SPAN_K_TX + 1; |
caryclark | 55888e4 | 2016-07-18 10:01:36 -0700 | [diff] [blame] | 1705 | var SPAN_K_OTHER = SPAN_K_TY + 1; |
caryclark | 1049f12 | 2015-04-20 08:31:59 -0700 | [diff] [blame] | 1706 | var SPAN_K_OTHERT = SPAN_K_OTHER + 1; |
| 1707 | var SPAN_K_OTHERI = SPAN_K_OTHERT + 1; |
| 1708 | var SPAN_K_SUM = SPAN_K_OTHERI + 1; |
| 1709 | var SPAN_K_VAL = SPAN_K_SUM + 1; |
| 1710 | var SPAN_K_OPP = SPAN_K_VAL + 1; |
| 1711 | |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 1712 | var SPAN_X4 = SPAN_Y3 + 1; |
| 1713 | var SPAN_Y4 = SPAN_X4 + 1; |
caryclark | 1049f12 | 2015-04-20 08:31:59 -0700 | [diff] [blame] | 1714 | |
caryclark | 55888e4 | 2016-07-18 10:01:36 -0700 | [diff] [blame] | 1715 | var SPAN_C_TX = SPAN_Y4 + 1; |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 1716 | var SPAN_C_TY = SPAN_C_TX + 1; |
caryclark | 55888e4 | 2016-07-18 10:01:36 -0700 | [diff] [blame] | 1717 | var SPAN_C_OTHER = SPAN_C_TY + 1; |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 1718 | var SPAN_C_OTHERT = SPAN_C_OTHER + 1; |
| 1719 | var SPAN_C_OTHERI = SPAN_C_OTHERT + 1; |
| 1720 | var SPAN_C_SUM = SPAN_C_OTHERI + 1; |
| 1721 | var SPAN_C_VAL = SPAN_C_SUM + 1; |
| 1722 | var SPAN_C_OPP = SPAN_C_VAL + 1; |
| 1723 | |
| 1724 | var ACTIVE_LINE_SPAN = 1; |
| 1725 | var ACTIVE_QUAD_SPAN = ACTIVE_LINE_SPAN + 1; |
caryclark | 1049f12 | 2015-04-20 08:31:59 -0700 | [diff] [blame] | 1726 | var ACTIVE_CONIC_SPAN = ACTIVE_QUAD_SPAN + 1; |
| 1727 | var ACTIVE_CUBIC_SPAN = ACTIVE_CONIC_SPAN + 1; |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 1728 | |
| 1729 | var ADD_MOVETO = ACTIVE_CUBIC_SPAN + 1; |
| 1730 | var ADD_LINETO = ADD_MOVETO + 1; |
| 1731 | var ADD_QUADTO = ADD_LINETO + 1; |
caryclark | 1049f12 | 2015-04-20 08:31:59 -0700 | [diff] [blame] | 1732 | var ADD_CONICTO = ADD_QUADTO + 1; |
| 1733 | var ADD_CUBICTO = ADD_CONICTO + 1; |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 1734 | var ADD_CLOSE = ADD_CUBICTO + 1; |
| 1735 | var ADD_FILL = ADD_CLOSE + 1; |
| 1736 | |
| 1737 | var PATH_LINE = ADD_FILL + 1; |
| 1738 | var PATH_QUAD = PATH_LINE + 1; |
caryclark | 1049f12 | 2015-04-20 08:31:59 -0700 | [diff] [blame] | 1739 | var PATH_CONIC = PATH_QUAD + 1; |
| 1740 | var PATH_CUBIC = PATH_CONIC + 1; |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 1741 | |
| 1742 | var INTERSECT_LINE = PATH_CUBIC + 1; |
| 1743 | var INTERSECT_LINE_2 = INTERSECT_LINE + 1; |
| 1744 | var INTERSECT_LINE_NO = INTERSECT_LINE_2 + 1; |
| 1745 | var INTERSECT_QUAD_LINE = INTERSECT_LINE_NO + 1; |
| 1746 | var INTERSECT_QUAD_LINE_2 = INTERSECT_QUAD_LINE + 1; |
| 1747 | var INTERSECT_QUAD_LINE_NO = INTERSECT_QUAD_LINE_2 + 1; |
| 1748 | var INTERSECT_QUAD = INTERSECT_QUAD_LINE_NO + 1; |
| 1749 | var INTERSECT_QUAD_2 = INTERSECT_QUAD + 1; |
| 1750 | var INTERSECT_QUAD_NO = INTERSECT_QUAD_2 + 1; |
caryclark | 1049f12 | 2015-04-20 08:31:59 -0700 | [diff] [blame] | 1751 | var INTERSECT_CONIC_LINE = INTERSECT_QUAD_NO + 1; |
| 1752 | var INTERSECT_CONIC_LINE_2 = INTERSECT_CONIC_LINE + 1; |
| 1753 | var INTERSECT_CONIC_LINE_NO = INTERSECT_CONIC_LINE_2 + 1; |
caryclark | 55888e4 | 2016-07-18 10:01:36 -0700 | [diff] [blame] | 1754 | var INTERSECT_CONIC_QUAD = INTERSECT_CONIC_LINE_NO + 1; |
| 1755 | var INTERSECT_CONIC_QUAD_2 = INTERSECT_CONIC_QUAD + 1; |
caryclark | 6c3b9cd | 2016-09-26 05:36:58 -0700 | [diff] [blame] | 1756 | var INTERSECT_CONIC_QUAD_3 = INTERSECT_CONIC_QUAD_2 + 1; |
| 1757 | var INTERSECT_CONIC_QUAD_4 = INTERSECT_CONIC_QUAD_3 + 1; |
| 1758 | var INTERSECT_CONIC_QUAD_NO = INTERSECT_CONIC_QUAD_4 + 1; |
caryclark | 55888e4 | 2016-07-18 10:01:36 -0700 | [diff] [blame] | 1759 | var INTERSECT_CONIC = INTERSECT_CONIC_QUAD_NO + 1; |
caryclark | 1049f12 | 2015-04-20 08:31:59 -0700 | [diff] [blame] | 1760 | var INTERSECT_CONIC_2 = INTERSECT_CONIC + 1; |
| 1761 | var INTERSECT_CONIC_NO = INTERSECT_CONIC_2 + 1; |
| 1762 | var INTERSECT_SELF_CUBIC = INTERSECT_CONIC_NO + 1; |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 1763 | var INTERSECT_SELF_CUBIC_NO = INTERSECT_SELF_CUBIC + 1; |
| 1764 | var INTERSECT_CUBIC_LINE = INTERSECT_SELF_CUBIC_NO + 1; |
| 1765 | var INTERSECT_CUBIC_LINE_2 = INTERSECT_CUBIC_LINE + 1; |
| 1766 | var INTERSECT_CUBIC_LINE_3 = INTERSECT_CUBIC_LINE_2 + 1; |
| 1767 | var INTERSECT_CUBIC_LINE_NO = INTERSECT_CUBIC_LINE_3 + 1; |
| 1768 | var INTERSECT_CUBIC_QUAD = INTERSECT_CUBIC_LINE_NO + 1; |
| 1769 | var INTERSECT_CUBIC_QUAD_2 = INTERSECT_CUBIC_QUAD + 1; |
| 1770 | var INTERSECT_CUBIC_QUAD_3 = INTERSECT_CUBIC_QUAD_2 + 1; |
| 1771 | var INTERSECT_CUBIC_QUAD_4 = INTERSECT_CUBIC_QUAD_3 + 1; |
| 1772 | var INTERSECT_CUBIC_QUAD_NO = INTERSECT_CUBIC_QUAD_4 + 1; |
| 1773 | var INTERSECT_CUBIC = INTERSECT_CUBIC_QUAD_NO + 1; |
| 1774 | var INTERSECT_CUBIC_2 = INTERSECT_CUBIC + 1; |
| 1775 | var INTERSECT_CUBIC_3 = INTERSECT_CUBIC_2 + 1; |
| 1776 | var INTERSECT_CUBIC_4 = INTERSECT_CUBIC_3 + 1; |
| 1777 | // FIXME: add cubic 5- 9 |
| 1778 | var INTERSECT_CUBIC_NO = INTERSECT_CUBIC_4 + 1; |
| 1779 | |
| 1780 | var SORT_UNARY = INTERSECT_CUBIC_NO + 1; |
| 1781 | var SORT_BINARY = SORT_UNARY + 1; |
| 1782 | |
| 1783 | var OP_DIFFERENCE = SORT_BINARY + 1; |
| 1784 | var OP_INTERSECT = OP_DIFFERENCE + 1; |
| 1785 | var OP_UNION = OP_INTERSECT + 1; |
| 1786 | var OP_XOR = OP_UNION + 1; |
| 1787 | |
| 1788 | var MARK_LINE = OP_XOR + 1; |
| 1789 | var MARK_QUAD = MARK_LINE + 1; |
caryclark | 1049f12 | 2015-04-20 08:31:59 -0700 | [diff] [blame] | 1790 | var MARK_CONIC = MARK_QUAD + 1; |
| 1791 | var MARK_CUBIC = MARK_CONIC + 1; |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 1792 | var MARK_DONE_LINE = MARK_CUBIC + 1; |
| 1793 | var MARK_DONE_QUAD = MARK_DONE_LINE + 1; |
caryclark | 1049f12 | 2015-04-20 08:31:59 -0700 | [diff] [blame] | 1794 | var MARK_DONE_CONIC = MARK_DONE_QUAD + 1; |
| 1795 | var MARK_DONE_CUBIC = MARK_DONE_CONIC + 1; |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 1796 | var MARK_UNSORTABLE_LINE = MARK_DONE_CUBIC + 1; |
| 1797 | var MARK_UNSORTABLE_QUAD = MARK_UNSORTABLE_LINE + 1; |
caryclark | 1049f12 | 2015-04-20 08:31:59 -0700 | [diff] [blame] | 1798 | var MARK_UNSORTABLE_CONIC = MARK_UNSORTABLE_QUAD + 1; |
| 1799 | var MARK_UNSORTABLE_CUBIC = MARK_UNSORTABLE_CONIC + 1; |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 1800 | var MARK_SIMPLE_LINE = MARK_UNSORTABLE_CUBIC + 1; |
| 1801 | var MARK_SIMPLE_QUAD = MARK_SIMPLE_LINE + 1; |
caryclark | 1049f12 | 2015-04-20 08:31:59 -0700 | [diff] [blame] | 1802 | var MARK_SIMPLE_CONIC = MARK_SIMPLE_QUAD + 1; |
| 1803 | var MARK_SIMPLE_CUBIC = MARK_SIMPLE_CONIC + 1; |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 1804 | var MARK_SIMPLE_DONE_LINE = MARK_SIMPLE_CUBIC + 1; |
| 1805 | var MARK_SIMPLE_DONE_QUAD = MARK_SIMPLE_DONE_LINE + 1; |
caryclark | 1049f12 | 2015-04-20 08:31:59 -0700 | [diff] [blame] | 1806 | var MARK_SIMPLE_DONE_CONIC = MARK_SIMPLE_DONE_QUAD + 1; |
| 1807 | var MARK_SIMPLE_DONE_CUBIC = MARK_SIMPLE_DONE_CONIC + 1; |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 1808 | var MARK_DONE_UNARY_LINE = MARK_SIMPLE_DONE_CUBIC + 1; |
| 1809 | var MARK_DONE_UNARY_QUAD = MARK_DONE_UNARY_LINE + 1; |
caryclark | 1049f12 | 2015-04-20 08:31:59 -0700 | [diff] [blame] | 1810 | var MARK_DONE_UNARY_CONIC = MARK_DONE_UNARY_QUAD + 1; |
| 1811 | var MARK_DONE_UNARY_CUBIC = MARK_DONE_UNARY_CONIC + 1; |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 1812 | var MARK_ANGLE_LAST = MARK_DONE_UNARY_CUBIC + 1; |
| 1813 | |
| 1814 | var COMPUTED_SET_1 = MARK_ANGLE_LAST + 1; |
| 1815 | var COMPUTED_SET_2 = COMPUTED_SET_1 + 1; |
| 1816 | |
caryclark | 624637c | 2015-05-11 07:21:27 -0700 | [diff] [blame] | 1817 | var ANGLE_AFTER = COMPUTED_SET_2 + 1; |
caryclark | 5435929 | 2015-03-26 07:52:43 -0700 | [diff] [blame] | 1818 | var ANGLE_AFTERPART = ANGLE_AFTER + 1; |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 1819 | |
caryclark | 5435929 | 2015-03-26 07:52:43 -0700 | [diff] [blame] | 1820 | var ACTIVE_OP = ANGLE_AFTERPART + 1; |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 1821 | |
caryclark | 624637c | 2015-05-11 07:21:27 -0700 | [diff] [blame] | 1822 | var COIN_MAIN_SPAN = ACTIVE_OP + 1; |
| 1823 | var COIN_OPP_SPAN = COIN_MAIN_SPAN + 1; |
| 1824 | |
| 1825 | var FRAG_TYPE_LAST = COIN_OPP_SPAN; |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 1826 | |
| 1827 | var REC_TYPE_UNKNOWN = -1; |
| 1828 | var REC_TYPE_PATH = 0; |
caryclark | 5435929 | 2015-03-26 07:52:43 -0700 | [diff] [blame] | 1829 | var REC_TYPE_PATH2 = 1; |
| 1830 | var REC_TYPE_SECT = 2; |
| 1831 | var REC_TYPE_ACTIVE = 3; |
| 1832 | var REC_TYPE_ADD = 4; |
| 1833 | var REC_TYPE_SORT = 5; |
| 1834 | var REC_TYPE_OP = 6; |
| 1835 | var REC_TYPE_MARK = 7; |
| 1836 | var REC_TYPE_COMPUTED = 8; |
| 1837 | var REC_TYPE_COIN = 9; |
| 1838 | var REC_TYPE_ANGLE = 10; |
| 1839 | var REC_TYPE_ACTIVE_OP = 11; |
| 1840 | var REC_TYPE_AFTERPART = 12; |
caryclark | 03b03ca | 2015-04-23 09:13:37 -0700 | [diff] [blame] | 1841 | var REC_TYPE_TOP = 13; |
caryclark | 624637c | 2015-05-11 07:21:27 -0700 | [diff] [blame] | 1842 | var REC_TYPE_COINCIDENCE = 14; |
caryclark | 26ad22a | 2015-10-16 09:03:38 -0700 | [diff] [blame] | 1843 | var REC_TYPE_ALIGNED = 15; |
| 1844 | var REC_TYPE_LAST = REC_TYPE_ALIGNED; |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 1845 | |
| 1846 | function strs_to_nums(strs) { |
| 1847 | var result = []; |
| 1848 | for (var idx = 1; idx < strs.length; ++idx) { |
| 1849 | var str = strs[idx]; |
| 1850 | var num = parseFloat(str); |
| 1851 | if (isNaN(num)) { |
| 1852 | result.push(str); |
| 1853 | } else { |
| 1854 | result.push(num); |
| 1855 | } |
| 1856 | } |
| 1857 | return result; |
| 1858 | } |
| 1859 | |
| 1860 | function filter_str_by(id, str, regex, array) { |
| 1861 | if (regex.test(str)) { |
| 1862 | var strs = regex.exec(str); |
| 1863 | var result = strs_to_nums(strs); |
| 1864 | array.push(id); |
| 1865 | array.push(result); |
| 1866 | return true; |
| 1867 | } |
| 1868 | return false; |
| 1869 | } |
| 1870 | |
| 1871 | function construct_regexp2(pattern) { |
| 1872 | var escape = pattern.replace(/[-/\\^$*+?.()|[\]{}]/g, '\\$&'); |
| 1873 | escape = escape.replace(/UNSORTABLE/g, "\\*\\*\\* UNSORTABLE \\*\\*\\*"); |
| 1874 | 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] | 1875 | 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] | 1876 | escape = escape.replace(/QUAD_VAL/g, "\\(P_VAL P_VAL P_VAL\\)"); |
| 1877 | escape = escape.replace(/LINE_VAL/g, "\\(P_VAL P_VAL\\)"); |
| 1878 | escape = escape.replace(/FILL_TYPE/g, "SkPath::k[a-zA-Z]+_FillType"); |
caryclark | 5435929 | 2015-03-26 07:52:43 -0700 | [diff] [blame] | 1879 | escape = escape.replace(/PTR_VAL/g, "0x[0-9A-F]+"); |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 1880 | escape = escape.replace(/PT_VAL/g, "\\(P_VAL\\)"); |
| 1881 | escape = escape.replace(/P_VAL/g, "(-?\\d+\\.?\\d*(?:e-?\\d+)?)[Ff]?, ?(-?\\d+\\.?\\d*(?:e-?\\d+)?)[Ff]?"); |
| 1882 | escape = escape.replace(/T_VAL/g, "(-?\\d+\\.?\\d*(?:e-?\\d+)?)"); |
caryclark | 1049f12 | 2015-04-20 08:31:59 -0700 | [diff] [blame] | 1883 | escape = escape.replace(/W_VAL/g, "(-?\\d+\\.?\\d*(?:e-?\\d+)?)[Ff]?"); |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 1884 | escape = escape.replace(/PATH/g, "pathB?"); |
caryclark | 1049f12 | 2015-04-20 08:31:59 -0700 | [diff] [blame] | 1885 | escape = escape.replace(/IDX/g, "(-?\\d+)"); |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 1886 | escape = escape.replace(/NUM/g, "(-?\\d+)"); |
| 1887 | escape = escape.replace(/OPT/g, "(\\?|-?\\d+)"); |
| 1888 | return new RegExp(escape, 'i'); |
| 1889 | } |
| 1890 | |
| 1891 | function construct_regexp2c(pattern) { |
| 1892 | var escape = pattern.replace(/[-/\\^$*+?.()|[\]{}]/g, '\\$&'); |
| 1893 | escape = escape.replace(/UNSORTABLE/g, "\\*\\*\\* UNSORTABLE \\*\\*\\*"); |
caryclark | 5435929 | 2015-03-26 07:52:43 -0700 | [diff] [blame] | 1894 | 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] | 1895 | 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] | 1896 | escape = escape.replace(/QUAD_VAL/g, "(?:\\$\\d = )?\\{\\{\\{P_VAL\\}, \\{P_VAL\\}, \\{P_VAL\\}\\}\\}"); |
| 1897 | escape = escape.replace(/LINE_VAL/g, "(?:\\$\\d = )?\\{\\{\\{P_VAL\\}, \\{P_VAL\\}\\}\\}"); |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 1898 | escape = escape.replace(/FILL_TYPE/g, "SkPath::k[a-zA-Z]+_FillType"); |
caryclark | 5435929 | 2015-03-26 07:52:43 -0700 | [diff] [blame] | 1899 | escape = escape.replace(/PTR_VAL/g, "0x[0-9A-F]+"); |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 1900 | escape = escape.replace(/PT_VAL/g, "\\{\\{P_VAL\\}\\}"); |
caryclark | 5435929 | 2015-03-26 07:52:43 -0700 | [diff] [blame] | 1901 | 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] | 1902 | escape = escape.replace(/T_VAL/g, "(-?\\d+\\.?\\d*(?:e-?\\d+)?)"); |
caryclark | 1049f12 | 2015-04-20 08:31:59 -0700 | [diff] [blame] | 1903 | escape = escape.replace(/W_VAL/g, "(-?\\d+\\.?\\d*(?:e-?\\d+)?)[Ff]?"); |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 1904 | escape = escape.replace(/OPER/g, "[a-z]+"); |
| 1905 | escape = escape.replace(/PATH/g, "pathB?"); |
| 1906 | escape = escape.replace(/T_F/g, "([TF])"); |
caryclark | 1049f12 | 2015-04-20 08:31:59 -0700 | [diff] [blame] | 1907 | escape = escape.replace(/IDX/g, "(-?\\d+)"); |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 1908 | escape = escape.replace(/NUM/g, "(-?\\d+)"); |
| 1909 | escape = escape.replace(/OPT/g, "(\\?|-?\\d+)"); |
| 1910 | return new RegExp(escape, 'i'); |
| 1911 | } |
| 1912 | |
| 1913 | function match_regexp(str, lineNo, array, id, pattern) { |
| 1914 | var regex = construct_regexp2(pattern); |
| 1915 | if (filter_str_by(id, str, regex, array)) { |
| 1916 | return true; |
| 1917 | } |
| 1918 | regex = construct_regexp2c(pattern); |
| 1919 | return filter_str_by(id, str, regex, array); |
| 1920 | } |
| 1921 | |
| 1922 | function endsWith(str, suffix) { |
| 1923 | return str.indexOf(suffix, str.length - suffix.length) !== -1; |
| 1924 | } |
| 1925 | |
| 1926 | function parse_all(test) { |
| 1927 | var lines = test.match(/[^\r\n]+/g); |
| 1928 | var records = []; // a rec can be the original paths, a set of intersections, a set of active spans, a sort, or a path add |
| 1929 | var record = []; |
| 1930 | var recType = REC_TYPE_UNKNOWN; |
| 1931 | var lastLineNo; |
| 1932 | var moveX, moveY; |
| 1933 | for (var lineNo = 0; lineNo < lines.length; ++lineNo) { |
| 1934 | var line = lines[lineNo]; |
| 1935 | if (line.length == 0) { |
| 1936 | continue; |
| 1937 | } |
| 1938 | var opStart = "SkOpSegment::"; |
| 1939 | if (line.lastIndexOf(opStart, 0) === 0) { |
| 1940 | line = line.substr(opStart.length); |
| 1941 | } |
| 1942 | var angleStart = "SkOpAngle::"; |
| 1943 | if (line.lastIndexOf(angleStart, 0) === 0) { |
| 1944 | line = line.substr(angleStart.length); |
| 1945 | } |
caryclark | 624637c | 2015-05-11 07:21:27 -0700 | [diff] [blame] | 1946 | var coinStart = "SkOpCoincidence::"; |
| 1947 | if (line.lastIndexOf(coinStart, 0) === 0) { |
| 1948 | line = line.substr(coinStart.length); |
| 1949 | } |
caryclark | 5435929 | 2015-03-26 07:52:43 -0700 | [diff] [blame] | 1950 | var type = line.lastIndexOf("debugShowActiveSpans", 0) === 0 ? REC_TYPE_ACTIVE |
caryclark | 624637c | 2015-05-11 07:21:27 -0700 | [diff] [blame] | 1951 | : line.lastIndexOf("debugShowCoincidence", 0) === 0 ? REC_TYPE_COINCIDENCE |
caryclark | 5435929 | 2015-03-26 07:52:43 -0700 | [diff] [blame] | 1952 | : line.lastIndexOf("((SkOpSegment*)", 0) === 0 ? REC_TYPE_PATH2 |
caryclark | 55888e4 | 2016-07-18 10:01:36 -0700 | [diff] [blame] | 1953 | : line.lastIndexOf("debugShowTs", 0) === 0 ? REC_TYPE_COIN |
caryclark | 5435929 | 2015-03-26 07:52:43 -0700 | [diff] [blame] | 1954 | : line.lastIndexOf("afterPart", 0) === 0 ? REC_TYPE_AFTERPART |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 1955 | : line.lastIndexOf("debugShow", 0) === 0 ? REC_TYPE_SECT |
| 1956 | : line.lastIndexOf("activeOp", 0) === 0 ? REC_TYPE_ACTIVE_OP |
| 1957 | : line.lastIndexOf("computed", 0) === 0 ? REC_TYPE_COMPUTED |
| 1958 | : line.lastIndexOf("debugOne", 0) === 0 ? REC_TYPE_SORT |
caryclark | 26ad22a | 2015-10-16 09:03:38 -0700 | [diff] [blame] | 1959 | : line.lastIndexOf("aligned=", 0) === 0 ? REC_TYPE_ALIGNED |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 1960 | : line.lastIndexOf("dumpOne", 0) === 0 ? REC_TYPE_SORT |
caryclark | 03b03ca | 2015-04-23 09:13:37 -0700 | [diff] [blame] | 1961 | : line.lastIndexOf("findTop", 0) === 0 ? REC_TYPE_TOP |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 1962 | : line.lastIndexOf("pathB.", 0) === 0 ? REC_TYPE_ADD |
| 1963 | : line.lastIndexOf("path.", 0) === 0 ? REC_TYPE_ADD |
| 1964 | : line.lastIndexOf("after", 0) === 0 ? REC_TYPE_ANGLE |
| 1965 | : line.lastIndexOf("mark", 0) === 0 ? REC_TYPE_MARK |
| 1966 | : line.lastIndexOf(" {{", 0) === 0 ? REC_TYPE_COMPUTED |
caryclark | 5435929 | 2015-03-26 07:52:43 -0700 | [diff] [blame] | 1967 | : line.lastIndexOf("seg=", 0) === 0 ? REC_TYPE_PATH |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 1968 | : line.lastIndexOf("op", 0) === 0 ? REC_TYPE_OP |
| 1969 | : line.lastIndexOf("$", 0) === 0 ? REC_TYPE_PATH |
| 1970 | : REC_TYPE_UNKNOWN; |
| 1971 | if (recType != type || recType == REC_TYPE_ADD || recType == REC_TYPE_SECT |
| 1972 | || recType == REC_TYPE_ACTIVE_OP || recType == REC_TYPE_ANGLE) { |
| 1973 | if (recType != REC_TYPE_UNKNOWN) { |
| 1974 | records.push(recType); |
| 1975 | records.push(lastLineNo); |
| 1976 | records.push(record); |
| 1977 | } |
| 1978 | record = []; |
| 1979 | recType = type; |
| 1980 | lastLineNo = lineNo; |
| 1981 | } |
| 1982 | var found = false; |
| 1983 | switch (recType) { |
| 1984 | case REC_TYPE_ACTIVE: |
| 1985 | found = match_regexp(line, lineNo, record, ACTIVE_LINE_SPAN, "debugShowActiveSpans" + |
caryclark | 55888e4 | 2016-07-18 10:01:36 -0700 | [diff] [blame] | 1986 | " 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] | 1987 | ) || match_regexp(line, lineNo, record, ACTIVE_QUAD_SPAN, "debugShowActiveSpans" + |
caryclark | 55888e4 | 2016-07-18 10:01:36 -0700 | [diff] [blame] | 1988 | " 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] | 1989 | ) || match_regexp(line, lineNo, record, ACTIVE_CONIC_SPAN, "debugShowActiveSpans" + |
caryclark | 55888e4 | 2016-07-18 10:01:36 -0700 | [diff] [blame] | 1990 | " 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] | 1991 | ) || match_regexp(line, lineNo, record, ACTIVE_CUBIC_SPAN, "debugShowActiveSpans" + |
caryclark | 55888e4 | 2016-07-18 10:01:36 -0700 | [diff] [blame] | 1992 | " 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] | 1993 | ) || match_regexp(line, lineNo, record, ACTIVE_LINE_SPAN, "debugShowActiveSpans" + |
caryclark | 55888e4 | 2016-07-18 10:01:36 -0700 | [diff] [blame] | 1994 | " 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] | 1995 | ) || match_regexp(line, lineNo, record, ACTIVE_QUAD_SPAN, "debugShowActiveSpans" + |
caryclark | 55888e4 | 2016-07-18 10:01:36 -0700 | [diff] [blame] | 1996 | " 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] | 1997 | ) || match_regexp(line, lineNo, record, ACTIVE_CONIC_SPAN, "debugShowActiveSpans" + |
caryclark | 55888e4 | 2016-07-18 10:01:36 -0700 | [diff] [blame] | 1998 | " 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] | 1999 | ) || match_regexp(line, lineNo, record, ACTIVE_CUBIC_SPAN, "debugShowActiveSpans" + |
caryclark | 55888e4 | 2016-07-18 10:01:36 -0700 | [diff] [blame] | 2000 | " 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] | 2001 | ); |
| 2002 | break; |
| 2003 | case REC_TYPE_ACTIVE_OP: |
| 2004 | found = match_regexp(line, lineNo, record, ACTIVE_OP, "activeOp" + |
| 2005 | " id=IDX t=T_VAL tEnd=T_VAL op=OPER miFrom=NUM miTo=NUM suFrom=NUM suTo=NUM result=IDX" |
| 2006 | ); |
| 2007 | break; |
| 2008 | case REC_TYPE_ADD: |
| 2009 | if (match_regexp(line, lineNo, record, ADD_MOVETO, "PATH.moveTo(P_VAL);")) { |
| 2010 | moveX = record[1][0]; |
| 2011 | moveY = record[1][1]; |
| 2012 | found = true; |
| 2013 | } else if (match_regexp(line, lineNo, record, ADD_LINETO, "PATH.lineTo(P_VAL);")) { |
| 2014 | record[1].unshift(moveY); |
| 2015 | record[1].unshift(moveX); |
| 2016 | moveX = record[1][2]; |
| 2017 | moveY = record[1][3]; |
| 2018 | found = true; |
| 2019 | } else if (match_regexp(line, lineNo, record, ADD_QUADTO, "PATH.quadTo(P_VAL, P_VAL);")) { |
| 2020 | record[1].unshift(moveY); |
| 2021 | record[1].unshift(moveX); |
| 2022 | moveX = record[1][4]; |
| 2023 | moveY = record[1][5]; |
| 2024 | found = true; |
caryclark | 1049f12 | 2015-04-20 08:31:59 -0700 | [diff] [blame] | 2025 | } else if (match_regexp(line, lineNo, record, ADD_CONICTO, "PATH.conicTo(P_VAL, P_VAL, T_VAL);")) { |
| 2026 | record[1].unshift(moveY); |
| 2027 | record[1].unshift(moveX); |
| 2028 | moveX = record[1][4]; |
| 2029 | moveY = record[1][5]; |
| 2030 | found = true; |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 2031 | } else if (match_regexp(line, lineNo, record, ADD_CUBICTO, "PATH.cubicTo(P_VAL, P_VAL, P_VAL);")) { |
| 2032 | record[1].unshift(moveY); |
| 2033 | record[1].unshift(moveX); |
| 2034 | moveX = record[1][6]; |
| 2035 | moveY = record[1][7]; |
| 2036 | found = true; |
| 2037 | } else if (match_regexp(line, lineNo, record, ADD_FILL, "PATH.setFillType(FILL_TYPE);")) { |
| 2038 | found = true; |
| 2039 | } else { |
| 2040 | found = match_regexp(line, lineNo, record, ADD_CLOSE, "PATH.close();"); |
| 2041 | } |
| 2042 | break; |
caryclark | 5435929 | 2015-03-26 07:52:43 -0700 | [diff] [blame] | 2043 | case REC_TYPE_AFTERPART: |
Cary Clark | ff11428 | 2016-12-14 11:56:16 -0500 | [diff] [blame] | 2044 | found = match_regexp(line, lineNo, record, PATH_LINE, "afterPart LINE_VAL id=IDX") |
| 2045 | || match_regexp(line, lineNo, record, PATH_QUAD, "afterPart QUAD_VAL id=IDX") |
| 2046 | || match_regexp(line, lineNo, record, PATH_CONIC, "afterPart CONIC_VAL id=IDX") |
| 2047 | || match_regexp(line, lineNo, record, PATH_CUBIC, "afterPart CUBIC_VAL id=IDX") |
caryclark | 5435929 | 2015-03-26 07:52:43 -0700 | [diff] [blame] | 2048 | break; |
caryclark | 26ad22a | 2015-10-16 09:03:38 -0700 | [diff] [blame] | 2049 | case REC_TYPE_ALIGNED: |
| 2050 | found = match_regexp(line, lineNo, record, PATH_LINE, "aligned=IDX LINE_VAL" |
| 2051 | ) || match_regexp(line, lineNo, record, PATH_QUAD, "aligned=IDX QUAD_VAL" |
| 2052 | ) || match_regexp(line, lineNo, record, PATH_CONIC, "aligned=IDX CONIC_VAL" |
| 2053 | ) || match_regexp(line, lineNo, record, PATH_CUBIC, "aligned=IDX CUBIC_VAL" |
| 2054 | ); |
| 2055 | break; |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 2056 | case REC_TYPE_ANGLE: |
| 2057 | found = match_regexp(line, lineNo, record, ANGLE_AFTER, "after " + |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 2058 | "[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"); |
| 2059 | break; |
| 2060 | case REC_TYPE_COIN: |
| 2061 | found = true; |
| 2062 | break; |
caryclark | 624637c | 2015-05-11 07:21:27 -0700 | [diff] [blame] | 2063 | case REC_TYPE_COINCIDENCE: |
| 2064 | found = match_regexp(line, lineNo, record, COIN_MAIN_SPAN, "debugShowCoincidence" + |
| 2065 | " + id=IDX t=T_VAL tEnd=T_VAL" |
| 2066 | ) || match_regexp(line, lineNo, record, COIN_OPP_SPAN, "debugShowCoincidence" + |
| 2067 | " - id=IDX t=T_VAL tEnd=T_VAL" |
| 2068 | ); |
| 2069 | break; |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 2070 | case REC_TYPE_COMPUTED: |
| 2071 | found = line == "computed quadratics given" |
| 2072 | || match_regexp(line, lineNo, record, COMPUTED_SET_1, "computed quadratics set 1" |
| 2073 | ) || match_regexp(line, lineNo, record, COMPUTED_SET_2, "computed quadratics set 2" |
| 2074 | ) || match_regexp(line, lineNo, record, PATH_QUAD, " QUAD_VAL," |
caryclark | 1049f12 | 2015-04-20 08:31:59 -0700 | [diff] [blame] | 2075 | ) || match_regexp(line, lineNo, record, PATH_CONIC, " CONIC_VAL," |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 2076 | ) || match_regexp(line, lineNo, record, PATH_CUBIC, " CUBIC_VAL," |
| 2077 | ); |
| 2078 | break; |
| 2079 | case REC_TYPE_PATH: |
caryclark | 5435929 | 2015-03-26 07:52:43 -0700 | [diff] [blame] | 2080 | found = match_regexp(line, lineNo, record, PATH_LINE, "seg=IDX LINE_VAL" |
| 2081 | ) || match_regexp(line, lineNo, record, PATH_QUAD, "seg=IDX QUAD_VAL" |
caryclark | 1049f12 | 2015-04-20 08:31:59 -0700 | [diff] [blame] | 2082 | ) || match_regexp(line, lineNo, record, PATH_CONIC, "seg=IDX CONIC_VAL" |
caryclark | 5435929 | 2015-03-26 07:52:43 -0700 | [diff] [blame] | 2083 | ) || match_regexp(line, lineNo, record, PATH_CUBIC, "seg=IDX CUBIC_VAL" |
| 2084 | ); |
| 2085 | break; |
| 2086 | case REC_TYPE_PATH2: |
| 2087 | found = match_regexp(line, lineNo, record, PATH_LINE, "((SkOpSegment*) PTR_VAL) [IDX] {LINE_VAL}" |
| 2088 | ) || match_regexp(line, lineNo, record, PATH_QUAD, "((SkOpSegment*) PTR_VAL) [IDX] {QUAD_VAL}" |
caryclark | 1049f12 | 2015-04-20 08:31:59 -0700 | [diff] [blame] | 2089 | ) || match_regexp(line, lineNo, record, PATH_CONIC, "((SkOpSegment*) PTR_VAL) [IDX] {CONIC_VAL}" |
caryclark | 5435929 | 2015-03-26 07:52:43 -0700 | [diff] [blame] | 2090 | ) || match_regexp(line, lineNo, record, PATH_CUBIC, "((SkOpSegment*) PTR_VAL) [IDX] {CUBIC_VAL}" |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 2091 | ); |
| 2092 | break; |
| 2093 | case REC_TYPE_SECT: |
| 2094 | found = match_regexp(line, lineNo, record, INTERSECT_LINE, "debugShowLineIntersection" + |
| 2095 | " wtTs[0]=T_VAL LINE_VAL PT_VAL wnTs[0]=T_VAL LINE_VAL" |
| 2096 | ) || match_regexp(line, lineNo, record, INTERSECT_LINE_2, "debugShowLineIntersection" + |
| 2097 | " wtTs[0]=T_VAL LINE_VAL PT_VAL wtTs[1]=T_VAL PT_VAL wnTs[0]=T_VAL LINE_VAL wnTs[1]=T_VAL" |
| 2098 | ) || match_regexp(line, lineNo, record, INTERSECT_LINE_NO, "debugShowLineIntersection" + |
| 2099 | " no intersect LINE_VAL LINE_VAL" |
| 2100 | ) || match_regexp(line, lineNo, record, INTERSECT_QUAD_LINE, "debugShowQuadLineIntersection" + |
| 2101 | " wtTs[0]=T_VAL QUAD_VAL PT_VAL wnTs[0]=T_VAL LINE_VAL" |
| 2102 | ) || match_regexp(line, lineNo, record, INTERSECT_QUAD_LINE_2, "debugShowQuadLineIntersection" + |
| 2103 | " wtTs[0]=T_VAL QUAD_VAL PT_VAL wtTs[1]=T_VAL PT_VAL wnTs[0]=T_VAL LINE_VAL wnTs[1]=T_VAL" |
| 2104 | ) || match_regexp(line, lineNo, record, INTERSECT_QUAD_LINE_NO, "debugShowQuadLineIntersection" + |
| 2105 | " no intersect QUAD_VAL LINE_VAL" |
| 2106 | ) || match_regexp(line, lineNo, record, INTERSECT_QUAD, "debugShowQuadIntersection" + |
| 2107 | " wtTs[0]=T_VAL QUAD_VAL PT_VAL wnTs[0]=T_VAL QUAD_VAL" |
| 2108 | ) || match_regexp(line, lineNo, record, INTERSECT_QUAD_2, "debugShowQuadIntersection" + |
| 2109 | " wtTs[0]=T_VAL QUAD_VAL PT_VAL wtTs[1]=T_VAL PT_VAL wnTs[0]=T_VAL QUAD_VAL wnTs[1]=T_VAL" |
| 2110 | ) || match_regexp(line, lineNo, record, INTERSECT_QUAD_NO, "debugShowQuadIntersection" + |
| 2111 | " no intersect QUAD_VAL QUAD_VAL" |
caryclark | 55888e4 | 2016-07-18 10:01:36 -0700 | [diff] [blame] | 2112 | |
caryclark | 1049f12 | 2015-04-20 08:31:59 -0700 | [diff] [blame] | 2113 | ) || match_regexp(line, lineNo, record, INTERSECT_CONIC_LINE, "debugShowConicLineIntersection" + |
| 2114 | " wtTs[0]=T_VAL CONIC_VAL PT_VAL wnTs[0]=T_VAL LINE_VAL" |
| 2115 | ) || match_regexp(line, lineNo, record, INTERSECT_CONIC_LINE_2, "debugShowConicLineIntersection" + |
| 2116 | " wtTs[0]=T_VAL CONIC_VAL PT_VAL wtTs[1]=T_VAL PT_VAL wnTs[0]=T_VAL LINE_VAL wnTs[1]=T_VAL" |
| 2117 | ) || match_regexp(line, lineNo, record, INTERSECT_CONIC_LINE_NO, "debugShowConicLineIntersection" + |
| 2118 | " no intersect CONIC_VAL LINE_VAL" |
caryclark | 55888e4 | 2016-07-18 10:01:36 -0700 | [diff] [blame] | 2119 | |
| 2120 | ) || match_regexp(line, lineNo, record, INTERSECT_CONIC_QUAD, "debugShowConicQuadIntersection" + |
| 2121 | " wtTs[0]=T_VAL CONIC_VAL PT_VAL wnTs[0]=T_VAL QUAD_VAL" |
| 2122 | ) || match_regexp(line, lineNo, record, INTERSECT_CONIC_QUAD_2, "debugShowConicQuadIntersection" + |
| 2123 | " 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] | 2124 | ) || match_regexp(line, lineNo, record, INTERSECT_CONIC_QUAD_3, "debugShowConicQuadIntersection" + |
| 2125 | " 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" |
| 2126 | ) || match_regexp(line, lineNo, record, INTERSECT_CONIC_QUAD_4, "debugShowConicQuadIntersection" + |
| 2127 | " 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] | 2128 | ) || match_regexp(line, lineNo, record, INTERSECT_CONIC_QUAD_NO, "debugShowConicQuadIntersection" + |
| 2129 | " no intersect CONIC_VAL QUAD_VAL" |
| 2130 | |
caryclark | 1049f12 | 2015-04-20 08:31:59 -0700 | [diff] [blame] | 2131 | ) || match_regexp(line, lineNo, record, INTERSECT_CONIC, "debugShowConicIntersection" + |
| 2132 | " wtTs[0]=T_VAL CONIC_VAL PT_VAL wnTs[0]=T_VAL CONIC_VAL" |
| 2133 | ) || match_regexp(line, lineNo, record, INTERSECT_CONIC_2, "debugShowConicIntersection" + |
| 2134 | " wtTs[0]=T_VAL CONIC_VAL PT_VAL wtTs[1]=T_VAL PT_VAL wnTs[0]=T_VAL CONIC_VAL wnTs[1]=T_VAL" |
| 2135 | ) || match_regexp(line, lineNo, record, INTERSECT_CONIC_NO, "debugShowConicIntersection" + |
| 2136 | " no intersect CONIC_VAL CONIC_VAL" |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 2137 | ) || match_regexp(line, lineNo, record, INTERSECT_CUBIC_LINE, "debugShowCubicLineIntersection" + |
| 2138 | " wtTs[0]=T_VAL CUBIC_VAL PT_VAL wnTs[0]=T_VAL LINE_VAL" |
| 2139 | ) || match_regexp(line, lineNo, record, INTERSECT_CUBIC_LINE_2, "debugShowCubicLineIntersection" + |
| 2140 | " wtTs[0]=T_VAL CUBIC_VAL PT_VAL wtTs[1]=T_VAL PT_VAL wnTs[0]=T_VAL LINE_VAL wnTs[1]=T_VAL" |
| 2141 | ) || match_regexp(line, lineNo, record, INTERSECT_CUBIC_LINE_3, "debugShowCubicLineIntersection" + |
| 2142 | " 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" |
| 2143 | ) || match_regexp(line, lineNo, record, INTERSECT_CUBIC_LINE_NO, "debugShowCubicLineIntersection" + |
| 2144 | " no intersect CUBIC_VAL LINE_VAL" |
| 2145 | ) || match_regexp(line, lineNo, record, INTERSECT_CUBIC_QUAD, "debugShowCubicQuadIntersection" + |
| 2146 | " wtTs[0]=T_VAL CUBIC_VAL PT_VAL wnTs[0]=T_VAL QUAD_VAL" |
| 2147 | ) || match_regexp(line, lineNo, record, INTERSECT_CUBIC_QUAD_2, "debugShowCubicQuadIntersection" + |
| 2148 | " wtTs[0]=T_VAL CUBIC_VAL PT_VAL wtTs[1]=T_VAL PT_VAL wnTs[0]=T_VAL QUAD_VAL wnTs[1]=T_VAL" |
| 2149 | ) || match_regexp(line, lineNo, record, INTERSECT_CUBIC_QUAD_3, "debugShowCubicQuadIntersection" + |
| 2150 | " 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" |
| 2151 | ) || match_regexp(line, lineNo, record, INTERSECT_CUBIC_QUAD_4, "debugShowCubicQuadIntersection" + |
| 2152 | " 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" |
| 2153 | ) || match_regexp(line, lineNo, record, INTERSECT_CUBIC_QUAD_NO, "debugShowCubicQuadIntersection" + |
| 2154 | " no intersect CUBIC_VAL QUAD_VAL" |
| 2155 | ) || match_regexp(line, lineNo, record, INTERSECT_CUBIC, "debugShowCubicIntersection" + |
| 2156 | " wtTs[0]=T_VAL CUBIC_VAL PT_VAL wnTs[0]=T_VAL CUBIC_VAL" |
| 2157 | ) || match_regexp(line, lineNo, record, INTERSECT_CUBIC_2, "debugShowCubicIntersection" + |
| 2158 | " wtTs[0]=T_VAL CUBIC_VAL PT_VAL wtTs[1]=T_VAL PT_VAL wnTs[0]=T_VAL CUBIC_VAL wnTs[1]=T_VAL" |
| 2159 | ) || match_regexp(line, lineNo, record, INTERSECT_CUBIC_3, "debugShowCubicIntersection" + |
| 2160 | " 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" |
| 2161 | ) || match_regexp(line, lineNo, record, INTERSECT_CUBIC_4, "debugShowCubicIntersection" + |
| 2162 | " 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" |
| 2163 | ) || match_regexp(line, lineNo, record, INTERSECT_CUBIC_NO, "debugShowCubicIntersection" + |
| 2164 | " no intersect CUBIC_VAL CUBIC_VAL" |
| 2165 | ) || match_regexp(line, lineNo, record, INTERSECT_SELF_CUBIC, "debugShowCubicIntersection" + |
| 2166 | " wtTs[0]=T_VAL CUBIC_VAL PT_VAL wtTs[1]=T_VAL" |
| 2167 | ) || match_regexp(line, lineNo, record, INTERSECT_SELF_CUBIC_NO, "debugShowCubicIntersection" + |
| 2168 | " no self intersect CUBIC_VAL" |
| 2169 | ); |
| 2170 | break; |
| 2171 | case REC_TYPE_SORT: |
| 2172 | var hasDone = / done/.test(line); |
| 2173 | var hasUnorderable = / unorderable/.test(line); |
| 2174 | var hasSmall = / small/.test(line); |
| 2175 | var hasTiny = / tiny/.test(line); |
| 2176 | var hasOperand = / operand/.test(line); |
| 2177 | var hasStop = / stop/.test(line); |
| 2178 | line.replace(/[ a-z]+$/, ""); |
| 2179 | found = match_regexp(line, lineNo, record, SORT_UNARY, "debugOne" + |
| 2180 | " [IDX/IDX] next=IDX/IDX sect=IDX/IDX s=T_VAL [IDX] e=T_VAL [IDX] sgn=NUM windVal=IDX windSum=OPT" |
| 2181 | ) || match_regexp(line, lineNo, record, SORT_BINARY, "debugOne" + |
| 2182 | " [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" |
| 2183 | ) || match_regexp(line, lineNo, record, SORT_UNARY, "dumpOne" + |
| 2184 | " [IDX/IDX] next=IDX/IDX sect=NUM/NUM s=T_VAL [IDX] e=T_VAL [IDX] sgn=NUM windVal=IDX windSum=OPT" |
| 2185 | ) || match_regexp(line, lineNo, record, SORT_BINARY, "dumpOne" + |
| 2186 | " [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" |
| 2187 | ); |
| 2188 | if (found) { |
| 2189 | record[1].push(hasDone); |
| 2190 | record[1].push(hasUnorderable); |
| 2191 | record[1].push(hasSmall); |
| 2192 | record[1].push(hasTiny); |
| 2193 | record[1].push(hasOperand); |
| 2194 | record[1].push(hasStop); |
| 2195 | } |
| 2196 | break; |
caryclark | 03b03ca | 2015-04-23 09:13:37 -0700 | [diff] [blame] | 2197 | case REC_TYPE_TOP: |
| 2198 | found = match_regexp(line, lineNo, record, ACTIVE_OP, "findTop" + |
| 2199 | " id=IDX s=T_VAL e=T_VAL cw=NUM swap=NUM inflections=NUM monotonic=NUM" |
| 2200 | ) || match_regexp(line, lineNo, record, ACTIVE_OP, "findTop" + |
| 2201 | " id=IDX s=T_VAL e=T_VAL (-) cw=NUM swap=NUM inflections=NUM monotonic=NUM" |
| 2202 | ) || match_regexp(line, lineNo, record, ACTIVE_OP, "findTop" + |
| 2203 | " id=IDX s=T_VAL e=T_VAL (+) cw=NUM swap=NUM inflections=NUM monotonic=NUM" |
| 2204 | ); |
| 2205 | break; |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 2206 | case REC_TYPE_MARK: |
| 2207 | found = match_regexp(line, lineNo, record, MARK_LINE, "markWinding" + |
caryclark | 5435929 | 2015-03-26 07:52:43 -0700 | [diff] [blame] | 2208 | " 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] | 2209 | ) || match_regexp(line, lineNo, record, MARK_QUAD, "markWinding" + |
caryclark | 5435929 | 2015-03-26 07:52:43 -0700 | [diff] [blame] | 2210 | " 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] | 2211 | ) || match_regexp(line, lineNo, record, MARK_CONIC, "markWinding" + |
| 2212 | " 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] | 2213 | ) || match_regexp(line, lineNo, record, MARK_CUBIC, "markWinding" + |
caryclark | 5435929 | 2015-03-26 07:52:43 -0700 | [diff] [blame] | 2214 | " id=IDX CUBIC_VAL t=T_VAL [IDX] PT_VAL tEnd=T_VAL newWindSum=NUM newOppSum=OPT oppSum=OPT windSum=OPT windValue=IDX" |
| 2215 | ) || match_regexp(line, lineNo, record, MARK_DONE_LINE, "markDone" + |
| 2216 | " 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" |
| 2217 | ) || match_regexp(line, lineNo, record, MARK_DONE_QUAD, "markDone" + |
| 2218 | " 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] | 2219 | ) || match_regexp(line, lineNo, record, MARK_DONE_CONIC, "markDone" + |
| 2220 | " 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] | 2221 | ) || match_regexp(line, lineNo, record, MARK_DONE_CUBIC, "markDone" + |
| 2222 | " 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] | 2223 | ) || match_regexp(line, lineNo, record, MARK_SIMPLE_LINE, "markWinding" + |
| 2224 | " id=IDX LINE_VAL t=T_VAL [IDX] PT_VAL tEnd=T_VAL newWindSum=NUM windSum=OPT windValue=IDX" |
| 2225 | ) || match_regexp(line, lineNo, record, MARK_SIMPLE_QUAD, "markWinding" + |
| 2226 | " 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] | 2227 | ) || match_regexp(line, lineNo, record, MARK_SIMPLE_CONIC, "markWinding" + |
| 2228 | " 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] | 2229 | ) || match_regexp(line, lineNo, record, MARK_SIMPLE_CUBIC, "markWinding" + |
| 2230 | " 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] | 2231 | ) || match_regexp(line, lineNo, record, MARK_ANGLE_LAST, "markAngle" + |
caryclark | 1049f12 | 2015-04-20 08:31:59 -0700 | [diff] [blame] | 2232 | " last segment=IDX span=IDX" |
caryclark | 5435929 | 2015-03-26 07:52:43 -0700 | [diff] [blame] | 2233 | ) || match_regexp(line, lineNo, record, MARK_ANGLE_LAST, "markAngle" + |
caryclark | 55888e4 | 2016-07-18 10:01:36 -0700 | [diff] [blame] | 2234 | " last seg=IDX span=IDX" |
| 2235 | ) || match_regexp(line, lineNo, record, MARK_ANGLE_LAST, "markAngle" + |
| 2236 | " last segment=IDX span=IDX windSum=OPT" |
| 2237 | ) || match_regexp(line, lineNo, record, MARK_ANGLE_LAST, "markAngle" + |
| 2238 | " last seg=IDX span=IDX windSum=OPT" |
| 2239 | ); |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 2240 | break; |
| 2241 | case REC_TYPE_OP: |
| 2242 | if (line.lastIndexOf("oppSign oppSign=", 0) === 0 |
| 2243 | || line.lastIndexOf("operator<", 0) === 0) { |
| 2244 | found = true; |
| 2245 | break; |
| 2246 | } |
caryclark | 5435929 | 2015-03-26 07:52:43 -0700 | [diff] [blame] | 2247 | found = match_regexp(line, lineNo, record, OP_DIFFERENCE, "op diff" |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 2248 | ) || match_regexp(line, lineNo, record, OP_INTERSECT, "op intersect" |
caryclark | 5435929 | 2015-03-26 07:52:43 -0700 | [diff] [blame] | 2249 | ) || match_regexp(line, lineNo, record, OP_INTERSECT, "op sect" |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 2250 | ) || match_regexp(line, lineNo, record, OP_UNION, "op union" |
| 2251 | ) || match_regexp(line, lineNo, record, OP_XOR, "op xor" |
| 2252 | ); |
| 2253 | break; |
| 2254 | case REC_TYPE_UNKNOWN: |
| 2255 | found = true; |
| 2256 | break; |
| 2257 | } |
| 2258 | if (!found) { |
| 2259 | console.log(line + " [" + lineNo + "] of type " + type + " not found"); |
| 2260 | } |
| 2261 | } |
| 2262 | if (recType != REC_TYPE_UNKNOWN) { |
| 2263 | records.push(recType); |
| 2264 | records.push(lastLineNo); |
| 2265 | records.push(record); |
| 2266 | } |
| 2267 | if (records.length >= 1) { |
| 2268 | tests[testIndex] = records; |
| 2269 | testLines[testIndex] = lines; |
| 2270 | } |
| 2271 | } |
| 2272 | |
| 2273 | function init(test) { |
| 2274 | var canvas = document.getElementById('canvas'); |
| 2275 | if (!canvas.getContext) return; |
| 2276 | ctx = canvas.getContext('2d'); |
| 2277 | var resScale = retina_scale && window.devicePixelRatio ? window.devicePixelRatio : 1; |
| 2278 | var unscaledWidth = window.innerWidth - 20; |
| 2279 | var unscaledHeight = window.innerHeight - 20; |
| 2280 | screenWidth = unscaledWidth; |
| 2281 | screenHeight = unscaledHeight; |
| 2282 | canvas.width = unscaledWidth * resScale; |
| 2283 | canvas.height = unscaledHeight * resScale; |
| 2284 | canvas.style.width = unscaledWidth + 'px'; |
| 2285 | canvas.style.height = unscaledHeight + 'px'; |
| 2286 | if (resScale != 1) { |
| 2287 | ctx.scale(resScale, resScale); |
| 2288 | } |
| 2289 | xmin = Infinity; |
| 2290 | xmax = -Infinity; |
| 2291 | ymin = Infinity; |
| 2292 | ymax = -Infinity; |
caryclark | 26ad22a | 2015-10-16 09:03:38 -0700 | [diff] [blame] | 2293 | hasPath = hasAlignedPath = hasComputedPath = false; |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 2294 | firstActiveSpan = -1; |
| 2295 | for (var tIndex = 0; tIndex < test.length; tIndex += 3) { |
| 2296 | var recType = test[tIndex]; |
| 2297 | if (!typeof recType == 'number' || recType < REC_TYPE_UNKNOWN || recType > REC_TYPE_LAST) { |
| 2298 | console.log("unknown rec type: " + recType); |
| 2299 | throw "stop execution"; |
| 2300 | } |
| 2301 | var records = test[tIndex + 2]; |
| 2302 | for (var recordIndex = 0; recordIndex < records.length; recordIndex += 2) { |
| 2303 | var fragType = records[recordIndex]; |
| 2304 | if (!typeof fragType == 'number' || fragType < 1 || fragType > FRAG_TYPE_LAST) { |
| 2305 | console.log("unknown in range frag type: " + fragType); |
| 2306 | throw "stop execution"; |
| 2307 | } |
| 2308 | var frags = records[recordIndex + 1]; |
| 2309 | var first = 0; |
| 2310 | var last = -1; |
| 2311 | var first2 = 0; |
| 2312 | var last2 = 0; |
| 2313 | switch (recType) { |
caryclark | 26ad22a | 2015-10-16 09:03:38 -0700 | [diff] [blame] | 2314 | case REC_TYPE_ALIGNED: |
| 2315 | hasAlignedPath = true; |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 2316 | case REC_TYPE_COMPUTED: |
| 2317 | if (fragType == COMPUTED_SET_1 || fragType == COMPUTED_SET_2) { |
| 2318 | break; |
| 2319 | } |
caryclark | 26ad22a | 2015-10-16 09:03:38 -0700 | [diff] [blame] | 2320 | if (REC_TYPE_COMPUTED == recType) { |
| 2321 | hasComputedPath = true; |
| 2322 | } |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 2323 | case REC_TYPE_PATH: |
caryclark | 5435929 | 2015-03-26 07:52:43 -0700 | [diff] [blame] | 2324 | first = 1; |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 2325 | switch (fragType) { |
| 2326 | case PATH_LINE: |
caryclark | 5435929 | 2015-03-26 07:52:43 -0700 | [diff] [blame] | 2327 | last = 5; |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 2328 | break; |
caryclark | 1049f12 | 2015-04-20 08:31:59 -0700 | [diff] [blame] | 2329 | case PATH_CONIC: |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 2330 | case PATH_QUAD: |
caryclark | 5435929 | 2015-03-26 07:52:43 -0700 | [diff] [blame] | 2331 | last = 7; |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 2332 | break; |
| 2333 | case PATH_CUBIC: |
caryclark | 5435929 | 2015-03-26 07:52:43 -0700 | [diff] [blame] | 2334 | last = 9; |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 2335 | break; |
| 2336 | default: |
caryclark | 55888e4 | 2016-07-18 10:01:36 -0700 | [diff] [blame] | 2337 | console.log("unknown " + (recType == REC_TYPE_PATH ? "REC_TYPE_PATH" |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 2338 | : "REC_TYPE_COMPUTED") + " frag type:" + fragType); |
| 2339 | throw "stop execution"; |
| 2340 | } |
| 2341 | if (recType == REC_TYPE_PATH) { |
| 2342 | hasPath = true; |
| 2343 | } |
| 2344 | break; |
caryclark | 5435929 | 2015-03-26 07:52:43 -0700 | [diff] [blame] | 2345 | case REC_TYPE_PATH2: |
| 2346 | first = 1; |
| 2347 | switch (fragType) { |
| 2348 | case PATH_LINE: |
| 2349 | last = 5; |
| 2350 | break; |
caryclark | 1049f12 | 2015-04-20 08:31:59 -0700 | [diff] [blame] | 2351 | case PATH_CONIC: |
caryclark | 5435929 | 2015-03-26 07:52:43 -0700 | [diff] [blame] | 2352 | case PATH_QUAD: |
| 2353 | last = 7; |
| 2354 | break; |
| 2355 | case PATH_CUBIC: |
| 2356 | last = 9; |
| 2357 | break; |
| 2358 | default: |
caryclark | 55888e4 | 2016-07-18 10:01:36 -0700 | [diff] [blame] | 2359 | console.log("unknown " + (recType == REC_TYPE_PATH2 ? "REC_TYPE_PATH2" |
caryclark | 5435929 | 2015-03-26 07:52:43 -0700 | [diff] [blame] | 2360 | : "REC_TYPE_COMPUTED") + " frag type:" + fragType); |
| 2361 | throw "stop execution"; |
| 2362 | } |
| 2363 | if (recType == REC_TYPE_PATH2) { |
| 2364 | hasPath = true; |
| 2365 | } |
| 2366 | break; |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 2367 | case REC_TYPE_ACTIVE: |
| 2368 | if (firstActiveSpan < 0) { |
| 2369 | firstActiveSpan = tIndex; |
| 2370 | } |
| 2371 | first = 1; |
| 2372 | switch (fragType) { |
| 2373 | case ACTIVE_LINE_SPAN: |
| 2374 | last = 5; |
| 2375 | break; |
caryclark | 1049f12 | 2015-04-20 08:31:59 -0700 | [diff] [blame] | 2376 | case ACTIVE_CONIC_SPAN: |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 2377 | case ACTIVE_QUAD_SPAN: |
| 2378 | last = 7; |
| 2379 | break; |
| 2380 | case ACTIVE_CUBIC_SPAN: |
| 2381 | last = 9; |
| 2382 | break; |
| 2383 | default: |
| 2384 | console.log("unknown REC_TYPE_ACTIVE frag type: " + fragType); |
| 2385 | throw "stop execution"; |
| 2386 | } |
| 2387 | break; |
| 2388 | case REC_TYPE_ADD: |
| 2389 | switch (fragType) { |
| 2390 | case ADD_MOVETO: |
| 2391 | break; |
| 2392 | case ADD_LINETO: |
| 2393 | last = 4; |
| 2394 | break; |
caryclark | 1049f12 | 2015-04-20 08:31:59 -0700 | [diff] [blame] | 2395 | case ADD_CONICTO: |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 2396 | case ADD_QUADTO: |
| 2397 | last = 6; |
| 2398 | break; |
| 2399 | case ADD_CUBICTO: |
| 2400 | last = 8; |
| 2401 | break; |
| 2402 | case ADD_CLOSE: |
| 2403 | case ADD_FILL: |
| 2404 | break; |
| 2405 | default: |
| 2406 | console.log("unknown REC_TYPE_ADD frag type: " + fragType); |
| 2407 | throw "stop execution"; |
| 2408 | } |
| 2409 | break; |
caryclark | 5435929 | 2015-03-26 07:52:43 -0700 | [diff] [blame] | 2410 | case REC_TYPE_AFTERPART: |
| 2411 | switch (fragType) { |
| 2412 | case PATH_LINE: |
| 2413 | last = 4; |
| 2414 | break; |
caryclark | 1049f12 | 2015-04-20 08:31:59 -0700 | [diff] [blame] | 2415 | case PATH_CONIC: |
caryclark | 5435929 | 2015-03-26 07:52:43 -0700 | [diff] [blame] | 2416 | case PATH_QUAD: |
| 2417 | last = 6; |
| 2418 | break; |
| 2419 | case PATH_CUBIC: |
| 2420 | last = 8; |
| 2421 | break; |
| 2422 | default: |
| 2423 | console.log("unknown REC_TYPE_ACTIVEPART frag type: " + fragType); |
| 2424 | throw "stop execution"; |
| 2425 | } |
| 2426 | break; |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 2427 | case REC_TYPE_SECT: |
| 2428 | switch (fragType) { |
| 2429 | case INTERSECT_LINE: |
| 2430 | first = 1; last = 5; first2 = 8; last2 = 12; |
| 2431 | break; |
| 2432 | case INTERSECT_LINE_2: |
| 2433 | first = 1; last = 5; first2 = 11; last2 = 15; |
| 2434 | break; |
| 2435 | case INTERSECT_LINE_NO: |
| 2436 | first = 0; last = 4; first2 = 4; last2 = 8; |
| 2437 | break; |
caryclark | 1049f12 | 2015-04-20 08:31:59 -0700 | [diff] [blame] | 2438 | case INTERSECT_CONIC_LINE: |
| 2439 | first = 1; last = 7; first2 = 11; last2 = 15; |
| 2440 | break; |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 2441 | case INTERSECT_QUAD_LINE: |
| 2442 | first = 1; last = 7; first2 = 10; last2 = 14; |
| 2443 | break; |
caryclark | 1049f12 | 2015-04-20 08:31:59 -0700 | [diff] [blame] | 2444 | case INTERSECT_CONIC_LINE_2: |
| 2445 | first = 1; last = 7; first2 = 14; last2 = 18; |
| 2446 | break; |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 2447 | case INTERSECT_QUAD_LINE_2: |
| 2448 | first = 1; last = 7; first2 = 13; last2 = 17; |
| 2449 | break; |
caryclark | 1049f12 | 2015-04-20 08:31:59 -0700 | [diff] [blame] | 2450 | case INTERSECT_CONIC_LINE_NO: |
| 2451 | first = 0; last = 6; first2 = 7; last2 = 11; |
| 2452 | break; |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 2453 | case INTERSECT_QUAD_LINE_NO: |
| 2454 | first = 0; last = 6; first2 = 6; last2 = 10; |
| 2455 | break; |
caryclark | 1049f12 | 2015-04-20 08:31:59 -0700 | [diff] [blame] | 2456 | case INTERSECT_CONIC: |
| 2457 | first = 1; last = 7; first2 = 11; last2 = 17; |
| 2458 | break; |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 2459 | case INTERSECT_QUAD: |
| 2460 | first = 1; last = 7; first2 = 10; last2 = 16; |
| 2461 | break; |
caryclark | 1049f12 | 2015-04-20 08:31:59 -0700 | [diff] [blame] | 2462 | case INTERSECT_CONIC_2: |
| 2463 | first = 1; last = 7; first2 = 14; last2 = 20; |
| 2464 | break; |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 2465 | case INTERSECT_QUAD_2: |
| 2466 | first = 1; last = 7; first2 = 13; last2 = 19; |
| 2467 | break; |
caryclark | 1049f12 | 2015-04-20 08:31:59 -0700 | [diff] [blame] | 2468 | case INTERSECT_CONIC_NO: |
| 2469 | first = 0; last = 6; first2 = 7; last2 = 13; |
| 2470 | break; |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 2471 | case INTERSECT_QUAD_NO: |
| 2472 | first = 0; last = 6; first2 = 6; last2 = 12; |
| 2473 | break; |
| 2474 | case INTERSECT_SELF_CUBIC: |
| 2475 | first = 1; last = 9; |
| 2476 | break; |
| 2477 | case INTERSECT_SELF_CUBIC_NO: |
| 2478 | first = 0; last = 8; |
| 2479 | break; |
| 2480 | case INTERSECT_CUBIC_LINE: |
| 2481 | first = 1; last = 9; first2 = 12; last2 = 16; |
| 2482 | break; |
| 2483 | case INTERSECT_CUBIC_LINE_2: |
| 2484 | first = 1; last = 9; first2 = 15; last2 = 19; |
| 2485 | break; |
| 2486 | case INTERSECT_CUBIC_LINE_3: |
| 2487 | first = 1; last = 9; first2 = 18; last2 = 22; |
| 2488 | break; |
| 2489 | case INTERSECT_CUBIC_LINE_NO: |
| 2490 | first = 0; last = 8; first2 = 8; last2 = 12; |
| 2491 | break; |
caryclark | 55888e4 | 2016-07-18 10:01:36 -0700 | [diff] [blame] | 2492 | case INTERSECT_CONIC_QUAD: |
| 2493 | first = 1; last = 7; first2 = 11; last2 = 17; |
| 2494 | break; |
| 2495 | case INTERSECT_CONIC_QUAD_2: |
| 2496 | first = 1; last = 7; first2 = 14; last2 = 20; |
| 2497 | break; |
caryclark | 6c3b9cd | 2016-09-26 05:36:58 -0700 | [diff] [blame] | 2498 | case INTERSECT_CONIC_QUAD_3: |
| 2499 | first = 1; last = 7; first2 = 17; last2 = 23; |
| 2500 | break; |
| 2501 | case INTERSECT_CONIC_QUAD_4: |
| 2502 | first = 1; last = 7; first2 = 20; last2 = 26; |
| 2503 | break; |
caryclark | 55888e4 | 2016-07-18 10:01:36 -0700 | [diff] [blame] | 2504 | case INTERSECT_CONIC_QUAD_NO: |
| 2505 | first = 0; last = 6; first2 = 7; last2 = 13; |
| 2506 | break; |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 2507 | case INTERSECT_CUBIC_QUAD: |
| 2508 | first = 1; last = 9; first2 = 12; last2 = 18; |
| 2509 | break; |
| 2510 | case INTERSECT_CUBIC_QUAD_2: |
| 2511 | first = 1; last = 9; first2 = 15; last2 = 21; |
| 2512 | break; |
| 2513 | case INTERSECT_CUBIC_QUAD_3: |
| 2514 | first = 1; last = 9; first2 = 18; last2 = 24; |
| 2515 | break; |
| 2516 | case INTERSECT_CUBIC_QUAD_4: |
| 2517 | first = 1; last = 9; first2 = 21; last2 = 27; |
| 2518 | break; |
| 2519 | case INTERSECT_CUBIC_QUAD_NO: |
| 2520 | first = 0; last = 8; first2 = 8; last2 = 14; |
| 2521 | break; |
| 2522 | case INTERSECT_CUBIC: |
| 2523 | first = 1; last = 9; first2 = 12; last2 = 20; |
| 2524 | break; |
| 2525 | case INTERSECT_CUBIC_2: |
| 2526 | first = 1; last = 9; first2 = 15; last2 = 23; |
| 2527 | break; |
| 2528 | case INTERSECT_CUBIC_3: |
| 2529 | first = 1; last = 9; first2 = 18; last2 = 26; |
| 2530 | break; |
| 2531 | case INTERSECT_CUBIC_4: |
| 2532 | first = 1; last = 9; first2 = 21; last2 = 29; |
| 2533 | break; |
| 2534 | case INTERSECT_CUBIC_NO: |
| 2535 | first = 0; last = 8; first2 = 8; last2 = 16; |
| 2536 | break; |
| 2537 | default: |
| 2538 | console.log("unknown REC_TYPE_SECT frag type: " + fragType); |
| 2539 | throw "stop execution"; |
| 2540 | } |
| 2541 | break; |
| 2542 | default: |
| 2543 | continue; |
| 2544 | } |
| 2545 | for (var idx = first; idx < last; idx += 2) { |
| 2546 | xmin = Math.min(xmin, frags[idx]); |
| 2547 | xmax = Math.max(xmax, frags[idx]); |
| 2548 | ymin = Math.min(ymin, frags[idx + 1]); |
| 2549 | ymax = Math.max(ymax, frags[idx + 1]); |
| 2550 | } |
| 2551 | for (var idx = first2; idx < last2; idx += 2) { |
| 2552 | xmin = Math.min(xmin, frags[idx]); |
| 2553 | xmax = Math.max(xmax, frags[idx]); |
| 2554 | ymin = Math.min(ymin, frags[idx + 1]); |
| 2555 | ymax = Math.max(ymax, frags[idx + 1]); |
| 2556 | } |
| 2557 | } |
| 2558 | } |
| 2559 | var angleBounds = [Infinity, Infinity, -Infinity, -Infinity]; |
| 2560 | for (var tIndex = 0; tIndex < test.length; tIndex += 3) { |
| 2561 | var recType = test[tIndex]; |
| 2562 | var records = test[tIndex + 2]; |
| 2563 | for (var recordIndex = 0; recordIndex < records.length; recordIndex += 2) { |
| 2564 | var fragType = records[recordIndex]; |
| 2565 | var frags = records[recordIndex + 1]; |
| 2566 | switch (recType) { |
| 2567 | case REC_TYPE_ACTIVE_OP: |
| 2568 | if (!draw_op) { |
| 2569 | break; |
| 2570 | } |
| 2571 | { |
| 2572 | var curve = curvePartialByID(test, frags[0], frags[1], frags[2]); |
| 2573 | curve_extremes(curve, angleBounds); |
| 2574 | } |
| 2575 | break; |
| 2576 | case REC_TYPE_ANGLE: |
| 2577 | if (!draw_angle) { |
| 2578 | break; |
| 2579 | } |
caryclark | 5435929 | 2015-03-26 07:52:43 -0700 | [diff] [blame] | 2580 | { |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 2581 | var curve = curvePartialByID(test, frags[0], frags[4], frags[5]); |
| 2582 | curve_extremes(curve, angleBounds); |
| 2583 | curve = curvePartialByID(test, frags[6], frags[10], frags[11]); |
| 2584 | curve_extremes(curve, angleBounds); |
| 2585 | curve = curvePartialByID(test, frags[12], frags[16], frags[17]); |
| 2586 | } |
| 2587 | break; |
caryclark | 624637c | 2015-05-11 07:21:27 -0700 | [diff] [blame] | 2588 | case REC_TYPE_COINCIDENCE: |
| 2589 | if (!draw_coincidence) { |
| 2590 | break; |
| 2591 | } |
| 2592 | { |
| 2593 | var curve = curvePartialByID(test, frags[0], frags[1], frags[2]); |
| 2594 | curve_extremes(curve, angleBounds); |
| 2595 | } |
| 2596 | break; |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 2597 | case REC_TYPE_SORT: |
| 2598 | if (!draw_sort) { |
| 2599 | break; |
| 2600 | } |
| 2601 | if (fragType == SORT_UNARY || fragType == SORT_BINARY) { |
| 2602 | var curve = curvePartialByID(test, frags[0], frags[6], frags[8]); |
| 2603 | curve_extremes(curve, angleBounds); |
| 2604 | } |
| 2605 | break; |
caryclark | 03b03ca | 2015-04-23 09:13:37 -0700 | [diff] [blame] | 2606 | case REC_TYPE_TOP: |
| 2607 | if (!draw_top) { |
| 2608 | break; |
| 2609 | } |
| 2610 | { |
| 2611 | var curve = curvePartialByID(test, frags[0], frags[1], frags[2]); |
| 2612 | curve_extremes(curve, angleBounds); |
| 2613 | } |
| 2614 | break; |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 2615 | } |
| 2616 | } |
| 2617 | } |
| 2618 | xmin = Math.min(xmin, angleBounds[0]); |
| 2619 | ymin = Math.min(ymin, angleBounds[1]); |
| 2620 | xmax = Math.max(xmax, angleBounds[2]); |
| 2621 | ymax = Math.max(ymax, angleBounds[3]); |
| 2622 | setScale(xmin, xmax, ymin, ymax); |
| 2623 | if (hasPath == false && hasComputedPath == true && !draw_computed) { |
caryclark | 1049f12 | 2015-04-20 08:31:59 -0700 | [diff] [blame] | 2624 | draw_computed = 7; // show quadratics, conics, and cubics |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 2625 | } |
| 2626 | if (hasPath == true && hasComputedPath == false && draw_computed) { |
| 2627 | draw_computed = 0; |
| 2628 | } |
| 2629 | } |
| 2630 | |
caryclark | 26ad22a | 2015-10-16 09:03:38 -0700 | [diff] [blame] | 2631 | function curveByIDMatch(test, id, recMatch) { |
caryclark | 5435929 | 2015-03-26 07:52:43 -0700 | [diff] [blame] | 2632 | var tIndex = -3; |
| 2633 | while ((tIndex += 3) < test.length) { |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 2634 | var recType = test[tIndex]; |
caryclark | 5435929 | 2015-03-26 07:52:43 -0700 | [diff] [blame] | 2635 | if (recType == REC_TYPE_OP) { |
| 2636 | continue; |
| 2637 | } |
caryclark | 26ad22a | 2015-10-16 09:03:38 -0700 | [diff] [blame] | 2638 | if (recType != recMatch) { |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 2639 | return []; |
| 2640 | } |
| 2641 | var records = test[tIndex + 2]; |
| 2642 | for (var recordIndex = 0; recordIndex < records.length; recordIndex += 2) { |
| 2643 | var fragType = records[recordIndex]; |
| 2644 | var frags = records[recordIndex + 1]; |
| 2645 | if (frags[0] == id) { |
| 2646 | switch (fragType) { |
caryclark | 5435929 | 2015-03-26 07:52:43 -0700 | [diff] [blame] | 2647 | case PATH_LINE: |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 2648 | return [frags[1], frags[2], frags[3], frags[4]]; |
caryclark | 5435929 | 2015-03-26 07:52:43 -0700 | [diff] [blame] | 2649 | case PATH_QUAD: |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 2650 | return [frags[1], frags[2], frags[3], frags[4], |
| 2651 | frags[5], frags[6]]; |
caryclark | 1049f12 | 2015-04-20 08:31:59 -0700 | [diff] [blame] | 2652 | case PATH_CONIC: |
| 2653 | return [frags[1], frags[2], frags[3], frags[4], |
| 2654 | frags[5], frags[6], frags[7]]; |
caryclark | 5435929 | 2015-03-26 07:52:43 -0700 | [diff] [blame] | 2655 | case PATH_CUBIC: |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 2656 | return [frags[1], frags[2], frags[3], frags[4], |
| 2657 | frags[5], frags[6], frags[7], frags[8]]; |
| 2658 | } |
| 2659 | } |
| 2660 | } |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 2661 | } |
| 2662 | return []; |
| 2663 | } |
| 2664 | |
caryclark | 26ad22a | 2015-10-16 09:03:38 -0700 | [diff] [blame] | 2665 | function curveByID(test, id) { |
| 2666 | var result = draw_path >= 4 ? curveByIDMatch(test, id, REC_TYPE_ALIGNED) : []; |
| 2667 | if (!result.length) { |
| 2668 | result = curveByIDMatch(test, id, REC_TYPE_PATH); |
| 2669 | } |
| 2670 | return result; |
| 2671 | } |
| 2672 | |
| 2673 | function curvePartialByIDMatch(test, id, t0, t1, recMatch) { |
caryclark | 5435929 | 2015-03-26 07:52:43 -0700 | [diff] [blame] | 2674 | var tIndex = -3; |
| 2675 | while ((tIndex += 3) < test.length) { |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 2676 | var recType = test[tIndex]; |
caryclark | 5435929 | 2015-03-26 07:52:43 -0700 | [diff] [blame] | 2677 | if (recType == REC_TYPE_OP) { |
| 2678 | continue; |
| 2679 | } |
caryclark | 26ad22a | 2015-10-16 09:03:38 -0700 | [diff] [blame] | 2680 | if (recType != recMatch) { |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 2681 | return []; |
| 2682 | } |
| 2683 | var records = test[tIndex + 2]; |
| 2684 | for (var recordIndex = 0; recordIndex < records.length; recordIndex += 2) { |
| 2685 | var fragType = records[recordIndex]; |
| 2686 | var frags = records[recordIndex + 1]; |
| 2687 | if (frags[0] == id) { |
| 2688 | switch (fragType) { |
caryclark | 5435929 | 2015-03-26 07:52:43 -0700 | [diff] [blame] | 2689 | case PATH_LINE: |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 2690 | return linePartial(frags[1], frags[2], frags[3], frags[4], t0, t1); |
caryclark | 5435929 | 2015-03-26 07:52:43 -0700 | [diff] [blame] | 2691 | case PATH_QUAD: |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 2692 | return quadPartial(frags[1], frags[2], frags[3], frags[4], |
| 2693 | frags[5], frags[6], t0, t1); |
caryclark | 1049f12 | 2015-04-20 08:31:59 -0700 | [diff] [blame] | 2694 | case PATH_CONIC: |
| 2695 | return conicPartial(frags[1], frags[2], frags[3], frags[4], |
| 2696 | frags[5], frags[6], frags[7], t0, t1); |
caryclark | 5435929 | 2015-03-26 07:52:43 -0700 | [diff] [blame] | 2697 | case PATH_CUBIC: |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 2698 | return cubicPartial(frags[1], frags[2], frags[3], frags[4], |
| 2699 | frags[5], frags[6], frags[7], frags[8], t0, t1); |
| 2700 | } |
| 2701 | } |
| 2702 | } |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 2703 | } |
| 2704 | return []; |
| 2705 | } |
| 2706 | |
caryclark | 26ad22a | 2015-10-16 09:03:38 -0700 | [diff] [blame] | 2707 | function curvePartialByID(test, id, t0, t1) { |
| 2708 | var result = draw_path >= 4 ? curvePartialByIDMatch(test, id, t0, t1, REC_TYPE_ALIGNED) : []; |
| 2709 | if (!result.length) { |
| 2710 | result = curvePartialByIDMatch(test, id, t0, t1, REC_TYPE_PATH); |
| 2711 | } |
| 2712 | return result; |
| 2713 | } |
| 2714 | |
| 2715 | function idByCurveIDMatch(test, frag, type, recMatch) { |
caryclark | 5435929 | 2015-03-26 07:52:43 -0700 | [diff] [blame] | 2716 | var tIndex = 0; |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 2717 | while (tIndex < test.length) { |
| 2718 | var recType = test[tIndex]; |
caryclark | 26ad22a | 2015-10-16 09:03:38 -0700 | [diff] [blame] | 2719 | if (recType != recMatch) { |
caryclark | 5435929 | 2015-03-26 07:52:43 -0700 | [diff] [blame] | 2720 | ++tIndex; |
| 2721 | continue; |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 2722 | } |
| 2723 | var records = test[tIndex + 2]; |
| 2724 | for (var recordIndex = 0; recordIndex < records.length; recordIndex += 2) { |
| 2725 | var fragType = records[recordIndex]; |
| 2726 | var frags = records[recordIndex + 1]; |
caryclark | 5435929 | 2015-03-26 07:52:43 -0700 | [diff] [blame] | 2727 | if (frag.length != frags.length - 1) { |
| 2728 | continue; |
| 2729 | } |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 2730 | switch (fragType) { |
caryclark | 5435929 | 2015-03-26 07:52:43 -0700 | [diff] [blame] | 2731 | case PATH_LINE: |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 2732 | if (frag[0] != frags[1] || frag[1] != frags[2] |
| 2733 | || frag[2] != frags[3] || frag[3] != frags[4]) { |
| 2734 | continue; |
| 2735 | } |
| 2736 | return frags[0]; |
caryclark | 5435929 | 2015-03-26 07:52:43 -0700 | [diff] [blame] | 2737 | case PATH_QUAD: |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 2738 | if (frag[0] != frags[1] || frag[1] != frags[2] |
| 2739 | || frag[2] != frags[3] || frag[3] != frags[4] |
| 2740 | || frag[4] != frags[5] || frag[5] != frags[6]) { |
| 2741 | continue; |
| 2742 | } |
| 2743 | return frags[0]; |
caryclark | 1049f12 | 2015-04-20 08:31:59 -0700 | [diff] [blame] | 2744 | case PATH_CONIC: |
| 2745 | if (frag[0] != frags[1] || frag[1] != frags[2] |
| 2746 | || frag[2] != frags[3] || frag[3] != frags[4] |
| 2747 | || frag[4] != frags[5] || frag[5] != frags[6] |
| 2748 | || frag[6] != frags[7]) { |
| 2749 | continue; |
| 2750 | } |
| 2751 | return frags[0]; |
caryclark | 5435929 | 2015-03-26 07:52:43 -0700 | [diff] [blame] | 2752 | case PATH_CUBIC: |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 2753 | if (frag[0] != frags[1] || frag[1] != frags[2] |
| 2754 | || frag[2] != frags[3] || frag[3] != frags[4] |
| 2755 | || frag[4] != frags[5] || frag[5] != frags[6] |
| 2756 | || frag[6] != frags[7] || frag[7] != frags[8]) { |
| 2757 | continue; |
| 2758 | } |
| 2759 | return frags[0]; |
| 2760 | } |
| 2761 | } |
| 2762 | ++tIndex; |
| 2763 | } |
| 2764 | return -1; |
| 2765 | } |
| 2766 | |
caryclark | 26ad22a | 2015-10-16 09:03:38 -0700 | [diff] [blame] | 2767 | function idByCurve(test, frag, type) { |
| 2768 | var result = draw_path >= 4 ? idByCurveIDMatch(test, frag, type, REC_TYPE_ALIGNED) : []; |
| 2769 | if (!result.length) { |
| 2770 | result = idByCurveIDMatch(test, frag, type, REC_TYPE_PATH); |
| 2771 | } |
| 2772 | return result; |
| 2773 | } |
| 2774 | |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 2775 | function curve_extremes(curve, bounds) { |
caryclark | 1049f12 | 2015-04-20 08:31:59 -0700 | [diff] [blame] | 2776 | var length = curve.length == 7 ? 6 : curve.length; |
caryclark | ed0935a | 2015-10-22 07:23:52 -0700 | [diff] [blame] | 2777 | for (var index = 0; index < length; index += 2) { |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 2778 | var x = curve[index]; |
| 2779 | var y = curve[index + 1]; |
| 2780 | bounds[0] = Math.min(bounds[0], x); |
| 2781 | bounds[1] = Math.min(bounds[1], y); |
| 2782 | bounds[2] = Math.max(bounds[2], x); |
| 2783 | bounds[3] = Math.max(bounds[3], y); |
| 2784 | } |
| 2785 | } |
| 2786 | |
| 2787 | function setScale(x0, x1, y0, y1) { |
| 2788 | var srcWidth = x1 - x0; |
| 2789 | var srcHeight = y1 - y0; |
| 2790 | var usableWidth = screenWidth; |
| 2791 | var xDigits = Math.ceil(Math.log(Math.abs(xmax)) / Math.log(10)); |
| 2792 | var yDigits = Math.ceil(Math.log(Math.abs(ymax)) / Math.log(10)); |
| 2793 | usableWidth -= (xDigits + yDigits) * 10; |
| 2794 | usableWidth -= decimal_places * 10; |
| 2795 | if (draw_legend) { |
| 2796 | usableWidth -= 40; |
| 2797 | } |
| 2798 | var hscale = usableWidth / srcWidth; |
| 2799 | var vscale = screenHeight / srcHeight; |
| 2800 | scale = Math.min(hscale, vscale); |
| 2801 | var invScale = 1 / scale; |
| 2802 | var sxmin = x0 - invScale * 5; |
| 2803 | var symin = y0 - invScale * 10; |
| 2804 | var sxmax = x1 + invScale * (6 * decimal_places + 10); |
| 2805 | var symax = y1 + invScale * 10; |
| 2806 | srcWidth = sxmax - sxmin; |
| 2807 | srcHeight = symax - symin; |
| 2808 | hscale = usableWidth / srcWidth; |
| 2809 | vscale = screenHeight / srcHeight; |
| 2810 | scale = Math.min(hscale, vscale); |
| 2811 | srcLeft = sxmin; |
| 2812 | srcTop = symin; |
| 2813 | } |
| 2814 | |
| 2815 | function drawArc(curve, op, from, to) { |
| 2816 | var type = PATH_LINE + (curve.length / 2 - 2); |
| 2817 | var pt = pointAtT(curve, type, op ? 0.4 : 0.6); |
| 2818 | var dy = pt.y - curve[1]; |
| 2819 | var dx = pt.x - curve[0]; |
| 2820 | var dist = Math.sqrt(dy * dy + dx * dx); |
| 2821 | var _dist = dist * scale; |
| 2822 | var angle = Math.atan2(dy, dx); |
| 2823 | var _px = (curve[0] - srcLeft) * scale; |
| 2824 | var _py = (curve[1] - srcTop) * scale; |
| 2825 | var divisor = 4; |
| 2826 | var endDist; |
| 2827 | do { |
| 2828 | var ends = []; |
| 2829 | for (var index = -1; index <= 1; index += 2) { |
| 2830 | var px = Math.cos(index * Math.PI / divisor); |
| 2831 | var py = Math.sin(index * Math.PI / divisor); |
| 2832 | ends.push(px); |
| 2833 | ends.push(py); |
| 2834 | } |
| 2835 | var endDx = (ends[2] - ends[0]) * scale * dist; |
| 2836 | var endDy = (ends[3] - ends[1]) * scale * dist; |
| 2837 | endDist = Math.sqrt(endDx * endDx + endDy * endDy); |
| 2838 | if (endDist < 100) { |
| 2839 | break; |
| 2840 | } |
| 2841 | divisor *= 2; |
| 2842 | } while (true); |
| 2843 | if (endDist < 30) { |
| 2844 | return; |
| 2845 | } |
| 2846 | if (op) { |
| 2847 | divisor *= 2; |
| 2848 | } |
| 2849 | ctx.strokeStyle = op ? "rgba(210,0,45, 0.4)" : "rgba(90,90,90, 0.5)"; |
| 2850 | ctx.beginPath(); |
| 2851 | ctx.arc(_px, _py, _dist, angle - Math.PI / divisor, angle + Math.PI / divisor, false); |
| 2852 | ctx.stroke(); |
| 2853 | var saveAlign = ctx.textAlign; |
| 2854 | var saveStyle = ctx.fillStyle; |
| 2855 | var saveFont = ctx.font; |
| 2856 | ctx.textAlign = "center"; |
| 2857 | ctx.fillStyle = "black"; |
| 2858 | ctx.font = "normal 24px Arial"; |
| 2859 | divisor *= 0.8; |
| 2860 | for (var index = -1; index <= 1; index += 2) { |
| 2861 | var px = curve[0] + Math.cos(angle + index * Math.PI / divisor) * dist; |
| 2862 | var py = curve[1] + Math.sin(angle + index * Math.PI / divisor) * dist; |
| 2863 | var _px = (px - srcLeft) * scale; |
| 2864 | var _py = (py - srcTop) * scale; |
| 2865 | ctx.fillText(index < 0 ? to.toString() : from.toString(), _px, _py + 8); |
| 2866 | } |
| 2867 | ctx.textAlign = saveAlign; |
| 2868 | ctx.fillStyle = saveStyle; |
| 2869 | ctx.font = saveFont; |
| 2870 | } |
| 2871 | |
| 2872 | function drawPoint(px, py, end) { |
caryclark | 1049f12 | 2015-04-20 08:31:59 -0700 | [diff] [blame] | 2873 | var length = drawnPts.length == 7 ? 6 : drawnPts.length; |
| 2874 | for (var pts = 0; pts < length; pts += 2) { |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 2875 | var x = drawnPts[pts]; |
| 2876 | var y = drawnPts[pts + 1]; |
| 2877 | if (px == x && py == y) { |
| 2878 | return; |
| 2879 | } |
| 2880 | } |
| 2881 | drawnPts.push(px); |
| 2882 | drawnPts.push(py); |
| 2883 | var label = px.toFixed(decimal_places) + ", " + py.toFixed(decimal_places); |
| 2884 | var _px = (px - srcLeft) * scale; |
| 2885 | var _py = (py - srcTop) * scale; |
| 2886 | ctx.beginPath(); |
| 2887 | ctx.arc(_px, _py, 3, 0, Math.PI*2, true); |
| 2888 | ctx.closePath(); |
| 2889 | if (end) { |
| 2890 | ctx.fill(); |
| 2891 | } else { |
| 2892 | ctx.stroke(); |
| 2893 | } |
| 2894 | if (debug_xy) { |
| 2895 | ctx.textAlign = "left"; |
| 2896 | ctx.fillText(label, _px + 5, _py); |
| 2897 | } |
| 2898 | } |
| 2899 | |
caryclark | 1049f12 | 2015-04-20 08:31:59 -0700 | [diff] [blame] | 2900 | function coordCount(curveType) { |
| 2901 | switch (curveType) { |
| 2902 | case PATH_LINE: |
| 2903 | return 4; |
| 2904 | case PATH_QUAD: |
| 2905 | return 6; |
| 2906 | case PATH_CONIC: |
| 2907 | return 6; |
| 2908 | case PATH_CUBIC: |
| 2909 | return 8; |
| 2910 | } |
| 2911 | return -1; |
| 2912 | } |
| 2913 | |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 2914 | function drawPoints(ptArray, curveType, drawControls) { |
caryclark | 1049f12 | 2015-04-20 08:31:59 -0700 | [diff] [blame] | 2915 | var count = coordCount(curveType); |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 2916 | for (var idx = 0; idx < count; idx += 2) { |
| 2917 | if (!drawControls && idx != 0 && idx != count - 2) { |
| 2918 | continue; |
| 2919 | } |
| 2920 | drawPoint(ptArray[idx], ptArray[idx + 1], idx == 0 || idx == count - 2); |
| 2921 | } |
| 2922 | } |
| 2923 | |
| 2924 | function drawControlLines(curve, curveType, drawEnd) { |
| 2925 | if (curveType == PATH_LINE) { |
| 2926 | return; |
| 2927 | } |
| 2928 | ctx.strokeStyle = "rgba(0,0,0, 0.3)"; |
| 2929 | drawLine(curve[0], curve[1], curve[2], curve[3]); |
| 2930 | drawLine(curve[2], curve[3], curve[4], curve[5]); |
| 2931 | if (curveType == PATH_CUBIC) { |
| 2932 | drawLine(curve[4], curve[5], curve[6], curve[7]); |
| 2933 | if (drawEnd > 1) { |
| 2934 | drawLine(curve[6], curve[7], curve[0], curve[1]); |
| 2935 | if (drawEnd > 2) { |
| 2936 | drawLine(curve[0], curve[1], curve[4], curve[5]); |
| 2937 | drawLine(curve[6], curve[7], curve[2], curve[3]); |
| 2938 | } |
| 2939 | } |
| 2940 | } else if (drawEnd > 1) { |
| 2941 | drawLine(curve[4], curve[5], curve[0], curve[1]); |
| 2942 | } |
| 2943 | } |
| 2944 | |
| 2945 | function pointAtT(curve, curveType, t) { |
| 2946 | var xy = {}; |
| 2947 | switch (curveType) { |
| 2948 | case PATH_LINE: |
| 2949 | var a = 1 - t; |
| 2950 | var b = t; |
| 2951 | xy.x = a * curve[0] + b * curve[2]; |
| 2952 | xy.y = a * curve[1] + b * curve[3]; |
| 2953 | break; |
| 2954 | case PATH_QUAD: |
| 2955 | var one_t = 1 - t; |
| 2956 | var a = one_t * one_t; |
| 2957 | var b = 2 * one_t * t; |
| 2958 | var c = t * t; |
| 2959 | xy.x = a * curve[0] + b * curve[2] + c * curve[4]; |
| 2960 | xy.y = a * curve[1] + b * curve[3] + c * curve[5]; |
| 2961 | break; |
caryclark | 1049f12 | 2015-04-20 08:31:59 -0700 | [diff] [blame] | 2962 | case PATH_CONIC: |
| 2963 | var one_t = 1 - t; |
| 2964 | var a = one_t * one_t; |
| 2965 | var b = 2 * one_t * t; |
| 2966 | var c = t * t; |
| 2967 | xy.x = a * curve[0] + b * curve[2] * curve[6] + c * curve[4]; |
| 2968 | xy.y = a * curve[1] + b * curve[3] * curve[6] + c * curve[5]; |
| 2969 | var d = a + b * curve[6] + c; |
| 2970 | xy.x /= d; |
| 2971 | xy.y /= d; |
| 2972 | break; |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 2973 | case PATH_CUBIC: |
| 2974 | var one_t = 1 - t; |
| 2975 | var one_t2 = one_t * one_t; |
| 2976 | var a = one_t2 * one_t; |
| 2977 | var b = 3 * one_t2 * t; |
| 2978 | var t2 = t * t; |
| 2979 | var c = 3 * one_t * t2; |
| 2980 | var d = t2 * t; |
| 2981 | xy.x = a * curve[0] + b * curve[2] + c * curve[4] + d * curve[6]; |
| 2982 | xy.y = a * curve[1] + b * curve[3] + c * curve[5] + d * curve[7]; |
| 2983 | break; |
| 2984 | } |
| 2985 | return xy; |
| 2986 | } |
caryclark | 55888e4 | 2016-07-18 10:01:36 -0700 | [diff] [blame] | 2987 | |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 2988 | function drawPointAtT(curve, curveType) { |
| 2989 | var x, y; |
| 2990 | var xy = pointAtT(curve, curveType, curveT); |
| 2991 | drawPoint(xy.x, xy.y, true); |
| 2992 | if (!draw_intersectT) { |
| 2993 | return; |
| 2994 | } |
| 2995 | ctx.fillStyle = "red"; |
| 2996 | drawTAtPointUp(xy.x, xy.y, curveT); |
| 2997 | } |
| 2998 | |
| 2999 | function drawTAtPointUp(px, py, t) { |
| 3000 | var label = t.toFixed(decimal_places); |
| 3001 | var _px = (px - srcLeft)* scale; |
| 3002 | var _py = (py - srcTop) * scale; |
| 3003 | ctx.fillText(label, _px + 5, _py - 10); |
| 3004 | } |
| 3005 | |
| 3006 | function drawTAtPointDown(px, py, t) { |
| 3007 | var label = t.toFixed(decimal_places); |
| 3008 | var _px = (px - srcLeft)* scale; |
| 3009 | var _py = (py - srcTop) * scale; |
| 3010 | ctx.fillText(label, _px + 5, _py + 10); |
| 3011 | } |
| 3012 | |
| 3013 | function alreadyDrawnLine(x1, y1, x2, y2) { |
| 3014 | if (collect_bounds) { |
| 3015 | if (focus_enabled) { |
| 3016 | focusXmin = Math.min(focusXmin, x1, x2); |
| 3017 | focusYmin = Math.min(focusYmin, y1, y2); |
| 3018 | focusXmax = Math.max(focusXmax, x1, x2); |
| 3019 | focusYmax = Math.max(focusYmax, y1, y2); |
| 3020 | } |
| 3021 | return true; |
| 3022 | } |
| 3023 | for (var pts = 0; pts < drawnLines.length; pts += 4) { |
| 3024 | if (x1 == drawnLines[pts] && y1 == drawnLines[pts + 1] |
| 3025 | && x2 == drawnLines[pts + 2] && y2 == drawnLines[pts + 3]) { |
| 3026 | return true; |
| 3027 | } |
| 3028 | } |
| 3029 | drawnLines.push(x1); |
| 3030 | drawnLines.push(y1); |
| 3031 | drawnLines.push(x2); |
| 3032 | drawnLines.push(y2); |
| 3033 | return false; |
| 3034 | } |
| 3035 | |
| 3036 | function drawLine(x1, y1, x2, y2) { |
| 3037 | if (alreadyDrawnLine(x1, y1, x2, y2)) { |
| 3038 | return; |
| 3039 | } |
| 3040 | ctx.beginPath(); |
| 3041 | ctx.moveTo((x1 - srcLeft) * scale, |
| 3042 | (y1 - srcTop) * scale); |
| 3043 | ctx.lineTo((x2 - srcLeft) * scale, |
| 3044 | (y2 - srcTop) * scale); |
| 3045 | ctx.stroke(); |
| 3046 | } |
| 3047 | |
| 3048 | function linePartial(x1, y1, x2, y2, t1, t2) { |
| 3049 | var dx = x1 - x2; |
| 3050 | var dy = y1 - y2; |
| 3051 | var array = [ |
| 3052 | x1 - t1 * dx, |
| 3053 | y1 - t1 * dy, |
| 3054 | x1 - t2 * dx, |
| 3055 | y1 - t2 * dy |
| 3056 | ]; |
| 3057 | return array; |
| 3058 | } |
| 3059 | |
| 3060 | function drawLinePartial(x1, y1, x2, y2, t1, t2) { |
| 3061 | var a = linePartial(x1, y1, x2, y2, t1, t2); |
| 3062 | var ax = a[0]; |
| 3063 | var ay = a[1]; |
| 3064 | var bx = a[2]; |
| 3065 | var by = a[3]; |
| 3066 | if (alreadyDrawnLine(ax, ay, bx, by)) { |
| 3067 | return; |
| 3068 | } |
| 3069 | ctx.beginPath(); |
| 3070 | ctx.moveTo((ax - srcLeft) * scale, |
| 3071 | (ay - srcTop) * scale); |
| 3072 | ctx.lineTo((bx - srcLeft) * scale, |
| 3073 | (by - srcTop) * scale); |
| 3074 | ctx.stroke(); |
| 3075 | } |
| 3076 | |
| 3077 | function alreadyDrawnQuad(x1, y1, x2, y2, x3, y3) { |
| 3078 | if (collect_bounds) { |
| 3079 | if (focus_enabled) { |
| 3080 | focusXmin = Math.min(focusXmin, x1, x2, x3); |
| 3081 | focusYmin = Math.min(focusYmin, y1, y2, y3); |
| 3082 | focusXmax = Math.max(focusXmax, x1, x2, x3); |
| 3083 | focusYmax = Math.max(focusYmax, y1, y2, y3); |
| 3084 | } |
| 3085 | return true; |
| 3086 | } |
| 3087 | for (var pts = 0; pts < drawnQuads.length; pts += 6) { |
| 3088 | if (x1 == drawnQuads[pts] && y1 == drawnQuads[pts + 1] |
| 3089 | && x2 == drawnQuads[pts + 2] && y2 == drawnQuads[pts + 3] |
| 3090 | && x3 == drawnQuads[pts + 4] && y3 == drawnQuads[pts + 5]) { |
| 3091 | return true; |
| 3092 | } |
| 3093 | } |
| 3094 | drawnQuads.push(x1); |
| 3095 | drawnQuads.push(y1); |
| 3096 | drawnQuads.push(x2); |
| 3097 | drawnQuads.push(y2); |
| 3098 | drawnQuads.push(x3); |
| 3099 | drawnQuads.push(y3); |
| 3100 | return false; |
| 3101 | } |
| 3102 | |
| 3103 | function drawQuad(x1, y1, x2, y2, x3, y3) { |
| 3104 | if (alreadyDrawnQuad(x1, y1, x2, y2, x3, y3)) { |
| 3105 | return; |
| 3106 | } |
| 3107 | ctx.beginPath(); |
| 3108 | ctx.moveTo((x1 - srcLeft) * scale, |
| 3109 | (y1 - srcTop) * scale); |
| 3110 | ctx.quadraticCurveTo((x2 - srcLeft) * scale, |
| 3111 | (y2 - srcTop) * scale, |
| 3112 | (x3 - srcLeft) * scale, |
| 3113 | (y3 - srcTop) * scale); |
| 3114 | ctx.stroke(); |
| 3115 | } |
| 3116 | |
| 3117 | function interp(A, B, t) { |
| 3118 | return A + (B - A) * t; |
| 3119 | } |
| 3120 | |
| 3121 | function interp_quad_coords(x1, x2, x3, t) |
| 3122 | { |
| 3123 | var ab = interp(x1, x2, t); |
| 3124 | var bc = interp(x2, x3, t); |
| 3125 | var abc = interp(ab, bc, t); |
| 3126 | return abc; |
| 3127 | } |
| 3128 | |
| 3129 | function quadPartial(x1, y1, x2, y2, x3, y3, t1, t2) { |
| 3130 | var ax = interp_quad_coords(x1, x2, x3, t1); |
| 3131 | var ay = interp_quad_coords(y1, y2, y3, t1); |
| 3132 | var dx = interp_quad_coords(x1, x2, x3, (t1 + t2) / 2); |
| 3133 | var dy = interp_quad_coords(y1, y2, y3, (t1 + t2) / 2); |
| 3134 | var cx = interp_quad_coords(x1, x2, x3, t2); |
| 3135 | var cy = interp_quad_coords(y1, y2, y3, t2); |
| 3136 | var bx = 2*dx - (ax + cx)/2; |
| 3137 | var by = 2*dy - (ay + cy)/2; |
| 3138 | var array = [ |
| 3139 | ax, ay, bx, by, cx, cy |
| 3140 | ]; |
| 3141 | return array; |
| 3142 | } |
| 3143 | |
| 3144 | function drawQuadPartial(x1, y1, x2, y2, x3, y3, t1, t2) { |
| 3145 | var a = quadPartial(x1, y1, x2, y2, x3, y3, t1, t2); |
| 3146 | var ax = a[0]; |
| 3147 | var ay = a[1]; |
| 3148 | var bx = a[2]; |
| 3149 | var by = a[3]; |
| 3150 | var cx = a[4]; |
| 3151 | var cy = a[5]; |
| 3152 | if (alreadyDrawnQuad(ax, ay, bx, by, cx, cy)) { |
| 3153 | return; |
| 3154 | } |
| 3155 | ctx.beginPath(); |
| 3156 | ctx.moveTo((ax - srcLeft) * scale, |
| 3157 | (ay - srcTop) * scale); |
| 3158 | ctx.quadraticCurveTo((bx - srcLeft) * scale, |
| 3159 | (by - srcTop) * scale, |
| 3160 | (cx - srcLeft) * scale, |
| 3161 | (cy - srcTop) * scale); |
| 3162 | ctx.stroke(); |
| 3163 | } |
| 3164 | |
caryclark | 1049f12 | 2015-04-20 08:31:59 -0700 | [diff] [blame] | 3165 | function alreadyDrawnConic(x1, y1, x2, y2, x3, y3, w) { |
| 3166 | if (collect_bounds) { |
| 3167 | if (focus_enabled) { |
| 3168 | focusXmin = Math.min(focusXmin, x1, x2, x3); |
| 3169 | focusYmin = Math.min(focusYmin, y1, y2, y3); |
| 3170 | focusXmax = Math.max(focusXmax, x1, x2, x3); |
| 3171 | focusYmax = Math.max(focusYmax, y1, y2, y3); |
| 3172 | } |
| 3173 | return true; |
| 3174 | } |
| 3175 | for (var pts = 0; pts < drawnConics.length; pts += 8) { |
| 3176 | if (x1 == drawnConics[pts] && y1 == drawnCubics[pts + 1] |
caryclark | 55888e4 | 2016-07-18 10:01:36 -0700 | [diff] [blame] | 3177 | && x2 == drawnCubics[pts + 2] && y2 == drawnCubics[pts + 3] |
| 3178 | && x3 == drawnCubics[pts + 4] && y3 == drawnCubics[pts + 5] |
caryclark | 1049f12 | 2015-04-20 08:31:59 -0700 | [diff] [blame] | 3179 | && w == drawnCubics[pts + 6]) { |
| 3180 | return true; |
| 3181 | } |
| 3182 | } |
| 3183 | drawnConics.push(x1); |
| 3184 | drawnConics.push(y1); |
| 3185 | drawnConics.push(x2); |
| 3186 | drawnConics.push(y2); |
| 3187 | drawnConics.push(x3); |
| 3188 | drawnConics.push(y3); |
| 3189 | drawnCubics.push(w); |
| 3190 | return false; |
| 3191 | } |
| 3192 | |
| 3193 | var kMaxConicToQuadPOW2 = 5; |
| 3194 | |
| 3195 | function computeQuadPOW2(curve, tol) { |
| 3196 | var a = curve[6] - 1; |
| 3197 | var k = a / (4 * (2 + a)); |
| 3198 | var x = k * (curve[0] - 2 * curve[2] + curve[4]); |
| 3199 | var y = k * (curve[1] - 2 * curve[3] + curve[5]); |
| 3200 | |
| 3201 | var error = Math.sqrt(x * x + y * y); |
| 3202 | var pow2; |
| 3203 | for (pow2 = 0; pow2 < kMaxConicToQuadPOW2; ++pow2) { |
| 3204 | if (error <= tol) { |
| 3205 | break; |
| 3206 | } |
| 3207 | error *= 0.25; |
| 3208 | } |
| 3209 | return pow2; |
| 3210 | } |
| 3211 | |
| 3212 | function subdivide_w_value(w) { |
| 3213 | return Math.sqrt(0.5 + w * 0.5); |
| 3214 | } |
| 3215 | |
| 3216 | function chop(curve, part1, part2) { |
| 3217 | var w = curve[6]; |
| 3218 | var scale = 1 / (1 + w); |
| 3219 | part1[0] = curve[0]; |
| 3220 | part1[1] = curve[1]; |
| 3221 | part1[2] = (curve[0] + curve[2] * w) * scale; |
| 3222 | part1[3] = (curve[1] + curve[3] * w) * scale; |
| 3223 | part1[4] = part2[0] = (curve[0] + (curve[2] * w) * 2 + curve[4]) * scale * 0.5; |
| 3224 | part1[5] = part2[1] = (curve[1] + (curve[3] * w) * 2 + curve[5]) * scale * 0.5; |
| 3225 | part2[2] = (curve[2] * w + curve[4]) * scale; |
| 3226 | part2[3] = (curve[3] * w + curve[5]) * scale; |
| 3227 | part2[4] = curve[4]; |
| 3228 | part2[5] = curve[5]; |
| 3229 | part1[6] = part2[6] = subdivide_w_value(w); |
| 3230 | } |
| 3231 | |
| 3232 | function subdivide(curve, level, pts) { |
| 3233 | if (0 == level) { |
| 3234 | pts.push(curve[2]); |
| 3235 | pts.push(curve[3]); |
| 3236 | pts.push(curve[4]); |
| 3237 | pts.push(curve[5]); |
| 3238 | } else { |
| 3239 | var part1 = [], part2 = []; |
| 3240 | chop(curve, part1, part2); |
| 3241 | --level; |
| 3242 | subdivide(part1, level, pts); |
| 3243 | subdivide(part2, level, pts); |
| 3244 | } |
| 3245 | } |
| 3246 | |
| 3247 | function chopIntoQuadsPOW2(curve, pow2, pts) { |
| 3248 | subdivide(curve, pow2, pts); |
| 3249 | return 1 << pow2; |
| 3250 | } |
| 3251 | |
| 3252 | function drawConicWithQuads(x1, y1, x2, y2, x3, y3, w) { |
| 3253 | if (alreadyDrawnConic(x1, y1, x2, y2, x3, y3, w)) { |
| 3254 | return; |
| 3255 | } |
| 3256 | ctx.beginPath(); |
| 3257 | ctx.moveTo((x1 - srcLeft) * scale, |
| 3258 | (y1 - srcTop) * scale); |
| 3259 | var tol = 1 / scale; |
| 3260 | var curve = [x1, y1, x2, y2, x3, y3, w]; |
| 3261 | var pow2 = computeQuadPOW2(curve, tol); |
| 3262 | var pts = []; |
| 3263 | chopIntoQuadsPOW2(curve, pow2, pts); |
| 3264 | for (var i = 0; i < pts.length; i += 4) { |
| 3265 | ctx.quadraticCurveTo( |
| 3266 | (pts[i + 0] - srcLeft) * scale, (pts[i + 1] - srcTop) * scale, |
| 3267 | (pts[i + 2] - srcLeft) * scale, (pts[i + 3] - srcTop) * scale); |
| 3268 | } |
| 3269 | ctx.stroke(); |
| 3270 | } |
| 3271 | |
| 3272 | function conic_eval_numerator(x1, x2, x3, w, t) { |
| 3273 | var src2w = x2 * w; |
| 3274 | var C = x1; |
| 3275 | var A = x3 - 2 * src2w + C; |
| 3276 | var B = 2 * (src2w - C); |
| 3277 | return (A * t + B) * t + C; |
| 3278 | } |
| 3279 | |
| 3280 | |
| 3281 | function conic_eval_denominator(w, t) { |
| 3282 | var B = 2 * (w - 1); |
| 3283 | var C = 1; |
| 3284 | var A = -B; |
| 3285 | return (A * t + B) * t + C; |
| 3286 | } |
| 3287 | |
| 3288 | function conicPartial(x1, y1, x2, y2, x3, y3, w, t1, t2) { |
| 3289 | var ax = conic_eval_numerator(x1, x2, x3, w, t1); |
| 3290 | var ay = conic_eval_numerator(y1, y2, y3, w, t1); |
| 3291 | var az = conic_eval_denominator(w, t1); |
| 3292 | var midT = (t1 + t2) / 2; |
| 3293 | var dx = conic_eval_numerator(x1, x2, x3, w, midT); |
| 3294 | var dy = conic_eval_numerator(y1, y2, y3, w, midT); |
| 3295 | var dz = conic_eval_denominator(w, midT); |
| 3296 | var cx = conic_eval_numerator(x1, x2, x3, w, t2); |
| 3297 | var cy = conic_eval_numerator(y1, y2, y3, w, t2); |
| 3298 | var cz = conic_eval_denominator(w, t2); |
| 3299 | var bx = 2 * dx - (ax + cx) / 2; |
| 3300 | var by = 2 * dy - (ay + cy) / 2; |
| 3301 | var bz = 2 * dz - (az + cz) / 2; |
| 3302 | var dt = t2 - t1; |
| 3303 | var dt_1 = 1 - dt; |
caryclark | 1049f12 | 2015-04-20 08:31:59 -0700 | [diff] [blame] | 3304 | var array = [ |
caryclark | ed0935a | 2015-10-22 07:23:52 -0700 | [diff] [blame] | 3305 | ax / az, ay / az, bx / bz, by / bz, cx / cz, cy / cz, 0 |
caryclark | 1049f12 | 2015-04-20 08:31:59 -0700 | [diff] [blame] | 3306 | ]; |
caryclark | ed0935a | 2015-10-22 07:23:52 -0700 | [diff] [blame] | 3307 | var dMidAC = { x:(array[0] + array[4]) / 2, y:(array[1] + array[5]) / 2 }; |
| 3308 | var dMid = { x:dx / dz, y:dy / dz }; |
| 3309 | var dWNumer = { x:dMidAC.x - dMid.x, y:dMidAC.y - dMid.y }; |
| 3310 | var dWDenom = { x:dMid.x - array[2], y:dMid.y - array[3] }; |
| 3311 | var partW = Math.sqrt(dWNumer.x * dWNumer.x + dWNumer.y * dWNumer.y) |
| 3312 | / Math.sqrt(dWDenom.x * dWDenom.x + dWDenom.y * dWDenom.y); |
| 3313 | array[6] = partW; |
caryclark | 1049f12 | 2015-04-20 08:31:59 -0700 | [diff] [blame] | 3314 | return array; |
| 3315 | } |
caryclark | 55888e4 | 2016-07-18 10:01:36 -0700 | [diff] [blame] | 3316 | |
caryclark | 1049f12 | 2015-04-20 08:31:59 -0700 | [diff] [blame] | 3317 | function drawConicPartial(x1, y1, x2, y2, x3, y3, w, t1, t2) { |
| 3318 | var a = conicPartial(x1, y1, x2, y2, x3, y3, w, t1, t2); |
| 3319 | var ax = a[0]; |
| 3320 | var ay = a[1]; |
| 3321 | var bx = a[2]; |
| 3322 | var by = a[3]; |
| 3323 | var cx = a[4]; |
| 3324 | var cy = a[5]; |
| 3325 | var w_ = a[6]; |
| 3326 | drawConicWithQuads(ax, ay, bx, by, cx, cy, w_); |
| 3327 | } |
| 3328 | |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 3329 | function alreadyDrawnCubic(x1, y1, x2, y2, x3, y3, x4, y4) { |
| 3330 | if (collect_bounds) { |
| 3331 | if (focus_enabled) { |
| 3332 | focusXmin = Math.min(focusXmin, x1, x2, x3, x4); |
| 3333 | focusYmin = Math.min(focusYmin, y1, y2, y3, y4); |
| 3334 | focusXmax = Math.max(focusXmax, x1, x2, x3, x4); |
| 3335 | focusYmax = Math.max(focusYmax, y1, y2, y3, y4); |
| 3336 | } |
| 3337 | return true; |
| 3338 | } |
| 3339 | for (var pts = 0; pts < drawnCubics.length; pts += 8) { |
| 3340 | if (x1 == drawnCubics[pts] && y1 == drawnCubics[pts + 1] |
caryclark | 55888e4 | 2016-07-18 10:01:36 -0700 | [diff] [blame] | 3341 | && x2 == drawnCubics[pts + 2] && y2 == drawnCubics[pts + 3] |
| 3342 | && x3 == drawnCubics[pts + 4] && y3 == drawnCubics[pts + 5] |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 3343 | && x4 == drawnCubics[pts + 6] && y4 == drawnCubics[pts + 7]) { |
| 3344 | return true; |
| 3345 | } |
| 3346 | } |
| 3347 | drawnCubics.push(x1); |
| 3348 | drawnCubics.push(y1); |
| 3349 | drawnCubics.push(x2); |
| 3350 | drawnCubics.push(y2); |
| 3351 | drawnCubics.push(x3); |
| 3352 | drawnCubics.push(y3); |
| 3353 | drawnCubics.push(x4); |
| 3354 | drawnCubics.push(y4); |
| 3355 | return false; |
| 3356 | } |
| 3357 | |
| 3358 | function drawCubic(x1, y1, x2, y2, x3, y3, x4, y4) { |
| 3359 | if (alreadyDrawnCubic(x1, y1, x2, y2, x3, y3, x4, y4)) { |
| 3360 | return; |
| 3361 | } |
| 3362 | ctx.beginPath(); |
| 3363 | ctx.moveTo((x1 - srcLeft) * scale, |
| 3364 | (y1 - srcTop) * scale); |
| 3365 | ctx.bezierCurveTo((x2 - srcLeft) * scale, |
| 3366 | (y2 - srcTop) * scale, |
| 3367 | (x3 - srcLeft) * scale, |
| 3368 | (y3 - srcTop) * scale, |
| 3369 | (x4 - srcLeft) * scale, |
| 3370 | (y4 - srcTop) * scale); |
| 3371 | ctx.stroke(); |
| 3372 | } |
| 3373 | |
| 3374 | function interp_cubic_coords(x1, x2, x3, x4, t) |
| 3375 | { |
| 3376 | var ab = interp(x1, x2, t); |
| 3377 | var bc = interp(x2, x3, t); |
| 3378 | var cd = interp(x3, x4, t); |
| 3379 | var abc = interp(ab, bc, t); |
| 3380 | var bcd = interp(bc, cd, t); |
| 3381 | var abcd = interp(abc, bcd, t); |
| 3382 | return abcd; |
| 3383 | } |
| 3384 | |
| 3385 | function cubicPartial(x1, y1, x2, y2, x3, y3, x4, y4, t1, t2) { |
| 3386 | var ax = interp_cubic_coords(x1, x2, x3, x4, t1); |
| 3387 | var ay = interp_cubic_coords(y1, y2, y3, y4, t1); |
| 3388 | var ex = interp_cubic_coords(x1, x2, x3, x4, (t1*2+t2)/3); |
| 3389 | var ey = interp_cubic_coords(y1, y2, y3, y4, (t1*2+t2)/3); |
| 3390 | var fx = interp_cubic_coords(x1, x2, x3, x4, (t1+t2*2)/3); |
| 3391 | var fy = interp_cubic_coords(y1, y2, y3, y4, (t1+t2*2)/3); |
| 3392 | var dx = interp_cubic_coords(x1, x2, x3, x4, t2); |
| 3393 | var dy = interp_cubic_coords(y1, y2, y3, y4, t2); |
| 3394 | var mx = ex * 27 - ax * 8 - dx; |
| 3395 | var my = ey * 27 - ay * 8 - dy; |
| 3396 | var nx = fx * 27 - ax - dx * 8; |
| 3397 | var ny = fy * 27 - ay - dy * 8; |
| 3398 | var bx = (mx * 2 - nx) / 18; |
| 3399 | var by = (my * 2 - ny) / 18; |
| 3400 | var cx = (nx * 2 - mx) / 18; |
| 3401 | var cy = (ny * 2 - my) / 18; |
| 3402 | var array = [ |
| 3403 | ax, ay, bx, by, cx, cy, dx, dy |
| 3404 | ]; |
| 3405 | return array; |
| 3406 | } |
caryclark | 55888e4 | 2016-07-18 10:01:36 -0700 | [diff] [blame] | 3407 | |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 3408 | function drawCubicPartial(x1, y1, x2, y2, x3, y3, x4, y4, t1, t2) { |
| 3409 | var a = cubicPartial(x1, y1, x2, y2, x3, y3, x4, y4, t1, t2); |
| 3410 | var ax = a[0]; |
| 3411 | var ay = a[1]; |
| 3412 | var bx = a[2]; |
| 3413 | var by = a[3]; |
| 3414 | var cx = a[4]; |
| 3415 | var cy = a[5]; |
| 3416 | var dx = a[6]; |
| 3417 | var dy = a[7]; |
| 3418 | if (alreadyDrawnCubic(ax, ay, bx, by, cx, cy, dx, dy)) { |
| 3419 | return; |
| 3420 | } |
| 3421 | ctx.beginPath(); |
| 3422 | ctx.moveTo((ax - srcLeft) * scale, |
| 3423 | (ay - srcTop) * scale); |
| 3424 | ctx.bezierCurveTo((bx - srcLeft) * scale, |
| 3425 | (by - srcTop) * scale, |
| 3426 | (cx - srcLeft) * scale, |
| 3427 | (cy - srcTop) * scale, |
| 3428 | (dx - srcLeft) * scale, |
| 3429 | (dy - srcTop) * scale); |
| 3430 | ctx.stroke(); |
| 3431 | } |
| 3432 | |
| 3433 | function drawCurve(c) { |
| 3434 | switch (c.length) { |
| 3435 | case 4: |
| 3436 | drawLine(c[0], c[1], c[2], c[3]); |
| 3437 | break; |
| 3438 | case 6: |
| 3439 | drawQuad(c[0], c[1], c[2], c[3], c[4], c[5]); |
| 3440 | break; |
caryclark | 1049f12 | 2015-04-20 08:31:59 -0700 | [diff] [blame] | 3441 | case 7: |
| 3442 | drawConicWithQuads(c[0], c[1], c[2], c[3], c[4], c[5], c[6]); |
| 3443 | break; |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 3444 | case 8: |
| 3445 | drawCubic(c[0], c[1], c[2], c[3], c[4], c[5], c[6], c[7]); |
| 3446 | break; |
| 3447 | } |
| 3448 | } |
| 3449 | |
| 3450 | function boundsWidth(pts) { |
| 3451 | var min = pts[0]; |
| 3452 | var max = pts[0]; |
caryclark | 1049f12 | 2015-04-20 08:31:59 -0700 | [diff] [blame] | 3453 | var length = pts.length == 7 ? 6 : pts.length; |
| 3454 | for (var idx = 2; idx < length; idx += 2) { |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 3455 | min = Math.min(min, pts[idx]); |
| 3456 | max = Math.max(max, pts[idx]); |
| 3457 | } |
| 3458 | return max - min; |
| 3459 | } |
| 3460 | |
| 3461 | function boundsHeight(pts) { |
| 3462 | var min = pts[1]; |
| 3463 | var max = pts[1]; |
caryclark | 1049f12 | 2015-04-20 08:31:59 -0700 | [diff] [blame] | 3464 | var length = pts.length == 7 ? 6 : pts.length; |
| 3465 | for (var idx = 3; idx < length; idx += 2) { |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 3466 | min = Math.min(min, pts[idx]); |
| 3467 | max = Math.max(max, pts[idx]); |
| 3468 | } |
| 3469 | return max - min; |
| 3470 | } |
| 3471 | |
| 3472 | function tangent(pts) { |
| 3473 | var dx = pts[2] - pts[0]; |
| 3474 | var dy = pts[3] - pts[1]; |
| 3475 | if (dx == 0 && dy == 0 && pts.length > 4) { |
| 3476 | dx = pts[4] - pts[0]; |
| 3477 | dy = pts[5] - pts[1]; |
caryclark | 1049f12 | 2015-04-20 08:31:59 -0700 | [diff] [blame] | 3478 | if (dx == 0 && dy == 0 && pts.length == 8) { |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 3479 | dx = pts[6] - pts[0]; |
| 3480 | dy = pts[7] - pts[1]; |
| 3481 | } |
| 3482 | } |
| 3483 | return Math.atan2(-dy, dx); |
| 3484 | } |
| 3485 | |
| 3486 | function hodograph(cubic) { |
| 3487 | var hodo = []; |
| 3488 | hodo[0] = 3 * (cubic[2] - cubic[0]); |
| 3489 | hodo[1] = 3 * (cubic[3] - cubic[1]); |
| 3490 | hodo[2] = 3 * (cubic[4] - cubic[2]); |
| 3491 | hodo[3] = 3 * (cubic[5] - cubic[3]); |
| 3492 | hodo[4] = 3 * (cubic[6] - cubic[4]); |
| 3493 | hodo[5] = 3 * (cubic[7] - cubic[5]); |
| 3494 | return hodo; |
| 3495 | } |
| 3496 | |
| 3497 | function hodograph2(cubic) { |
| 3498 | var quad = hodograph(cubic); |
| 3499 | var hodo = []; |
| 3500 | hodo[0] = 2 * (quad[2] - quad[0]); |
| 3501 | hodo[1] = 2 * (quad[3] - quad[1]); |
| 3502 | hodo[2] = 2 * (quad[4] - quad[2]); |
| 3503 | hodo[3] = 2 * (quad[5] - quad[3]); |
| 3504 | return hodo; |
| 3505 | } |
| 3506 | |
| 3507 | function quadraticRootsReal(A, B, C, s) { |
| 3508 | if (A == 0) { |
| 3509 | if (B == 0) { |
| 3510 | s[0] = 0; |
| 3511 | return C == 0; |
| 3512 | } |
| 3513 | s[0] = -C / B; |
| 3514 | return 1; |
| 3515 | } |
| 3516 | /* normal form: x^2 + px + q = 0 */ |
| 3517 | var p = B / (2 * A); |
| 3518 | var q = C / A; |
| 3519 | var p2 = p * p; |
| 3520 | if (p2 < q) { |
| 3521 | return 0; |
| 3522 | } |
| 3523 | var sqrt_D = 0; |
| 3524 | if (p2 > q) { |
| 3525 | sqrt_D = sqrt(p2 - q); |
| 3526 | } |
| 3527 | s[0] = sqrt_D - p; |
| 3528 | s[1] = -sqrt_D - p; |
| 3529 | return 1 + s[0] != s[1]; |
| 3530 | } |
| 3531 | |
| 3532 | function add_valid_ts(s, realRoots, t) { |
| 3533 | var foundRoots = 0; |
| 3534 | for (var index = 0; index < realRoots; ++index) { |
| 3535 | var tValue = s[index]; |
| 3536 | if (tValue >= 0 && tValue <= 1) { |
| 3537 | for (var idx2 = 0; idx2 < foundRoots; ++idx2) { |
| 3538 | if (t[idx2] != tValue) { |
| 3539 | t[foundRoots++] = tValue; |
| 3540 | } |
| 3541 | } |
| 3542 | } |
| 3543 | } |
| 3544 | return foundRoots; |
| 3545 | } |
| 3546 | |
| 3547 | function quadraticRootsValidT(a, b, c, t) { |
| 3548 | var s = []; |
| 3549 | var realRoots = quadraticRootsReal(A, B, C, s); |
| 3550 | var foundRoots = add_valid_ts(s, realRoots, t); |
| 3551 | return foundRoots != 0; |
| 3552 | } |
| 3553 | |
| 3554 | function find_cubic_inflections(cubic, tValues) { |
| 3555 | var Ax = src[2] - src[0]; |
| 3556 | var Ay = src[3] - src[1]; |
| 3557 | var Bx = src[4] - 2 * src[2] + src[0]; |
| 3558 | var By = src[5] - 2 * src[3] + src[1]; |
| 3559 | var Cx = src[6] + 3 * (src[2] - src[4]) - src[0]; |
| 3560 | var Cy = src[7] + 3 * (src[3] - src[5]) - src[1]; |
| 3561 | return quadraticRootsValidT(Bx * Cy - By * Cx, (Ax * Cy - Ay * Cx), |
| 3562 | Ax * By - Ay * Bx, tValues); |
| 3563 | } |
| 3564 | |
| 3565 | function dxy_at_t(curve, type, t) { |
| 3566 | var dxy = {}; |
Cary Clark | ff11428 | 2016-12-14 11:56:16 -0500 | [diff] [blame] | 3567 | if (type == PATH_LINE) { |
| 3568 | dxy.x = curve[2] - curve[0]; |
| 3569 | dxy.y = curve[3] - curve[1]; |
| 3570 | } else if (type == PATH_QUAD) { |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 3571 | var a = t - 1; |
| 3572 | var b = 1 - 2 * t; |
| 3573 | var c = t; |
| 3574 | dxy.x = a * curve[0] + b * curve[2] + c * curve[4]; |
| 3575 | dxy.y = a * curve[1] + b * curve[3] + c * curve[5]; |
caryclark | 1049f12 | 2015-04-20 08:31:59 -0700 | [diff] [blame] | 3576 | } else if (type == PATH_CONIC) { |
| 3577 | var p20x = curve[4] - curve[0]; |
| 3578 | var p20y = curve[5] - curve[1]; |
| 3579 | var p10xw = (curve[2] - curve[0]) * curve[6]; |
| 3580 | var p10yw = (curve[3] - curve[1]) * curve[6]; |
| 3581 | var coeff0x = curve[6] * p20x - p20x; |
| 3582 | var coeff0y = curve[6] * p20y - p20y; |
| 3583 | var coeff1x = p20x - 2 * p10xw; |
| 3584 | var coeff1y = p20y - 2 * p10yw; |
| 3585 | dxy.x = t * (t * coeff0x + coeff1x) + p10xw; |
| 3586 | dxy.y = t * (t * coeff0y + coeff1y) + p10yw; |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 3587 | } else if (type == PATH_CUBIC) { |
| 3588 | var one_t = 1 - t; |
| 3589 | var a = curve[0]; |
| 3590 | var b = curve[2]; |
| 3591 | var c = curve[4]; |
| 3592 | var d = curve[6]; |
| 3593 | dxy.x = 3 * ((b - a) * one_t * one_t + 2 * (c - b) * t * one_t + (d - c) * t * t); |
| 3594 | a = curve[1]; |
| 3595 | b = curve[3]; |
| 3596 | c = curve[5]; |
| 3597 | d = curve[7]; |
| 3598 | dxy.y = 3 * ((b - a) * one_t * one_t + 2 * (c - b) * t * one_t + (d - c) * t * t); |
| 3599 | } |
| 3600 | return dxy; |
| 3601 | } |
| 3602 | |
Cary Clark | ff11428 | 2016-12-14 11:56:16 -0500 | [diff] [blame] | 3603 | function dpt_at_t(curve, t) {
|
| 3604 | var type = PATH_LINE + (curve.length / 2 - 2); |
| 3605 | return dxy_at_t(curve, type, t);
|
| 3606 | } |
| 3607 | |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 3608 | function drawLabel(num, px, py) { |
| 3609 | ctx.beginPath(); |
| 3610 | ctx.arc(px, py, 8, 0, Math.PI*2, true); |
| 3611 | ctx.closePath(); |
| 3612 | ctx.strokeStyle = "rgba(0,0,0, 0.4)"; |
| 3613 | ctx.lineWidth = num == 0 || num == 3 ? 2 : 1; |
| 3614 | ctx.stroke(); |
| 3615 | ctx.fillStyle = "black"; |
| 3616 | ctx.font = "normal 10px Arial"; |
| 3617 | // ctx.rotate(0.001); |
| 3618 | ctx.fillText(num, px - 2, py + 3); |
| 3619 | // ctx.rotate(-0.001); |
| 3620 | } |
| 3621 | |
| 3622 | function drawLabelX(ymin, num, loc) { |
| 3623 | var px = (loc - srcLeft) * scale; |
| 3624 | var py = (ymin - srcTop) * scale - 20; |
| 3625 | drawLabel(num, px, py); |
| 3626 | } |
| 3627 | |
| 3628 | function drawLabelY(xmin, num, loc) { |
| 3629 | var px = (xmin - srcLeft) * scale - 20; |
| 3630 | var py = (loc - srcTop) * scale; |
| 3631 | drawLabel(num, px, py); |
| 3632 | } |
| 3633 | |
| 3634 | function drawHodoOrigin(hx, hy, hMinX, hMinY, hMaxX, hMaxY) { |
| 3635 | ctx.beginPath(); |
| 3636 | ctx.moveTo(hx, hy - 100); |
| 3637 | ctx.lineTo(hx, hy); |
| 3638 | ctx.strokeStyle = hMinY < 0 ? "green" : "blue"; |
| 3639 | ctx.stroke(); |
| 3640 | ctx.beginPath(); |
| 3641 | ctx.moveTo(hx, hy); |
| 3642 | ctx.lineTo(hx, hy + 100); |
| 3643 | ctx.strokeStyle = hMaxY > 0 ? "green" : "blue"; |
| 3644 | ctx.stroke(); |
| 3645 | ctx.beginPath(); |
| 3646 | ctx.moveTo(hx - 100, hy); |
| 3647 | ctx.lineTo(hx, hy); |
| 3648 | ctx.strokeStyle = hMinX < 0 ? "green" : "blue"; |
| 3649 | ctx.stroke(); |
| 3650 | ctx.beginPath(); |
| 3651 | ctx.moveTo(hx, hy); |
| 3652 | ctx.lineTo(hx + 100, hy); |
| 3653 | ctx.strokeStyle = hMaxX > 0 ? "green" : "blue"; |
| 3654 | ctx.stroke(); |
| 3655 | } |
| 3656 | |
| 3657 | function scalexy(x, y, mag) { |
| 3658 | var length = Math.sqrt(x * x + y * y); |
| 3659 | return mag / length; |
| 3660 | } |
| 3661 | |
caryclark | 03b03ca | 2015-04-23 09:13:37 -0700 | [diff] [blame] | 3662 | function drawArrow(x, y, dx, dy, s) { |
| 3663 | var dscale = scalexy(dx, dy, 1 / scale * 100 * s); |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 3664 | dx *= dscale; |
| 3665 | dy *= dscale; |
| 3666 | ctx.beginPath(); |
| 3667 | ctx.moveTo((x - srcLeft) * scale, (y - srcTop) * scale); |
| 3668 | x += dx; |
| 3669 | y += dy; |
| 3670 | ctx.lineTo((x - srcLeft) * scale, (y - srcTop) * scale); |
| 3671 | dx /= 10; |
| 3672 | dy /= 10; |
| 3673 | ctx.lineTo((x - dy - srcLeft) * scale, (y + dx - srcTop) * scale); |
| 3674 | ctx.lineTo((x + dx * 2 - srcLeft) * scale, (y + dy * 2 - srcTop) * scale); |
| 3675 | ctx.lineTo((x + dy - srcLeft) * scale, (y - dx - srcTop) * scale); |
| 3676 | ctx.lineTo((x - srcLeft) * scale, (y - srcTop) * scale); |
| 3677 | ctx.strokeStyle = "rgba(0,75,0, 0.4)"; |
| 3678 | ctx.stroke(); |
| 3679 | } |
| 3680 | |
| 3681 | function x_at_t(curve, t) { |
| 3682 | var one_t = 1 - t; |
| 3683 | if (curve.length == 4) { |
| 3684 | return one_t * curve[0] + t * curve[2]; |
| 3685 | } |
| 3686 | var one_t2 = one_t * one_t; |
| 3687 | var t2 = t * t; |
| 3688 | if (curve.length == 6) { |
| 3689 | return one_t2 * curve[0] + 2 * one_t * t * curve[2] + t2 * curve[4]; |
| 3690 | } |
caryclark | 1049f12 | 2015-04-20 08:31:59 -0700 | [diff] [blame] | 3691 | if (curve.length == 7) { |
| 3692 | return (one_t2 * curve[0] + 2 * one_t * t * curve[2] * curve[6] + t2 * curve[4]) |
| 3693 | / (one_t2 +2 * one_t * t * curve[6] + t2); |
| 3694 | } |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 3695 | var a = one_t2 * one_t; |
| 3696 | var b = 3 * one_t2 * t; |
| 3697 | var c = 3 * one_t * t2; |
| 3698 | var d = t2 * t; |
| 3699 | return a * curve[0] + b * curve[2] + c * curve[4] + d * curve[6]; |
| 3700 | } |
| 3701 | |
| 3702 | function y_at_t(curve, t) { |
| 3703 | var one_t = 1 - t; |
| 3704 | if (curve.length == 4) { |
| 3705 | return one_t * curve[1] + t * curve[3]; |
| 3706 | } |
| 3707 | var one_t2 = one_t * one_t; |
| 3708 | var t2 = t * t; |
| 3709 | if (curve.length == 6) { |
| 3710 | return one_t2 * curve[1] + 2 * one_t * t * curve[3] + t2 * curve[5]; |
| 3711 | } |
caryclark | 1049f12 | 2015-04-20 08:31:59 -0700 | [diff] [blame] | 3712 | if (curve.length == 7) { |
| 3713 | return (one_t2 * curve[1] + 2 * one_t * t * curve[3] * curve[6] + t2 * curve[5]) |
| 3714 | / (one_t2 +2 * one_t * t * curve[6] + t2); |
| 3715 | } |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 3716 | var a = one_t2 * one_t; |
| 3717 | var b = 3 * one_t2 * t; |
| 3718 | var c = 3 * one_t * t2; |
| 3719 | var d = t2 * t; |
| 3720 | return a * curve[1] + b * curve[3] + c * curve[5] + d * curve[7]; |
| 3721 | } |
| 3722 | |
Cary Clark | ff11428 | 2016-12-14 11:56:16 -0500 | [diff] [blame] | 3723 | function pt_at_t(curve, t) {
|
| 3724 | var pt = {};
|
| 3725 | pt.x = x_at_t(curve, t);
|
| 3726 | pt.y = y_at_t(curve, t);
|
| 3727 | return pt;
|
| 3728 | } |
| 3729 | |
| 3730 | function drawOrder(curve, t, label) { |
| 3731 | var px = x_at_t(curve, t); |
| 3732 | var py = y_at_t(curve, t); |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 3733 | var _px = (px - srcLeft) * scale; |
| 3734 | var _py = (py - srcTop) * scale; |
| 3735 | ctx.beginPath(); |
| 3736 | ctx.arc(_px, _py, 15, 0, Math.PI * 2, true); |
| 3737 | ctx.closePath(); |
| 3738 | ctx.fillStyle = "white"; |
| 3739 | ctx.fill(); |
| 3740 | if (label == 'L') { |
| 3741 | ctx.strokeStyle = "rgba(255,0,0, 1)"; |
| 3742 | ctx.fillStyle = "rgba(255,0,0, 1)"; |
| 3743 | } else { |
| 3744 | ctx.strokeStyle = "rgba(0,0,255, 1)"; |
| 3745 | ctx.fillStyle = "rgba(0,0,255, 1)"; |
| 3746 | } |
| 3747 | ctx.stroke(); |
| 3748 | ctx.font = "normal 16px Arial"; |
| 3749 | ctx.textAlign = "center"; |
| 3750 | ctx.fillText(label, _px, _py + 5); |
| 3751 | ctx.font = "normal 10px Arial"; |
| 3752 | } |
| 3753 | |
Cary Clark | ff11428 | 2016-12-14 11:56:16 -0500 | [diff] [blame] | 3754 | function drawVisibleOrder(curve, label) {
|
| 3755 | var s = pt_at_t(curve, 0);
|
| 3756 | var e = pt_at_t(curve, 1);
|
| 3757 | var sOn = ptOnScreen(s);
|
| 3758 | var eOn = ptOnScreen(e);
|
| 3759 | var defaultT = 0.85;
|
| 3760 | if (sOn && eOn)
|
| 3761 | return drawOrder(curve, defaultT, label);
|
| 3762 | if (sOn || eOn) {
|
| 3763 | if (eOn) {
|
| 3764 | defaultT = 1 - defaultT;
|
| 3765 | }
|
| 3766 | var step = sOn ? -defaultT / 2 : (1 - defaultT) / 2;
|
| 3767 | var t = defaultT;
|
| 3768 | var tries = 16;
|
| 3769 | do {
|
| 3770 | var mid = pt_at_t(curve, t);
|
| 3771 | if (ptOnScreen(mid))
|
| 3772 | return drawOrder(curve, t, label);
|
| 3773 | t += step;
|
| 3774 | step /= 2;
|
| 3775 | } while (--tries > 0);
|
| 3776 | drawOrder(curve, defaultT, label);
|
| 3777 | }
|
| 3778 | // scattershot until we find a visible point
|
| 3779 | var denom = 2; // visit odd number num / denom to hit unique pts
|
| 3780 | var tries = 6; // tries 1/2, 1/4, 3/4, 1/8, 3/8, 5/8, 7/8, 1/16 ...
|
| 3781 | do {
|
| 3782 | for (var numer = 1; numer < denom; numer += 2) {
|
| 3783 | var t = numer / denom + 0.1;
|
| 3784 | if (t >= 1) {
|
| 3785 | break;
|
| 3786 | }
|
| 3787 | var mid = pt_at_t(curve, t);
|
| 3788 | if (ptOnScreen(mid))
|
| 3789 | return drawOrder(curve, t, label);
|
| 3790 | }
|
| 3791 | denom *= 2;
|
| 3792 | } while (--tries > 0);
|
| 3793 | drawOrder(curve, defaultT, label);
|
| 3794 | } |
| 3795 | |
| 3796 | function set_length(pt, newLen) {
|
| 3797 | var len = Math.sqrt(pt.x * pt.x + pt.y * pt.y);
|
| 3798 | var scale = newLen / len;
|
| 3799 | var newPt = { x: pt.x * scale, y: pt.y * scale };
|
| 3800 | return newPt;
|
| 3801 | } |
| 3802 | |
| 3803 | function drawDirection(curve, t) {
|
| 3804 | var d = dpt_at_t(curve, t); |
| 3805 | d = set_length(d, 16); |
| 3806 | var pt = localToGlobal(pt_at_t(curve, t));
|
| 3807 | ctx.beginPath(); |
| 3808 | ctx.moveTo(pt.x - d.y, pt.y + d.x); |
| 3809 | ctx.lineTo(pt.x + d.x, pt.y + d.y); |
| 3810 | ctx.lineTo(pt.x + d.y, pt.y - d.x); |
| 3811 | ctx.strokeStyle = "rgba(0,75,0, 0.4)"; |
| 3812 | ctx.stroke(); |
| 3813 | } |
| 3814 | |
| 3815 | function drawVisibleDirection(curve) {
|
| 3816 | var s = pt_at_t(curve, 0);
|
| 3817 | var e = pt_at_t(curve, 1);
|
| 3818 | var sOn = ptOnScreen(s);
|
| 3819 | var eOn = ptOnScreen(e);
|
| 3820 | var defaultT = 0.65;
|
| 3821 | if (sOn && eOn) {
|
| 3822 | return drawDirection(curve, defaultT);
|
| 3823 | }
|
| 3824 | if (sOn || eOn) {
|
| 3825 | if (eOn) {
|
| 3826 | defaultT = 1 - defaultT;
|
| 3827 | }
|
| 3828 | var step = sOn ? -defaultT / 2 : (1 - defaultT) / 2;
|
| 3829 | var t = defaultT;
|
| 3830 | var tries = 16;
|
| 3831 | do {
|
| 3832 | var mid = pt_at_t(curve, t);
|
| 3833 | if (ptOnScreen(mid))
|
| 3834 | return drawDirection(curve, t);
|
| 3835 | t += step;
|
| 3836 | step /= 2;
|
| 3837 | } while (--tries > 0);
|
| 3838 | drawDirection(curve, defaultT);
|
| 3839 | }
|
| 3840 | // scattershot until we find a visible point
|
| 3841 | var denom = 2; // visit odd number num / denom to hit unique pts
|
| 3842 | var tries = 6; // tries 1/2, 1/4, 3/4, 1/8, 3/8, 5/8, 7/8, 1/16 ...
|
| 3843 | do {
|
| 3844 | for (var numer = 1; numer < denom; numer += 2) {
|
| 3845 | var t = numer / denom + 0.1;
|
| 3846 | if (t >= 1) {
|
| 3847 | break;
|
| 3848 | }
|
| 3849 | var mid = pt_at_t(curve, t);
|
| 3850 | if (ptOnScreen(mid))
|
| 3851 | return drawDirection(curve, t);
|
| 3852 | }
|
| 3853 | denom *= 2;
|
| 3854 | } while (--tries > 0);
|
| 3855 | drawDirection(curve, defaultT);
|
| 3856 | } |
| 3857 | |
| 3858 | function drawID(curve, t, id) { |
| 3859 | var px = x_at_t(curve, t); |
| 3860 | var py = y_at_t(curve, t); |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 3861 | var _px = (px - srcLeft) * scale; |
| 3862 | var _py = (py - srcTop) * scale; |
| 3863 | draw_id_at(id, _px, _py); |
| 3864 | } |
| 3865 | |
Cary Clark | ff11428 | 2016-12-14 11:56:16 -0500 | [diff] [blame] | 3866 | function localToGlobal(local) {
|
| 3867 | var global = {};
|
| 3868 | global.x = (local.x - srcLeft) * scale;
|
| 3869 | global.y = (local.y - srcTop) * scale;
|
| 3870 | return global;
|
| 3871 | } |
| 3872 | |
| 3873 | function ptOnScreen(local) {
|
| 3874 | var pt = localToGlobal(local);
|
| 3875 | return 10 <= pt.x && pt.x <= screenWidth - 10
|
| 3876 | && 10 <= pt.y && pt.y <= screenHeight - 10;
|
| 3877 | } |
| 3878 | |
| 3879 | function drawVisibleID(curve, defaultT, id) {
|
| 3880 | // determine if either or both ends are visible
|
| 3881 | var s = pt_at_t(curve, 0);
|
| 3882 | var e = pt_at_t(curve, 1);
|
| 3883 | var sOn = ptOnScreen(s);
|
| 3884 | var eOn = ptOnScreen(e);
|
| 3885 | if (sOn && eOn)
|
| 3886 | return drawID(curve, defaultT, id);
|
| 3887 | if (sOn || eOn) {
|
| 3888 | var step = sOn ? -defaultT / 2 : (1 - defaultT) / 2;
|
| 3889 | var t = defaultT;
|
| 3890 | var tries = 16;
|
| 3891 | do {
|
| 3892 | var mid = pt_at_t(curve, t);
|
| 3893 | if (ptOnScreen(mid))
|
| 3894 | return drawID(curve, t, id);
|
| 3895 | t += step;
|
| 3896 | step /= 2;
|
| 3897 | } while (--tries > 0);
|
| 3898 | drawID(curve, defaultT, id);
|
| 3899 | }
|
| 3900 | // scattershot until we find a visible point
|
| 3901 | var denom = 2; // visit odd number num / denom to hit unique pts
|
| 3902 | var tries = 6; // tries 1/2, 1/4, 3/4, 1/8, 3/8, 5/8, 7/8, 1/16 ...
|
| 3903 | do {
|
| 3904 | for (var numer = 1; numer < denom; numer += 2) {
|
| 3905 | var t = numer / denom;
|
| 3906 | var mid = pt_at_t(curve, t);
|
| 3907 | if (ptOnScreen(mid))
|
| 3908 | return drawID(curve, t, id);
|
| 3909 | }
|
| 3910 | denom *= 2;
|
| 3911 | } while (--tries > 0);
|
| 3912 | drawID(curve, defaultT, id);
|
| 3913 | } |
| 3914 | |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 3915 | function draw_id_at(id, _px, _py) { |
| 3916 | ctx.beginPath(); |
| 3917 | ctx.arc(_px, _py, 15, 0, Math.PI * 2, true); |
| 3918 | ctx.closePath(); |
| 3919 | ctx.fillStyle = "white"; |
| 3920 | ctx.fill(); |
| 3921 | ctx.strokeStyle = "rgba(127,127,0, 1)"; |
| 3922 | ctx.fillStyle = "rgba(127,127,0, 1)"; |
| 3923 | ctx.stroke(); |
| 3924 | ctx.font = "normal 16px Arial"; |
| 3925 | ctx.textAlign = "center"; |
| 3926 | ctx.fillText(id, _px, _py + 5); |
| 3927 | ctx.font = "normal 10px Arial"; |
| 3928 | } |
| 3929 | |
| 3930 | function drawLinePartialID(id, x1, y1, x2, y2, t1, t2) { |
| 3931 | var curve = [x1, y1, x2, y2]; |
| 3932 | drawCurvePartialID(id, curve, t1, t2); |
| 3933 | } |
| 3934 | |
caryclark | 55888e4 | 2016-07-18 10:01:36 -0700 | [diff] [blame] | 3935 | function drawLineID(id, x1, y1, x2, y2) { |
| 3936 | drawLinePartialID(id, x1, y1, x2, y2, 0, 1); |
| 3937 | } |
| 3938 | |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 3939 | function drawQuadPartialID(id, x1, y1, x2, y2, x3, y3, t1, t2) { |
| 3940 | var curve = [x1, y1, x2, y2, x3, y3]; |
| 3941 | drawCurvePartialID(id, curve, t1, t2); |
| 3942 | } |
| 3943 | |
caryclark | 55888e4 | 2016-07-18 10:01:36 -0700 | [diff] [blame] | 3944 | function drawQuadID(id, x1, y1, x2, y2, x3, y3) { |
| 3945 | drawQuadPartialID(id, x1, y1, x2, y2, x3, y3, 0, 1); |
| 3946 | } |
| 3947 | |
caryclark | 1049f12 | 2015-04-20 08:31:59 -0700 | [diff] [blame] | 3948 | function drawConicPartialID(id, x1, y1, x2, y2, x3, y3, w, t1, t2) { |
| 3949 | var curve = [x1, y1, x2, y2, x3, y3, w]; |
| 3950 | drawCurvePartialID(id, curve, t1, t2); |
| 3951 | } |
| 3952 | |
caryclark | 55888e4 | 2016-07-18 10:01:36 -0700 | [diff] [blame] | 3953 | function drawConicID(id, x1, y1, x2, y2, x3, y3, w) { |
| 3954 | drawConicPartialID(id, x1, y1, x2, y2, x3, y3, w, 0, 1); |
| 3955 | } |
| 3956 | |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 3957 | function drawCubicPartialID(id, x1, y1, x2, y2, x3, y3, x4, y4, t1, t2) { |
| 3958 | var curve = [x1, y1, x2, y2, x3, y3, x4, y4]; |
| 3959 | drawCurvePartialID(id, curve, t1, t2); |
| 3960 | } |
| 3961 | |
caryclark | 55888e4 | 2016-07-18 10:01:36 -0700 | [diff] [blame] | 3962 | function drawCubicID(id, x1, y1, x2, y2, x3, y3, x4, y4) { |
| 3963 | drawCubicPartialID(id, x1, y1, x2, y2, x3, y3, x4, y4, 0, 1); |
| 3964 | } |
| 3965 | |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 3966 | function drawCurvePartialID(id, curve, t1, t2) { |
Cary Clark | ff11428 | 2016-12-14 11:56:16 -0500 | [diff] [blame] | 3967 | drawVisibleID(curve, (t1 + t2) / 2, id); |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 3968 | } |
| 3969 | |
| 3970 | function drawCurveSpecials(test, curve, type) { |
| 3971 | if (pt_labels) { |
| 3972 | drawPoints(curve, type, pt_labels == 2); |
| 3973 | } |
| 3974 | if (control_lines != 0) { |
| 3975 | drawControlLines(curve, type, control_lines); |
| 3976 | } |
| 3977 | if (curve_t) { |
| 3978 | drawPointAtT(curve, type); |
| 3979 | } |
| 3980 | if (draw_midpoint) { |
| 3981 | var mid = pointAtT(curve, type, 0.5); |
| 3982 | drawPoint(mid.x, mid.y, true); |
| 3983 | } |
| 3984 | if (draw_id) { |
| 3985 | var id = idByCurve(test, curve, type); |
| 3986 | if (id >= 0) { |
Cary Clark | ff11428 | 2016-12-14 11:56:16 -0500 | [diff] [blame] | 3987 | drawVisibleID(curve, 0.5, id); |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 3988 | } |
| 3989 | } |
Cary Clark | ff11428 | 2016-12-14 11:56:16 -0500 | [diff] [blame] | 3990 | if (draw_direction) {
|
| 3991 | drawVisibleDirection(curve);
|
| 3992 | } |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 3993 | if (type == PATH_LINE) { |
| 3994 | return; |
| 3995 | } |
| 3996 | if (draw_deriviatives > 0) { |
| 3997 | var d = dxy_at_t(curve, type, 0); |
caryclark | 03b03ca | 2015-04-23 09:13:37 -0700 | [diff] [blame] | 3998 | drawArrow(curve[0], curve[1], d.x, d.y, 1); |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 3999 | if (draw_deriviatives == 2) { |
| 4000 | d = dxy_at_t(curve, type, 1); |
| 4001 | if (type == PATH_CUBIC) { |
caryclark | 03b03ca | 2015-04-23 09:13:37 -0700 | [diff] [blame] | 4002 | drawArrow(curve[6], curve[7], d.x, d.y, 1); |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 4003 | } else { |
caryclark | 03b03ca | 2015-04-23 09:13:37 -0700 | [diff] [blame] | 4004 | drawArrow(curve[4], curve[5], d.x, d.y, 1); |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 4005 | } |
| 4006 | } |
| 4007 | if (draw_midpoint) { |
| 4008 | var mid = pointAtT(curve, type, 0.5); |
| 4009 | d = dxy_at_t(curve, type, 0.5); |
caryclark | 03b03ca | 2015-04-23 09:13:37 -0700 | [diff] [blame] | 4010 | drawArrow(mid.x, mid.y, d.x, d.y, 1); |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 4011 | } |
| 4012 | } |
| 4013 | if (type != PATH_CUBIC) { |
| 4014 | return; |
| 4015 | } |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 4016 | if (draw_sequence) { |
| 4017 | var ymin = Math.min(curve[1], curve[3], curve[5], curve[7]); |
| 4018 | for (var i = 0; i < 8; i+= 2) { |
| 4019 | drawLabelX(ymin, i >> 1, curve[i]); |
| 4020 | } |
| 4021 | var xmin = Math.min(curve[0], curve[2], curve[4], curve[6]); |
| 4022 | for (var i = 1; i < 8; i+= 2) { |
| 4023 | drawLabelY(xmin, i >> 1, curve[i]); |
| 4024 | } |
| 4025 | } |
| 4026 | } |
| 4027 | |
| 4028 | function logCurves(test) { |
| 4029 | for (curves in test) { |
| 4030 | var curve = test[curves]; |
| 4031 | dumpCurve(curve); |
| 4032 | } |
| 4033 | } |
| 4034 | |
| 4035 | function curveToString(curve) { |
| 4036 | var str = "{{"; |
caryclark | 1049f12 | 2015-04-20 08:31:59 -0700 | [diff] [blame] | 4037 | var length = curve.length == 7 ? 6 : curve.length; |
| 4038 | if (curve.length == 7) { |
| 4039 | str += "{"; |
| 4040 | } |
| 4041 | for (i = 0; i < length; i += 2) { |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 4042 | str += curve[i].toFixed(decimal_places) + "," + curve[i + 1].toFixed(decimal_places); |
| 4043 | if (i < curve.length - 2) { |
| 4044 | str += "}, {"; |
| 4045 | } |
| 4046 | } |
caryclark | 1049f12 | 2015-04-20 08:31:59 -0700 | [diff] [blame] | 4047 | str += "}"; |
| 4048 | if (curve.length == 7) { |
| 4049 | str += "}, " + curve[6].toFixed(decimal_places); |
| 4050 | } |
| 4051 | str += "}"; |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 4052 | return str; |
| 4053 | } |
| 4054 | |
| 4055 | function dumpCurve(curve) { |
| 4056 | console.log(curveToString(curve)); |
| 4057 | } |
| 4058 | |
| 4059 | function draw(test, lines, title) { |
| 4060 | ctx.fillStyle = "rgba(0,0,0, 0.1)"; |
| 4061 | ctx.font = "normal 50px Arial"; |
| 4062 | ctx.textAlign = "left"; |
| 4063 | ctx.fillText(title, 50, 50); |
| 4064 | ctx.font = "normal 10px Arial"; |
| 4065 | ctx.lineWidth = "1.001"; "0.999"; |
| 4066 | var secondPath = test.length; |
| 4067 | var closeCount = 0; |
| 4068 | logStart = -1; |
| 4069 | logRange = 0; |
| 4070 | // find last active rec type at this step |
| 4071 | var curType = test[0]; |
| 4072 | var curStep = 0; |
| 4073 | var hasOp = false; |
| 4074 | var lastActive = 0; |
| 4075 | var lastAdd = 0; |
caryclark | 624637c | 2015-05-11 07:21:27 -0700 | [diff] [blame] | 4076 | var lastCoin = 0; |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 4077 | var lastSect = 0; |
| 4078 | var lastSort = 0; |
| 4079 | var lastMark = 0; |
caryclark | 03b03ca | 2015-04-23 09:13:37 -0700 | [diff] [blame] | 4080 | var lastTop = 0; |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 4081 | activeCount = 0; |
| 4082 | addCount = 0; |
| 4083 | angleCount = 0; |
| 4084 | opCount = 0; |
| 4085 | sectCount = 0; |
| 4086 | sortCount = 0; |
caryclark | 03b03ca | 2015-04-23 09:13:37 -0700 | [diff] [blame] | 4087 | topCount = 0; |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 4088 | markCount = 0; |
| 4089 | activeMax = 0; |
| 4090 | addMax = 0; |
| 4091 | angleMax = 0; |
caryclark | 624637c | 2015-05-11 07:21:27 -0700 | [diff] [blame] | 4092 | coinMax = 0; |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 4093 | opMax = 0; |
| 4094 | sectMax = 0; |
| 4095 | sectMax2 = 0; |
| 4096 | sortMax = 0; |
caryclark | 03b03ca | 2015-04-23 09:13:37 -0700 | [diff] [blame] | 4097 | topMax = 0; |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 4098 | markMax = 0; |
| 4099 | lastIndex = test.length - 3; |
| 4100 | for (var tIndex = 0; tIndex < test.length; tIndex += 3) { |
| 4101 | var recType = test[tIndex]; |
| 4102 | if (!typeof recType == 'number' || recType < REC_TYPE_UNKNOWN || recType > REC_TYPE_LAST) { |
| 4103 | console.log("unknown rec type: " + recType); |
| 4104 | throw "stop execution"; |
| 4105 | } |
| 4106 | // if (curType == recType && curType != REC_TYPE_ADD) { |
| 4107 | // continue; |
| 4108 | // } |
| 4109 | var inStepRange = step_limit == 0 || curStep < step_limit; |
| 4110 | curType = recType; |
| 4111 | if (recType == REC_TYPE_OP) { |
| 4112 | hasOp = true; |
| 4113 | continue; |
| 4114 | } |
| 4115 | if (recType == REC_TYPE_UNKNOWN) { |
| 4116 | // these types do not advance step |
| 4117 | continue; |
| 4118 | } |
| 4119 | var bumpStep = false; |
| 4120 | var records = test[tIndex + 2]; |
| 4121 | var fragType = records[0]; |
| 4122 | if (recType == REC_TYPE_ADD) { |
| 4123 | if (records.length != 2) { |
| 4124 | console.log("expect only two elements: " + records.length); |
| 4125 | throw "stop execution"; |
| 4126 | } |
| 4127 | if (fragType == ADD_MOVETO || fragType == ADD_CLOSE) { |
| 4128 | continue; |
| 4129 | } |
| 4130 | ++addMax; |
| 4131 | if (!draw_add || !inStepRange) { |
| 4132 | continue; |
| 4133 | } |
| 4134 | lastAdd = tIndex; |
| 4135 | ++addCount; |
| 4136 | bumpStep = true; |
| 4137 | } |
| 4138 | if (recType == REC_TYPE_PATH && hasOp) { |
| 4139 | secondPath = tIndex; |
| 4140 | } |
caryclark | 5435929 | 2015-03-26 07:52:43 -0700 | [diff] [blame] | 4141 | if (recType == REC_TYPE_PATH2 && hasOp) { |
| 4142 | secondPath = tIndex; |
| 4143 | } |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 4144 | if (recType == REC_TYPE_ACTIVE) { |
| 4145 | ++activeMax; |
| 4146 | if (!draw_active || !inStepRange) { |
| 4147 | continue; |
| 4148 | } |
| 4149 | lastActive = tIndex; |
| 4150 | ++activeCount; |
| 4151 | bumpStep = true; |
| 4152 | } |
| 4153 | if (recType == REC_TYPE_ACTIVE_OP) { |
| 4154 | ++opMax; |
| 4155 | if (!draw_op || !inStepRange) { |
| 4156 | continue; |
| 4157 | } |
| 4158 | lastOp = tIndex; |
| 4159 | ++opCount; |
| 4160 | bumpStep = true; |
| 4161 | } |
caryclark | 5435929 | 2015-03-26 07:52:43 -0700 | [diff] [blame] | 4162 | if (recType == REC_TYPE_AFTERPART) { |
| 4163 | if (draw_angle != 3 || !inStepRange) { |
| 4164 | continue; |
| 4165 | } |
| 4166 | lastAngle = tIndex; |
| 4167 | ++angleCount; |
| 4168 | bumpStep = true; |
| 4169 | } |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 4170 | if (recType == REC_TYPE_ANGLE) { |
| 4171 | ++angleMax; |
caryclark | 5435929 | 2015-03-26 07:52:43 -0700 | [diff] [blame] | 4172 | if (draw_angle == 0 || draw_angle == 3 || !inStepRange) { |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 4173 | continue; |
| 4174 | } |
| 4175 | lastAngle = tIndex; |
| 4176 | ++angleCount; |
| 4177 | bumpStep = true; |
| 4178 | } |
caryclark | 624637c | 2015-05-11 07:21:27 -0700 | [diff] [blame] | 4179 | if (recType == REC_TYPE_COINCIDENCE) { |
| 4180 | ++coinMax; |
| 4181 | if (!draw_coincidence || !inStepRange) { |
| 4182 | continue; |
| 4183 | } |
| 4184 | lastCoin = tIndex; |
| 4185 | ++coinCount; |
| 4186 | bumpStep = true; |
| 4187 | } |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 4188 | if (recType == REC_TYPE_SECT) { |
| 4189 | if (records.length != 2) { |
| 4190 | console.log("expect only two elements: " + records.length); |
| 4191 | throw "stop execution"; |
| 4192 | } |
| 4193 | ++sectMax; |
| 4194 | var sectBump = 1; |
| 4195 | switch (fragType) { |
| 4196 | case INTERSECT_LINE: |
| 4197 | case INTERSECT_QUAD_LINE: |
| 4198 | case INTERSECT_QUAD: |
caryclark | 1049f12 | 2015-04-20 08:31:59 -0700 | [diff] [blame] | 4199 | case INTERSECT_CONIC_LINE: |
caryclark | 55888e4 | 2016-07-18 10:01:36 -0700 | [diff] [blame] | 4200 | case INTERSECT_CONIC_QUAD: |
caryclark | 1049f12 | 2015-04-20 08:31:59 -0700 | [diff] [blame] | 4201 | case INTERSECT_CONIC: |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 4202 | case INTERSECT_SELF_CUBIC: |
| 4203 | case INTERSECT_CUBIC_LINE: |
| 4204 | case INTERSECT_CUBIC_QUAD: |
| 4205 | case INTERSECT_CUBIC: |
| 4206 | sectBump = 1; |
| 4207 | break; |
| 4208 | case INTERSECT_LINE_2: |
| 4209 | case INTERSECT_QUAD_LINE_2: |
| 4210 | case INTERSECT_QUAD_2: |
caryclark | 1049f12 | 2015-04-20 08:31:59 -0700 | [diff] [blame] | 4211 | case INTERSECT_CONIC_LINE_2: |
caryclark | 55888e4 | 2016-07-18 10:01:36 -0700 | [diff] [blame] | 4212 | case INTERSECT_CONIC_QUAD_2: |
caryclark | 1049f12 | 2015-04-20 08:31:59 -0700 | [diff] [blame] | 4213 | case INTERSECT_CONIC_2: |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 4214 | case INTERSECT_CUBIC_LINE_2: |
| 4215 | case INTERSECT_CUBIC_QUAD_2: |
| 4216 | case INTERSECT_CUBIC_2: |
| 4217 | sectBump = 2; |
| 4218 | break; |
| 4219 | case INTERSECT_LINE_NO: |
| 4220 | case INTERSECT_QUAD_LINE_NO: |
| 4221 | case INTERSECT_QUAD_NO: |
caryclark | 1049f12 | 2015-04-20 08:31:59 -0700 | [diff] [blame] | 4222 | case INTERSECT_CONIC_LINE_NO: |
caryclark | 55888e4 | 2016-07-18 10:01:36 -0700 | [diff] [blame] | 4223 | case INTERSECT_CONIC_QUAD_NO: |
caryclark | 1049f12 | 2015-04-20 08:31:59 -0700 | [diff] [blame] | 4224 | case INTERSECT_CONIC_NO: |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 4225 | case INTERSECT_SELF_CUBIC_NO: |
| 4226 | case INTERSECT_CUBIC_LINE_NO: |
| 4227 | case INTERSECT_CUBIC_QUAD_NO: |
| 4228 | case INTERSECT_CUBIC_NO: |
| 4229 | sectBump = 0; |
| 4230 | break; |
caryclark | 6c3b9cd | 2016-09-26 05:36:58 -0700 | [diff] [blame] | 4231 | case INTERSECT_CONIC_QUAD_3: |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 4232 | case INTERSECT_CUBIC_LINE_3: |
| 4233 | case INTERSECT_CUBIC_QUAD_3: |
| 4234 | case INTERSECT_CUBIC_3: |
| 4235 | sectBump = 3; |
| 4236 | break; |
caryclark | 6c3b9cd | 2016-09-26 05:36:58 -0700 | [diff] [blame] | 4237 | case INTERSECT_CONIC_QUAD_4: |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 4238 | case INTERSECT_CUBIC_QUAD_4: |
| 4239 | case INTERSECT_CUBIC_4: |
| 4240 | sectBump = 4; |
| 4241 | break; |
| 4242 | default: |
| 4243 | console.log("missing case " + records.length); |
| 4244 | throw "stop execution"; |
| 4245 | } |
| 4246 | sectMax2 += sectBump; |
| 4247 | if (draw_intersection <= 1 || !inStepRange) { |
| 4248 | continue; |
| 4249 | } |
| 4250 | lastSect = tIndex; |
| 4251 | sectCount += sectBump; |
| 4252 | bumpStep = true; |
| 4253 | } |
| 4254 | if (recType == REC_TYPE_SORT) { |
| 4255 | ++sortMax; |
| 4256 | if (!draw_sort || !inStepRange) { |
| 4257 | continue; |
| 4258 | } |
| 4259 | lastSort = tIndex; |
| 4260 | ++sortCount; |
| 4261 | bumpStep = true; |
| 4262 | } |
caryclark | 03b03ca | 2015-04-23 09:13:37 -0700 | [diff] [blame] | 4263 | if (recType == REC_TYPE_TOP) { |
| 4264 | ++topMax; |
| 4265 | if (!draw_top || !inStepRange) { |
| 4266 | continue; |
| 4267 | } |
| 4268 | lastTop = tIndex; |
| 4269 | ++topCount; |
| 4270 | bumpStep = true; |
| 4271 | } |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 4272 | if (recType == REC_TYPE_MARK) { |
| 4273 | ++markMax; |
| 4274 | if (!draw_mark || !inStepRange) { |
| 4275 | continue; |
| 4276 | } |
| 4277 | lastMark = tIndex; |
| 4278 | ++markCount; |
| 4279 | bumpStep = true; |
| 4280 | } |
| 4281 | if (bumpStep) { |
| 4282 | lastIndex = tIndex; |
| 4283 | logStart = test[tIndex + 1]; |
| 4284 | logRange = records.length / 2; |
| 4285 | ++curStep; |
| 4286 | } |
| 4287 | } |
| 4288 | stepMax = (draw_add ? addMax : 0) |
| 4289 | + (draw_active ? activeMax : 0) |
reed | 0dc4dd6 | 2015-03-24 13:55:33 -0700 | [diff] [blame] | 4290 | + (draw_angle ? angleMax : 0) |
caryclark | 624637c | 2015-05-11 07:21:27 -0700 | [diff] [blame] | 4291 | + (draw_coincidence ? coinMax : 0) |
caryclark | 5435929 | 2015-03-26 07:52:43 -0700 | [diff] [blame] | 4292 | + (draw_op ? opMax : 0) |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 4293 | + (draw_sort ? sortMax : 0) |
caryclark | 03b03ca | 2015-04-23 09:13:37 -0700 | [diff] [blame] | 4294 | + (draw_top ? topMax : 0) |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 4295 | + (draw_mark ? markMax : 0) |
| 4296 | + (draw_intersection == 2 ? sectMax : draw_intersection == 3 ? sectMax2 : 0); |
| 4297 | if (stepMax == 0) { |
caryclark | 624637c | 2015-05-11 07:21:27 -0700 | [diff] [blame] | 4298 | stepMax = addMax + activeMax + angleMax + coinMax + opMax + sortMax + topMax + markMax; |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 4299 | } |
| 4300 | drawnPts = []; |
| 4301 | drawnLines = []; |
| 4302 | drawnQuads = []; |
caryclark | 1049f12 | 2015-04-20 08:31:59 -0700 | [diff] [blame] | 4303 | drawnConics = []; |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 4304 | drawnCubics = []; |
| 4305 | focusXmin = focusYmin = Infinity; |
| 4306 | focusXmax = focusYmax = -Infinity; |
| 4307 | var pathIndex = 0; |
| 4308 | var opLetter = 'S'; |
| 4309 | for (var tIndex = lastIndex; tIndex >= 0; tIndex -= 3) { |
| 4310 | var recType = test[tIndex]; |
| 4311 | var records = test[tIndex + 2]; |
| 4312 | for (var recordIndex = 0; recordIndex < records.length; recordIndex += 2) { |
| 4313 | var fragType = records[recordIndex]; |
| 4314 | if (!typeof fragType == 'number' || fragType < 1 || fragType > FRAG_TYPE_LAST) { |
| 4315 | console.log("unknown in range frag type: " + fragType); |
| 4316 | throw "stop execution"; |
| 4317 | } |
| 4318 | var frags = records[recordIndex + 1]; |
| 4319 | focus_enabled = false; |
| 4320 | switch (recType) { |
| 4321 | case REC_TYPE_COMPUTED: |
| 4322 | if (draw_computed == 0) { |
| 4323 | continue; |
| 4324 | } |
| 4325 | ctx.lineWidth = 1; |
| 4326 | ctx.strokeStyle = pathIndex == 0 ? "black" : "red"; |
| 4327 | ctx.fillStyle = "blue"; |
| 4328 | var drawThis = false; |
| 4329 | switch (fragType) { |
| 4330 | case PATH_QUAD: |
caryclark | 1049f12 | 2015-04-20 08:31:59 -0700 | [diff] [blame] | 4331 | if ((draw_computed & 0x9) == 1 || ((draw_computed & 8) != 0 |
| 4332 | && (draw_computed & 7) == pathIndex)) { |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 4333 | drawQuad(frags[0], frags[1], frags[2], frags[3], |
| 4334 | frags[4], frags[5]); |
| 4335 | drawThis = true; |
| 4336 | } |
| 4337 | break; |
caryclark | 1049f12 | 2015-04-20 08:31:59 -0700 | [diff] [blame] | 4338 | case PATH_CONIC: |
| 4339 | if ((draw_computed & 0xA) == 2 || ((draw_computed & 8) != 0 |
| 4340 | && (draw_computed & 7) == pathIndex)) { |
| 4341 | drawConicWithQuads(frags[0], frags[1], frags[2], frags[3], |
| 4342 | frags[4], frags[5], frags[6]); |
| 4343 | drawThis = true; |
| 4344 | } |
| 4345 | break; |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 4346 | case PATH_CUBIC: |
caryclark | 1049f12 | 2015-04-20 08:31:59 -0700 | [diff] [blame] | 4347 | if ((draw_computed & 0xC) == 4 || ((draw_computed & 8) != 0 |
| 4348 | && (draw_computed & 7) == pathIndex)) { |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 4349 | drawCubic(frags[0], frags[1], frags[2], frags[3], |
| 4350 | frags[4], frags[5], frags[6], frags[7]); |
| 4351 | drawThis = true; |
| 4352 | } |
| 4353 | ++pathIndex; |
| 4354 | break; |
| 4355 | case COMPUTED_SET_1: |
| 4356 | pathIndex = 0; |
| 4357 | break; |
| 4358 | case COMPUTED_SET_2: |
| 4359 | pathIndex = 1; |
| 4360 | break; |
| 4361 | default: |
| 4362 | console.log("unknown REC_TYPE_COMPUTED frag type: " + fragType); |
| 4363 | throw "stop execution"; |
| 4364 | } |
| 4365 | if (!drawThis || collect_bounds) { |
| 4366 | break; |
| 4367 | } |
| 4368 | drawCurveSpecials(test, frags, fragType); |
| 4369 | break; |
caryclark | 26ad22a | 2015-10-16 09:03:38 -0700 | [diff] [blame] | 4370 | case REC_TYPE_ALIGNED: |
| 4371 | if (draw_path < 4) { |
| 4372 | continue; |
| 4373 | } |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 4374 | case REC_TYPE_PATH: |
caryclark | 5435929 | 2015-03-26 07:52:43 -0700 | [diff] [blame] | 4375 | case REC_TYPE_PATH2: |
caryclark | 26ad22a | 2015-10-16 09:03:38 -0700 | [diff] [blame] | 4376 | if (REC_TYPE_ALIGNED != recType && draw_path >= 4) { |
| 4377 | continue; |
| 4378 | } |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 4379 | if (!draw_path) { |
| 4380 | continue; |
| 4381 | } |
| 4382 | var firstPath = tIndex < secondPath; |
| 4383 | if ((draw_path & (firstPath ? 1 : 2)) == 0) { |
| 4384 | continue; |
| 4385 | } |
| 4386 | ctx.lineWidth = 1; |
| 4387 | ctx.strokeStyle = firstPath ? "black" : "red"; |
| 4388 | ctx.fillStyle = "blue"; |
caryclark | 55888e4 | 2016-07-18 10:01:36 -0700 | [diff] [blame] | 4389 | var frags2 = []; |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 4390 | switch (fragType) { |
| 4391 | case PATH_LINE: |
caryclark | 5435929 | 2015-03-26 07:52:43 -0700 | [diff] [blame] | 4392 | for (var i = 0; i < 4; ++ i) { frags2[i] = frags[i + 1]; } |
| 4393 | drawLine(frags2[0], frags2[1], frags2[2], frags2[3]); |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 4394 | break; |
| 4395 | case PATH_QUAD: |
caryclark | 5435929 | 2015-03-26 07:52:43 -0700 | [diff] [blame] | 4396 | for (var i = 0; i < 6; ++ i) { frags2[i] = frags[i + 1]; } |
| 4397 | drawQuad(frags2[0], frags2[1], frags2[2], frags2[3], |
| 4398 | frags2[4], frags2[5]); |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 4399 | break; |
caryclark | 1049f12 | 2015-04-20 08:31:59 -0700 | [diff] [blame] | 4400 | case PATH_CONIC: |
| 4401 | for (var i = 0; i < 7; ++ i) { frags2[i] = frags[i + 1]; } |
| 4402 | drawConicWithQuads(frags2[0], frags2[1], frags2[2], frags2[3], |
| 4403 | frags2[4], frags2[5], frags2[6]); |
| 4404 | break; |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 4405 | case PATH_CUBIC: |
caryclark | 5435929 | 2015-03-26 07:52:43 -0700 | [diff] [blame] | 4406 | for (var i = 0; i < 8; ++ i) { frags2[i] = frags[i + 1]; } |
| 4407 | drawCubic(frags2[0], frags2[1], frags2[2], frags2[3], |
| 4408 | frags2[4], frags2[5], frags2[6], frags2[7]); |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 4409 | break; |
| 4410 | default: |
caryclark | 26ad22a | 2015-10-16 09:03:38 -0700 | [diff] [blame] | 4411 | console.log("unknown " + recType + " frag type: " + fragType); |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 4412 | throw "stop execution"; |
| 4413 | } |
| 4414 | if (collect_bounds) { |
| 4415 | break; |
| 4416 | } |
caryclark | 5435929 | 2015-03-26 07:52:43 -0700 | [diff] [blame] | 4417 | drawCurveSpecials(test, frags2, fragType); |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 4418 | break; |
| 4419 | case REC_TYPE_OP: |
| 4420 | switch (fragType) { |
| 4421 | case OP_INTERSECT: opLetter = 'I'; break; |
| 4422 | case OP_DIFFERENCE: opLetter = 'D'; break; |
| 4423 | case OP_UNION: opLetter = 'U'; break; |
| 4424 | case OP_XOR: opLetter = 'X'; break; |
| 4425 | default: |
| 4426 | console.log("unknown REC_TYPE_OP frag type: " + fragType); |
| 4427 | throw "stop execution"; |
| 4428 | } |
| 4429 | break; |
| 4430 | case REC_TYPE_ACTIVE: |
| 4431 | if (!draw_active || (step_limit > 0 && tIndex < lastActive)) { |
| 4432 | continue; |
| 4433 | } |
| 4434 | var x1 = frags[SPAN_X1]; |
| 4435 | var y1 = frags[SPAN_Y1]; |
| 4436 | var x2 = frags[SPAN_X2]; |
| 4437 | var y2 = frags[SPAN_Y2]; |
caryclark | 55888e4 | 2016-07-18 10:01:36 -0700 | [diff] [blame] | 4438 | var x3, y3, x3, y4, w; |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 4439 | ctx.lineWidth = 3; |
| 4440 | ctx.strokeStyle = "rgba(0,0,255, 0.3)"; |
| 4441 | focus_enabled = true; |
| 4442 | switch (fragType) { |
| 4443 | case ACTIVE_LINE_SPAN: |
caryclark | 55888e4 | 2016-07-18 10:01:36 -0700 | [diff] [blame] | 4444 | drawLine(x1, y1, x2, y2); |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 4445 | if (draw_id) { |
caryclark | 55888e4 | 2016-07-18 10:01:36 -0700 | [diff] [blame] | 4446 | drawLineID(frags[0], x1, y1, x2, y2); |
| 4447 | } |
| 4448 | if (pt_labels) { |
| 4449 | var curve = [x1, y1, x2, y2]; |
| 4450 | ctx.fillStyle = "blue"; |
| 4451 | drawPoints(curve, PATH_LINE, pt_labels == 2); |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 4452 | } |
| 4453 | break; |
| 4454 | case ACTIVE_QUAD_SPAN: |
| 4455 | x3 = frags[SPAN_X3]; |
| 4456 | y3 = frags[SPAN_Y3]; |
caryclark | 55888e4 | 2016-07-18 10:01:36 -0700 | [diff] [blame] | 4457 | drawQuad(x1, y1, x2, y2, x3, y3); |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 4458 | if (draw_id) { |
caryclark | 55888e4 | 2016-07-18 10:01:36 -0700 | [diff] [blame] | 4459 | drawQuadID(frags[0], x1, y1, x2, y2, x3, y3); |
| 4460 | } |
| 4461 | if (pt_labels) { |
| 4462 | var curve = [x1, y1, x2, y2, x3, y3]; |
| 4463 | ctx.fillStyle = "blue"; |
| 4464 | drawPoints(curve, PATH_QUAD, pt_labels == 2); |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 4465 | } |
| 4466 | break; |
caryclark | 1049f12 | 2015-04-20 08:31:59 -0700 | [diff] [blame] | 4467 | case ACTIVE_CONIC_SPAN: |
| 4468 | x3 = frags[SPAN_X3]; |
| 4469 | y3 = frags[SPAN_Y3]; |
caryclark | 1049f12 | 2015-04-20 08:31:59 -0700 | [diff] [blame] | 4470 | w = frags[SPAN_K_W]; |
caryclark | 55888e4 | 2016-07-18 10:01:36 -0700 | [diff] [blame] | 4471 | drawConicWithQuads(x1, y1, x2, y2, x3, y3, w); |
caryclark | 1049f12 | 2015-04-20 08:31:59 -0700 | [diff] [blame] | 4472 | if (draw_id) { |
caryclark | 55888e4 | 2016-07-18 10:01:36 -0700 | [diff] [blame] | 4473 | drawConicID(frags[0], x1, y1, x2, y2, x3, y3, w); |
| 4474 | } |
| 4475 | if (pt_labels) { |
| 4476 | var curve = [x1, y1, x2, y2, x3, y3, w]; |
| 4477 | ctx.fillStyle = "blue"; |
| 4478 | drawPoints(curve, PATH_CONIC, pt_labels == 2); |
caryclark | 1049f12 | 2015-04-20 08:31:59 -0700 | [diff] [blame] | 4479 | } |
| 4480 | break; |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 4481 | case ACTIVE_CUBIC_SPAN: |
| 4482 | x3 = frags[SPAN_X3]; |
| 4483 | y3 = frags[SPAN_Y3]; |
| 4484 | x4 = frags[SPAN_X4]; |
| 4485 | y4 = frags[SPAN_Y4]; |
caryclark | 55888e4 | 2016-07-18 10:01:36 -0700 | [diff] [blame] | 4486 | drawCubic(x1, y1, x2, y2, x3, y3, x4, y4); |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 4487 | if (draw_id) { |
caryclark | 55888e4 | 2016-07-18 10:01:36 -0700 | [diff] [blame] | 4488 | drawCubicID(frags[0], x1, y1, x2, y2, x3, y3, x4, y4); |
| 4489 | } |
| 4490 | if (pt_labels) { |
| 4491 | var curve = [x1, y1, x2, y2, x3, y3, x4, y4]; |
| 4492 | ctx.fillStyle = "blue"; |
| 4493 | drawPoints(curve, PATH_CUBIC, pt_labels == 2); |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 4494 | } |
| 4495 | break; |
| 4496 | default: |
| 4497 | console.log("unknown REC_TYPE_ACTIVE frag type: " + fragType); |
| 4498 | throw "stop execution"; |
| 4499 | } |
| 4500 | break; |
| 4501 | case REC_TYPE_ACTIVE_OP: |
| 4502 | if (!draw_op || (step_limit > 0 && tIndex < lastOp)) { |
| 4503 | continue; |
| 4504 | } |
| 4505 | focus_enabled = true; |
| 4506 | ctx.lineWidth = 3; |
| 4507 | var activeSpan = frags[7] == "1"; |
| 4508 | ctx.strokeStyle = activeSpan ? "rgba(45,160,0, 0.3)" : "rgba(255,45,0, 0.5)"; |
| 4509 | var curve = curvePartialByID(test, frags[0], frags[1], frags[2]); |
| 4510 | drawCurve(curve); |
| 4511 | if (draw_op > 1) { |
| 4512 | drawArc(curve, false, frags[3], frags[4]); |
| 4513 | drawArc(curve, true, frags[5], frags[6]); |
| 4514 | } |
| 4515 | break; |
| 4516 | case REC_TYPE_ADD: |
| 4517 | if (!draw_add) { |
| 4518 | continue; |
| 4519 | } |
| 4520 | ctx.lineWidth = 3; |
| 4521 | ctx.strokeStyle = closeCount == 0 ? "rgba(0,0,255, 0.3)" |
| 4522 | : closeCount == 1 ? "rgba(0,127,0, 0.3)" |
| 4523 | : closeCount == 2 ? "rgba(0,127,127, 0.3)" |
| 4524 | : closeCount == 3 ? "rgba(127,127,0, 0.3)" |
| 4525 | : "rgba(127,0,127, 0.3)"; |
| 4526 | focus_enabled = true; |
| 4527 | switch (fragType) { |
| 4528 | case ADD_MOVETO: |
| 4529 | break; |
| 4530 | case ADD_LINETO: |
| 4531 | if (step_limit == 0 || tIndex >= lastAdd) { |
| 4532 | drawLine(frags[0], frags[1], frags[2], frags[3]); |
| 4533 | } |
| 4534 | break; |
| 4535 | case ADD_QUADTO: |
| 4536 | if (step_limit == 0 || tIndex >= lastAdd) { |
| 4537 | drawQuad(frags[0], frags[1], frags[2], frags[3], frags[4], frags[5]); |
| 4538 | } |
| 4539 | break; |
caryclark | 1049f12 | 2015-04-20 08:31:59 -0700 | [diff] [blame] | 4540 | case ADD_CONICTO: |
| 4541 | if (step_limit == 0 || tIndex >= lastAdd) { |
| 4542 | drawConicWithQuads(frags[0], frags[1], frags[2], frags[3], |
| 4543 | frags[4], frags[5], frags[6]); |
| 4544 | } |
| 4545 | break; |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 4546 | case ADD_CUBICTO: |
| 4547 | if (step_limit == 0 || tIndex >= lastAdd) { |
| 4548 | drawCubic(frags[0], frags[1], frags[2], frags[3], |
| 4549 | frags[4], frags[5], frags[6], frags[7]); |
| 4550 | } |
| 4551 | break; |
| 4552 | case ADD_CLOSE: |
| 4553 | ++closeCount; |
| 4554 | break; |
| 4555 | case ADD_FILL: |
| 4556 | break; |
| 4557 | default: |
| 4558 | console.log("unknown REC_TYPE_ADD frag type: " + fragType); |
| 4559 | throw "stop execution"; |
| 4560 | } |
| 4561 | break; |
| 4562 | case REC_TYPE_ANGLE: |
caryclark | 5435929 | 2015-03-26 07:52:43 -0700 | [diff] [blame] | 4563 | angleBetween = frags[18] == "T"; |
| 4564 | afterIndex = 0; |
| 4565 | if (draw_angle == 0 || draw_angle == 3 || (step_limit > 0 && tIndex < lastAngle)) { |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 4566 | continue; |
| 4567 | } |
| 4568 | focus_enabled = true; |
| 4569 | ctx.lineWidth = 3; |
| 4570 | ctx.strokeStyle = "rgba(127,45,127, 0.3)"; |
caryclark | 5435929 | 2015-03-26 07:52:43 -0700 | [diff] [blame] | 4571 | var leftCurve = curvePartialByID(test, frags[0], frags[4], frags[5]); |
| 4572 | var midCurve = curvePartialByID(test, frags[6], frags[10], frags[11]); |
| 4573 | var rightCurve = curvePartialByID(test, frags[12], frags[16], frags[17]); |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 4574 | drawCurve(leftCurve); |
| 4575 | drawCurve(rightCurve); |
caryclark | 5435929 | 2015-03-26 07:52:43 -0700 | [diff] [blame] | 4576 | 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] | 4577 | drawCurve(midCurve); |
| 4578 | if (draw_angle > 1) { |
Cary Clark | ff11428 | 2016-12-14 11:56:16 -0500 | [diff] [blame] | 4579 | drawVisibleOrder(leftCurve, 'L'); |
| 4580 | drawVisibleOrder(rightCurve, 'R'); |
| 4581 | } |
| 4582 | if (draw_id) {
|
| 4583 | drawVisibleID(leftCurve, 0.5, frags[0]);
|
| 4584 | drawVisibleID(midCurve, 0.5, frags[6]);
|
| 4585 | drawVisibleID(rightCurve, 0.5, frags[12]);
|
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 4586 | } |
| 4587 | break; |
caryclark | 5435929 | 2015-03-26 07:52:43 -0700 | [diff] [blame] | 4588 | case REC_TYPE_AFTERPART: |
| 4589 | if (draw_angle != 3 || (step_limit > 0 && tIndex < lastAngle)) { |
| 4590 | continue; |
| 4591 | } |
| 4592 | ctx.strokeStyle = afterIndex == 0 ? "rgba(255,0,0, 1.0)" |
| 4593 | : (afterIndex == 1) == angleBetween ? "rgba(0,128,0, 1.0)" |
Cary Clark | ff11428 | 2016-12-14 11:56:16 -0500 | [diff] [blame] | 4594 | : "rgba(0,0,255, 1.0)"; |
| 4595 | var curve; |
| 4596 | var id; |
caryclark | 5435929 | 2015-03-26 07:52:43 -0700 | [diff] [blame] | 4597 | switch (fragType) { |
| 4598 | case PATH_LINE: |
Cary Clark | ff11428 | 2016-12-14 11:56:16 -0500 | [diff] [blame] | 4599 | curve = [ frags[0], frags[1], frags[2], frags[3] ]; |
| 4600 | id = frags[4]; |
caryclark | 5435929 | 2015-03-26 07:52:43 -0700 | [diff] [blame] | 4601 | break; |
| 4602 | case PATH_QUAD: |
Cary Clark | ff11428 | 2016-12-14 11:56:16 -0500 | [diff] [blame] | 4603 | curve = [ frags[0], frags[1], frags[2], frags[3], |
| 4604 | frags[4], frags[5] ]; |
| 4605 | id = frags[6]; |
caryclark | 5435929 | 2015-03-26 07:52:43 -0700 | [diff] [blame] | 4606 | break; |
caryclark | 1049f12 | 2015-04-20 08:31:59 -0700 | [diff] [blame] | 4607 | case PATH_CONIC: |
Cary Clark | ff11428 | 2016-12-14 11:56:16 -0500 | [diff] [blame] | 4608 | curve = [ frags[0], frags[1], frags[2], frags[3], |
| 4609 | frags[4], frags[5], frags[6] ]; |
| 4610 | id = frags[7]; |
caryclark | 1049f12 | 2015-04-20 08:31:59 -0700 | [diff] [blame] | 4611 | break; |
caryclark | 5435929 | 2015-03-26 07:52:43 -0700 | [diff] [blame] | 4612 | case PATH_CUBIC: |
Cary Clark | ff11428 | 2016-12-14 11:56:16 -0500 | [diff] [blame] | 4613 | curve = [ frags[0], frags[1], frags[2], frags[3], |
| 4614 | frags[4], frags[5], frags[6], frags[7] ]; |
| 4615 | id = frags[8]; |
caryclark | 5435929 | 2015-03-26 07:52:43 -0700 | [diff] [blame] | 4616 | break; |
| 4617 | default: |
| 4618 | console.log("unknown REC_TYPE_AFTERPART frag type: " + fragType); |
| 4619 | throw "stop execution"; |
| 4620 | } |
Cary Clark | ff11428 | 2016-12-14 11:56:16 -0500 | [diff] [blame] | 4621 | drawCurve(curve); |
| 4622 | if (draw_id) {
|
| 4623 | drawVisibleID(curve, 0.5, id);
|
| 4624 | } |
caryclark | 5435929 | 2015-03-26 07:52:43 -0700 | [diff] [blame] | 4625 | ++afterIndex; |
| 4626 | break; |
caryclark | 624637c | 2015-05-11 07:21:27 -0700 | [diff] [blame] | 4627 | case REC_TYPE_COINCIDENCE: |
| 4628 | if (!draw_coincidence || (step_limit > 0 && tIndex < lastCoin)) { |
| 4629 | continue; |
| 4630 | } |
| 4631 | focus_enabled = true; |
| 4632 | ctx.lineWidth = 3; |
| 4633 | ctx.strokeStyle = "rgba(127,45,63, 0.3)"; |
| 4634 | var curve = curvePartialByID(test, frags[0], frags[1], frags[2]); |
| 4635 | drawCurve(curve); |
| 4636 | break; |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 4637 | case REC_TYPE_SECT: |
| 4638 | if (!draw_intersection) { |
| 4639 | continue; |
| 4640 | } |
| 4641 | if (draw_intersection != 1 && (step_limit > 0 && tIndex < lastSect)) { |
| 4642 | continue; |
| 4643 | } |
| 4644 | // draw_intersection == 1 : show all |
| 4645 | // draw_intersection == 2 : step == 0 ? show all : show intersection line #step |
| 4646 | // draw_intersection == 3 : step == 0 ? show all : show intersection #step |
| 4647 | ctx.lineWidth = 1; |
| 4648 | ctx.strokeStyle = "rgba(0,0,255, 0.3)"; |
| 4649 | ctx.fillStyle = "blue"; |
| 4650 | focus_enabled = true; |
| 4651 | var f = []; |
| 4652 | var c1s; |
| 4653 | var c1l; |
| 4654 | var c2s; |
| 4655 | var c2l; |
| 4656 | switch (fragType) { |
| 4657 | case INTERSECT_LINE: |
| 4658 | f.push(5, 6, 0, 7); |
| 4659 | c1s = 1; c1l = 4; c2s = 8; c2l = 4; |
| 4660 | break; |
| 4661 | case INTERSECT_LINE_2: |
| 4662 | f.push(5, 6, 0, 10); |
| 4663 | f.push(8, 9, 7, 15); |
| 4664 | c1s = 1; c1l = 4; c2s = 11; c2l = 4; |
| 4665 | break; |
| 4666 | case INTERSECT_LINE_NO: |
| 4667 | c1s = 0; c1l = 4; c2s = 4; c2l = 4; |
| 4668 | break; |
| 4669 | case INTERSECT_QUAD_LINE: |
| 4670 | f.push(7, 8, 0, 9); |
| 4671 | c1s = 1; c1l = 6; c2s = 10; c2l = 4; |
| 4672 | break; |
| 4673 | case INTERSECT_QUAD_LINE_2: |
| 4674 | f.push(7, 8, 0, 12); |
| 4675 | f.push(10, 11, 9, 17); |
| 4676 | c1s = 1; c1l = 6; c2s = 13; c2l = 4; |
| 4677 | break; |
| 4678 | case INTERSECT_QUAD_LINE_NO: |
| 4679 | c1s = 0; c1l = 6; c2s = 6; c2l = 4; |
| 4680 | break; |
| 4681 | case INTERSECT_QUAD: |
| 4682 | f.push(7, 8, 0, 9); |
| 4683 | c1s = 1; c1l = 6; c2s = 10; c2l = 6; |
| 4684 | break; |
| 4685 | case INTERSECT_QUAD_2: |
| 4686 | f.push(7, 8, 0, 12); |
| 4687 | f.push(10, 11, 9, 19); |
| 4688 | c1s = 1; c1l = 6; c2s = 13; c2l = 6; |
| 4689 | break; |
| 4690 | case INTERSECT_QUAD_NO: |
| 4691 | c1s = 0; c1l = 6; c2s = 6; c2l = 6; |
| 4692 | break; |
caryclark | 1049f12 | 2015-04-20 08:31:59 -0700 | [diff] [blame] | 4693 | case INTERSECT_CONIC_LINE: |
| 4694 | f.push(8, 9, 0, 10); |
| 4695 | c1s = 1; c1l = 7; c2s = 11; c2l = 4; |
| 4696 | break; |
| 4697 | case INTERSECT_CONIC_LINE_2: |
| 4698 | f.push(8, 9, 0, 12); |
| 4699 | f.push(11, 12, 10, 18); |
| 4700 | c1s = 1; c1l = 7; c2s = 14; c2l = 4; |
| 4701 | break; |
| 4702 | case INTERSECT_CONIC_LINE_NO: |
| 4703 | c1s = 0; c1l = 7; c2s = 7; c2l = 4; |
| 4704 | break; |
caryclark | 55888e4 | 2016-07-18 10:01:36 -0700 | [diff] [blame] | 4705 | case INTERSECT_CONIC_QUAD: |
| 4706 | f.push(8, 9, 0, 10); |
| 4707 | c1s = 1; c1l = 7; c2s = 11; c2l = 6; |
| 4708 | break; |
| 4709 | case INTERSECT_CONIC_QUAD_2: |
| 4710 | f.push(8, 9, 0, 12); |
| 4711 | f.push(11, 12, 10, 18); |
| 4712 | c1s = 1; c1l = 7; c2s = 14; c2l = 6; |
| 4713 | break; |
caryclark | 6c3b9cd | 2016-09-26 05:36:58 -0700 | [diff] [blame] | 4714 | case INTERSECT_CONIC_QUAD_3: |
| 4715 | f.push(8, 9, 0, 15); |
| 4716 | f.push(11, 12, 10, 21); |
| 4717 | f.push(14, 15, 13, 22); |
| 4718 | c1s = 1; c1l = 7; c2s = 17; c2l = 6; |
| 4719 | break; |
| 4720 | case INTERSECT_CONIC_QUAD_4: |
| 4721 | f.push(8, 9, 0, 18); |
| 4722 | f.push(11, 12, 10, 24); |
| 4723 | f.push(14, 15, 13, 25); |
| 4724 | f.push(17, 18, 16, 26); |
| 4725 | c1s = 1; c1l = 7; c2s = 20; c2l = 6; |
| 4726 | break; |
caryclark | 55888e4 | 2016-07-18 10:01:36 -0700 | [diff] [blame] | 4727 | case INTERSECT_CONIC_QUAD_NO: |
| 4728 | c1s = 0; c1l = 7; c2s = 7; c2l = 6; |
| 4729 | break; |
caryclark | 1049f12 | 2015-04-20 08:31:59 -0700 | [diff] [blame] | 4730 | case INTERSECT_CONIC: |
| 4731 | f.push(8, 9, 0, 10); |
| 4732 | c1s = 1; c1l = 7; c2s = 11; c2l = 7; |
| 4733 | break; |
| 4734 | case INTERSECT_CONIC_2: |
| 4735 | f.push(8, 9, 0, 13); |
| 4736 | f.push(11, 12, 10, 21); |
| 4737 | c1s = 1; c1l = 7; c2s = 14; c2l = 7; |
| 4738 | break; |
| 4739 | case INTERSECT_CONIC_NO: |
| 4740 | c1s = 0; c1l = 7; c2s = 7; c2l = 7; |
| 4741 | break; |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 4742 | case INTERSECT_SELF_CUBIC: |
| 4743 | f.push(9, 10, 0, 11); |
| 4744 | c1s = 1; c1l = 8; c2s = 0; c2l = 0; |
| 4745 | break; |
| 4746 | case INTERSECT_SELF_CUBIC_NO: |
| 4747 | c1s = 0; c1l = 8; c2s = 0; c2l = 0; |
| 4748 | break; |
| 4749 | case INTERSECT_CUBIC_LINE: |
| 4750 | f.push(9, 10, 0, 11); |
| 4751 | c1s = 1; c1l = 8; c2s = 12; c2l = 4; |
| 4752 | break; |
| 4753 | case INTERSECT_CUBIC_LINE_2: |
| 4754 | f.push(9, 10, 0, 14); |
| 4755 | f.push(12, 13, 11, 19); |
| 4756 | c1s = 1; c1l = 8; c2s = 15; c2l = 4; |
| 4757 | break; |
| 4758 | case INTERSECT_CUBIC_LINE_3: |
| 4759 | f.push(9, 10, 0, 17); |
| 4760 | f.push(12, 13, 11, 22); |
| 4761 | f.push(15, 16, 14, 23); |
| 4762 | c1s = 1; c1l = 8; c2s = 18; c2l = 4; |
| 4763 | break; |
| 4764 | case INTERSECT_CUBIC_QUAD_NO: |
| 4765 | c1s = 0; c1l = 8; c2s = 8; c2l = 6; |
| 4766 | break; |
| 4767 | case INTERSECT_CUBIC_QUAD: |
| 4768 | f.push(9, 10, 0, 11); |
| 4769 | c1s = 1; c1l = 8; c2s = 12; c2l = 6; |
| 4770 | break; |
| 4771 | case INTERSECT_CUBIC_QUAD_2: |
| 4772 | f.push(9, 10, 0, 14); |
| 4773 | f.push(12, 13, 11, 21); |
| 4774 | c1s = 1; c1l = 8; c2s = 15; c2l = 6; |
| 4775 | break; |
| 4776 | case INTERSECT_CUBIC_QUAD_3: |
| 4777 | f.push(9, 10, 0, 17); |
| 4778 | f.push(12, 13, 11, 24); |
| 4779 | f.push(15, 16, 14, 25); |
| 4780 | c1s = 1; c1l = 8; c2s = 18; c2l = 6; |
| 4781 | break; |
| 4782 | case INTERSECT_CUBIC_QUAD_4: |
| 4783 | f.push(9, 10, 0, 20); |
| 4784 | f.push(12, 13, 11, 27); |
| 4785 | f.push(15, 16, 14, 28); |
| 4786 | f.push(18, 19, 17, 29); |
| 4787 | c1s = 1; c1l = 8; c2s = 21; c2l = 6; |
| 4788 | break; |
| 4789 | case INTERSECT_CUBIC_LINE_NO: |
| 4790 | c1s = 0; c1l = 8; c2s = 8; c2l = 4; |
| 4791 | break; |
| 4792 | case INTERSECT_CUBIC: |
| 4793 | f.push(9, 10, 0, 11); |
| 4794 | c1s = 1; c1l = 8; c2s = 12; c2l = 8; |
| 4795 | break; |
| 4796 | case INTERSECT_CUBIC_2: |
| 4797 | f.push(9, 10, 0, 14); |
| 4798 | f.push(12, 13, 11, 23); |
| 4799 | c1s = 1; c1l = 8; c2s = 15; c2l = 8; |
| 4800 | break; |
| 4801 | case INTERSECT_CUBIC_3: |
| 4802 | f.push(9, 10, 0, 17); |
| 4803 | f.push(12, 13, 11, 26); |
| 4804 | f.push(15, 16, 14, 27); |
| 4805 | c1s = 1; c1l = 8; c2s = 18; c2l = 8; |
| 4806 | break; |
| 4807 | case INTERSECT_CUBIC_4: |
| 4808 | f.push(9, 10, 0, 20); |
| 4809 | f.push(12, 13, 11, 29); |
| 4810 | f.push(15, 16, 14, 30); |
| 4811 | f.push(18, 19, 17, 31); |
| 4812 | c1s = 1; c1l = 8; c2s = 21; c2l = 8; |
| 4813 | break; |
| 4814 | case INTERSECT_CUBIC_NO: |
| 4815 | c1s = 0; c1l = 8; c2s = 8; c2l = 8; |
| 4816 | break; |
| 4817 | default: |
| 4818 | console.log("unknown REC_TYPE_SECT frag type: " + fragType); |
| 4819 | throw "stop execution"; |
| 4820 | } |
| 4821 | if (draw_intersection != 1) { |
| 4822 | var id = -1; |
| 4823 | var curve; |
| 4824 | switch (c1l) { |
caryclark | 55888e4 | 2016-07-18 10:01:36 -0700 | [diff] [blame] | 4825 | case 4: |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 4826 | drawLine(frags[c1s], frags[c1s + 1], frags[c1s + 2], frags[c1s + 3]); |
| 4827 | if (draw_id) { |
| 4828 | curve = [frags[c1s], frags[c1s + 1], frags[c1s + 2], frags[c1s + 3]]; |
| 4829 | id = idByCurve(test, curve, PATH_LINE); |
| 4830 | } |
| 4831 | break; |
| 4832 | case 6: |
| 4833 | drawQuad(frags[c1s], frags[c1s + 1], frags[c1s + 2], frags[c1s + 3], |
| 4834 | frags[c1s + 4], frags[c1s + 5]); |
| 4835 | if (draw_id) { |
| 4836 | curve = [frags[c1s], frags[c1s + 1], frags[c1s + 2], frags[c1s + 3], |
| 4837 | frags[c1s + 4], frags[c1s + 5]]; |
| 4838 | id = idByCurve(test, curve, PATH_QUAD); |
| 4839 | } |
| 4840 | break; |
caryclark | 1049f12 | 2015-04-20 08:31:59 -0700 | [diff] [blame] | 4841 | case 7: |
| 4842 | drawConicWithQuads(frags[c1s], frags[c1s + 1], frags[c1s + 2], frags[c1s + 3], |
| 4843 | frags[c1s + 4], frags[c1s + 5], frags[c1s + 6]); |
| 4844 | if (draw_id) { |
| 4845 | curve = [frags[c1s], frags[c1s + 1], frags[c1s + 2], frags[c1s + 3], |
| 4846 | frags[c1s + 4], frags[c1s + 5], frags[c1s + 6]]; |
| 4847 | id = idByCurve(test, curve, PATH_CONIC); |
| 4848 | } |
| 4849 | break; |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 4850 | case 8: |
| 4851 | drawCubic(frags[c1s], frags[c1s + 1], frags[c1s + 2], frags[c1s + 3], |
| 4852 | frags[c1s + 4], frags[c1s + 5], frags[c1s + 6], frags[c1s + 7]); |
| 4853 | if (draw_id) { |
| 4854 | curve = [frags[c1s], frags[c1s + 1], frags[c1s + 2], frags[c1s + 3], |
| 4855 | frags[c1s + 4], frags[c1s + 5], frags[c1s + 6], frags[c1s + 7]]; |
| 4856 | id = idByCurve(test, curve, PATH_CUBIC); |
| 4857 | } |
| 4858 | break; |
| 4859 | } |
| 4860 | if (id >= 0) { |
Cary Clark | ff11428 | 2016-12-14 11:56:16 -0500 | [diff] [blame] | 4861 | drawVisibleID(curve, 0.5, id); |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 4862 | } |
| 4863 | id = -1; |
| 4864 | switch (c2l) { |
| 4865 | case 0: |
| 4866 | break; |
caryclark | 55888e4 | 2016-07-18 10:01:36 -0700 | [diff] [blame] | 4867 | case 4: |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 4868 | drawLine(frags[c2s], frags[c2s + 1], frags[c2s + 2], frags[c2s + 3]); |
| 4869 | if (draw_id) { |
| 4870 | curve = [frags[c2s], frags[c2s + 1], frags[c2s + 2], frags[c2s + 3]]; |
| 4871 | id = idByCurve(test, curve, PATH_LINE); |
| 4872 | } |
| 4873 | break; |
| 4874 | case 6: |
| 4875 | drawQuad(frags[c2s], frags[c2s + 1], frags[c2s + 2], frags[c2s + 3], |
| 4876 | frags[c2s + 4], frags[c2s + 5]); |
| 4877 | if (draw_id) { |
| 4878 | curve = [frags[c2s], frags[c2s + 1], frags[c2s + 2], frags[c2s + 3], |
| 4879 | frags[c2s + 4], frags[c2s + 5]]; |
| 4880 | id = idByCurve(test, curve, PATH_QUAD); |
| 4881 | } |
| 4882 | break; |
caryclark | 1049f12 | 2015-04-20 08:31:59 -0700 | [diff] [blame] | 4883 | case 7: |
| 4884 | drawConicWithQuads(frags[c2s], frags[c2s + 1], frags[c2s + 2], frags[c2s + 3], |
| 4885 | frags[c2s + 4], frags[c2s + 5], frags[c2s + 6]); |
| 4886 | if (draw_id) { |
| 4887 | curve = [frags[c2s], frags[c2s + 1], frags[c2s + 2], frags[c2s + 3], |
| 4888 | frags[c2s + 4], frags[c2s + 5], frags[c2s + 6]]; |
| 4889 | id = idByCurve(test, curve, PATH_CONIC); |
| 4890 | } |
| 4891 | break; |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 4892 | case 8: |
| 4893 | drawCubic(frags[c2s], frags[c2s + 1], frags[c2s + 2], frags[c2s + 3], |
| 4894 | frags[c2s + 4], frags[c2s + 5], frags[c2s + 6], frags[c2s + 7]); |
| 4895 | if (draw_id) { |
| 4896 | curve = [frags[c2s], frags[c2s + 1], frags[c2s + 2], frags[c2s + 3], |
| 4897 | frags[c2s + 4], frags[c2s + 5], frags[c2s + 6], frags[c2s + 7]]; |
| 4898 | id = idByCurve(test, curve, PATH_CUBIC); |
| 4899 | } |
| 4900 | break; |
| 4901 | } |
| 4902 | if (id >= 0) { |
Cary Clark | ff11428 | 2016-12-14 11:56:16 -0500 | [diff] [blame] | 4903 | drawVisibleID(curve, 0.5, id); |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 4904 | } |
| 4905 | } |
| 4906 | if (collect_bounds) { |
| 4907 | break; |
| 4908 | } |
caryclark | 5435929 | 2015-03-26 07:52:43 -0700 | [diff] [blame] | 4909 | if (draw_intersection != 3 || step_limit == 0 || tIndex >= lastSect) { |
| 4910 | for (var idx = 0; idx < f.length; idx += 4) { |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 4911 | drawPoint(frags[f[idx]], frags[f[idx + 1]], true); |
| 4912 | } |
| 4913 | } |
| 4914 | if (!draw_intersectT) { |
| 4915 | break; |
| 4916 | } |
| 4917 | ctx.fillStyle = "red"; |
caryclark | 5435929 | 2015-03-26 07:52:43 -0700 | [diff] [blame] | 4918 | if (draw_intersection != 3 || step_limit == 0 || tIndex >= lastSect) { |
| 4919 | for (var idx = 0; idx < f.length; idx += 4) { |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 4920 | drawTAtPointUp(frags[f[idx]], frags[f[idx + 1]], frags[f[idx + 2]]); |
| 4921 | drawTAtPointDown(frags[f[idx]], frags[f[idx + 1]], frags[f[idx + 3]]); |
| 4922 | } |
| 4923 | } |
| 4924 | break; |
| 4925 | case REC_TYPE_SORT: |
| 4926 | if (!draw_sort || (step_limit > 0 && tIndex < lastSort)) { |
| 4927 | continue; |
| 4928 | } |
| 4929 | ctx.lineWidth = 3; |
| 4930 | ctx.strokeStyle = "rgba(127,127,0, 0.5)"; |
| 4931 | focus_enabled = true; |
| 4932 | switch (fragType) { |
| 4933 | case SORT_UNARY: |
| 4934 | case SORT_BINARY: |
| 4935 | var curve = curvePartialByID(test, frags[0], frags[6], frags[8]); |
| 4936 | drawCurve(curve); |
| 4937 | break; |
| 4938 | default: |
| 4939 | console.log("unknown REC_TYPE_SORT frag type: " + fragType); |
| 4940 | throw "stop execution"; |
| 4941 | } |
| 4942 | break; |
caryclark | 03b03ca | 2015-04-23 09:13:37 -0700 | [diff] [blame] | 4943 | case REC_TYPE_TOP: |
| 4944 | if (!draw_top || (step_limit > 0 && tIndex < lastTop)) { |
| 4945 | continue; |
| 4946 | } |
| 4947 | ctx.lineWidth = 3; |
| 4948 | ctx.strokeStyle = "rgba(127,127,0, 0.5)"; |
| 4949 | focus_enabled = true; |
| 4950 | { |
| 4951 | var curve = curvePartialByID(test, frags[0], frags[1], frags[2]); |
| 4952 | drawCurve(curve); |
| 4953 | var type = PATH_LINE + (curve.length / 2 - 2); |
| 4954 | var mid = pointAtT(curve, type, 0.5); |
| 4955 | var d = dxy_at_t(curve, type, 0.5); |
| 4956 | drawArrow(mid.x, mid.y, d.x, d.y, 0.3); |
| 4957 | } |
| 4958 | break; |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 4959 | case REC_TYPE_MARK: |
| 4960 | if (!draw_mark || (step_limit > 0 && tIndex < lastMark)) { |
| 4961 | continue; |
| 4962 | } |
| 4963 | ctx.lineWidth = 3; |
| 4964 | ctx.strokeStyle = fragType >= MARK_DONE_LINE ? |
| 4965 | "rgba(127,0,127, 0.5)" : "rgba(127,127,0, 0.5)"; |
| 4966 | focus_enabled = true; |
| 4967 | switch (fragType) { |
| 4968 | case MARK_LINE: |
| 4969 | case MARK_DONE_LINE: |
| 4970 | case MARK_UNSORTABLE_LINE: |
| 4971 | case MARK_SIMPLE_LINE: |
| 4972 | case MARK_SIMPLE_DONE_LINE: |
| 4973 | case MARK_DONE_UNARY_LINE: |
| 4974 | drawLinePartial(frags[1], frags[2], frags[3], frags[4], |
| 4975 | frags[5], frags[9]); |
| 4976 | if (draw_id) { |
| 4977 | drawLinePartialID(frags[0], frags[1], frags[2], frags[3], frags[4], |
| 4978 | frags[5], frags[9]); |
| 4979 | } |
| 4980 | break; |
| 4981 | case MARK_QUAD: |
| 4982 | case MARK_DONE_QUAD: |
| 4983 | case MARK_UNSORTABLE_QUAD: |
| 4984 | case MARK_SIMPLE_QUAD: |
| 4985 | case MARK_SIMPLE_DONE_QUAD: |
| 4986 | case MARK_DONE_UNARY_QUAD: |
| 4987 | drawQuadPartial(frags[1], frags[2], frags[3], frags[4], |
| 4988 | frags[5], frags[6], frags[7], frags[11]); |
| 4989 | if (draw_id) { |
| 4990 | drawQuadPartialID(frags[0], frags[1], frags[2], frags[3], frags[4], |
| 4991 | frags[5], frags[6], frags[7], frags[11]); |
| 4992 | } |
| 4993 | break; |
| 4994 | case MARK_CUBIC: |
| 4995 | case MARK_DONE_CUBIC: |
| 4996 | case MARK_UNSORTABLE_CUBIC: |
| 4997 | case MARK_SIMPLE_CUBIC: |
| 4998 | case MARK_SIMPLE_DONE_CUBIC: |
| 4999 | case MARK_DONE_UNARY_CUBIC: |
| 5000 | drawCubicPartial(frags[1], frags[2], frags[3], frags[4], |
| 5001 | frags[5], frags[6], frags[7], frags[8], frags[9], frags[13]); |
| 5002 | if (draw_id) { |
| 5003 | drawCubicPartialID(frags[0], frags[1], frags[2], frags[3], frags[4], |
| 5004 | frags[5], frags[6], frags[7], frags[8], frags[9], frags[13]); |
| 5005 | } |
| 5006 | break; |
| 5007 | case MARK_ANGLE_LAST: |
| 5008 | // FIXME: ignored for now |
| 5009 | break; |
| 5010 | default: |
| 5011 | console.log("unknown REC_TYPE_MARK frag type: " + fragType); |
| 5012 | throw "stop execution"; |
| 5013 | } |
| 5014 | break; |
| 5015 | default: |
| 5016 | continue; |
| 5017 | } |
| 5018 | } |
| 5019 | switch (recType) { |
| 5020 | case REC_TYPE_SORT: |
| 5021 | if (!draw_sort || (step_limit > 0 && tIndex < lastSort)) { |
| 5022 | break; |
| 5023 | } |
| 5024 | var angles = []; // use tangent lines to describe arcs |
| 5025 | var windFrom = []; |
| 5026 | var windTo = []; |
| 5027 | var opp = []; |
| 5028 | var minXY = Number.MAX_VALUE; |
| 5029 | var partial; |
| 5030 | focus_enabled = true; |
| 5031 | var someUnsortable = false; |
| 5032 | for (var recordIndex = 0; recordIndex < records.length; recordIndex += 2) { |
| 5033 | var fragType = records[recordIndex]; |
| 5034 | var frags = records[recordIndex + 1]; |
| 5035 | var unsortable = (fragType == SORT_UNARY && frags[14]) || |
| 5036 | (fragType == SORT_BINARY && frags[16]); |
| 5037 | someUnsortable |= unsortable; |
| 5038 | switch (fragType) { |
| 5039 | case SORT_UNARY: |
| 5040 | case SORT_BINARY: |
| 5041 | partial = curvePartialByID(test, frags[0], frags[6], frags[8]); |
| 5042 | break; |
| 5043 | default: |
| 5044 | console.log("unknown REC_TYPE_SORT frag type: " + fragType); |
| 5045 | throw "stop execution"; |
| 5046 | } |
| 5047 | var dx = boundsWidth(partial); |
| 5048 | var dy = boundsHeight(partial); |
| 5049 | minXY = Math.min(minXY, dx * dx + dy * dy); |
| 5050 | if (collect_bounds) { |
| 5051 | continue; |
| 5052 | } |
| 5053 | angles.push(tangent(partial)); |
| 5054 | var from = frags[12]; |
| 5055 | var to = frags[12]; |
| 5056 | var sgn = frags[10]; |
| 5057 | if (sgn < 0) { |
| 5058 | from -= frags[11]; |
| 5059 | } else if (sgn > 0) { |
| 5060 | to -= frags[11]; |
| 5061 | } |
| 5062 | windFrom.push(from + (unsortable ? "!" : "")); |
| 5063 | windTo.push(to + (unsortable ? "!" : "")); |
| 5064 | opp.push(fragType == SORT_BINARY); |
| 5065 | if (draw_sort == 1) { |
Cary Clark | ff11428 | 2016-12-14 11:56:16 -0500 | [diff] [blame] | 5066 | drawVisibleOrder(partial, frags[12]); |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 5067 | } else { |
Cary Clark | ff11428 | 2016-12-14 11:56:16 -0500 | [diff] [blame] | 5068 | drawVisibleOrder(partial, (recordIndex / 2) + 1); |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 5069 | } |
| 5070 | } |
| 5071 | var radius = Math.sqrt(minXY) / 2 * scale; |
| 5072 | radius = Math.min(50, radius); |
| 5073 | var scaledRadius = radius / scale; |
| 5074 | var centerX = partial[0]; |
| 5075 | var centerY = partial[1]; |
| 5076 | if (collect_bounds) { |
| 5077 | if (focus_enabled) { |
| 5078 | focusXmin = Math.min(focusXmin, centerX - scaledRadius); |
| 5079 | focusYmin = Math.min(focusYmin, centerY - scaledRadius); |
| 5080 | focusXmax = Math.max(focusXmax, centerX + scaledRadius); |
| 5081 | focusYmax = Math.max(focusYmax, centerY + scaledRadius); |
| 5082 | } |
| 5083 | break; |
| 5084 | } |
| 5085 | break; |
| 5086 | default: |
| 5087 | break; |
| 5088 | } |
| 5089 | } |
| 5090 | if (collect_bounds) { |
| 5091 | return; |
| 5092 | } |
| 5093 | if (draw_log && logStart >= 0) { |
| 5094 | ctx.font = "normal 10px Arial"; |
| 5095 | ctx.textAlign = "left"; |
| 5096 | ctx.beginPath(); |
| 5097 | var top = screenHeight - 20 - (logRange + 2) * 10; |
| 5098 | ctx.rect(50, top, screenWidth - 100, (logRange + 2) * 10); |
| 5099 | ctx.fillStyle = "white"; |
| 5100 | ctx.fill(); |
| 5101 | ctx.fillStyle = "rgba(0,0,0, 0.5)"; |
| 5102 | if (logStart > 0) { |
| 5103 | ctx.fillText(lines[logStart - 1], 50, top + 8); |
| 5104 | } |
| 5105 | ctx.fillStyle = "black"; |
| 5106 | for (var idx = 0; idx < logRange; ++idx) { |
| 5107 | ctx.fillText(lines[logStart + idx], 50, top + 18 + 10 * idx); |
| 5108 | } |
| 5109 | ctx.fillStyle = "rgba(0,0,0, 0.5)"; |
| 5110 | if (logStart + logRange < lines.length) { |
| 5111 | ctx.fillText(lines[logStart + logRange], 50, top + 18 + 10 * logRange); |
| 5112 | } |
| 5113 | } |
| 5114 | if (draw_legend) { |
| 5115 | var pos = 0; |
caryclark | 624637c | 2015-05-11 07:21:27 -0700 | [diff] [blame] | 5116 | 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] | 5117 | // drawBox(pos++, "yellow", "black", opLetter, true, ''); |
| 5118 | drawBox(pos++, "rgba(0,0,255, 0.3)", "black", draw_intersection > 1 ? sectCount : sectMax2, draw_intersection, intersectionKey); |
| 5119 | drawBox(pos++, "rgba(0,0,255, 0.3)", "black", draw_add ? addCount : addMax, draw_add, addKey); |
| 5120 | drawBox(pos++, "rgba(0,0,255, 0.3)", "black", draw_active ? activeCount : activeMax, draw_active, activeKey); |
| 5121 | 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] | 5122 | 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] | 5123 | drawBox(pos++, "rgba(127,127,0, 0.3)", "black", draw_op ? opCount : opMax, draw_op, opKey); |
| 5124 | 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] | 5125 | 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] | 5126 | 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] | 5127 | drawBox(pos++, "black", "white", |
caryclark | 26ad22a | 2015-10-16 09:03:38 -0700 | [diff] [blame] | 5128 | (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] | 5129 | drawBox(pos++, "rgba(0,63,0, 0.7)", "white", |
| 5130 | (new Array('Q', 'Q', 'C', 'QC', 'Qc', 'Cq'))[draw_computed], |
| 5131 | draw_computed != 0, computedKey); |
| 5132 | drawBox(pos++, "green", "black", step_limit, drawSomething, ''); |
| 5133 | drawBox(pos++, "green", "black", stepMax, drawSomething, ''); |
| 5134 | drawBox(pos++, "rgba(255,0,0, 0.6)", "black", lastIndex, drawSomething & draw_log, ''); |
| 5135 | drawBox(pos++, "rgba(255,0,0, 0.6)", "black", test.length - 1, drawSomething & draw_log, ''); |
| 5136 | if (curve_t) { |
| 5137 | drawCurveTControl(); |
| 5138 | } |
| 5139 | ctx.font = "normal 20px Arial"; |
| 5140 | ctx.fillStyle = "rgba(0,0,0, 0.3)"; |
| 5141 | ctx.textAlign = "right"; |
| 5142 | ctx.fillText(scale.toFixed(decimal_places) + 'x' , screenWidth - 10, screenHeight - 5); |
| 5143 | } |
| 5144 | if (draw_hints) { |
| 5145 | ctx.font = "normal 10px Arial"; |
| 5146 | ctx.fillStyle = "rgba(0,0,0, 0.5)"; |
| 5147 | ctx.textAlign = "right"; |
| 5148 | var y = 4; |
| 5149 | ctx.fillText("control lines : " + controlLinesKey, ctx.screenWidthwidth - 10, pos * 50 + y++ * 10); |
| 5150 | ctx.fillText("curve t : " + curveTKey, screenWidth - 10, pos * 50 + y++ * 10); |
| 5151 | ctx.fillText("deriviatives : " + deriviativesKey, screenWidth - 10, pos * 50 + y++ * 10); |
| 5152 | ctx.fillText("intersect t : " + intersectTKey, screenWidth - 10, pos * 50 + y++ * 10); |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 5153 | ctx.fillText("log : " + logKey, screenWidth - 10, pos * 50 + y++ * 10); |
| 5154 | ctx.fillText("log curve : " + logCurvesKey, screenWidth - 10, pos * 50 + y++ * 10); |
| 5155 | ctx.fillText("mid point : " + midpointKey, screenWidth - 10, pos * 50 + y++ * 10); |
| 5156 | ctx.fillText("points : " + ptsKey, screenWidth - 10, pos * 50 + y++ * 10); |
| 5157 | ctx.fillText("sequence : " + sequenceKey, screenWidth - 10, pos * 50 + y++ * 10); |
| 5158 | ctx.fillText("xy : " + xyKey, screenWidth - 10, pos * 50 + y++ * 10); |
| 5159 | } |
| 5160 | } |
| 5161 | |
| 5162 | function drawBox(y, backC, foreC, str, enable, label) { |
| 5163 | ctx.beginPath(); |
| 5164 | ctx.fillStyle = backC; |
| 5165 | ctx.rect(screenWidth - 40, y * 50 + 10, 40, 30); |
| 5166 | ctx.fill(); |
| 5167 | ctx.font = "normal 16px Arial"; |
| 5168 | ctx.fillStyle = foreC; |
| 5169 | ctx.textAlign = "center"; |
| 5170 | ctx.fillText(str, screenWidth - 20, y * 50 + 32); |
| 5171 | if (!enable) { |
| 5172 | ctx.fillStyle = "rgba(255,255,255, 0.5)"; |
| 5173 | ctx.fill(); |
| 5174 | } |
| 5175 | if (label != '') { |
| 5176 | ctx.font = "normal 9px Arial"; |
| 5177 | ctx.fillStyle = "black"; |
| 5178 | ctx.fillText(label, screenWidth - 47, y * 50 + 40); |
| 5179 | } |
| 5180 | } |
| 5181 | |
| 5182 | function drawCurveTControl() { |
| 5183 | ctx.lineWidth = 2; |
| 5184 | ctx.strokeStyle = "rgba(0,0,0, 0.3)"; |
| 5185 | ctx.beginPath(); |
| 5186 | ctx.rect(screenWidth - 80, 40, 28, screenHeight - 80); |
| 5187 | ctx.stroke(); |
| 5188 | var ty = 40 + curveT * (screenHeight - 80); |
| 5189 | ctx.beginPath(); |
| 5190 | ctx.moveTo(screenWidth - 80, ty); |
| 5191 | ctx.lineTo(screenWidth - 85, ty - 5); |
| 5192 | ctx.lineTo(screenWidth - 85, ty + 5); |
| 5193 | ctx.lineTo(screenWidth - 80, ty); |
| 5194 | ctx.fillStyle = "rgba(0,0,0, 0.6)"; |
| 5195 | ctx.fill(); |
| 5196 | var num = curveT.toFixed(decimal_places); |
| 5197 | ctx.font = "normal 10px Arial"; |
| 5198 | ctx.textAlign = "left"; |
| 5199 | ctx.fillText(num, screenWidth - 78, ty); |
| 5200 | } |
| 5201 | |
| 5202 | function ptInTControl() { |
| 5203 | var e = window.event; |
caryclark | 55888e4 | 2016-07-18 10:01:36 -0700 | [diff] [blame] | 5204 | var tgt = e.target || e.srcElement; |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 5205 | var left = tgt.offsetLeft; |
| 5206 | var top = tgt.offsetTop; |
| 5207 | var x = (e.clientX - left); |
| 5208 | var y = (e.clientY - top); |
| 5209 | if (x < screenWidth - 80 || x > screenWidth - 50) { |
| 5210 | return false; |
| 5211 | } |
| 5212 | if (y < 40 || y > screenHeight - 80) { |
| 5213 | return false; |
| 5214 | } |
| 5215 | curveT = (y - 40) / (screenHeight - 120); |
| 5216 | if (curveT < 0 || curveT > 1) { |
| 5217 | throw "stop execution"; |
| 5218 | } |
| 5219 | return true; |
| 5220 | } |
| 5221 | |
| 5222 | function drawTop() { |
| 5223 | if (tests[testIndex] == null) { |
| 5224 | var str = testDivs[testIndex].textContent; |
| 5225 | parse_all(str); |
| 5226 | var title = testDivs[testIndex].id.toString(); |
| 5227 | testTitles[testIndex] = title; |
| 5228 | } |
| 5229 | init(tests[testIndex]); |
| 5230 | redraw(); |
| 5231 | } |
| 5232 | |
| 5233 | function redraw() { |
| 5234 | if (focus_on_selection) { |
| 5235 | collect_bounds = true; |
| 5236 | draw(tests[testIndex], testLines[testIndex], testTitles[testIndex]); |
| 5237 | collect_bounds = false; |
| 5238 | if (focusXmin < focusXmax && focusYmin < focusYmax) { |
| 5239 | setScale(focusXmin, focusXmax, focusYmin, focusYmax); |
| 5240 | } |
| 5241 | } |
| 5242 | ctx.beginPath(); |
| 5243 | ctx.fillStyle = "white"; |
| 5244 | ctx.rect(0, 0, screenWidth, screenHeight); |
| 5245 | ctx.fill(); |
| 5246 | draw(tests[testIndex], testLines[testIndex], testTitles[testIndex]); |
| 5247 | } |
| 5248 | |
| 5249 | function dumpCurvePartial(test, id, t0, t1) { |
| 5250 | var curve = curveByID(test, id); |
| 5251 | var name = ["line", "quad", "cubic"][curve.length / 2 - 2]; |
| 5252 | console.log("id=" + id + " " + name + "=" + curveToString(curve) |
| 5253 | + " t0=" + t0 + " t1=" + t1 |
| 5254 | + " partial=" + curveToString(curvePartialByID(test, id, t0, t1))); |
| 5255 | } |
| 5256 | |
| 5257 | function dumpAngleTest(test, id, t0, t1) { |
| 5258 | var curve = curveByID(test, id); |
caryclark | 55888e4 | 2016-07-18 10:01:36 -0700 | [diff] [blame] | 5259 | console.log(" { {" + curveToString(curve) + "}, " |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 5260 | + curve.length / 2 + ", " + t0 + ", " + t1 + ", {} }, //"); |
| 5261 | } |
| 5262 | |
| 5263 | function dumpLogToConsole() { |
| 5264 | if (logStart < 0) { |
| 5265 | return; |
| 5266 | } |
| 5267 | var test = tests[testIndex]; |
| 5268 | var recType = REC_TYPE_UNKNOWN; |
| 5269 | var records; |
| 5270 | for (var index = 0; index < test.length; index += 3) { |
| 5271 | var lastLineNo = test[index + 1]; |
| 5272 | if (lastLineNo >= logStart && lastLineNo < logStart + logRange) { |
| 5273 | recType = test[index]; |
| 5274 | records = test[index + 2]; |
| 5275 | break; |
| 5276 | } |
| 5277 | } |
| 5278 | if (recType == REC_TYPE_UNKNOWN) { |
| 5279 | return; |
| 5280 | } |
| 5281 | var lines = testLines[testIndex]; |
| 5282 | for (var idx = 0; idx < logRange; ++idx) { |
| 5283 | var line = lines[logStart + idx]; |
| 5284 | console.log(line); |
| 5285 | for (var recordIndex = 0; recordIndex < records.length; recordIndex += 2) { |
| 5286 | var fragType = records[recordIndex]; |
| 5287 | var frags = records[recordIndex + 1]; |
| 5288 | if (recType == REC_TYPE_ANGLE && fragType == ANGLE_AFTER) { |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 5289 | dumpCurvePartial(test, frags[0], frags[4], frags[5]); |
| 5290 | dumpCurvePartial(test, frags[6], frags[10], frags[11]); |
| 5291 | dumpCurvePartial(test, frags[12], frags[16], frags[17]); |
| 5292 | console.log("\nstatic IntersectData intersectDataSet[] = { //"); |
| 5293 | dumpAngleTest(test, frags[0], frags[4], frags[5]); |
| 5294 | dumpAngleTest(test, frags[6], frags[10], frags[11]); |
| 5295 | dumpAngleTest(test, frags[12], frags[16], frags[17]); |
| 5296 | console.log("}; //"); |
| 5297 | } |
| 5298 | } |
| 5299 | } |
| 5300 | } |
| 5301 | |
| 5302 | var activeKey = 'a'; |
| 5303 | var pathKey = 'b'; |
| 5304 | var pathBackKey = 'B'; |
| 5305 | var centerKey = 'c'; |
caryclark | 624637c | 2015-05-11 07:21:27 -0700 | [diff] [blame] | 5306 | var coincidenceKey = 'C'; |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 5307 | var addKey = 'd'; |
| 5308 | var deriviativesKey = 'f'; |
| 5309 | var angleKey = 'g'; |
| 5310 | var angleBackKey = 'G'; |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 5311 | var intersectionKey = 'i'; |
| 5312 | var intersectionBackKey = 'I'; |
| 5313 | var sequenceKey = 'j'; |
| 5314 | var midpointKey = 'k'; |
| 5315 | var logKey = 'l'; |
| 5316 | var logToConsoleKey = 'L'; |
| 5317 | var markKey = 'm'; |
| 5318 | var sortKey = 'o'; |
| 5319 | var opKey = 'p'; |
| 5320 | var opBackKey = 'P'; |
| 5321 | var computedKey = 'q'; |
| 5322 | var computedBackKey = 'Q'; |
Cary Clark | ff11428 | 2016-12-14 11:56:16 -0500 | [diff] [blame] | 5323 | var directionKey = 'r'; |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 5324 | var stepKey = 's'; |
| 5325 | var stepBackKey = 'S'; |
| 5326 | var intersectTKey = 't'; |
caryclark | 03b03ca | 2015-04-23 09:13:37 -0700 | [diff] [blame] | 5327 | var topKey = 'T'; |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 5328 | var curveTKey = 'u'; |
| 5329 | var controlLinesBackKey = 'V'; |
| 5330 | var controlLinesKey = 'v'; |
| 5331 | var ptsKey = 'x'; |
| 5332 | var xyKey = 'y'; |
| 5333 | var logCurvesKey = 'z'; |
| 5334 | var focusKey = '`'; |
| 5335 | var idKey = '.'; |
| 5336 | var retinaKey = '\\'; |
| 5337 | |
| 5338 | function doKeyPress(evt) { |
| 5339 | var char = String.fromCharCode(evt.charCode); |
| 5340 | var focusWasOn = false; |
| 5341 | switch (char) { |
| 5342 | case '0': |
| 5343 | case '1': |
| 5344 | case '2': |
| 5345 | case '3': |
| 5346 | case '4': |
| 5347 | case '5': |
| 5348 | case '6': |
| 5349 | case '7': |
| 5350 | case '8': |
| 5351 | case '9': |
| 5352 | decimal_places = char - '0'; |
| 5353 | redraw(); |
| 5354 | break; |
| 5355 | case activeKey: |
| 5356 | draw_active ^= true; |
caryclark | 55888e4 | 2016-07-18 10:01:36 -0700 | [diff] [blame] | 5357 | redraw(); |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 5358 | break; |
| 5359 | case addKey: |
| 5360 | draw_add ^= true; |
caryclark | 55888e4 | 2016-07-18 10:01:36 -0700 | [diff] [blame] | 5361 | redraw(); |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 5362 | break; |
| 5363 | case angleKey: |
caryclark | 5435929 | 2015-03-26 07:52:43 -0700 | [diff] [blame] | 5364 | draw_angle = (draw_angle + 1) % 4; |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 5365 | redraw(); |
| 5366 | break; |
| 5367 | case angleBackKey: |
| 5368 | draw_angle = (draw_angle + 2) % 3; |
| 5369 | redraw(); |
| 5370 | break; |
| 5371 | case centerKey: |
| 5372 | setScale(xmin, xmax, ymin, ymax); |
caryclark | 55888e4 | 2016-07-18 10:01:36 -0700 | [diff] [blame] | 5373 | redraw(); |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 5374 | break; |
caryclark | 624637c | 2015-05-11 07:21:27 -0700 | [diff] [blame] | 5375 | case coincidenceKey: |
| 5376 | draw_coincidence ^= true; |
| 5377 | redraw(); |
| 5378 | break; |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 5379 | case controlLinesBackKey: |
| 5380 | control_lines = (control_lines + 3) % 4; |
caryclark | 55888e4 | 2016-07-18 10:01:36 -0700 | [diff] [blame] | 5381 | redraw(); |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 5382 | break; |
| 5383 | case controlLinesKey: |
| 5384 | control_lines = (control_lines + 1) % 4; |
caryclark | 55888e4 | 2016-07-18 10:01:36 -0700 | [diff] [blame] | 5385 | redraw(); |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 5386 | break; |
| 5387 | case computedBackKey: |
| 5388 | draw_computed = (draw_computed + 5) % 6; |
caryclark | 55888e4 | 2016-07-18 10:01:36 -0700 | [diff] [blame] | 5389 | redraw(); |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 5390 | break; |
| 5391 | case computedKey: |
| 5392 | draw_computed = (draw_computed + 1) % 6; |
caryclark | 55888e4 | 2016-07-18 10:01:36 -0700 | [diff] [blame] | 5393 | redraw(); |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 5394 | break; |
| 5395 | case curveTKey: |
| 5396 | curve_t ^= true; |
| 5397 | if (curve_t) { |
| 5398 | draw_legend = true; |
| 5399 | } |
| 5400 | redraw(); |
| 5401 | break; |
| 5402 | case deriviativesKey: |
| 5403 | draw_deriviatives = (draw_deriviatives + 1) % 3; |
| 5404 | redraw(); |
| 5405 | break; |
Cary Clark | ff11428 | 2016-12-14 11:56:16 -0500 | [diff] [blame] | 5406 | case directionKey: |
| 5407 | draw_direction ^= true; |
| 5408 | redraw(); |
| 5409 | break; |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 5410 | case focusKey: |
| 5411 | focus_on_selection ^= true; |
| 5412 | setScale(xmin, xmax, ymin, ymax); |
| 5413 | redraw(); |
| 5414 | break; |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 5415 | case idKey: |
| 5416 | draw_id ^= true; |
| 5417 | redraw(); |
| 5418 | break; |
| 5419 | case intersectionBackKey: |
| 5420 | draw_intersection = (draw_intersection + 3) % 4; |
caryclark | 55888e4 | 2016-07-18 10:01:36 -0700 | [diff] [blame] | 5421 | redraw(); |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 5422 | break; |
| 5423 | case intersectionKey: |
| 5424 | draw_intersection = (draw_intersection + 1) % 4; |
caryclark | 55888e4 | 2016-07-18 10:01:36 -0700 | [diff] [blame] | 5425 | redraw(); |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 5426 | break; |
| 5427 | case intersectTKey: |
| 5428 | draw_intersectT ^= true; |
| 5429 | redraw(); |
| 5430 | break; |
| 5431 | case logCurvesKey: |
| 5432 | logCurves(tests[testIndex]); |
| 5433 | break; |
| 5434 | case logKey: |
| 5435 | draw_log ^= true; |
| 5436 | redraw(); |
| 5437 | break; |
| 5438 | case logToConsoleKey: |
| 5439 | if (draw_log) { |
| 5440 | dumpLogToConsole(); |
| 5441 | } |
| 5442 | break; |
| 5443 | case markKey: |
| 5444 | draw_mark ^= true; |
| 5445 | redraw(); |
| 5446 | break; |
| 5447 | case midpointKey: |
| 5448 | draw_midpoint ^= true; |
| 5449 | redraw(); |
| 5450 | break; |
| 5451 | case opKey: |
| 5452 | draw_op = (draw_op + 1) % 3; |
| 5453 | redraw(); |
| 5454 | break; |
| 5455 | case opBackKey: |
| 5456 | draw_op = (draw_op + 2) % 3; |
| 5457 | redraw(); |
| 5458 | break; |
| 5459 | case pathKey: |
caryclark | 26ad22a | 2015-10-16 09:03:38 -0700 | [diff] [blame] | 5460 | draw_path = (draw_path + 1) % (4 + (hasAlignedPath ? 3 : 0)); |
caryclark | 55888e4 | 2016-07-18 10:01:36 -0700 | [diff] [blame] | 5461 | redraw(); |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 5462 | break; |
| 5463 | case pathBackKey: |
caryclark | 26ad22a | 2015-10-16 09:03:38 -0700 | [diff] [blame] | 5464 | draw_path = (draw_path + 3 + (hasAlignedPath ? 3 : 0)) % (4 + (hasAlignedPath ? 3 : 0)); |
caryclark | 55888e4 | 2016-07-18 10:01:36 -0700 | [diff] [blame] | 5465 | redraw(); |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 5466 | break; |
| 5467 | case ptsKey: |
| 5468 | pt_labels = (pt_labels + 1) % 3; |
| 5469 | redraw(); |
| 5470 | break; |
| 5471 | case retinaKey: |
| 5472 | retina_scale ^= true; |
| 5473 | drawTop(); |
| 5474 | break; |
| 5475 | case sequenceKey: |
| 5476 | draw_sequence ^= true; |
| 5477 | redraw(); |
| 5478 | break; |
| 5479 | case sortKey: |
| 5480 | draw_sort = (draw_sort + 1) % 3; |
| 5481 | drawTop(); |
| 5482 | break; |
| 5483 | case stepKey: |
| 5484 | step_limit++; |
| 5485 | if (step_limit > stepMax) { |
| 5486 | step_limit = stepMax; |
| 5487 | } |
| 5488 | redraw(); |
| 5489 | break; |
| 5490 | case stepBackKey: |
| 5491 | step_limit--; |
| 5492 | if (step_limit < 0) { |
| 5493 | step_limit = 0; |
| 5494 | } |
| 5495 | redraw(); |
| 5496 | break; |
caryclark | 03b03ca | 2015-04-23 09:13:37 -0700 | [diff] [blame] | 5497 | case topKey: |
| 5498 | draw_top ^= true; |
| 5499 | redraw(); |
| 5500 | break; |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 5501 | case xyKey: |
| 5502 | debug_xy = (debug_xy + 1) % 3; |
| 5503 | redraw(); |
| 5504 | break; |
| 5505 | case '-': |
| 5506 | focusWasOn = focus_on_selection; |
| 5507 | if (focusWasOn) { |
| 5508 | focus_on_selection = false; |
| 5509 | scale /= 1.2; |
| 5510 | } else { |
| 5511 | scale /= 2; |
| 5512 | calcLeftTop(); |
| 5513 | } |
| 5514 | redraw(); |
| 5515 | focus_on_selection = focusWasOn; |
| 5516 | break; |
| 5517 | case '=': |
| 5518 | case '+': |
| 5519 | focusWasOn = focus_on_selection; |
| 5520 | if (focusWasOn) { |
| 5521 | focus_on_selection = false; |
| 5522 | scale *= 1.2; |
| 5523 | } else { |
| 5524 | scale *= 2; |
| 5525 | calcLeftTop(); |
| 5526 | } |
| 5527 | redraw(); |
| 5528 | focus_on_selection = focusWasOn; |
| 5529 | break; |
| 5530 | case '?': |
| 5531 | draw_hints ^= true; |
| 5532 | if (draw_hints && !draw_legend) { |
| 5533 | draw_legend = true; |
| 5534 | } |
| 5535 | redraw(); |
| 5536 | break; |
| 5537 | case '/': |
| 5538 | draw_legend ^= true; |
| 5539 | redraw(); |
| 5540 | break; |
| 5541 | } |
| 5542 | } |
| 5543 | |
| 5544 | function doKeyDown(evt) { |
| 5545 | var char = evt.keyCode; |
| 5546 | var preventDefault = false; |
| 5547 | switch (char) { |
| 5548 | case 37: // left arrow |
| 5549 | if (evt.shiftKey) { |
| 5550 | testIndex -= 9; |
| 5551 | } |
| 5552 | if (--testIndex < 0) |
| 5553 | testIndex = tests.length - 1; |
| 5554 | drawTop(); |
| 5555 | preventDefault = true; |
| 5556 | break; |
| 5557 | case 39: // right arrow |
| 5558 | if (evt.shiftKey) { |
| 5559 | testIndex += 9; |
| 5560 | } |
| 5561 | if (++testIndex >= tests.length) |
| 5562 | testIndex = 0; |
| 5563 | drawTop(); |
| 5564 | preventDefault = true; |
| 5565 | break; |
| 5566 | } |
| 5567 | if (preventDefault) { |
| 5568 | evt.preventDefault(); |
| 5569 | return false; |
| 5570 | } |
| 5571 | return true; |
| 5572 | } |
| 5573 | |
| 5574 | (function() { |
| 5575 | var hidden = "hidden"; |
| 5576 | |
| 5577 | // Standards: |
| 5578 | if (hidden in document) |
| 5579 | document.addEventListener("visibilitychange", onchange); |
| 5580 | else if ((hidden = "mozHidden") in document) |
| 5581 | document.addEventListener("mozvisibilitychange", onchange); |
| 5582 | else if ((hidden = "webkitHidden") in document) |
| 5583 | document.addEventListener("webkitvisibilitychange", onchange); |
| 5584 | else if ((hidden = "msHidden") in document) |
| 5585 | document.addEventListener("msvisibilitychange", onchange); |
| 5586 | // IE 9 and lower: |
| 5587 | else if ('onfocusin' in document) |
| 5588 | document.onfocusin = document.onfocusout = onchange; |
| 5589 | // All others: |
| 5590 | else |
caryclark | 55888e4 | 2016-07-18 10:01:36 -0700 | [diff] [blame] | 5591 | window.onpageshow = window.onpagehide |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 5592 | = window.onfocus = window.onblur = onchange; |
| 5593 | |
| 5594 | function onchange (evt) { |
| 5595 | var v = 'visible', h = 'hidden', |
caryclark | 55888e4 | 2016-07-18 10:01:36 -0700 | [diff] [blame] | 5596 | evtMap = { |
| 5597 | focus:v, focusin:v, pageshow:v, blur:h, focusout:h, pagehide:h |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 5598 | }; |
| 5599 | |
| 5600 | evt = evt || window.event; |
| 5601 | if (evt.type in evtMap) |
| 5602 | document.body.className = evtMap[evt.type]; |
caryclark | 55888e4 | 2016-07-18 10:01:36 -0700 | [diff] [blame] | 5603 | else |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 5604 | document.body.className = this[hidden] ? "hidden" : "visible"; |
| 5605 | } |
| 5606 | })(); |
| 5607 | |
| 5608 | function calcXY() { |
| 5609 | var e = window.event; |
caryclark | 55888e4 | 2016-07-18 10:01:36 -0700 | [diff] [blame] | 5610 | var tgt = e.target || e.srcElement; |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 5611 | var left = tgt.offsetLeft; |
| 5612 | var top = tgt.offsetTop; |
| 5613 | mouseX = (e.clientX - left) / scale + srcLeft; |
| 5614 | mouseY = (e.clientY - top) / scale + srcTop; |
| 5615 | } |
| 5616 | |
| 5617 | function calcLeftTop() { |
| 5618 | srcLeft = mouseX - screenWidth / 2 / scale; |
| 5619 | srcTop = mouseY - screenHeight / 2 / scale; |
| 5620 | } |
| 5621 | |
| 5622 | var disableClick = false; |
| 5623 | |
| 5624 | function handleMouseClick() { |
| 5625 | if (disableClick) { |
| 5626 | return; |
| 5627 | } |
| 5628 | if (!curve_t || !ptInTControl()) { |
| 5629 | calcXY(); |
| 5630 | calcLeftTop(); |
| 5631 | } |
| 5632 | redraw(); |
| 5633 | // if (!curve_t || !ptInTControl()) { |
| 5634 | // mouseX = screenWidth / 2 / scale + srcLeft; |
| 5635 | // mouseY = screenHeight / 2 / scale + srcTop; |
| 5636 | // } |
| 5637 | } |
| 5638 | |
| 5639 | function handleMouseOver() { |
| 5640 | calcXY(); |
| 5641 | if (debug_xy != 2) { |
| 5642 | return; |
| 5643 | } |
| 5644 | var num = mouseX.toFixed(decimal_places) + ", " + mouseY.toFixed(decimal_places); |
| 5645 | ctx.beginPath(); |
| 5646 | ctx.rect(300,100,num.length * 6,10); |
| 5647 | ctx.fillStyle="white"; |
| 5648 | ctx.fill(); |
| 5649 | ctx.font = "normal 10px Arial"; |
| 5650 | ctx.fillStyle="black"; |
| 5651 | ctx.textAlign = "left"; |
| 5652 | ctx.fillText(num, 300, 108); |
| 5653 | } |
| 5654 | |
| 5655 | function start() { |
| 5656 | for (var i = 0; i < testDivs.length; ++i) { |
| 5657 | tests[i] = null; |
| 5658 | } |
| 5659 | testIndex = 0; |
| 5660 | drawTop(); |
| 5661 | window.addEventListener('keypress', doKeyPress, true); |
| 5662 | window.addEventListener('keydown', doKeyDown, true); |
| 5663 | window.onresize = function() { |
| 5664 | drawTop(); |
| 5665 | } |
| 5666 | /* |
| 5667 | window.onpagehide = function() { |
| 5668 | disableClick = true; |
| 5669 | } |
| 5670 | */ |
| 5671 | window.onpageshow = function () { |
| 5672 | disableClick = false; |
| 5673 | } |
| 5674 | } |
| 5675 | |
| 5676 | </script> |
| 5677 | </head> |
| 5678 | |
| 5679 | <body onLoad="start();"> |
| 5680 | <canvas id="canvas" width="750" height="500" |
| 5681 | onmousemove="handleMouseOver()" |
| 5682 | onclick="handleMouseClick()" |
| 5683 | ></canvas > |
| 5684 | </body> |
| 5685 | </html> |