blob: 1844dfd3ad7805b7a8ced6f6317804dc264dfd6e [file] [log] [blame]
caryclarkdac1d172014-06-17 05:15:38 -07001<html>
2<head>
Cary Clark59d5a0e2017-01-23 14:38:52 +00003<div height="0" hidden="true">
Cary Clark7eb01e02016-12-08 14:36:32 -05004
Cary Clark59d5a0e2017-01-23 14:38:52 +00005<div id="joel_11">
6SkDCubic::ComplexBreak
7{{{407.66400146484375, 586.52301025390625}, {406.718994140625, 585.91400146484375}, {405.56201171875, 585.6710205078125}, {404.38299560546875, 585.9210205078125}}},
8maxCurvature[0]=0.210691815 {{{410.1179280337341311, 587.5354084049533867}, {403.9625372513739308, 584.8405979797089458}}},
9SkDCubic::ComplexBreak
10{{{403.625, 582.36602783203125}, {407.9530029296875, 581.4520263671875}, {412.17999267578125, 584.2020263671875}, {413.10198974609375, 588.5140380859375}}},
11maxCurvature[0]=0.505742375 {{{399.4806060513494685, 576.7555289603596975}, {419.9185900147107304, 590.2821868178559725}}},
12SkDCubic::ComplexBreak
13{{{408.92901611328125, 592.5469970703125}, {409.53802490234375, 591.60198974609375}, {409.78802490234375, 590.4530029296875}, {409.53802490234375, 589.27398681640625}}},
14maxCurvature[0]=0.2464997 {{{408.0414711863251682, 594.9185862710903621}, {410.5821756824746558, 588.7085892000006879}}},
15SkDCubic::ComplexBreak
16{{{413.10003662109375, 588.5159912109375}, {414.00604248046875, 592.83599853515625}, {411.27203369140625, 597.06298828125}, {406.94403076171875, 597.9849853515625}}},
17maxCurvature[0]=0.50027635 {{{418.6547935965468241, 584.2584103487866969}, {405.3110940414140941, 604.7967504597730795}}},
18SkDCubic::ComplexBreak
19{{{402.91400146484375, 593.82000732421875}, {403.8590087890625, 594.42901611328125}, {405.0159912109375, 594.67901611328125}, {406.19500732421875, 594.42901611328125}}},
20maxCurvature[0]=0.20172566 {{{400.4418179242405245, 592.7682938621098856}, {406.5786156780874876, 595.518866839962584}}},
21SkDCubic::ComplexBreak
22{{{406.94500732421875, 597.9840087890625}, {402.625, 598.89801025390625}, {398.39801025390625, 596.156005859375}, {397.47601318359375, 591.83599853515625}}},
23maxCurvature[0]=0.500281451 {{{411.2024837739085115, 603.5428096059653171}, {390.6642477196397749, 590.1989499052259589}}},
24SkDCubic::ComplexBreak
25{{{401.6409912109375, 587.81298828125}, {401.031982421875, 588.7509765625}, {400.781982421875, 589.89898681640625}, {401.031982421875, 591.0789794921875}}},
26maxCurvature[0]=0.208772223 {{{402.6666692341399312, 585.3725424991555428}, {399.9489005783761968, 591.4800732145131406}}},
27SkDCubic::ComplexBreak
28{{{397.47698974609375, 591.83697509765625}, {396.56298828125, 587.5169677734375}, {399.30499267578125, 583.28997802734375}, {403.625, 582.36798095703125}}},
29maxCurvature[0]=0.500281451 {{{391.9181889291909329, 596.0944515473461252}, {405.2620486299302911, 575.5562154930773886}}},
30<empty>
31<empty>
32seg=1 {{{409.539001f, 589.27301f}, {409.296997f, 588.085022f}, {408.593994f, 587.140015f}, {407.664001f, 586.52301f}}}
33seg=2 {{{407.664001f, 586.52301f}, {406.718994f, 585.914001f}, {405.562012f, 585.671021f}, {404.382996f, 585.921021f}}}
34seg=3 {{{404.382996f, 585.921021f}, {403.625f, 582.366028f}}}
35seg=4 {{{403.625f, 582.366028f}, {407.953003f, 581.452026f}, {412.179993f, 584.202026f}, {413.10199f, 588.514038f}}}
36seg=5 {{{413.10199f, 588.514038f}, {409.539001f, 589.27301f}}}
37<empty>
38seg=6 {{{406.195007f, 594.429993f}, {407.375f, 594.179993f}, {408.320007f, 593.484985f}, {408.929016f, 592.546997f}}}
39seg=7 {{{408.929016f, 592.546997f}, {409.538025f, 591.60199f}, {409.788025f, 590.453003f}, {409.538025f, 589.273987f}}}
40seg=8 {{{409.538025f, 589.273987f}, {413.100037f, 588.515991f}}}
41seg=9 {{{413.100037f, 588.515991f}, {414.006042f, 592.835999f}, {411.272034f, 597.062988f}, {406.944031f, 597.984985f}}}
42seg=10 {{{406.944031f, 597.984985f}, {406.195007f, 594.429993f}}}
43<empty>
44seg=11 {{{401.031006f, 591.078003f}, {401.289001f, 592.257996f}, {401.984009f, 593.210999f}, {402.914001f, 593.820007f}}}
45seg=12 {{{402.914001f, 593.820007f}, {403.859009f, 594.429016f}, {405.015991f, 594.679016f}, {406.195007f, 594.429016f}}}
46seg=13 {{{406.195007f, 594.429016f}, {406.945007f, 597.984009f}}}
47seg=14 {{{406.945007f, 597.984009f}, {402.625f, 598.89801f}, {398.39801f, 596.156006f}, {397.476013f, 591.835999f}}}
48seg=15 {{{397.476013f, 591.835999f}, {401.031006f, 591.078003f}}}
49seg=16 {{{404.382996f, 585.921997f}, {403.203003f, 586.171997f}, {402.25f, 586.867004f}, {401.640991f, 587.812988f}}}
50seg=17 {{{401.640991f, 587.812988f}, {401.031982f, 588.750977f}, {400.781982f, 589.898987f}, {401.031982f, 591.078979f}}}
51seg=18 {{{401.031982f, 591.078979f}, {397.47699f, 591.836975f}}}
52seg=19 {{{397.47699f, 591.836975f}, {396.562988f, 587.516968f}, {399.304993f, 583.289978f}, {403.625f, 582.367981f}}}
53seg=20 {{{403.625f, 582.367981f}, {404.382996f, 585.921997f}}}
54debugShowCubicIntersection 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}}}
55debugShowCubicIntersection 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}}}
56debugShowCubicLineIntersection 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}}}
57debugShowCubicLineIntersection 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}}}
58debugShowCubicIntersection 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}}}
59debugShowCubicLineIntersection 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}}}
60debugShowCubicLineIntersection 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}}}
61debugShowCubicIntersection 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}}}
62debugShowCubicLineIntersection 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}}}
63debugShowCubicLineIntersection 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}}}
64SkOpSegment::addT insert t=0.999474488 segID=3 spanID=41
65debugShowLineIntersection 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
66debugShowCubicIntersection 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}}}
67debugShowCubicIntersection 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}}}
68debugShowCubicLineIntersection 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}}}
69debugShowCubicLineIntersection 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}}}
70SkOpSegment::addT insert t=0.000318097039 segID=8 spanID=42
71debugShowCubicIntersection 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}}}
72debugShowLineIntersection 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}}}
73debugShowCubicLineIntersection 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}}}
74debugShowCubicIntersection 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}}}
75debugShowCubicIntersection 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}}}
76debugShowCubicLineIntersection 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}}}
77debugShowCubicLineIntersection 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}}}
78debugShowCubicIntersection 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}}}
79debugShowCubicLineIntersection 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}}}
80debugShowCubicLineIntersection 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}}}
81debugShowCubicIntersection 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}}}
82debugShowCubicLineIntersection 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}}}
83debugShowCubicLineIntersection 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}}}
84SkOpSegment::addT insert t=0.000319790508 segID=11 spanID=43
85debugShowCubicLineIntersection 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}}}
86debugShowLineIntersection no intersect {{{401.031982,591.078979}, {397.47699,591.836975}}} {{{397.476013,591.835999}, {401.031006,591.078003}}}
87debugShowCubicIntersection 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}}}
88debugShowCubicIntersection 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}}}
89debugShowCubicLineIntersection 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}}}
90SkOpSegment::addT insert t=8.74738929e-05 segID=19 spanID=44
91debugShowCubicIntersection 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}}}
92debugShowCubicIntersection 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}}}
93debugShowCubicLineIntersection 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}}}
94debugShowCubicLineIntersection 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}}}
95debugShowCubicIntersection 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}}}
96debugShowCubicLineIntersection 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}}}
97debugShowCubicLineIntersection 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}}}
98debugShowCubicIntersection 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}}}
99debugShowCubicLineIntersection 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
100debugShowCubicIntersection 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}}}
101debugShowCubicLineIntersection 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}}}
102debugShowCubicIntersection 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}}}
103debugShowCubicLineIntersection 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}}}
104debugShowLineIntersection 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}}}
105debugShowCubicLineIntersection 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}}}
106SkOpSegment::addT insert t=8.73365293e-05 segID=14 spanID=45
107debugShowCubicIntersection 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}}}
108debugShowCubicIntersection 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}}}
109debugShowCubicLineIntersection 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}}}
110debugShowCubicLineIntersection 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}}}
111debugShowCubicIntersection 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}}}
112debugShowCubicLineIntersection 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}}}
113debugShowCubicLineIntersection 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}}}
114------------------x--x---------------- addExpanded
11500: seg/base=20/39 seg/base=3/5 MarkCoinStart
11601: seg/base=20/40 seg/base=3/41 MarkCoinEnd
117SkOpSegment::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
118SkOpSegment::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
119SkOpSegment::debugShowActiveSpans id=3 (404.382996,585.921021 403.625397,582.36792) t=0 tEnd=0.999474488 windSum=? windValue=1
120SkOpSegment::debugShowActiveSpans id=3 (403.625397,582.36792 403.625,582.366028) t=0.999474488 tEnd=1 windSum=? windValue=1
121SkOpSegment::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
122SkOpSegment::debugShowActiveSpans id=5 (413.10199,588.514038 409.539001,589.27301) t=0 tEnd=1 windSum=? windValue=1
123SkOpSegment::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
124SkOpSegment::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
125SkOpSegment::debugShowActiveSpans id=18 (401.031982,591.078979 397.47699,591.836975) t=0 tEnd=1 windSum=? windValue=1
126SkOpSegment::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
127SkOpSegment::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
128SkOpSegment::debugShowActiveSpans id=20 (403.625,582.367981 404.382996,585.921997) t=0 tEnd=1 windSum=? windValue=1
129SkOpSegment::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
130SkOpSegment::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
131SkOpSegment::debugShowActiveSpans id=8 (409.538025,589.273987 409.539154,589.273743) t=0 tEnd=0.000318097039 windSum=? windValue=1
132SkOpSegment::debugShowActiveSpans id=8 (409.539154,589.273743 413.100037,588.515991) t=0.000318097039 tEnd=1 windSum=? windValue=1
133SkOpSegment::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
134SkOpSegment::debugShowActiveSpans id=10 (406.944031,597.984985 406.195007,594.429993) t=0 tEnd=1 windSum=? windValue=1
135SkOpSegment::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
136SkOpSegment::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
137SkOpSegment::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
138SkOpSegment::debugShowActiveSpans id=13 (406.195007,594.429016 406.945007,597.984009) t=0 tEnd=1 windSum=? windValue=1
139SkOpSegment::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
140SkOpSegment::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
141SkOpSegment::debugShowActiveSpans id=15 (397.476013,591.835999 401.031006,591.078003) t=0 tEnd=1 windSum=? windValue=1
142------------------x--x---------------- move_multiples
14300: seg/base=20/39 seg/base=3/5 MarkCoinStart
14401: seg/base=20/40 seg/base=3/41 MarkCoinEnd
145------------------x--x---------------- move_nearby
14600: seg/base=20/39 seg/base=3/5 MarkCoinStart
14701: seg/base=20/40 seg/base=3/41 MarkCoinEnd
148------------------x--x---------------- correctEnds
14900: seg/base=20/39 seg/base=3/5 MarkCoinStart
15001: seg/base=20/40 seg/base=3/41 MarkCoinEnd
151------------------x--x---------------- addEndMovedSpans
15200: seg/base=20/39 seg/base=3/5 MarkCoinStart
15301: seg/base=20/40 seg/base=3/41 MarkCoinEnd
154------------------x--x---------------- expand
15500: seg/base=20/39 seg/base=3/5 MarkCoinStart
15601: seg/base=20/40 seg/base=3/41 MarkCoinEnd
157------------------x--x---------------- addExpanded
15800: seg/base=20/39 seg/base=3/5 MarkCoinStart
15901: seg/base=20/40 seg/base=3/41 MarkCoinEnd
160------------------x--x---------------- mark
16100: seg/base=20/39 seg/base=3/5 MarkCoinStart
16201: seg/base=20/40 seg/base=3/41 MarkCoinEnd
163-------------------------------------- missing_coincidence
164-------------------------------------- expand
165-------------------------------------- expand
166-------------------------------------- apply
167SkOpSegment::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
168SkOpSegment::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
169-------------------------------------- findOverlaps
170SkOpSegment::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
171SkOpSegment::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
172SkOpSegment::debugShowActiveSpans id=3 (403.625397,582.36792 403.625,582.366028) t=0.999474488 tEnd=1 windSum=? windValue=1
173SkOpSegment::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
174SkOpSegment::debugShowActiveSpans id=5 (413.10199,588.514038 409.539001,589.27301) t=0 tEnd=1 windSum=? windValue=1
175SkOpSegment::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
176SkOpSegment::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
177SkOpSegment::debugShowActiveSpans id=18 (401.031982,591.078979 397.47699,591.836975) t=0 tEnd=1 windSum=? windValue=1
178SkOpSegment::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
179SkOpSegment::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
180SkOpSegment::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
181SkOpSegment::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
182SkOpSegment::debugShowActiveSpans id=8 (409.538025,589.273987 409.539154,589.273743) t=0 tEnd=0.000318097039 windSum=? windValue=1
183SkOpSegment::debugShowActiveSpans id=8 (409.539154,589.273743 413.100037,588.515991) t=0.000318097039 tEnd=1 windSum=? windValue=1
184SkOpSegment::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
185SkOpSegment::debugShowActiveSpans id=10 (406.944031,597.984985 406.195007,594.429993) t=0 tEnd=1 windSum=? windValue=1
186SkOpSegment::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
187SkOpSegment::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
188SkOpSegment::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
189SkOpSegment::debugShowActiveSpans id=13 (406.195007,594.429016 406.945007,597.984009) t=0 tEnd=1 windSum=? windValue=1
190SkOpSegment::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
191SkOpSegment::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
192SkOpSegment::debugShowActiveSpans id=15 (397.476013,591.835999 401.031006,591.078003) t=0 tEnd=1 windSum=? windValue=1
193-------------------------------------- calc_angles
194SkOpSegment::sortAngles [1] tStart=0 [1]
195SkOpAngle::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
196SkOpAngle::afterPart {{{409.539154,589.273743}, {409.29715,588.085754}, {408.594147,587.140747}, {407.664154,586.523743}}} id=1
197SkOpAngle::afterPart {{{409.539154,589.273743}, {413.100037,588.515991}}} id=8
198SkOpAngle::afterPart {{{409.539154,589.273743}, {409.538025,589.273987}}} id=8
199SkOpAngle::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
200SkOpAngle::afterPart {{{409.539001,589.27301}, {409.296997,588.085022}, {408.593994,587.140015}, {407.664001,586.52301}}} id=1
201SkOpAngle::afterPart {{{409.539001,589.27301}, {413.10199,588.514038}}} id=5
202SkOpAngle::afterPart {{{409.539001,589.27301}, {409.537872,589.273254}}} id=8
203SkOpAngle::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
204SkOpAngle::afterPart {{{409.539001,589.27301}, {409.537872,589.273254}}} id=8
205SkOpAngle::afterPart {{{409.539001,589.27301}, {413.10199,588.514038}}} id=5
206SkOpAngle::afterPart {{{409.539001,589.27301}, {413.099884,588.515259}}} id=8
207SkOpAngle::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
208SkOpAngle::afterPart {{{409.539001,589.27301}, {413.099884,588.515259}}} id=8
209SkOpAngle::afterPart {{{409.539001,589.27301}, {413.10199,588.514038}}} id=5
210SkOpAngle::afterPart {{{409.539001,589.27301}, {409.296997,588.085022}, {408.593994,587.140015}, {407.664001,586.52301}}} id=1
211SkOpSegment::sortAngles [2] tStart=1 [4]
212SkOpSegment::sortAngles [3] tStart=0.999474488 [41]
213SkOpSegment::sortAngles [5] tStart=1 [10]
214SkOpSegment::sortAngles [16] tStart=0 [31]
215SkOpSegment::sortAngles [17] tStart=1 [34]
216SkOpAngle::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
217SkOpAngle::afterPart {{{401.03125,591.079163}, {400.78125,589.89917}, {401.03125,588.75116}, {401.640259,587.813171}}} id=17
218SkOpAngle::afterPart {{{401.03125,591.079163}, {401.031006,591.078003}, {401.031088,591.07838}, {401.031006,591.078003}}} id=11
219SkOpAngle::afterPart {{{401.03125,591.079163}, {397.476257,591.837158}}} id=18
220SkOpAngle::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
221SkOpAngle::afterPart {{{401.03125,591.079163}, {400.78125,589.89917}, {401.03125,588.75116}, {401.640259,587.813171}}} id=17
222SkOpAngle::afterPart {{{401.03125,591.079163}, {401.289442,592.258633}, {401.984306,593.211193}, {402.914001,593.820007}}} id=11
223SkOpAngle::afterPart {{{401.03125,591.079163}, {401.031006,591.078003}, {401.031088,591.07838}, {401.031006,591.078003}}} id=11
224SkOpAngle::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
225SkOpAngle::afterPart {{{401.03125,591.079163}, {401.031006,591.078003}, {401.031088,591.07838}, {401.031006,591.078003}}} id=11
226SkOpAngle::afterPart {{{401.03125,591.079163}, {401.289442,592.258633}, {401.984306,593.211193}, {402.914001,593.820007}}} id=11
227SkOpAngle::afterPart {{{401.03125,591.079163}, {397.476257,591.837158}}} id=18
228SkOpAngle::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
229SkOpAngle::afterPart {{{401.03125,591.079163}, {397.476257,591.837158}}} id=18
230SkOpAngle::afterPart {{{401.03125,591.079163}, {401.289442,592.258633}, {401.984306,593.211193}, {402.914001,593.820007}}} id=11
231SkOpAngle::afterPart {{{401.03125,591.079163}, {400.78125,589.89917}, {401.03125,588.75116}, {401.640259,587.813171}}} id=17
232SkOpSegment::sortAngles [18] tStart=0 [35]
233SkOpSegment::sortAngles [19] tStart=8.74738929e-05 [44]
234SkOpAngle::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
235SkOpAngle::afterPart {{{397.476013,591.835999}, {397.476257,591.837158}, {397.476177,591.83678}, {397.476257,591.837158}}} id=19
236SkOpAngle::afterPart {{{397.476013,591.835999}, {398.39793,596.155629}, {402.624264,598.897536}, {406.943878,597.984253}}} id=14
237SkOpAngle::afterPart {{{397.476013,591.835999}, {396.562731,587.516385}, {399.304638,583.29008}, {403.624268,582.368164}}} id=19
238SkOpAngle::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
239SkOpAngle::afterPart {{{397.476013,591.835999}, {397.476257,591.837158}, {397.476177,591.83678}, {397.476257,591.837158}}} id=19
240SkOpAngle::afterPart {{{397.476013,591.835999}, {401.031006,591.078003}}} id=15
241SkOpAngle::afterPart {{{397.476013,591.835999}, {398.39793,596.155629}, {402.624264,598.897536}, {406.943878,597.984253}}} id=14
242SkOpAngle::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
243SkOpAngle::afterPart {{{397.476013,591.835999}, {398.39793,596.155629}, {402.624264,598.897536}, {406.943878,597.984253}}} id=14
244SkOpAngle::afterPart {{{397.476013,591.835999}, {401.031006,591.078003}}} id=15
245SkOpAngle::afterPart {{{397.476013,591.835999}, {396.562731,587.516385}, {399.304638,583.29008}, {403.624268,582.368164}}} id=19
246SkOpSegment::sortAngles [19] tStart=1 [38]
247SkOpSegment::sortAngles [6] tStart=0 [11]
248SkOpAngle::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
249SkOpAngle::afterPart {{{406.195007,594.429016}, {407.375,594.179016}, {408.320007,593.484009}, {408.929016,592.546021}}} id=6
250SkOpAngle::afterPart {{{406.195007,594.429016}, {406.945007,597.984009}}} id=13
251SkOpAngle::afterPart {{{406.195007,594.429016}, {405.015991,594.679016}, {403.859009,594.429016}, {402.914001,593.820007}}} id=12
252SkOpAngle::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
253SkOpAngle::afterPart {{{406.195007,594.429993}, {407.375,594.179993}, {408.320007,593.484985}, {408.929016,592.546997}}} id=6
254SkOpAngle::afterPart {{{406.195007,594.429993}, {406.944031,597.984985}}} id=10
255SkOpAngle::afterPart {{{406.195007,594.429993}, {405.015991,594.679993}, {403.859009,594.429993}, {402.914001,593.820984}}} id=12
256SkOpAngle::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
257SkOpAngle::afterPart {{{406.195007,594.429993}, {405.015991,594.679993}, {403.859009,594.429993}, {402.914001,593.820984}}} id=12
258SkOpAngle::afterPart {{{406.195007,594.429993}, {406.944031,597.984985}}} id=10
259SkOpAngle::afterPart {{{406.195007,594.429993}, {406.945007,597.984985}}} id=13
260SkOpSegment::sortAngles [8] tStart=0.000318097039 [42]
261SkOpSegment::sortAngles [9] tStart=1 [18]
262SkOpAngle::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
263SkOpAngle::afterPart {{{406.943878,597.984253}, {411.271881,597.062256}, {414.00589,592.835266}, {413.099884,588.515259}}} id=9
264SkOpAngle::afterPart {{{406.943878,597.984253}, {406.945007,597.984009}, {406.94463,597.984009}, {406.945007,597.984009}}} id=14
265SkOpAngle::afterPart {{{406.943878,597.984253}, {406.194855,594.42926}}} id=10
266SkOpAngle::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
267SkOpAngle::afterPart {{{406.943878,597.984253}, {411.271881,597.062256}, {414.00589,592.835266}, {413.099884,588.515259}}} id=9
268SkOpAngle::afterPart {{{406.943878,597.984253}, {402.624264,598.897536}, {398.39793,596.155629}, {397.476013,591.835999}}} id=14
269SkOpAngle::afterPart {{{406.943878,597.984253}, {406.194855,594.42926}}} id=10
270SkOpAngle::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
271SkOpAngle::afterPart {{{406.943878,597.984253}, {406.194855,594.42926}}} id=10
272SkOpAngle::afterPart {{{406.943878,597.984253}, {402.624264,598.897536}, {398.39793,596.155629}, {397.476013,591.835999}}} id=14
273SkOpAngle::afterPart {{{406.943878,597.984253}, {406.945007,597.984009}, {406.94463,597.984009}, {406.945007,597.984009}}} id=14
274SkOpSegment::sortAngles [10] tStart=0 [19]
275SkOpSegment::sortAngles [10] tStart=1 [20]
276SkOpSegment::sortAngles [11] tStart=0.000319790508 [43]
277SkOpSegment::sortAngles [12] tStart=1 [24]
278SkOpSegment::sortAngles [13] tStart=0 [25]
279SkOpSegment::sortAngles [14] tStart=8.73365293e-05 [45]
280SkOpSegment::sortAngles [14] tStart=1 [28]
281SkOpSegment::sortAngles [15] tStart=0 [29]
282coinSpan - id=20 t=0 tEnd=1
283coinSpan + id=3 t=0.999474488 tEnd=0
284SkOpSpan::sortableTop dir=kLeft seg=1 t=0.5 pt=(408.859497,587.683899)
285SkOpSpan::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)
286SkOpSpan::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)
287SkOpSpan::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)
288SkOpSegment::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
289SkOpSegment::nextChase mismatched signs
290SkOpSegment::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
291SkOpSegment::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
292SkOpSegment::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
293SkOpSegment::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
294SkOpSegment::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
295SkOpSegment::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
296SkOpSegment::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
297SkOpSegment::nextChase mismatched signs
298SkOpSegment::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
299SkOpSegment::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
300SkOpSegment::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
301SkOpSegment::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
302SkOpSegment::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
303SkOpSegment::markAngle last seg=6 span=11 windSum=-1
304SkOpSegment::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
305SkOpSegment::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
306SkOpSegment::markAngle last seg=9 span=18
307SkOpSegment::findNextWinding
308SkOpAngle::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
309SkOpAngle::dumpOne [8/12] next=8/13 sect=17/17 s=0.000318097039 [42] e=0 [15] sgn=1 windVal=1 windSum=-1
310SkOpAngle::dumpOne [8/13] next=5/4 sect=1/1 s=0.000318097039 [42] e=1 [16] sgn=-1 windVal=1 windSum=-1
311SkOpAngle::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
312SkOpSegment::findNextWinding chase.append segment=6 span=11 windSum=-1
313SkOpSegment::findNextWinding chase.append segment=9 span=18
314SkOpSegment::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
315SkOpSegment::findNextWinding from:[1] to:[8] start=4291816 end=4286928
316bridgeWinding current id=1 from=(407.664001,586.52301) to=(409.539001,589.27301)
317path.moveTo(407.664001,586.52301);
318path.cubicTo(408.593994,587.140015, 409.296997,588.085022, 409.539001,589.27301);
319SkOpSegment::findNextWinding simple
320SkOpSegment::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
321bridgeWinding current id=8 from=(409.539154,589.273743) to=(409.538025,589.273987)
322SkOpSegment::findNextWinding simple
323SkOpSegment::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
324bridgeWinding current id=7 from=(409.538025,589.273987) to=(408.929016,592.546997)
325path.lineTo(409.538025,589.273987);
326path.cubicTo(409.788025,590.453003, 409.538025,591.60199, 408.929016,592.546997);
327SkOpSegment::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
328SkOpSegment::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
329SkOpSegment::markAngle last seg=11 span=43 windSum=-1
330SkOpSegment::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
331SkOpSegment::markAngle last seg=10 span=19 windSum=-2
332SkOpSegment::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
333SkOpSegment::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
334SkOpSegment::markAngle last seg=14 span=45 windSum=?
335SkOpSegment::findNextWinding
336SkOpAngle::dumpOne [6/11] next=12/19 sect=1/1 s=0 [11] e=1 [12] sgn=-1 windVal=1 windSum=-1
337SkOpAngle::dumpOne [12/19] next=10/16 sect=17/13 s=1 [24] e=0 [23] sgn=1 windVal=1 windSum=-1
338SkOpAngle::dumpOne [10/16] next=13/20 sect=25/25 s=1 [20] e=0 [19] sgn=1 windVal=1 windSum=-2
339SkOpAngle::dumpOne [13/20] next=6/11 sect=25/25 s=0 [25] e=1 [26] sgn=-1 windVal=1 windSum=-2
340SkOpSegment::findNextWinding chase.append segment=11 span=43 windSum=-1
341SkOpSegment::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
342SkOpSegment::findNextWinding chase.append segment=10 span=19 windSum=-2
343SkOpSegment::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
344SkOpSegment::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
345SkOpSegment::findNextWinding chase.append segment=14 span=45 windSum=-2147483647
346SkOpSegment::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
347SkOpSegment::findNextWinding from:[6] to:[12] start=4288824 end=4288680
348bridgeWinding current id=6 from=(408.929016,592.546997) to=(406.195007,594.429993)
349path.cubicTo(408.320007,593.484985, 407.375,594.179993, 406.195007,594.429993);
350SkOpSegment::findNextWinding simple
351SkOpSegment::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
352bridgeWinding current id=12 from=(406.195007,594.429016) to=(402.914001,593.820007)
353path.cubicTo(405.015991,594.679016, 403.859009,594.429016, 402.914001,593.820007);
354SkOpSegment::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
355SkOpSegment::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
356SkOpSegment::markAngle last seg=15 span=29 windSum=-2
357SkOpSegment::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
358SkOpSegment::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
359SkOpSegment::markAngle last seg=19 span=44 windSum=-1
360SkOpSegment::findNextWinding
361SkOpAngle::dumpOne [11/18] next=17/6 sect=25/25 s=0.000319790508 [43] e=1 [22] sgn=-1 windVal=1 windSum=-1
362SkOpAngle::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
363SkOpAngle::dumpOne [11/17] next=18/7 sect=9/9 s=0.000319790508 [43] e=0 [21] sgn=1 windVal=1 windSum=-2
364SkOpAngle::dumpOne [18/7] next=11/18 sect=17/17 s=0 [35] e=1 [36] sgn=-1 windVal=1 windSum=-2
365SkOpSegment::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
366SkOpSegment::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
367SkOpSegment::findNextWinding chase.append segment=15 span=29 windSum=-2
368SkOpSegment::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
369SkOpSegment::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
370SkOpSegment::findNextWinding chase.append segment=19 span=44 windSum=-1
371SkOpSegment::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
372SkOpSegment::findNextWinding from:[11] to:[17] start=4290488 end=4290344
373bridgeWinding current id=11 from=(402.914001,593.820007) to=(401.03125,591.079163)
374path.cubicTo(401.984314,593.211182, 401.289429,592.258606, 401.03125,591.079163);
375SkOpSegment::findNextWinding simple
376SkOpSegment::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
377bridgeWinding current id=17 from=(401.031982,591.078979) to=(401.640991,587.812988)
378path.cubicTo(400.781982,589.898987, 401.031982,588.750977, 401.640991,587.812988);
379SkOpSegment::nextChase mismatched signs
380SkOpSegment::findNextWinding simple
381SkOpSegment::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
382bridgeWinding current id=16 from=(401.640991,587.812988) to=(404.382996,585.921997)
383path.cubicTo(402.25,586.867004, 403.203003,586.171997, 404.382996,585.921997);
384SkOpSegment::findNextWinding simple
385SkOpSegment::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
386bridgeWinding current id=2 from=(404.382996,585.921021) to=(407.664001,586.52301)
387path.cubicTo(405.562012,585.671021, 406.718994,585.914001, 407.664001,586.52301);
388path.close();
389SkOpSegment::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
390SkOpSegment::nextChase mismatched signs
391SkOpSegment::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
392SkOpSegment::markAngle last seg=14 span=45 windSum=-2
393SkOpSegment::debugShowActiveSpans id=3 (403.625397,582.36792 403.625,582.366028) t=0.999474488 tEnd=1 windSum=-1 oppSum=0 windValue=1 oppValue=0
394SkOpSegment::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
395SkOpSegment::debugShowActiveSpans id=5 (413.10199,588.514038 409.539001,589.27301) t=0 tEnd=1 windSum=-1 oppSum=0 windValue=1 oppValue=0
396SkOpSegment::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
397SkOpSegment::debugShowActiveSpans id=8 (409.539154,589.273743 413.100037,588.515991) t=0.000318097039 tEnd=1 windSum=-1 windValue=1
398SkOpSegment::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
399SkOpSegment::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
400SkOpSegment::nextChase mismatched signs
401SkOpSegment::findNextWinding simple
402SkOpSegment::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
403bridgeWinding current id=19 from=(397.476746,591.835815) to=(403.625,582.367981)
404path.moveTo(397.476746,591.835815);
405path.cubicTo(396.563477,587.516174, 399.305359,583.289917, 403.625,582.367981);
406SkOpSegment::findNextWinding simple
407SkOpSegment::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
408bridgeWinding current id=3 from=(403.625397,582.36792) to=(403.625,582.366028)
409SkOpSegment::findNextWinding simple
410SkOpSegment::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
411bridgeWinding current id=4 from=(403.625,582.366028) to=(413.10199,588.514038)
412path.lineTo(403.625,582.366028);
413path.cubicTo(407.953003,581.452026, 412.179993,584.202026, 413.10199,588.514038);
414SkOpSegment::findNextWinding
415SkOpAngle::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
416SkOpAngle::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
417SkOpAngle::dumpOne [8/12] next=8/13 sect=17/17 s=0.000318097039 [42] e=0 [15] sgn=1 windVal=1 windSum=-1 done
418SkOpAngle::dumpOne [8/13] next=5/4 sect=1/1 s=0.000318097039 [42] e=1 [16] sgn=-1 windVal=1 windSum=-1
419SkOpSegment::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
420SkOpSegment::findNextWinding from:[5] to:[8] start=4291816 end=4287072
421bridgeWinding current id=5 from=(413.10199,588.514038) to=(409.539001,589.27301)
422SkOpSegment::findNextWinding simple
423SkOpSegment::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
424bridgeWinding current id=8 from=(409.539154,589.273743) to=(413.100037,588.515991)
425path.lineTo(409.539001,589.27301);
426SkOpSegment::findNextWinding
427SkOpAngle::dumpOne [9/14] next=10/15 sect=1/5 s=1 [18] e=0 [17] sgn=1 windVal=1 windSum=-1
428SkOpAngle::dumpOne [10/15] next=14/22 sect=9/9 s=0 [19] e=1 [20] sgn=-1 windVal=1 windSum=-2 done
429SkOpAngle::dumpOne [14/22] next=14/21 sect=17/13 s=8.73365293e-05 [45] e=1 [28] sgn=-1 windVal=1 windSum=-2
430SkOpAngle::dumpOne [14/21] next=9/14 sect=31/31 s=8.73365293e-05 [45] e=0 [27] sgn=1 windVal=1 windSum=-2 done
431SkOpSegment::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
432SkOpSegment::findNextWinding from:[9] to:[14] start=4292248 end=4289320
433bridgeWinding current id=9 from=(413.100037,588.515991) to=(406.944031,597.984985)
434path.lineTo(413.100037,588.515991);
435path.cubicTo(414.006042,592.835999, 411.272034,597.062988, 406.944031,597.984985);
436SkOpSegment::findNextWinding simple
437SkOpSegment::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
438SkOpSegment::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">
442SkDCubic::ComplexBreak
443{{{584.08599853515625, 431.33599853515625}, {582.93798828125, 430.96099853515625}, {581.75799560546875, 431.08599853515625}, {580.7659912109375, 431.593994140625}}},
444maxCurvature[0]=0.908113421 {{{584.1181209116214177, 430.1538818130687787}, {577.969954809597084, 432.7736222667205084}}},
445SkDCubic::ComplexBreak
446{{{575.14801025390625, 433}, {576.5150146484375, 428.7969970703125}, {581.0150146484375, 426.5159912109375}, {585.21002197265625, 427.875}}},
447maxCurvature[0]=0.50036075 {{{568.1978874470240726, 433.8982271481503972}, {590.0470235470908165, 422.8012586633995511}}},
448SkDCubic::ComplexBreak
449{{{586.875, 436.81201171875}, {587.25, 435.66400146484375}, {587.125, 434.5}, {586.61700439453125, 433.49200439453125}}},
450maxCurvature[0]=0.709758914 {{{587.7871278617965345, 437.6571056882418702}, {586.1322255770696756, 431.1527144185091061}}},
451SkDCubic::ComplexBreak
452{{{585.21099853515625, 427.875}, {589.406005859375, 429.24200439453125}, {591.69500732421875, 433.7340087890625}, {590.3280029296875, 437.93701171875}}},
453maxCurvature[0]=0.49729326 {{{584.2405287567108871, 420.9205840752692325}, {595.4397901231312744, 442.7054003127302053}}},
454SkDCubic::ComplexBreak
455{{{581.39801025390625, 439.60198974609375}, {582.53900146484375, 439.968994140625}, {583.71002197265625, 439.85198974609375}, {584.71002197265625, 439.343994140625}}},
456maxCurvature[0]=0.769822111 {{{580.7905223461929154, 440.6007184045780036}, {587.1989920634028977, 438.6622846164399903}}},
457SkDCubic::ComplexBreak
458{{{590.3270263671875, 437.93798828125}, {588.9520263671875, 442.13299560546875}, {584.468017578125, 444.4219970703125}, {580.2650146484375, 443.05499267578125}}},
459maxCurvature[0]=0.50179849 {{{597.2616281410381589, 437.0677298509480124}, {575.4121463613508922, 448.1166853435209987}}},
460SkDCubic::ComplexBreak
461{{{578.60198974609375, 434.125}, {578.2349853515625, 435.27301025390625}, {578.35198974609375, 436.43701171875}, {578.8599853515625, 437.44500732421875}}},
462maxCurvature[0]=0.714831074 {{{577.6906339162001132, 433.299635239093675}, {579.3552391524597169, 439.7975429835167347}}},
463SkDCubic::ComplexBreak
464{{{580.2659912109375, 443.05401611328125}, {576.07098388671875, 441.68701171875}, {573.781982421875, 437.2020263671875}, {575.14898681640625, 432.9990234375}}},
465maxCurvature[0]=0.498616268 {{{581.2070198879381451, 449.9982918524905813}, {570.0518531862154532, 428.2119094507434625}}},
466<empty>
467<empty>
468seg=1 {{{584.085999f, 431.335999f}, {582.937988f, 430.960999f}, {581.757996f, 431.085999f}, {580.765991f, 431.593994f}}}
469seg=2 {{{580.765991f, 431.593994f}, {579.773987f, 432.10199f}, {578.97699f, 432.97699f}, {578.60199f, 434.125f}}}
470seg=3 {{{578.60199f, 434.125f}, {575.14801f, 433}}}
471seg=4 {{{575.14801f, 433}, {576.515015f, 428.796997f}, {581.015015f, 426.515991f}, {585.210022f, 427.875f}}}
472seg=5 {{{585.210022f, 427.875f}, {584.085999f, 431.335999f}}}
473<empty>
474seg=6 {{{586.875f, 436.812012f}, {587.25f, 435.664001f}, {587.125f, 434.5f}, {586.617004f, 433.492004f}}}
475seg=7 {{{586.617004f, 433.492004f}, {586.101013f, 432.5f}, {585.234009f, 431.703003f}, {584.085999f, 431.335999f}}}
476seg=8 {{{584.085999f, 431.335999f}, {585.210999f, 427.875f}}}
477seg=9 {{{585.210999f, 427.875f}, {589.406006f, 429.242004f}, {591.695007f, 433.734009f}, {590.328003f, 437.937012f}}}
478seg=10 {{{590.328003f, 437.937012f}, {586.875f, 436.812012f}}}
479<empty>
480seg=11 {{{581.39801f, 439.60199f}, {582.539001f, 439.968994f}, {583.710022f, 439.85199f}, {584.710022f, 439.343994f}}}
481seg=12 {{{584.710022f, 439.343994f}, {585.702026f, 438.835999f}, {586.499023f, 437.960999f}, {586.874023f, 436.812988f}}}
482seg=13 {{{586.874023f, 436.812988f}, {590.327026f, 437.937988f}}}
483seg=14 {{{590.327026f, 437.937988f}, {588.952026f, 442.132996f}, {584.468018f, 444.421997f}, {580.265015f, 443.054993f}}}
484seg=15 {{{580.265015f, 443.054993f}, {581.39801f, 439.60199f}}}
485seg=16 {{{578.60199f, 434.125f}, {578.234985f, 435.27301f}, {578.35199f, 436.437012f}, {578.859985f, 437.445007f}}}
486seg=17 {{{578.859985f, 437.445007f}, {579.367981f, 438.437012f}, {580.250977f, 439.226013f}, {581.398987f, 439.601013f}}}
487seg=18 {{{581.398987f, 439.601013f}, {580.265991f, 443.054016f}}}
488seg=19 {{{580.265991f, 443.054016f}, {576.070984f, 441.687012f}, {573.781982f, 437.202026f}, {575.148987f, 432.999023f}}}
489seg=20 {{{575.148987f, 432.999023f}, {578.60199f, 434.125f}}}
490debugShowCubicIntersection 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}}}
491debugShowCubicIntersection 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}}}
492debugShowCubicLineIntersection 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}}}
493debugShowCubicLineIntersection 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}}}
494debugShowCubicIntersection 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}}}
495debugShowCubicLineIntersection 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}}}
496debugShowCubicLineIntersection 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}}}
497debugShowCubicIntersection 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}}}
498debugShowCubicLineIntersection 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}}}
499debugShowCubicIntersection 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}}}
500debugShowCubicLineIntersection 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}}}
501debugShowCubicLineIntersection 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}}}
502debugShowLineIntersection 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
503debugShowCubicIntersection 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}}}
504debugShowCubicIntersection 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}}}
505debugShowCubicLineIntersection 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}}}
506debugShowCubicLineIntersection 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}}}
507debugShowCubicLineIntersection 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}}}
508SkOpSegment::addT insert t=0.999907158 segID=19 spanID=41
509debugShowLineIntersection 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}}}
510debugShowCubicIntersection 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}}}
511debugShowCubicLineIntersection 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}}}
512debugShowCubicIntersection 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}}}
513debugShowCubicIntersection 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}}}
514debugShowCubicLineIntersection 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}}}
515debugShowCubicLineIntersection 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}}}
516debugShowCubicIntersection 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}}}
517debugShowCubicLineIntersection 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}}}
518debugShowCubicLineIntersection 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}}}
519debugShowCubicIntersection 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}}}
520debugShowCubicLineIntersection 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}}}
521debugShowLineIntersection no intersect {{{590.328003,437.937012}, {586.875,436.812012}}} {{{586.874023,436.812988}, {590.327026,437.937988}}}
522debugShowCubicIntersection 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}}}
523debugShowCubicIntersection 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}}}
524debugShowCubicLineIntersection 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}}}
525debugShowCubicLineIntersection 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}}}
526debugShowCubicIntersection 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}}}
527debugShowCubicLineIntersection 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}}}
528debugShowCubicLineIntersection 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}}}
529debugShowCubicIntersection 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}}}
530debugShowCubicIntersection 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}}}
531debugShowCubicLineIntersection 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
532SkOpSegment::addT insert t=0.000339103907 segID=18 spanID=42
533debugShowCubicLineIntersection 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}}}
534debugShowLineIntersection 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
535SkOpSegment::addT insert t=0.000339103907 segID=15 spanID=43
536debugShowCubicIntersection 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}}}
537debugShowCubicLineIntersection 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
538debugShowCubicIntersection 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}}}
539debugShowCubicIntersection 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}}}
540debugShowCubicLineIntersection 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}}}
541debugShowCubicLineIntersection 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}}}
542debugShowCubicIntersection 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}}}
543debugShowCubicLineIntersection 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}}}
544debugShowCubicLineIntersection 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
54600: seg/base=15/43 seg/base=18/42 MarkCoinStart
54701: seg/base=15/30 seg/base=18/36 MarkCoinEnd
54802: seg/base=8/15 seg/base=5/9 MarkCoinStart
54903: seg/base=8/16 seg/base=5/10 MarkCoinEnd
550SkOpSegment::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
551SkOpSegment::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
552SkOpSegment::debugShowActiveSpans id=3 (578.60199,434.125 575.14801,433) t=0 tEnd=1 windSum=? windValue=1
553SkOpSegment::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
554SkOpSegment::debugShowActiveSpans id=5 (585.210022,427.875 584.085999,431.335999) t=0 tEnd=1 windSum=? windValue=1
555SkOpSegment::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
556SkOpSegment::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
557SkOpSegment::debugShowActiveSpans id=8 (584.085999,431.335999 585.210999,427.875) t=0 tEnd=1 windSum=? windValue=1
558SkOpSegment::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
559SkOpSegment::debugShowActiveSpans id=10 (590.328003,437.937012 586.875,436.812012) t=0 tEnd=1 windSum=? windValue=1
560SkOpSegment::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
561SkOpSegment::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
562SkOpSegment::debugShowActiveSpans id=18 (581.398987,439.601013 581.398621,439.602173) t=0 tEnd=0.000339103907 windSum=? windValue=1
563SkOpSegment::debugShowActiveSpans id=18 (581.398621,439.602173 580.265991,443.054016) t=0.000339103907 tEnd=1 windSum=? windValue=1
564SkOpSegment::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
565SkOpSegment::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
566SkOpSegment::debugShowActiveSpans id=20 (575.148987,432.999023 578.60199,434.125) t=0 tEnd=1 windSum=? windValue=1
567SkOpSegment::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
568SkOpSegment::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
569SkOpSegment::debugShowActiveSpans id=13 (586.874023,436.812988 590.327026,437.937988) t=0 tEnd=1 windSum=? windValue=1
570SkOpSegment::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
571SkOpSegment::debugShowActiveSpans id=15 (580.265015,443.054993 580.265381,443.053833) t=0 tEnd=0.000339103907 windSum=? windValue=1
572SkOpSegment::debugShowActiveSpans id=15 (580.265381,443.053833 581.39801,439.60199) t=0.000339103907 tEnd=1 windSum=? windValue=1
573------------------x--x---------------- move_multiples
57400: seg/base=15/43 seg/base=18/42 MarkCoinStart
57501: seg/base=15/30 seg/base=18/36 MarkCoinEnd
57602: seg/base=8/15 seg/base=5/9 MarkCoinStart
57703: seg/base=8/16 seg/base=5/10 MarkCoinEnd
578------------------x--x---------------- move_nearby
57900: seg/base=15/43 seg/base=18/42 MarkCoinStart
58001: seg/base=15/30 seg/base=18/36 MarkCoinEnd
58102: seg/base=8/15 seg/base=5/9 MarkCoinStart
58203: seg/base=8/16 seg/base=5/10 MarkCoinEnd
583------------------x--x---------------- correctEnds
58400: seg/base=15/43 seg/base=18/42 MarkCoinStart
58501: seg/base=15/30 seg/base=18/36 MarkCoinEnd
58602: seg/base=8/15 seg/base=5/9 MarkCoinStart
58703: seg/base=8/16 seg/base=5/10 MarkCoinEnd
588------------------x--x---------------- addEndMovedSpans
58900: seg/base=15/43 seg/base=18/42 MarkCoinStart
59001: seg/base=15/30 seg/base=18/36 MarkCoinEnd
59102: seg/base=8/15 seg/base=5/9 MarkCoinStart
59203: seg/base=8/16 seg/base=5/10 MarkCoinEnd
593------------------x--x---------------- expand
59400: seg/base=15/43 seg/base=18/42 MarkCoinStart
59501: seg/base=15/30 seg/base=18/36 MarkCoinEnd
59602: seg/base=8/15 seg/base=5/9 MarkCoinStart
59703: seg/base=8/16 seg/base=5/10 MarkCoinEnd
598------------------x--x---------------- addExpanded
59900: seg/base=15/43 seg/base=18/42 MarkCoinStart
60001: seg/base=15/30 seg/base=18/36 MarkCoinEnd
60102: seg/base=8/15 seg/base=5/9 MarkCoinStart
60203: seg/base=8/16 seg/base=5/10 MarkCoinEnd
603------------------x--x---------------- mark
60400: seg/base=15/43 seg/base=18/42 MarkCoinStart
60501: seg/base=15/30 seg/base=18/36 MarkCoinEnd
60602: seg/base=8/15 seg/base=5/9 MarkCoinStart
60703: seg/base=8/16 seg/base=5/10 MarkCoinEnd
608-------------------------------------- missing_coincidence
609-------------------------------------- expand
610-------------------------------------- expand
611-------------------------------------- apply
612SkOpSegment::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
613SkOpSegment::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
614SkOpSegment::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
615SkOpSegment::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
617SkOpSegment::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
618SkOpSegment::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
619SkOpSegment::debugShowActiveSpans id=3 (578.60199,434.125 575.14801,433) t=0 tEnd=1 windSum=? windValue=1
620SkOpSegment::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
621SkOpSegment::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
622SkOpSegment::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
623SkOpSegment::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
624SkOpSegment::debugShowActiveSpans id=10 (590.328003,437.937012 586.875,436.812012) t=0 tEnd=1 windSum=? windValue=1
625SkOpSegment::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
626SkOpSegment::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
627SkOpSegment::debugShowActiveSpans id=18 (581.398987,439.601013 581.398621,439.602173) t=0 tEnd=0.000339103907 windSum=? windValue=1
628SkOpSegment::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
629SkOpSegment::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
630SkOpSegment::debugShowActiveSpans id=20 (575.148987,432.999023 578.60199,434.125) t=0 tEnd=1 windSum=? windValue=1
631SkOpSegment::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
632SkOpSegment::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
633SkOpSegment::debugShowActiveSpans id=13 (586.874023,436.812988 590.327026,437.937988) t=0 tEnd=1 windSum=? windValue=1
634SkOpSegment::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
635SkOpSegment::debugShowActiveSpans id=15 (580.265015,443.054993 580.265381,443.053833) t=0 tEnd=0.000339103907 windSum=? windValue=1
636-------------------------------------- calc_angles
637SkOpSegment::sortAngles [1] tStart=0 [1]
638SkOpSegment::sortAngles [2] tStart=1 [4]
639SkOpAngle::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
640SkOpAngle::afterPart {{{578.60199,434.125}, {578.97699,432.97699}, {579.773987,432.10199}, {580.765991,431.593994}}} id=2
641SkOpAngle::afterPart {{{578.60199,434.125}, {578.234985,435.27301}, {578.35199,436.437012}, {578.859985,437.445007}}} id=16
642SkOpAngle::afterPart {{{578.60199,434.125}, {575.148987,432.999023}}} id=20
643SkOpAngle::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
644SkOpAngle::afterPart {{{578.60199,434.125}, {578.97699,432.97699}, {579.773987,432.10199}, {580.765991,431.593994}}} id=2
645SkOpAngle::afterPart {{{578.60199,434.125}, {575.14801,433}}} id=3
646SkOpAngle::afterPart {{{578.60199,434.125}, {575.148987,432.999023}}} id=20
647SkOpAngle::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
648SkOpAngle::afterPart {{{578.60199,434.125}, {575.148987,432.999023}}} id=20
649SkOpAngle::afterPart {{{578.60199,434.125}, {575.14801,433}}} id=3
650SkOpAngle::afterPart {{{578.60199,434.125}, {578.234985,435.27301}, {578.35199,436.437012}, {578.859985,437.445007}}} id=16
651SkOpSegment::sortAngles [3] tStart=0 [5]
652SkOpSegment::sortAngles [3] tStart=1 [6]
653SkOpAngle::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
654SkOpAngle::afterPart {{{575.148621,433.000183}, {578.6026,434.125183}}} id=3
655SkOpAngle::afterPart {{{575.148621,433.000183}, {575.148987,432.999023}, {575.14886,432.999414}, {575.148987,432.999023}}} id=19
656SkOpAngle::afterPart {{{575.148621,433.000183}, {573.782422,437.202848}, {576.071373,441.687139}, {580.265991,443.054016}}} id=19
657SkOpAngle::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
658SkOpAngle::afterPart {{{575.14801,433}, {578.60199,434.125}}} id=3
659SkOpAngle::afterPart {{{575.14801,433}, {576.515015,428.796997}, {581.015015,426.515991}, {585.210022,427.875}}} id=4
660SkOpAngle::afterPart {{{575.14801,433}, {575.148376,432.99884}, {575.14825,432.999231}, {575.148376,432.99884}}} id=19
661SkOpSegment::sortAngles [4] tStart=0 [7]
662SkOpSegment::sortAngles [4] tStart=1 [8]
663SkOpSegment::sortAngles [7] tStart=1 [14]
664SkOpSegment::sortAngles [9] tStart=0 [17]
665SkOpSegment::sortAngles [16] tStart=0 [31]
666SkOpSegment::sortAngles [18] tStart=0.000339103907 [42]
667SkOpSegment::sortAngles [19] tStart=0 [37]
668SkOpSegment::sortAngles [19] tStart=0.999907158 [41]
669SkOpSegment::sortAngles [20] tStart=1 [40]
670SkOpSegment::sortAngles [11] tStart=0 [21]
671SkOpSegment::sortAngles [15] tStart=0.000339103907 [43]
672coinSpan - id=15 t=0.000339103907 tEnd=1
673coinSpan + id=18 t=1 tEnd=0.000339103907
674coinSpan - id=8 t=0 tEnd=1
675coinSpan + id=5 t=1 tEnd=0
676SkOpSpan::sortableTop dir=kTop seg=1 t=0.5 pt=(582.367493,431.133881)
677SkOpSpan::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)
678SkOpSpan::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)
679SkOpSegment::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
680SkOpSegment::nextChase mismatched signs
681SkOpSegment::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
682SkOpSegment::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
683SkOpSegment::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
684SkOpSegment::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
685SkOpSegment::nextChase mismatched signs
686SkOpSegment::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
687SkOpSegment::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
688SkOpSegment::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
689SkOpSegment::nextChase mismatched signs
690SkOpSegment::findNextWinding simple
691SkOpSegment::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
692bridgeWinding current id=1 from=(580.765991,431.593994) to=(584.085999,431.335999)
693path.moveTo(580.765991,431.593994);
694path.cubicTo(581.757996,431.085999, 582.937988,430.960999, 584.085999,431.335999);
695SkOpSegment::findNextWinding simple
696SkOpSegment::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
697bridgeWinding current id=7 from=(584.085999,431.335999) to=(586.617004,433.492004)
698path.cubicTo(585.234009,431.703003, 586.101013,432.5, 586.617004,433.492004);
699SkOpSegment::findNextWinding simple
700SkOpSegment::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
701bridgeWinding current id=6 from=(586.617004,433.492004) to=(586.875,436.812012)
702path.cubicTo(587.125,434.5, 587.25,435.664001, 586.875,436.812012);
703SkOpSegment::findNextWinding simple
704SkOpSegment::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
705bridgeWinding current id=10 from=(586.875,436.812012) to=(590.328003,437.937012)
706SkOpSegment::nextChase mismatched signs
707SkOpSegment::findNextWinding simple
708SkOpSegment::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
709bridgeWinding current id=9 from=(590.328003,437.937012) to=(585.210999,427.875)
710path.lineTo(590.328003,437.937012);
711path.cubicTo(591.695007,433.734009, 589.406006,429.242004, 585.210999,427.875);
712SkOpSegment::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
713SkOpSegment::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
714SkOpSegment::markAngle last seg=20 span=40
715SkOpSegment::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
716SkOpSegment::nextChase mismatched signs
717SkOpSegment::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
718SkOpSegment::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
719SkOpSegment::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
720SkOpSegment::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
721SkOpSegment::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
722SkOpSegment::nextChase mismatched signs
723SkOpSegment::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
724SkOpSegment::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
725SkOpSegment::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
726SkOpSegment::markAngle last seg=16 span=31 windSum=1
727SkOpSegment::markWinding id=3 (578.60199,434.125 575.14801,433) t=0 [5] (578.60199,434.125) tEnd=1 newWindSum=-1 windSum=? windValue=1
728SkOpSegment::markAngle last seg=3 span=5 windSum=-1
729SkOpSegment::findNextWinding
730SkOpAngle::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
731SkOpAngle::dumpOne [19/13] next=19/12 sect=5/5 s=0.999907158 [41] e=1 [38] sgn=-1 windVal=1 windSum=1
732SkOpAngle::dumpOne [19/12] next=3/4 sect=21/25 s=0.999907158 [41] e=0 [37] sgn=1 windVal=1 windSum=1
733SkOpAngle::dumpOne [3/4] next=4/5 sect=29/29 s=1 [6] e=0 [5] sgn=1 windVal=1 windSum=-1
734SkOpSegment::findNextWinding chase.append segment=20 span=40
735SkOpSegment::findNextWinding chase.append segment=16 span=31 windSum=1
736SkOpSegment::findNextWinding chase.append segment=3 span=5 windSum=-1
737SkOpSegment::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
738SkOpSegment::findNextWinding from:[4] to:[19] start=107589448 end=107588904
739bridgeWinding current id=4 from=(585.210022,427.875) to=(575.14801,433)
740path.cubicTo(581.015015,426.515991, 576.515015,428.796997, 575.14801,433);
741SkOpSegment::findNextWinding simple
742SkOpSegment::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
743bridgeWinding current id=19 from=(575.148621,433.000183) to=(575.148987,432.999023)
744SkOpSegment::findNextWinding
745SkOpAngle::dumpOne [20/14] next=3/3 sect=13/13 s=1 [40] e=0 [39] sgn=1 windVal=1 windSum=1
746SkOpAngle::dumpOne [3/3] next=16/9 sect=13/13 s=0 [5] e=1 [6] sgn=-1 windVal=1 windSum=-1
747SkOpAngle::dumpOne [16/9] next=2/2 sect=21/25 s=0 [31] e=1 [32] sgn=-1 windVal=1 windSum=1
748SkOpAngle::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
749SkOpSegment::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
750SkOpSegment::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
751SkOpSegment::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
752SkOpSegment::nextChase mismatched signs
753SkOpSegment::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
754SkOpSegment::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
755SkOpSegment::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
756SkOpSegment::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
757SkOpSegment::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
758SkOpSegment::nextChase mismatched signs
759SkOpSegment::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
760SkOpSegment::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
761SkOpSegment::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
762SkOpSegment::findNextWinding from:[20] to:[3] start=84323264 end=84323408
763bridgeWinding current id=20 from=(575.148987,432.999023) to=(578.60199,434.125)
764path.lineTo(575.148987,432.999023);
765SkOpSegment::findNextWinding
766SkOpAngle::dumpOne [3/4] next=4/5 sect=29/29 s=1 [6] e=0 [5] sgn=1 windVal=1 windSum=-1
767SkOpAngle::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
768SkOpAngle::dumpOne [19/13] next=19/12 sect=5/5 s=0.999907158 [41] e=1 [38] sgn=-1 windVal=1 windSum=1 done
769SkOpAngle::dumpOne [19/12] next=3/4 sect=21/25 s=0.999907158 [41] e=0 [37] sgn=1 windVal=1 windSum=1 done
770SkOpSegment::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
771SkOpSegment::findNextWinding from:[3] to:[19] start=107589448 end=107588760
772bridgeWinding current id=3 from=(578.60199,434.125) to=(575.14801,433)
773path.lineTo(578.60199,434.125);
774path.lineTo(575.14801,433);
775</div>
776
Cary Clarkab2d73b2016-12-16 17:17:25 -0500777<div id="joel_9">
778SkDCubic::ComplexBreak
779{{{135.9219970703125, 286.843994140625}, {137.0699920654296875, 287.218994140625}, {138.24200439453125, 287.08599853515625}, {139.24200439453125, 286.5780029296875}}},
780maxCurvature[0]=0.792934788 {{{135.4119318213115264, 287.8851344587143899}, {141.7889152443062528, 285.8031681979956034}}},
781SkDCubic::ComplexBreak
782{{{144.8590087890625, 285.1719970703125}, {143.49200439453125, 289.375}, {138.99200439453125, 291.656005859375}, {134.7970123291015625, 290.2969970703125}}},
783maxCurvature[0]=0.500369557 {{{151.8091004853574191, 284.2739657784525775}, {129.9598379993292951, 295.3706402825127384}}},
784SkDCubic::ComplexBreak
785{{{133.13299560546875, 281.36700439453125}, {132.75799560546875, 282.50799560546875}, {132.88299560546875, 283.68701171875}, {133.3909912109375, 284.67901611328125}}},
786maxCurvature[0]=0.890138394 {{{131.9702953334127074, 281.2544561239553218}, {134.504877661677142, 287.4367308089338735}}},
787SkDCubic::ComplexBreak
788{{{134.7969970703125, 290.2960205078125}, {130.60198974609375, 288.92901611328125}, {128.3130035400390625, 284.43701171875}, {129.67999267578125, 280.24102783203125}}},
789maxCurvature[0]=0.501284828 {{{135.6786690755316727, 297.2365018076872047}, {124.6125777463847015, 275.3942315809875936}}},
790SkDCubic::ComplexBreak
791{{{138.6089935302734375, 278.57000732421875}, {137.46099853515625, 278.2030029296875}, {136.2969970703125, 278.3280029296875}, {135.2969970703125, 278.83599853515625}}},
792maxCurvature[0]=0.752685444 {{{139.2766403970662736, 277.5953584796508267}, {132.8559815638245141, 279.4666826521223584}}},
793SkDCubic::ComplexBreak
794{{{129.67999267578125, 280.24200439453125}, {131.0469970703125, 276.03900146484375}, {135.5389862060546875, 273.75799560546875}, {139.7419891357421875, 275.11700439453125}}},
795maxCurvature[0]=0.497337863 {{{122.7256959778976722, 281.2074843176263244}, {144.5112303093615367, 270.009707570421881}}},
796SkDCubic::ComplexBreak
797{{{141.406005859375, 284.05499267578125}, {141.77301025390625, 282.906982421875}, {141.64801025390625, 281.7349853515625}, {141.14801025390625, 280.7349853515625}}},
798maxCurvature[0]=0.832410427 {{{142.480311641757794, 284.4077599725231948}, {140.2541820165808417, 278.0948877187078097}}},
799SkDCubic::ComplexBreak
800{{{139.74200439453125, 275.11798095703125}, {143.93701171875, 276.49298095703125}, {146.2190093994140625, 280.97698974609375}, {144.8590087890625, 285.1729736328125}}},
801maxCurvature[0]=0.502822735 {{{138.8970629124157199, 268.1903632194039346}, {149.9014014889614828, 290.0464803476303359}}},
802<empty>
803<empty>
804seg=1 {{{135.921997f, 286.843994f}, {137.069992f, 287.218994f}, {138.242004f, 287.085999f}, {139.242004f, 286.578003f}}}
805seg=2 {{{139.242004f, 286.578003f}, {140.234009f, 286.078003f}, {141.031006f, 285.203003f}, {141.406006f, 284.054993f}}}
806seg=3 {{{141.406006f, 284.054993f}, {144.859009f, 285.171997f}}}
807seg=4 {{{144.859009f, 285.171997f}, {143.492004f, 289.375f}, {138.992004f, 291.656006f}, {134.797012f, 290.296997f}}}
808seg=5 {{{134.797012f, 290.296997f}, {135.921997f, 286.843994f}}}
809<empty>
810seg=6 {{{133.132996f, 281.367004f}, {132.757996f, 282.507996f}, {132.882996f, 283.687012f}, {133.390991f, 284.679016f}}}
811seg=7 {{{133.390991f, 284.679016f}, {133.906998f, 285.679016f}, {134.773987f, 286.468018f}, {135.921997f, 286.843018f}}}
812seg=8 {{{135.921997f, 286.843018f}, {134.796997f, 290.296021f}}}
813seg=9 {{{134.796997f, 290.296021f}, {130.60199f, 288.929016f}, {128.313004f, 284.437012f}, {129.679993f, 280.241028f}}}
814seg=10 {{{129.679993f, 280.241028f}, {133.132996f, 281.367004f}}}
815<empty>
816seg=11 {{{138.608994f, 278.570007f}, {137.460999f, 278.203003f}, {136.296997f, 278.328003f}, {135.296997f, 278.835999f}}}
817seg=12 {{{135.296997f, 278.835999f}, {134.296997f, 279.343994f}, {133.507996f, 280.218994f}, {133.132996f, 281.367004f}}}
818seg=13 {{{133.132996f, 281.367004f}, {129.679993f, 280.242004f}}}
819seg=14 {{{129.679993f, 280.242004f}, {131.046997f, 276.039001f}, {135.538986f, 273.757996f}, {139.741989f, 275.117004f}}}
820seg=15 {{{139.741989f, 275.117004f}, {138.608994f, 278.570007f}}}
821seg=16 {{{141.406006f, 284.054993f}, {141.77301f, 282.906982f}, {141.64801f, 281.734985f}, {141.14801f, 280.734985f}}}
822seg=17 {{{141.14801f, 280.734985f}, {140.625015f, 279.734985f}, {139.757004f, 278.945984f}, {138.609009f, 278.570984f}}}
823seg=18 {{{138.609009f, 278.570984f}, {139.742004f, 275.117981f}}}
824seg=19 {{{139.742004f, 275.117981f}, {143.937012f, 276.492981f}, {146.219009f, 280.97699f}, {144.859009f, 285.172974f}}}
825seg=20 {{{144.859009f, 285.172974f}, {141.406006f, 284.054993f}}}
826debugShowCubicIntersection 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}}}
827debugShowCubicIntersection 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}}}
828debugShowCubicLineIntersection 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}}}
829debugShowCubicLineIntersection 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}}}
830debugShowCubicIntersection 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}}}
831debugShowCubicLineIntersection 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}}}
832debugShowCubicLineIntersection 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}}}
833debugShowCubicIntersection 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}}}
834debugShowCubicLineIntersection 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}}}
835SkOpSegment::addT insert t=0.00025401744 segID=18 spanID=41
836debugShowCubicIntersection 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}}}
837debugShowCubicLineIntersection 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}}}
838debugShowCubicIntersection 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}}}
839debugShowLineIntersection 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
840SkOpSegment::addT insert t=0.00025401744 segID=15 spanID=42
841debugShowCubicLineIntersection 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}}}
842debugShowCubicIntersection 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}}}
843debugShowCubicIntersection 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}}}
844debugShowCubicLineIntersection 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}}}
845debugShowCubicLineIntersection 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}}}
846debugShowCubicLineIntersection 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}}}
847debugShowLineIntersection 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}}}
848debugShowCubicIntersection 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}}}
849debugShowCubicLineIntersection 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}}}
850SkOpSegment::addT insert t=7.00240426e-05 segID=14 spanID=43
851debugShowCubicIntersection 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}}}
852debugShowCubicIntersection 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}}}
853debugShowCubicLineIntersection 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}}}
854debugShowCubicLineIntersection 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}}}
855debugShowCubicIntersection 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}}}
856debugShowCubicLineIntersection 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}}}
857debugShowCubicLineIntersection 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}}}
858debugShowCubicIntersection 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}}}
859debugShowCubicLineIntersection 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}}}
860debugShowCubicIntersection 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}}}
861debugShowCubicLineIntersection 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}}}
862debugShowCubicIntersection 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}}}
863debugShowCubicLineIntersection 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}}}
864debugShowLineIntersection 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}}}
865debugShowCubicLineIntersection 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}}}
866SkOpSegment::addT insert t=7.00717611e-05 segID=4 spanID=44
867debugShowCubicIntersection 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}}}
868debugShowCubicIntersection 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}}}
869debugShowCubicLineIntersection 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}}}
870debugShowCubicLineIntersection 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}}}
871debugShowCubicIntersection 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}}}
872debugShowCubicLineIntersection 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}}}
873debugShowCubicLineIntersection 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}}}
874debugShowCubicIntersection 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}}}
875debugShowCubicIntersection 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}}}
876debugShowCubicLineIntersection 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}}}
877SkOpSegment::addT insert t=0.000255675976 segID=8 spanID=45
878debugShowCubicLineIntersection 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}}}
879debugShowLineIntersection 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
880SkOpSegment::addT insert t=0.000254375091 segID=5 spanID=46
881debugShowCubicIntersection 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}}}
882debugShowCubicLineIntersection 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}}}
883debugShowCubicIntersection 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}}}
884debugShowCubicIntersection 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}}}
885debugShowCubicLineIntersection 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}}}
886debugShowCubicLineIntersection 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}}}
887debugShowCubicIntersection 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}}}
888debugShowCubicLineIntersection 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}}}
889debugShowCubicLineIntersection 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
89100: seg/base=5/46 seg/base=8/45 MarkCoinStart
89201: seg/base=5/10 seg/base=8/16 MarkCoinEnd
89302: seg/base=18/41 seg/base=15/42 MarkCoinStart
89403: seg/base=18/36 seg/base=15/30 MarkCoinEnd
895SkOpSegment::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
896SkOpSegment::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
897SkOpSegment::debugShowActiveSpans id=13 (133.132996,281.367004 129.679993,280.242004) t=0 tEnd=1 windSum=? windValue=1
898SkOpSegment::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
899SkOpSegment::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
900SkOpSegment::debugShowActiveSpans id=15 (139.741989,275.117004 139.741699,275.117889) t=0 tEnd=0.00025401744 windSum=? windValue=1
901SkOpSegment::debugShowActiveSpans id=15 (139.741699,275.117889 138.608994,278.570007) t=0.00025401744 tEnd=1 windSum=? windValue=1
902SkOpSegment::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
903SkOpSegment::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
904SkOpSegment::debugShowActiveSpans id=18 (138.609009,278.570984 138.609299,278.570099) t=0 tEnd=0.00025401744 windSum=? windValue=1
905SkOpSegment::debugShowActiveSpans id=18 (138.609299,278.570099 139.742004,275.117981) t=0.00025401744 tEnd=1 windSum=? windValue=1
906SkOpSegment::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
907SkOpSegment::debugShowActiveSpans id=20 (144.859009,285.172974 141.406006,284.054993) t=0 tEnd=1 windSum=? windValue=1
908SkOpSegment::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
909SkOpSegment::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
910SkOpSegment::debugShowActiveSpans id=8 (135.921997,286.843018 135.921707,286.843903) t=0 tEnd=0.000255675976 windSum=? windValue=1
911SkOpSegment::debugShowActiveSpans id=8 (135.921707,286.843903 134.796997,290.296021) t=0.000255675976 tEnd=1 windSum=? windValue=1
912SkOpSegment::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
913SkOpSegment::debugShowActiveSpans id=10 (129.679993,280.241028 133.132996,281.367004) t=0 tEnd=1 windSum=? windValue=1
914SkOpSegment::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
915SkOpSegment::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
916SkOpSegment::debugShowActiveSpans id=3 (141.406006,284.054993 144.859009,285.171997) t=0 tEnd=1 windSum=? windValue=1
917SkOpSegment::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
918SkOpSegment::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
919SkOpSegment::debugShowActiveSpans id=5 (134.797012,290.296997 134.797302,290.296112) t=0 tEnd=0.000254375091 windSum=? windValue=1
920SkOpSegment::debugShowActiveSpans id=5 (134.797302,290.296112 135.921997,286.843994) t=0.000254375091 tEnd=1 windSum=? windValue=1
921------------------x--x---------------- move_multiples
92200: seg/base=5/46 seg/base=8/45 MarkCoinStart
92301: seg/base=5/10 seg/base=8/16 MarkCoinEnd
92402: seg/base=18/41 seg/base=15/42 MarkCoinStart
92503: seg/base=18/36 seg/base=15/30 MarkCoinEnd
926------------------x--x---------------- move_nearby
92700: seg/base=5/46 seg/base=8/45 MarkCoinStart
92801: seg/base=5/10 seg/base=8/16 MarkCoinEnd
92902: seg/base=18/41 seg/base=15/42 MarkCoinStart
93003: seg/base=18/36 seg/base=15/30 MarkCoinEnd
931------------------x--x---------------- correctEnds
93200: seg/base=5/46 seg/base=8/45 MarkCoinStart
93301: seg/base=5/10 seg/base=8/16 MarkCoinEnd
93402: seg/base=18/41 seg/base=15/42 MarkCoinStart
93503: seg/base=18/36 seg/base=15/30 MarkCoinEnd
936------------------x--x---------------- addEndMovedSpans
93700: seg/base=5/46 seg/base=8/45 MarkCoinStart
93801: seg/base=5/10 seg/base=8/16 MarkCoinEnd
93902: seg/base=18/41 seg/base=15/42 MarkCoinStart
94003: seg/base=18/36 seg/base=15/30 MarkCoinEnd
941------------------x--x---------------- expand
94200: seg/base=5/46 seg/base=8/45 MarkCoinStart
94301: seg/base=5/10 seg/base=8/16 MarkCoinEnd
94402: seg/base=18/41 seg/base=15/42 MarkCoinStart
94503: seg/base=18/36 seg/base=15/30 MarkCoinEnd
946------------------x--x---------------- addExpanded
94700: seg/base=5/46 seg/base=8/45 MarkCoinStart
94801: seg/base=5/10 seg/base=8/16 MarkCoinEnd
94902: seg/base=18/41 seg/base=15/42 MarkCoinStart
95003: seg/base=18/36 seg/base=15/30 MarkCoinEnd
951------------------x--x---------------- mark
95200: seg/base=5/46 seg/base=8/45 MarkCoinStart
95301: seg/base=5/10 seg/base=8/16 MarkCoinEnd
95402: seg/base=18/41 seg/base=15/42 MarkCoinStart
95503: seg/base=18/36 seg/base=15/30 MarkCoinEnd
956-------------------------------------- missing_coincidence
957-------------------------------------- expand
958-------------------------------------- expand
959-------------------------------------- apply
960SkOpSegment::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
961SkOpSegment::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
962SkOpSegment::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
963SkOpSegment::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
965SkOpSegment::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
966SkOpSegment::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
967SkOpSegment::debugShowActiveSpans id=13 (133.132996,281.367004 129.679993,280.242004) t=0 tEnd=1 windSum=? windValue=1
968SkOpSegment::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
969SkOpSegment::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
970SkOpSegment::debugShowActiveSpans id=15 (139.741989,275.117004 139.741699,275.117889) t=0 tEnd=0.00025401744 windSum=? windValue=1
971SkOpSegment::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
972SkOpSegment::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
973SkOpSegment::debugShowActiveSpans id=18 (138.609009,278.570984 138.609299,278.570099) t=0 tEnd=0.00025401744 windSum=? windValue=1
974SkOpSegment::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
975SkOpSegment::debugShowActiveSpans id=20 (144.859009,285.172974 141.406006,284.054993) t=0 tEnd=1 windSum=? windValue=1
976SkOpSegment::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
977SkOpSegment::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
978SkOpSegment::debugShowActiveSpans id=8 (135.921997,286.843018 135.921707,286.843903) t=0 tEnd=0.000255675976 windSum=? windValue=1
979SkOpSegment::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
980SkOpSegment::debugShowActiveSpans id=10 (129.679993,280.241028 133.132996,281.367004) t=0 tEnd=1 windSum=? windValue=1
981SkOpSegment::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
982SkOpSegment::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
983SkOpSegment::debugShowActiveSpans id=3 (141.406006,284.054993 144.859009,285.171997) t=0 tEnd=1 windSum=? windValue=1
984SkOpSegment::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
985SkOpSegment::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
986SkOpSegment::debugShowActiveSpans id=5 (134.797012,290.296997 134.797302,290.296112) t=0 tEnd=0.000254375091 windSum=? windValue=1
987-------------------------------------- calc_angles
988SkOpSegment::sortAngles [11] tStart=0 [21]
989SkOpSegment::sortAngles [12] tStart=1 [24]
Cary Clark59d5a0e2017-01-23 14:38:52 +0000990SkOpAngle::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
Cary Clarkab2d73b2016-12-16 17:17:25 -0500991SkOpAngle::afterPart {{{133.132996,281.367004}, {133.507996,280.218994}, {134.296997,279.343994}, {135.296997,278.835999}}} id=12
992SkOpAngle::afterPart {{{133.132996,281.367004}, {132.757996,282.507996}, {132.882996,283.687012}, {133.390991,284.679016}}} id=6
993SkOpAngle::afterPart {{{133.132996,281.367004}, {129.679993,280.241028}}} id=10
Cary Clark59d5a0e2017-01-23 14:38:52 +0000994SkOpAngle::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
Cary Clarkab2d73b2016-12-16 17:17:25 -0500995SkOpAngle::afterPart {{{133.132996,281.367004}, {133.507996,280.218994}, {134.296997,279.343994}, {135.296997,278.835999}}} id=12
996SkOpAngle::afterPart {{{133.132996,281.367004}, {129.679993,280.242004}}} id=13
997SkOpAngle::afterPart {{{133.132996,281.367004}, {129.679993,280.241028}}} id=10
Cary Clark59d5a0e2017-01-23 14:38:52 +0000998SkOpAngle::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
Cary Clarkab2d73b2016-12-16 17:17:25 -0500999SkOpAngle::afterPart {{{133.132996,281.367004}, {129.679993,280.241028}}} id=10
1000SkOpAngle::afterPart {{{133.132996,281.367004}, {129.679993,280.242004}}} id=13
1001SkOpAngle::afterPart {{{133.132996,281.367004}, {132.757996,282.507996}, {132.882996,283.687012}, {133.390991,284.679016}}} id=6
1002SkOpSegment::sortAngles [13] tStart=0 [25]
1003SkOpSegment::sortAngles [14] tStart=7.00240426e-05 [43]
Cary Clark59d5a0e2017-01-23 14:38:52 +00001004SkOpAngle::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
1005SkOpAngle::afterPart {{{129.679993,280.241028}, {129.679703,280.241913}, {129.679798,280.241619}, {129.679703,280.241913}}} id=14
Cary Clarkab2d73b2016-12-16 17:17:25 -05001006SkOpAngle::afterPart {{{129.679993,280.241028}, {128.313004,284.437012}, {130.60199,288.929016}, {134.796997,290.296021}}} id=9
Cary Clark59d5a0e2017-01-23 14:38:52 +00001007SkOpAngle::afterPart {{{129.679993,280.241028}, {131.047339,276.038588}, {135.538991,273.757999}, {139.741699,275.116913}}} id=14
1008SkOpAngle::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
Cary Clarkab2d73b2016-12-16 17:17:25 -05001009SkOpAngle::afterPart {{{129.679993,280.241028}, {129.679703,280.241913}, {129.679798,280.241619}, {129.679703,280.241913}}} id=14
1010SkOpAngle::afterPart {{{129.679993,280.241028}, {133.132996,281.367004}}} id=10
1011SkOpAngle::afterPart {{{129.679993,280.241028}, {128.313004,284.437012}, {130.60199,288.929016}, {134.796997,290.296021}}} id=9
Cary Clark59d5a0e2017-01-23 14:38:52 +00001012SkOpAngle::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
Cary Clarkab2d73b2016-12-16 17:17:25 -05001013SkOpAngle::afterPart {{{129.679993,280.241028}, {128.313004,284.437012}, {130.60199,288.929016}, {134.796997,290.296021}}} id=9
1014SkOpAngle::afterPart {{{129.679993,280.241028}, {133.132996,281.367004}}} id=10
1015SkOpAngle::afterPart {{{129.679993,280.241028}, {131.047339,276.038588}, {135.538991,273.757999}, {139.741699,275.116913}}} id=14
1016SkOpSegment::sortAngles [15] tStart=0.00025401744 [42]
1017SkOpSegment::sortAngles [16] tStart=0 [31]
Cary Clark59d5a0e2017-01-23 14:38:52 +00001018SkOpAngle::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
Cary Clarkab2d73b2016-12-16 17:17:25 -05001019SkOpAngle::afterPart {{{141.406006,284.054993}, {141.77301,282.906982}, {141.64801,281.734985}, {141.14801,280.734985}}} id=16
1020SkOpAngle::afterPart {{{141.406006,284.054993}, {141.031006,285.203003}, {140.234009,286.078003}, {139.242004,286.578003}}} id=2
1021SkOpAngle::afterPart {{{141.406006,284.054993}, {144.859009,285.171997}}} id=3
Cary Clark59d5a0e2017-01-23 14:38:52 +00001022SkOpAngle::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
Cary Clarkab2d73b2016-12-16 17:17:25 -05001023SkOpAngle::afterPart {{{141.406006,284.054993}, {141.77301,282.906982}, {141.64801,281.734985}, {141.14801,280.734985}}} id=16
1024SkOpAngle::afterPart {{{141.406006,284.054993}, {144.859009,285.172974}}} id=20
1025SkOpAngle::afterPart {{{141.406006,284.054993}, {141.031006,285.203003}, {140.234009,286.078003}, {139.242004,286.578003}}} id=2
Cary Clark59d5a0e2017-01-23 14:38:52 +00001026SkOpAngle::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
Cary Clarkab2d73b2016-12-16 17:17:25 -05001027SkOpAngle::afterPart {{{141.406006,284.054993}, {141.031006,285.203003}, {140.234009,286.078003}, {139.242004,286.578003}}} id=2
1028SkOpAngle::afterPart {{{141.406006,284.054993}, {144.859009,285.172974}}} id=20
1029SkOpAngle::afterPart {{{141.406006,284.054993}, {144.859009,285.171997}}} id=3
1030SkOpSegment::sortAngles [18] tStart=0.00025401744 [41]
1031SkOpSegment::sortAngles [19] tStart=0 [37]
1032SkOpSegment::sortAngles [19] tStart=1 [38]
Cary Clark59d5a0e2017-01-23 14:38:52 +00001033SkOpAngle::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
1034SkOpAngle::afterPart {{{144.858719,285.172882}, {146.218719,280.976898}, {143.936722,276.492889}, {139.741714,275.117889}}} id=19
Cary Clarkab2d73b2016-12-16 17:17:25 -05001035SkOpAngle::afterPart {{{144.858719,285.172882}, {144.859009,285.171997}, {144.858913,285.172292}, {144.859009,285.171997}}} id=4
Cary Clark59d5a0e2017-01-23 14:38:52 +00001036SkOpAngle::afterPart {{{144.858719,285.172882}, {141.405716,284.054901}}} id=20
1037SkOpAngle::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
Cary Clarkab2d73b2016-12-16 17:17:25 -05001038SkOpAngle::afterPart {{{144.858719,285.172882}, {146.218719,280.976898}, {143.936722,276.492889}, {139.741714,275.117889}}} id=19
1039SkOpAngle::afterPart {{{144.858719,285.172882}, {143.491371,289.375321}, {138.99171,291.655911}, {134.797012,290.296997}}} id=4
1040SkOpAngle::afterPart {{{144.858719,285.172882}, {141.405716,284.054901}}} id=20
Cary Clark59d5a0e2017-01-23 14:38:52 +00001041SkOpAngle::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
1042SkOpAngle::afterPart {{{144.858719,285.172882}, {141.405716,284.054901}}} id=20
Cary Clarkab2d73b2016-12-16 17:17:25 -05001043SkOpAngle::afterPart {{{144.858719,285.172882}, {143.491371,289.375321}, {138.99171,291.655911}, {134.797012,290.296997}}} id=4
1044SkOpAngle::afterPart {{{144.858719,285.172882}, {144.859009,285.171997}, {144.858913,285.172292}, {144.859009,285.171997}}} id=4
1045SkOpSegment::sortAngles [20] tStart=0 [39]
1046SkOpSegment::sortAngles [20] tStart=1 [40]
1047SkOpSegment::sortAngles [6] tStart=0 [11]
1048SkOpSegment::sortAngles [8] tStart=0.000255675976 [45]
1049SkOpSegment::sortAngles [9] tStart=0 [17]
1050SkOpSegment::sortAngles [9] tStart=1 [18]
1051SkOpSegment::sortAngles [10] tStart=0 [19]
1052SkOpSegment::sortAngles [10] tStart=1 [20]
1053SkOpSegment::sortAngles [1] tStart=0 [1]
1054SkOpSegment::sortAngles [2] tStart=1 [4]
1055SkOpSegment::sortAngles [3] tStart=0 [5]
1056SkOpSegment::sortAngles [4] tStart=7.00717611e-05 [44]
1057SkOpSegment::sortAngles [5] tStart=0.000254375091 [46]
1058coinSpan - id=5 t=0.000254375091 tEnd=1
1059coinSpan + id=8 t=1 tEnd=0.000255675976
1060coinSpan - id=18 t=0.00025401744 tEnd=1
1061coinSpan + id=15 t=1 tEnd=0.00025401744
1062SkOpSpan::sortableTop dir=kTop seg=11 t=0.5 pt=(136.897491,278.374878)
1063SkOpSpan::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)
1064SkOpSpan::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)
1065SkOpSegment::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
1066SkOpSegment::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
1067SkOpSegment::nextChase mismatched signs
1068SkOpSegment::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
1069SkOpSegment::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
1070SkOpSegment::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
1071SkOpSegment::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
1072SkOpSegment::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
1073SkOpSegment::nextChase mismatched signs
1074SkOpSegment::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
1075SkOpSegment::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
1076SkOpSegment::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
1077SkOpSegment::nextChase mismatched signs
1078SkOpSegment::findNextWinding simple
1079SkOpSegment::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
1080bridgeWinding current id=11 from=(135.296997,278.835999) to=(138.608994,278.570007)
1081path.moveTo(135.296997,278.835999);
1082path.cubicTo(136.296997,278.328003, 137.460999,278.203003, 138.608994,278.570007);
1083SkOpSegment::findNextWinding simple
1084SkOpSegment::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
1085bridgeWinding current id=18 from=(138.609299,278.570099) to=(138.609009,278.570984)
1086SkOpSegment::findNextWinding simple
1087SkOpSegment::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
1088bridgeWinding current id=17 from=(138.609009,278.570984) to=(141.14801,280.734985)
1089path.lineTo(138.609009,278.570984);
1090path.cubicTo(139.757004,278.945984, 140.625015,279.734985, 141.14801,280.734985);
1091SkOpSegment::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
1092SkOpSegment::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
1093SkOpSegment::nextChase mismatched signs
1094SkOpSegment::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
1095SkOpSegment::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
1096SkOpSegment::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
1097SkOpSegment::markAngle last seg=6 span=11 windSum=-1
1098SkOpSegment::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
1099SkOpSegment::markAngle last seg=20 span=39 windSum=-2
1100SkOpSegment::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
1101SkOpSegment::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
1102SkOpSegment::markAngle last seg=4 span=44 windSum=?
1103SkOpSegment::findNextWinding
1104SkOpAngle::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
1105SkOpAngle::dumpOne [2/20] next=20/12 sect=21/21 s=1 [4] e=0 [3] sgn=1 windVal=1 windSum=-1
1106SkOpAngle::dumpOne [20/12] next=3/21 sect=29/29 s=1 [40] e=0 [39] sgn=1 windVal=1 windSum=-2
1107SkOpAngle::dumpOne [3/21] next=16/7 sect=29/29 s=0 [5] e=1 [6] sgn=-1 windVal=1 windSum=-2
1108SkOpSegment::findNextWinding chase.append segment=6 span=11 windSum=-1
1109SkOpSegment::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
1110SkOpSegment::findNextWinding chase.append segment=20 span=39 windSum=-2
1111SkOpSegment::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
1112SkOpSegment::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
1113SkOpSegment::findNextWinding chase.append segment=4 span=44 windSum=-2147483647
1114SkOpSegment::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
Cary Clark59d5a0e2017-01-23 14:38:52 +00001115SkOpSegment::findNextWinding from:[16] to:[2] start=84323080 end=84322936
Cary Clarkab2d73b2016-12-16 17:17:25 -05001116bridgeWinding current id=16 from=(141.14801,280.734985) to=(141.406006,284.054993)
1117path.cubicTo(141.64801,281.734985, 141.77301,282.906982, 141.406006,284.054993);
1118SkOpSegment::findNextWinding simple
1119SkOpSegment::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
1120bridgeWinding current id=2 from=(141.406006,284.054993) to=(139.242004,286.578003)
1121path.cubicTo(141.031006,285.203003, 140.234009,286.078003, 139.242004,286.578003);
1122SkOpSegment::nextChase mismatched signs
1123SkOpSegment::findNextWinding simple
1124SkOpSegment::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
1125bridgeWinding current id=1 from=(139.242004,286.578003) to=(135.921997,286.843994)
1126path.cubicTo(138.242004,287.085999, 137.069992,287.218994, 135.921997,286.843994);
1127SkOpSegment::findNextWinding simple
1128SkOpSegment::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
1129bridgeWinding current id=8 from=(135.921707,286.843903) to=(135.921997,286.843018)
1130SkOpSegment::findNextWinding simple
1131SkOpSegment::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
1132bridgeWinding current id=7 from=(135.921997,286.843018) to=(133.390991,284.679016)
1133path.lineTo(135.921997,286.843018);
1134path.cubicTo(134.773987,286.468018, 133.906998,285.679016, 133.390991,284.679016);
1135SkOpSegment::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
1136SkOpSegment::markAngle last seg=10 span=19 windSum=-2
1137SkOpSegment::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
1138SkOpSegment::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
1139SkOpSegment::markAngle last seg=14 span=43 windSum=-1
1140SkOpSegment::findNextWinding
1141SkOpAngle::dumpOne [6/13] next=12/2 sect=21/25 s=0 [11] e=1 [12] sgn=-1 windVal=1 windSum=-1
1142SkOpAngle::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
1143SkOpAngle::dumpOne [10/18] next=13/3 sect=13/13 s=1 [20] e=0 [19] sgn=1 windVal=1 windSum=-2
1144SkOpAngle::dumpOne [13/3] next=6/13 sect=13/13 s=0 [25] e=1 [26] sgn=-1 windVal=1 windSum=-2
1145SkOpSegment::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
1146SkOpSegment::findNextWinding chase.append segment=10 span=19 windSum=-2
1147SkOpSegment::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
1148SkOpSegment::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
1149SkOpSegment::findNextWinding chase.append segment=14 span=43 windSum=-1
1150SkOpSegment::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
Cary Clark59d5a0e2017-01-23 14:38:52 +00001151SkOpSegment::findNextWinding from:[6] to:[12] start=107586600 end=107586456
Cary Clarkab2d73b2016-12-16 17:17:25 -05001152bridgeWinding current id=6 from=(133.390991,284.679016) to=(133.132996,281.367004)
1153path.cubicTo(132.882996,283.687012, 132.757996,282.507996, 133.132996,281.367004);
1154SkOpSegment::findNextWinding simple
1155SkOpSegment::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
1156bridgeWinding current id=12 from=(133.132996,281.367004) to=(135.296997,278.835999)
1157path.cubicTo(133.507996,280.218994, 134.296997,279.343994, 135.296997,278.835999);
1158path.close();
1159SkOpSegment::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
1160SkOpSegment::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
1161SkOpSegment::nextChase mismatched signs
1162SkOpSegment::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
1163SkOpSegment::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
1164SkOpSegment::markAngle last seg=4 span=44 windSum=-2
1165SkOpSegment::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
1166SkOpSegment::debugShowActiveSpans id=15 (139.741989,275.117004 139.741699,275.117889) t=0 tEnd=0.00025401744 windSum=-1 oppSum=0 windValue=1 oppValue=0
1167SkOpSegment::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
1168SkOpSegment::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
1169SkOpSegment::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
1170SkOpSegment::debugShowActiveSpans id=5 (134.797012,290.296997 134.797302,290.296112) t=0 tEnd=0.000254375091 windSum=-2 windValue=1
1171SkOpSegment::findNextWinding simple
1172SkOpSegment::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
1173bridgeWinding current id=14 from=(129.680283,280.241119) to=(139.741989,275.117004)
1174path.moveTo(129.680283,280.241119);
1175path.cubicTo(131.047623,276.038666, 135.539276,273.758087, 139.741989,275.117004);
1176SkOpSegment::nextChase mismatched signs
1177SkOpSegment::findNextWinding simple
1178SkOpSegment::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
1179bridgeWinding current id=15 from=(139.741989,275.117004) to=(139.741699,275.117889)
1180SkOpSegment::findNextWinding
1181SkOpAngle::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
1182SkOpAngle::dumpOne [20/11] next=4/23 sect=13/13 s=0 [39] e=1 [40] sgn=-1 windVal=1 windSum=-2 done
1183SkOpAngle::dumpOne [4/23] next=4/22 sect=21/17 s=7.00717611e-05 [44] e=1 [8] sgn=-1 windVal=1 windSum=-2
1184SkOpAngle::dumpOne [4/22] next=19/10 sect=5/5 s=7.00717611e-05 [44] e=0 [7] sgn=1 windVal=1 windSum=-2 done
1185SkOpSegment::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
Cary Clark59d5a0e2017-01-23 14:38:52 +00001186SkOpSegment::findNextWinding from:[19] to:[4] start=107589880 end=84323576
Cary Clarkab2d73b2016-12-16 17:17:25 -05001187bridgeWinding current id=19 from=(139.742004,275.117981) to=(144.859009,285.172974)
1188path.lineTo(139.741699,275.117889);
1189path.cubicTo(143.937012,276.492981, 146.219009,280.97699, 144.859009,285.172974);
1190SkOpSegment::findNextWinding simple
1191SkOpSegment::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
1192SkOpSegment::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
1193SkOpSegment::debugShowActiveSpans id=5 (134.797012,290.296997 134.797302,290.296112) t=0 tEnd=0.000254375091 windSum=-2 windValue=1
1194SkOpSegment::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
1195SkOpSegment::nextChase mismatched signs
1196SkOpSegment::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
1197SkOpSegment::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
Cary Clark59d5a0e2017-01-23 14:38:52 +00001200<div id="issue3838">
1201seg=1 {{{200, 170}, {220, 170}}}
1202seg=2 {{{220, 170}, {220, 230}}}
1203seg=3 {{{220, 230}, {240, 230}}}
1204seg=4 {{{240, 230}, {240, 210}}}
1205seg=5 {{{240, 210}, {180, 210}}}
1206seg=6 {{{180, 210}, {180, 190}}}
1207seg=7 {{{180, 190}, {260, 190}}}
1208seg=8 {{{260, 190}, {260, 250}}}
1209seg=9 {{{260, 250}, {200, 250}}}
1210seg=10 {{{200, 250}, {200, 170}}}
1211debugShowLineIntersection wtTs[0]=0 {{{220,170}, {220,230}}} {{220,170}} wnTs[0]=1 {{{200,170}, {220,170}}}
1212debugShowLineIntersection wtTs[0]=1 {{{200,250}, {200,170}}} {{200,170}} wnTs[0]=0 {{{200,170}, {220,170}}}
1213debugShowLineIntersection wtTs[0]=0 {{{220,230}, {240,230}}} {{220,230}} wnTs[0]=1 {{{220,170}, {220,230}}}
1214debugShowLineIntersection wtTs[0]=0.333333333 {{{240,210}, {180,210}}} {{220,210}} wnTs[0]=0.666667 {{{220,170}, {220,230}}}
1215SkOpSegment::addT insert t=0.666666667 segID=2 spanID=21
1216SkOpSegment::addT insert t=0.333333333 segID=5 spanID=22
1217debugShowLineIntersection wtTs[0]=0.5 {{{180,190}, {260,190}}} {{220,190}} wnTs[0]=0.333333 {{{220,170}, {220,230}}}
1218SkOpSegment::addT insert t=0.333333333 segID=2 spanID=23
1219SkOpSegment::addT insert t=0.5 segID=7 spanID=24
1220debugShowLineIntersection wtTs[0]=0 {{{240,230}, {240,210}}} {{240,230}} wnTs[0]=1 {{{220,230}, {240,230}}}
1221debugShowLineIntersection wtTs[0]=0 {{{240,210}, {180,210}}} {{240,210}} wnTs[0]=1 {{{240,230}, {240,210}}}
1222debugShowLineIntersection wtTs[0]=0 {{{180,210}, {180,190}}} {{180,210}} wnTs[0]=1 {{{240,210}, {180,210}}}
1223debugShowLineIntersection wtTs[0]=0.5 {{{200,250}, {200,170}}} {{200,210}} wnTs[0]=0.666667 {{{240,210}, {180,210}}}
1224SkOpSegment::addT insert t=0.666666667 segID=5 spanID=25
1225SkOpSegment::addT insert t=0.5 segID=10 spanID=26
1226debugShowLineIntersection wtTs[0]=0 {{{180,190}, {260,190}}} {{180,190}} wnTs[0]=1 {{{180,210}, {180,190}}}
1227debugShowLineIntersection wtTs[0]=0 {{{260,190}, {260,250}}} {{260,190}} wnTs[0]=1 {{{180,190}, {260,190}}}
1228debugShowLineIntersection wtTs[0]=0.75 {{{200,250}, {200,170}}} {{200,190}} wnTs[0]=0.25 {{{180,190}, {260,190}}}
1229SkOpSegment::addT insert t=0.25 segID=7 spanID=27
1230SkOpSegment::addT insert t=0.75 segID=10 spanID=28
1231debugShowLineIntersection wtTs[0]=0 {{{260,250}, {200,250}}} {{260,250}} wnTs[0]=1 {{{260,190}, {260,250}}}
1232debugShowLineIntersection wtTs[0]=0 {{{200,250}, {200,170}}} {{200,250}} wnTs[0]=1 {{{260,250}, {200,250}}}
1233-------------------------------------- addExpanded
1234SkOpSegment::debugShowActiveSpans id=1 (200,170 220,170) t=0 tEnd=1 windSum=? windValue=1
1235SkOpSegment::debugShowActiveSpans id=2 (220,170 220,190) t=0 tEnd=0.333333333 windSum=? windValue=1
1236SkOpSegment::debugShowActiveSpans id=2 (220,190 220,210) t=0.333333333 tEnd=0.666666667 windSum=? windValue=1
1237SkOpSegment::debugShowActiveSpans id=2 (220,210 220,230) t=0.666666667 tEnd=1 windSum=? windValue=1
1238SkOpSegment::debugShowActiveSpans id=3 (220,230 240,230) t=0 tEnd=1 windSum=? windValue=1
1239SkOpSegment::debugShowActiveSpans id=4 (240,230 240,210) t=0 tEnd=1 windSum=? windValue=1
1240SkOpSegment::debugShowActiveSpans id=5 (240,210 220,210) t=0 tEnd=0.333333333 windSum=? windValue=1
1241SkOpSegment::debugShowActiveSpans id=5 (220,210 200,210) t=0.333333333 tEnd=0.666666667 windSum=? windValue=1
1242SkOpSegment::debugShowActiveSpans id=5 (200,210 180,210) t=0.666666667 tEnd=1 windSum=? windValue=1
1243SkOpSegment::debugShowActiveSpans id=6 (180,210 180,190) t=0 tEnd=1 windSum=? windValue=1
1244SkOpSegment::debugShowActiveSpans id=7 (180,190 200,190) t=0 tEnd=0.25 windSum=? windValue=1
1245SkOpSegment::debugShowActiveSpans id=7 (200,190 220,190) t=0.25 tEnd=0.5 windSum=? windValue=1
1246SkOpSegment::debugShowActiveSpans id=7 (220,190 260,190) t=0.5 tEnd=1 windSum=? windValue=1
1247SkOpSegment::debugShowActiveSpans id=8 (260,190 260,250) t=0 tEnd=1 windSum=? windValue=1
1248SkOpSegment::debugShowActiveSpans id=9 (260,250 200,250) t=0 tEnd=1 windSum=? windValue=1
1249SkOpSegment::debugShowActiveSpans id=10 (200,250 200,210) t=0 tEnd=0.5 windSum=? windValue=1
1250SkOpSegment::debugShowActiveSpans id=10 (200,210 200,190) t=0.5 tEnd=0.75 windSum=? windValue=1
1251SkOpSegment::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
1265SkOpSegment::sortAngles [2] tStart=0.333333333 [23]
1266SkOpAngle::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
1267SkOpAngle::afterPart {{{220,190}, {220,170}}} id=2
1268SkOpAngle::afterPart {{{220,190}, {200,190}}} id=7
1269SkOpAngle::afterPart {{{220,190}, {220,210}}} id=2
1270SkOpAngle::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
1271SkOpAngle::afterPart {{{220,190}, {220,170}}} id=2
1272SkOpAngle::afterPart {{{220,190}, {260,190}}} id=7
1273SkOpAngle::afterPart {{{220,190}, {200,190}}} id=7
1274SkOpAngle::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
1275SkOpAngle::afterPart {{{220,190}, {200,190}}} id=7
1276SkOpAngle::afterPart {{{220,190}, {260,190}}} id=7
1277SkOpAngle::afterPart {{{220,190}, {220,210}}} id=2
1278SkOpAngle::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
1279SkOpAngle::afterPart {{{220,190}, {220,210}}} id=2
1280SkOpAngle::afterPart {{{220,190}, {260,190}}} id=7
1281SkOpAngle::afterPart {{{220,190}, {220,170}}} id=2
1282SkOpSegment::sortAngles [2] tStart=0.666666667 [21]
1283SkOpAngle::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
1284SkOpAngle::afterPart {{{220,210}, {220,190}}} id=2
1285SkOpAngle::afterPart {{{220,210}, {240,210}}} id=5
1286SkOpAngle::afterPart {{{220,210}, {220,230}}} id=2
1287SkOpAngle::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
1288SkOpAngle::afterPart {{{220,210}, {220,190}}} id=2
1289SkOpAngle::afterPart {{{220,210}, {200,210}}} id=5
1290SkOpAngle::afterPart {{{220,210}, {220,230}}} id=2
1291SkOpSegment::sortAngles [5] tStart=0.333333333 [22]
1292SkOpSegment::sortAngles [5] tStart=0.666666667 [25]
1293SkOpAngle::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
1294SkOpAngle::afterPart {{{200,210}, {220,210}}} id=5
1295SkOpAngle::afterPart {{{200,210}, {200,250}}} id=10
1296SkOpAngle::afterPart {{{200,210}, {180,210}}} id=5
1297SkOpAngle::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
1298SkOpAngle::afterPart {{{200,210}, {220,210}}} id=5
1299SkOpAngle::afterPart {{{200,210}, {200,190}}} id=10
1300SkOpAngle::afterPart {{{200,210}, {180,210}}} id=5
1301SkOpSegment::sortAngles [7] tStart=0.25 [27]
1302SkOpAngle::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
1303SkOpAngle::afterPart {{{200,190}, {180,190}}} id=7
1304SkOpAngle::afterPart {{{200,190}, {200,210}}} id=10
1305SkOpAngle::afterPart {{{200,190}, {220,190}}} id=7
1306SkOpAngle::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
1307SkOpAngle::afterPart {{{200,190}, {180,190}}} id=7
1308SkOpAngle::afterPart {{{200,190}, {200,170}}} id=10
1309SkOpAngle::afterPart {{{200,190}, {200,210}}} id=10
1310SkOpAngle::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
1311SkOpAngle::afterPart {{{200,190}, {200,210}}} id=10
1312SkOpAngle::afterPart {{{200,190}, {200,170}}} id=10
1313SkOpAngle::afterPart {{{200,190}, {220,190}}} id=7
1314SkOpAngle::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
1315SkOpAngle::afterPart {{{200,190}, {220,190}}} id=7
1316SkOpAngle::afterPart {{{200,190}, {200,170}}} id=10
1317SkOpAngle::afterPart {{{200,190}, {180,190}}} id=7
1318SkOpSegment::sortAngles [7] tStart=0.5 [24]
1319SkOpSegment::sortAngles [10] tStart=0.5 [26]
1320SkOpSegment::sortAngles [10] tStart=0.75 [28]
1321SkOpSpan::sortableTop dir=kTop seg=1 t=0.5 pt=(210,170)
1322SkOpSpan::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)
1323SkOpSegment::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
1324SkOpSegment::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
1325SkOpSegment::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
1326SkOpSegment::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
1327SkOpSegment::findNextWinding simple
1328SkOpSegment::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
1329bridgeWinding current id=1 from=(220,170) to=(200,170)
1330SkOpSegment::markWinding id=7 (180,190 260,190) t=0 [13] (180,190) tEnd=0.25 newWindSum=-1 windSum=? windValue=1
1331SkOpSegment::markWinding id=6 (180,210 180,190) t=0 [11] (180,210) tEnd=1 newWindSum=-1 windSum=? windValue=1
1332SkOpSegment::markWinding id=5 (240,210 180,210) t=0.666666667 [25] (200,210) tEnd=1 newWindSum=-1 windSum=? windValue=1
1333SkOpSegment::markAngle last seg=5 span=25 windSum=-1
1334SkOpSegment::markWinding id=10 (200,250 200,170) t=0.5 [26] (200,210) tEnd=0.75 newWindSum=-2 windSum=? windValue=1
1335SkOpSegment::markAngle last seg=10 span=26 windSum=-2
1336SkOpSegment::markWinding id=7 (180,190 260,190) t=0.25 [27] (200,190) tEnd=0.5 newWindSum=-2 windSum=? windValue=1
1337SkOpSegment::markAngle last seg=7 span=24 windSum=?
1338SkOpSegment::findNextWinding
1339SkOpAngle::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
1340SkOpAngle::dumpOne [7/9] next=10/15 sect=15/15 s=0.25 [27] e=0 [13] sgn=1 windVal=1 windSum=-1
1341SkOpAngle::dumpOne [10/15] next=7/10 sect=23/23 s=0.75 [28] e=0.5 [26] sgn=1 windVal=1 windSum=-2
1342SkOpAngle::dumpOne [7/10] next=10/16 sect=31/31 s=0.25 [27] e=0.5 [24] sgn=-1 windVal=1 windSum=-2
1343SkOpSegment::findNextWinding chase.append segment=5 span=25 windSum=-1
1344SkOpSegment::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
1345SkOpSegment::findNextWinding chase.append segment=10 span=26 windSum=-2
1346SkOpSegment::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
1347SkOpSegment::findNextWinding chase.append segment=7 span=24 windSum=-2147483647
1348SkOpSegment::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
1349SkOpSegment::findNextWinding from:[10] to:[7] start=5333632 end=5331472
1350bridgeWinding current id=10 from=(200,170) to=(200,190)
1351path.moveTo(220,170);
1352path.lineTo(200,170);
1353SkOpSegment::findNextWinding simple
1354SkOpSegment::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
1355bridgeWinding current id=7 from=(200,190) to=(180,190)
1356path.lineTo(200,190);
1357SkOpSegment::findNextWinding simple
1358SkOpSegment::markDone id=6 (180,210 180,190) t=0 [11] (180,210) tEnd=1 newWindSum=-1 newOppSum=? oppSum=? windSum=-1 windValue=1 oppValue=0
1359bridgeWinding current id=6 from=(180,190) to=(180,210)
1360path.lineTo(180,190);
1361SkOpSegment::markWinding id=10 (200,250 200,170) t=0 [19] (200,250) tEnd=0.5 newWindSum=-1 windSum=? windValue=1
1362SkOpSegment::markWinding id=9 (260,250 200,250) t=0 [17] (260,250) tEnd=1 newWindSum=-1 windSum=? windValue=1
1363SkOpSegment::markWinding id=8 (260,190 260,250) t=0 [15] (260,190) tEnd=1 newWindSum=-1 windSum=? windValue=1
1364SkOpSegment::markWinding id=7 (180,190 260,190) t=0.5 [24] (220,190) tEnd=1 newWindSum=-1 windSum=? windValue=1
1365SkOpSegment::markAngle last seg=7 span=24 windSum=-1
1366SkOpSegment::markWinding id=5 (240,210 180,210) t=0.333333333 [22] (220,210) tEnd=0.666666667 newWindSum=-2 windSum=? windValue=1
1367SkOpSegment::markAngle last seg=5 span=22 windSum=-2
1368SkOpSegment::findNextWinding
1369SkOpAngle::dumpOne [5/8] next=10/13 sect=15/15 s=0.666666667 [25] e=1 [10] sgn=-1 windVal=1 windSum=-1
1370SkOpAngle::dumpOne [10/13] next=5/7 sect=23/23 s=0.5 [26] e=0 [19] sgn=1 windVal=1 windSum=-1
1371SkOpAngle::dumpOne [5/7] next=10/14 sect=31/31 s=0.666666667 [25] e=0.333333333 [22] sgn=1 windVal=1 windSum=-2
1372SkOpAngle::dumpOne [10/14] next=5/8 sect=7/7 s=0.5 [26] e=0.75 [28] sgn=-1 windVal=1 windSum=-2 done
1373SkOpSegment::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
1374SkOpSegment::findNextWinding chase.append segment=5 span=22 windSum=-2
1375SkOpSegment::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
1376SkOpSegment::findNextWinding from:[5] to:[10] start=5333488 end=5332456
1377bridgeWinding current id=5 from=(180,210) to=(200,210)
1378path.lineTo(180,210);
1379SkOpSegment::findNextWinding simple
1380SkOpSegment::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
1381bridgeWinding current id=10 from=(200,210) to=(200,250)
1382path.lineTo(200,210);
1383SkOpSegment::findNextWinding simple
1384SkOpSegment::markDone id=9 (260,250 200,250) t=0 [17] (260,250) tEnd=1 newWindSum=-1 newOppSum=? oppSum=? windSum=-1 windValue=1 oppValue=0
1385bridgeWinding current id=9 from=(200,250) to=(260,250)
1386path.lineTo(200,250);
1387SkOpSegment::findNextWinding simple
1388SkOpSegment::markDone id=8 (260,190 260,250) t=0 [15] (260,190) tEnd=1 newWindSum=-1 newOppSum=? oppSum=? windSum=-1 windValue=1 oppValue=0
1389bridgeWinding current id=8 from=(260,250) to=(260,190)
1390path.lineTo(260,250);
1391SkOpSegment::markWinding id=2 (220,170 220,230) t=0.333333333 [23] (220,190) tEnd=0.666666667 newWindSum=-2 windSum=? windValue=1
1392SkOpSegment::markAngle last seg=2 span=21 windSum=?
1393SkOpSegment::findNextWinding
1394SkOpAngle::dumpOne [7/12] next=2/1 sect=31/31 s=0.5 [24] e=1 [14] sgn=-1 windVal=1 windSum=-1
1395SkOpAngle::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
1396SkOpAngle::dumpOne [7/11] next=2/2 sect=15/15 s=0.5 [24] e=0.25 [27] sgn=1 windVal=1 windSum=-2 done
1397SkOpAngle::dumpOne [2/2] next=7/12 sect=23/23 s=0.333333333 [23] e=0.666666667 [21] sgn=-1 windVal=1 windSum=-2
1398SkOpSegment::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
1399SkOpSegment::findNextWinding chase.append segment=2 span=21 windSum=-2147483647
1400SkOpSegment::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
1401SkOpSegment::findNextWinding from:[7] to:[2] start=5333056 end=5329832
1402bridgeWinding current id=7 from=(260,190) to=(220,190)
1403path.lineTo(260,190);
1404SkOpSegment::findNextWinding simple
1405SkOpSegment::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
1406bridgeWinding current id=2 from=(220,190) to=(220,170)
1407path.lineTo(220,190);
1408path.lineTo(220,170);
1409path.close();
1410SkOpSegment::markWinding id=2 (220,170 220,230) t=0.666666667 [21] (220,210) tEnd=1 newWindSum=-1 windSum=? windValue=1
1411SkOpSegment::markWinding id=3 (220,230 240,230) t=0 [5] (220,230) tEnd=1 newWindSum=-1 windSum=? windValue=1
1412SkOpSegment::markWinding id=4 (240,230 240,210) t=0 [7] (240,230) tEnd=1 newWindSum=-1 windSum=? windValue=1
1413SkOpSegment::markWinding id=5 (240,210 180,210) t=0 [9] (240,210) tEnd=0.333333333 newWindSum=-1 windSum=? windValue=1
1414SkOpSegment::markAngle last seg=5 span=22 windSum=-2
1415SkOpSegment::markWinding id=5 (240,210 180,210) t=0 [9] (240,210) tEnd=0.333333333 newWindSum=-1 windSum=-1 windValue=1
1416SkOpSegment::debugShowActiveSpans id=2 (220,210 220,230) t=0.666666667 tEnd=1 windSum=-1 windValue=1
1417SkOpSegment::debugShowActiveSpans id=3 (220,230 240,230) t=0 tEnd=1 windSum=-1 windValue=1
1418SkOpSegment::debugShowActiveSpans id=4 (240,230 240,210) t=0 tEnd=1 windSum=-1 windValue=1
1419SkOpSegment::debugShowActiveSpans id=5 (240,210 220,210) t=0 tEnd=0.333333333 windSum=-1 windValue=1
1420SkOpSegment::findNextWinding simple
1421SkOpSegment::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
1422bridgeWinding current id=2 from=(220,210) to=(220,230)
1423SkOpSegment::findNextWinding simple
1424SkOpSegment::markDone id=3 (220,230 240,230) t=0 [5] (220,230) tEnd=1 newWindSum=-1 newOppSum=? oppSum=? windSum=-1 windValue=1 oppValue=0
1425bridgeWinding current id=3 from=(220,230) to=(240,230)
1426path.moveTo(220,210);
1427path.lineTo(220,230);
1428SkOpSegment::findNextWinding simple
1429SkOpSegment::markDone id=4 (240,230 240,210) t=0 [7] (240,230) tEnd=1 newWindSum=-1 newOppSum=? oppSum=? windSum=-1 windValue=1 oppValue=0
1430bridgeWinding current id=4 from=(240,230) to=(240,210)
1431path.lineTo(240,230);
1432SkOpSegment::findNextWinding
1433SkOpAngle::dumpOne [5/5] next=2/3 sect=31/31 s=0.333333333 [22] e=0 [9] sgn=1 windVal=1 windSum=-1
1434SkOpAngle::dumpOne [2/3] next=5/6 sect=7/7 s=0.666666667 [21] e=0.333333333 [23] sgn=1 windVal=1 windSum=-2 done
1435SkOpAngle::dumpOne [5/6] next=2/4 sect=15/15 s=0.333333333 [22] e=0.666666667 [25] sgn=-1 windVal=1 windSum=-2 done
1436SkOpAngle::dumpOne [2/4] next=5/5 sect=23/23 s=0.666666667 [21] e=1 [4] sgn=-1 windVal=1 windSum=-1 done
1437SkOpSegment::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
1438SkOpSegment::findNextWinding from:[5] to:[2] start=5332768 end=5329976
1439bridgeWinding current id=5 from=(240,210) to=(220,210)
1440path.lineTo(240,210);
1441path.lineTo(220,210);
1442path.close();
1443</div>
1444
1445<div id="issue3838_a">
1446SkOpSpan::sortableTop dir=kTop seg=1 t=0.5 pt=(210,170)
1447SkOpSpan::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)
1448SkOpBuilder::FixWinding id=1 nested=1 ccw=0
1449SkOpSegment::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
1450SkOpSegment::markDone id=2 (200,170 200,190) t=0 [3] (200,170) tEnd=1 newWindSum=? newOppSum=? oppSum=? windSum=? windValue=1 oppValue=0
1451SkOpSegment::markDone id=3 (200,190 180,190) t=0 [5] (200,190) tEnd=1 newWindSum=? newOppSum=? oppSum=? windSum=? windValue=1 oppValue=0
1452SkOpSegment::markDone id=4 (180,190 180,210) t=0 [7] (180,190) tEnd=1 newWindSum=? newOppSum=? oppSum=? windSum=? windValue=1 oppValue=0
1453SkOpSegment::markDone id=5 (180,210 200,210) t=0 [9] (180,210) tEnd=1 newWindSum=? newOppSum=? oppSum=? windSum=? windValue=1 oppValue=0
1454SkOpSegment::markDone id=6 (200,210 200,250) t=0 [11] (200,210) tEnd=1 newWindSum=? newOppSum=? oppSum=? windSum=? windValue=1 oppValue=0
1455SkOpSegment::markDone id=7 (200,250 260,250) t=0 [13] (200,250) tEnd=1 newWindSum=? newOppSum=? oppSum=? windSum=? windValue=1 oppValue=0
1456SkOpSegment::markDone id=8 (260,250 260,190) t=0 [15] (260,250) tEnd=1 newWindSum=? newOppSum=? oppSum=? windSum=? windValue=1 oppValue=0
1457SkOpSegment::markDone id=9 (260,190 220,190) t=0 [17] (260,190) tEnd=1 newWindSum=? newOppSum=? oppSum=? windSum=? windValue=1 oppValue=0
1458SkOpSegment::markDone id=10 (220,190 220,170) t=0 [19] (220,190) tEnd=1 newWindSum=? newOppSum=? oppSum=? windSum=? windValue=1 oppValue=0
1459SkOpSpan::sortableTop dir=kLeft seg=11 t=0.5 pt=(220,220)
1460SkOpSpan::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)
1461SkOpSpan::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)
1462SkOpBuilder::FixWinding id=11 nested=2 ccw=0
1463SkOpSegment::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
1464SkOpSegment::markDone id=12 (220,230 240,230) t=0 [23] (220,230) tEnd=1 newWindSum=? newOppSum=? oppSum=? windSum=? windValue=1 oppValue=0
1465SkOpSegment::markDone id=13 (240,230 240,210) t=0 [25] (240,230) tEnd=1 newWindSum=? newOppSum=? oppSum=? windSum=? windValue=1 oppValue=0
1466SkOpSegment::markDone id=14 (240,210 220,210) t=0 [27] (240,210) tEnd=1 newWindSum=? newOppSum=? oppSum=? windSum=? windValue=1 oppValue=0
1467path.moveTo(220,170);
1468path.lineTo(220,190);
1469path.lineTo(260,190);
1470path.lineTo(260,250);
1471path.lineTo(200,250);
1472path.lineTo(200,210);
1473path.lineTo(180,210);
1474path.lineTo(180,190);
1475path.lineTo(200,190);
1476path.lineTo(200,170);
1477path.lineTo(220,170);
1478path.close();
1479</div>
1480
1481<div id="issue3838_b">
1482seg=1 {{{220, 170}, {220, 190}}}
1483seg=2 {{{220, 190}, {260, 190}}}
1484seg=3 {{{260, 190}, {260, 250}}}
1485seg=4 {{{260, 250}, {200, 250}}}
1486seg=5 {{{200, 250}, {200, 210}}}
1487seg=6 {{{200, 210}, {180, 210}}}
1488seg=7 {{{180, 210}, {180, 190}}}
1489seg=8 {{{180, 190}, {200, 190}}}
1490seg=9 {{{200, 190}, {200, 170}}}
1491seg=10 {{{200, 170}, {220, 170}}}
1492debugShowLineIntersection wtTs[0]=0 {{{220,190}, {260,190}}} {{220,190}} wnTs[0]=1 {{{220,170}, {220,190}}}
1493debugShowLineIntersection wtTs[0]=1 {{{200,170}, {220,170}}} {{220,170}} wnTs[0]=0 {{{220,170}, {220,190}}}
1494debugShowLineIntersection wtTs[0]=0 {{{260,190}, {260,250}}} {{260,190}} wnTs[0]=1 {{{220,190}, {260,190}}}
1495debugShowLineIntersection wtTs[0]=0 {{{260,250}, {200,250}}} {{260,250}} wnTs[0]=1 {{{260,190}, {260,250}}}
1496debugShowLineIntersection wtTs[0]=0 {{{200,250}, {200,210}}} {{200,250}} wnTs[0]=1 {{{260,250}, {200,250}}}
1497debugShowLineIntersection wtTs[0]=0 {{{200,210}, {180,210}}} {{200,210}} wnTs[0]=1 {{{200,250}, {200,210}}}
1498debugShowLineIntersection wtTs[0]=0 {{{180,210}, {180,190}}} {{180,210}} wnTs[0]=1 {{{200,210}, {180,210}}}
1499debugShowLineIntersection wtTs[0]=0 {{{180,190}, {200,190}}} {{180,190}} wnTs[0]=1 {{{180,210}, {180,190}}}
1500debugShowLineIntersection wtTs[0]=0 {{{200,190}, {200,170}}} {{200,190}} wnTs[0]=1 {{{180,190}, {200,190}}}
1501debugShowLineIntersection wtTs[0]=0 {{{200,170}, {220,170}}} {{200,170}} wnTs[0]=1 {{{200,190}, {200,170}}}
1502-------------------------------------- addExpanded
1503SkOpSegment::debugShowActiveSpans id=1 (220,170 220,190) t=0 tEnd=1 windSum=? windValue=1
1504SkOpSegment::debugShowActiveSpans id=2 (220,190 260,190) t=0 tEnd=1 windSum=? windValue=1
1505SkOpSegment::debugShowActiveSpans id=3 (260,190 260,250) t=0 tEnd=1 windSum=? windValue=1
1506SkOpSegment::debugShowActiveSpans id=4 (260,250 200,250) t=0 tEnd=1 windSum=? windValue=1
1507SkOpSegment::debugShowActiveSpans id=5 (200,250 200,210) t=0 tEnd=1 windSum=? windValue=1
1508SkOpSegment::debugShowActiveSpans id=6 (200,210 180,210) t=0 tEnd=1 windSum=? windValue=1
1509SkOpSegment::debugShowActiveSpans id=7 (180,210 180,190) t=0 tEnd=1 windSum=? windValue=1
1510SkOpSegment::debugShowActiveSpans id=8 (180,190 200,190) t=0 tEnd=1 windSum=? windValue=1
1511SkOpSegment::debugShowActiveSpans id=9 (200,190 200,170) t=0 tEnd=1 windSum=? windValue=1
1512SkOpSegment::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
1526SkOpSpan::sortableTop dir=kLeft seg=1 t=0.5 pt=(220,180)
1527SkOpSpan::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)
1528SkOpSpan::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)
1529SkOpSegment::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
1530SkOpSegment::markWinding id=10 (200,170 220,170) t=0 [19] (200,170) tEnd=1 newWindSum=-1 newOppSum=0 oppSum=? windSum=? windValue=1 oppValue=0
1531SkOpSegment::markWinding id=1 (220,170 220,190) t=0 [1] (220,170) tEnd=1 newWindSum=-1 newOppSum=0 oppSum=? windSum=? windValue=1 oppValue=0
1532SkOpSegment::markWinding id=2 (220,190 260,190) t=0 [3] (220,190) tEnd=1 newWindSum=-1 newOppSum=0 oppSum=? windSum=? windValue=1 oppValue=0
1533SkOpSegment::markWinding id=3 (260,190 260,250) t=0 [5] (260,190) tEnd=1 newWindSum=-1 newOppSum=0 oppSum=? windSum=? windValue=1 oppValue=0
1534SkOpSegment::markWinding id=4 (260,250 200,250) t=0 [7] (260,250) tEnd=1 newWindSum=-1 newOppSum=0 oppSum=? windSum=? windValue=1 oppValue=0
1535SkOpSegment::markWinding id=5 (200,250 200,210) t=0 [9] (200,250) tEnd=1 newWindSum=-1 newOppSum=0 oppSum=? windSum=? windValue=1 oppValue=0
1536SkOpSegment::markWinding id=6 (200,210 180,210) t=0 [11] (200,210) tEnd=1 newWindSum=-1 newOppSum=0 oppSum=? windSum=? windValue=1 oppValue=0
1537SkOpSegment::markWinding id=7 (180,210 180,190) t=0 [13] (180,210) tEnd=1 newWindSum=-1 newOppSum=0 oppSum=? windSum=? windValue=1 oppValue=0
1538SkOpSegment::markWinding id=8 (180,190 200,190) t=0 [15] (180,190) tEnd=1 newWindSum=-1 newOppSum=0 oppSum=? windSum=? windValue=1 oppValue=0
1539SkOpSegment::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
1540SkOpSegment::findNextWinding simple
1541SkOpSegment::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
1542bridgeWinding current id=1 from=(220,190) to=(220,170)
1543SkOpSegment::findNextWinding simple
1544SkOpSegment::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
1545bridgeWinding current id=10 from=(220,170) to=(200,170)
1546path.moveTo(220,190);
1547path.lineTo(220,170);
1548SkOpSegment::findNextWinding simple
1549SkOpSegment::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
1550bridgeWinding current id=9 from=(200,170) to=(200,190)
1551path.lineTo(200,170);
1552SkOpSegment::findNextWinding simple
1553SkOpSegment::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
1554bridgeWinding current id=8 from=(200,190) to=(180,190)
1555path.lineTo(200,190);
1556SkOpSegment::findNextWinding simple
1557SkOpSegment::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
1558bridgeWinding current id=7 from=(180,190) to=(180,210)
1559path.lineTo(180,190);
1560SkOpSegment::findNextWinding simple
1561SkOpSegment::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
1562bridgeWinding current id=6 from=(180,210) to=(200,210)
1563path.lineTo(180,210);
1564SkOpSegment::findNextWinding simple
1565SkOpSegment::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
1566bridgeWinding current id=5 from=(200,210) to=(200,250)
1567path.lineTo(200,210);
1568SkOpSegment::findNextWinding simple
1569SkOpSegment::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
1570bridgeWinding current id=4 from=(200,250) to=(260,250)
1571path.lineTo(200,250);
1572SkOpSegment::findNextWinding simple
1573SkOpSegment::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
1574bridgeWinding current id=3 from=(260,250) to=(260,190)
1575path.lineTo(260,250);
1576SkOpSegment::findNextWinding simple
1577SkOpSegment::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
1578bridgeWinding current id=2 from=(260,190) to=(220,190)
1579path.lineTo(260,190);
1580path.lineTo(220,190);
1581path.close();
1582</div>
1583
caryclarkdac1d172014-06-17 05:15:38 -07001584</div>
1585
1586<script type="text/javascript">
1587
caryclark55888e42016-07-18 10:01:36 -07001588 var testDivs = [
Cary Clark59d5a0e2017-01-23 14:38:52 +00001589 issue3838,
1590 issue3838_a,
1591 issue3838_b,
1592 joel_11,
1593 joel_10,
Cary Clarkab2d73b2016-12-16 17:17:25 -05001594 joel_9,
caryclark30b9fdd2016-08-31 14:36:29 -07001595 ];
caryclarkdac1d172014-06-17 05:15:38 -07001596
1597var decimal_places = 3; // make this 3 to show more precision
1598
1599var tests = [];
1600var testLines = [];
1601var testTitles = [];
1602var testIndex = 0;
1603var ctx;
1604
1605var xmin, xmax, focusXmin, focusXmax;
1606var ymin, ymax, focusYmin, focusYmax;
1607var scale;
1608var mouseX, mouseY;
1609var srcLeft, srcTop;
1610var screenWidth, screenHeight;
caryclark1049f122015-04-20 08:31:59 -07001611var drawnPts, drawnLines, drawnQuads, drawnConics, drawnCubics;
caryclarkdac1d172014-06-17 05:15:38 -07001612var curveT = 0;
1613
1614var pt_labels = 2;
1615var collect_bounds = false;
1616var control_lines = 0;
1617var curve_t = false;
1618var debug_xy = 1;
1619var focus_enabled = false;
1620var focus_on_selection = false;
1621var step_limit = 0;
1622var draw_active = false;
1623var draw_add = false;
1624var draw_angle = 0;
caryclark624637c2015-05-11 07:21:27 -07001625var draw_coincidence = false;
caryclarkdac1d172014-06-17 05:15:38 -07001626var draw_deriviatives = 0;
Cary Clarkff114282016-12-14 11:56:16 -05001627var draw_direction = false;
caryclarkdac1d172014-06-17 05:15:38 -07001628var draw_hints = false;
caryclarkdac1d172014-06-17 05:15:38 -07001629var draw_id = false;
1630var draw_intersection = 0;
1631var draw_intersectT = false;
1632var draw_legend = true;
1633var draw_log = false;
1634var draw_mark = false;
1635var draw_midpoint = false;
1636var draw_op = 0;
1637var draw_sequence = false;
1638var draw_sort = 0;
caryclark03b03ca2015-04-23 09:13:37 -07001639var draw_top = false;
caryclarkdac1d172014-06-17 05:15:38 -07001640var draw_path = 3;
1641var draw_computed = 0;
1642var retina_scale = !!window.devicePixelRatio;
1643
1644var activeCount = 0;
1645var addCount = 0;
1646var angleCount = 0;
caryclark624637c2015-05-11 07:21:27 -07001647var coinCount = 0;
caryclarkdac1d172014-06-17 05:15:38 -07001648var opCount = 0;
1649var sectCount = 0;
1650var sortCount = 0;
caryclark03b03ca2015-04-23 09:13:37 -07001651var topCount = 0;
caryclarkdac1d172014-06-17 05:15:38 -07001652var markCount = 0;
1653var activeMax = 0;
1654var addMax = 0;
1655var angleMax = 0;
caryclark624637c2015-05-11 07:21:27 -07001656var coinMax = 0;
caryclarkdac1d172014-06-17 05:15:38 -07001657var sectMax = 0;
1658var sectMax2 = 0;
1659var sortMax = 0;
caryclark03b03ca2015-04-23 09:13:37 -07001660var topMax = 0;
caryclarkdac1d172014-06-17 05:15:38 -07001661var markMax = 0;
1662var opMax = 0;
1663var stepMax = 0;
1664var lastIndex = 0;
1665var hasPath = false;
caryclark26ad22a2015-10-16 09:03:38 -07001666var hasAlignedPath = false;
caryclarkdac1d172014-06-17 05:15:38 -07001667var hasComputedPath = false;
caryclark54359292015-03-26 07:52:43 -07001668var angleBetween = false;
1669var afterIndex = 0;
caryclarkdac1d172014-06-17 05:15:38 -07001670
1671var firstActiveSpan = -1;
1672var logStart = -1;
1673var logRange = 0;
1674
1675var SPAN_ID = 0;
1676var SPAN_X1 = SPAN_ID + 1;
1677var SPAN_Y1 = SPAN_X1 + 1;
1678var SPAN_X2 = SPAN_Y1 + 1;
1679var SPAN_Y2 = SPAN_X2 + 1;
caryclark1049f122015-04-20 08:31:59 -07001680
caryclark55888e42016-07-18 10:01:36 -07001681var SPAN_L_TX = SPAN_Y2 + 1;
caryclarkdac1d172014-06-17 05:15:38 -07001682var SPAN_L_TY = SPAN_L_TX + 1;
caryclark55888e42016-07-18 10:01:36 -07001683var SPAN_L_OTHER = SPAN_L_TY + 1;
caryclarkdac1d172014-06-17 05:15:38 -07001684var SPAN_L_OTHERT = SPAN_L_OTHER + 1;
1685var SPAN_L_OTHERI = SPAN_L_OTHERT + 1;
1686var SPAN_L_SUM = SPAN_L_OTHERI + 1;
1687var SPAN_L_VAL = SPAN_L_SUM + 1;
1688var SPAN_L_OPP = SPAN_L_VAL + 1;
1689
1690var SPAN_X3 = SPAN_Y2 + 1;
1691var SPAN_Y3 = SPAN_X3 + 1;
caryclark1049f122015-04-20 08:31:59 -07001692
caryclark55888e42016-07-18 10:01:36 -07001693var SPAN_Q_TX = SPAN_Y3 + 1;
caryclarkdac1d172014-06-17 05:15:38 -07001694var SPAN_Q_TY = SPAN_Q_TX + 1;
caryclark55888e42016-07-18 10:01:36 -07001695var SPAN_Q_OTHER = SPAN_Q_TY + 1;
caryclarkdac1d172014-06-17 05:15:38 -07001696var SPAN_Q_OTHERT = SPAN_Q_OTHER + 1;
1697var SPAN_Q_OTHERI = SPAN_Q_OTHERT + 1;
1698var SPAN_Q_SUM = SPAN_Q_OTHERI + 1;
1699var SPAN_Q_VAL = SPAN_Q_SUM + 1;
1700var SPAN_Q_OPP = SPAN_Q_VAL + 1;
1701
caryclark1049f122015-04-20 08:31:59 -07001702var SPAN_K_W = SPAN_Y3 + 1;
caryclark55888e42016-07-18 10:01:36 -07001703var SPAN_K_TX = SPAN_K_W + 1;
caryclark1049f122015-04-20 08:31:59 -07001704var SPAN_K_TY = SPAN_K_TX + 1;
caryclark55888e42016-07-18 10:01:36 -07001705var SPAN_K_OTHER = SPAN_K_TY + 1;
caryclark1049f122015-04-20 08:31:59 -07001706var SPAN_K_OTHERT = SPAN_K_OTHER + 1;
1707var SPAN_K_OTHERI = SPAN_K_OTHERT + 1;
1708var SPAN_K_SUM = SPAN_K_OTHERI + 1;
1709var SPAN_K_VAL = SPAN_K_SUM + 1;
1710var SPAN_K_OPP = SPAN_K_VAL + 1;
1711
caryclarkdac1d172014-06-17 05:15:38 -07001712var SPAN_X4 = SPAN_Y3 + 1;
1713var SPAN_Y4 = SPAN_X4 + 1;
caryclark1049f122015-04-20 08:31:59 -07001714
caryclark55888e42016-07-18 10:01:36 -07001715var SPAN_C_TX = SPAN_Y4 + 1;
caryclarkdac1d172014-06-17 05:15:38 -07001716var SPAN_C_TY = SPAN_C_TX + 1;
caryclark55888e42016-07-18 10:01:36 -07001717var SPAN_C_OTHER = SPAN_C_TY + 1;
caryclarkdac1d172014-06-17 05:15:38 -07001718var SPAN_C_OTHERT = SPAN_C_OTHER + 1;
1719var SPAN_C_OTHERI = SPAN_C_OTHERT + 1;
1720var SPAN_C_SUM = SPAN_C_OTHERI + 1;
1721var SPAN_C_VAL = SPAN_C_SUM + 1;
1722var SPAN_C_OPP = SPAN_C_VAL + 1;
1723
1724var ACTIVE_LINE_SPAN = 1;
1725var ACTIVE_QUAD_SPAN = ACTIVE_LINE_SPAN + 1;
caryclark1049f122015-04-20 08:31:59 -07001726var ACTIVE_CONIC_SPAN = ACTIVE_QUAD_SPAN + 1;
1727var ACTIVE_CUBIC_SPAN = ACTIVE_CONIC_SPAN + 1;
caryclarkdac1d172014-06-17 05:15:38 -07001728
1729var ADD_MOVETO = ACTIVE_CUBIC_SPAN + 1;
1730var ADD_LINETO = ADD_MOVETO + 1;
1731var ADD_QUADTO = ADD_LINETO + 1;
caryclark1049f122015-04-20 08:31:59 -07001732var ADD_CONICTO = ADD_QUADTO + 1;
1733var ADD_CUBICTO = ADD_CONICTO + 1;
caryclarkdac1d172014-06-17 05:15:38 -07001734var ADD_CLOSE = ADD_CUBICTO + 1;
1735var ADD_FILL = ADD_CLOSE + 1;
1736
1737var PATH_LINE = ADD_FILL + 1;
1738var PATH_QUAD = PATH_LINE + 1;
caryclark1049f122015-04-20 08:31:59 -07001739var PATH_CONIC = PATH_QUAD + 1;
1740var PATH_CUBIC = PATH_CONIC + 1;
caryclarkdac1d172014-06-17 05:15:38 -07001741
1742var INTERSECT_LINE = PATH_CUBIC + 1;
1743var INTERSECT_LINE_2 = INTERSECT_LINE + 1;
1744var INTERSECT_LINE_NO = INTERSECT_LINE_2 + 1;
1745var INTERSECT_QUAD_LINE = INTERSECT_LINE_NO + 1;
1746var INTERSECT_QUAD_LINE_2 = INTERSECT_QUAD_LINE + 1;
1747var INTERSECT_QUAD_LINE_NO = INTERSECT_QUAD_LINE_2 + 1;
1748var INTERSECT_QUAD = INTERSECT_QUAD_LINE_NO + 1;
1749var INTERSECT_QUAD_2 = INTERSECT_QUAD + 1;
1750var INTERSECT_QUAD_NO = INTERSECT_QUAD_2 + 1;
caryclark1049f122015-04-20 08:31:59 -07001751var INTERSECT_CONIC_LINE = INTERSECT_QUAD_NO + 1;
1752var INTERSECT_CONIC_LINE_2 = INTERSECT_CONIC_LINE + 1;
1753var INTERSECT_CONIC_LINE_NO = INTERSECT_CONIC_LINE_2 + 1;
caryclark55888e42016-07-18 10:01:36 -07001754var INTERSECT_CONIC_QUAD = INTERSECT_CONIC_LINE_NO + 1;
1755var INTERSECT_CONIC_QUAD_2 = INTERSECT_CONIC_QUAD + 1;
caryclark6c3b9cd2016-09-26 05:36:58 -07001756var INTERSECT_CONIC_QUAD_3 = INTERSECT_CONIC_QUAD_2 + 1;
1757var INTERSECT_CONIC_QUAD_4 = INTERSECT_CONIC_QUAD_3 + 1;
1758var INTERSECT_CONIC_QUAD_NO = INTERSECT_CONIC_QUAD_4 + 1;
caryclark55888e42016-07-18 10:01:36 -07001759var INTERSECT_CONIC = INTERSECT_CONIC_QUAD_NO + 1;
caryclark1049f122015-04-20 08:31:59 -07001760var INTERSECT_CONIC_2 = INTERSECT_CONIC + 1;
1761var INTERSECT_CONIC_NO = INTERSECT_CONIC_2 + 1;
1762var INTERSECT_SELF_CUBIC = INTERSECT_CONIC_NO + 1;
caryclarkdac1d172014-06-17 05:15:38 -07001763var INTERSECT_SELF_CUBIC_NO = INTERSECT_SELF_CUBIC + 1;
1764var INTERSECT_CUBIC_LINE = INTERSECT_SELF_CUBIC_NO + 1;
1765var INTERSECT_CUBIC_LINE_2 = INTERSECT_CUBIC_LINE + 1;
1766var INTERSECT_CUBIC_LINE_3 = INTERSECT_CUBIC_LINE_2 + 1;
1767var INTERSECT_CUBIC_LINE_NO = INTERSECT_CUBIC_LINE_3 + 1;
1768var INTERSECT_CUBIC_QUAD = INTERSECT_CUBIC_LINE_NO + 1;
1769var INTERSECT_CUBIC_QUAD_2 = INTERSECT_CUBIC_QUAD + 1;
1770var INTERSECT_CUBIC_QUAD_3 = INTERSECT_CUBIC_QUAD_2 + 1;
1771var INTERSECT_CUBIC_QUAD_4 = INTERSECT_CUBIC_QUAD_3 + 1;
1772var INTERSECT_CUBIC_QUAD_NO = INTERSECT_CUBIC_QUAD_4 + 1;
1773var INTERSECT_CUBIC = INTERSECT_CUBIC_QUAD_NO + 1;
1774var INTERSECT_CUBIC_2 = INTERSECT_CUBIC + 1;
1775var INTERSECT_CUBIC_3 = INTERSECT_CUBIC_2 + 1;
1776var INTERSECT_CUBIC_4 = INTERSECT_CUBIC_3 + 1;
1777// FIXME: add cubic 5- 9
1778var INTERSECT_CUBIC_NO = INTERSECT_CUBIC_4 + 1;
1779
1780var SORT_UNARY = INTERSECT_CUBIC_NO + 1;
1781var SORT_BINARY = SORT_UNARY + 1;
1782
1783var OP_DIFFERENCE = SORT_BINARY + 1;
1784var OP_INTERSECT = OP_DIFFERENCE + 1;
1785var OP_UNION = OP_INTERSECT + 1;
1786var OP_XOR = OP_UNION + 1;
1787
1788var MARK_LINE = OP_XOR + 1;
1789var MARK_QUAD = MARK_LINE + 1;
caryclark1049f122015-04-20 08:31:59 -07001790var MARK_CONIC = MARK_QUAD + 1;
1791var MARK_CUBIC = MARK_CONIC + 1;
caryclarkdac1d172014-06-17 05:15:38 -07001792var MARK_DONE_LINE = MARK_CUBIC + 1;
1793var MARK_DONE_QUAD = MARK_DONE_LINE + 1;
caryclark1049f122015-04-20 08:31:59 -07001794var MARK_DONE_CONIC = MARK_DONE_QUAD + 1;
1795var MARK_DONE_CUBIC = MARK_DONE_CONIC + 1;
caryclarkdac1d172014-06-17 05:15:38 -07001796var MARK_UNSORTABLE_LINE = MARK_DONE_CUBIC + 1;
1797var MARK_UNSORTABLE_QUAD = MARK_UNSORTABLE_LINE + 1;
caryclark1049f122015-04-20 08:31:59 -07001798var MARK_UNSORTABLE_CONIC = MARK_UNSORTABLE_QUAD + 1;
1799var MARK_UNSORTABLE_CUBIC = MARK_UNSORTABLE_CONIC + 1;
caryclarkdac1d172014-06-17 05:15:38 -07001800var MARK_SIMPLE_LINE = MARK_UNSORTABLE_CUBIC + 1;
1801var MARK_SIMPLE_QUAD = MARK_SIMPLE_LINE + 1;
caryclark1049f122015-04-20 08:31:59 -07001802var MARK_SIMPLE_CONIC = MARK_SIMPLE_QUAD + 1;
1803var MARK_SIMPLE_CUBIC = MARK_SIMPLE_CONIC + 1;
caryclarkdac1d172014-06-17 05:15:38 -07001804var MARK_SIMPLE_DONE_LINE = MARK_SIMPLE_CUBIC + 1;
1805var MARK_SIMPLE_DONE_QUAD = MARK_SIMPLE_DONE_LINE + 1;
caryclark1049f122015-04-20 08:31:59 -07001806var MARK_SIMPLE_DONE_CONIC = MARK_SIMPLE_DONE_QUAD + 1;
1807var MARK_SIMPLE_DONE_CUBIC = MARK_SIMPLE_DONE_CONIC + 1;
caryclarkdac1d172014-06-17 05:15:38 -07001808var MARK_DONE_UNARY_LINE = MARK_SIMPLE_DONE_CUBIC + 1;
1809var MARK_DONE_UNARY_QUAD = MARK_DONE_UNARY_LINE + 1;
caryclark1049f122015-04-20 08:31:59 -07001810var MARK_DONE_UNARY_CONIC = MARK_DONE_UNARY_QUAD + 1;
1811var MARK_DONE_UNARY_CUBIC = MARK_DONE_UNARY_CONIC + 1;
caryclarkdac1d172014-06-17 05:15:38 -07001812var MARK_ANGLE_LAST = MARK_DONE_UNARY_CUBIC + 1;
1813
1814var COMPUTED_SET_1 = MARK_ANGLE_LAST + 1;
1815var COMPUTED_SET_2 = COMPUTED_SET_1 + 1;
1816
caryclark624637c2015-05-11 07:21:27 -07001817var ANGLE_AFTER = COMPUTED_SET_2 + 1;
caryclark54359292015-03-26 07:52:43 -07001818var ANGLE_AFTERPART = ANGLE_AFTER + 1;
caryclarkdac1d172014-06-17 05:15:38 -07001819
caryclark54359292015-03-26 07:52:43 -07001820var ACTIVE_OP = ANGLE_AFTERPART + 1;
caryclarkdac1d172014-06-17 05:15:38 -07001821
caryclark624637c2015-05-11 07:21:27 -07001822var COIN_MAIN_SPAN = ACTIVE_OP + 1;
1823var COIN_OPP_SPAN = COIN_MAIN_SPAN + 1;
1824
1825var FRAG_TYPE_LAST = COIN_OPP_SPAN;
caryclarkdac1d172014-06-17 05:15:38 -07001826
1827var REC_TYPE_UNKNOWN = -1;
1828var REC_TYPE_PATH = 0;
caryclark54359292015-03-26 07:52:43 -07001829var REC_TYPE_PATH2 = 1;
1830var REC_TYPE_SECT = 2;
1831var REC_TYPE_ACTIVE = 3;
1832var REC_TYPE_ADD = 4;
1833var REC_TYPE_SORT = 5;
1834var REC_TYPE_OP = 6;
1835var REC_TYPE_MARK = 7;
1836var REC_TYPE_COMPUTED = 8;
1837var REC_TYPE_COIN = 9;
1838var REC_TYPE_ANGLE = 10;
1839var REC_TYPE_ACTIVE_OP = 11;
1840var REC_TYPE_AFTERPART = 12;
caryclark03b03ca2015-04-23 09:13:37 -07001841var REC_TYPE_TOP = 13;
caryclark624637c2015-05-11 07:21:27 -07001842var REC_TYPE_COINCIDENCE = 14;
caryclark26ad22a2015-10-16 09:03:38 -07001843var REC_TYPE_ALIGNED = 15;
1844var REC_TYPE_LAST = REC_TYPE_ALIGNED;
caryclarkdac1d172014-06-17 05:15:38 -07001845
1846function 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
1860function 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
1871function 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\\)");
caryclark1049f122015-04-20 08:31:59 -07001875 escape = escape.replace(/CONIC_VAL/g, "\\(P_VAL P_VAL P_VAL W_VAL\\)");
caryclarkdac1d172014-06-17 05:15:38 -07001876 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");
caryclark54359292015-03-26 07:52:43 -07001879 escape = escape.replace(/PTR_VAL/g, "0x[0-9A-F]+");
caryclarkdac1d172014-06-17 05:15:38 -07001880 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+)?)");
caryclark1049f122015-04-20 08:31:59 -07001883 escape = escape.replace(/W_VAL/g, "(-?\\d+\\.?\\d*(?:e-?\\d+)?)[Ff]?");
caryclarkdac1d172014-06-17 05:15:38 -07001884 escape = escape.replace(/PATH/g, "pathB?");
caryclark1049f122015-04-20 08:31:59 -07001885 escape = escape.replace(/IDX/g, "(-?\\d+)");
caryclarkdac1d172014-06-17 05:15:38 -07001886 escape = escape.replace(/NUM/g, "(-?\\d+)");
1887 escape = escape.replace(/OPT/g, "(\\?|-?\\d+)");
1888 return new RegExp(escape, 'i');
1889}
1890
1891function construct_regexp2c(pattern) {
1892 var escape = pattern.replace(/[-/\\^$*+?.()|[\]{}]/g, '\\$&');
1893 escape = escape.replace(/UNSORTABLE/g, "\\*\\*\\* UNSORTABLE \\*\\*\\*");
caryclark54359292015-03-26 07:52:43 -07001894 escape = escape.replace(/CUBIC_VAL/g, "(?:\\$\\d = )?\\{\\{\\{P_VAL\\}, \\{P_VAL\\}, \\{P_VAL\\}, \\{P_VAL\\}\\}\\}");
caryclark1049f122015-04-20 08:31:59 -07001895 escape = escape.replace(/CONIC_VAL/g, "(?:\\$\\d = )?\\{\\{\\{\\{P_VAL\\}, \\{P_VAL\\}, \\{P_VAL\\}\\}\\}, W_VAL\\}");
caryclark54359292015-03-26 07:52:43 -07001896 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\\}\\}\\}");
caryclarkdac1d172014-06-17 05:15:38 -07001898 escape = escape.replace(/FILL_TYPE/g, "SkPath::k[a-zA-Z]+_FillType");
caryclark54359292015-03-26 07:52:43 -07001899 escape = escape.replace(/PTR_VAL/g, "0x[0-9A-F]+");
caryclarkdac1d172014-06-17 05:15:38 -07001900 escape = escape.replace(/PT_VAL/g, "\\{\\{P_VAL\\}\\}");
caryclark54359292015-03-26 07:52:43 -07001901 escape = escape.replace(/P_VAL/g, "(?:f?[xX] = )?(-?\\d+\\.?\\d*(?:e-?\\d+)?)[Ff]?, *(?: f?[yY] = )?(-?\\d+\\.?\\d*(?:e-?\\d+)?)[Ff]?");
caryclarkdac1d172014-06-17 05:15:38 -07001902 escape = escape.replace(/T_VAL/g, "(-?\\d+\\.?\\d*(?:e-?\\d+)?)");
caryclark1049f122015-04-20 08:31:59 -07001903 escape = escape.replace(/W_VAL/g, "(-?\\d+\\.?\\d*(?:e-?\\d+)?)[Ff]?");
caryclarkdac1d172014-06-17 05:15:38 -07001904 escape = escape.replace(/OPER/g, "[a-z]+");
1905 escape = escape.replace(/PATH/g, "pathB?");
1906 escape = escape.replace(/T_F/g, "([TF])");
caryclark1049f122015-04-20 08:31:59 -07001907 escape = escape.replace(/IDX/g, "(-?\\d+)");
caryclarkdac1d172014-06-17 05:15:38 -07001908 escape = escape.replace(/NUM/g, "(-?\\d+)");
1909 escape = escape.replace(/OPT/g, "(\\?|-?\\d+)");
1910 return new RegExp(escape, 'i');
1911}
1912
1913function 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
1922function endsWith(str, suffix) {
1923 return str.indexOf(suffix, str.length - suffix.length) !== -1;
1924}
1925
1926function 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 }
caryclark624637c2015-05-11 07:21:27 -07001946 var coinStart = "SkOpCoincidence::";
1947 if (line.lastIndexOf(coinStart, 0) === 0) {
1948 line = line.substr(coinStart.length);
1949 }
caryclark54359292015-03-26 07:52:43 -07001950 var type = line.lastIndexOf("debugShowActiveSpans", 0) === 0 ? REC_TYPE_ACTIVE
caryclark624637c2015-05-11 07:21:27 -07001951 : line.lastIndexOf("debugShowCoincidence", 0) === 0 ? REC_TYPE_COINCIDENCE
caryclark54359292015-03-26 07:52:43 -07001952 : line.lastIndexOf("((SkOpSegment*)", 0) === 0 ? REC_TYPE_PATH2
caryclark55888e42016-07-18 10:01:36 -07001953 : line.lastIndexOf("debugShowTs", 0) === 0 ? REC_TYPE_COIN
caryclark54359292015-03-26 07:52:43 -07001954 : line.lastIndexOf("afterPart", 0) === 0 ? REC_TYPE_AFTERPART
caryclarkdac1d172014-06-17 05:15:38 -07001955 : 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
caryclark26ad22a2015-10-16 09:03:38 -07001959 : line.lastIndexOf("aligned=", 0) === 0 ? REC_TYPE_ALIGNED
caryclarkdac1d172014-06-17 05:15:38 -07001960 : line.lastIndexOf("dumpOne", 0) === 0 ? REC_TYPE_SORT
caryclark03b03ca2015-04-23 09:13:37 -07001961 : line.lastIndexOf("findTop", 0) === 0 ? REC_TYPE_TOP
caryclarkdac1d172014-06-17 05:15:38 -07001962 : line.lastIndexOf("pathB.", 0) === 0 ? REC_TYPE_ADD
1963 : line.lastIndexOf("path.", 0) === 0 ? REC_TYPE_ADD
Cary Clark59d5a0e2017-01-23 14:38:52 +00001964 : line.lastIndexOf("after", 0) === 0 ? REC_TYPE_ANGLE
caryclarkdac1d172014-06-17 05:15:38 -07001965 : line.lastIndexOf("mark", 0) === 0 ? REC_TYPE_MARK
1966 : line.lastIndexOf(" {{", 0) === 0 ? REC_TYPE_COMPUTED
caryclark54359292015-03-26 07:52:43 -07001967 : line.lastIndexOf("seg=", 0) === 0 ? REC_TYPE_PATH
caryclarkdac1d172014-06-17 05:15:38 -07001968 : 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" +
caryclark55888e42016-07-18 10:01:36 -07001986" id=IDX LINE_VAL t=T_VAL tEnd=T_VAL windSum=OPT windValue=IDX"
caryclarkdac1d172014-06-17 05:15:38 -07001987 ) || match_regexp(line, lineNo, record, ACTIVE_QUAD_SPAN, "debugShowActiveSpans" +
caryclark55888e42016-07-18 10:01:36 -07001988" id=IDX QUAD_VAL t=T_VAL tEnd=T_VAL windSum=OPT windValue=IDX"
caryclark1049f122015-04-20 08:31:59 -07001989 ) || match_regexp(line, lineNo, record, ACTIVE_CONIC_SPAN, "debugShowActiveSpans" +
caryclark55888e42016-07-18 10:01:36 -07001990" id=IDX CONIC_VAL t=T_VAL tEnd=T_VAL windSum=OPT windValue=IDX"
caryclarkdac1d172014-06-17 05:15:38 -07001991 ) || match_regexp(line, lineNo, record, ACTIVE_CUBIC_SPAN, "debugShowActiveSpans" +
caryclark55888e42016-07-18 10:01:36 -07001992" id=IDX CUBIC_VAL t=T_VAL tEnd=T_VAL windSum=OPT windValue=IDX"
caryclark624637c2015-05-11 07:21:27 -07001993 ) || match_regexp(line, lineNo, record, ACTIVE_LINE_SPAN, "debugShowActiveSpans" +
caryclark55888e42016-07-18 10:01:36 -07001994" id=IDX LINE_VAL t=T_VAL tEnd=T_VAL windSum=OPT oppSum=OPT windValue=IDX oppValue=NUM"
caryclark624637c2015-05-11 07:21:27 -07001995 ) || match_regexp(line, lineNo, record, ACTIVE_QUAD_SPAN, "debugShowActiveSpans" +
caryclark55888e42016-07-18 10:01:36 -07001996" id=IDX QUAD_VAL t=T_VAL tEnd=T_VAL windSum=OPT oppSum=OPT windValue=IDX oppValue=NUM"
caryclark624637c2015-05-11 07:21:27 -07001997 ) || match_regexp(line, lineNo, record, ACTIVE_CONIC_SPAN, "debugShowActiveSpans" +
caryclark55888e42016-07-18 10:01:36 -07001998" id=IDX CONIC_VAL t=T_VAL tEnd=T_VAL windSum=OPT oppSum=OPT windValue=IDX oppValue=NUM"
caryclark624637c2015-05-11 07:21:27 -07001999 ) || match_regexp(line, lineNo, record, ACTIVE_CUBIC_SPAN, "debugShowActiveSpans" +
caryclark55888e42016-07-18 10:01:36 -07002000" id=IDX CUBIC_VAL t=T_VAL tEnd=T_VAL windSum=OPT oppSum=OPT windValue=IDX oppValue=NUM"
caryclarkdac1d172014-06-17 05:15:38 -07002001 );
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;
caryclark1049f122015-04-20 08:31:59 -07002025 } 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;
caryclarkdac1d172014-06-17 05:15:38 -07002031 } 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;
caryclark54359292015-03-26 07:52:43 -07002043 case REC_TYPE_AFTERPART:
Cary Clarkff114282016-12-14 11:56:16 -05002044 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")
caryclark54359292015-03-26 07:52:43 -07002048 break;
caryclark26ad22a2015-10-16 09:03:38 -07002049 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;
caryclarkdac1d172014-06-17 05:15:38 -07002056 case REC_TYPE_ANGLE:
Cary Clark59d5a0e2017-01-23 14:38:52 +00002057 found = match_regexp(line, lineNo, record, ANGLE_AFTER, "after " +
caryclarkdac1d172014-06-17 05:15:38 -07002058"[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;
caryclark624637c2015-05-11 07:21:27 -07002063 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;
caryclarkdac1d172014-06-17 05:15:38 -07002070 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,"
caryclark1049f122015-04-20 08:31:59 -07002075 ) || match_regexp(line, lineNo, record, PATH_CONIC, " CONIC_VAL,"
caryclarkdac1d172014-06-17 05:15:38 -07002076 ) || match_regexp(line, lineNo, record, PATH_CUBIC, " CUBIC_VAL,"
2077 );
2078 break;
2079 case REC_TYPE_PATH:
caryclark54359292015-03-26 07:52:43 -07002080 found = match_regexp(line, lineNo, record, PATH_LINE, "seg=IDX LINE_VAL"
2081 ) || match_regexp(line, lineNo, record, PATH_QUAD, "seg=IDX QUAD_VAL"
caryclark1049f122015-04-20 08:31:59 -07002082 ) || match_regexp(line, lineNo, record, PATH_CONIC, "seg=IDX CONIC_VAL"
caryclark54359292015-03-26 07:52:43 -07002083 ) || 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}"
caryclark1049f122015-04-20 08:31:59 -07002089 ) || match_regexp(line, lineNo, record, PATH_CONIC, "((SkOpSegment*) PTR_VAL) [IDX] {CONIC_VAL}"
caryclark54359292015-03-26 07:52:43 -07002090 ) || match_regexp(line, lineNo, record, PATH_CUBIC, "((SkOpSegment*) PTR_VAL) [IDX] {CUBIC_VAL}"
caryclarkdac1d172014-06-17 05:15:38 -07002091 );
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"
caryclark55888e42016-07-18 10:01:36 -07002112
caryclark1049f122015-04-20 08:31:59 -07002113 ) || 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"
caryclark55888e42016-07-18 10:01:36 -07002119
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"
caryclark6c3b9cd2016-09-26 05:36:58 -07002124 ) || 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"
caryclark55888e42016-07-18 10:01:36 -07002128 ) || match_regexp(line, lineNo, record, INTERSECT_CONIC_QUAD_NO, "debugShowConicQuadIntersection" +
2129" no intersect CONIC_VAL QUAD_VAL"
2130
caryclark1049f122015-04-20 08:31:59 -07002131 ) || 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"
caryclarkdac1d172014-06-17 05:15:38 -07002137 ) || 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;
caryclark03b03ca2015-04-23 09:13:37 -07002197 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;
caryclarkdac1d172014-06-17 05:15:38 -07002206 case REC_TYPE_MARK:
2207 found = match_regexp(line, lineNo, record, MARK_LINE, "markWinding" +
caryclark54359292015-03-26 07:52:43 -07002208" id=IDX LINE_VAL t=T_VAL [IDX] PT_VAL tEnd=T_VAL newWindSum=NUM newOppSum=OPT oppSum=OPT windSum=OPT windValue=IDX"
caryclarkdac1d172014-06-17 05:15:38 -07002209 ) || match_regexp(line, lineNo, record, MARK_QUAD, "markWinding" +
caryclark54359292015-03-26 07:52:43 -07002210" id=IDX QUAD_VAL t=T_VAL [IDX] PT_VAL tEnd=T_VAL newWindSum=NUM newOppSum=OPT oppSum=OPT windSum=OPT windValue=IDX"
caryclark1049f122015-04-20 08:31:59 -07002211 ) || 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"
caryclarkdac1d172014-06-17 05:15:38 -07002213 ) || match_regexp(line, lineNo, record, MARK_CUBIC, "markWinding" +
caryclark54359292015-03-26 07:52:43 -07002214" 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"
caryclark1049f122015-04-20 08:31:59 -07002219 ) || 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"
caryclark54359292015-03-26 07:52:43 -07002221 ) || 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"
caryclarkdac1d172014-06-17 05:15:38 -07002223 ) || 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"
caryclark1049f122015-04-20 08:31:59 -07002227 ) || 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"
caryclarkdac1d172014-06-17 05:15:38 -07002229 ) || 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"
caryclarkdac1d172014-06-17 05:15:38 -07002231 ) || match_regexp(line, lineNo, record, MARK_ANGLE_LAST, "markAngle" +
caryclark1049f122015-04-20 08:31:59 -07002232" last segment=IDX span=IDX"
caryclark54359292015-03-26 07:52:43 -07002233 ) || match_regexp(line, lineNo, record, MARK_ANGLE_LAST, "markAngle" +
caryclark55888e42016-07-18 10:01:36 -07002234" 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 );
caryclarkdac1d172014-06-17 05:15:38 -07002240 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 }
caryclark54359292015-03-26 07:52:43 -07002247 found = match_regexp(line, lineNo, record, OP_DIFFERENCE, "op diff"
caryclarkdac1d172014-06-17 05:15:38 -07002248 ) || match_regexp(line, lineNo, record, OP_INTERSECT, "op intersect"
caryclark54359292015-03-26 07:52:43 -07002249 ) || match_regexp(line, lineNo, record, OP_INTERSECT, "op sect"
caryclarkdac1d172014-06-17 05:15:38 -07002250 ) || 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
2273function 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;
caryclark26ad22a2015-10-16 09:03:38 -07002293 hasPath = hasAlignedPath = hasComputedPath = false;
caryclarkdac1d172014-06-17 05:15:38 -07002294 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) {
caryclark26ad22a2015-10-16 09:03:38 -07002314 case REC_TYPE_ALIGNED:
2315 hasAlignedPath = true;
caryclarkdac1d172014-06-17 05:15:38 -07002316 case REC_TYPE_COMPUTED:
2317 if (fragType == COMPUTED_SET_1 || fragType == COMPUTED_SET_2) {
2318 break;
2319 }
caryclark26ad22a2015-10-16 09:03:38 -07002320 if (REC_TYPE_COMPUTED == recType) {
2321 hasComputedPath = true;
2322 }
caryclarkdac1d172014-06-17 05:15:38 -07002323 case REC_TYPE_PATH:
caryclark54359292015-03-26 07:52:43 -07002324 first = 1;
caryclarkdac1d172014-06-17 05:15:38 -07002325 switch (fragType) {
2326 case PATH_LINE:
caryclark54359292015-03-26 07:52:43 -07002327 last = 5;
caryclarkdac1d172014-06-17 05:15:38 -07002328 break;
caryclark1049f122015-04-20 08:31:59 -07002329 case PATH_CONIC:
caryclarkdac1d172014-06-17 05:15:38 -07002330 case PATH_QUAD:
caryclark54359292015-03-26 07:52:43 -07002331 last = 7;
caryclarkdac1d172014-06-17 05:15:38 -07002332 break;
2333 case PATH_CUBIC:
caryclark54359292015-03-26 07:52:43 -07002334 last = 9;
caryclarkdac1d172014-06-17 05:15:38 -07002335 break;
2336 default:
caryclark55888e42016-07-18 10:01:36 -07002337 console.log("unknown " + (recType == REC_TYPE_PATH ? "REC_TYPE_PATH"
caryclarkdac1d172014-06-17 05:15:38 -07002338 : "REC_TYPE_COMPUTED") + " frag type:" + fragType);
2339 throw "stop execution";
2340 }
2341 if (recType == REC_TYPE_PATH) {
2342 hasPath = true;
2343 }
2344 break;
caryclark54359292015-03-26 07:52:43 -07002345 case REC_TYPE_PATH2:
2346 first = 1;
2347 switch (fragType) {
2348 case PATH_LINE:
2349 last = 5;
2350 break;
caryclark1049f122015-04-20 08:31:59 -07002351 case PATH_CONIC:
caryclark54359292015-03-26 07:52:43 -07002352 case PATH_QUAD:
2353 last = 7;
2354 break;
2355 case PATH_CUBIC:
2356 last = 9;
2357 break;
2358 default:
caryclark55888e42016-07-18 10:01:36 -07002359 console.log("unknown " + (recType == REC_TYPE_PATH2 ? "REC_TYPE_PATH2"
caryclark54359292015-03-26 07:52:43 -07002360 : "REC_TYPE_COMPUTED") + " frag type:" + fragType);
2361 throw "stop execution";
2362 }
2363 if (recType == REC_TYPE_PATH2) {
2364 hasPath = true;
2365 }
2366 break;
caryclarkdac1d172014-06-17 05:15:38 -07002367 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;
caryclark1049f122015-04-20 08:31:59 -07002376 case ACTIVE_CONIC_SPAN:
caryclarkdac1d172014-06-17 05:15:38 -07002377 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;
caryclark1049f122015-04-20 08:31:59 -07002395 case ADD_CONICTO:
caryclarkdac1d172014-06-17 05:15:38 -07002396 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;
caryclark54359292015-03-26 07:52:43 -07002410 case REC_TYPE_AFTERPART:
2411 switch (fragType) {
2412 case PATH_LINE:
2413 last = 4;
2414 break;
caryclark1049f122015-04-20 08:31:59 -07002415 case PATH_CONIC:
caryclark54359292015-03-26 07:52:43 -07002416 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;
caryclarkdac1d172014-06-17 05:15:38 -07002427 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;
caryclark1049f122015-04-20 08:31:59 -07002438 case INTERSECT_CONIC_LINE:
2439 first = 1; last = 7; first2 = 11; last2 = 15;
2440 break;
caryclarkdac1d172014-06-17 05:15:38 -07002441 case INTERSECT_QUAD_LINE:
2442 first = 1; last = 7; first2 = 10; last2 = 14;
2443 break;
caryclark1049f122015-04-20 08:31:59 -07002444 case INTERSECT_CONIC_LINE_2:
2445 first = 1; last = 7; first2 = 14; last2 = 18;
2446 break;
caryclarkdac1d172014-06-17 05:15:38 -07002447 case INTERSECT_QUAD_LINE_2:
2448 first = 1; last = 7; first2 = 13; last2 = 17;
2449 break;
caryclark1049f122015-04-20 08:31:59 -07002450 case INTERSECT_CONIC_LINE_NO:
2451 first = 0; last = 6; first2 = 7; last2 = 11;
2452 break;
caryclarkdac1d172014-06-17 05:15:38 -07002453 case INTERSECT_QUAD_LINE_NO:
2454 first = 0; last = 6; first2 = 6; last2 = 10;
2455 break;
caryclark1049f122015-04-20 08:31:59 -07002456 case INTERSECT_CONIC:
2457 first = 1; last = 7; first2 = 11; last2 = 17;
2458 break;
caryclarkdac1d172014-06-17 05:15:38 -07002459 case INTERSECT_QUAD:
2460 first = 1; last = 7; first2 = 10; last2 = 16;
2461 break;
caryclark1049f122015-04-20 08:31:59 -07002462 case INTERSECT_CONIC_2:
2463 first = 1; last = 7; first2 = 14; last2 = 20;
2464 break;
caryclarkdac1d172014-06-17 05:15:38 -07002465 case INTERSECT_QUAD_2:
2466 first = 1; last = 7; first2 = 13; last2 = 19;
2467 break;
caryclark1049f122015-04-20 08:31:59 -07002468 case INTERSECT_CONIC_NO:
2469 first = 0; last = 6; first2 = 7; last2 = 13;
2470 break;
caryclarkdac1d172014-06-17 05:15:38 -07002471 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;
caryclark55888e42016-07-18 10:01:36 -07002492 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;
caryclark6c3b9cd2016-09-26 05:36:58 -07002498 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;
caryclark55888e42016-07-18 10:01:36 -07002504 case INTERSECT_CONIC_QUAD_NO:
2505 first = 0; last = 6; first2 = 7; last2 = 13;
2506 break;
caryclarkdac1d172014-06-17 05:15:38 -07002507 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 }
caryclark54359292015-03-26 07:52:43 -07002580 {
caryclarkdac1d172014-06-17 05:15:38 -07002581 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;
caryclark624637c2015-05-11 07:21:27 -07002588 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;
caryclarkdac1d172014-06-17 05:15:38 -07002597 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;
caryclark03b03ca2015-04-23 09:13:37 -07002606 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;
caryclarkdac1d172014-06-17 05:15:38 -07002615 }
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) {
caryclark1049f122015-04-20 08:31:59 -07002624 draw_computed = 7; // show quadratics, conics, and cubics
caryclarkdac1d172014-06-17 05:15:38 -07002625 }
2626 if (hasPath == true && hasComputedPath == false && draw_computed) {
2627 draw_computed = 0;
2628 }
2629}
2630
caryclark26ad22a2015-10-16 09:03:38 -07002631function curveByIDMatch(test, id, recMatch) {
caryclark54359292015-03-26 07:52:43 -07002632 var tIndex = -3;
2633 while ((tIndex += 3) < test.length) {
caryclarkdac1d172014-06-17 05:15:38 -07002634 var recType = test[tIndex];
caryclark54359292015-03-26 07:52:43 -07002635 if (recType == REC_TYPE_OP) {
2636 continue;
2637 }
caryclark26ad22a2015-10-16 09:03:38 -07002638 if (recType != recMatch) {
caryclarkdac1d172014-06-17 05:15:38 -07002639 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) {
caryclark54359292015-03-26 07:52:43 -07002647 case PATH_LINE:
caryclarkdac1d172014-06-17 05:15:38 -07002648 return [frags[1], frags[2], frags[3], frags[4]];
caryclark54359292015-03-26 07:52:43 -07002649 case PATH_QUAD:
caryclarkdac1d172014-06-17 05:15:38 -07002650 return [frags[1], frags[2], frags[3], frags[4],
2651 frags[5], frags[6]];
caryclark1049f122015-04-20 08:31:59 -07002652 case PATH_CONIC:
2653 return [frags[1], frags[2], frags[3], frags[4],
2654 frags[5], frags[6], frags[7]];
caryclark54359292015-03-26 07:52:43 -07002655 case PATH_CUBIC:
caryclarkdac1d172014-06-17 05:15:38 -07002656 return [frags[1], frags[2], frags[3], frags[4],
2657 frags[5], frags[6], frags[7], frags[8]];
2658 }
2659 }
2660 }
caryclarkdac1d172014-06-17 05:15:38 -07002661 }
2662 return [];
2663}
2664
caryclark26ad22a2015-10-16 09:03:38 -07002665function 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
2673function curvePartialByIDMatch(test, id, t0, t1, recMatch) {
caryclark54359292015-03-26 07:52:43 -07002674 var tIndex = -3;
2675 while ((tIndex += 3) < test.length) {
caryclarkdac1d172014-06-17 05:15:38 -07002676 var recType = test[tIndex];
caryclark54359292015-03-26 07:52:43 -07002677 if (recType == REC_TYPE_OP) {
2678 continue;
2679 }
caryclark26ad22a2015-10-16 09:03:38 -07002680 if (recType != recMatch) {
caryclarkdac1d172014-06-17 05:15:38 -07002681 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) {
caryclark54359292015-03-26 07:52:43 -07002689 case PATH_LINE:
caryclarkdac1d172014-06-17 05:15:38 -07002690 return linePartial(frags[1], frags[2], frags[3], frags[4], t0, t1);
caryclark54359292015-03-26 07:52:43 -07002691 case PATH_QUAD:
caryclarkdac1d172014-06-17 05:15:38 -07002692 return quadPartial(frags[1], frags[2], frags[3], frags[4],
2693 frags[5], frags[6], t0, t1);
caryclark1049f122015-04-20 08:31:59 -07002694 case PATH_CONIC:
2695 return conicPartial(frags[1], frags[2], frags[3], frags[4],
2696 frags[5], frags[6], frags[7], t0, t1);
caryclark54359292015-03-26 07:52:43 -07002697 case PATH_CUBIC:
caryclarkdac1d172014-06-17 05:15:38 -07002698 return cubicPartial(frags[1], frags[2], frags[3], frags[4],
2699 frags[5], frags[6], frags[7], frags[8], t0, t1);
2700 }
2701 }
2702 }
caryclarkdac1d172014-06-17 05:15:38 -07002703 }
2704 return [];
2705}
2706
caryclark26ad22a2015-10-16 09:03:38 -07002707function 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
2715function idByCurveIDMatch(test, frag, type, recMatch) {
caryclark54359292015-03-26 07:52:43 -07002716 var tIndex = 0;
caryclarkdac1d172014-06-17 05:15:38 -07002717 while (tIndex < test.length) {
2718 var recType = test[tIndex];
caryclark26ad22a2015-10-16 09:03:38 -07002719 if (recType != recMatch) {
caryclark54359292015-03-26 07:52:43 -07002720 ++tIndex;
2721 continue;
caryclarkdac1d172014-06-17 05:15:38 -07002722 }
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];
caryclark54359292015-03-26 07:52:43 -07002727 if (frag.length != frags.length - 1) {
2728 continue;
2729 }
caryclarkdac1d172014-06-17 05:15:38 -07002730 switch (fragType) {
caryclark54359292015-03-26 07:52:43 -07002731 case PATH_LINE:
caryclarkdac1d172014-06-17 05:15:38 -07002732 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];
caryclark54359292015-03-26 07:52:43 -07002737 case PATH_QUAD:
caryclarkdac1d172014-06-17 05:15:38 -07002738 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];
caryclark1049f122015-04-20 08:31:59 -07002744 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];
caryclark54359292015-03-26 07:52:43 -07002752 case PATH_CUBIC:
caryclarkdac1d172014-06-17 05:15:38 -07002753 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
caryclark26ad22a2015-10-16 09:03:38 -07002767function 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
caryclarkdac1d172014-06-17 05:15:38 -07002775function curve_extremes(curve, bounds) {
caryclark1049f122015-04-20 08:31:59 -07002776 var length = curve.length == 7 ? 6 : curve.length;
caryclarked0935a2015-10-22 07:23:52 -07002777 for (var index = 0; index < length; index += 2) {
caryclarkdac1d172014-06-17 05:15:38 -07002778 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
2787function 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
2815function 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
2872function drawPoint(px, py, end) {
caryclark1049f122015-04-20 08:31:59 -07002873 var length = drawnPts.length == 7 ? 6 : drawnPts.length;
2874 for (var pts = 0; pts < length; pts += 2) {
caryclarkdac1d172014-06-17 05:15:38 -07002875 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
caryclark1049f122015-04-20 08:31:59 -07002900function 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
caryclarkdac1d172014-06-17 05:15:38 -07002914function drawPoints(ptArray, curveType, drawControls) {
caryclark1049f122015-04-20 08:31:59 -07002915 var count = coordCount(curveType);
caryclarkdac1d172014-06-17 05:15:38 -07002916 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
2924function 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
2945function 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;
caryclark1049f122015-04-20 08:31:59 -07002962 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;
caryclarkdac1d172014-06-17 05:15:38 -07002973 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}
caryclark55888e42016-07-18 10:01:36 -07002987
caryclarkdac1d172014-06-17 05:15:38 -07002988function 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
2999function 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
3006function 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
3013function 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
3036function 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
3048function 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
3060function 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
3077function 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
3103function 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
3117function interp(A, B, t) {
3118 return A + (B - A) * t;
3119}
3120
3121function 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
3129function 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
3144function 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
caryclark1049f122015-04-20 08:31:59 -07003165function 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]
caryclark55888e42016-07-18 10:01:36 -07003177 && x2 == drawnCubics[pts + 2] && y2 == drawnCubics[pts + 3]
3178 && x3 == drawnCubics[pts + 4] && y3 == drawnCubics[pts + 5]
caryclark1049f122015-04-20 08:31:59 -07003179 && 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
3193var kMaxConicToQuadPOW2 = 5;
3194
3195function 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
3212function subdivide_w_value(w) {
3213 return Math.sqrt(0.5 + w * 0.5);
3214}
3215
3216function 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
3232function 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
3247function chopIntoQuadsPOW2(curve, pow2, pts) {
3248 subdivide(curve, pow2, pts);
3249 return 1 << pow2;
3250}
3251
3252function 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
3272function 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
3281function 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
3288function 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;
caryclark1049f122015-04-20 08:31:59 -07003304 var array = [
caryclarked0935a2015-10-22 07:23:52 -07003305 ax / az, ay / az, bx / bz, by / bz, cx / cz, cy / cz, 0
caryclark1049f122015-04-20 08:31:59 -07003306 ];
caryclarked0935a2015-10-22 07:23:52 -07003307 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;
caryclark1049f122015-04-20 08:31:59 -07003314 return array;
3315}
caryclark55888e42016-07-18 10:01:36 -07003316
caryclark1049f122015-04-20 08:31:59 -07003317function 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
caryclarkdac1d172014-06-17 05:15:38 -07003329function 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]
caryclark55888e42016-07-18 10:01:36 -07003341 && x2 == drawnCubics[pts + 2] && y2 == drawnCubics[pts + 3]
3342 && x3 == drawnCubics[pts + 4] && y3 == drawnCubics[pts + 5]
caryclarkdac1d172014-06-17 05:15:38 -07003343 && 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
3358function 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
3374function 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
3385function 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}
caryclark55888e42016-07-18 10:01:36 -07003407
caryclarkdac1d172014-06-17 05:15:38 -07003408function 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
3433function 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;
caryclark1049f122015-04-20 08:31:59 -07003441 case 7:
3442 drawConicWithQuads(c[0], c[1], c[2], c[3], c[4], c[5], c[6]);
3443 break;
caryclarkdac1d172014-06-17 05:15:38 -07003444 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
3450function boundsWidth(pts) {
3451 var min = pts[0];
3452 var max = pts[0];
caryclark1049f122015-04-20 08:31:59 -07003453 var length = pts.length == 7 ? 6 : pts.length;
3454 for (var idx = 2; idx < length; idx += 2) {
caryclarkdac1d172014-06-17 05:15:38 -07003455 min = Math.min(min, pts[idx]);
3456 max = Math.max(max, pts[idx]);
3457 }
3458 return max - min;
3459}
3460
3461function boundsHeight(pts) {
3462 var min = pts[1];
3463 var max = pts[1];
caryclark1049f122015-04-20 08:31:59 -07003464 var length = pts.length == 7 ? 6 : pts.length;
3465 for (var idx = 3; idx < length; idx += 2) {
caryclarkdac1d172014-06-17 05:15:38 -07003466 min = Math.min(min, pts[idx]);
3467 max = Math.max(max, pts[idx]);
3468 }
3469 return max - min;
3470}
3471
3472function 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];
caryclark1049f122015-04-20 08:31:59 -07003478 if (dx == 0 && dy == 0 && pts.length == 8) {
caryclarkdac1d172014-06-17 05:15:38 -07003479 dx = pts[6] - pts[0];
3480 dy = pts[7] - pts[1];
3481 }
3482 }
3483 return Math.atan2(-dy, dx);
3484}
3485
3486function 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
3497function 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
3507function 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
3532function 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
3547function 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
3554function 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
3565function dxy_at_t(curve, type, t) {
3566 var dxy = {};
Cary Clarkff114282016-12-14 11:56:16 -05003567 if (type == PATH_LINE) {
3568 dxy.x = curve[2] - curve[0];
3569 dxy.y = curve[3] - curve[1];
3570 } else if (type == PATH_QUAD) {
caryclarkdac1d172014-06-17 05:15:38 -07003571 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];
caryclark1049f122015-04-20 08:31:59 -07003576 } 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;
caryclarkdac1d172014-06-17 05:15:38 -07003587 } 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 Clark59d5a0e2017-01-23 14:38:52 +00003603function dpt_at_t(curve, t) {
Cary Clarkff114282016-12-14 11:56:16 -05003604 var type = PATH_LINE + (curve.length / 2 - 2);
Cary Clark59d5a0e2017-01-23 14:38:52 +00003605 return dxy_at_t(curve, type, t);
Cary Clarkff114282016-12-14 11:56:16 -05003606}
3607
caryclarkdac1d172014-06-17 05:15:38 -07003608function 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
3622function drawLabelX(ymin, num, loc) {
3623 var px = (loc - srcLeft) * scale;
3624 var py = (ymin - srcTop) * scale - 20;
3625 drawLabel(num, px, py);
3626}
3627
3628function drawLabelY(xmin, num, loc) {
3629 var px = (xmin - srcLeft) * scale - 20;
3630 var py = (loc - srcTop) * scale;
3631 drawLabel(num, px, py);
3632}
3633
3634function 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
3657function scalexy(x, y, mag) {
3658 var length = Math.sqrt(x * x + y * y);
3659 return mag / length;
3660}
3661
caryclark03b03ca2015-04-23 09:13:37 -07003662function drawArrow(x, y, dx, dy, s) {
3663 var dscale = scalexy(dx, dy, 1 / scale * 100 * s);
caryclarkdac1d172014-06-17 05:15:38 -07003664 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
3681function 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 }
caryclark1049f122015-04-20 08:31:59 -07003691 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 }
caryclarkdac1d172014-06-17 05:15:38 -07003695 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
3702function 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 }
caryclark1049f122015-04-20 08:31:59 -07003712 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 }
caryclarkdac1d172014-06-17 05:15:38 -07003716 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 Clark59d5a0e2017-01-23 14:38:52 +00003723function 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;
Cary Clarkff114282016-12-14 11:56:16 -05003728}
3729
3730function drawOrder(curve, t, label) {
3731 var px = x_at_t(curve, t);
3732 var py = y_at_t(curve, t);
caryclarkdac1d172014-06-17 05:15:38 -07003733 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 Clark59d5a0e2017-01-23 14:38:52 +00003754function 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);
Cary Clarkff114282016-12-14 11:56:16 -05003794}
3795
Cary Clark59d5a0e2017-01-23 14:38:52 +00003796function 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;
Cary Clarkff114282016-12-14 11:56:16 -05003801}
3802
Cary Clark59d5a0e2017-01-23 14:38:52 +00003803function drawDirection(curve, t) {
Cary Clarkff114282016-12-14 11:56:16 -05003804 var d = dpt_at_t(curve, t);
3805 d = set_length(d, 16);
Cary Clark59d5a0e2017-01-23 14:38:52 +00003806 var pt = localToGlobal(pt_at_t(curve, t));
Cary Clarkff114282016-12-14 11:56:16 -05003807 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
Cary Clark59d5a0e2017-01-23 14:38:52 +00003815function 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);
Cary Clarkff114282016-12-14 11:56:16 -05003856}
3857
3858function drawID(curve, t, id) {
3859 var px = x_at_t(curve, t);
3860 var py = y_at_t(curve, t);
caryclarkdac1d172014-06-17 05:15:38 -07003861 var _px = (px - srcLeft) * scale;
3862 var _py = (py - srcTop) * scale;
3863 draw_id_at(id, _px, _py);
3864}
3865
Cary Clark59d5a0e2017-01-23 14:38:52 +00003866function localToGlobal(local) {
3867 var global = {};
3868 global.x = (local.x - srcLeft) * scale;
3869 global.y = (local.y - srcTop) * scale;
3870 return global;
Cary Clarkff114282016-12-14 11:56:16 -05003871}
3872
Cary Clark59d5a0e2017-01-23 14:38:52 +00003873function ptOnScreen(local) {
3874 var pt = localToGlobal(local);
3875 return 10 <= pt.x && pt.x <= screenWidth - 10
3876 && 10 <= pt.y && pt.y <= screenHeight - 10;
Cary Clarkff114282016-12-14 11:56:16 -05003877}
3878
Cary Clark59d5a0e2017-01-23 14:38:52 +00003879function 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);
Cary Clarkff114282016-12-14 11:56:16 -05003913}
3914
caryclarkdac1d172014-06-17 05:15:38 -07003915function 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
3930function drawLinePartialID(id, x1, y1, x2, y2, t1, t2) {
3931 var curve = [x1, y1, x2, y2];
3932 drawCurvePartialID(id, curve, t1, t2);
3933}
3934
caryclark55888e42016-07-18 10:01:36 -07003935function drawLineID(id, x1, y1, x2, y2) {
3936 drawLinePartialID(id, x1, y1, x2, y2, 0, 1);
3937}
3938
caryclarkdac1d172014-06-17 05:15:38 -07003939function 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
caryclark55888e42016-07-18 10:01:36 -07003944function drawQuadID(id, x1, y1, x2, y2, x3, y3) {
3945 drawQuadPartialID(id, x1, y1, x2, y2, x3, y3, 0, 1);
3946}
3947
caryclark1049f122015-04-20 08:31:59 -07003948function 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
caryclark55888e42016-07-18 10:01:36 -07003953function drawConicID(id, x1, y1, x2, y2, x3, y3, w) {
3954 drawConicPartialID(id, x1, y1, x2, y2, x3, y3, w, 0, 1);
3955}
3956
caryclarkdac1d172014-06-17 05:15:38 -07003957function 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
caryclark55888e42016-07-18 10:01:36 -07003962function 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
caryclarkdac1d172014-06-17 05:15:38 -07003966function drawCurvePartialID(id, curve, t1, t2) {
Cary Clarkff114282016-12-14 11:56:16 -05003967 drawVisibleID(curve, (t1 + t2) / 2, id);
caryclarkdac1d172014-06-17 05:15:38 -07003968}
3969
3970function 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 Clarkff114282016-12-14 11:56:16 -05003987 drawVisibleID(curve, 0.5, id);
caryclarkdac1d172014-06-17 05:15:38 -07003988 }
3989 }
Cary Clark59d5a0e2017-01-23 14:38:52 +00003990 if (draw_direction) {
3991 drawVisibleDirection(curve);
Cary Clarkff114282016-12-14 11:56:16 -05003992 }
caryclarkdac1d172014-06-17 05:15:38 -07003993 if (type == PATH_LINE) {
3994 return;
3995 }
3996 if (draw_deriviatives > 0) {
3997 var d = dxy_at_t(curve, type, 0);
caryclark03b03ca2015-04-23 09:13:37 -07003998 drawArrow(curve[0], curve[1], d.x, d.y, 1);
caryclarkdac1d172014-06-17 05:15:38 -07003999 if (draw_deriviatives == 2) {
4000 d = dxy_at_t(curve, type, 1);
4001 if (type == PATH_CUBIC) {
caryclark03b03ca2015-04-23 09:13:37 -07004002 drawArrow(curve[6], curve[7], d.x, d.y, 1);
caryclarkdac1d172014-06-17 05:15:38 -07004003 } else {
caryclark03b03ca2015-04-23 09:13:37 -07004004 drawArrow(curve[4], curve[5], d.x, d.y, 1);
caryclarkdac1d172014-06-17 05:15:38 -07004005 }
4006 }
4007 if (draw_midpoint) {
4008 var mid = pointAtT(curve, type, 0.5);
4009 d = dxy_at_t(curve, type, 0.5);
caryclark03b03ca2015-04-23 09:13:37 -07004010 drawArrow(mid.x, mid.y, d.x, d.y, 1);
caryclarkdac1d172014-06-17 05:15:38 -07004011 }
4012 }
4013 if (type != PATH_CUBIC) {
4014 return;
4015 }
caryclarkdac1d172014-06-17 05:15:38 -07004016 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
4028function logCurves(test) {
4029 for (curves in test) {
4030 var curve = test[curves];
4031 dumpCurve(curve);
4032 }
4033}
4034
4035function curveToString(curve) {
4036 var str = "{{";
caryclark1049f122015-04-20 08:31:59 -07004037 var length = curve.length == 7 ? 6 : curve.length;
4038 if (curve.length == 7) {
4039 str += "{";
4040 }
4041 for (i = 0; i < length; i += 2) {
caryclarkdac1d172014-06-17 05:15:38 -07004042 str += curve[i].toFixed(decimal_places) + "," + curve[i + 1].toFixed(decimal_places);
4043 if (i < curve.length - 2) {
4044 str += "}, {";
4045 }
4046 }
caryclark1049f122015-04-20 08:31:59 -07004047 str += "}";
4048 if (curve.length == 7) {
4049 str += "}, " + curve[6].toFixed(decimal_places);
4050 }
4051 str += "}";
caryclarkdac1d172014-06-17 05:15:38 -07004052 return str;
4053}
4054
4055function dumpCurve(curve) {
4056 console.log(curveToString(curve));
4057}
4058
4059function 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;
caryclark624637c2015-05-11 07:21:27 -07004076 var lastCoin = 0;
caryclarkdac1d172014-06-17 05:15:38 -07004077 var lastSect = 0;
4078 var lastSort = 0;
4079 var lastMark = 0;
caryclark03b03ca2015-04-23 09:13:37 -07004080 var lastTop = 0;
caryclarkdac1d172014-06-17 05:15:38 -07004081 activeCount = 0;
4082 addCount = 0;
4083 angleCount = 0;
4084 opCount = 0;
4085 sectCount = 0;
4086 sortCount = 0;
caryclark03b03ca2015-04-23 09:13:37 -07004087 topCount = 0;
caryclarkdac1d172014-06-17 05:15:38 -07004088 markCount = 0;
4089 activeMax = 0;
4090 addMax = 0;
4091 angleMax = 0;
caryclark624637c2015-05-11 07:21:27 -07004092 coinMax = 0;
caryclarkdac1d172014-06-17 05:15:38 -07004093 opMax = 0;
4094 sectMax = 0;
4095 sectMax2 = 0;
4096 sortMax = 0;
caryclark03b03ca2015-04-23 09:13:37 -07004097 topMax = 0;
caryclarkdac1d172014-06-17 05:15:38 -07004098 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 }
caryclark54359292015-03-26 07:52:43 -07004141 if (recType == REC_TYPE_PATH2 && hasOp) {
4142 secondPath = tIndex;
4143 }
caryclarkdac1d172014-06-17 05:15:38 -07004144 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 }
caryclark54359292015-03-26 07:52:43 -07004162 if (recType == REC_TYPE_AFTERPART) {
4163 if (draw_angle != 3 || !inStepRange) {
4164 continue;
4165 }
4166 lastAngle = tIndex;
4167 ++angleCount;
4168 bumpStep = true;
4169 }
caryclarkdac1d172014-06-17 05:15:38 -07004170 if (recType == REC_TYPE_ANGLE) {
4171 ++angleMax;
caryclark54359292015-03-26 07:52:43 -07004172 if (draw_angle == 0 || draw_angle == 3 || !inStepRange) {
caryclarkdac1d172014-06-17 05:15:38 -07004173 continue;
4174 }
4175 lastAngle = tIndex;
4176 ++angleCount;
4177 bumpStep = true;
4178 }
caryclark624637c2015-05-11 07:21:27 -07004179 if (recType == REC_TYPE_COINCIDENCE) {
4180 ++coinMax;
4181 if (!draw_coincidence || !inStepRange) {
4182 continue;
4183 }
4184 lastCoin = tIndex;
4185 ++coinCount;
4186 bumpStep = true;
4187 }
caryclarkdac1d172014-06-17 05:15:38 -07004188 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:
caryclark1049f122015-04-20 08:31:59 -07004199 case INTERSECT_CONIC_LINE:
caryclark55888e42016-07-18 10:01:36 -07004200 case INTERSECT_CONIC_QUAD:
caryclark1049f122015-04-20 08:31:59 -07004201 case INTERSECT_CONIC:
caryclarkdac1d172014-06-17 05:15:38 -07004202 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:
caryclark1049f122015-04-20 08:31:59 -07004211 case INTERSECT_CONIC_LINE_2:
caryclark55888e42016-07-18 10:01:36 -07004212 case INTERSECT_CONIC_QUAD_2:
caryclark1049f122015-04-20 08:31:59 -07004213 case INTERSECT_CONIC_2:
caryclarkdac1d172014-06-17 05:15:38 -07004214 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:
caryclark1049f122015-04-20 08:31:59 -07004222 case INTERSECT_CONIC_LINE_NO:
caryclark55888e42016-07-18 10:01:36 -07004223 case INTERSECT_CONIC_QUAD_NO:
caryclark1049f122015-04-20 08:31:59 -07004224 case INTERSECT_CONIC_NO:
caryclarkdac1d172014-06-17 05:15:38 -07004225 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;
caryclark6c3b9cd2016-09-26 05:36:58 -07004231 case INTERSECT_CONIC_QUAD_3:
caryclarkdac1d172014-06-17 05:15:38 -07004232 case INTERSECT_CUBIC_LINE_3:
4233 case INTERSECT_CUBIC_QUAD_3:
4234 case INTERSECT_CUBIC_3:
4235 sectBump = 3;
4236 break;
caryclark6c3b9cd2016-09-26 05:36:58 -07004237 case INTERSECT_CONIC_QUAD_4:
caryclarkdac1d172014-06-17 05:15:38 -07004238 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 }
caryclark03b03ca2015-04-23 09:13:37 -07004263 if (recType == REC_TYPE_TOP) {
4264 ++topMax;
4265 if (!draw_top || !inStepRange) {
4266 continue;
4267 }
4268 lastTop = tIndex;
4269 ++topCount;
4270 bumpStep = true;
4271 }
caryclarkdac1d172014-06-17 05:15:38 -07004272 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)
reed0dc4dd62015-03-24 13:55:33 -07004290 + (draw_angle ? angleMax : 0)
caryclark624637c2015-05-11 07:21:27 -07004291 + (draw_coincidence ? coinMax : 0)
caryclark54359292015-03-26 07:52:43 -07004292 + (draw_op ? opMax : 0)
caryclarkdac1d172014-06-17 05:15:38 -07004293 + (draw_sort ? sortMax : 0)
caryclark03b03ca2015-04-23 09:13:37 -07004294 + (draw_top ? topMax : 0)
caryclarkdac1d172014-06-17 05:15:38 -07004295 + (draw_mark ? markMax : 0)
4296 + (draw_intersection == 2 ? sectMax : draw_intersection == 3 ? sectMax2 : 0);
4297 if (stepMax == 0) {
caryclark624637c2015-05-11 07:21:27 -07004298 stepMax = addMax + activeMax + angleMax + coinMax + opMax + sortMax + topMax + markMax;
caryclarkdac1d172014-06-17 05:15:38 -07004299 }
4300 drawnPts = [];
4301 drawnLines = [];
4302 drawnQuads = [];
caryclark1049f122015-04-20 08:31:59 -07004303 drawnConics = [];
caryclarkdac1d172014-06-17 05:15:38 -07004304 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:
caryclark1049f122015-04-20 08:31:59 -07004331 if ((draw_computed & 0x9) == 1 || ((draw_computed & 8) != 0
4332 && (draw_computed & 7) == pathIndex)) {
caryclarkdac1d172014-06-17 05:15:38 -07004333 drawQuad(frags[0], frags[1], frags[2], frags[3],
4334 frags[4], frags[5]);
4335 drawThis = true;
4336 }
4337 break;
caryclark1049f122015-04-20 08:31:59 -07004338 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;
caryclarkdac1d172014-06-17 05:15:38 -07004346 case PATH_CUBIC:
caryclark1049f122015-04-20 08:31:59 -07004347 if ((draw_computed & 0xC) == 4 || ((draw_computed & 8) != 0
4348 && (draw_computed & 7) == pathIndex)) {
caryclarkdac1d172014-06-17 05:15:38 -07004349 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;
caryclark26ad22a2015-10-16 09:03:38 -07004370 case REC_TYPE_ALIGNED:
4371 if (draw_path < 4) {
4372 continue;
4373 }
caryclarkdac1d172014-06-17 05:15:38 -07004374 case REC_TYPE_PATH:
caryclark54359292015-03-26 07:52:43 -07004375 case REC_TYPE_PATH2:
caryclark26ad22a2015-10-16 09:03:38 -07004376 if (REC_TYPE_ALIGNED != recType && draw_path >= 4) {
4377 continue;
4378 }
caryclarkdac1d172014-06-17 05:15:38 -07004379 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";
caryclark55888e42016-07-18 10:01:36 -07004389 var frags2 = [];
caryclarkdac1d172014-06-17 05:15:38 -07004390 switch (fragType) {
4391 case PATH_LINE:
caryclark54359292015-03-26 07:52:43 -07004392 for (var i = 0; i < 4; ++ i) { frags2[i] = frags[i + 1]; }
4393 drawLine(frags2[0], frags2[1], frags2[2], frags2[3]);
caryclarkdac1d172014-06-17 05:15:38 -07004394 break;
4395 case PATH_QUAD:
caryclark54359292015-03-26 07:52:43 -07004396 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]);
caryclarkdac1d172014-06-17 05:15:38 -07004399 break;
caryclark1049f122015-04-20 08:31:59 -07004400 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;
caryclarkdac1d172014-06-17 05:15:38 -07004405 case PATH_CUBIC:
caryclark54359292015-03-26 07:52:43 -07004406 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]);
caryclarkdac1d172014-06-17 05:15:38 -07004409 break;
4410 default:
caryclark26ad22a2015-10-16 09:03:38 -07004411 console.log("unknown " + recType + " frag type: " + fragType);
caryclarkdac1d172014-06-17 05:15:38 -07004412 throw "stop execution";
4413 }
4414 if (collect_bounds) {
4415 break;
4416 }
caryclark54359292015-03-26 07:52:43 -07004417 drawCurveSpecials(test, frags2, fragType);
caryclarkdac1d172014-06-17 05:15:38 -07004418 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];
caryclark55888e42016-07-18 10:01:36 -07004438 var x3, y3, x3, y4, w;
caryclarkdac1d172014-06-17 05:15:38 -07004439 ctx.lineWidth = 3;
4440 ctx.strokeStyle = "rgba(0,0,255, 0.3)";
4441 focus_enabled = true;
4442 switch (fragType) {
4443 case ACTIVE_LINE_SPAN:
caryclark55888e42016-07-18 10:01:36 -07004444 drawLine(x1, y1, x2, y2);
caryclarkdac1d172014-06-17 05:15:38 -07004445 if (draw_id) {
caryclark55888e42016-07-18 10:01:36 -07004446 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);
caryclarkdac1d172014-06-17 05:15:38 -07004452 }
4453 break;
4454 case ACTIVE_QUAD_SPAN:
4455 x3 = frags[SPAN_X3];
4456 y3 = frags[SPAN_Y3];
caryclark55888e42016-07-18 10:01:36 -07004457 drawQuad(x1, y1, x2, y2, x3, y3);
caryclarkdac1d172014-06-17 05:15:38 -07004458 if (draw_id) {
caryclark55888e42016-07-18 10:01:36 -07004459 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);
caryclarkdac1d172014-06-17 05:15:38 -07004465 }
4466 break;
caryclark1049f122015-04-20 08:31:59 -07004467 case ACTIVE_CONIC_SPAN:
4468 x3 = frags[SPAN_X3];
4469 y3 = frags[SPAN_Y3];
caryclark1049f122015-04-20 08:31:59 -07004470 w = frags[SPAN_K_W];
caryclark55888e42016-07-18 10:01:36 -07004471 drawConicWithQuads(x1, y1, x2, y2, x3, y3, w);
caryclark1049f122015-04-20 08:31:59 -07004472 if (draw_id) {
caryclark55888e42016-07-18 10:01:36 -07004473 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);
caryclark1049f122015-04-20 08:31:59 -07004479 }
4480 break;
caryclarkdac1d172014-06-17 05:15:38 -07004481 case ACTIVE_CUBIC_SPAN:
4482 x3 = frags[SPAN_X3];
4483 y3 = frags[SPAN_Y3];
4484 x4 = frags[SPAN_X4];
4485 y4 = frags[SPAN_Y4];
caryclark55888e42016-07-18 10:01:36 -07004486 drawCubic(x1, y1, x2, y2, x3, y3, x4, y4);
caryclarkdac1d172014-06-17 05:15:38 -07004487 if (draw_id) {
caryclark55888e42016-07-18 10:01:36 -07004488 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);
caryclarkdac1d172014-06-17 05:15:38 -07004494 }
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;
caryclark1049f122015-04-20 08:31:59 -07004540 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;
caryclarkdac1d172014-06-17 05:15:38 -07004546 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:
caryclark54359292015-03-26 07:52:43 -07004563 angleBetween = frags[18] == "T";
4564 afterIndex = 0;
4565 if (draw_angle == 0 || draw_angle == 3 || (step_limit > 0 && tIndex < lastAngle)) {
caryclarkdac1d172014-06-17 05:15:38 -07004566 continue;
4567 }
4568 focus_enabled = true;
4569 ctx.lineWidth = 3;
4570 ctx.strokeStyle = "rgba(127,45,127, 0.3)";
caryclark54359292015-03-26 07:52:43 -07004571 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]);
caryclarkdac1d172014-06-17 05:15:38 -07004574 drawCurve(leftCurve);
4575 drawCurve(rightCurve);
caryclark54359292015-03-26 07:52:43 -07004576 ctx.strokeStyle = angleBetween ? "rgba(0,160,45, 0.3)" : "rgba(255,0,45, 0.5)";
caryclarkdac1d172014-06-17 05:15:38 -07004577 drawCurve(midCurve);
4578 if (draw_angle > 1) {
Cary Clarkff114282016-12-14 11:56:16 -05004579 drawVisibleOrder(leftCurve, 'L');
4580 drawVisibleOrder(rightCurve, 'R');
4581 }
Cary Clark59d5a0e2017-01-23 14:38:52 +00004582 if (draw_id) {
4583 drawVisibleID(leftCurve, 0.5, frags[0]);
4584 drawVisibleID(midCurve, 0.5, frags[6]);
4585 drawVisibleID(rightCurve, 0.5, frags[12]);
caryclarkdac1d172014-06-17 05:15:38 -07004586 }
4587 break;
caryclark54359292015-03-26 07:52:43 -07004588 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 Clarkff114282016-12-14 11:56:16 -05004594 : "rgba(0,0,255, 1.0)";
4595 var curve;
4596 var id;
caryclark54359292015-03-26 07:52:43 -07004597 switch (fragType) {
4598 case PATH_LINE:
Cary Clarkff114282016-12-14 11:56:16 -05004599 curve = [ frags[0], frags[1], frags[2], frags[3] ];
4600 id = frags[4];
caryclark54359292015-03-26 07:52:43 -07004601 break;
4602 case PATH_QUAD:
Cary Clarkff114282016-12-14 11:56:16 -05004603 curve = [ frags[0], frags[1], frags[2], frags[3],
4604 frags[4], frags[5] ];
4605 id = frags[6];
caryclark54359292015-03-26 07:52:43 -07004606 break;
caryclark1049f122015-04-20 08:31:59 -07004607 case PATH_CONIC:
Cary Clarkff114282016-12-14 11:56:16 -05004608 curve = [ frags[0], frags[1], frags[2], frags[3],
4609 frags[4], frags[5], frags[6] ];
4610 id = frags[7];
caryclark1049f122015-04-20 08:31:59 -07004611 break;
caryclark54359292015-03-26 07:52:43 -07004612 case PATH_CUBIC:
Cary Clarkff114282016-12-14 11:56:16 -05004613 curve = [ frags[0], frags[1], frags[2], frags[3],
4614 frags[4], frags[5], frags[6], frags[7] ];
4615 id = frags[8];
caryclark54359292015-03-26 07:52:43 -07004616 break;
4617 default:
4618 console.log("unknown REC_TYPE_AFTERPART frag type: " + fragType);
4619 throw "stop execution";
4620 }
Cary Clarkff114282016-12-14 11:56:16 -05004621 drawCurve(curve);
Cary Clark59d5a0e2017-01-23 14:38:52 +00004622 if (draw_id) {
4623 drawVisibleID(curve, 0.5, id);
Cary Clarkff114282016-12-14 11:56:16 -05004624 }
caryclark54359292015-03-26 07:52:43 -07004625 ++afterIndex;
4626 break;
caryclark624637c2015-05-11 07:21:27 -07004627 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;
caryclarkdac1d172014-06-17 05:15:38 -07004637 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;
caryclark1049f122015-04-20 08:31:59 -07004693 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;
caryclark55888e42016-07-18 10:01:36 -07004705 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;
caryclark6c3b9cd2016-09-26 05:36:58 -07004714 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;
caryclark55888e42016-07-18 10:01:36 -07004727 case INTERSECT_CONIC_QUAD_NO:
4728 c1s = 0; c1l = 7; c2s = 7; c2l = 6;
4729 break;
caryclark1049f122015-04-20 08:31:59 -07004730 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;
caryclarkdac1d172014-06-17 05:15:38 -07004742 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) {
caryclark55888e42016-07-18 10:01:36 -07004825 case 4:
caryclarkdac1d172014-06-17 05:15:38 -07004826 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;
caryclark1049f122015-04-20 08:31:59 -07004841 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;
caryclarkdac1d172014-06-17 05:15:38 -07004850 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 Clarkff114282016-12-14 11:56:16 -05004861 drawVisibleID(curve, 0.5, id);
caryclarkdac1d172014-06-17 05:15:38 -07004862 }
4863 id = -1;
4864 switch (c2l) {
4865 case 0:
4866 break;
caryclark55888e42016-07-18 10:01:36 -07004867 case 4:
caryclarkdac1d172014-06-17 05:15:38 -07004868 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;
caryclark1049f122015-04-20 08:31:59 -07004883 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;
caryclarkdac1d172014-06-17 05:15:38 -07004892 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 Clarkff114282016-12-14 11:56:16 -05004903 drawVisibleID(curve, 0.5, id);
caryclarkdac1d172014-06-17 05:15:38 -07004904 }
4905 }
4906 if (collect_bounds) {
4907 break;
4908 }
caryclark54359292015-03-26 07:52:43 -07004909 if (draw_intersection != 3 || step_limit == 0 || tIndex >= lastSect) {
4910 for (var idx = 0; idx < f.length; idx += 4) {
caryclarkdac1d172014-06-17 05:15:38 -07004911 drawPoint(frags[f[idx]], frags[f[idx + 1]], true);
4912 }
4913 }
4914 if (!draw_intersectT) {
4915 break;
4916 }
4917 ctx.fillStyle = "red";
caryclark54359292015-03-26 07:52:43 -07004918 if (draw_intersection != 3 || step_limit == 0 || tIndex >= lastSect) {
4919 for (var idx = 0; idx < f.length; idx += 4) {
caryclarkdac1d172014-06-17 05:15:38 -07004920 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;
caryclark03b03ca2015-04-23 09:13:37 -07004943 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;
caryclarkdac1d172014-06-17 05:15:38 -07004959 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 Clarkff114282016-12-14 11:56:16 -05005066 drawVisibleOrder(partial, frags[12]);
caryclarkdac1d172014-06-17 05:15:38 -07005067 } else {
Cary Clarkff114282016-12-14 11:56:16 -05005068 drawVisibleOrder(partial, (recordIndex / 2) + 1);
caryclarkdac1d172014-06-17 05:15:38 -07005069 }
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;
caryclark624637c2015-05-11 07:21:27 -07005116 var drawSomething = draw_add | draw_active | draw_angle | draw_coincidence | draw_sort | draw_mark;
caryclarkdac1d172014-06-17 05:15:38 -07005117 // 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);
caryclark624637c2015-05-11 07:21:27 -07005122 drawBox(pos++, "rgba(127,127,0, 0.3)", "black", draw_coincidence ? coinCount : coinMax, draw_coincidence, coincidenceKey);
caryclarkdac1d172014-06-17 05:15:38 -07005123 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);
caryclark03b03ca2015-04-23 09:13:37 -07005125 drawBox(pos++, "rgba(127,127,0, 0.3)", "black", draw_top ? topCount : topMax, draw_top, topKey);
caryclarkdac1d172014-06-17 05:15:38 -07005126 drawBox(pos++, "rgba(127,0,127, 0.3)", "black", draw_mark ? markCount : markMax, draw_mark, markKey);
caryclark55888e42016-07-18 10:01:36 -07005127 drawBox(pos++, "black", "white",
caryclark26ad22a2015-10-16 09:03:38 -07005128 (new Array('P', 'P1', 'P2', 'P', 'p', 'p1', 'p2'))[draw_path], draw_path != 0, pathKey);
caryclarkdac1d172014-06-17 05:15:38 -07005129 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);
caryclarkdac1d172014-06-17 05:15:38 -07005153 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
5162function 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
5182function 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
5202function ptInTControl() {
5203 var e = window.event;
caryclark55888e42016-07-18 10:01:36 -07005204 var tgt = e.target || e.srcElement;
caryclarkdac1d172014-06-17 05:15:38 -07005205 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
5222function 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
5233function 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
5249function 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
5257function dumpAngleTest(test, id, t0, t1) {
5258 var curve = curveByID(test, id);
caryclark55888e42016-07-18 10:01:36 -07005259 console.log(" { {" + curveToString(curve) + "}, "
caryclarkdac1d172014-06-17 05:15:38 -07005260 + curve.length / 2 + ", " + t0 + ", " + t1 + ", {} }, //");
5261}
5262
5263function 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) {
caryclarkdac1d172014-06-17 05:15:38 -07005289 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
5302var activeKey = 'a';
5303var pathKey = 'b';
5304var pathBackKey = 'B';
5305var centerKey = 'c';
caryclark624637c2015-05-11 07:21:27 -07005306var coincidenceKey = 'C';
caryclarkdac1d172014-06-17 05:15:38 -07005307var addKey = 'd';
5308var deriviativesKey = 'f';
5309var angleKey = 'g';
5310var angleBackKey = 'G';
caryclarkdac1d172014-06-17 05:15:38 -07005311var intersectionKey = 'i';
5312var intersectionBackKey = 'I';
5313var sequenceKey = 'j';
5314var midpointKey = 'k';
5315var logKey = 'l';
5316var logToConsoleKey = 'L';
5317var markKey = 'm';
5318var sortKey = 'o';
5319var opKey = 'p';
5320var opBackKey = 'P';
5321var computedKey = 'q';
5322var computedBackKey = 'Q';
Cary Clarkff114282016-12-14 11:56:16 -05005323var directionKey = 'r';
caryclarkdac1d172014-06-17 05:15:38 -07005324var stepKey = 's';
5325var stepBackKey = 'S';
5326var intersectTKey = 't';
caryclark03b03ca2015-04-23 09:13:37 -07005327var topKey = 'T';
caryclarkdac1d172014-06-17 05:15:38 -07005328var curveTKey = 'u';
5329var controlLinesBackKey = 'V';
5330var controlLinesKey = 'v';
5331var ptsKey = 'x';
5332var xyKey = 'y';
5333var logCurvesKey = 'z';
5334var focusKey = '`';
5335var idKey = '.';
5336var retinaKey = '\\';
5337
5338function 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;
caryclark55888e42016-07-18 10:01:36 -07005357 redraw();
caryclarkdac1d172014-06-17 05:15:38 -07005358 break;
5359 case addKey:
5360 draw_add ^= true;
caryclark55888e42016-07-18 10:01:36 -07005361 redraw();
caryclarkdac1d172014-06-17 05:15:38 -07005362 break;
5363 case angleKey:
caryclark54359292015-03-26 07:52:43 -07005364 draw_angle = (draw_angle + 1) % 4;
caryclarkdac1d172014-06-17 05:15:38 -07005365 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);
caryclark55888e42016-07-18 10:01:36 -07005373 redraw();
caryclarkdac1d172014-06-17 05:15:38 -07005374 break;
caryclark624637c2015-05-11 07:21:27 -07005375 case coincidenceKey:
5376 draw_coincidence ^= true;
5377 redraw();
5378 break;
caryclarkdac1d172014-06-17 05:15:38 -07005379 case controlLinesBackKey:
5380 control_lines = (control_lines + 3) % 4;
caryclark55888e42016-07-18 10:01:36 -07005381 redraw();
caryclarkdac1d172014-06-17 05:15:38 -07005382 break;
5383 case controlLinesKey:
5384 control_lines = (control_lines + 1) % 4;
caryclark55888e42016-07-18 10:01:36 -07005385 redraw();
caryclarkdac1d172014-06-17 05:15:38 -07005386 break;
5387 case computedBackKey:
5388 draw_computed = (draw_computed + 5) % 6;
caryclark55888e42016-07-18 10:01:36 -07005389 redraw();
caryclarkdac1d172014-06-17 05:15:38 -07005390 break;
5391 case computedKey:
5392 draw_computed = (draw_computed + 1) % 6;
caryclark55888e42016-07-18 10:01:36 -07005393 redraw();
caryclarkdac1d172014-06-17 05:15:38 -07005394 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 Clarkff114282016-12-14 11:56:16 -05005406 case directionKey:
5407 draw_direction ^= true;
5408 redraw();
5409 break;
caryclarkdac1d172014-06-17 05:15:38 -07005410 case focusKey:
5411 focus_on_selection ^= true;
5412 setScale(xmin, xmax, ymin, ymax);
5413 redraw();
5414 break;
caryclarkdac1d172014-06-17 05:15:38 -07005415 case idKey:
5416 draw_id ^= true;
5417 redraw();
5418 break;
5419 case intersectionBackKey:
5420 draw_intersection = (draw_intersection + 3) % 4;
caryclark55888e42016-07-18 10:01:36 -07005421 redraw();
caryclarkdac1d172014-06-17 05:15:38 -07005422 break;
5423 case intersectionKey:
5424 draw_intersection = (draw_intersection + 1) % 4;
caryclark55888e42016-07-18 10:01:36 -07005425 redraw();
caryclarkdac1d172014-06-17 05:15:38 -07005426 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:
caryclark26ad22a2015-10-16 09:03:38 -07005460 draw_path = (draw_path + 1) % (4 + (hasAlignedPath ? 3 : 0));
caryclark55888e42016-07-18 10:01:36 -07005461 redraw();
caryclarkdac1d172014-06-17 05:15:38 -07005462 break;
5463 case pathBackKey:
caryclark26ad22a2015-10-16 09:03:38 -07005464 draw_path = (draw_path + 3 + (hasAlignedPath ? 3 : 0)) % (4 + (hasAlignedPath ? 3 : 0));
caryclark55888e42016-07-18 10:01:36 -07005465 redraw();
caryclarkdac1d172014-06-17 05:15:38 -07005466 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;
caryclark03b03ca2015-04-23 09:13:37 -07005497 case topKey:
5498 draw_top ^= true;
5499 redraw();
5500 break;
caryclarkdac1d172014-06-17 05:15:38 -07005501 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
5544function 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
caryclark55888e42016-07-18 10:01:36 -07005591 window.onpageshow = window.onpagehide
caryclarkdac1d172014-06-17 05:15:38 -07005592 = window.onfocus = window.onblur = onchange;
5593
5594 function onchange (evt) {
5595 var v = 'visible', h = 'hidden',
caryclark55888e42016-07-18 10:01:36 -07005596 evtMap = {
5597 focus:v, focusin:v, pageshow:v, blur:h, focusout:h, pagehide:h
caryclarkdac1d172014-06-17 05:15:38 -07005598 };
5599
5600 evt = evt || window.event;
5601 if (evt.type in evtMap)
5602 document.body.className = evtMap[evt.type];
caryclark55888e42016-07-18 10:01:36 -07005603 else
caryclarkdac1d172014-06-17 05:15:38 -07005604 document.body.className = this[hidden] ? "hidden" : "visible";
5605 }
5606})();
5607
5608function calcXY() {
5609 var e = window.event;
caryclark55888e42016-07-18 10:01:36 -07005610 var tgt = e.target || e.srcElement;
caryclarkdac1d172014-06-17 05:15:38 -07005611 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
5617function calcLeftTop() {
5618 srcLeft = mouseX - screenWidth / 2 / scale;
5619 srcTop = mouseY - screenHeight / 2 / scale;
5620}
5621
5622var disableClick = false;
5623
5624function 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
5639function 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
5655function 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>