blob: 076f5914eac70d98e969defa7c13ccf12257426f [file] [log] [blame]
caryclarkdac1d172014-06-17 05:15:38 -07001<html>
2<head>
3<div height="0" hidden="true">
caryclarkdac1d172014-06-17 05:15:38 -07004
caryclark2bec26a2016-05-26 09:01:47 -07005Skia UnitTests: --match Simplify$ --resourcePath resources\ SK_DEBUG
caryclarked0935a2015-10-22 07:23:52 -07006
caryclark2bec26a2016-05-26 09:01:47 -07007<div id="fuzz763_4713_b">
8seg=1 {{{41, 33}, {41, 36.3137093f}, {38.6568527f, 38.6568527f}}}
9seg=2 {{{38.6568527f, 38.6568527f}, {36.3137093f, 41}, {33, 41}}}
10seg=3 {{{33, 41}, {29.6862907f, 41}, {27.3431454f, 38.6568527f}}}
11seg=4 {{{27.3431454f, 38.6568527f}, {25, 36.3137093f}, {25, 33}}}
12seg=5 {{{25, 33}, {25, 29.6862907f}, {27.3431454f, 27.3431454f}}}
13seg=6 {{{27.3431454f, 27.3431454f}, {29.6862907f, 25}, {33, 25}}}
14seg=7 {{{33, 25}, {36.3137093f, 25}, {38.6568527f, 27.3431454f}}}
15seg=8 {{{38.6568527f, 27.3431454f}, {41, 29.6862907f}, {41, 33}}}
16seg=9 {{{33.2413864f, 24.6781349f}, {36.5549393f, 24.6459332f}, {38.920742f, 26.966198f}}}
17seg=10 {{{38.920742f, 26.966198f}, {41.2865486f, 29.2864628f}, {41.3187523f, 32.6000175f}}}
18seg=11 {{{41.3187523f, 32.6000175f}, {41.3509521f, 35.9135704f}, {39.0306854f, 38.2793732f}}}
19seg=12 {{{39.0306854f, 38.2793732f}, {38.9995995f, 38.3110695f}, {38.9681816f, 38.3424988f}}}
20seg=13 {{{38.9681816f, 38.3424988f}, {38.9374619f, 38.3742142f}, {38.9064751f, 38.4056053f}}}
21seg=14 {{{38.9064751f, 38.4056053f}, {38.8441086f, 38.4687881f}, {38.7809143f, 38.5304031f}}}
22seg=15 {{{38.7809143f, 38.5304031f}, {38.7196693f, 38.5940361f}, {38.6568527f, 38.6568527f}}}
23seg=16 {{{38.6568527f, 38.6568527f}, {36.3137093f, 41}, {33, 41}}}
24seg=17 {{{33, 41}, {29.6862907f, 41}, {27.3431454f, 38.6568527f}}}
25seg=18 {{{27.3431454f, 38.6568527f}, {25, 36.3137093f}, {25, 33}}}
26seg=19 {{{25, 33}, {25, 29.6862907f}, {27.3431454f, 27.3431454f}}}
27seg=20 {{{27.3431454f, 27.3431454f}, {27.3875446f, 27.2987461f}, {27.4323025f, 27.2551785f}}}
28seg=21 {{{27.4323025f, 27.2551785f}, {27.4755878f, 27.2101307f}, {27.5197105f, 27.165432f}}}
29seg=22 {{{27.5197105f, 27.165432f}, {27.541851f, 27.1430035f}, {27.5638676f, 27.1209965f}}}
30seg=23 {{{27.5638676f, 27.1209965f}, {27.5855064f, 27.0986347f}, {27.6075668f, 27.0761414f}}}
31seg=24 {{{27.6075668f, 27.0761414f}, {29.9278316f, 24.7103367f}, {33.2413864f, 24.6781349f}}}
32debugShowQuadIntersection wtTs[0]=1 {{{33.2413864,24.6781349}, {36.5549393,24.6459332}, {38.920742,26.966198}}} {{38.920742,26.966198}} wnTs[0]=0 {{{38.920742,26.966198}, {41.2865486,29.2864628}, {41.3187523,32.6000175}}}
33debugShowQuadIntersection wtTs[0]=0 {{{33.2413864,24.6781349}, {36.5549393,24.6459332}, {38.920742,26.966198}}} {{33.2413864,24.6781349}} wnTs[0]=1 {{{27.6075668,27.0761414}, {29.9278316,24.7103367}, {33.2413864,24.6781349}}}
34debugShowQuadIntersection wtTs[0]=1 {{{38.920742,26.966198}, {41.2865486,29.2864628}, {41.3187523,32.6000175}}} {{41.3187523,32.6000175}} wnTs[0]=0 {{{41.3187523,32.6000175}, {41.3509521,35.9135704}, {39.0306854,38.2793732}}}
35debugShowQuadIntersection wtTs[0]=1 {{{41.3187523,32.6000175}, {41.3509521,35.9135704}, {39.0306854,38.2793732}}} {{39.0306854,38.2793732}} wnTs[0]=0 {{{39.0306854,38.2793732}, {38.9995995,38.3110695}, {38.9681816,38.3424988}}}
36debugShowQuadIntersection wtTs[0]=1 {{{39.0306854,38.2793732}, {38.9995995,38.3110695}, {38.9681816,38.3424988}}} {{38.9681816,38.3424988}} wnTs[0]=0 {{{38.9681816,38.3424988}, {38.9374619,38.3742142}, {38.9064751,38.4056053}}}
37debugShowQuadIntersection wtTs[0]=1 {{{38.9681816,38.3424988}, {38.9374619,38.3742142}, {38.9064751,38.4056053}}} {{38.9064751,38.4056053}} wnTs[0]=0 {{{38.9064751,38.4056053}, {38.8441086,38.4687881}, {38.7809143,38.5304031}}}
38debugShowQuadIntersection wtTs[0]=1 {{{38.9064751,38.4056053}, {38.8441086,38.4687881}, {38.7809143,38.5304031}}} {{38.7809143,38.5304031}} wnTs[0]=0 {{{38.7809143,38.5304031}, {38.7196693,38.5940361}, {38.6568527,38.6568527}}}
39debugShowQuadIntersection wtTs[0]=1 {{{38.7809143,38.5304031}, {38.7196693,38.5940361}, {38.6568527,38.6568527}}} {{38.6568527,38.6568527}} wnTs[0]=0 {{{38.6568527,38.6568527}, {36.3137093,41}, {33,41}}}
40debugShowQuadIntersection wtTs[0]=1 {{{38.6568527,38.6568527}, {36.3137093,41}, {33,41}}} {{33,41}} wnTs[0]=0 {{{33,41}, {29.6862907,41}, {27.3431454,38.6568527}}}
41debugShowQuadIntersection wtTs[0]=1 {{{33,41}, {29.6862907,41}, {27.3431454,38.6568527}}} {{27.3431454,38.6568527}} wnTs[0]=0 {{{27.3431454,38.6568527}, {25,36.3137093}, {25,33}}}
42debugShowQuadIntersection wtTs[0]=1 {{{27.3431454,38.6568527}, {25,36.3137093}, {25,33}}} {{25,33}} wnTs[0]=0 {{{25,33}, {25,29.6862907}, {27.3431454,27.3431454}}}
43debugShowQuadIntersection wtTs[0]=1 {{{25,33}, {25,29.6862907}, {27.3431454,27.3431454}}} {{27.3431454,27.3431454}} wnTs[0]=0 {{{27.3431454,27.3431454}, {27.3875446,27.2987461}, {27.4323025,27.2551785}}}
44debugShowQuadIntersection wtTs[0]=1 {{{27.3431454,27.3431454}, {27.3875446,27.2987461}, {27.4323025,27.2551785}}} {{27.4323025,27.2551785}} wnTs[0]=0 {{{27.4323025,27.2551785}, {27.4755878,27.2101307}, {27.5197105,27.165432}}}
45debugShowQuadIntersection wtTs[0]=1 {{{27.4323025,27.2551785}, {27.4755878,27.2101307}, {27.5197105,27.165432}}} {{27.5197105,27.165432}} wnTs[0]=0 {{{27.5197105,27.165432}, {27.541851,27.1430035}, {27.5638676,27.1209965}}}
46debugShowQuadIntersection wtTs[0]=1 {{{27.5197105,27.165432}, {27.541851,27.1430035}, {27.5638676,27.1209965}}} {{27.5638676,27.1209965}} wnTs[0]=0 {{{27.5638676,27.1209965}, {27.5855064,27.0986347}, {27.6075668,27.0761414}}}
47debugShowQuadIntersection wtTs[0]=1 {{{27.5638676,27.1209965}, {27.5855064,27.0986347}, {27.6075668,27.0761414}}} {{27.6075668,27.0761414}} wnTs[0]=0 {{{27.6075668,27.0761414}, {29.9278316,24.7103367}, {33.2413864,24.6781349}}}
48id=1 1=(0,0.5) [2] 3=(0.5,1) [2] id=2 2=(0,1) [3,1]
49id=1 1=(0,0.5) [2] 3=(0.5,1) [4] id=2 2=(0,0.5) [1] 4=(0.5,1) [3]
50id=1 3=(0.5,1) [4] id=2 4=(0.5,1) [3]
51id=1 (empty) id=2 (empty)
52debugShowQuadIntersection no intersect {{{33.2413864,24.6781349}, {36.5549393,24.6459332}, {38.920742,26.966198}}} {{{33,25}, {36.3137093,25}, {38.6568527,27.3431454}}}
53id=1 1=(0,1) [4,2] id=2 2=(0,0.5) [1] 4=(0.5,1) [1]
54id=1 (empty) id=2 (empty)
55debugShowQuadIntersection no intersect {{{38.920742,26.966198}, {41.2865486,29.2864628}, {41.3187523,32.6000175}}} {{{38.6568527,27.3431454}, {41,29.6862907}, {41,33}}}
56id=1 1=(0,0.5) [2] 3=(0.5,1) [2] id=2 2=(0,1) [3,1]
57id=1 1=(0,0.5) [2] 3=(0.5,1) [4,2] id=2 2=(0,0.5) [3,1] 4=(0.5,1) [3]
58id=1 3=(0.5,1) [4,2] id=2 2=(0,0.5) [3] 4=(0.5,1) [3]
59id=1 3=(0.5,1) [6,4] id=2 6=(0.25,0.5) [3] 4=(0.5,1) [3]
60id=1 3=(0.5,0.75) [4] 7=(0.75,1) [4] id=2 4=(0.5,1) [7,3]
61id=1 7=(0.75,1) [8,4] id=2 4=(0.5,0.75) [7] 8=(0.75,1) [7]
62id=1 7=(0.75,1) [10,8] id=2 10=(0.625,0.75) [7] 8=(0.75,1) [7]
63id=1 9=(0.875,1) [8] id=2 8=(0.75,1) [9]
64id=1 (empty) id=2 (empty)
65debugShowQuadIntersection no intersect {{{41.3187523,32.6000175}, {41.3509521,35.9135704}, {39.0306854,38.2793732}}} {{{41,33}, {41,36.3137093}, {38.6568527,38.6568527}}}
66debugShowQuadIntersection no intersect {{{41.3187523,32.6000175}, {41.3509521,35.9135704}, {39.0306854,38.2793732}}} {{{38.6568527,27.3431454}, {41,29.6862907}, {41,33}}}
67id=1 1=(0,1) [4] id=2 4=(0.5,1) [1]
68id=1 1=(0,1) [6] id=2 6=(0.75,1) [1]
69id=1 (empty) id=2 (empty)
70debugShowQuadIntersection no intersect {{{39.0306854,38.2793732}, {38.9995995,38.3110695}, {38.9681816,38.3424988}}} {{{41,33}, {41,36.3137093}, {38.6568527,38.6568527}}}
71id=1 1=(0,1) [4] id=2 4=(0.5,1) [1]
72id=1 1=(0,1) [6] id=2 6=(0.75,1) [1]
73id=1 1=(0,1) [8] id=2 8=(0.875,1) [1]
74id=1 (empty) id=2 (empty)
75debugShowQuadIntersection no intersect {{{38.9681816,38.3424988}, {38.9374619,38.3742142}, {38.9064751,38.4056053}}} {{{41,33}, {41,36.3137093}, {38.6568527,38.6568527}}}
76id=1 1=(0,1) [4] id=2 4=(0.5,1) [1]
77id=1 1=(0,1) [6] id=2 6=(0.75,1) [1]
78id=1 1=(0,1) [8] id=2 8=(0.875,1) [1]
79id=1 1=(0,1) [10] id=2 10=(0.9375,1) [1]
80id=1 1=(0,1) [12,10] id=2 10=(0.9375,0.96875) [1] 12=(0.96875,1) [1]
81id=1 1=(0,1) [14,12,10] id=2 10=(0.9375,0.953125) [1] 14=(0.953125,0.96875) [1] 12=(0.96875,1) [1]
82id=1 1=(0,1) [14,12,10] id=2 10=(0.9375,0.953125) [1] 14=(0.953125,0.96875) [1] 12=(0.96875,0.984375) [1]
83id=1 3=(0.5,1) [12] id=2 12=(0.96875,0.984375) [3]
84id=1 3=(0.5,1) [12] id=2 12=(0.96875,0.976563) [3]
85id=1 5=(0.75,1) [12] id=2 12=(0.96875,0.976563) [5]
86id=1 5=(0.75,1) [20,12] id=2 12=(0.96875,0.972656) [5] 20=(0.972656,0.976563) [5]
87id=1 7=(0.875,1) [20] id=2 20=(0.972656,0.976563) [7]
88id=1 7=(0.875,1) [20] id=2 20=(0.972656,0.974609) [7]
89id=1 (empty) id=2 (empty)
90debugShowQuadIntersection no intersect {{{38.9064751,38.4056053}, {38.8441086,38.4687881}, {38.7809143,38.5304031}}} {{{41,33}, {41,36.3137093}, {38.6568527,38.6568527}}}
91id=1 1=(0,1) [4] id=2 4=(0.5,1) [1]
92id=1 1=(0,1) [6] id=2 6=(0.75,1) [1]
93id=1 1=(0,1) [8] id=2 8=(0.875,1) [1]
94id=1 1=(0,1) [10] id=2 10=(0.9375,1) [1]
95id=1 1=(0,1) [12] id=2 12=(0.96875,1) [1]
96id=1 1=(0,1) [14,12] id=2 12=(0.96875,0.984375) [1] 14=(0.984375,1) [1]
97id=1 1=(0,0.5) [14,12] 3=(0.5,1) [14] id=2 12=(0.96875,0.984375) [1] 14=(0.984375,1) [3,1]
98id=1 1=(0,0.5) [16,14,12] 3=(0.5,1) [14] id=2 12=(0.96875,0.976563) [1] 16=(0.976563,0.984375) [1] 14=(0.984375,1) [3,1]
99id=1 1=(0,0.5) [16,14,12] 3=(0.5,1) [18,14] id=2 12=(0.96875,0.976563) [1] 16=(0.976563,0.984375) [1] 14=(0.984375,0.992188) [3,1] 18=(0.992188,1) [3]
100id=1 1=(0,0.25) [16,12] 5=(0.25,0.5) [14,16] 3=(0.5,1) [18,14] id=2 12=(0.96875,0.976563) [1] 16=(0.976563,0.984375) [5,1] 14=(0.984375,0.992188) [5,3] 18=(0.992188,1) [3]
101id=1 1=(0,0.25) [16,12] 5=(0.25,0.5) [14,16] 3=(0.5,0.75) [18,14] 7=(0.75,1) [18] id=2 12=(0.96875,0.976563) [1] 16=(0.976563,0.984375) [5,1] 14=(0.984375,0.992188) [5,3] 18=(0.992188,1) [7,3]
102id=1 1=(0,0.25) [20,16] 5=(0.25,0.5) [14,16] 3=(0.5,0.75) [18,14] 7=(0.75,1) [18] id=2 20=(0.972656,0.976563) [1] 16=(0.976563,0.984375) [5,1] 14=(0.984375,0.992188) [5,3] 18=(0.992188,1) [7,3]
103id=1 1=(0,0.25) [20,16] 5=(0.25,0.5) [22,14,16] 3=(0.5,0.75) [18,14] 7=(0.75,1) [18] id=2 20=(0.972656,0.976563) [1] 16=(0.976563,0.980469) [5,1] 22=(0.980469,0.984375) [5] 14=(0.984375,0.992188) [5,3] 18=(0.992188,1) [7,3]
104id=1 1=(0,0.25) [20,16] 5=(0.25,0.5) [22,14,16] 3=(0.5,0.75) [24,18,14] 7=(0.75,1) [18] id=2 20=(0.972656,0.976563) [1] 16=(0.976563,0.980469) [5,1] 22=(0.980469,0.984375) [5] 14=(0.984375,0.988281) [5,3] 24=(0.988281,0.992188) [3] 18=(0.992188,1) [7,3]
105id=1 1=(0,0.25) [20,16] 5=(0.25,0.5) [22,14,16] 3=(0.5,0.75) [24,18,14] 7=(0.75,1) [26,18] id=2 20=(0.972656,0.976563) [1] 16=(0.976563,0.980469) [5,1] 22=(0.980469,0.984375) [5] 14=(0.984375,0.988281) [5,3] 24=(0.988281,0.992188) [3] 18=(0.992188,0.996094) [7,3] 26=(0.996094,1) [7]
106id=1 1=(0,0.125) [20] 9=(0.125,0.25) [16,20] 5=(0.25,0.5) [22,14,16] 3=(0.5,0.75) [24,18,14] 7=(0.75,1) [26,18] id=2 20=(0.972656,0.976563) [9,1] 16=(0.976563,0.980469) [9,5] 22=(0.980469,0.984375) [5] 14=(0.984375,0.988281) [5,3] 24=(0.988281,0.992188) [3] 18=(0.992188,0.996094) [7,3] 26=(0.996094,1) [7]
107id=1 1=(0,0.125) [20] 9=(0.125,0.25) [16,20] 5=(0.25,0.375) [22,16] 11=(0.375,0.5) [14,22] 3=(0.5,0.75) [24,18,14] 7=(0.75,1) [26,18] id=2 20=(0.972656,0.976563) [9,1] 16=(0.976563,0.980469) [9,5] 22=(0.980469,0.984375) [11,5] 14=(0.984375,0.988281) [11,3] 24=(0.988281,0.992188) [3] 18=(0.992188,0.996094) [7,3] 26=(0.996094,1) [7]
108id=1 1=(0,0.125) [20] 9=(0.125,0.25) [16,20] 5=(0.25,0.375) [22,16] 11=(0.375,0.5) [14,22] 3=(0.5,0.625) [24,14] 13=(0.625,0.75) [18,24] 7=(0.75,1) [26,18] id=2 20=(0.972656,0.976563) [9,1] 16=(0.976563,0.980469) [9,5] 22=(0.980469,0.984375) [11,5] 14=(0.984375,0.988281) [11,3] 24=(0.988281,0.992188) [13,3] 18=(0.992188,0.996094) [13,7] 26=(0.996094,1) [7]
109id=1 1=(0,0.125) [20] 9=(0.125,0.25) [16,20] 5=(0.25,0.375) [22,16] 11=(0.375,0.5) [14,22] 3=(0.5,0.625) [24,14] 13=(0.625,0.75) [18,24] 7=(0.75,0.875) [26,18] 15=(0.875,1) [26] id=2 20=(0.972656,0.976563) [9,1] 16=(0.976563,0.980469) [9,5] 22=(0.980469,0.984375) [11,5] 14=(0.984375,0.988281) [11,3] 24=(0.988281,0.992188) [13,3] 18=(0.992188,0.996094) [13,7] 26=(0.996094,1) [15,7]
110id=1 1=(0,0.125) [28,20] 9=(0.125,0.25) [28,16] 5=(0.25,0.375) [22,16] 11=(0.375,0.5) [14,22] 3=(0.5,0.625) [24,14] 13=(0.625,0.75) [18,24] 7=(0.75,0.875) [26,18] 15=(0.875,1) [26] id=2 20=(0.972656,0.974609) [1] 28=(0.974609,0.976563) [1,9] 16=(0.976563,0.980469) [9,5] 22=(0.980469,0.984375) [11,5] 14=(0.984375,0.988281) [11,3] 24=(0.988281,0.992188) [13,3] 18=(0.992188,0.996094) [13,7] 26=(0.996094,1) [15,7]
111id=1 1=(0,0.125) [28,20] 9=(0.125,0.25) [30,28,16] 5=(0.25,0.375) [30,22] 11=(0.375,0.5) [14,22] 3=(0.5,0.625) [24,14] 13=(0.625,0.75) [18,24] 7=(0.75,0.875) [26,18] 15=(0.875,1) [26] id=2 20=(0.972656,0.974609) [1] 28=(0.974609,0.976563) [1,9] 16=(0.976563,0.978516) [9] 30=(0.978516,0.980469) [5,9] 22=(0.980469,0.984375) [11,5] 14=(0.984375,0.988281) [11,3] 24=(0.988281,0.992188) [13,3] 18=(0.992188,0.996094) [13,7] 26=(0.996094,1) [15,7]
112id=1 1=(0,0.125) [28,20] 9=(0.125,0.25) [30,28,16] 5=(0.25,0.375) [32,30,22] 11=(0.375,0.5) [32,14] 3=(0.5,0.625) [24,14] 13=(0.625,0.75) [18,24] 7=(0.75,0.875) [26,18] 15=(0.875,1) [26] id=2 20=(0.972656,0.974609) [1] 28=(0.974609,0.976563) [1,9] 16=(0.976563,0.978516) [9] 30=(0.978516,0.980469) [5,9] 22=(0.980469,0.982422) [5] 32=(0.982422,0.984375) [5,11] 14=(0.984375,0.988281) [11,3] 24=(0.988281,0.992188) [13,3] 18=(0.992188,0.996094) [13,7] 26=(0.996094,1) [15,7]
113id=1 1=(0,0.125) [28,20] 9=(0.125,0.25) [30,28,16] 5=(0.25,0.375) [32,30,22] 11=(0.375,0.5) [34,32,14] 3=(0.5,0.625) [34,24] 13=(0.625,0.75) [18,24] 7=(0.75,0.875) [26,18] 15=(0.875,1) [26] id=2 20=(0.972656,0.974609) [1] 28=(0.974609,0.976563) [1,9] 16=(0.976563,0.978516) [9] 30=(0.978516,0.980469) [5,9] 22=(0.980469,0.982422) [5] 32=(0.982422,0.984375) [5,11] 14=(0.984375,0.986328) [11] 34=(0.986328,0.988281) [3,11] 24=(0.988281,0.992188) [13,3] 18=(0.992188,0.996094) [13,7] 26=(0.996094,1) [15,7]
114id=1 1=(0,0.125) [28,20] 9=(0.125,0.25) [30,28,16] 5=(0.25,0.375) [32,30,22] 11=(0.375,0.5) [34,32,14] 3=(0.5,0.625) [34,24] 13=(0.625,0.75) [36,18,24] 7=(0.75,0.875) [26,18] 15=(0.875,1) [26] id=2 20=(0.972656,0.974609) [1] 28=(0.974609,0.976563) [1,9] 16=(0.976563,0.978516) [9] 30=(0.978516,0.980469) [5,9] 22=(0.980469,0.982422) [5] 32=(0.982422,0.984375) [5,11] 14=(0.984375,0.986328) [11] 34=(0.986328,0.988281) [3,11] 24=(0.988281,0.990234) [13,3] 36=(0.990234,0.992188) [13] 18=(0.992188,0.996094) [13,7] 26=(0.996094,1) [15,7]
115id=1 1=(0,0.125) [28,20] 9=(0.125,0.25) [30,28,16] 5=(0.25,0.375) [32,30,22] 11=(0.375,0.5) [34,32,14] 3=(0.5,0.625) [34,24] 13=(0.625,0.75) [36,18,24] 7=(0.75,0.875) [38,26,18] 15=(0.875,1) [26] id=2 20=(0.972656,0.974609) [1] 28=(0.974609,0.976563) [1,9] 16=(0.976563,0.978516) [9] 30=(0.978516,0.980469) [5,9] 22=(0.980469,0.982422) [5] 32=(0.982422,0.984375) [5,11] 14=(0.984375,0.986328) [11] 34=(0.986328,0.988281) [3,11] 24=(0.988281,0.990234) [13,3] 36=(0.990234,0.992188) [13] 18=(0.992188,0.994141) [13,7] 38=(0.994141,0.996094) [7] 26=(0.996094,1) [15,7]
116id=1 1=(0,0.125) [28,20] 9=(0.125,0.25) [30,28,16] 5=(0.25,0.375) [32,30,22] 11=(0.375,0.5) [34,32,14] 3=(0.5,0.625) [34,24] 13=(0.625,0.75) [36,18,24] 7=(0.75,0.875) [38,26,18] 15=(0.875,1) [40,26] id=2 20=(0.972656,0.974609) [1] 28=(0.974609,0.976563) [1,9] 16=(0.976563,0.978516) [9] 30=(0.978516,0.980469) [5,9] 22=(0.980469,0.982422) [5] 32=(0.982422,0.984375) [5,11] 14=(0.984375,0.986328) [11] 34=(0.986328,0.988281) [3,11] 24=(0.988281,0.990234) [13,3] 36=(0.990234,0.992188) [13] 18=(0.992188,0.994141) [13,7] 38=(0.994141,0.996094) [7] 26=(0.996094,0.998047) [15,7] 40=(0.998047,1) [15]
117setPerp t=0.974609375 cPt=(38.7743301,38.5372393) == oppT=0.0537252999 fPerpPt=(38.774329,38.5372382)
118setPerp t=0.9765625 cPt=(38.7654006,38.5464847) == oppT=0.126456412 fPerpPt=(38.7653995,38.5464837)
119setPerp t=0.0625 cPt=(38.7732525,38.5383541) == oppT=0.974845025 fPerpPt=(38.7732537,38.5383551)
120setPerp t=0.974609375 cPt=(38.7743301,38.5372393) == oppT=0.0537252999 fPerpPt=(38.774329,38.5372382)
121setPerp t=0 cPt=(38.7809143,38.5304031) == oppT=0.973166462 fPerpPt=(38.7809154,38.5304042)
122setPerp t=0.974609375 cPt=(38.7743301,38.5372393) == oppT=0.0537252999 fPerpPt=(38.774329,38.5372382)
123setPerp t=0.9765625 cPt=(38.7654006,38.5464847) == oppT=0.126456412 fPerpPt=(38.7653995,38.5464837)
124setPerp t=0.0625 cPt=(38.7732525,38.5383541) == oppT=0.974845025 fPerpPt=(38.7732537,38.5383551)
125setPerp t=0.125 cPt=(38.7655785,38.5462986) == oppT=0.976523392 fPerpPt=(38.7655796,38.5462997)
126id=1 9=(0.125,0.25) [30,28,16] 5=(0.25,0.375) [32,30,22] 11=(0.375,0.5) [34,32,14] 3=(0.5,0.625) [34,24] 13=(0.625,0.75) [36,18,24] 7=(0.75,0.875) [38,26,18] 15=(0.875,1) [40,26] id=2 28=(0.974609,0.976563) [9] 16=(0.976563,0.978516) [9] 30=(0.978516,0.980469) [5,9] 22=(0.980469,0.982422) [5] 32=(0.982422,0.984375) [5,11] 14=(0.984375,0.986328) [11] 34=(0.986328,0.988281) [3,11] 24=(0.988281,0.990234) [13,3] 36=(0.990234,0.992188) [13] 18=(0.992188,0.994141) [13,7] 38=(0.994141,0.996094) [7] 26=(0.996094,0.998047) [15,7] 40=(0.998047,1) [15]
127setPerp t=0.974609375 cPt=(38.7743301,38.5372393) == oppT=0.0537252999 fPerpPt=(38.774329,38.5372382)
128setPerp t=0.9765625 cPt=(38.7654006,38.5464847) == oppT=0.126456412 fPerpPt=(38.7653995,38.5464837)
129setPerp t=0.125 cPt=(38.7655785,38.5462986) == oppT=0.976523392 fPerpPt=(38.7655796,38.5462997)
130setPerp t=0.9765625 cPt=(38.7654006,38.5464847) == oppT=0.126456412 fPerpPt=(38.7653995,38.5464837)
131setPerp t=0.978515625 cPt=(38.7564533,38.5557228) == oppT=0.199197443 fPerpPt=(38.7564523,38.5557218)
132setPerp t=0.1875 cPt=(38.7578922,38.5542368) == oppT=0.978201562 fPerpPt=(38.7578932,38.5542378)
133setPerp t=0.9765625 cPt=(38.7654006,38.5464847) == oppT=0.126456412 fPerpPt=(38.7653995,38.5464837)
134setPerp t=0.978515625 cPt=(38.7564533,38.5557228) == oppT=0.199197443 fPerpPt=(38.7564523,38.5557218)
135setPerp t=0.1875 cPt=(38.7578922,38.5542368) == oppT=0.978201562 fPerpPt=(38.7578932,38.5542378)
136setPerp t=0.978515625 cPt=(38.7564533,38.5557228) == oppT=0.199197443 fPerpPt=(38.7564523,38.5557218)
137setPerp t=0.98046875 cPt=(38.7474881,38.5649534) == oppT=0.271948381 fPerpPt=(38.7474871,38.5649525)
138setPerp t=0.25 cPt=(38.7501936,38.5621686) == oppT=0.979879536 fPerpPt=(38.7501946,38.5621695)
139id=1 5=(0.25,0.375) [32,30,22] 11=(0.375,0.5) [34,32,14] 3=(0.5,0.625) [34,24] 13=(0.625,0.75) [36,18,24] 7=(0.75,0.875) [38,26,18] 15=(0.875,1) [40,26] id=2 30=(0.978516,0.980469) [5] 22=(0.980469,0.982422) [5] 32=(0.982422,0.984375) [5,11] 14=(0.984375,0.986328) [11] 34=(0.986328,0.988281) [3,11] 24=(0.988281,0.990234) [13,3] 36=(0.990234,0.992188) [13] 18=(0.992188,0.994141) [13,7] 38=(0.994141,0.996094) [7] 26=(0.996094,0.998047) [15,7] 40=(0.998047,1) [15]
140setPerp t=0.978515625 cPt=(38.7564533,38.5557228) == oppT=0.199197443 fPerpPt=(38.7564523,38.5557218)
141setPerp t=0.98046875 cPt=(38.7474881,38.5649534) == oppT=0.271948381 fPerpPt=(38.7474871,38.5649525)
142setPerp t=0.25 cPt=(38.7501936,38.5621686) == oppT=0.979879536 fPerpPt=(38.7501946,38.5621695)
143setPerp t=0.98046875 cPt=(38.7474881,38.5649534) == oppT=0.271948381 fPerpPt=(38.7474871,38.5649525)
144setPerp t=0.982421875 cPt=(38.738505,38.5741767) == oppT=0.344709216 fPerpPt=(38.7385041,38.5741759)
145setPerp t=0.3125 cPt=(38.7424827,38.570094) == oppT=0.981557313 fPerpPt=(38.7424836,38.5700949)
146setPerp t=0.98046875 cPt=(38.7474881,38.5649534) == oppT=0.271948381 fPerpPt=(38.7474871,38.5649525)
147setPerp t=0.982421875 cPt=(38.738505,38.5741767) == oppT=0.344709216 fPerpPt=(38.7385041,38.5741759)
148setPerp t=0.3125 cPt=(38.7424827,38.570094) == oppT=0.981557313 fPerpPt=(38.7424836,38.5700949)
149setPerp t=0.982421875 cPt=(38.738505,38.5741767) == oppT=0.344709216 fPerpPt=(38.7385041,38.5741759)
150setPerp t=0.984375 cPt=(38.729504,38.5833925) == oppT=0.417479935 fPerpPt=(38.7295033,38.5833918)
151setPerp t=0.375 cPt=(38.7347596,38.5780131) == oppT=0.983234895 fPerpPt=(38.7347604,38.5780138)
152id=1 11=(0.375,0.5) [34,32,14] 3=(0.5,0.625) [34,24] 13=(0.625,0.75) [36,18,24] 7=(0.75,0.875) [38,26,18] 15=(0.875,1) [40,26] id=2 32=(0.982422,0.984375) [11] 14=(0.984375,0.986328) [11] 34=(0.986328,0.988281) [3,11] 24=(0.988281,0.990234) [13,3] 36=(0.990234,0.992188) [13] 18=(0.992188,0.994141) [13,7] 38=(0.994141,0.996094) [7] 26=(0.996094,0.998047) [15,7] 40=(0.998047,1) [15]
153setPerp t=0.982421875 cPt=(38.738505,38.5741767) == oppT=0.344709216 fPerpPt=(38.7385041,38.5741759)
154setPerp t=0.984375 cPt=(38.729504,38.5833925) == oppT=0.417479935 fPerpPt=(38.7295033,38.5833918)
155setPerp t=0.375 cPt=(38.7347596,38.5780131) == oppT=0.983234895 fPerpPt=(38.7347604,38.5780138)
156setPerp t=0.984375 cPt=(38.729504,38.5833925) == oppT=0.417479935 fPerpPt=(38.7295033,38.5833918)
157setPerp t=0.986328125 cPt=(38.7204852,38.592601) == oppT=0.490260525 fPerpPt=(38.7204846,38.5926004)
158setPerp t=0.4375 cPt=(38.7270241,38.5859257) == oppT=0.984912281 fPerpPt=(38.7270248,38.5859264)
159setPerp t=0.984375 cPt=(38.729504,38.5833925) == oppT=0.417479935 fPerpPt=(38.7295033,38.5833918)
160setPerp t=0.986328125 cPt=(38.7204852,38.592601) == oppT=0.490260525 fPerpPt=(38.7204846,38.5926004)
161setPerp t=0.4375 cPt=(38.7270241,38.5859257) == oppT=0.984912281 fPerpPt=(38.7270248,38.5859264)
162setPerp t=0.986328125 cPt=(38.7204852,38.592601) == oppT=0.490260525 fPerpPt=(38.7204846,38.5926004)
163setPerp t=0.98828125 cPt=(38.7114485,38.601802) == oppT=0.563050975 fPerpPt=(38.711448,38.6018015)
164setPerp t=0.5 cPt=(38.7192764,38.593832) == oppT=0.986589471 fPerpPt=(38.719277,38.5938326)
165id=1 3=(0.5,0.625) [34,24] 13=(0.625,0.75) [36,18,24] 7=(0.75,0.875) [38,26,18] 15=(0.875,1) [40,26] id=2 34=(0.986328,0.988281) [3] 24=(0.988281,0.990234) [13,3] 36=(0.990234,0.992188) [13] 18=(0.992188,0.994141) [13,7] 38=(0.994141,0.996094) [7] 26=(0.996094,0.998047) [15,7] 40=(0.998047,1) [15]
166setPerp t=0.986328125 cPt=(38.7204852,38.592601) == oppT=0.490260525 fPerpPt=(38.7204846,38.5926004)
167setPerp t=0.98828125 cPt=(38.7114485,38.601802) == oppT=0.563050975 fPerpPt=(38.711448,38.6018015)
168setPerp t=0.5 cPt=(38.7192764,38.593832) == oppT=0.986589471 fPerpPt=(38.719277,38.5938326)
169setPerp t=0.5625 cPt=(38.7115164,38.6017319) == oppT=0.988266467 fPerpPt=(38.7115169,38.6017324)
170setPerp t=0.98828125 cPt=(38.7114485,38.601802) == oppT=0.563050975 fPerpPt=(38.711448,38.6018015)
171setPerp t=0.990234375 cPt=(38.7023939,38.6109956) == oppT=0.635851272 fPerpPt=(38.7023935,38.6109953)
172setPerp t=0.625 cPt=(38.7037442,38.6096255) == oppT=0.989943268 fPerpPt=(38.7037445,38.6096258)
173setPerp t=0.986328125 cPt=(38.7204852,38.592601) == oppT=0.490260525 fPerpPt=(38.7204846,38.5926004)
174setPerp t=0.98828125 cPt=(38.7114485,38.601802) == oppT=0.563050975 fPerpPt=(38.711448,38.6018015)
175setPerp t=0.5625 cPt=(38.7115164,38.6017319) == oppT=0.988266467 fPerpPt=(38.7115169,38.6017324)
176id=1 13=(0.625,0.75) [36,18,24] 7=(0.75,0.875) [38,26,18] 15=(0.875,1) [40,26] id=2 24=(0.988281,0.990234) [13] 36=(0.990234,0.992188) [13] 18=(0.992188,0.994141) [13,7] 38=(0.994141,0.996094) [7] 26=(0.996094,0.998047) [15,7] 40=(0.998047,1) [15]
177setPerp t=0.990234375 cPt=(38.7023939,38.6109956) == oppT=0.635851272 fPerpPt=(38.7023935,38.6109953)
178setPerp t=0.9921875 cPt=(38.6933214,38.6201819) == oppT=0.708661403 fPerpPt=(38.6933211,38.6201816)
179setPerp t=0.6875 cPt=(38.6959596,38.6175126) == oppT=0.991619875 fPerpPt=(38.6959599,38.6175129)
180setPerp t=0.98828125 cPt=(38.7114485,38.601802) == oppT=0.563050975 fPerpPt=(38.711448,38.6018015)
181setPerp t=0.990234375 cPt=(38.7023939,38.6109956) == oppT=0.635851272 fPerpPt=(38.7023935,38.6109953)
182setPerp t=0.625 cPt=(38.7037442,38.6096255) == oppT=0.989943268 fPerpPt=(38.7037445,38.6096258)
183setPerp t=0.9921875 cPt=(38.6933214,38.6201819) == oppT=0.708661403 fPerpPt=(38.6933211,38.6201816)
184setPerp t=0.994140625 cPt=(38.684231,38.6293607) == oppT=0.781481354 fPerpPt=(38.6842309,38.6293605)
185setPerp t=0.75 cPt=(38.6881628,38.6253934) == oppT=0.993296287 fPerpPt=(38.688163,38.6253936)
186setPerp t=0.990234375 cPt=(38.7023939,38.6109956) == oppT=0.635851272 fPerpPt=(38.7023935,38.6109953)
187setPerp t=0.9921875 cPt=(38.6933214,38.6201819) == oppT=0.708661403 fPerpPt=(38.6933211,38.6201816)
188setPerp t=0.6875 cPt=(38.6959596,38.6175126) == oppT=0.991619875 fPerpPt=(38.6959599,38.6175129)
189id=1 7=(0.75,0.875) [38,26,18] 15=(0.875,1) [40,26] id=2 18=(0.992188,0.994141) [7] 38=(0.994141,0.996094) [7] 26=(0.996094,0.998047) [15,7] 40=(0.998047,1) [15]
190setPerp t=0.994140625 cPt=(38.684231,38.6293607) == oppT=0.781481354 fPerpPt=(38.6842309,38.6293605)
191setPerp t=0.99609375 cPt=(38.6751228,38.6385321) == oppT=0.854311113 fPerpPt=(38.6751227,38.638532)
192setPerp t=0.8125 cPt=(38.6803537,38.6332678) == oppT=0.994972505 fPerpPt=(38.6803538,38.6332679)
193setPerp t=0.9921875 cPt=(38.6933214,38.6201819) == oppT=0.708661403 fPerpPt=(38.6933211,38.6201816)
194setPerp t=0.994140625 cPt=(38.684231,38.6293607) == oppT=0.781481354 fPerpPt=(38.6842309,38.6293605)
195setPerp t=0.75 cPt=(38.6881628,38.6253934) == oppT=0.993296287 fPerpPt=(38.688163,38.6253936)
196setPerp t=0.99609375 cPt=(38.6751228,38.6385321) == oppT=0.854311113 fPerpPt=(38.6751227,38.638532)
197setPerp t=0.998046875 cPt=(38.6659967,38.6476961) == oppT=0.927150666 fPerpPt=(38.6659967,38.6476961)
198setPerp t=0.875 cPt=(38.6725323,38.6411358) == oppT=0.99664853 fPerpPt=(38.6725324,38.6411359)
199setPerp t=0.994140625 cPt=(38.684231,38.6293607) == oppT=0.781481354 fPerpPt=(38.6842309,38.6293605)
200setPerp t=0.99609375 cPt=(38.6751228,38.6385321) == oppT=0.854311113 fPerpPt=(38.6751227,38.638532)
201setPerp t=0.8125 cPt=(38.6803537,38.6332678) == oppT=0.994972505 fPerpPt=(38.6803538,38.6332679)
202id=1 15=(0.875,1) [40,26] id=2 26=(0.996094,0.998047) [15] 40=(0.998047,1) [15]
203setPerp t=0.998046875 cPt=(38.6659967,38.6476961) == oppT=0.927150666 fPerpPt=(38.6659967,38.6476961)
204setPerp t=1 cPt=(38.6568527,38.6568527) == oppT=1 fPerpPt=(38.6568527,38.6568527)
205setPerp t=0.9375 cPt=(38.6646987,38.6489975) == oppT=0.998324361 fPerpPt=(38.6646987,38.6489975)
206setPerp t=0.99609375 cPt=(38.6751228,38.6385321) == oppT=0.854311113 fPerpPt=(38.6751227,38.638532)
207setPerp t=0.998046875 cPt=(38.6659967,38.6476961) == oppT=0.927150666 fPerpPt=(38.6659967,38.6476961)
208setPerp t=0.875 cPt=(38.6725323,38.6411358) == oppT=0.99664853 fPerpPt=(38.6725324,38.6411359)
209id=1 31=(0.9375,1) [40] id=2 40=(0.998047,1) [31]
210setPerp t=0.9375 cPt=(38.6646987,38.6489975) == oppT=0.998324361 fPerpPt=(38.6646987,38.6489975)
211setPerp t=1 cPt=(38.6568527,38.6568527) == oppT=1 fPerpPt=(38.6568527,38.6568527)
212setPerp t=0.999023438 cPt=(38.6614269,38.6522753) == oppT=0.963574111 fPerpPt=(38.6614269,38.6522753)
213id=1 31=(1,1) [42] id=2 42=(1,1) [31]
214debugShowQuadIntersection wtTs[0]=1 {{{38.7809143,38.5304031}, {38.7196693,38.5940361}, {38.6568527,38.6568527}}} {{38.6568527,38.6568527}} wnTs[0]=1 {{{41,33}, {41,36.3137093}, {38.6568527,38.6568527}}}
215debugShowQuadIntersection wtTs[0]=1 {{{38.7809143,38.5304031}, {38.7196693,38.5940361}, {38.6568527,38.6568527}}} {{38.6568527,38.6568527}} wnTs[0]=0 {{{38.6568527,38.6568527}, {36.3137093,41}, {33,41}}}
216debugShowQuadIntersection wtTs[0]=0 {{{38.6568527,38.6568527}, {36.3137093,41}, {33,41}}} {{38.6568527,38.6568527}} wnTs[0]=1 {{{41,33}, {41,36.3137093}, {38.6568527,38.6568527}}}
217id=1 1=(0,1) [4,2] id=2 2=(0,0.5) [1] 4=(0.5,1) [1]
218id=1 1=(0,0.5) [4,2] 3=(0.5,1) [2,4] id=2 2=(0,0.5) [3,1] 4=(0.5,1) [3,1]
219id=1 1=(0,0.5) [4,2] 3=(0.5,1) [6,2,4] id=2 2=(0,0.5) [3,1] 4=(0.5,0.75) [3,1] 6=(0.75,1) [3]
220id=1 1=(0,0.5) [4,2] 3=(0.5,0.75) [6,2,4] 5=(0.75,1) [4,6] id=2 2=(0,0.5) [3,1] 4=(0.5,0.75) [5,3,1] 6=(0.75,1) [5,3]
221id=1 1=(0,0.5) [8,4,2] 3=(0.5,0.75) [8,6,4] 5=(0.75,1) [4,6] id=2 2=(0,0.25) [1] 8=(0.25,0.5) [1,3] 4=(0.5,0.75) [5,3,1] 6=(0.75,1) [5,3]
222id=1 1=(0,0.25) [8,2] 7=(0.25,0.5) [2,4,8] 3=(0.5,0.75) [8,6,4] 5=(0.75,1) [4,6] id=2 2=(0,0.25) [7,1] 8=(0.25,0.5) [7,1,3] 4=(0.5,0.75) [7,5,3] 6=(0.75,1) [5,3]
223id=1 1=(0,0.25) [8,2] 7=(0.25,0.5) [2,4,8] 3=(0.5,0.75) [8,6,4] 5=(0.75,1) [10,4,6] id=2 2=(0,0.25) [7,1] 8=(0.25,0.5) [7,1,3] 4=(0.5,0.75) [7,5,3] 6=(0.75,0.875) [5,3] 10=(0.875,1) [5]
224id=1 1=(0,0.25) [8,2] 7=(0.25,0.5) [2,4,8] 3=(0.5,0.75) [8,6,4] 5=(0.75,0.875) [10,4,6] 9=(0.875,1) [6,10] id=2 2=(0,0.25) [7,1] 8=(0.25,0.5) [7,1,3] 4=(0.5,0.75) [7,5,3] 6=(0.75,0.875) [9,5,3] 10=(0.875,1) [9,5]
225id=1 1=(0,0.25) [8,2] 7=(0.25,0.5) [2,4,8] 3=(0.5,0.75) [12,8,6,4] 5=(0.75,0.875) [12,10,6] 9=(0.875,1) [6,10] id=2 2=(0,0.25) [7,1] 8=(0.25,0.5) [7,1,3] 4=(0.5,0.625) [7,3] 12=(0.625,0.75) [3,5] 6=(0.75,0.875) [9,5,3] 10=(0.875,1) [9,5]
226id=1 1=(0,0.25) [8,2] 7=(0.25,0.5) [2,4,8] 3=(0.5,0.625) [12,8,4] 11=(0.625,0.75) [4,6,12] 5=(0.75,0.875) [12,10,6] 9=(0.875,1) [6,10] id=2 2=(0,0.25) [7,1] 8=(0.25,0.5) [7,1,3] 4=(0.5,0.625) [11,7,3] 12=(0.625,0.75) [11,3,5] 6=(0.75,0.875) [11,9,5] 10=(0.875,1) [9,5]
227id=1 1=(0,0.25) [8,2] 7=(0.25,0.5) [14,2,4,8] 3=(0.5,0.625) [14,12,4] 11=(0.625,0.75) [4,6,12] 5=(0.75,0.875) [12,10,6] 9=(0.875,1) [6,10] id=2 2=(0,0.25) [7,1] 8=(0.25,0.375) [7,1] 14=(0.375,0.5) [3,7] 4=(0.5,0.625) [11,7,3] 12=(0.625,0.75) [11,3,5] 6=(0.75,0.875) [11,9,5] 10=(0.875,1) [9,5]
228id=1 1=(0,0.25) [8,2] 7=(0.25,0.375) [14,2,8] 13=(0.375,0.5) [8,4,14] 3=(0.5,0.625) [14,12,4] 11=(0.625,0.75) [4,6,12] 5=(0.75,0.875) [12,10,6] 9=(0.875,1) [6,10] id=2 2=(0,0.25) [7,1] 8=(0.25,0.375) [13,7,1] 14=(0.375,0.5) [13,3,7] 4=(0.5,0.625) [13,11,3] 12=(0.625,0.75) [11,3,5] 6=(0.75,0.875) [11,9,5] 10=(0.875,1) [9,5]
229id=1 1=(0,0.25) [16,8,2] 7=(0.25,0.375) [16,14,8] 13=(0.375,0.5) [8,4,14] 3=(0.5,0.625) [14,12,4] 11=(0.625,0.75) [4,6,12] 5=(0.75,0.875) [12,10,6] 9=(0.875,1) [6,10] id=2 2=(0,0.125) [1] 16=(0.125,0.25) [1,7] 8=(0.25,0.375) [13,7,1] 14=(0.375,0.5) [13,3,7] 4=(0.5,0.625) [13,11,3] 12=(0.625,0.75) [11,3,5] 6=(0.75,0.875) [11,9,5] 10=(0.875,1) [9,5]
230id=1 1=(0,0.125) [16,2] 15=(0.125,0.25) [2,8,16] 7=(0.25,0.375) [16,14,8] 13=(0.375,0.5) [8,4,14] 3=(0.5,0.625) [14,12,4] 11=(0.625,0.75) [4,6,12] 5=(0.75,0.875) [12,10,6] 9=(0.875,1) [6,10] id=2 2=(0,0.125) [15,1] 16=(0.125,0.25) [15,1,7] 8=(0.25,0.375) [15,13,7] 14=(0.375,0.5) [13,3,7] 4=(0.5,0.625) [13,11,3] 12=(0.625,0.75) [11,3,5] 6=(0.75,0.875) [11,9,5] 10=(0.875,1) [9,5]
231id=1 1=(0,0.125) [16,2] 15=(0.125,0.25) [2,8,16] 7=(0.25,0.375) [16,14,8] 13=(0.375,0.5) [8,4,14] 3=(0.5,0.625) [14,12,4] 11=(0.625,0.75) [4,6,12] 5=(0.75,0.875) [12,10,6] 9=(0.875,1) [18,6,10] id=2 2=(0,0.125) [15,1] 16=(0.125,0.25) [15,1,7] 8=(0.25,0.375) [15,13,7] 14=(0.375,0.5) [13,3,7] 4=(0.5,0.625) [13,11,3] 12=(0.625,0.75) [11,3,5] 6=(0.75,0.875) [11,9,5] 10=(0.875,0.9375) [9,5] 18=(0.9375,1) [9]
232setPerp t=0 cPt=(38.6568527,38.6568527) == oppT=0 fPerpPt=(38.6568527,38.6568527)
233setPerp t=0.125 cPt=(38.0559018,39.2060279) == oppT=0.125 fPerpPt=(38.0559018,39.2060279)
234setPerp t=0.25 cPt=(37.4246206,39.6819797) == oppT=0.25 fPerpPt=(37.4246206,39.6819797)
235setPerp t=0.375 cPt=(36.7630093,40.0847081) == oppT=0.375 fPerpPt=(36.7630093,40.0847081)
236setPerp t=0.5 cPt=(36.0710678,40.4142132) == oppT=0.5 fPerpPt=(36.0710678,40.4142132)
237setPerp t=0.625 cPt=(35.3487961,40.6704949) == oppT=0.625 fPerpPt=(35.3487961,40.6704949)
238setPerp t=0.75 cPt=(34.5961943,40.8535533) == oppT=0.75 fPerpPt=(34.5961943,40.8535533)
239setPerp t=0.875 cPt=(33.8132622,40.9633883) == oppT=0.875 fPerpPt=(33.8132622,40.9633883)
240setPerp t=0.9375 cPt=(33.4104224,40.9908471) == oppT=0.9375 fPerpPt=(33.4104224,40.9908471)
241setPerp t=1 cPt=(33,41) == oppT=1 fPerpPt=(33,41)
242setPerp t=0 cPt=(38.6568527,38.6568527) == oppT=0 fPerpPt=(38.6568527,38.6568527)
243setPerp t=1 cPt=(33,41) == oppT=1 fPerpPt=(33,41)
244id=1 (empty) id=2 (empty)
245debugShowQuadIntersection wtTs[0]=0 {{{38.6568527,38.6568527}, {36.3137093,41}, {33,41}}} {{38.6568527,38.6568527}} wtTs[1]=1 {{33,41}} wnTs[0]=0 {{{38.6568527,38.6568527}, {36.3137093,41}, {33,41}}} wnTs[1]=1
246debugShowQuadIntersection wtTs[0]=1 {{{38.6568527,38.6568527}, {36.3137093,41}, {33,41}}} {{33,41}} wnTs[0]=0 {{{33,41}, {29.6862907,41}, {27.3431454,38.6568527}}}
247debugShowQuadIntersection wtTs[0]=0 {{{33,41}, {29.6862907,41}, {27.3431454,38.6568527}}} {{33,41}} wnTs[0]=1 {{{38.6568527,38.6568527}, {36.3137093,41}, {33,41}}}
248id=1 1=(0,1) [4,2] id=2 2=(0,0.5) [1] 4=(0.5,1) [1]
249id=1 1=(0,0.5) [4,2] 3=(0.5,1) [2,4] id=2 2=(0,0.5) [3,1] 4=(0.5,1) [3,1]
250id=1 1=(0,0.5) [6,4,2] 3=(0.5,1) [6,4] id=2 2=(0,0.25) [1] 6=(0.25,0.5) [1,3] 4=(0.5,1) [3,1]
251id=1 1=(0,0.25) [6,2] 5=(0.25,0.5) [2,4,6] 3=(0.5,1) [6,4] id=2 2=(0,0.25) [5,1] 6=(0.25,0.5) [5,1,3] 4=(0.5,1) [5,3]
252id=1 1=(0,0.25) [6,2] 5=(0.25,0.5) [2,4,6] 3=(0.5,1) [8,6,4] id=2 2=(0,0.25) [5,1] 6=(0.25,0.5) [5,1,3] 4=(0.5,0.75) [5,3] 8=(0.75,1) [3]
253id=1 1=(0,0.25) [6,2] 5=(0.25,0.5) [2,4,6] 3=(0.5,0.75) [8,6,4] 7=(0.75,1) [4,8] id=2 2=(0,0.25) [5,1] 6=(0.25,0.5) [5,1,3] 4=(0.5,0.75) [7,5,3] 8=(0.75,1) [7,3]
254id=1 1=(0,0.25) [10,6,2] 5=(0.25,0.5) [10,4,6] 3=(0.5,0.75) [8,6,4] 7=(0.75,1) [4,8] id=2 2=(0,0.125) [1] 10=(0.125,0.25) [1,5] 6=(0.25,0.5) [5,1,3] 4=(0.5,0.75) [7,5,3] 8=(0.75,1) [7,3]
255id=1 1=(0,0.125) [10,2] 9=(0.125,0.25) [2,6,10] 5=(0.25,0.5) [10,4,6] 3=(0.5,0.75) [8,6,4] 7=(0.75,1) [4,8] id=2 2=(0,0.125) [9,1] 10=(0.125,0.25) [9,1,5] 6=(0.25,0.5) [9,5,3] 4=(0.5,0.75) [7,5,3] 8=(0.75,1) [7,3]
256id=1 1=(0,0.125) [10,2] 9=(0.125,0.25) [2,6,10] 5=(0.25,0.5) [12,10,4,6] 3=(0.5,0.75) [12,8,4] 7=(0.75,1) [4,8] id=2 2=(0,0.125) [9,1] 10=(0.125,0.25) [9,1,5] 6=(0.25,0.375) [9,5] 12=(0.375,0.5) [3,5] 4=(0.5,0.75) [7,5,3] 8=(0.75,1) [7,3]
257id=1 1=(0,0.125) [10,2] 9=(0.125,0.25) [2,6,10] 5=(0.25,0.375) [12,10,6] 11=(0.375,0.5) [6,4,12] 3=(0.5,0.75) [12,8,4] 7=(0.75,1) [4,8] id=2 2=(0,0.125) [9,1] 10=(0.125,0.25) [9,1,5] 6=(0.25,0.375) [11,9,5] 12=(0.375,0.5) [11,3,5] 4=(0.5,0.75) [11,7,3] 8=(0.75,1) [7,3]
258id=1 1=(0,0.125) [10,2] 9=(0.125,0.25) [2,6,10] 5=(0.25,0.375) [12,10,6] 11=(0.375,0.5) [6,4,12] 3=(0.5,0.75) [14,12,8,4] 7=(0.75,1) [14,8] id=2 2=(0,0.125) [9,1] 10=(0.125,0.25) [9,1,5] 6=(0.25,0.375) [11,9,5] 12=(0.375,0.5) [11,3,5] 4=(0.5,0.625) [11,3] 14=(0.625,0.75) [3,7] 8=(0.75,1) [7,3]
259id=1 1=(0,0.125) [10,2] 9=(0.125,0.25) [2,6,10] 5=(0.25,0.375) [12,10,6] 11=(0.375,0.5) [6,4,12] 3=(0.5,0.625) [14,12,4] 13=(0.625,0.75) [4,8,14] 7=(0.75,1) [14,8] id=2 2=(0,0.125) [9,1] 10=(0.125,0.25) [9,1,5] 6=(0.25,0.375) [11,9,5] 12=(0.375,0.5) [11,3,5] 4=(0.5,0.625) [13,11,3] 14=(0.625,0.75) [13,3,7] 8=(0.75,1) [13,7]
260id=1 1=(0,0.125) [10,2] 9=(0.125,0.25) [2,6,10] 5=(0.25,0.375) [12,10,6] 11=(0.375,0.5) [6,4,12] 3=(0.5,0.625) [14,12,4] 13=(0.625,0.75) [4,8,14] 7=(0.75,1) [16,14,8] id=2 2=(0,0.125) [9,1] 10=(0.125,0.25) [9,1,5] 6=(0.25,0.375) [11,9,5] 12=(0.375,0.5) [11,3,5] 4=(0.5,0.625) [13,11,3] 14=(0.625,0.75) [13,3,7] 8=(0.75,0.875) [13,7] 16=(0.875,1) [7]
261id=1 1=(0,0.125) [10,2] 9=(0.125,0.25) [2,6,10] 5=(0.25,0.375) [12,10,6] 11=(0.375,0.5) [6,4,12] 3=(0.5,0.625) [14,12,4] 13=(0.625,0.75) [4,8,14] 7=(0.75,0.875) [16,14,8] 15=(0.875,1) [8,16] id=2 2=(0,0.125) [9,1] 10=(0.125,0.25) [9,1,5] 6=(0.25,0.375) [11,9,5] 12=(0.375,0.5) [11,3,5] 4=(0.5,0.625) [13,11,3] 14=(0.625,0.75) [13,3,7] 8=(0.75,0.875) [15,13,7] 16=(0.875,1) [15,7]
262id=1 1=(0,0.125) [18,10,2] 9=(0.125,0.25) [18,6,10] 5=(0.25,0.375) [12,10,6] 11=(0.375,0.5) [6,4,12] 3=(0.5,0.625) [14,12,4] 13=(0.625,0.75) [4,8,14] 7=(0.75,0.875) [16,14,8] 15=(0.875,1) [8,16] id=2 2=(0,0.0625) [1] 18=(0.0625,0.125) [1,9] 10=(0.125,0.25) [9,1,5] 6=(0.25,0.375) [11,9,5] 12=(0.375,0.5) [11,3,5] 4=(0.5,0.625) [13,11,3] 14=(0.625,0.75) [13,3,7] 8=(0.75,0.875) [15,13,7] 16=(0.875,1) [15,7]
263setPerp t=0 cPt=(33,41) == oppT=0 fPerpPt=(33,41)
264setPerp t=0.0625 cPt=(32.5895776,40.9908471) == oppT=0.0625 fPerpPt=(32.5895776,40.9908471)
265setPerp t=0.125 cPt=(32.1867377,40.9633883) == oppT=0.125 fPerpPt=(32.1867377,40.9633883)
266setPerp t=0.25 cPt=(31.4038056,40.8535533) == oppT=0.25 fPerpPt=(31.4038056,40.8535533)
267setPerp t=0.375 cPt=(30.6512036,40.6704949) == oppT=0.375 fPerpPt=(30.6512036,40.6704949)
268setPerp t=0.5 cPt=(29.9289317,40.4142132) == oppT=0.5 fPerpPt=(29.9289317,40.4142132)
269setPerp t=0.625 cPt=(29.2369899,40.0847081) == oppT=0.625 fPerpPt=(29.2369899,40.0847081)
270setPerp t=0.75 cPt=(28.5753783,39.6819797) == oppT=0.75 fPerpPt=(28.5753783,39.6819797)
271setPerp t=0.875 cPt=(27.9440968,39.2060279) == oppT=0.875 fPerpPt=(27.9440968,39.2060279)
272setPerp t=1 cPt=(27.3431454,38.6568527) == oppT=1 fPerpPt=(27.3431454,38.6568527)
273setPerp t=0 cPt=(33,41) == oppT=0 fPerpPt=(33,41)
274setPerp t=1 cPt=(27.3431454,38.6568527) == oppT=1 fPerpPt=(27.3431454,38.6568527)
275id=1 (empty) id=2 (empty)
276debugShowQuadIntersection wtTs[0]=0 {{{33,41}, {29.6862907,41}, {27.3431454,38.6568527}}} {{33,41}} wtTs[1]=1 {{27.3431454,38.6568527}} wnTs[0]=0 {{{33,41}, {29.6862907,41}, {27.3431454,38.6568527}}} wnTs[1]=1
277debugShowQuadIntersection wtTs[0]=1 {{{33,41}, {29.6862907,41}, {27.3431454,38.6568527}}} {{27.3431454,38.6568527}} wnTs[0]=0 {{{27.3431454,38.6568527}, {25,36.3137093}, {25,33}}}
278debugShowQuadIntersection wtTs[0]=0 {{{27.3431454,38.6568527}, {25,36.3137093}, {25,33}}} {{27.3431454,38.6568527}} wnTs[0]=1 {{{33,41}, {29.6862907,41}, {27.3431454,38.6568527}}}
279id=1 1=(0,1) [4,2] id=2 2=(0,0.5) [1] 4=(0.5,1) [1]
280id=1 1=(0,0.5) [4,2] 3=(0.5,1) [2,4] id=2 2=(0,0.5) [3,1] 4=(0.5,1) [3,1]
281id=1 1=(0,0.5) [4,2] 3=(0.5,1) [6,2,4] id=2 2=(0,0.5) [3,1] 4=(0.5,0.75) [3,1] 6=(0.75,1) [3]
282id=1 1=(0,0.5) [4,2] 3=(0.5,0.75) [6,2,4] 5=(0.75,1) [4,6] id=2 2=(0,0.5) [3,1] 4=(0.5,0.75) [5,3,1] 6=(0.75,1) [5,3]
283id=1 1=(0,0.5) [8,4,2] 3=(0.5,0.75) [8,6,4] 5=(0.75,1) [4,6] id=2 2=(0,0.25) [1] 8=(0.25,0.5) [1,3] 4=(0.5,0.75) [5,3,1] 6=(0.75,1) [5,3]
284id=1 1=(0,0.25) [8,2] 7=(0.25,0.5) [2,4,8] 3=(0.5,0.75) [8,6,4] 5=(0.75,1) [4,6] id=2 2=(0,0.25) [7,1] 8=(0.25,0.5) [7,1,3] 4=(0.5,0.75) [7,5,3] 6=(0.75,1) [5,3]
285id=1 1=(0,0.25) [8,2] 7=(0.25,0.5) [2,4,8] 3=(0.5,0.75) [8,6,4] 5=(0.75,1) [10,4,6] id=2 2=(0,0.25) [7,1] 8=(0.25,0.5) [7,1,3] 4=(0.5,0.75) [7,5,3] 6=(0.75,0.875) [5,3] 10=(0.875,1) [5]
286id=1 1=(0,0.25) [8,2] 7=(0.25,0.5) [2,4,8] 3=(0.5,0.75) [8,6,4] 5=(0.75,0.875) [10,4,6] 9=(0.875,1) [6,10] id=2 2=(0,0.25) [7,1] 8=(0.25,0.5) [7,1,3] 4=(0.5,0.75) [7,5,3] 6=(0.75,0.875) [9,5,3] 10=(0.875,1) [9,5]
287id=1 1=(0,0.25) [8,2] 7=(0.25,0.5) [2,4,8] 3=(0.5,0.75) [12,8,6,4] 5=(0.75,0.875) [12,10,6] 9=(0.875,1) [6,10] id=2 2=(0,0.25) [7,1] 8=(0.25,0.5) [7,1,3] 4=(0.5,0.625) [7,3] 12=(0.625,0.75) [3,5] 6=(0.75,0.875) [9,5,3] 10=(0.875,1) [9,5]
288id=1 1=(0,0.25) [8,2] 7=(0.25,0.5) [2,4,8] 3=(0.5,0.625) [12,8,4] 11=(0.625,0.75) [4,6,12] 5=(0.75,0.875) [12,10,6] 9=(0.875,1) [6,10] id=2 2=(0,0.25) [7,1] 8=(0.25,0.5) [7,1,3] 4=(0.5,0.625) [11,7,3] 12=(0.625,0.75) [11,3,5] 6=(0.75,0.875) [11,9,5] 10=(0.875,1) [9,5]
289id=1 1=(0,0.25) [8,2] 7=(0.25,0.5) [14,2,4,8] 3=(0.5,0.625) [14,12,4] 11=(0.625,0.75) [4,6,12] 5=(0.75,0.875) [12,10,6] 9=(0.875,1) [6,10] id=2 2=(0,0.25) [7,1] 8=(0.25,0.375) [7,1] 14=(0.375,0.5) [3,7] 4=(0.5,0.625) [11,7,3] 12=(0.625,0.75) [11,3,5] 6=(0.75,0.875) [11,9,5] 10=(0.875,1) [9,5]
290id=1 1=(0,0.25) [8,2] 7=(0.25,0.375) [14,2,8] 13=(0.375,0.5) [8,4,14] 3=(0.5,0.625) [14,12,4] 11=(0.625,0.75) [4,6,12] 5=(0.75,0.875) [12,10,6] 9=(0.875,1) [6,10] id=2 2=(0,0.25) [7,1] 8=(0.25,0.375) [13,7,1] 14=(0.375,0.5) [13,3,7] 4=(0.5,0.625) [13,11,3] 12=(0.625,0.75) [11,3,5] 6=(0.75,0.875) [11,9,5] 10=(0.875,1) [9,5]
291id=1 1=(0,0.25) [16,8,2] 7=(0.25,0.375) [16,14,8] 13=(0.375,0.5) [8,4,14] 3=(0.5,0.625) [14,12,4] 11=(0.625,0.75) [4,6,12] 5=(0.75,0.875) [12,10,6] 9=(0.875,1) [6,10] id=2 2=(0,0.125) [1] 16=(0.125,0.25) [1,7] 8=(0.25,0.375) [13,7,1] 14=(0.375,0.5) [13,3,7] 4=(0.5,0.625) [13,11,3] 12=(0.625,0.75) [11,3,5] 6=(0.75,0.875) [11,9,5] 10=(0.875,1) [9,5]
292id=1 1=(0,0.125) [16,2] 15=(0.125,0.25) [2,8,16] 7=(0.25,0.375) [16,14,8] 13=(0.375,0.5) [8,4,14] 3=(0.5,0.625) [14,12,4] 11=(0.625,0.75) [4,6,12] 5=(0.75,0.875) [12,10,6] 9=(0.875,1) [6,10] id=2 2=(0,0.125) [15,1] 16=(0.125,0.25) [15,1,7] 8=(0.25,0.375) [15,13,7] 14=(0.375,0.5) [13,3,7] 4=(0.5,0.625) [13,11,3] 12=(0.625,0.75) [11,3,5] 6=(0.75,0.875) [11,9,5] 10=(0.875,1) [9,5]
293id=1 1=(0,0.125) [16,2] 15=(0.125,0.25) [2,8,16] 7=(0.25,0.375) [16,14,8] 13=(0.375,0.5) [8,4,14] 3=(0.5,0.625) [14,12,4] 11=(0.625,0.75) [4,6,12] 5=(0.75,0.875) [12,10,6] 9=(0.875,1) [18,6,10] id=2 2=(0,0.125) [15,1] 16=(0.125,0.25) [15,1,7] 8=(0.25,0.375) [15,13,7] 14=(0.375,0.5) [13,3,7] 4=(0.5,0.625) [13,11,3] 12=(0.625,0.75) [11,3,5] 6=(0.75,0.875) [11,9,5] 10=(0.875,0.9375) [9,5] 18=(0.9375,1) [9]
294setPerp t=0 cPt=(27.3431454,38.6568527) == oppT=0 fPerpPt=(27.3431454,38.6568527)
295setPerp t=0.125 cPt=(26.7939707,38.0559018) == oppT=0.125 fPerpPt=(26.7939707,38.0559018)
296setPerp t=0.25 cPt=(26.3180193,37.4246206) == oppT=0.25 fPerpPt=(26.3180193,37.4246206)
297setPerp t=0.375 cPt=(25.9152912,36.7630093) == oppT=0.375 fPerpPt=(25.9152912,36.7630093)
298setPerp t=0.5 cPt=(25.5857863,36.0710678) == oppT=0.5 fPerpPt=(25.5857863,36.0710678)
299setPerp t=0.625 cPt=(25.3295048,35.3487961) == oppT=0.625 fPerpPt=(25.3295048,35.3487961)
300setPerp t=0.75 cPt=(25.1464466,34.5961943) == oppT=0.75 fPerpPt=(25.1464466,34.5961943)
301setPerp t=0.875 cPt=(25.0366116,33.8132622) == oppT=0.875 fPerpPt=(25.0366116,33.8132622)
302setPerp t=0.9375 cPt=(25.0091529,33.4104224) == oppT=0.9375 fPerpPt=(25.0091529,33.4104224)
303setPerp t=1 cPt=(25,33) == oppT=1 fPerpPt=(25,33)
304setPerp t=0 cPt=(27.3431454,38.6568527) == oppT=0 fPerpPt=(27.3431454,38.6568527)
305setPerp t=1 cPt=(25,33) == oppT=1 fPerpPt=(25,33)
306id=1 (empty) id=2 (empty)
307debugShowQuadIntersection wtTs[0]=0 {{{27.3431454,38.6568527}, {25,36.3137093}, {25,33}}} {{27.3431454,38.6568527}} wtTs[1]=1 {{25,33}} wnTs[0]=0 {{{27.3431454,38.6568527}, {25,36.3137093}, {25,33}}} wnTs[1]=1
308debugShowQuadIntersection wtTs[0]=1 {{{27.3431454,38.6568527}, {25,36.3137093}, {25,33}}} {{25,33}} wnTs[0]=0 {{{25,33}, {25,29.6862907}, {27.3431454,27.3431454}}}
309debugShowQuadIntersection wtTs[0]=0 {{{25,33}, {25,29.6862907}, {27.3431454,27.3431454}}} {{25,33}} wnTs[0]=1 {{{27.3431454,38.6568527}, {25,36.3137093}, {25,33}}}
310id=1 1=(0,1) [4,2] id=2 2=(0,0.5) [1] 4=(0.5,1) [1]
311id=1 1=(0,0.5) [4,2] 3=(0.5,1) [2,4] id=2 2=(0,0.5) [3,1] 4=(0.5,1) [3,1]
312id=1 1=(0,0.5) [6,4,2] 3=(0.5,1) [6,4] id=2 2=(0,0.25) [1] 6=(0.25,0.5) [1,3] 4=(0.5,1) [3,1]
313id=1 1=(0,0.25) [6,2] 5=(0.25,0.5) [2,4,6] 3=(0.5,1) [6,4] id=2 2=(0,0.25) [5,1] 6=(0.25,0.5) [5,1,3] 4=(0.5,1) [5,3]
314id=1 1=(0,0.25) [6,2] 5=(0.25,0.5) [2,4,6] 3=(0.5,1) [8,6,4] id=2 2=(0,0.25) [5,1] 6=(0.25,0.5) [5,1,3] 4=(0.5,0.75) [5,3] 8=(0.75,1) [3]
315id=1 1=(0,0.25) [6,2] 5=(0.25,0.5) [2,4,6] 3=(0.5,0.75) [8,6,4] 7=(0.75,1) [4,8] id=2 2=(0,0.25) [5,1] 6=(0.25,0.5) [5,1,3] 4=(0.5,0.75) [7,5,3] 8=(0.75,1) [7,3]
316id=1 1=(0,0.25) [10,6,2] 5=(0.25,0.5) [10,4,6] 3=(0.5,0.75) [8,6,4] 7=(0.75,1) [4,8] id=2 2=(0,0.125) [1] 10=(0.125,0.25) [1,5] 6=(0.25,0.5) [5,1,3] 4=(0.5,0.75) [7,5,3] 8=(0.75,1) [7,3]
317id=1 1=(0,0.125) [10,2] 9=(0.125,0.25) [2,6,10] 5=(0.25,0.5) [10,4,6] 3=(0.5,0.75) [8,6,4] 7=(0.75,1) [4,8] id=2 2=(0,0.125) [9,1] 10=(0.125,0.25) [9,1,5] 6=(0.25,0.5) [9,5,3] 4=(0.5,0.75) [7,5,3] 8=(0.75,1) [7,3]
318id=1 1=(0,0.125) [10,2] 9=(0.125,0.25) [2,6,10] 5=(0.25,0.5) [12,10,4,6] 3=(0.5,0.75) [12,8,4] 7=(0.75,1) [4,8] id=2 2=(0,0.125) [9,1] 10=(0.125,0.25) [9,1,5] 6=(0.25,0.375) [9,5] 12=(0.375,0.5) [3,5] 4=(0.5,0.75) [7,5,3] 8=(0.75,1) [7,3]
319id=1 1=(0,0.125) [10,2] 9=(0.125,0.25) [2,6,10] 5=(0.25,0.375) [12,10,6] 11=(0.375,0.5) [6,4,12] 3=(0.5,0.75) [12,8,4] 7=(0.75,1) [4,8] id=2 2=(0,0.125) [9,1] 10=(0.125,0.25) [9,1,5] 6=(0.25,0.375) [11,9,5] 12=(0.375,0.5) [11,3,5] 4=(0.5,0.75) [11,7,3] 8=(0.75,1) [7,3]
320id=1 1=(0,0.125) [10,2] 9=(0.125,0.25) [2,6,10] 5=(0.25,0.375) [12,10,6] 11=(0.375,0.5) [6,4,12] 3=(0.5,0.75) [14,12,8,4] 7=(0.75,1) [14,8] id=2 2=(0,0.125) [9,1] 10=(0.125,0.25) [9,1,5] 6=(0.25,0.375) [11,9,5] 12=(0.375,0.5) [11,3,5] 4=(0.5,0.625) [11,3] 14=(0.625,0.75) [3,7] 8=(0.75,1) [7,3]
321id=1 1=(0,0.125) [10,2] 9=(0.125,0.25) [2,6,10] 5=(0.25,0.375) [12,10,6] 11=(0.375,0.5) [6,4,12] 3=(0.5,0.625) [14,12,4] 13=(0.625,0.75) [4,8,14] 7=(0.75,1) [14,8] id=2 2=(0,0.125) [9,1] 10=(0.125,0.25) [9,1,5] 6=(0.25,0.375) [11,9,5] 12=(0.375,0.5) [11,3,5] 4=(0.5,0.625) [13,11,3] 14=(0.625,0.75) [13,3,7] 8=(0.75,1) [13,7]
322id=1 1=(0,0.125) [10,2] 9=(0.125,0.25) [2,6,10] 5=(0.25,0.375) [12,10,6] 11=(0.375,0.5) [6,4,12] 3=(0.5,0.625) [14,12,4] 13=(0.625,0.75) [4,8,14] 7=(0.75,1) [16,14,8] id=2 2=(0,0.125) [9,1] 10=(0.125,0.25) [9,1,5] 6=(0.25,0.375) [11,9,5] 12=(0.375,0.5) [11,3,5] 4=(0.5,0.625) [13,11,3] 14=(0.625,0.75) [13,3,7] 8=(0.75,0.875) [13,7] 16=(0.875,1) [7]
323id=1 1=(0,0.125) [10,2] 9=(0.125,0.25) [2,6,10] 5=(0.25,0.375) [12,10,6] 11=(0.375,0.5) [6,4,12] 3=(0.5,0.625) [14,12,4] 13=(0.625,0.75) [4,8,14] 7=(0.75,0.875) [16,14,8] 15=(0.875,1) [8,16] id=2 2=(0,0.125) [9,1] 10=(0.125,0.25) [9,1,5] 6=(0.25,0.375) [11,9,5] 12=(0.375,0.5) [11,3,5] 4=(0.5,0.625) [13,11,3] 14=(0.625,0.75) [13,3,7] 8=(0.75,0.875) [15,13,7] 16=(0.875,1) [15,7]
324id=1 1=(0,0.125) [18,10,2] 9=(0.125,0.25) [18,6,10] 5=(0.25,0.375) [12,10,6] 11=(0.375,0.5) [6,4,12] 3=(0.5,0.625) [14,12,4] 13=(0.625,0.75) [4,8,14] 7=(0.75,0.875) [16,14,8] 15=(0.875,1) [8,16] id=2 2=(0,0.0625) [1] 18=(0.0625,0.125) [1,9] 10=(0.125,0.25) [9,1,5] 6=(0.25,0.375) [11,9,5] 12=(0.375,0.5) [11,3,5] 4=(0.5,0.625) [13,11,3] 14=(0.625,0.75) [13,3,7] 8=(0.75,0.875) [15,13,7] 16=(0.875,1) [15,7]
325setPerp t=0 cPt=(25,33) == oppT=0 fPerpPt=(25,33)
326setPerp t=0.0625 cPt=(25.0091529,32.5895776) == oppT=0.0625 fPerpPt=(25.0091529,32.5895776)
327setPerp t=0.125 cPt=(25.0366116,32.1867377) == oppT=0.125 fPerpPt=(25.0366116,32.1867377)
328setPerp t=0.25 cPt=(25.1464466,31.4038056) == oppT=0.25 fPerpPt=(25.1464466,31.4038056)
329setPerp t=0.375 cPt=(25.3295048,30.6512036) == oppT=0.375 fPerpPt=(25.3295048,30.6512036)
330setPerp t=0.5 cPt=(25.5857863,29.9289317) == oppT=0.5 fPerpPt=(25.5857863,29.9289317)
331setPerp t=0.625 cPt=(25.9152912,29.2369899) == oppT=0.625 fPerpPt=(25.9152912,29.2369899)
332setPerp t=0.75 cPt=(26.3180193,28.5753783) == oppT=0.75 fPerpPt=(26.3180193,28.5753783)
333setPerp t=0.875 cPt=(26.7939707,27.9440968) == oppT=0.875 fPerpPt=(26.7939707,27.9440968)
334setPerp t=1 cPt=(27.3431454,27.3431454) == oppT=1 fPerpPt=(27.3431454,27.3431454)
335setPerp t=0 cPt=(25,33) == oppT=0 fPerpPt=(25,33)
336setPerp t=1 cPt=(27.3431454,27.3431454) == oppT=1 fPerpPt=(27.3431454,27.3431454)
337id=1 (empty) id=2 (empty)
338debugShowQuadIntersection wtTs[0]=0 {{{25,33}, {25,29.6862907}, {27.3431454,27.3431454}}} {{25,33}} wtTs[1]=1 {{27.3431454,27.3431454}} wnTs[0]=0 {{{25,33}, {25,29.6862907}, {27.3431454,27.3431454}}} wnTs[1]=1
339debugShowQuadIntersection wtTs[0]=1 {{{25,33}, {25,29.6862907}, {27.3431454,27.3431454}}} {{27.3431454,27.3431454}} wnTs[0]=0 {{{27.3431454,27.3431454}, {29.6862907,25}, {33,25}}}
340debugShowQuadIntersection wtTs[0]=0 {{{27.3431454,27.3431454}, {27.3875446,27.2987461}, {27.4323025,27.2551785}}} {{27.3431454,27.3431454}} wnTs[0]=1 {{{25,33}, {25,29.6862907}, {27.3431454,27.3431454}}}
341id=1 1=(0,1) [2] id=2 2=(0,0.5) [1]
342id=1 1=(0,1) [2] id=2 2=(0,0.25) [1]
343id=1 1=(0,1) [2] id=2 2=(0,0.125) [1]
344id=1 1=(0,1) [2] id=2 2=(0,0.0625) [1]
345id=1 1=(0,1) [2] id=2 2=(0,0.03125) [1]
346id=1 1=(0,1) [14,2] id=2 2=(0,0.015625) [1] 14=(0.015625,0.03125) [1]
347id=1 1=(0,0.5) [2] 3=(0.5,1) [2,14] id=2 2=(0,0.015625) [3,1] 14=(0.015625,0.03125) [3]
348id=1 1=(0,0.5) [2] 3=(0.5,1) [2,14] id=2 2=(0,0.015625) [3,1] 14=(0.015625,0.0234375) [3]
349id=1 1=(0,0.5) [18,2] 3=(0.5,1) [18,14] id=2 2=(0,0.0078125) [1] 18=(0.0078125,0.015625) [1,3] 14=(0.015625,0.0234375) [3]
350id=1 1=(0,0.5) [18,2] 3=(0.5,0.75) [18] 5=(0.75,1) [14,18] id=2 2=(0,0.0078125) [1] 18=(0.0078125,0.015625) [5,1,3] 14=(0.015625,0.0234375) [5]
351id=1 1=(0,0.25) [2] 7=(0.25,0.5) [2,18] 3=(0.5,0.75) [18] 5=(0.75,1) [14,18] id=2 2=(0,0.0078125) [7,1] 18=(0.0078125,0.015625) [7,5,3] 14=(0.015625,0.0234375) [5]
352id=1 1=(0,0.25) [2] 7=(0.25,0.5) [2,18] 3=(0.5,0.75) [18] 5=(0.75,1) [14,18] id=2 2=(0,0.0078125) [7,1] 18=(0.0078125,0.015625) [7,5,3] 14=(0.015625,0.0195313) [5]
353id=1 1=(0,0.25) [2] 7=(0.25,0.5) [2,18] 3=(0.5,0.75) [22,18] 5=(0.75,1) [22,14] id=2 2=(0,0.0078125) [7,1] 18=(0.0078125,0.0117188) [7,3] 22=(0.0117188,0.015625) [3,5] 14=(0.015625,0.0195313) [5]
354id=1 1=(0,0.25) [24,2] 7=(0.25,0.5) [24,18] 3=(0.5,0.75) [22,18] 5=(0.75,1) [22,14] id=2 2=(0,0.00390625) [1] 24=(0.00390625,0.0078125) [1,7] 18=(0.0078125,0.0117188) [7,3] 22=(0.0117188,0.015625) [3,5] 14=(0.015625,0.0195313) [5]
355id=1 1=(0,0.25) [24,2] 7=(0.25,0.5) [24,18] 3=(0.5,0.75) [22,18] 5=(0.75,0.875) [22,14] 9=(0.875,1) [14] id=2 2=(0,0.00390625) [1] 24=(0.00390625,0.0078125) [1,7] 18=(0.0078125,0.0117188) [7,3] 22=(0.0117188,0.015625) [3,5] 14=(0.015625,0.0195313) [9,5]
356id=1 1=(0,0.25) [24,2] 7=(0.25,0.5) [24,18] 3=(0.5,0.625) [22,18] 11=(0.625,0.75) [22] 5=(0.75,0.875) [22,14] 9=(0.875,1) [14] id=2 2=(0,0.00390625) [1] 24=(0.00390625,0.0078125) [1,7] 18=(0.0078125,0.0117188) [7,3] 22=(0.0117188,0.015625) [11,3,5] 14=(0.015625,0.0195313) [9,5]
357id=1 1=(0,0.25) [24,2] 7=(0.25,0.375) [24] 13=(0.375,0.5) [18,24] 3=(0.5,0.625) [22,18] 11=(0.625,0.75) [22] 5=(0.75,0.875) [22,14] 9=(0.875,1) [14] id=2 2=(0,0.00390625) [1] 24=(0.00390625,0.0078125) [13,1,7] 18=(0.0078125,0.0117188) [13,3] 22=(0.0117188,0.015625) [11,3,5] 14=(0.015625,0.0195313) [9,5]
358id=1 1=(0,0.125) [2] 15=(0.125,0.25) [2,24] 7=(0.25,0.375) [24] 13=(0.375,0.5) [18,24] 3=(0.5,0.625) [22,18] 11=(0.625,0.75) [22] 5=(0.75,0.875) [22,14] 9=(0.875,1) [14] id=2 2=(0,0.00390625) [15,1] 24=(0.00390625,0.0078125) [15,13,7] 18=(0.0078125,0.0117188) [13,3] 22=(0.0117188,0.015625) [11,3,5] 14=(0.015625,0.0195313) [9,5]
359setPerp t=0.875 cPt=(27.4211186,27.2660834) == oppT=0.0165816271 fPerpPt=(27.4211186,27.2660833)
360setPerp t=1 cPt=(27.4323025,27.2551785) == oppT=0.0189506978 fPerpPt=(27.4323024,27.2551784)
361setPerp t=0.017578125 cPt=(27.4258215,27.2614932) == oppT=0.927578956 fPerpPt=(27.4258215,27.2614932)
362setPerp t=0.75 cPt=(27.409946,27.2770143) == oppT=0.0142126233 fPerpPt=(27.4099459,27.2770142)
363setPerp t=0.875 cPt=(27.4211186,27.2660834) == oppT=0.0165816271 fPerpPt=(27.4211186,27.2660833)
364setPerp t=0.015625 cPt=(27.4166056,27.2704941) == oppT=0.824524193 fPerpPt=(27.4166057,27.2704942)
365setPerp t=0.875 cPt=(27.4211186,27.2660834) == oppT=0.0165816271 fPerpPt=(27.4211186,27.2660833)
366setPerp t=1 cPt=(27.4323025,27.2551785) == oppT=0.0189506978 fPerpPt=(27.4323024,27.2551784)
367setPerp t=0.017578125 cPt=(27.4258215,27.2614932) == oppT=0.927578956 fPerpPt=(27.4258215,27.2614932)
368id=1 1=(0,0.125) [2] 15=(0.125,0.25) [2,24] 7=(0.25,0.375) [24] 13=(0.375,0.5) [18,24] 3=(0.5,0.625) [22,18] 11=(0.625,0.75) [22] 5=(0.75,0.875) [22] id=2 2=(0,0.00390625) [15,1] 24=(0.00390625,0.0078125) [15,13,7] 18=(0.0078125,0.0117188) [13,3] 22=(0.0117188,0.015625) [11,3,5]
369setPerp t=0.625 cPt=(27.3987845,27.2879711) == oppT=0.0118436864 fPerpPt=(27.3987845,27.2879711)
370setPerp t=0.75 cPt=(27.409946,27.2770143) == oppT=0.0142126233 fPerpPt=(27.4099459,27.2770142)
371setPerp t=0.013671875 cPt=(27.4073972,27.279513) == oppT=0.721467031 fPerpPt=(27.4073972,27.279513)
372setPerp t=0.5 cPt=(27.3876343,27.298954) == oppT=0.00947481625 fPerpPt=(27.3876342,27.298954)
373setPerp t=0.625 cPt=(27.3987845,27.2879711) == oppT=0.0118436864 fPerpPt=(27.3987845,27.2879711)
374setPerp t=0.01171875 cPt=(27.3981961,27.2885497) == oppT=0.618407471 fPerpPt=(27.3981962,27.2885497)
375setPerp t=0.75 cPt=(27.409946,27.2770143) == oppT=0.0142126233 fPerpPt=(27.4099459,27.2770142)
376setPerp t=0.875 cPt=(27.4211186,27.2660834) == oppT=0.0165816271 fPerpPt=(27.4211186,27.2660833)
377setPerp t=0.015625 cPt=(27.4166056,27.2704941) == oppT=0.824524193 fPerpPt=(27.4166057,27.2704942)
378setPerp t=0.625 cPt=(27.3987845,27.2879711) == oppT=0.0118436864 fPerpPt=(27.3987845,27.2879711)
379setPerp t=0.75 cPt=(27.409946,27.2770143) == oppT=0.0142126233 fPerpPt=(27.4099459,27.2770142)
380setPerp t=0.013671875 cPt=(27.4073972,27.279513) == oppT=0.721467031 fPerpPt=(27.4073972,27.279513)
381id=1 1=(0,0.125) [2] 15=(0.125,0.25) [2,24] 7=(0.25,0.375) [24] 13=(0.375,0.5) [18,24] 3=(0.5,0.625) [18] id=2 2=(0,0.00390625) [15,1] 24=(0.00390625,0.0078125) [15,13,7] 18=(0.0078125,0.0117188) [13,3]
382setPerp t=0.375 cPt=(27.3764952,27.3099629) == oppT=0.00710601267 fPerpPt=(27.3764952,27.3099628)
383setPerp t=0.5 cPt=(27.3876343,27.298954) == oppT=0.00947481625 fPerpPt=(27.3876342,27.298954)
384setPerp t=0.0078125 cPt=(27.3798163,27.3066767) == oppT=0.412281177 fPerpPt=(27.3798163,27.3066768)
385setPerp t=0.5 cPt=(27.3876343,27.298954) == oppT=0.00947481625 fPerpPt=(27.3876342,27.298954)
386setPerp t=0.625 cPt=(27.3987845,27.2879711) == oppT=0.0118436864 fPerpPt=(27.3987845,27.2879711)
387setPerp t=0.009765625 cPt=(27.3890025,27.2976043) == oppT=0.515345519 fPerpPt=(27.3890025,27.2976043)
388setPerp t=0.5 cPt=(27.3876343,27.298954) == oppT=0.00947481625 fPerpPt=(27.3876342,27.298954)
389setPerp t=0.625 cPt=(27.3987845,27.2879711) == oppT=0.0118436864 fPerpPt=(27.3987845,27.2879711)
390setPerp t=0.009765625 cPt=(27.3890025,27.2976043) == oppT=0.515345519 fPerpPt=(27.3890025,27.2976043)
391setPerp t=0.01171875 cPt=(27.3981961,27.2885497) == oppT=0.618407471 fPerpPt=(27.3981962,27.2885497)
392id=1 1=(0,0.125) [2] 15=(0.125,0.25) [2,24] 7=(0.25,0.375) [24] 13=(0.375,0.5) [24] id=2 2=(0,0.00390625) [15,1] 24=(0.00390625,0.0078125) [15,13,7]
393setPerp t=0.125 cPt=(27.3542508,27.3320585) == oppT=0.00236860468 fPerpPt=(27.3542508,27.3320585)
394setPerp t=0.25 cPt=(27.3653674,27.3209977) == oppT=0.00473727552 fPerpPt=(27.3653674,27.3209977)
395setPerp t=0.00390625 cPt=(27.361466,27.3248753) == oppT=0.206145343 fPerpPt=(27.361466,27.3248753)
396setPerp t=0.25 cPt=(27.3653674,27.3209977) == oppT=0.00473727552 fPerpPt=(27.3653674,27.3209977)
397setPerp t=0.375 cPt=(27.3764952,27.3099629) == oppT=0.00710601267 fPerpPt=(27.3764952,27.3099628)
398setPerp t=0.005859375 cPt=(27.3706374,27.3157671) == oppT=0.309214451 fPerpPt=(27.3706374,27.3157671)
399setPerp t=0.25 cPt=(27.3653674,27.3209977) == oppT=0.00473727552 fPerpPt=(27.3653674,27.3209977)
400setPerp t=0.375 cPt=(27.3764952,27.3099629) == oppT=0.00710601267 fPerpPt=(27.3764952,27.3099628)
401setPerp t=0.005859375 cPt=(27.3706374,27.3157671) == oppT=0.309214451 fPerpPt=(27.3706374,27.3157671)
402setPerp t=0.375 cPt=(27.3764952,27.3099629) == oppT=0.00710601267 fPerpPt=(27.3764952,27.3099628)
403setPerp t=0.5 cPt=(27.3876343,27.298954) == oppT=0.00947481625 fPerpPt=(27.3876342,27.298954)
404setPerp t=0.0078125 cPt=(27.3798163,27.3066767) == oppT=0.412281177 fPerpPt=(27.3798163,27.3066768)
405id=1 1=(0,0.125) [2] 15=(0.125,0.25) [2] id=2 2=(0,0.00390625) [15,1]
406setPerp t=0.125 cPt=(27.3542508,27.3320585) == oppT=0.00236860468 fPerpPt=(27.3542508,27.3320585)
407setPerp t=0.25 cPt=(27.3653674,27.3209977) == oppT=0.00473727552 fPerpPt=(27.3653674,27.3209977)
408setPerp t=0.00390625 cPt=(27.361466,27.3248753) == oppT=0.206145343 fPerpPt=(27.361466,27.3248753)
409id=1 1=(0,0.125) [34,2] id=2 2=(0,0.00195313) [1] 34=(0.00195313,0.00390625) [1]
410id=1 1=(0,0.0625) [2] 17=(0.0625,0.125) [2,34] id=2 2=(0,0.00195313) [17,1] 34=(0.00195313,0.00390625) [17]
411id=1 1=(0,0.0625) [2] 17=(0.0625,0.125) [2,34] id=2 2=(0,0.00195313) [17,1] 34=(0.00195313,0.00292969) [17]
412id=1 1=(0,0.0625) [38,2] 17=(0.0625,0.125) [38,34] id=2 2=(0,0.000976563) [1] 38=(0.000976563,0.00195313) [1,17] 34=(0.00195313,0.00292969) [17]
413setPerp t=0.001953125 cPt=(27.352302,27.3340014) == oppT=0.103073858 fPerpPt=(27.352302,27.3340014)
414setPerp t=0.0029296875 cPt=(27.3568831,27.3294361) == oppT=0.154609898 fPerpPt=(27.3568831,27.3294361)
415setPerp t=0.125 cPt=(27.3542508,27.3320585) == oppT=0.00236860468 fPerpPt=(27.3542508,27.3320585)
416id=1 1=(0,0.0625) [38,2] 17=(0.0625,0.09375) [38] 19=(0.09375,0.125) [38] id=2 2=(0,0.000976563) [1] 38=(0.000976563,0.00195313) [19,1,17]
417id=1 1=(0,0.03125) [2] 21=(0.03125,0.0625) [2,38] 17=(0.0625,0.09375) [38] 19=(0.09375,0.125) [38] id=2 2=(0,0.000976563) [21,1] 38=(0.000976563,0.00195313) [21,19,17]
418setPerp t=0.09375 cPt=(27.3514734,27.3348278) == oppT=0.00177644731 fPerpPt=(27.3514734,27.3348278)
419setPerp t=0.125 cPt=(27.3542508,27.3320585) == oppT=0.00236860468 fPerpPt=(27.3542508,27.3320585)
420setPerp t=0.001953125 cPt=(27.352302,27.3340014) == oppT=0.103073858 fPerpPt=(27.352302,27.3340014)
421id=1 1=(0,0.03125) [2] 21=(0.03125,0.0625) [2,38] 17=(0.0625,0.09375) [40,38] id=2 2=(0,0.000976563) [21,1] 38=(0.000976563,0.00146484) [21,17] 40=(0.00146484,0.00195313) [17]
422id=1 1=(0,0.03125) [42,2] 21=(0.03125,0.0625) [42,38] 17=(0.0625,0.09375) [40,38] id=2 2=(0,0.000488281) [1] 42=(0.000488281,0.000976563) [1,21] 38=(0.000976563,0.00146484) [21,17] 40=(0.00146484,0.00195313) [17]
423setPerp t=0.00146484375 cPt=(27.3500121,27.3362857) == oppT=0.0773056159 fPerpPt=(27.3500121,27.3362857)
424setPerp t=0.001953125 cPt=(27.352302,27.3340014) == oppT=0.103073858 fPerpPt=(27.352302,27.3340014)
425setPerp t=0.078125 cPt=(27.3500849,27.3362131) == oppT=0.00148037018 fPerpPt=(27.3500849,27.3362131)
426setPerp t=0.00146484375 cPt=(27.3500121,27.3362857) == oppT=0.0773056159 fPerpPt=(27.3500121,27.3362857)
427setPerp t=0.001953125 cPt=(27.352302,27.3340014) == oppT=0.103073858 fPerpPt=(27.352302,27.3340014)
428setPerp t=0.078125 cPt=(27.3500849,27.3362131) == oppT=0.00148037018 fPerpPt=(27.3500849,27.3362131)
429setPerp t=0.09375 cPt=(27.3514734,27.3348278) == oppT=0.00177644731 fPerpPt=(27.3514734,27.3348278)
430id=1 1=(0,0.03125) [42,2] 21=(0.03125,0.0625) [42,38] 17=(0.0625,0.078125) [38] id=2 2=(0,0.000488281) [1] 42=(0.000488281,0.000976563) [1,21] 38=(0.000976563,0.00146484) [21,17]
431id=1 1=(0,0.03125) [42,2] 21=(0.03125,0.046875) [42] 25=(0.046875,0.0625) [38,42] 17=(0.0625,0.078125) [38] id=2 2=(0,0.000488281) [1] 42=(0.000488281,0.000976563) [25,1,21] 38=(0.000976563,0.00146484) [25,17]
432id=1 1=(0,0.015625) [2] 27=(0.015625,0.03125) [2,42] 21=(0.03125,0.046875) [42] 25=(0.046875,0.0625) [38,42] 17=(0.0625,0.078125) [38] id=2 2=(0,0.000488281) [27,1] 42=(0.000488281,0.000976563) [27,25,21] 38=(0.000976563,0.00146484) [25,17]
433setPerp t=0.0625 cPt=(27.3486967,27.3375987) == oppT=0.00118429408 fPerpPt=(27.3486967,27.3375987)
434setPerp t=0.078125 cPt=(27.3500849,27.3362131) == oppT=0.00148037018 fPerpPt=(27.3500849,27.3362131)
435setPerp t=0.00122070313 cPt=(27.3488674,27.3374283) == oppT=0.0644214392 fPerpPt=(27.3488674,27.3374283)
436setPerp t=0.00146484375 cPt=(27.3500121,27.3362857) == oppT=0.0773056159 fPerpPt=(27.3500121,27.3362857)
437id=1 1=(0,0.015625) [2] 27=(0.015625,0.03125) [2,42] 21=(0.03125,0.046875) [42] 25=(0.046875,0.0625) [38,42] 17=(0.0625,0.078125) [38] id=2 2=(0,0.000488281) [27,1] 42=(0.000488281,0.000976563) [27,25,21] 38=(0.000976563,0.0012207) [25,17]
438id=1 1=(0,0.015625) [2] 27=(0.015625,0.03125) [2,42] 21=(0.03125,0.046875) [46,42] 25=(0.046875,0.0625) [46,38] 17=(0.0625,0.078125) [38] id=2 2=(0,0.000488281) [27,1] 42=(0.000488281,0.000732422) [27,21] 46=(0.000732422,0.000976563) [21,25] 38=(0.000976563,0.0012207) [25,17]
439id=1 1=(0,0.015625) [48,2] 27=(0.015625,0.03125) [48,42] 21=(0.03125,0.046875) [46,42] 25=(0.046875,0.0625) [46,38] 17=(0.0625,0.078125) [38] id=2 2=(0,0.000244141) [1] 48=(0.000244141,0.000488281) [1,27] 42=(0.000488281,0.000732422) [27,21] 46=(0.000732422,0.000976563) [21,25] 38=(0.000976563,0.0012207) [25,17]
440id=1 1=(0,0.015625) [48,2] 27=(0.015625,0.03125) [48,42] 21=(0.03125,0.046875) [46,42] 25=(0.046875,0.0625) [46,38] 17=(0.0625,0.0703125) [38] id=2 2=(0,0.000244141) [1] 48=(0.000244141,0.000488281) [1,27] 42=(0.000488281,0.000732422) [27,21] 46=(0.000732422,0.000976563) [21,25] 38=(0.000976563,0.0012207) [25,17]
441id=1 1=(0,0.015625) [48,2] 27=(0.015625,0.03125) [48,42] 21=(0.03125,0.046875) [46,42] 25=(0.046875,0.0546875) [46,38] 31=(0.0546875,0.0625) [38] 17=(0.0625,0.0703125) [38] id=2 2=(0,0.000244141) [1] 48=(0.000244141,0.000488281) [1,27] 42=(0.000488281,0.000732422) [27,21] 46=(0.000732422,0.000976563) [21,25] 38=(0.000976563,0.0012207) [31,25,17]
442id=1 1=(0,0.015625) [48,2] 27=(0.015625,0.03125) [48,42] 21=(0.03125,0.0390625) [46,42] 33=(0.0390625,0.046875) [46] 25=(0.046875,0.0546875) [46,38] 31=(0.0546875,0.0625) [38] 17=(0.0625,0.0703125) [38] id=2 2=(0,0.000244141) [1] 48=(0.000244141,0.000488281) [1,27] 42=(0.000488281,0.000732422) [27,21] 46=(0.000732422,0.000976563) [33,21,25] 38=(0.000976563,0.0012207) [31,25,17]
443id=1 1=(0,0.015625) [48,2] 27=(0.015625,0.0234375) [48] 35=(0.0234375,0.03125) [42,48] 21=(0.03125,0.0390625) [46,42] 33=(0.0390625,0.046875) [46] 25=(0.046875,0.0546875) [46,38] 31=(0.0546875,0.0625) [38] 17=(0.0625,0.0703125) [38] id=2 2=(0,0.000244141) [1] 48=(0.000244141,0.000488281) [35,1,27] 42=(0.000488281,0.000732422) [35,21] 46=(0.000732422,0.000976563) [33,21,25] 38=(0.000976563,0.0012207) [31,25,17]
444id=1 1=(0,0.0078125) [2] 37=(0.0078125,0.015625) [2,48] 27=(0.015625,0.0234375) [48] 35=(0.0234375,0.03125) [42,48] 21=(0.03125,0.0390625) [46,42] 33=(0.0390625,0.046875) [46] 25=(0.046875,0.0546875) [46,38] 31=(0.0546875,0.0625) [38] 17=(0.0625,0.0703125) [38] id=2 2=(0,0.000244141) [37,1] 48=(0.000244141,0.000488281) [37,35,27] 42=(0.000488281,0.000732422) [35,21] 46=(0.000732422,0.000976563) [33,21,25] 38=(0.000976563,0.0012207) [31,25,17]
445setPerp t=0.0546875 cPt=(27.3480026,27.3382917) == oppT=0.00103625641 fPerpPt=(27.3480026,27.3382917)
446setPerp t=0.0625 cPt=(27.3486967,27.3375987) == oppT=0.00118429408 fPerpPt=(27.3486967,27.3375987)
447setPerp t=0.00109863281 cPt=(27.3482951,27.3379997) == oppT=0.057979337 fPerpPt=(27.3482951,27.3379997)
448setPerp t=0.046875 cPt=(27.3473086,27.3389848) == oppT=0.00088821901 fPerpPt=(27.3473086,27.3389848)
449setPerp t=0.0546875 cPt=(27.3480026,27.3382917) == oppT=0.00103625641 fPerpPt=(27.3480026,27.3382917)
450setPerp t=0.0009765625 cPt=(27.3477228,27.3385711) == oppT=0.0515372255 fPerpPt=(27.3477228,27.3385711)
451setPerp t=0.0625 cPt=(27.3486967,27.3375987) == oppT=0.00118429408 fPerpPt=(27.3486967,27.3375987)
452setPerp t=0.0703125 cPt=(27.3493908,27.3369058) == oppT=0.001332332 fPerpPt=(27.3493908,27.3369058)
453setPerp t=0.00122070313 cPt=(27.3488674,27.3374283) == oppT=0.0644214392 fPerpPt=(27.3488674,27.3374283)
454setPerp t=0.0546875 cPt=(27.3480026,27.3382917) == oppT=0.00103625641 fPerpPt=(27.3480026,27.3382917)
455setPerp t=0.0625 cPt=(27.3486967,27.3375987) == oppT=0.00118429408 fPerpPt=(27.3486967,27.3375987)
456setPerp t=0.00109863281 cPt=(27.3482951,27.3379997) == oppT=0.057979337 fPerpPt=(27.3482951,27.3379997)
457id=1 1=(0,0.0078125) [2] 37=(0.0078125,0.015625) [2,48] 27=(0.015625,0.0234375) [48] 35=(0.0234375,0.03125) [42,48] 21=(0.03125,0.0390625) [46,42] 33=(0.0390625,0.046875) [46] 25=(0.046875,0.0546875) [46] id=2 2=(0,0.000244141) [37,1] 48=(0.000244141,0.000488281) [37,35,27] 42=(0.000488281,0.000732422) [35,21] 46=(0.000732422,0.000976563) [33,21,25]
458setPerp t=0.046875 cPt=(27.3473086,27.3389848) == oppT=0.00088821901 fPerpPt=(27.3473086,27.3389848)
459setPerp t=0.0546875 cPt=(27.3480026,27.3382917) == oppT=0.00103625641 fPerpPt=(27.3480026,27.3382917)
460setPerp t=0.0009765625 cPt=(27.3477228,27.3385711) == oppT=0.0515372255 fPerpPt=(27.3477228,27.3385711)
461id=1 1=(0,0.0078125) [2] 37=(0.0078125,0.015625) [2,48] 27=(0.015625,0.0234375) [48] 35=(0.0234375,0.03125) [42,48] 21=(0.03125,0.0390625) [46,42] 33=(0.0390625,0.046875) [52,46] id=2 2=(0,0.000244141) [37,1] 48=(0.000244141,0.000488281) [37,35,27] 42=(0.000488281,0.000732422) [35,21] 46=(0.000732422,0.000854492) [33,21] 52=(0.000854492,0.000976563) [33]
462id=1 1=(0,0.0078125) [2] 37=(0.0078125,0.015625) [2,48] 27=(0.015625,0.0234375) [48] 35=(0.0234375,0.03125) [42,48] 21=(0.03125,0.0390625) [54,46,42] 33=(0.0390625,0.046875) [52,46] id=2 2=(0,0.000244141) [37,1] 48=(0.000244141,0.000488281) [37,35,27] 42=(0.000488281,0.000610352) [35,21] 54=(0.000610352,0.000732422) [21] 46=(0.000732422,0.000854492) [33,21] 52=(0.000854492,0.000976563) [33]
463id=1 1=(0,0.0078125) [2] 37=(0.0078125,0.015625) [2,48] 27=(0.015625,0.0234375) [56,48] 35=(0.0234375,0.03125) [56,42] 21=(0.03125,0.0390625) [54,46,42] 33=(0.0390625,0.046875) [52,46] id=2 2=(0,0.000244141) [37,1] 48=(0.000244141,0.000366211) [37,27] 56=(0.000366211,0.000488281) [27,35] 42=(0.000488281,0.000610352) [35,21] 54=(0.000610352,0.000732422) [21] 46=(0.000732422,0.000854492) [33,21] 52=(0.000854492,0.000976563) [33]
464id=1 1=(0,0.0078125) [58,2] 37=(0.0078125,0.015625) [58,48] 27=(0.015625,0.0234375) [56,48] 35=(0.0234375,0.03125) [56,42] 21=(0.03125,0.0390625) [54,46,42] 33=(0.0390625,0.046875) [52,46] id=2 2=(0,0.00012207) [1] 58=(0.00012207,0.000244141) [1,37] 48=(0.000244141,0.000366211) [37,27] 56=(0.000366211,0.000488281) [27,35] 42=(0.000488281,0.000610352) [35,21] 54=(0.000610352,0.000732422) [21] 46=(0.000732422,0.000854492) [33,21] 52=(0.000854492,0.000976563) [33]
465setPerp t=0.000854492188 cPt=(27.3471505,27.3391427) == oppT=0.0450951047 fPerpPt=(27.3471505,27.3391427)
466setPerp t=0.0009765625 cPt=(27.3477228,27.3385711) == oppT=0.0515372255 fPerpPt=(27.3477228,27.3385711)
467setPerp t=0.046875 cPt=(27.3473086,27.3389848) == oppT=0.00088821901 fPerpPt=(27.3473086,27.3389848)
468id=1 1=(0,0.0078125) [58,2] 37=(0.0078125,0.015625) [58,48] 27=(0.015625,0.0234375) [56,48] 35=(0.0234375,0.03125) [56,42] 21=(0.03125,0.0390625) [54,46,42] 33=(0.0390625,0.0429688) [46] 39=(0.0429688,0.046875) [46] id=2 2=(0,0.00012207) [1] 58=(0.00012207,0.000244141) [1,37] 48=(0.000244141,0.000366211) [37,27] 56=(0.000366211,0.000488281) [27,35] 42=(0.000488281,0.000610352) [35,21] 54=(0.000610352,0.000732422) [21] 46=(0.000732422,0.000854492) [39,33,21]
469id=1 1=(0,0.0078125) [58,2] 37=(0.0078125,0.015625) [58,48] 27=(0.015625,0.0234375) [56,48] 35=(0.0234375,0.03125) [56,42] 21=(0.03125,0.0351563) [54,42] 41=(0.0351563,0.0390625) [46,54] 33=(0.0390625,0.0429688) [46] 39=(0.0429688,0.046875) [46] id=2 2=(0,0.00012207) [1] 58=(0.00012207,0.000244141) [1,37] 48=(0.000244141,0.000366211) [37,27] 56=(0.000366211,0.000488281) [27,35] 42=(0.000488281,0.000610352) [35,21] 54=(0.000610352,0.000732422) [41,21] 46=(0.000732422,0.000854492) [41,39,33]
470id=1 1=(0,0.0078125) [58,2] 37=(0.0078125,0.015625) [58,48] 27=(0.015625,0.0234375) [56,48] 35=(0.0234375,0.0273438) [56,42] 43=(0.0273438,0.03125) [42] 21=(0.03125,0.0351563) [54,42] 41=(0.0351563,0.0390625) [46,54] 33=(0.0390625,0.0429688) [46] 39=(0.0429688,0.046875) [46] id=2 2=(0,0.00012207) [1] 58=(0.00012207,0.000244141) [1,37] 48=(0.000244141,0.000366211) [37,27] 56=(0.000366211,0.000488281) [27,35] 42=(0.000488281,0.000610352) [43,35,21] 54=(0.000610352,0.000732422) [41,21] 46=(0.000732422,0.000854492) [41,39,33]
471id=1 1=(0,0.0078125) [58,2] 37=(0.0078125,0.015625) [58,48] 27=(0.015625,0.0195313) [56,48] 45=(0.0195313,0.0234375) [56] 35=(0.0234375,0.0273438) [56,42] 43=(0.0273438,0.03125) [42] 21=(0.03125,0.0351563) [54,42] 41=(0.0351563,0.0390625) [46,54] 33=(0.0390625,0.0429688) [46] 39=(0.0429688,0.046875) [46] id=2 2=(0,0.00012207) [1] 58=(0.00012207,0.000244141) [1,37] 48=(0.000244141,0.000366211) [37,27] 56=(0.000366211,0.000488281) [45,27,35] 42=(0.000488281,0.000610352) [43,35,21] 54=(0.000610352,0.000732422) [41,21] 46=(0.000732422,0.000854492) [41,39,33]
472id=1 1=(0,0.0078125) [58,2] 37=(0.0078125,0.0117188) [58] 47=(0.0117188,0.015625) [48,58] 27=(0.015625,0.0195313) [56,48] 45=(0.0195313,0.0234375) [56] 35=(0.0234375,0.0273438) [56,42] 43=(0.0273438,0.03125) [42] 21=(0.03125,0.0351563) [54,42] 41=(0.0351563,0.0390625) [46,54] 33=(0.0390625,0.0429688) [46] 39=(0.0429688,0.046875) [46] id=2 2=(0,0.00012207) [1] 58=(0.00012207,0.000244141) [47,1,37] 48=(0.000244141,0.000366211) [47,27] 56=(0.000366211,0.000488281) [45,27,35] 42=(0.000488281,0.000610352) [43,35,21] 54=(0.000610352,0.000732422) [41,21] 46=(0.000732422,0.000854492) [41,39,33]
473id=1 1=(0,0.00390625) [2] 49=(0.00390625,0.0078125) [2,58] 37=(0.0078125,0.0117188) [58] 47=(0.0117188,0.015625) [48,58] 27=(0.015625,0.0195313) [56,48] 45=(0.0195313,0.0234375) [56] 35=(0.0234375,0.0273438) [56,42] 43=(0.0273438,0.03125) [42] 21=(0.03125,0.0351563) [54,42] 41=(0.0351563,0.0390625) [46,54] 33=(0.0390625,0.0429688) [46] 39=(0.0429688,0.046875) [46] id=2 2=(0,0.00012207) [49,1] 58=(0.00012207,0.000244141) [49,47,37] 48=(0.000244141,0.000366211) [47,27] 56=(0.000366211,0.000488281) [45,27,35] 42=(0.000488281,0.000610352) [43,35,21] 54=(0.000610352,0.000732422) [41,21] 46=(0.000732422,0.000854492) [41,39,33]
474setPerp t=0.03515625 cPt=(27.3462676,27.3400246) == oppT=0.000666163387 fPerpPt=(27.3462676,27.3400246)
475setPerp t=0.0390625 cPt=(27.3466146,27.3396779) == oppT=0.000740181863 fPerpPt=(27.3466146,27.3396779)
476setPerp t=0.000732421875 cPt=(27.3465782,27.3397143) == oppT=0.0386529746 fPerpPt=(27.3465782,27.3397143)
477setPerp t=0.0390625 cPt=(27.3466146,27.3396779) == oppT=0.000740181863 fPerpPt=(27.3466146,27.3396779)
478setPerp t=0.04296875 cPt=(27.3469616,27.3393313) == oppT=0.000814200404 fPerpPt=(27.3469616,27.3393313)
479setPerp t=0.000793457031 cPt=(27.3468644,27.3394285) == oppT=0.0418740408 fPerpPt=(27.3468644,27.3394285)
480setPerp t=0.0390625 cPt=(27.3466146,27.3396779) == oppT=0.000740181863 fPerpPt=(27.3466146,27.3396779)
481setPerp t=0.04296875 cPt=(27.3469616,27.3393313) == oppT=0.000814200404 fPerpPt=(27.3469616,27.3393313)
482setPerp t=0.000793457031 cPt=(27.3468644,27.3394285) == oppT=0.0418740408 fPerpPt=(27.3468644,27.3394285)
483setPerp t=0.04296875 cPt=(27.3469616,27.3393313) == oppT=0.000814200404 fPerpPt=(27.3469616,27.3393313)
484setPerp t=0.046875 cPt=(27.3473086,27.3389848) == oppT=0.00088821901 fPerpPt=(27.3473086,27.3389848)
485setPerp t=0.000854492188 cPt=(27.3471505,27.3391427) == oppT=0.0450951047 fPerpPt=(27.3471505,27.3391427)
486id=1 1=(0,0.00390625) [2] 49=(0.00390625,0.0078125) [2,58] 37=(0.0078125,0.0117188) [58] 47=(0.0117188,0.015625) [48,58] 27=(0.015625,0.0195313) [56,48] 45=(0.0195313,0.0234375) [56] 35=(0.0234375,0.0273438) [56,42] 43=(0.0273438,0.03125) [42] 21=(0.03125,0.0351563) [54,42] 41=(0.0351563,0.0390625) [54] id=2 2=(0,0.00012207) [49,1] 58=(0.00012207,0.000244141) [49,47,37] 48=(0.000244141,0.000366211) [47,27] 56=(0.000366211,0.000488281) [45,27,35] 42=(0.000488281,0.000610352) [43,35,21] 54=(0.000610352,0.000732422) [41,21]
487setPerp t=0.03515625 cPt=(27.3462676,27.3400246) == oppT=0.000666163387 fPerpPt=(27.3462676,27.3400246)
488setPerp t=0.0390625 cPt=(27.3466146,27.3396779) == oppT=0.000740181863 fPerpPt=(27.3466146,27.3396779)
489setPerp t=0.000671386719 cPt=(27.3462921,27.3400001) == oppT=0.0354319062 fPerpPt=(27.3462921,27.3400001)
490setPerp t=0.03515625 cPt=(27.3462676,27.3400246) == oppT=0.000666163387 fPerpPt=(27.3462676,27.3400246)
491setPerp t=0.0390625 cPt=(27.3466146,27.3396779) == oppT=0.000740181863 fPerpPt=(27.3466146,27.3396779)
492setPerp t=0.000671386719 cPt=(27.3462921,27.3400001) == oppT=0.0354319062 fPerpPt=(27.3462921,27.3400001)
493setPerp t=0.000732421875 cPt=(27.3465782,27.3397143) == oppT=0.0386529746 fPerpPt=(27.3465782,27.3397143)
494id=1 1=(0,0.00390625) [2] 49=(0.00390625,0.0078125) [2,58] 37=(0.0078125,0.0117188) [58] 47=(0.0117188,0.015625) [48,58] 27=(0.015625,0.0195313) [56,48] 45=(0.0195313,0.0234375) [56] 35=(0.0234375,0.0273438) [56,42] 43=(0.0273438,0.03125) [42] 21=(0.03125,0.0351563) [54,42] id=2 2=(0,0.00012207) [49,1] 58=(0.00012207,0.000244141) [49,47,37] 48=(0.000244141,0.000366211) [47,27] 56=(0.000366211,0.000488281) [45,27,35] 42=(0.000488281,0.000610352) [43,35,21] 54=(0.000610352,0.000671387) [21]
495id=1 1=(0,0.00390625) [2] 49=(0.00390625,0.0078125) [2,58] 37=(0.0078125,0.0117188) [58] 47=(0.0117188,0.015625) [48,58] 27=(0.015625,0.0195313) [56,48] 45=(0.0195313,0.0234375) [56] 35=(0.0234375,0.0273438) [56,42] 43=(0.0273438,0.03125) [64,42] 21=(0.03125,0.0351563) [64,54] id=2 2=(0,0.00012207) [49,1] 58=(0.00012207,0.000244141) [49,47,37] 48=(0.000244141,0.000366211) [47,27] 56=(0.000366211,0.000488281) [45,27,35] 42=(0.000488281,0.000549316) [43,35] 64=(0.000549316,0.000610352) [21,43] 54=(0.000610352,0.000671387) [21]
496id=1 1=(0,0.00390625) [2] 49=(0.00390625,0.0078125) [2,58] 37=(0.0078125,0.0117188) [58] 47=(0.0117188,0.015625) [48,58] 27=(0.015625,0.0195313) [56,48] 45=(0.0195313,0.0234375) [66,56] 35=(0.0234375,0.0273438) [66,42] 43=(0.0273438,0.03125) [64,42] 21=(0.03125,0.0351563) [64,54] id=2 2=(0,0.00012207) [49,1] 58=(0.00012207,0.000244141) [49,47,37] 48=(0.000244141,0.000366211) [47,27] 56=(0.000366211,0.000427246) [45,27] 66=(0.000427246,0.000488281) [35,45] 42=(0.000488281,0.000549316) [43,35] 64=(0.000549316,0.000610352) [21,43] 54=(0.000610352,0.000671387) [21]
497setPerp t=0 cPt=(27.3431454,27.3431454) == oppT=0 fPerpPt=(27.3431454,27.3431454)
498setPerp t=0.00390625 cPt=(27.3434922,27.3427985) == oppT=7.40178961e-05 fPerpPt=(27.3434922,27.3427985)
499setPerp t=0.0078125 cPt=(27.3438391,27.3424517) == oppT=0.000148035857 fPerpPt=(27.3438391,27.3424517)
500setPerp t=0.01171875 cPt=(27.344186,27.3421049) == oppT=0.000222053882 fPerpPt=(27.344186,27.3421049)
501setPerp t=0.015625 cPt=(27.3445329,27.3417581) == oppT=0.000296071971 fPerpPt=(27.3445329,27.3417581)
502setPerp t=0.01953125 cPt=(27.3448799,27.3414113) == oppT=0.000370090126 fPerpPt=(27.3448799,27.3414113)
503setPerp t=0.0234375 cPt=(27.3452268,27.3410646) == oppT=0.000444108344 fPerpPt=(27.3452268,27.3410646)
504setPerp t=0.02734375 cPt=(27.3455737,27.3407179) == oppT=0.000518126627 fPerpPt=(27.3455737,27.3407179)
505setPerp t=0.03125 cPt=(27.3459207,27.3403712) == oppT=0.000592144975 fPerpPt=(27.3459207,27.3403712)
506setPerp t=0.03515625 cPt=(27.3462676,27.3400246) == oppT=0.000666163387 fPerpPt=(27.3462676,27.3400246)
507setPerp t=0 cPt=(27.3431454,27.3431454) == oppT=0 fPerpPt=(27.3431454,27.3431454)
508setPerp t=0.03515625 cPt=(27.3462676,27.3400246) == oppT=0.000666163387 fPerpPt=(27.3462676,27.3400246)
509id=1 (empty) id=2 (empty)
510debugShowQuadIntersection wtTs[0]=0 {{{27.3431454,27.3431454}, {27.3875446,27.2987461}, {27.4323025,27.2551785}}} {{27.3431454,27.3431454}} wtTs[1]=0.03515625 {{27.3462677,27.3400249}} wnTs[0]=0 {{{27.3431454,27.3431454}, {29.6862907,25}, {33,25}}} wnTs[1]=0.000666163387
511SkOpSegment::addT insert t=0.03515625 segID=20 spanID=49
512SkOpSegment::addT insert t=0.000666163387 segID=6 spanID=50
513id=1 1=(0,1) [2] id=2 2=(0,0.5) [1]
514id=1 1=(0,1) [2] id=2 2=(0,0.25) [1]
515id=1 1=(0,1) [2] id=2 2=(0,0.125) [1]
516id=1 1=(0,1) [2] id=2 2=(0,0.0625) [1]
517id=1 1=(0,1) [12,2] id=2 2=(0,0.03125) [1] 12=(0.03125,0.0625) [1]
518id=1 1=(0,1) [12,2] id=2 2=(0,0.03125) [1] 12=(0.03125,0.046875) [1]
519id=1 1=(0,1) [16,12] id=2 16=(0.015625,0.03125) [1] 12=(0.03125,0.046875) [1]
520id=1 1=(0,0.5) [16] 3=(0.5,1) [16] id=2 16=(0.015625,0.03125) [3,1]
521id=1 1=(0,0.5) [18,16] id=2 16=(0.015625,0.0234375) [1] 18=(0.0234375,0.03125) [1]
522id=1 1=(0,0.25) [16] id=2 16=(0.015625,0.0234375) [1]
523id=1 1=(0,0.25) [20,16] id=2 16=(0.015625,0.0195313) [1] 20=(0.0195313,0.0234375) [1]
524id=1 1=(0,0.125) [20,16] id=2 16=(0.015625,0.0195313) [1] 20=(0.0195313,0.0234375) [1]
525setPerp t=0 cPt=(27.4323025,27.2551785) == oppT=0.0189506973 fPerpPt=(27.4323024,27.2551784)
526setPerp t=0.125 cPt=(27.4431369,27.243922) != oppT=0.0213231007 fPerpPt=(27.4435129,27.2442845)
527setPerp t=0.01953125 cPt=(27.4350447,27.2525101) != oppT=0.0306377854 fPerpPt=(27.4349556,27.2524185)
528id=1 1=(0,0.125) [16] id=2 16=(0.015625,0.0195313) [1]
529id=1 (empty) id=2 (empty)
530debugShowQuadIntersection no intersect {{{27.4323025,27.2551785}, {27.4755878,27.2101307}, {27.5197105,27.165432}}} {{{27.3431454,27.3431454}, {29.6862907,25}, {33,25}}}
531debugShowQuadIntersection no intersect {{{27.5197105,27.165432}, {27.541851,27.1430035}, {27.5638676,27.1209965}}} {{{27.3431454,27.3431454}, {29.6862907,25}, {33,25}}}
532id=1 (empty) id=2 (empty)
533debugShowQuadIntersection no intersect {{{27.5638676,27.1209965}, {27.5855064,27.0986347}, {27.6075668,27.0761414}}} {{{27.3431454,27.3431454}, {29.6862907,25}, {33,25}}}
534id=1 1=(0,1) [4,2] id=2 2=(0,0.5) [1] 4=(0.5,1) [1]
535id=1 1=(0,0.5) [2] 3=(0.5,1) [4] id=2 2=(0,0.5) [1] 4=(0.5,1) [3]
536id=1 1=(0,0.5) [2] id=2 2=(0,0.5) [1]
537id=1 1=(0,0.5) [8,2] id=2 2=(0,0.25) [1] 8=(0.25,0.5) [1]
538id=1 1=(0,0.25) [2] id=2 2=(0,0.25) [1]
539id=1 1=(0,0.25) [10,2] id=2 2=(0,0.125) [1] 10=(0.125,0.25) [1]
540id=1 (empty) id=2 (empty)
541debugShowQuadIntersection no intersect {{{27.6075668,27.0761414}, {29.9278316,24.7103367}, {33.2413864,24.6781349}}} {{{27.3431454,27.3431454}, {29.6862907,25}, {33,25}}}
542debugShowQuadIntersection no intersect {{{27.6075668,27.0761414}, {29.9278316,24.7103367}, {33.2413864,24.6781349}}} {{{33,25}, {36.3137093,25}, {38.6568527,27.3431454}}}
543debugShowQuadIntersection wtTs[0]=1 {{{41,33}, {41,36.3137093}, {38.6568527,38.6568527}}} {{38.6568527,38.6568527}} wnTs[0]=0 {{{38.6568527,38.6568527}, {36.3137093,41}, {33,41}}}
544debugShowQuadIntersection wtTs[0]=0 {{{41,33}, {41,36.3137093}, {38.6568527,38.6568527}}} {{41,33}} wnTs[0]=1 {{{38.6568527,27.3431454}, {41,29.6862907}, {41,33}}}
545debugShowQuadIntersection wtTs[0]=1 {{{38.6568527,38.6568527}, {36.3137093,41}, {33,41}}} {{33,41}} wnTs[0]=0 {{{33,41}, {29.6862907,41}, {27.3431454,38.6568527}}}
546debugShowQuadIntersection wtTs[0]=1 {{{33,41}, {29.6862907,41}, {27.3431454,38.6568527}}} {{27.3431454,38.6568527}} wnTs[0]=0 {{{27.3431454,38.6568527}, {25,36.3137093}, {25,33}}}
547debugShowQuadIntersection wtTs[0]=1 {{{27.3431454,38.6568527}, {25,36.3137093}, {25,33}}} {{25,33}} wnTs[0]=0 {{{25,33}, {25,29.6862907}, {27.3431454,27.3431454}}}
548debugShowQuadIntersection wtTs[0]=1 {{{25,33}, {25,29.6862907}, {27.3431454,27.3431454}}} {{27.3431454,27.3431454}} wnTs[0]=0 {{{27.3431454,27.3431454}, {29.6862907,25}, {33,25}}}
549debugShowQuadIntersection wtTs[0]=1 {{{27.3431454,27.3431454}, {29.6862907,25}, {33,25}}} {{33,25}} wnTs[0]=0 {{{33,25}, {36.3137093,25}, {38.6568527,27.3431454}}}
550debugShowQuadIntersection wtTs[0]=1 {{{33,25}, {36.3137093,25}, {38.6568527,27.3431454}}} {{38.6568527,27.3431454}} wnTs[0]=0 {{{38.6568527,27.3431454}, {41,29.6862907}, {41,33}}}
551SkOpSegment::markDone id=6 (27.3431454,27.3431454 29.6862907,25 33,25) t=0 [11] (27.3431454,27.3431454) tEnd=0.000666163387 newWindSum=? newOppSum=? oppSum=? windSum=? windValue=0 oppValue=0
552SkOpSegment::markDone id=5 (25,33 25,29.6862907 27.3431454,27.3431454) t=0 [9] (25,33) tEnd=1 newWindSum=? newOppSum=? oppSum=? windSum=? windValue=0 oppValue=0
553SkOpSegment::markDone id=4 (27.3431454,38.6568527 25,36.3137093 25,33) t=0 [7] (27.3431454,38.6568527) tEnd=1 newWindSum=? newOppSum=? oppSum=? windSum=? windValue=0 oppValue=0
554SkOpSegment::markDone id=3 (33,41 29.6862907,41 27.3431454,38.6568527) t=0 [5] (33,41) tEnd=1 newWindSum=? newOppSum=? oppSum=? windSum=? windValue=0 oppValue=0
555SkOpSegment::markDone id=2 (38.6568527,38.6568527 36.3137093,41 33,41) t=0 [3] (38.6568527,38.6568527) tEnd=1 newWindSum=? newOppSum=? oppSum=? windSum=? windValue=0 oppValue=0
556SkOpSegment::sortAngles [15] tStart=1 [30]
557SkOpAngle::after [15/1] 4/5 tStart=1 tEnd=0 < [16/2] 21/17 tStart=0 tEnd=1 < [1/13] 1/5 tStart=1 tEnd=0 T 5
558SkOpAngle::afterPart {{{38.6568527,38.6568527}, {38.7196693,38.5940361}, {38.7809143,38.5304031}}} id=15
559SkOpAngle::afterPart {{{38.6568527,38.6568527}, {36.3137093,41}, {33,41}}} id=16
560SkOpAngle::afterPart {{{38.6568527,38.6568527}, {41,36.3137093}, {41,33}}} id=1
561SkOpSegment::sortAngles [16] tStart=0 [31]
562SkOpSegment::sortAngles [16] tStart=1 [32]
563SkOpSegment::sortAngles [17] tStart=0 [33]
564SkOpSegment::sortAngles [17] tStart=1 [34]
565SkOpSegment::sortAngles [18] tStart=0 [35]
566SkOpSegment::sortAngles [18] tStart=1 [36]
567SkOpSegment::sortAngles [19] tStart=0 [37]
568SkOpSegment::sortAngles [19] tStart=1 [38]
569SkOpSegment::sortAngles [20] tStart=0 [39]
570SkOpSegment::sortAngles [20] tStart=0.03515625 [49]
571SkOpAngle::after [20/11] 17/17 tStart=0.03515625 tEnd=0 < [6/14] 1/1 tStart=0.000666163387 tEnd=1 < [20/12] 1/1 tStart=0.03515625 tEnd=1 F 11
572SkOpAngle::afterPart {{{27.3462677,27.3400249}, {27.3447063,27.3415846}, {27.3431454,27.3431454}}} id=20
573SkOpAngle::afterPart {{{27.3462677,27.3400249}, {29.6884986,25}, {33,25}}} id=6
574SkOpAngle::afterPart {{{27.3462677,27.3400249}, {27.3891352,27.2971979}, {27.4323025,27.2551785}}} id=20
575SkOpSegment::sortAngles [1] tStart=1 [2]
576SkOpSegment::sortAngles [6] tStart=0.000666163387 [50]
577SkOpCoincidence::debugShowCoincidence - id=20 t=0 tEnd=0.03515625
578SkOpCoincidence::debugShowCoincidence + id=6 t=0 tEnd=0.000666163387
579SkOpCoincidence::debugShowCoincidence - id=19 t=0 tEnd=1
580SkOpCoincidence::debugShowCoincidence + id=5 t=0 tEnd=1
581SkOpCoincidence::debugShowCoincidence - id=18 t=0 tEnd=1
582SkOpCoincidence::debugShowCoincidence + id=4 t=0 tEnd=1
583SkOpCoincidence::debugShowCoincidence - id=17 t=0 tEnd=1
584SkOpCoincidence::debugShowCoincidence + id=3 t=0 tEnd=1
585SkOpCoincidence::debugShowCoincidence - id=16 t=0 tEnd=1
586SkOpCoincidence::debugShowCoincidence + id=2 t=0 tEnd=1
587SkOpSegment::debugShowActiveSpans id=9 (33.2413864,24.6781349 36.5549393,24.6459332 38.920742,26.966198) t=0 (33.2413864,24.6781349) tEnd=1 windSum=? windValue=1
588SkOpSegment::debugShowActiveSpans id=10 (38.920742,26.966198 41.2865486,29.2864628 41.3187523,32.6000175) t=0 (38.920742,26.966198) tEnd=1 windSum=? windValue=1
589SkOpSegment::debugShowActiveSpans id=11 (41.3187523,32.6000175 41.3509521,35.9135704 39.0306854,38.2793732) t=0 (41.3187523,32.6000175) tEnd=1 windSum=? windValue=1
590SkOpSegment::debugShowActiveSpans id=12 (39.0306854,38.2793732 38.9995995,38.3110695 38.9681816,38.3424988) t=0 (39.0306854,38.2793732) tEnd=1 windSum=? windValue=1
591SkOpSegment::debugShowActiveSpans id=13 (38.9681816,38.3424988 38.9374619,38.3742142 38.9064751,38.4056053) t=0 (38.9681816,38.3424988) tEnd=1 windSum=? windValue=1
592SkOpSegment::debugShowActiveSpans id=14 (38.9064751,38.4056053 38.8441086,38.4687881 38.7809143,38.5304031) t=0 (38.9064751,38.4056053) tEnd=1 windSum=? windValue=1
593SkOpSegment::debugShowActiveSpans id=15 (38.7809143,38.5304031 38.7196693,38.5940361 38.6568527,38.6568527) t=0 (38.7809143,38.5304031) tEnd=1 windSum=? windValue=1
594SkOpSegment::debugShowActiveSpans id=16 (38.6568527,38.6568527 36.3137093,41 33,41) t=0 (38.6568527,38.6568527) tEnd=1 windSum=? windValue=2
595SkOpSegment::debugShowActiveSpans id=17 (33,41 29.6862907,41 27.3431454,38.6568527) t=0 (33,41) tEnd=1 windSum=? windValue=2
596SkOpSegment::debugShowActiveSpans id=18 (27.3431454,38.6568527 25,36.3137093 25,33) t=0 (27.3431454,38.6568527) tEnd=1 windSum=? windValue=2
597SkOpSegment::debugShowActiveSpans id=19 (25,33 25,29.6862907 27.3431454,27.3431454) t=0 (25,33) tEnd=1 windSum=? windValue=2
598SkOpSegment::debugShowActiveSpans id=20 (27.3431454,27.3431454 27.3875446,27.2987461 27.4323025,27.2551785) t=0 (27.3431454,27.3431454) tEnd=0.03515625 windSum=? windValue=2
599SkOpSegment::debugShowActiveSpans id=20 (27.3431454,27.3431454 27.3875446,27.2987461 27.4323025,27.2551785) t=0.03515625 (27.3462677,27.3400249) tEnd=1 windSum=? windValue=1
600SkOpSegment::debugShowActiveSpans id=21 (27.4323025,27.2551785 27.4755878,27.2101307 27.5197105,27.165432) t=0 (27.4323025,27.2551785) tEnd=1 windSum=? windValue=1
601SkOpSegment::debugShowActiveSpans id=22 (27.5197105,27.165432 27.541851,27.1430035 27.5638676,27.1209965) t=0 (27.5197105,27.165432) tEnd=1 windSum=? windValue=1
602SkOpSegment::debugShowActiveSpans id=23 (27.5638676,27.1209965 27.5855064,27.0986347 27.6075668,27.0761414) t=0 (27.5638676,27.1209965) tEnd=1 windSum=? windValue=1
603SkOpSegment::debugShowActiveSpans id=24 (27.6075668,27.0761414 29.9278316,24.7103367 33.2413864,24.6781349) t=0 (27.6075668,27.0761414) tEnd=1 windSum=? windValue=1
604SkOpSegment::debugShowActiveSpans id=1 (41,33 41,36.3137093 38.6568527,38.6568527) t=0 (41,33) tEnd=1 windSum=? windValue=1
605SkOpSegment::debugShowActiveSpans id=6 (27.3431454,27.3431454 29.6862907,25 33,25) t=0.000666163387 (27.3462677,27.3400249) tEnd=1 windSum=? windValue=1
606SkOpSegment::debugShowActiveSpans id=7 (33,25 36.3137093,25 38.6568527,27.3431454) t=0 (33,25) tEnd=1 windSum=? windValue=1
607SkOpSegment::debugShowActiveSpans id=8 (38.6568527,27.3431454 41,29.6862907 41,33) t=0 (38.6568527,27.3431454) tEnd=1 windSum=? windValue=1
608SkOpSpan::sortableTop dir=kTop seg=9 t=0.5 pt=(36.3180008,25.2340508)
609SkOpSpan::sortableTop [0] valid=1 operand=0 span=17 ccw=1 seg=9 {{{33.2413864f, 24.6781349f}, {36.5549393f, 24.6459332f}, {38.920742f, 26.966198f}}} t=0.5 pt=(36.3180008,25.2340508) slope=(2.83967781,1.14403152)
610SkOpSegment::markWinding id=9 (33.2413864,24.6781349 36.5549393,24.6459332 38.920742,26.966198) t=0 [17] (33.2413864,24.6781349) tEnd=1 newWindSum=-1 newOppSum=0 oppSum=0 windSum=-1 windValue=1 oppValue=0
611SkOpSegment::markWinding id=10 (38.920742,26.966198 41.2865486,29.2864628 41.3187523,32.6000175) t=0 [19] (38.920742,26.966198) tEnd=1 newWindSum=-1 newOppSum=0 oppSum=? windSum=? windValue=1 oppValue=0
612SkOpSegment::markWinding id=11 (41.3187523,32.6000175 41.3509521,35.9135704 39.0306854,38.2793732) t=0 [21] (41.3187523,32.6000175) tEnd=1 newWindSum=-1 newOppSum=0 oppSum=? windSum=? windValue=1 oppValue=0
613SkOpSegment::markWinding id=12 (39.0306854,38.2793732 38.9995995,38.3110695 38.9681816,38.3424988) t=0 [23] (39.0306854,38.2793732) tEnd=1 newWindSum=-1 newOppSum=0 oppSum=? windSum=? windValue=1 oppValue=0
614SkOpSegment::markWinding id=13 (38.9681816,38.3424988 38.9374619,38.3742142 38.9064751,38.4056053) t=0 [25] (38.9681816,38.3424988) tEnd=1 newWindSum=-1 newOppSum=0 oppSum=? windSum=? windValue=1 oppValue=0
615SkOpSegment::markWinding id=14 (38.9064751,38.4056053 38.8441086,38.4687881 38.7809143,38.5304031) t=0 [27] (38.9064751,38.4056053) tEnd=1 newWindSum=-1 newOppSum=0 oppSum=? windSum=? windValue=1 oppValue=0
616SkOpSegment::markWinding id=15 (38.7809143,38.5304031 38.7196693,38.5940361 38.6568527,38.6568527) t=0 [29] (38.7809143,38.5304031) tEnd=1 newWindSum=-1 newOppSum=0 oppSum=? windSum=? windValue=1 oppValue=0
617SkOpSegment::markWinding id=9 (33.2413864,24.6781349 36.5549393,24.6459332 38.920742,26.966198) t=0 [17] (33.2413864,24.6781349) tEnd=1 newWindSum=-1 newOppSum=0 oppSum=0 windSum=-1 windValue=1 oppValue=0
618SkOpSegment::markWinding id=24 (27.6075668,27.0761414 29.9278316,24.7103367 33.2413864,24.6781349) t=0 [47] (27.6075668,27.0761414) tEnd=1 newWindSum=-1 newOppSum=0 oppSum=? windSum=? windValue=1 oppValue=0
619SkOpSegment::markWinding id=23 (27.5638676,27.1209965 27.5855064,27.0986347 27.6075668,27.0761414) t=0 [45] (27.5638676,27.1209965) tEnd=1 newWindSum=-1 newOppSum=0 oppSum=? windSum=? windValue=1 oppValue=0
620SkOpSegment::markWinding id=22 (27.5197105,27.165432 27.541851,27.1430035 27.5638676,27.1209965) t=0 [43] (27.5197105,27.165432) tEnd=1 newWindSum=-1 newOppSum=0 oppSum=? windSum=? windValue=1 oppValue=0
621SkOpSegment::markWinding id=21 (27.4323025,27.2551785 27.4755878,27.2101307 27.5197105,27.165432) t=0 [41] (27.4323025,27.2551785) tEnd=1 newWindSum=-1 newOppSum=0 oppSum=? windSum=? windValue=1 oppValue=0
622SkOpSegment::markWinding id=20 (27.3431454,27.3431454 27.3875446,27.2987461 27.4323025,27.2551785) t=0.03515625 [49] (27.3462677,27.3400249) tEnd=1 newWindSum=-1 newOppSum=0 oppSum=? windSum=? windValue=1 oppValue=0
623SkOpSegment::findNextWinding simple
624SkOpSegment::markDone id=9 (33.2413864,24.6781349 36.5549393,24.6459332 38.920742,26.966198) t=0 [17] (33.2413864,24.6781349) tEnd=1 newWindSum=-1 newOppSum=0 oppSum=0 windSum=-1 windValue=1 oppValue=0
625bridgeWinding current id=9 from=(38.920742,26.966198) to=(33.2413864,24.6781349)
626path.moveTo(38.920742,26.966198);
627path.quadTo(36.5549393,24.6459332, 33.2413864,24.6781349);
628SkOpSegment::findNextWinding simple
629SkOpSegment::markDone id=24 (27.6075668,27.0761414 29.9278316,24.7103367 33.2413864,24.6781349) t=0 [47] (27.6075668,27.0761414) tEnd=1 newWindSum=-1 newOppSum=0 oppSum=0 windSum=-1 windValue=1 oppValue=0
630bridgeWinding current id=24 from=(33.2413864,24.6781349) to=(27.6075668,27.0761414)
631path.quadTo(29.9278316,24.7103367, 27.6075668,27.0761414);
632SkOpSegment::findNextWinding simple
633SkOpSegment::markDone id=23 (27.5638676,27.1209965 27.5855064,27.0986347 27.6075668,27.0761414) t=0 [45] (27.5638676,27.1209965) tEnd=1 newWindSum=-1 newOppSum=0 oppSum=0 windSum=-1 windValue=1 oppValue=0
634bridgeWinding current id=23 from=(27.6075668,27.0761414) to=(27.5638676,27.1209965)
635path.quadTo(27.5855064,27.0986347, 27.5638676,27.1209965);
636SkOpSegment::findNextWinding simple
637SkOpSegment::markDone id=22 (27.5197105,27.165432 27.541851,27.1430035 27.5638676,27.1209965) t=0 [43] (27.5197105,27.165432) tEnd=1 newWindSum=-1 newOppSum=0 oppSum=0 windSum=-1 windValue=1 oppValue=0
638bridgeWinding current id=22 from=(27.5638676,27.1209965) to=(27.5197105,27.165432)
639path.quadTo(27.541851,27.1430035, 27.5197105,27.165432);
640SkOpSegment::findNextWinding simple
641SkOpSegment::markDone id=21 (27.4323025,27.2551785 27.4755878,27.2101307 27.5197105,27.165432) t=0 [41] (27.4323025,27.2551785) tEnd=1 newWindSum=-1 newOppSum=0 oppSum=0 windSum=-1 windValue=1 oppValue=0
642bridgeWinding current id=21 from=(27.5197105,27.165432) to=(27.4323025,27.2551785)
643path.quadTo(27.4755878,27.2101307, 27.4323025,27.2551785);
644SkOpSegment::markWinding id=6 (27.3431454,27.3431454 29.6862907,25 33,25) t=0.000666163387 [50] (27.3462677,27.3400249) tEnd=1 newWindSum=1 windSum=? windValue=1
645SkOpSegment::markWinding id=7 (33,25 36.3137093,25 38.6568527,27.3431454) t=0 [13] (33,25) tEnd=1 newWindSum=1 windSum=? windValue=1
646SkOpSegment::markWinding id=8 (38.6568527,27.3431454 41,29.6862907 41,33) t=0 [15] (38.6568527,27.3431454) tEnd=1 newWindSum=1 windSum=? windValue=1
647SkOpSegment::markWinding id=1 (41,33 41,36.3137093 38.6568527,38.6568527) t=0 [1] (41,33) tEnd=1 newWindSum=1 windSum=? windValue=1
648SkOpSegment::markAngle last seg=1 span=2
649SkOpSegment::markWinding id=20 (27.3431454,27.3431454 27.3875446,27.2987461 27.4323025,27.2551785) t=0 [39] (27.3431454,27.3431454) tEnd=0.03515625 newWindSum=1 windSum=? windValue=2
650SkOpSegment::nextChase mismatched signs
651SkOpSegment::markWinding id=19 (25,33 25,29.6862907 27.3431454,27.3431454) t=0 [37] (25,33) tEnd=1 newWindSum=1 windSum=? windValue=2
652SkOpSegment::nextChase mismatched signs
653SkOpSegment::markWinding id=18 (27.3431454,38.6568527 25,36.3137093 25,33) t=0 [35] (27.3431454,38.6568527) tEnd=1 newWindSum=1 windSum=? windValue=2
654SkOpSegment::nextChase mismatched signs
655SkOpSegment::markWinding id=17 (33,41 29.6862907,41 27.3431454,38.6568527) t=0 [33] (33,41) tEnd=1 newWindSum=1 windSum=? windValue=2
656SkOpSegment::nextChase mismatched signs
657SkOpSegment::markWinding id=16 (38.6568527,38.6568527 36.3137093,41 33,41) t=0 [31] (38.6568527,38.6568527) tEnd=1 newWindSum=1 windSum=? windValue=2
658SkOpSegment::markAngle last seg=16 span=31 windSum=1
659SkOpSegment::findNextWinding
660SkOpAngle::dumpOne [20/12] next=6/14 sect=1/1 s=0.03515625 [49] e=1 [40] sgn=-1 windVal=1 windSum=-1 oppVal=0 oppSum=0
661SkOpAngle::dumpOne [6/14] next=20/11 sect=1/1 s=0.000666163387 [50] e=1 [12] sgn=-1 windVal=1 windSum=1
662SkOpAngle::dumpOne [20/11] next=20/12 sect=17/17 s=0.03515625 [49] e=0 [39] sgn=1 windVal=2 windSum=1
663SkOpSegment::findNextWinding chase.append segment=1 span=2
664SkOpSegment::markDone id=20 (27.3431454,27.3431454 27.3875446,27.2987461 27.4323025,27.2551785) t=0 [39] (27.3431454,27.3431454) tEnd=0.03515625 newWindSum=1 newOppSum=? oppSum=? windSum=1 windValue=2 oppValue=0
665SkOpSegment::nextChase mismatched signs
666SkOpSegment::markDone id=19 (25,33 25,29.6862907 27.3431454,27.3431454) t=0 [37] (25,33) tEnd=1 newWindSum=1 newOppSum=? oppSum=? windSum=1 windValue=2 oppValue=0
667SkOpSegment::nextChase mismatched signs
668SkOpSegment::markDone id=18 (27.3431454,38.6568527 25,36.3137093 25,33) t=0 [35] (27.3431454,38.6568527) tEnd=1 newWindSum=1 newOppSum=? oppSum=? windSum=1 windValue=2 oppValue=0
669SkOpSegment::nextChase mismatched signs
670SkOpSegment::markDone id=17 (33,41 29.6862907,41 27.3431454,38.6568527) t=0 [33] (33,41) tEnd=1 newWindSum=1 newOppSum=? oppSum=? windSum=1 windValue=2 oppValue=0
671SkOpSegment::nextChase mismatched signs
672SkOpSegment::markDone id=16 (38.6568527,38.6568527 36.3137093,41 33,41) t=0 [31] (38.6568527,38.6568527) tEnd=1 newWindSum=1 newOppSum=? oppSum=? windSum=1 windValue=2 oppValue=0
673SkOpSegment::findNextWinding chase.append segment=16 span=31 windSum=1
674SkOpSegment::markDone id=20 (27.3431454,27.3431454 27.3875446,27.2987461 27.4323025,27.2551785) t=0.03515625 [49] (27.3462677,27.3400249) tEnd=1 newWindSum=-1 newOppSum=0 oppSum=0 windSum=-1 windValue=1 oppValue=0
675SkOpSegment::findNextWinding from:[20] to:[6] start=5584652 end=5579668
676bridgeWinding current id=20 from=(27.4323025,27.2551785) to=(27.3462677,27.3400249)
677path.quadTo(27.3891354,27.2971973, 27.3462677,27.3400249);
678SkOpSegment::findNextWinding simple
679SkOpSegment::markDone id=6 (27.3431454,27.3431454 29.6862907,25 33,25) t=0.000666163387 [50] (27.3462677,27.3400249) tEnd=1 newWindSum=1 newOppSum=? oppSum=? windSum=1 windValue=1 oppValue=0
680bridgeWinding current id=6 from=(27.3462677,27.3400249) to=(33,25)
681path.quadTo(29.6884995,25, 33,25);
682SkOpSegment::findNextWinding simple
683SkOpSegment::markDone id=7 (33,25 36.3137093,25 38.6568527,27.3431454) t=0 [13] (33,25) tEnd=1 newWindSum=1 newOppSum=? oppSum=? windSum=1 windValue=1 oppValue=0
684bridgeWinding current id=7 from=(33,25) to=(38.6568527,27.3431454)
685path.quadTo(36.3137093,25, 38.6568527,27.3431454);
686SkOpSegment::findNextWinding simple
687SkOpSegment::markDone id=8 (38.6568527,27.3431454 41,29.6862907 41,33) t=0 [15] (38.6568527,27.3431454) tEnd=1 newWindSum=1 newOppSum=? oppSum=? windSum=1 windValue=1 oppValue=0
688bridgeWinding current id=8 from=(38.6568527,27.3431454) to=(41,33)
689path.quadTo(41,29.6862907, 41,33);
690SkOpSegment::findNextWinding
691SkOpAngle::dumpOne [1/13] next=15/1 sect=1/5 s=1 [2] e=0 [1] sgn=1 windVal=1 windSum=1
692SkOpAngle::dumpOne [15/1] next=16/2 sect=4/5 s=1 [30] e=0 [29] sgn=1 windVal=1 windSum=-1 oppVal=0 oppSum=0
693SkOpAngle::dumpOne [16/2] next=1/13 sect=21/17 s=0 [31] e=1 [32] sgn=-1 windVal=2 windSum=1 done
694SkOpSegment::markDone id=1 (41,33 41,36.3137093 38.6568527,38.6568527) t=0 [1] (41,33) tEnd=1 newWindSum=1 newOppSum=? oppSum=? windSum=1 windValue=1 oppValue=0
695SkOpSegment::findNextWinding from:[1] to:[15] start=5581892 end=5581788
696bridgeWinding current id=1 from=(41,33) to=(38.6568527,38.6568527)
697path.quadTo(41,36.3137093, 38.6568527,38.6568527);
698SkOpSegment::findNextWinding simple
699SkOpSegment::markDone id=15 (38.7809143,38.5304031 38.7196693,38.5940361 38.6568527,38.6568527) t=0 [29] (38.7809143,38.5304031) tEnd=1 newWindSum=-1 newOppSum=0 oppSum=0 windSum=-1 windValue=1 oppValue=0
700bridgeWinding current id=15 from=(38.6568527,38.6568527) to=(38.7809143,38.5304031)
701path.quadTo(38.7196693,38.5940361, 38.7809143,38.5304031);
702SkOpSegment::findNextWinding simple
703SkOpSegment::markDone id=14 (38.9064751,38.4056053 38.8441086,38.4687881 38.7809143,38.5304031) t=0 [27] (38.9064751,38.4056053) tEnd=1 newWindSum=-1 newOppSum=0 oppSum=0 windSum=-1 windValue=1 oppValue=0
704bridgeWinding current id=14 from=(38.7809143,38.5304031) to=(38.9064751,38.4056053)
705path.quadTo(38.8441086,38.4687881, 38.9064751,38.4056053);
706SkOpSegment::findNextWinding simple
707SkOpSegment::markDone id=13 (38.9681816,38.3424988 38.9374619,38.3742142 38.9064751,38.4056053) t=0 [25] (38.9681816,38.3424988) tEnd=1 newWindSum=-1 newOppSum=0 oppSum=0 windSum=-1 windValue=1 oppValue=0
708bridgeWinding current id=13 from=(38.9064751,38.4056053) to=(38.9681816,38.3424988)
709path.quadTo(38.9374619,38.3742142, 38.9681816,38.3424988);
710SkOpSegment::findNextWinding simple
711SkOpSegment::markDone id=12 (39.0306854,38.2793732 38.9995995,38.3110695 38.9681816,38.3424988) t=0 [23] (39.0306854,38.2793732) tEnd=1 newWindSum=-1 newOppSum=0 oppSum=0 windSum=-1 windValue=1 oppValue=0
712bridgeWinding current id=12 from=(38.9681816,38.3424988) to=(39.0306854,38.2793732)
713path.quadTo(38.9995995,38.3110695, 39.0306854,38.2793732);
714SkOpSegment::findNextWinding simple
715SkOpSegment::markDone id=11 (41.3187523,32.6000175 41.3509521,35.9135704 39.0306854,38.2793732) t=0 [21] (41.3187523,32.6000175) tEnd=1 newWindSum=-1 newOppSum=0 oppSum=0 windSum=-1 windValue=1 oppValue=0
716bridgeWinding current id=11 from=(39.0306854,38.2793732) to=(41.3187523,32.6000175)
717path.quadTo(41.3509521,35.9135704, 41.3187523,32.6000175);
718SkOpSegment::findNextWinding simple
719SkOpSegment::markDone id=10 (38.920742,26.966198 41.2865486,29.2864628 41.3187523,32.6000175) t=0 [19] (38.920742,26.966198) tEnd=1 newWindSum=-1 newOppSum=0 oppSum=0 windSum=-1 windValue=1 oppValue=0
720bridgeWinding current id=10 from=(41.3187523,32.6000175) to=(38.920742,26.966198)
721path.quadTo(41.2865486,29.2864628, 38.920742,26.966198);
722path.close();
723</div>
724
725<div id="fuzz763_4713parts">
726seg=1 {{{-33.1326447f, -40.8928833f}, {-29.8189526f, -40.9036179f}, {-27.4682293f, -38.5680733f}}}
727seg=2 {{{-27.4682293f, -38.5680733f}, {-25.117506f, -36.2325325f}, {-25.1067715f, -32.9188423f}}}
728seg=3 {{{-25.1067715f, -32.9188423f}, {-25.0960369f, -29.6051483f}, {-27.4315796f, -27.254425f}}}
729seg=4 {{{-27.4315796f, -27.254425f}, {-29.7671204f, -24.9036999f}, {-33.0808144f, -24.8929653f}}}
730seg=5 {{{-33.0808144f, -24.8929653f}, {-36.3945045f, -24.8822308f}, {-38.7452278f, -27.2177753f}}}
731seg=6 {{{-38.7452278f, -27.2177753f}, {-41.0959549f, -29.5533161f}, {-41.1066895f, -32.867012f}}}
732seg=7 {{{-41.1066895f, -32.867012f}, {-41.117424f, -36.1807022f}, {-38.7818794f, -38.5314217f}}}
733seg=8 {{{-38.7818794f, -38.5314217f}, {-36.4463348f, -40.8821487f}, {-33.1326447f, -40.8928833f}}}
734op union
735seg=9 {{{41, 33}, {41, 36.3137093f}, {38.6568527f, 38.6568527f}}}
736seg=10 {{{38.6568527f, 38.6568527f}, {36.3137093f, 41}, {33, 41}}}
737seg=11 {{{33, 41}, {29.6862907f, 41}, {27.3431454f, 38.6568527f}}}
738seg=12 {{{27.3431454f, 38.6568527f}, {25, 36.3137093f}, {25, 33}}}
739seg=13 {{{25, 33}, {25, 29.6862907f}, {27.3431454f, 27.3431454f}}}
740seg=14 {{{27.3431454f, 27.3431454f}, {29.6862907f, 25}, {33, 25}}}
741seg=15 {{{33, 25}, {36.3137093f, 25}, {38.6568527f, 27.3431454f}}}
742seg=16 {{{38.6568527f, 27.3431454f}, {41, 29.6862907f}, {41, 33}}}
743debugShowQuadIntersection wtTs[0]=1 {{{-33.1326447,-40.8928833}, {-29.8189526,-40.9036179}, {-27.4682293,-38.5680733}}} {{-27.4682293,-38.5680733}} wnTs[0]=0 {{{-27.4682293,-38.5680733}, {-25.117506,-36.2325325}, {-25.1067715,-32.9188423}}}
744debugShowQuadIntersection wtTs[0]=0 {{{-33.1326447,-40.8928833}, {-29.8189526,-40.9036179}, {-27.4682293,-38.5680733}}} {{-33.1326447,-40.8928833}} wnTs[0]=1 {{{-38.7818794,-38.5314217}, {-36.4463348,-40.8821487}, {-33.1326447,-40.8928833}}}
745debugShowQuadIntersection wtTs[0]=1 {{{-27.4682293,-38.5680733}, {-25.117506,-36.2325325}, {-25.1067715,-32.9188423}}} {{-25.1067715,-32.9188423}} wnTs[0]=0 {{{-25.1067715,-32.9188423}, {-25.0960369,-29.6051483}, {-27.4315796,-27.254425}}}
746debugShowQuadIntersection wtTs[0]=1 {{{-25.1067715,-32.9188423}, {-25.0960369,-29.6051483}, {-27.4315796,-27.254425}}} {{-27.4315796,-27.254425}} wnTs[0]=0 {{{-27.4315796,-27.254425}, {-29.7671204,-24.9036999}, {-33.0808144,-24.8929653}}}
747debugShowQuadIntersection wtTs[0]=1 {{{-27.4315796,-27.254425}, {-29.7671204,-24.9036999}, {-33.0808144,-24.8929653}}} {{-33.0808144,-24.8929653}} wnTs[0]=0 {{{-33.0808144,-24.8929653}, {-36.3945045,-24.8822308}, {-38.7452278,-27.2177753}}}
748debugShowQuadIntersection wtTs[0]=1 {{{-33.0808144,-24.8929653}, {-36.3945045,-24.8822308}, {-38.7452278,-27.2177753}}} {{-38.7452278,-27.2177753}} wnTs[0]=0 {{{-38.7452278,-27.2177753}, {-41.0959549,-29.5533161}, {-41.1066895,-32.867012}}}
749debugShowQuadIntersection wtTs[0]=1 {{{-38.7452278,-27.2177753}, {-41.0959549,-29.5533161}, {-41.1066895,-32.867012}}} {{-41.1066895,-32.867012}} wnTs[0]=0 {{{-41.1066895,-32.867012}, {-41.117424,-36.1807022}, {-38.7818794,-38.5314217}}}
750debugShowQuadIntersection wtTs[0]=1 {{{-41.1066895,-32.867012}, {-41.117424,-36.1807022}, {-38.7818794,-38.5314217}}} {{-38.7818794,-38.5314217}} wnTs[0]=0 {{{-38.7818794,-38.5314217}, {-36.4463348,-40.8821487}, {-33.1326447,-40.8928833}}}
751debugShowQuadIntersection wtTs[0]=1 {{{41,33}, {41,36.3137093}, {38.6568527,38.6568527}}} {{38.6568527,38.6568527}} wnTs[0]=0 {{{38.6568527,38.6568527}, {36.3137093,41}, {33,41}}}
752debugShowQuadIntersection wtTs[0]=0 {{{41,33}, {41,36.3137093}, {38.6568527,38.6568527}}} {{41,33}} wnTs[0]=1 {{{38.6568527,27.3431454}, {41,29.6862907}, {41,33}}}
753debugShowQuadIntersection wtTs[0]=1 {{{38.6568527,38.6568527}, {36.3137093,41}, {33,41}}} {{33,41}} wnTs[0]=0 {{{33,41}, {29.6862907,41}, {27.3431454,38.6568527}}}
754debugShowQuadIntersection wtTs[0]=1 {{{33,41}, {29.6862907,41}, {27.3431454,38.6568527}}} {{27.3431454,38.6568527}} wnTs[0]=0 {{{27.3431454,38.6568527}, {25,36.3137093}, {25,33}}}
755debugShowQuadIntersection wtTs[0]=1 {{{27.3431454,38.6568527}, {25,36.3137093}, {25,33}}} {{25,33}} wnTs[0]=0 {{{25,33}, {25,29.6862907}, {27.3431454,27.3431454}}}
756debugShowQuadIntersection wtTs[0]=1 {{{25,33}, {25,29.6862907}, {27.3431454,27.3431454}}} {{27.3431454,27.3431454}} wnTs[0]=0 {{{27.3431454,27.3431454}, {29.6862907,25}, {33,25}}}
757debugShowQuadIntersection wtTs[0]=1 {{{27.3431454,27.3431454}, {29.6862907,25}, {33,25}}} {{33,25}} wnTs[0]=0 {{{33,25}, {36.3137093,25}, {38.6568527,27.3431454}}}
758debugShowQuadIntersection wtTs[0]=1 {{{33,25}, {36.3137093,25}, {38.6568527,27.3431454}}} {{38.6568527,27.3431454}} wnTs[0]=0 {{{38.6568527,27.3431454}, {41,29.6862907}, {41,33}}}
759SkOpSegment::debugShowActiveSpans id=1 (-33.1326447,-40.8928833 -29.8189526,-40.9036179 -27.4682293,-38.5680733) t=0 (-33.1326447,-40.8928833) tEnd=1 windSum=? windValue=1
760SkOpSegment::debugShowActiveSpans id=2 (-27.4682293,-38.5680733 -25.117506,-36.2325325 -25.1067715,-32.9188423) t=0 (-27.4682293,-38.5680733) tEnd=1 windSum=? windValue=1
761SkOpSegment::debugShowActiveSpans id=3 (-25.1067715,-32.9188423 -25.0960369,-29.6051483 -27.4315796,-27.254425) t=0 (-25.1067715,-32.9188423) tEnd=1 windSum=? windValue=1
762SkOpSegment::debugShowActiveSpans id=4 (-27.4315796,-27.254425 -29.7671204,-24.9036999 -33.0808144,-24.8929653) t=0 (-27.4315796,-27.254425) tEnd=1 windSum=? windValue=1
763SkOpSegment::debugShowActiveSpans id=5 (-33.0808144,-24.8929653 -36.3945045,-24.8822308 -38.7452278,-27.2177753) t=0 (-33.0808144,-24.8929653) tEnd=1 windSum=? windValue=1
764SkOpSegment::debugShowActiveSpans id=6 (-38.7452278,-27.2177753 -41.0959549,-29.5533161 -41.1066895,-32.867012) t=0 (-38.7452278,-27.2177753) tEnd=1 windSum=? windValue=1
765SkOpSegment::debugShowActiveSpans id=7 (-41.1066895,-32.867012 -41.117424,-36.1807022 -38.7818794,-38.5314217) t=0 (-41.1066895,-32.867012) tEnd=1 windSum=? windValue=1
766SkOpSegment::debugShowActiveSpans id=8 (-38.7818794,-38.5314217 -36.4463348,-40.8821487 -33.1326447,-40.8928833) t=0 (-38.7818794,-38.5314217) tEnd=1 windSum=? windValue=1
767SkOpSegment::debugShowActiveSpans id=9 (41,33 41,36.3137093 38.6568527,38.6568527) t=0 (41,33) tEnd=1 windSum=? windValue=1
768SkOpSegment::debugShowActiveSpans id=10 (38.6568527,38.6568527 36.3137093,41 33,41) t=0 (38.6568527,38.6568527) tEnd=1 windSum=? windValue=1
769SkOpSegment::debugShowActiveSpans id=11 (33,41 29.6862907,41 27.3431454,38.6568527) t=0 (33,41) tEnd=1 windSum=? windValue=1
770SkOpSegment::debugShowActiveSpans id=12 (27.3431454,38.6568527 25,36.3137093 25,33) t=0 (27.3431454,38.6568527) tEnd=1 windSum=? windValue=1
771SkOpSegment::debugShowActiveSpans id=13 (25,33 25,29.6862907 27.3431454,27.3431454) t=0 (25,33) tEnd=1 windSum=? windValue=1
772SkOpSegment::debugShowActiveSpans id=14 (27.3431454,27.3431454 29.6862907,25 33,25) t=0 (27.3431454,27.3431454) tEnd=1 windSum=? windValue=1
773SkOpSegment::debugShowActiveSpans id=15 (33,25 36.3137093,25 38.6568527,27.3431454) t=0 (33,25) tEnd=1 windSum=? windValue=1
774SkOpSegment::debugShowActiveSpans id=16 (38.6568527,27.3431454 41,29.6862907 41,33) t=0 (38.6568527,27.3431454) tEnd=1 windSum=? windValue=1
775SkOpSpan::sortableTop dir=kTop seg=1 t=0.5 pt=(-30.0596943,-40.3170471)
776SkOpSpan::sortableTop [0] valid=1 operand=0 span=1 ccw=1 seg=1 {{{-33.1326447f, -40.8928833f}, {-29.8189526f, -40.9036179f}, {-27.4682293f, -38.5680733f}}} t=0.5 pt=(-30.0596943,-40.3170471) slope=(2.83220768,1.16240501)
777SkOpSegment::markWinding id=1 (-33.1326447,-40.8928833 -29.8189526,-40.9036179 -27.4682293,-38.5680733) t=0 [1] (-33.1326447,-40.8928833) tEnd=1 newWindSum=-1 newOppSum=0 oppSum=0 windSum=-1 windValue=1 oppValue=0
778SkOpSegment::markWinding id=2 (-27.4682293,-38.5680733 -25.117506,-36.2325325 -25.1067715,-32.9188423) t=0 [3] (-27.4682293,-38.5680733) tEnd=1 newWindSum=-1 newOppSum=0 oppSum=? windSum=? windValue=1 oppValue=0
779SkOpSegment::markWinding id=3 (-25.1067715,-32.9188423 -25.0960369,-29.6051483 -27.4315796,-27.254425) t=0 [5] (-25.1067715,-32.9188423) tEnd=1 newWindSum=-1 newOppSum=0 oppSum=? windSum=? windValue=1 oppValue=0
780SkOpSegment::markWinding id=4 (-27.4315796,-27.254425 -29.7671204,-24.9036999 -33.0808144,-24.8929653) t=0 [7] (-27.4315796,-27.254425) tEnd=1 newWindSum=-1 newOppSum=0 oppSum=? windSum=? windValue=1 oppValue=0
781SkOpSegment::markWinding id=5 (-33.0808144,-24.8929653 -36.3945045,-24.8822308 -38.7452278,-27.2177753) t=0 [9] (-33.0808144,-24.8929653) tEnd=1 newWindSum=-1 newOppSum=0 oppSum=? windSum=? windValue=1 oppValue=0
782SkOpSegment::markWinding id=6 (-38.7452278,-27.2177753 -41.0959549,-29.5533161 -41.1066895,-32.867012) t=0 [11] (-38.7452278,-27.2177753) tEnd=1 newWindSum=-1 newOppSum=0 oppSum=? windSum=? windValue=1 oppValue=0
783SkOpSegment::markWinding id=7 (-41.1066895,-32.867012 -41.117424,-36.1807022 -38.7818794,-38.5314217) t=0 [13] (-41.1066895,-32.867012) tEnd=1 newWindSum=-1 newOppSum=0 oppSum=? windSum=? windValue=1 oppValue=0
784SkOpSegment::markWinding id=8 (-38.7818794,-38.5314217 -36.4463348,-40.8821487 -33.1326447,-40.8928833) t=0 [15] (-38.7818794,-38.5314217) tEnd=1 newWindSum=-1 newOppSum=0 oppSum=? windSum=? windValue=1 oppValue=0
785SkOpSegment::markWinding id=1 (-33.1326447,-40.8928833 -29.8189526,-40.9036179 -27.4682293,-38.5680733) t=0 [1] (-33.1326447,-40.8928833) tEnd=1 newWindSum=-1 newOppSum=0 oppSum=0 windSum=-1 windValue=1 oppValue=0
786SkOpSegment::activeOp id=1 t=1 tEnd=0 op=union miFrom=0 miTo=1 suFrom=0 suTo=0 result=1
787SkOpSegment::findNextOp simple
788SkOpSegment::markDone id=1 (-33.1326447,-40.8928833 -29.8189526,-40.9036179 -27.4682293,-38.5680733) t=0 [1] (-33.1326447,-40.8928833) tEnd=1 newWindSum=-1 newOppSum=0 oppSum=0 windSum=-1 windValue=1 oppValue=0
789bridgeOp current id=1 from=(-27.4682293,-38.5680733) to=(-33.1326447,-40.8928833)
790path.moveTo(-27.4682293,-38.5680733);
791path.quadTo(-29.8189526,-40.9036179, -33.1326447,-40.8928833);
792SkOpSegment::findNextOp simple
793SkOpSegment::markDone id=8 (-38.7818794,-38.5314217 -36.4463348,-40.8821487 -33.1326447,-40.8928833) t=0 [15] (-38.7818794,-38.5314217) tEnd=1 newWindSum=-1 newOppSum=0 oppSum=0 windSum=-1 windValue=1 oppValue=0
794bridgeOp current id=8 from=(-33.1326447,-40.8928833) to=(-38.7818794,-38.5314217)
795path.quadTo(-36.4463348,-40.8821487, -38.7818794,-38.5314217);
796SkOpSegment::findNextOp simple
797SkOpSegment::markDone id=7 (-41.1066895,-32.867012 -41.117424,-36.1807022 -38.7818794,-38.5314217) t=0 [13] (-41.1066895,-32.867012) tEnd=1 newWindSum=-1 newOppSum=0 oppSum=0 windSum=-1 windValue=1 oppValue=0
798bridgeOp current id=7 from=(-38.7818794,-38.5314217) to=(-41.1066895,-32.867012)
799path.quadTo(-41.117424,-36.1807022, -41.1066895,-32.867012);
800SkOpSegment::findNextOp simple
801SkOpSegment::markDone id=6 (-38.7452278,-27.2177753 -41.0959549,-29.5533161 -41.1066895,-32.867012) t=0 [11] (-38.7452278,-27.2177753) tEnd=1 newWindSum=-1 newOppSum=0 oppSum=0 windSum=-1 windValue=1 oppValue=0
802bridgeOp current id=6 from=(-41.1066895,-32.867012) to=(-38.7452278,-27.2177753)
803path.quadTo(-41.0959549,-29.5533161, -38.7452278,-27.2177753);
804SkOpSegment::findNextOp simple
805SkOpSegment::markDone id=5 (-33.0808144,-24.8929653 -36.3945045,-24.8822308 -38.7452278,-27.2177753) t=0 [9] (-33.0808144,-24.8929653) tEnd=1 newWindSum=-1 newOppSum=0 oppSum=0 windSum=-1 windValue=1 oppValue=0
806bridgeOp current id=5 from=(-38.7452278,-27.2177753) to=(-33.0808144,-24.8929653)
807path.quadTo(-36.3945045,-24.8822308, -33.0808144,-24.8929653);
808SkOpSegment::findNextOp simple
809SkOpSegment::markDone id=4 (-27.4315796,-27.254425 -29.7671204,-24.9036999 -33.0808144,-24.8929653) t=0 [7] (-27.4315796,-27.254425) tEnd=1 newWindSum=-1 newOppSum=0 oppSum=0 windSum=-1 windValue=1 oppValue=0
810bridgeOp current id=4 from=(-33.0808144,-24.8929653) to=(-27.4315796,-27.254425)
811path.quadTo(-29.7671204,-24.9036999, -27.4315796,-27.254425);
812SkOpSegment::findNextOp simple
813SkOpSegment::markDone id=3 (-25.1067715,-32.9188423 -25.0960369,-29.6051483 -27.4315796,-27.254425) t=0 [5] (-25.1067715,-32.9188423) tEnd=1 newWindSum=-1 newOppSum=0 oppSum=0 windSum=-1 windValue=1 oppValue=0
814bridgeOp current id=3 from=(-27.4315796,-27.254425) to=(-25.1067715,-32.9188423)
815path.quadTo(-25.0960369,-29.6051483, -25.1067715,-32.9188423);
816SkOpSegment::findNextOp simple
817SkOpSegment::markDone id=2 (-27.4682293,-38.5680733 -25.117506,-36.2325325 -25.1067715,-32.9188423) t=0 [3] (-27.4682293,-38.5680733) tEnd=1 newWindSum=-1 newOppSum=0 oppSum=0 windSum=-1 windValue=1 oppValue=0
818bridgeOp current id=2 from=(-25.1067715,-32.9188423) to=(-27.4682293,-38.5680733)
819path.quadTo(-25.117506,-36.2325325, -27.4682293,-38.5680733);
820path.close();
821SkOpSegment::debugShowActiveSpans id=9 (41,33 41,36.3137093 38.6568527,38.6568527) t=0 (41,33) tEnd=1 windSum=? windValue=1
822SkOpSegment::debugShowActiveSpans id=10 (38.6568527,38.6568527 36.3137093,41 33,41) t=0 (38.6568527,38.6568527) tEnd=1 windSum=? windValue=1
823SkOpSegment::debugShowActiveSpans id=11 (33,41 29.6862907,41 27.3431454,38.6568527) t=0 (33,41) tEnd=1 windSum=? windValue=1
824SkOpSegment::debugShowActiveSpans id=12 (27.3431454,38.6568527 25,36.3137093 25,33) t=0 (27.3431454,38.6568527) tEnd=1 windSum=? windValue=1
825SkOpSegment::debugShowActiveSpans id=13 (25,33 25,29.6862907 27.3431454,27.3431454) t=0 (25,33) tEnd=1 windSum=? windValue=1
826SkOpSegment::debugShowActiveSpans id=14 (27.3431454,27.3431454 29.6862907,25 33,25) t=0 (27.3431454,27.3431454) tEnd=1 windSum=? windValue=1
827SkOpSegment::debugShowActiveSpans id=15 (33,25 36.3137093,25 38.6568527,27.3431454) t=0 (33,25) tEnd=1 windSum=? windValue=1
828SkOpSegment::debugShowActiveSpans id=16 (38.6568527,27.3431454 41,29.6862907 41,33) t=0 (38.6568527,27.3431454) tEnd=1 windSum=? windValue=1
829SkOpSpan::sortableTop dir=kLeft seg=9 t=0.5 pt=(40.4142151,36.0710678)
830SkOpSpan::sortableTop [0] valid=1 operand=1 span=23 ccw=1 seg=12 {{{27.3431454f, 38.6568527f}, {25, 36.3137093f}, {25, 33}}} t=0.5 pt=(25.5857868,36.0710678) slope=(-1.17157269,-2.82842636)
831SkOpSpan::sortableTop [1] valid=1 operand=1 span=17 ccw=0 seg=9 {{{41, 33}, {41, 36.3137093f}, {38.6568527f, 38.6568527f}}} t=0.5 pt=(40.4142151,36.0710678) slope=(-1.17157364,2.82842636)
832SkOpSegment::markWinding id=12 (27.3431454,38.6568527 25,36.3137093 25,33) t=0 [23] (27.3431454,38.6568527) tEnd=1 newWindSum=-1 newOppSum=0 oppSum=0 windSum=-1 windValue=1 oppValue=0
833SkOpSegment::markWinding id=13 (25,33 25,29.6862907 27.3431454,27.3431454) t=0 [25] (25,33) tEnd=1 newWindSum=-1 newOppSum=0 oppSum=? windSum=? windValue=1 oppValue=0
834SkOpSegment::markWinding id=14 (27.3431454,27.3431454 29.6862907,25 33,25) t=0 [27] (27.3431454,27.3431454) tEnd=1 newWindSum=-1 newOppSum=0 oppSum=? windSum=? windValue=1 oppValue=0
835SkOpSegment::markWinding id=15 (33,25 36.3137093,25 38.6568527,27.3431454) t=0 [29] (33,25) tEnd=1 newWindSum=-1 newOppSum=0 oppSum=? windSum=? windValue=1 oppValue=0
836SkOpSegment::markWinding id=16 (38.6568527,27.3431454 41,29.6862907 41,33) t=0 [31] (38.6568527,27.3431454) tEnd=1 newWindSum=-1 newOppSum=0 oppSum=? windSum=? windValue=1 oppValue=0
837SkOpSegment::markWinding id=9 (41,33 41,36.3137093 38.6568527,38.6568527) t=0 [17] (41,33) tEnd=1 newWindSum=-1 newOppSum=0 oppSum=? windSum=? windValue=1 oppValue=0
838SkOpSegment::markWinding id=10 (38.6568527,38.6568527 36.3137093,41 33,41) t=0 [19] (38.6568527,38.6568527) tEnd=1 newWindSum=-1 newOppSum=0 oppSum=? windSum=? windValue=1 oppValue=0
839SkOpSegment::markWinding id=11 (33,41 29.6862907,41 27.3431454,38.6568527) t=0 [21] (33,41) tEnd=1 newWindSum=-1 newOppSum=0 oppSum=? windSum=? windValue=1 oppValue=0
840SkOpSegment::markWinding id=12 (27.3431454,38.6568527 25,36.3137093 25,33) t=0 [23] (27.3431454,38.6568527) tEnd=1 newWindSum=-1 newOppSum=0 oppSum=0 windSum=-1 windValue=1 oppValue=0
841SkOpSegment::activeOp id=9 t=1 tEnd=0 op=union miFrom=0 miTo=0 suFrom=0 suTo=1 result=1
842SkOpSegment::findNextOp simple
843SkOpSegment::markDone id=9 (41,33 41,36.3137093 38.6568527,38.6568527) t=0 [17] (41,33) tEnd=1 newWindSum=-1 newOppSum=0 oppSum=0 windSum=-1 windValue=1 oppValue=0
844bridgeOp current id=9 from=(38.6568527,38.6568527) to=(41,33)
845path.moveTo(38.6568527,38.6568527);
846path.quadTo(41,36.3137093, 41,33);
847SkOpSegment::findNextOp simple
848SkOpSegment::markDone id=16 (38.6568527,27.3431454 41,29.6862907 41,33) t=0 [31] (38.6568527,27.3431454) tEnd=1 newWindSum=-1 newOppSum=0 oppSum=0 windSum=-1 windValue=1 oppValue=0
849bridgeOp current id=16 from=(41,33) to=(38.6568527,27.3431454)
850path.quadTo(41,29.6862907, 38.6568527,27.3431454);
851SkOpSegment::findNextOp simple
852SkOpSegment::markDone id=15 (33,25 36.3137093,25 38.6568527,27.3431454) t=0 [29] (33,25) tEnd=1 newWindSum=-1 newOppSum=0 oppSum=0 windSum=-1 windValue=1 oppValue=0
853bridgeOp current id=15 from=(38.6568527,27.3431454) to=(33,25)
854path.quadTo(36.3137093,25, 33,25);
855SkOpSegment::findNextOp simple
856SkOpSegment::markDone id=14 (27.3431454,27.3431454 29.6862907,25 33,25) t=0 [27] (27.3431454,27.3431454) tEnd=1 newWindSum=-1 newOppSum=0 oppSum=0 windSum=-1 windValue=1 oppValue=0
857bridgeOp current id=14 from=(33,25) to=(27.3431454,27.3431454)
858path.quadTo(29.6862907,25, 27.3431454,27.3431454);
859SkOpSegment::findNextOp simple
860SkOpSegment::markDone id=13 (25,33 25,29.6862907 27.3431454,27.3431454) t=0 [25] (25,33) tEnd=1 newWindSum=-1 newOppSum=0 oppSum=0 windSum=-1 windValue=1 oppValue=0
861bridgeOp current id=13 from=(27.3431454,27.3431454) to=(25,33)
862path.quadTo(25,29.6862907, 25,33);
863SkOpSegment::findNextOp simple
864SkOpSegment::markDone id=12 (27.3431454,38.6568527 25,36.3137093 25,33) t=0 [23] (27.3431454,38.6568527) tEnd=1 newWindSum=-1 newOppSum=0 oppSum=0 windSum=-1 windValue=1 oppValue=0
865bridgeOp current id=12 from=(25,33) to=(27.3431454,38.6568527)
866path.quadTo(25,36.3137093, 27.3431454,38.6568527);
867SkOpSegment::findNextOp simple
868SkOpSegment::markDone id=11 (33,41 29.6862907,41 27.3431454,38.6568527) t=0 [21] (33,41) tEnd=1 newWindSum=-1 newOppSum=0 oppSum=0 windSum=-1 windValue=1 oppValue=0
869bridgeOp current id=11 from=(27.3431454,38.6568527) to=(33,41)
870path.quadTo(29.6862907,41, 33,41);
871SkOpSegment::findNextOp simple
872SkOpSegment::markDone id=10 (38.6568527,38.6568527 36.3137093,41 33,41) t=0 [19] (38.6568527,38.6568527) tEnd=1 newWindSum=-1 newOppSum=0 oppSum=0 windSum=-1 windValue=1 oppValue=0
873bridgeOp current id=10 from=(33,41) to=(38.6568527,38.6568527)
874path.quadTo(36.3137093,41, 38.6568527,38.6568527);
caryclarkef784fb2015-10-30 12:03:06 -0700875path.close();
caryclarkdac1d172014-06-17 05:15:38 -0700876</div>
caryclark26ad22a2015-10-16 09:03:38 -0700877
caryclarkdac1d172014-06-17 05:15:38 -0700878</div>
879
880<script type="text/javascript">
881
882var testDivs = [
caryclark2bec26a2016-05-26 09:01:47 -0700883 fuzz763_4713_b,
884 fuzz763_4713parts,
caryclarkdac1d172014-06-17 05:15:38 -0700885];
886
887var decimal_places = 3; // make this 3 to show more precision
888
889var tests = [];
890var testLines = [];
891var testTitles = [];
892var testIndex = 0;
893var ctx;
894
895var xmin, xmax, focusXmin, focusXmax;
896var ymin, ymax, focusYmin, focusYmax;
897var scale;
898var mouseX, mouseY;
899var srcLeft, srcTop;
900var screenWidth, screenHeight;
caryclark1049f122015-04-20 08:31:59 -0700901var drawnPts, drawnLines, drawnQuads, drawnConics, drawnCubics;
caryclarkdac1d172014-06-17 05:15:38 -0700902var curveT = 0;
903
904var pt_labels = 2;
905var collect_bounds = false;
906var control_lines = 0;
907var curve_t = false;
908var debug_xy = 1;
909var focus_enabled = false;
910var focus_on_selection = false;
911var step_limit = 0;
912var draw_active = false;
913var draw_add = false;
914var draw_angle = 0;
caryclark624637c2015-05-11 07:21:27 -0700915var draw_coincidence = false;
caryclarkdac1d172014-06-17 05:15:38 -0700916var draw_deriviatives = 0;
917var draw_hints = false;
caryclarkdac1d172014-06-17 05:15:38 -0700918var draw_id = false;
919var draw_intersection = 0;
920var draw_intersectT = false;
921var draw_legend = true;
922var draw_log = false;
923var draw_mark = false;
924var draw_midpoint = false;
925var draw_op = 0;
926var draw_sequence = false;
927var draw_sort = 0;
caryclark03b03ca2015-04-23 09:13:37 -0700928var draw_top = false;
caryclarkdac1d172014-06-17 05:15:38 -0700929var draw_path = 3;
930var draw_computed = 0;
931var retina_scale = !!window.devicePixelRatio;
932
933var activeCount = 0;
934var addCount = 0;
935var angleCount = 0;
caryclark624637c2015-05-11 07:21:27 -0700936var coinCount = 0;
caryclarkdac1d172014-06-17 05:15:38 -0700937var opCount = 0;
938var sectCount = 0;
939var sortCount = 0;
caryclark03b03ca2015-04-23 09:13:37 -0700940var topCount = 0;
caryclarkdac1d172014-06-17 05:15:38 -0700941var markCount = 0;
942var activeMax = 0;
943var addMax = 0;
944var angleMax = 0;
caryclark624637c2015-05-11 07:21:27 -0700945var coinMax = 0;
caryclarkdac1d172014-06-17 05:15:38 -0700946var sectMax = 0;
947var sectMax2 = 0;
948var sortMax = 0;
caryclark03b03ca2015-04-23 09:13:37 -0700949var topMax = 0;
caryclarkdac1d172014-06-17 05:15:38 -0700950var markMax = 0;
951var opMax = 0;
952var stepMax = 0;
953var lastIndex = 0;
954var hasPath = false;
caryclark26ad22a2015-10-16 09:03:38 -0700955var hasAlignedPath = false;
caryclarkdac1d172014-06-17 05:15:38 -0700956var hasComputedPath = false;
caryclark54359292015-03-26 07:52:43 -0700957var angleBetween = false;
958var afterIndex = 0;
caryclarkdac1d172014-06-17 05:15:38 -0700959
960var firstActiveSpan = -1;
961var logStart = -1;
962var logRange = 0;
963
964var SPAN_ID = 0;
965var SPAN_X1 = SPAN_ID + 1;
966var SPAN_Y1 = SPAN_X1 + 1;
967var SPAN_X2 = SPAN_Y1 + 1;
968var SPAN_Y2 = SPAN_X2 + 1;
caryclark1049f122015-04-20 08:31:59 -0700969
caryclarkdac1d172014-06-17 05:15:38 -0700970var SPAN_L_T = SPAN_Y2 + 1;
971var SPAN_L_TX = SPAN_L_T + 1;
972var SPAN_L_TY = SPAN_L_TX + 1;
973var SPAN_L_TEND = SPAN_L_TY + 1;
974var SPAN_L_OTHER = SPAN_L_TEND + 1;
975var SPAN_L_OTHERT = SPAN_L_OTHER + 1;
976var SPAN_L_OTHERI = SPAN_L_OTHERT + 1;
977var SPAN_L_SUM = SPAN_L_OTHERI + 1;
978var SPAN_L_VAL = SPAN_L_SUM + 1;
979var SPAN_L_OPP = SPAN_L_VAL + 1;
980
981var SPAN_X3 = SPAN_Y2 + 1;
982var SPAN_Y3 = SPAN_X3 + 1;
caryclark1049f122015-04-20 08:31:59 -0700983
caryclarkdac1d172014-06-17 05:15:38 -0700984var SPAN_Q_T = SPAN_Y3 + 1;
985var SPAN_Q_TX = SPAN_Q_T + 1;
986var SPAN_Q_TY = SPAN_Q_TX + 1;
987var SPAN_Q_TEND = SPAN_Q_TY + 1;
988var SPAN_Q_OTHER = SPAN_Q_TEND + 1;
989var SPAN_Q_OTHERT = SPAN_Q_OTHER + 1;
990var SPAN_Q_OTHERI = SPAN_Q_OTHERT + 1;
991var SPAN_Q_SUM = SPAN_Q_OTHERI + 1;
992var SPAN_Q_VAL = SPAN_Q_SUM + 1;
993var SPAN_Q_OPP = SPAN_Q_VAL + 1;
994
caryclark1049f122015-04-20 08:31:59 -0700995var SPAN_K_W = SPAN_Y3 + 1;
996var SPAN_K_T = SPAN_K_W + 1;
997var SPAN_K_TX = SPAN_K_T + 1;
998var SPAN_K_TY = SPAN_K_TX + 1;
999var SPAN_K_TEND = SPAN_K_TY + 1;
1000var SPAN_K_OTHER = SPAN_K_TEND + 1;
1001var SPAN_K_OTHERT = SPAN_K_OTHER + 1;
1002var SPAN_K_OTHERI = SPAN_K_OTHERT + 1;
1003var SPAN_K_SUM = SPAN_K_OTHERI + 1;
1004var SPAN_K_VAL = SPAN_K_SUM + 1;
1005var SPAN_K_OPP = SPAN_K_VAL + 1;
1006
caryclarkdac1d172014-06-17 05:15:38 -07001007var SPAN_X4 = SPAN_Y3 + 1;
1008var SPAN_Y4 = SPAN_X4 + 1;
caryclark1049f122015-04-20 08:31:59 -07001009
caryclarkdac1d172014-06-17 05:15:38 -07001010var SPAN_C_T = SPAN_Y4 + 1;
1011var SPAN_C_TX = SPAN_C_T + 1;
1012var SPAN_C_TY = SPAN_C_TX + 1;
1013var SPAN_C_TEND = SPAN_C_TY + 1;
1014var SPAN_C_OTHER = SPAN_C_TEND + 1;
1015var SPAN_C_OTHERT = SPAN_C_OTHER + 1;
1016var SPAN_C_OTHERI = SPAN_C_OTHERT + 1;
1017var SPAN_C_SUM = SPAN_C_OTHERI + 1;
1018var SPAN_C_VAL = SPAN_C_SUM + 1;
1019var SPAN_C_OPP = SPAN_C_VAL + 1;
1020
1021var ACTIVE_LINE_SPAN = 1;
1022var ACTIVE_QUAD_SPAN = ACTIVE_LINE_SPAN + 1;
caryclark1049f122015-04-20 08:31:59 -07001023var ACTIVE_CONIC_SPAN = ACTIVE_QUAD_SPAN + 1;
1024var ACTIVE_CUBIC_SPAN = ACTIVE_CONIC_SPAN + 1;
caryclarkdac1d172014-06-17 05:15:38 -07001025
1026var ADD_MOVETO = ACTIVE_CUBIC_SPAN + 1;
1027var ADD_LINETO = ADD_MOVETO + 1;
1028var ADD_QUADTO = ADD_LINETO + 1;
caryclark1049f122015-04-20 08:31:59 -07001029var ADD_CONICTO = ADD_QUADTO + 1;
1030var ADD_CUBICTO = ADD_CONICTO + 1;
caryclarkdac1d172014-06-17 05:15:38 -07001031var ADD_CLOSE = ADD_CUBICTO + 1;
1032var ADD_FILL = ADD_CLOSE + 1;
1033
1034var PATH_LINE = ADD_FILL + 1;
1035var PATH_QUAD = PATH_LINE + 1;
caryclark1049f122015-04-20 08:31:59 -07001036var PATH_CONIC = PATH_QUAD + 1;
1037var PATH_CUBIC = PATH_CONIC + 1;
caryclarkdac1d172014-06-17 05:15:38 -07001038
1039var INTERSECT_LINE = PATH_CUBIC + 1;
1040var INTERSECT_LINE_2 = INTERSECT_LINE + 1;
1041var INTERSECT_LINE_NO = INTERSECT_LINE_2 + 1;
1042var INTERSECT_QUAD_LINE = INTERSECT_LINE_NO + 1;
1043var INTERSECT_QUAD_LINE_2 = INTERSECT_QUAD_LINE + 1;
1044var INTERSECT_QUAD_LINE_NO = INTERSECT_QUAD_LINE_2 + 1;
1045var INTERSECT_QUAD = INTERSECT_QUAD_LINE_NO + 1;
1046var INTERSECT_QUAD_2 = INTERSECT_QUAD + 1;
1047var INTERSECT_QUAD_NO = INTERSECT_QUAD_2 + 1;
caryclark1049f122015-04-20 08:31:59 -07001048var INTERSECT_CONIC_LINE = INTERSECT_QUAD_NO + 1;
1049var INTERSECT_CONIC_LINE_2 = INTERSECT_CONIC_LINE + 1;
1050var INTERSECT_CONIC_LINE_NO = INTERSECT_CONIC_LINE_2 + 1;
1051var INTERSECT_CONIC = INTERSECT_CONIC_LINE_NO + 1;
1052var INTERSECT_CONIC_2 = INTERSECT_CONIC + 1;
1053var INTERSECT_CONIC_NO = INTERSECT_CONIC_2 + 1;
1054var INTERSECT_SELF_CUBIC = INTERSECT_CONIC_NO + 1;
caryclarkdac1d172014-06-17 05:15:38 -07001055var INTERSECT_SELF_CUBIC_NO = INTERSECT_SELF_CUBIC + 1;
1056var INTERSECT_CUBIC_LINE = INTERSECT_SELF_CUBIC_NO + 1;
1057var INTERSECT_CUBIC_LINE_2 = INTERSECT_CUBIC_LINE + 1;
1058var INTERSECT_CUBIC_LINE_3 = INTERSECT_CUBIC_LINE_2 + 1;
1059var INTERSECT_CUBIC_LINE_NO = INTERSECT_CUBIC_LINE_3 + 1;
1060var INTERSECT_CUBIC_QUAD = INTERSECT_CUBIC_LINE_NO + 1;
1061var INTERSECT_CUBIC_QUAD_2 = INTERSECT_CUBIC_QUAD + 1;
1062var INTERSECT_CUBIC_QUAD_3 = INTERSECT_CUBIC_QUAD_2 + 1;
1063var INTERSECT_CUBIC_QUAD_4 = INTERSECT_CUBIC_QUAD_3 + 1;
1064var INTERSECT_CUBIC_QUAD_NO = INTERSECT_CUBIC_QUAD_4 + 1;
1065var INTERSECT_CUBIC = INTERSECT_CUBIC_QUAD_NO + 1;
1066var INTERSECT_CUBIC_2 = INTERSECT_CUBIC + 1;
1067var INTERSECT_CUBIC_3 = INTERSECT_CUBIC_2 + 1;
1068var INTERSECT_CUBIC_4 = INTERSECT_CUBIC_3 + 1;
1069// FIXME: add cubic 5- 9
1070var INTERSECT_CUBIC_NO = INTERSECT_CUBIC_4 + 1;
1071
1072var SORT_UNARY = INTERSECT_CUBIC_NO + 1;
1073var SORT_BINARY = SORT_UNARY + 1;
1074
1075var OP_DIFFERENCE = SORT_BINARY + 1;
1076var OP_INTERSECT = OP_DIFFERENCE + 1;
1077var OP_UNION = OP_INTERSECT + 1;
1078var OP_XOR = OP_UNION + 1;
1079
1080var MARK_LINE = OP_XOR + 1;
1081var MARK_QUAD = MARK_LINE + 1;
caryclark1049f122015-04-20 08:31:59 -07001082var MARK_CONIC = MARK_QUAD + 1;
1083var MARK_CUBIC = MARK_CONIC + 1;
caryclarkdac1d172014-06-17 05:15:38 -07001084var MARK_DONE_LINE = MARK_CUBIC + 1;
1085var MARK_DONE_QUAD = MARK_DONE_LINE + 1;
caryclark1049f122015-04-20 08:31:59 -07001086var MARK_DONE_CONIC = MARK_DONE_QUAD + 1;
1087var MARK_DONE_CUBIC = MARK_DONE_CONIC + 1;
caryclarkdac1d172014-06-17 05:15:38 -07001088var MARK_UNSORTABLE_LINE = MARK_DONE_CUBIC + 1;
1089var MARK_UNSORTABLE_QUAD = MARK_UNSORTABLE_LINE + 1;
caryclark1049f122015-04-20 08:31:59 -07001090var MARK_UNSORTABLE_CONIC = MARK_UNSORTABLE_QUAD + 1;
1091var MARK_UNSORTABLE_CUBIC = MARK_UNSORTABLE_CONIC + 1;
caryclarkdac1d172014-06-17 05:15:38 -07001092var MARK_SIMPLE_LINE = MARK_UNSORTABLE_CUBIC + 1;
1093var MARK_SIMPLE_QUAD = MARK_SIMPLE_LINE + 1;
caryclark1049f122015-04-20 08:31:59 -07001094var MARK_SIMPLE_CONIC = MARK_SIMPLE_QUAD + 1;
1095var MARK_SIMPLE_CUBIC = MARK_SIMPLE_CONIC + 1;
caryclarkdac1d172014-06-17 05:15:38 -07001096var MARK_SIMPLE_DONE_LINE = MARK_SIMPLE_CUBIC + 1;
1097var MARK_SIMPLE_DONE_QUAD = MARK_SIMPLE_DONE_LINE + 1;
caryclark1049f122015-04-20 08:31:59 -07001098var MARK_SIMPLE_DONE_CONIC = MARK_SIMPLE_DONE_QUAD + 1;
1099var MARK_SIMPLE_DONE_CUBIC = MARK_SIMPLE_DONE_CONIC + 1;
caryclarkdac1d172014-06-17 05:15:38 -07001100var MARK_DONE_UNARY_LINE = MARK_SIMPLE_DONE_CUBIC + 1;
1101var MARK_DONE_UNARY_QUAD = MARK_DONE_UNARY_LINE + 1;
caryclark1049f122015-04-20 08:31:59 -07001102var MARK_DONE_UNARY_CONIC = MARK_DONE_UNARY_QUAD + 1;
1103var MARK_DONE_UNARY_CUBIC = MARK_DONE_UNARY_CONIC + 1;
caryclarkdac1d172014-06-17 05:15:38 -07001104var MARK_ANGLE_LAST = MARK_DONE_UNARY_CUBIC + 1;
1105
1106var COMPUTED_SET_1 = MARK_ANGLE_LAST + 1;
1107var COMPUTED_SET_2 = COMPUTED_SET_1 + 1;
1108
caryclark624637c2015-05-11 07:21:27 -07001109var ANGLE_AFTER = COMPUTED_SET_2 + 1;
caryclark54359292015-03-26 07:52:43 -07001110var ANGLE_AFTERPART = ANGLE_AFTER + 1;
caryclarkdac1d172014-06-17 05:15:38 -07001111
caryclark54359292015-03-26 07:52:43 -07001112var ACTIVE_OP = ANGLE_AFTERPART + 1;
caryclarkdac1d172014-06-17 05:15:38 -07001113
caryclark624637c2015-05-11 07:21:27 -07001114var COIN_MAIN_SPAN = ACTIVE_OP + 1;
1115var COIN_OPP_SPAN = COIN_MAIN_SPAN + 1;
1116
1117var FRAG_TYPE_LAST = COIN_OPP_SPAN;
caryclarkdac1d172014-06-17 05:15:38 -07001118
1119var REC_TYPE_UNKNOWN = -1;
1120var REC_TYPE_PATH = 0;
caryclark54359292015-03-26 07:52:43 -07001121var REC_TYPE_PATH2 = 1;
1122var REC_TYPE_SECT = 2;
1123var REC_TYPE_ACTIVE = 3;
1124var REC_TYPE_ADD = 4;
1125var REC_TYPE_SORT = 5;
1126var REC_TYPE_OP = 6;
1127var REC_TYPE_MARK = 7;
1128var REC_TYPE_COMPUTED = 8;
1129var REC_TYPE_COIN = 9;
1130var REC_TYPE_ANGLE = 10;
1131var REC_TYPE_ACTIVE_OP = 11;
1132var REC_TYPE_AFTERPART = 12;
caryclark03b03ca2015-04-23 09:13:37 -07001133var REC_TYPE_TOP = 13;
caryclark624637c2015-05-11 07:21:27 -07001134var REC_TYPE_COINCIDENCE = 14;
caryclark26ad22a2015-10-16 09:03:38 -07001135var REC_TYPE_ALIGNED = 15;
1136var REC_TYPE_LAST = REC_TYPE_ALIGNED;
caryclarkdac1d172014-06-17 05:15:38 -07001137
1138function strs_to_nums(strs) {
1139 var result = [];
1140 for (var idx = 1; idx < strs.length; ++idx) {
1141 var str = strs[idx];
1142 var num = parseFloat(str);
1143 if (isNaN(num)) {
1144 result.push(str);
1145 } else {
1146 result.push(num);
1147 }
1148 }
1149 return result;
1150}
1151
1152function filter_str_by(id, str, regex, array) {
1153 if (regex.test(str)) {
1154 var strs = regex.exec(str);
1155 var result = strs_to_nums(strs);
1156 array.push(id);
1157 array.push(result);
1158 return true;
1159 }
1160 return false;
1161}
1162
1163function construct_regexp2(pattern) {
1164 var escape = pattern.replace(/[-/\\^$*+?.()|[\]{}]/g, '\\$&');
1165 escape = escape.replace(/UNSORTABLE/g, "\\*\\*\\* UNSORTABLE \\*\\*\\*");
1166 escape = escape.replace(/CUBIC_VAL/g, "\\(P_VAL P_VAL P_VAL P_VAL\\)");
caryclark1049f122015-04-20 08:31:59 -07001167 escape = escape.replace(/CONIC_VAL/g, "\\(P_VAL P_VAL P_VAL W_VAL\\)");
caryclarkdac1d172014-06-17 05:15:38 -07001168 escape = escape.replace(/QUAD_VAL/g, "\\(P_VAL P_VAL P_VAL\\)");
1169 escape = escape.replace(/LINE_VAL/g, "\\(P_VAL P_VAL\\)");
1170 escape = escape.replace(/FILL_TYPE/g, "SkPath::k[a-zA-Z]+_FillType");
caryclark54359292015-03-26 07:52:43 -07001171 escape = escape.replace(/PTR_VAL/g, "0x[0-9A-F]+");
caryclarkdac1d172014-06-17 05:15:38 -07001172 escape = escape.replace(/PT_VAL/g, "\\(P_VAL\\)");
1173 escape = escape.replace(/P_VAL/g, "(-?\\d+\\.?\\d*(?:e-?\\d+)?)[Ff]?, ?(-?\\d+\\.?\\d*(?:e-?\\d+)?)[Ff]?");
1174 escape = escape.replace(/T_VAL/g, "(-?\\d+\\.?\\d*(?:e-?\\d+)?)");
caryclark1049f122015-04-20 08:31:59 -07001175 escape = escape.replace(/W_VAL/g, "(-?\\d+\\.?\\d*(?:e-?\\d+)?)[Ff]?");
caryclarkdac1d172014-06-17 05:15:38 -07001176 escape = escape.replace(/PATH/g, "pathB?");
caryclark1049f122015-04-20 08:31:59 -07001177 escape = escape.replace(/IDX/g, "(-?\\d+)");
caryclarkdac1d172014-06-17 05:15:38 -07001178 escape = escape.replace(/NUM/g, "(-?\\d+)");
1179 escape = escape.replace(/OPT/g, "(\\?|-?\\d+)");
1180 return new RegExp(escape, 'i');
1181}
1182
1183function construct_regexp2c(pattern) {
1184 var escape = pattern.replace(/[-/\\^$*+?.()|[\]{}]/g, '\\$&');
1185 escape = escape.replace(/UNSORTABLE/g, "\\*\\*\\* UNSORTABLE \\*\\*\\*");
caryclark54359292015-03-26 07:52:43 -07001186 escape = escape.replace(/CUBIC_VAL/g, "(?:\\$\\d = )?\\{\\{\\{P_VAL\\}, \\{P_VAL\\}, \\{P_VAL\\}, \\{P_VAL\\}\\}\\}");
caryclark1049f122015-04-20 08:31:59 -07001187 escape = escape.replace(/CONIC_VAL/g, "(?:\\$\\d = )?\\{\\{\\{\\{P_VAL\\}, \\{P_VAL\\}, \\{P_VAL\\}\\}\\}, W_VAL\\}");
caryclark54359292015-03-26 07:52:43 -07001188 escape = escape.replace(/QUAD_VAL/g, "(?:\\$\\d = )?\\{\\{\\{P_VAL\\}, \\{P_VAL\\}, \\{P_VAL\\}\\}\\}");
1189 escape = escape.replace(/LINE_VAL/g, "(?:\\$\\d = )?\\{\\{\\{P_VAL\\}, \\{P_VAL\\}\\}\\}");
caryclarkdac1d172014-06-17 05:15:38 -07001190 escape = escape.replace(/FILL_TYPE/g, "SkPath::k[a-zA-Z]+_FillType");
caryclark54359292015-03-26 07:52:43 -07001191 escape = escape.replace(/PTR_VAL/g, "0x[0-9A-F]+");
caryclarkdac1d172014-06-17 05:15:38 -07001192 escape = escape.replace(/PT_VAL/g, "\\{\\{P_VAL\\}\\}");
caryclark54359292015-03-26 07:52:43 -07001193 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 -07001194 escape = escape.replace(/T_VAL/g, "(-?\\d+\\.?\\d*(?:e-?\\d+)?)");
caryclark1049f122015-04-20 08:31:59 -07001195 escape = escape.replace(/W_VAL/g, "(-?\\d+\\.?\\d*(?:e-?\\d+)?)[Ff]?");
caryclarkdac1d172014-06-17 05:15:38 -07001196 escape = escape.replace(/OPER/g, "[a-z]+");
1197 escape = escape.replace(/PATH/g, "pathB?");
1198 escape = escape.replace(/T_F/g, "([TF])");
caryclark1049f122015-04-20 08:31:59 -07001199 escape = escape.replace(/IDX/g, "(-?\\d+)");
caryclarkdac1d172014-06-17 05:15:38 -07001200 escape = escape.replace(/NUM/g, "(-?\\d+)");
1201 escape = escape.replace(/OPT/g, "(\\?|-?\\d+)");
1202 return new RegExp(escape, 'i');
1203}
1204
1205function match_regexp(str, lineNo, array, id, pattern) {
1206 var regex = construct_regexp2(pattern);
1207 if (filter_str_by(id, str, regex, array)) {
1208 return true;
1209 }
1210 regex = construct_regexp2c(pattern);
1211 return filter_str_by(id, str, regex, array);
1212}
1213
1214function endsWith(str, suffix) {
1215 return str.indexOf(suffix, str.length - suffix.length) !== -1;
1216}
1217
1218function parse_all(test) {
1219 var lines = test.match(/[^\r\n]+/g);
1220 var records = []; // a rec can be the original paths, a set of intersections, a set of active spans, a sort, or a path add
1221 var record = [];
1222 var recType = REC_TYPE_UNKNOWN;
1223 var lastLineNo;
1224 var moveX, moveY;
1225 for (var lineNo = 0; lineNo < lines.length; ++lineNo) {
1226 var line = lines[lineNo];
1227 if (line.length == 0) {
1228 continue;
1229 }
1230 var opStart = "SkOpSegment::";
1231 if (line.lastIndexOf(opStart, 0) === 0) {
1232 line = line.substr(opStart.length);
1233 }
1234 var angleStart = "SkOpAngle::";
1235 if (line.lastIndexOf(angleStart, 0) === 0) {
1236 line = line.substr(angleStart.length);
1237 }
caryclark624637c2015-05-11 07:21:27 -07001238 var coinStart = "SkOpCoincidence::";
1239 if (line.lastIndexOf(coinStart, 0) === 0) {
1240 line = line.substr(coinStart.length);
1241 }
caryclark54359292015-03-26 07:52:43 -07001242 var type = line.lastIndexOf("debugShowActiveSpans", 0) === 0 ? REC_TYPE_ACTIVE
caryclark624637c2015-05-11 07:21:27 -07001243 : line.lastIndexOf("debugShowCoincidence", 0) === 0 ? REC_TYPE_COINCIDENCE
caryclark54359292015-03-26 07:52:43 -07001244 : line.lastIndexOf("((SkOpSegment*)", 0) === 0 ? REC_TYPE_PATH2
caryclarkdac1d172014-06-17 05:15:38 -07001245 : line.lastIndexOf("debugShowTs", 0) === 0 ? REC_TYPE_COIN
caryclark54359292015-03-26 07:52:43 -07001246 : line.lastIndexOf("afterPart", 0) === 0 ? REC_TYPE_AFTERPART
caryclarkdac1d172014-06-17 05:15:38 -07001247 : line.lastIndexOf("debugShow", 0) === 0 ? REC_TYPE_SECT
1248 : line.lastIndexOf("activeOp", 0) === 0 ? REC_TYPE_ACTIVE_OP
1249 : line.lastIndexOf("computed", 0) === 0 ? REC_TYPE_COMPUTED
1250 : line.lastIndexOf("debugOne", 0) === 0 ? REC_TYPE_SORT
caryclark26ad22a2015-10-16 09:03:38 -07001251 : line.lastIndexOf("aligned=", 0) === 0 ? REC_TYPE_ALIGNED
caryclarkdac1d172014-06-17 05:15:38 -07001252 : line.lastIndexOf("dumpOne", 0) === 0 ? REC_TYPE_SORT
caryclark03b03ca2015-04-23 09:13:37 -07001253 : line.lastIndexOf("findTop", 0) === 0 ? REC_TYPE_TOP
caryclarkdac1d172014-06-17 05:15:38 -07001254 : line.lastIndexOf("pathB.", 0) === 0 ? REC_TYPE_ADD
1255 : line.lastIndexOf("path.", 0) === 0 ? REC_TYPE_ADD
1256 : line.lastIndexOf("after", 0) === 0 ? REC_TYPE_ANGLE
1257 : line.lastIndexOf("mark", 0) === 0 ? REC_TYPE_MARK
1258 : line.lastIndexOf(" {{", 0) === 0 ? REC_TYPE_COMPUTED
caryclark54359292015-03-26 07:52:43 -07001259 : line.lastIndexOf("seg=", 0) === 0 ? REC_TYPE_PATH
caryclarkdac1d172014-06-17 05:15:38 -07001260 : line.lastIndexOf("op", 0) === 0 ? REC_TYPE_OP
1261 : line.lastIndexOf("$", 0) === 0 ? REC_TYPE_PATH
1262 : REC_TYPE_UNKNOWN;
1263 if (recType != type || recType == REC_TYPE_ADD || recType == REC_TYPE_SECT
1264 || recType == REC_TYPE_ACTIVE_OP || recType == REC_TYPE_ANGLE) {
1265 if (recType != REC_TYPE_UNKNOWN) {
1266 records.push(recType);
1267 records.push(lastLineNo);
1268 records.push(record);
1269 }
1270 record = [];
1271 recType = type;
1272 lastLineNo = lineNo;
1273 }
1274 var found = false;
1275 switch (recType) {
1276 case REC_TYPE_ACTIVE:
1277 found = match_regexp(line, lineNo, record, ACTIVE_LINE_SPAN, "debugShowActiveSpans" +
caryclark624637c2015-05-11 07:21:27 -07001278" id=IDX LINE_VAL t=T_VAL PT_VAL tEnd=T_VAL windSum=OPT windValue=IDX"
caryclarkdac1d172014-06-17 05:15:38 -07001279 ) || match_regexp(line, lineNo, record, ACTIVE_QUAD_SPAN, "debugShowActiveSpans" +
caryclark624637c2015-05-11 07:21:27 -07001280" id=IDX QUAD_VAL t=T_VAL PT_VAL tEnd=T_VAL windSum=OPT windValue=IDX"
caryclark1049f122015-04-20 08:31:59 -07001281 ) || match_regexp(line, lineNo, record, ACTIVE_CONIC_SPAN, "debugShowActiveSpans" +
caryclark624637c2015-05-11 07:21:27 -07001282" id=IDX CONIC_VAL t=T_VAL PT_VAL tEnd=T_VAL windSum=OPT windValue=IDX"
caryclarkdac1d172014-06-17 05:15:38 -07001283 ) || match_regexp(line, lineNo, record, ACTIVE_CUBIC_SPAN, "debugShowActiveSpans" +
caryclark624637c2015-05-11 07:21:27 -07001284" id=IDX CUBIC_VAL t=T_VAL PT_VAL tEnd=T_VAL windSum=OPT windValue=IDX"
1285 ) || match_regexp(line, lineNo, record, ACTIVE_LINE_SPAN, "debugShowActiveSpans" +
1286" id=IDX LINE_VAL t=T_VAL PT_VAL tEnd=T_VAL windSum=OPT oppSum=OPT windValue=IDX oppValue=NUM"
1287 ) || match_regexp(line, lineNo, record, ACTIVE_QUAD_SPAN, "debugShowActiveSpans" +
1288" id=IDX QUAD_VAL t=T_VAL PT_VAL tEnd=T_VAL windSum=OPT oppSum=OPT windValue=IDX oppValue=NUM"
1289 ) || match_regexp(line, lineNo, record, ACTIVE_CONIC_SPAN, "debugShowActiveSpans" +
1290" id=IDX CONIC_VAL t=T_VAL PT_VAL tEnd=T_VAL windSum=OPT oppSum=OPT windValue=IDX oppValue=NUM"
1291 ) || match_regexp(line, lineNo, record, ACTIVE_CUBIC_SPAN, "debugShowActiveSpans" +
1292" id=IDX CUBIC_VAL t=T_VAL PT_VAL tEnd=T_VAL windSum=OPT oppSum=OPT windValue=IDX oppValue=NUM"
caryclarkdac1d172014-06-17 05:15:38 -07001293 );
1294 break;
1295 case REC_TYPE_ACTIVE_OP:
1296 found = match_regexp(line, lineNo, record, ACTIVE_OP, "activeOp" +
1297" id=IDX t=T_VAL tEnd=T_VAL op=OPER miFrom=NUM miTo=NUM suFrom=NUM suTo=NUM result=IDX"
1298 );
1299 break;
1300 case REC_TYPE_ADD:
1301 if (match_regexp(line, lineNo, record, ADD_MOVETO, "PATH.moveTo(P_VAL);")) {
1302 moveX = record[1][0];
1303 moveY = record[1][1];
1304 found = true;
1305 } else if (match_regexp(line, lineNo, record, ADD_LINETO, "PATH.lineTo(P_VAL);")) {
1306 record[1].unshift(moveY);
1307 record[1].unshift(moveX);
1308 moveX = record[1][2];
1309 moveY = record[1][3];
1310 found = true;
1311 } else if (match_regexp(line, lineNo, record, ADD_QUADTO, "PATH.quadTo(P_VAL, P_VAL);")) {
1312 record[1].unshift(moveY);
1313 record[1].unshift(moveX);
1314 moveX = record[1][4];
1315 moveY = record[1][5];
1316 found = true;
caryclark1049f122015-04-20 08:31:59 -07001317 } else if (match_regexp(line, lineNo, record, ADD_CONICTO, "PATH.conicTo(P_VAL, P_VAL, T_VAL);")) {
1318 record[1].unshift(moveY);
1319 record[1].unshift(moveX);
1320 moveX = record[1][4];
1321 moveY = record[1][5];
1322 found = true;
caryclarkdac1d172014-06-17 05:15:38 -07001323 } else if (match_regexp(line, lineNo, record, ADD_CUBICTO, "PATH.cubicTo(P_VAL, P_VAL, P_VAL);")) {
1324 record[1].unshift(moveY);
1325 record[1].unshift(moveX);
1326 moveX = record[1][6];
1327 moveY = record[1][7];
1328 found = true;
1329 } else if (match_regexp(line, lineNo, record, ADD_FILL, "PATH.setFillType(FILL_TYPE);")) {
1330 found = true;
1331 } else {
1332 found = match_regexp(line, lineNo, record, ADD_CLOSE, "PATH.close();");
1333 }
1334 break;
caryclark54359292015-03-26 07:52:43 -07001335 case REC_TYPE_AFTERPART:
1336 found = match_regexp(line, lineNo, record, PATH_LINE, "afterPart LINE_VAL")
1337 || match_regexp(line, lineNo, record, PATH_QUAD, "afterPart QUAD_VAL")
caryclark1049f122015-04-20 08:31:59 -07001338 || match_regexp(line, lineNo, record, PATH_CONIC, "afterPart CONIC_VAL")
caryclark54359292015-03-26 07:52:43 -07001339 || match_regexp(line, lineNo, record, PATH_CUBIC, "afterPart CUBIC_VAL")
1340 break;
caryclark26ad22a2015-10-16 09:03:38 -07001341 case REC_TYPE_ALIGNED:
1342 found = match_regexp(line, lineNo, record, PATH_LINE, "aligned=IDX LINE_VAL"
1343 ) || match_regexp(line, lineNo, record, PATH_QUAD, "aligned=IDX QUAD_VAL"
1344 ) || match_regexp(line, lineNo, record, PATH_CONIC, "aligned=IDX CONIC_VAL"
1345 ) || match_regexp(line, lineNo, record, PATH_CUBIC, "aligned=IDX CUBIC_VAL"
1346 );
1347 break;
caryclarkdac1d172014-06-17 05:15:38 -07001348 case REC_TYPE_ANGLE:
1349 found = match_regexp(line, lineNo, record, ANGLE_AFTER, "after " +
caryclarkdac1d172014-06-17 05:15:38 -07001350"[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");
1351 break;
1352 case REC_TYPE_COIN:
1353 found = true;
1354 break;
caryclark624637c2015-05-11 07:21:27 -07001355 case REC_TYPE_COINCIDENCE:
1356 found = match_regexp(line, lineNo, record, COIN_MAIN_SPAN, "debugShowCoincidence" +
1357" + id=IDX t=T_VAL tEnd=T_VAL"
1358 ) || match_regexp(line, lineNo, record, COIN_OPP_SPAN, "debugShowCoincidence" +
1359" - id=IDX t=T_VAL tEnd=T_VAL"
1360 );
1361 break;
caryclarkdac1d172014-06-17 05:15:38 -07001362 case REC_TYPE_COMPUTED:
1363 found = line == "computed quadratics given"
1364 || match_regexp(line, lineNo, record, COMPUTED_SET_1, "computed quadratics set 1"
1365 ) || match_regexp(line, lineNo, record, COMPUTED_SET_2, "computed quadratics set 2"
1366 ) || match_regexp(line, lineNo, record, PATH_QUAD, " QUAD_VAL,"
caryclark1049f122015-04-20 08:31:59 -07001367 ) || match_regexp(line, lineNo, record, PATH_CONIC, " CONIC_VAL,"
caryclarkdac1d172014-06-17 05:15:38 -07001368 ) || match_regexp(line, lineNo, record, PATH_CUBIC, " CUBIC_VAL,"
1369 );
1370 break;
1371 case REC_TYPE_PATH:
caryclark54359292015-03-26 07:52:43 -07001372 found = match_regexp(line, lineNo, record, PATH_LINE, "seg=IDX LINE_VAL"
1373 ) || match_regexp(line, lineNo, record, PATH_QUAD, "seg=IDX QUAD_VAL"
caryclark1049f122015-04-20 08:31:59 -07001374 ) || match_regexp(line, lineNo, record, PATH_CONIC, "seg=IDX CONIC_VAL"
caryclark54359292015-03-26 07:52:43 -07001375 ) || match_regexp(line, lineNo, record, PATH_CUBIC, "seg=IDX CUBIC_VAL"
1376 );
1377 break;
1378 case REC_TYPE_PATH2:
1379 found = match_regexp(line, lineNo, record, PATH_LINE, "((SkOpSegment*) PTR_VAL) [IDX] {LINE_VAL}"
1380 ) || match_regexp(line, lineNo, record, PATH_QUAD, "((SkOpSegment*) PTR_VAL) [IDX] {QUAD_VAL}"
caryclark1049f122015-04-20 08:31:59 -07001381 ) || match_regexp(line, lineNo, record, PATH_CONIC, "((SkOpSegment*) PTR_VAL) [IDX] {CONIC_VAL}"
caryclark54359292015-03-26 07:52:43 -07001382 ) || match_regexp(line, lineNo, record, PATH_CUBIC, "((SkOpSegment*) PTR_VAL) [IDX] {CUBIC_VAL}"
caryclarkdac1d172014-06-17 05:15:38 -07001383 );
1384 break;
1385 case REC_TYPE_SECT:
1386 found = match_regexp(line, lineNo, record, INTERSECT_LINE, "debugShowLineIntersection" +
1387" wtTs[0]=T_VAL LINE_VAL PT_VAL wnTs[0]=T_VAL LINE_VAL"
1388 ) || match_regexp(line, lineNo, record, INTERSECT_LINE_2, "debugShowLineIntersection" +
1389" wtTs[0]=T_VAL LINE_VAL PT_VAL wtTs[1]=T_VAL PT_VAL wnTs[0]=T_VAL LINE_VAL wnTs[1]=T_VAL"
1390 ) || match_regexp(line, lineNo, record, INTERSECT_LINE_NO, "debugShowLineIntersection" +
1391" no intersect LINE_VAL LINE_VAL"
1392 ) || match_regexp(line, lineNo, record, INTERSECT_QUAD_LINE, "debugShowQuadLineIntersection" +
1393" wtTs[0]=T_VAL QUAD_VAL PT_VAL wnTs[0]=T_VAL LINE_VAL"
1394 ) || match_regexp(line, lineNo, record, INTERSECT_QUAD_LINE_2, "debugShowQuadLineIntersection" +
1395" wtTs[0]=T_VAL QUAD_VAL PT_VAL wtTs[1]=T_VAL PT_VAL wnTs[0]=T_VAL LINE_VAL wnTs[1]=T_VAL"
1396 ) || match_regexp(line, lineNo, record, INTERSECT_QUAD_LINE_NO, "debugShowQuadLineIntersection" +
1397" no intersect QUAD_VAL LINE_VAL"
1398 ) || match_regexp(line, lineNo, record, INTERSECT_QUAD, "debugShowQuadIntersection" +
1399" wtTs[0]=T_VAL QUAD_VAL PT_VAL wnTs[0]=T_VAL QUAD_VAL"
1400 ) || match_regexp(line, lineNo, record, INTERSECT_QUAD_2, "debugShowQuadIntersection" +
1401" wtTs[0]=T_VAL QUAD_VAL PT_VAL wtTs[1]=T_VAL PT_VAL wnTs[0]=T_VAL QUAD_VAL wnTs[1]=T_VAL"
1402 ) || match_regexp(line, lineNo, record, INTERSECT_QUAD_NO, "debugShowQuadIntersection" +
1403" no intersect QUAD_VAL QUAD_VAL"
caryclark1049f122015-04-20 08:31:59 -07001404 ) || match_regexp(line, lineNo, record, INTERSECT_CONIC_LINE, "debugShowConicLineIntersection" +
1405" wtTs[0]=T_VAL CONIC_VAL PT_VAL wnTs[0]=T_VAL LINE_VAL"
1406 ) || match_regexp(line, lineNo, record, INTERSECT_CONIC_LINE_2, "debugShowConicLineIntersection" +
1407" wtTs[0]=T_VAL CONIC_VAL PT_VAL wtTs[1]=T_VAL PT_VAL wnTs[0]=T_VAL LINE_VAL wnTs[1]=T_VAL"
1408 ) || match_regexp(line, lineNo, record, INTERSECT_CONIC_LINE_NO, "debugShowConicLineIntersection" +
1409" no intersect CONIC_VAL LINE_VAL"
1410 ) || match_regexp(line, lineNo, record, INTERSECT_CONIC, "debugShowConicIntersection" +
1411" wtTs[0]=T_VAL CONIC_VAL PT_VAL wnTs[0]=T_VAL CONIC_VAL"
1412 ) || match_regexp(line, lineNo, record, INTERSECT_CONIC_2, "debugShowConicIntersection" +
1413" wtTs[0]=T_VAL CONIC_VAL PT_VAL wtTs[1]=T_VAL PT_VAL wnTs[0]=T_VAL CONIC_VAL wnTs[1]=T_VAL"
1414 ) || match_regexp(line, lineNo, record, INTERSECT_CONIC_NO, "debugShowConicIntersection" +
1415" no intersect CONIC_VAL CONIC_VAL"
caryclarkdac1d172014-06-17 05:15:38 -07001416 ) || match_regexp(line, lineNo, record, INTERSECT_CUBIC_LINE, "debugShowCubicLineIntersection" +
1417" wtTs[0]=T_VAL CUBIC_VAL PT_VAL wnTs[0]=T_VAL LINE_VAL"
1418 ) || match_regexp(line, lineNo, record, INTERSECT_CUBIC_LINE_2, "debugShowCubicLineIntersection" +
1419" wtTs[0]=T_VAL CUBIC_VAL PT_VAL wtTs[1]=T_VAL PT_VAL wnTs[0]=T_VAL LINE_VAL wnTs[1]=T_VAL"
1420 ) || match_regexp(line, lineNo, record, INTERSECT_CUBIC_LINE_3, "debugShowCubicLineIntersection" +
1421" 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"
1422 ) || match_regexp(line, lineNo, record, INTERSECT_CUBIC_LINE_NO, "debugShowCubicLineIntersection" +
1423" no intersect CUBIC_VAL LINE_VAL"
1424 ) || match_regexp(line, lineNo, record, INTERSECT_CUBIC_QUAD, "debugShowCubicQuadIntersection" +
1425" wtTs[0]=T_VAL CUBIC_VAL PT_VAL wnTs[0]=T_VAL QUAD_VAL"
1426 ) || match_regexp(line, lineNo, record, INTERSECT_CUBIC_QUAD_2, "debugShowCubicQuadIntersection" +
1427" wtTs[0]=T_VAL CUBIC_VAL PT_VAL wtTs[1]=T_VAL PT_VAL wnTs[0]=T_VAL QUAD_VAL wnTs[1]=T_VAL"
1428 ) || match_regexp(line, lineNo, record, INTERSECT_CUBIC_QUAD_3, "debugShowCubicQuadIntersection" +
1429" 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"
1430 ) || match_regexp(line, lineNo, record, INTERSECT_CUBIC_QUAD_4, "debugShowCubicQuadIntersection" +
1431" 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"
1432 ) || match_regexp(line, lineNo, record, INTERSECT_CUBIC_QUAD_NO, "debugShowCubicQuadIntersection" +
1433" no intersect CUBIC_VAL QUAD_VAL"
1434 ) || match_regexp(line, lineNo, record, INTERSECT_CUBIC, "debugShowCubicIntersection" +
1435" wtTs[0]=T_VAL CUBIC_VAL PT_VAL wnTs[0]=T_VAL CUBIC_VAL"
1436 ) || match_regexp(line, lineNo, record, INTERSECT_CUBIC_2, "debugShowCubicIntersection" +
1437" wtTs[0]=T_VAL CUBIC_VAL PT_VAL wtTs[1]=T_VAL PT_VAL wnTs[0]=T_VAL CUBIC_VAL wnTs[1]=T_VAL"
1438 ) || match_regexp(line, lineNo, record, INTERSECT_CUBIC_3, "debugShowCubicIntersection" +
1439" 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"
1440 ) || match_regexp(line, lineNo, record, INTERSECT_CUBIC_4, "debugShowCubicIntersection" +
1441" 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"
1442 ) || match_regexp(line, lineNo, record, INTERSECT_CUBIC_NO, "debugShowCubicIntersection" +
1443" no intersect CUBIC_VAL CUBIC_VAL"
1444 ) || match_regexp(line, lineNo, record, INTERSECT_SELF_CUBIC, "debugShowCubicIntersection" +
1445" wtTs[0]=T_VAL CUBIC_VAL PT_VAL wtTs[1]=T_VAL"
1446 ) || match_regexp(line, lineNo, record, INTERSECT_SELF_CUBIC_NO, "debugShowCubicIntersection" +
1447" no self intersect CUBIC_VAL"
1448 );
1449 break;
1450 case REC_TYPE_SORT:
1451 var hasDone = / done/.test(line);
1452 var hasUnorderable = / unorderable/.test(line);
1453 var hasSmall = / small/.test(line);
1454 var hasTiny = / tiny/.test(line);
1455 var hasOperand = / operand/.test(line);
1456 var hasStop = / stop/.test(line);
1457 line.replace(/[ a-z]+$/, "");
1458 found = match_regexp(line, lineNo, record, SORT_UNARY, "debugOne" +
1459" [IDX/IDX] next=IDX/IDX sect=IDX/IDX s=T_VAL [IDX] e=T_VAL [IDX] sgn=NUM windVal=IDX windSum=OPT"
1460 ) || match_regexp(line, lineNo, record, SORT_BINARY, "debugOne" +
1461" [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"
1462 ) || match_regexp(line, lineNo, record, SORT_UNARY, "dumpOne" +
1463" [IDX/IDX] next=IDX/IDX sect=NUM/NUM s=T_VAL [IDX] e=T_VAL [IDX] sgn=NUM windVal=IDX windSum=OPT"
1464 ) || match_regexp(line, lineNo, record, SORT_BINARY, "dumpOne" +
1465" [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"
1466 );
1467 if (found) {
1468 record[1].push(hasDone);
1469 record[1].push(hasUnorderable);
1470 record[1].push(hasSmall);
1471 record[1].push(hasTiny);
1472 record[1].push(hasOperand);
1473 record[1].push(hasStop);
1474 }
1475 break;
caryclark03b03ca2015-04-23 09:13:37 -07001476 case REC_TYPE_TOP:
1477 found = match_regexp(line, lineNo, record, ACTIVE_OP, "findTop" +
1478" id=IDX s=T_VAL e=T_VAL cw=NUM swap=NUM inflections=NUM monotonic=NUM"
1479 ) || match_regexp(line, lineNo, record, ACTIVE_OP, "findTop" +
1480" id=IDX s=T_VAL e=T_VAL (-) cw=NUM swap=NUM inflections=NUM monotonic=NUM"
1481 ) || match_regexp(line, lineNo, record, ACTIVE_OP, "findTop" +
1482" id=IDX s=T_VAL e=T_VAL (+) cw=NUM swap=NUM inflections=NUM monotonic=NUM"
1483 );
1484 break;
caryclarkdac1d172014-06-17 05:15:38 -07001485 case REC_TYPE_MARK:
1486 found = match_regexp(line, lineNo, record, MARK_LINE, "markWinding" +
caryclark54359292015-03-26 07:52:43 -07001487" 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 -07001488 ) || match_regexp(line, lineNo, record, MARK_QUAD, "markWinding" +
caryclark54359292015-03-26 07:52:43 -07001489" 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 -07001490 ) || match_regexp(line, lineNo, record, MARK_CONIC, "markWinding" +
1491" 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 -07001492 ) || match_regexp(line, lineNo, record, MARK_CUBIC, "markWinding" +
caryclark54359292015-03-26 07:52:43 -07001493" id=IDX CUBIC_VAL t=T_VAL [IDX] PT_VAL tEnd=T_VAL newWindSum=NUM newOppSum=OPT oppSum=OPT windSum=OPT windValue=IDX"
1494 ) || match_regexp(line, lineNo, record, MARK_DONE_LINE, "markDone" +
1495" 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"
1496 ) || match_regexp(line, lineNo, record, MARK_DONE_QUAD, "markDone" +
1497" 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 -07001498 ) || match_regexp(line, lineNo, record, MARK_DONE_CONIC, "markDone" +
1499" 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 -07001500 ) || match_regexp(line, lineNo, record, MARK_DONE_CUBIC, "markDone" +
1501" 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 -07001502 ) || match_regexp(line, lineNo, record, MARK_SIMPLE_LINE, "markWinding" +
1503" id=IDX LINE_VAL t=T_VAL [IDX] PT_VAL tEnd=T_VAL newWindSum=NUM windSum=OPT windValue=IDX"
1504 ) || match_regexp(line, lineNo, record, MARK_SIMPLE_QUAD, "markWinding" +
1505" 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 -07001506 ) || match_regexp(line, lineNo, record, MARK_SIMPLE_CONIC, "markWinding" +
1507" 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 -07001508 ) || match_regexp(line, lineNo, record, MARK_SIMPLE_CUBIC, "markWinding" +
1509" 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 -07001510 ) || match_regexp(line, lineNo, record, MARK_ANGLE_LAST, "markAngle" +
caryclark1049f122015-04-20 08:31:59 -07001511" last segment=IDX span=IDX"
caryclark54359292015-03-26 07:52:43 -07001512 ) || match_regexp(line, lineNo, record, MARK_ANGLE_LAST, "markAngle" +
1513" last segment=IDX span=IDX windSum=OPT");
caryclarkdac1d172014-06-17 05:15:38 -07001514 break;
1515 case REC_TYPE_OP:
1516 if (line.lastIndexOf("oppSign oppSign=", 0) === 0
1517 || line.lastIndexOf("operator<", 0) === 0) {
1518 found = true;
1519 break;
1520 }
caryclark54359292015-03-26 07:52:43 -07001521 found = match_regexp(line, lineNo, record, OP_DIFFERENCE, "op diff"
caryclarkdac1d172014-06-17 05:15:38 -07001522 ) || match_regexp(line, lineNo, record, OP_INTERSECT, "op intersect"
caryclark54359292015-03-26 07:52:43 -07001523 ) || match_regexp(line, lineNo, record, OP_INTERSECT, "op sect"
caryclarkdac1d172014-06-17 05:15:38 -07001524 ) || match_regexp(line, lineNo, record, OP_UNION, "op union"
1525 ) || match_regexp(line, lineNo, record, OP_XOR, "op xor"
1526 );
1527 break;
1528 case REC_TYPE_UNKNOWN:
1529 found = true;
1530 break;
1531 }
1532 if (!found) {
1533 console.log(line + " [" + lineNo + "] of type " + type + " not found");
1534 }
1535 }
1536 if (recType != REC_TYPE_UNKNOWN) {
1537 records.push(recType);
1538 records.push(lastLineNo);
1539 records.push(record);
1540 }
1541 if (records.length >= 1) {
1542 tests[testIndex] = records;
1543 testLines[testIndex] = lines;
1544 }
1545}
1546
1547function init(test) {
1548 var canvas = document.getElementById('canvas');
1549 if (!canvas.getContext) return;
1550 ctx = canvas.getContext('2d');
1551 var resScale = retina_scale && window.devicePixelRatio ? window.devicePixelRatio : 1;
1552 var unscaledWidth = window.innerWidth - 20;
1553 var unscaledHeight = window.innerHeight - 20;
1554 screenWidth = unscaledWidth;
1555 screenHeight = unscaledHeight;
1556 canvas.width = unscaledWidth * resScale;
1557 canvas.height = unscaledHeight * resScale;
1558 canvas.style.width = unscaledWidth + 'px';
1559 canvas.style.height = unscaledHeight + 'px';
1560 if (resScale != 1) {
1561 ctx.scale(resScale, resScale);
1562 }
1563 xmin = Infinity;
1564 xmax = -Infinity;
1565 ymin = Infinity;
1566 ymax = -Infinity;
caryclark26ad22a2015-10-16 09:03:38 -07001567 hasPath = hasAlignedPath = hasComputedPath = false;
caryclarkdac1d172014-06-17 05:15:38 -07001568 firstActiveSpan = -1;
1569 for (var tIndex = 0; tIndex < test.length; tIndex += 3) {
1570 var recType = test[tIndex];
1571 if (!typeof recType == 'number' || recType < REC_TYPE_UNKNOWN || recType > REC_TYPE_LAST) {
1572 console.log("unknown rec type: " + recType);
1573 throw "stop execution";
1574 }
1575 var records = test[tIndex + 2];
1576 for (var recordIndex = 0; recordIndex < records.length; recordIndex += 2) {
1577 var fragType = records[recordIndex];
1578 if (!typeof fragType == 'number' || fragType < 1 || fragType > FRAG_TYPE_LAST) {
1579 console.log("unknown in range frag type: " + fragType);
1580 throw "stop execution";
1581 }
1582 var frags = records[recordIndex + 1];
1583 var first = 0;
1584 var last = -1;
1585 var first2 = 0;
1586 var last2 = 0;
1587 switch (recType) {
caryclark26ad22a2015-10-16 09:03:38 -07001588 case REC_TYPE_ALIGNED:
1589 hasAlignedPath = true;
caryclarkdac1d172014-06-17 05:15:38 -07001590 case REC_TYPE_COMPUTED:
1591 if (fragType == COMPUTED_SET_1 || fragType == COMPUTED_SET_2) {
1592 break;
1593 }
caryclark26ad22a2015-10-16 09:03:38 -07001594 if (REC_TYPE_COMPUTED == recType) {
1595 hasComputedPath = true;
1596 }
caryclarkdac1d172014-06-17 05:15:38 -07001597 case REC_TYPE_PATH:
caryclark54359292015-03-26 07:52:43 -07001598 first = 1;
caryclarkdac1d172014-06-17 05:15:38 -07001599 switch (fragType) {
1600 case PATH_LINE:
caryclark54359292015-03-26 07:52:43 -07001601 last = 5;
caryclarkdac1d172014-06-17 05:15:38 -07001602 break;
caryclark1049f122015-04-20 08:31:59 -07001603 case PATH_CONIC:
caryclarkdac1d172014-06-17 05:15:38 -07001604 case PATH_QUAD:
caryclark54359292015-03-26 07:52:43 -07001605 last = 7;
caryclarkdac1d172014-06-17 05:15:38 -07001606 break;
1607 case PATH_CUBIC:
caryclark54359292015-03-26 07:52:43 -07001608 last = 9;
caryclarkdac1d172014-06-17 05:15:38 -07001609 break;
1610 default:
1611 console.log("unknown " + (recType == REC_TYPE_PATH ? "REC_TYPE_PATH"
1612 : "REC_TYPE_COMPUTED") + " frag type:" + fragType);
1613 throw "stop execution";
1614 }
1615 if (recType == REC_TYPE_PATH) {
1616 hasPath = true;
1617 }
1618 break;
caryclark54359292015-03-26 07:52:43 -07001619 case REC_TYPE_PATH2:
1620 first = 1;
1621 switch (fragType) {
1622 case PATH_LINE:
1623 last = 5;
1624 break;
caryclark1049f122015-04-20 08:31:59 -07001625 case PATH_CONIC:
caryclark54359292015-03-26 07:52:43 -07001626 case PATH_QUAD:
1627 last = 7;
1628 break;
1629 case PATH_CUBIC:
1630 last = 9;
1631 break;
1632 default:
1633 console.log("unknown " + (recType == REC_TYPE_PATH2 ? "REC_TYPE_PATH2"
1634 : "REC_TYPE_COMPUTED") + " frag type:" + fragType);
1635 throw "stop execution";
1636 }
1637 if (recType == REC_TYPE_PATH2) {
1638 hasPath = true;
1639 }
1640 break;
caryclarkdac1d172014-06-17 05:15:38 -07001641 case REC_TYPE_ACTIVE:
1642 if (firstActiveSpan < 0) {
1643 firstActiveSpan = tIndex;
1644 }
1645 first = 1;
1646 switch (fragType) {
1647 case ACTIVE_LINE_SPAN:
1648 last = 5;
1649 break;
caryclark1049f122015-04-20 08:31:59 -07001650 case ACTIVE_CONIC_SPAN:
caryclarkdac1d172014-06-17 05:15:38 -07001651 case ACTIVE_QUAD_SPAN:
1652 last = 7;
1653 break;
1654 case ACTIVE_CUBIC_SPAN:
1655 last = 9;
1656 break;
1657 default:
1658 console.log("unknown REC_TYPE_ACTIVE frag type: " + fragType);
1659 throw "stop execution";
1660 }
1661 break;
1662 case REC_TYPE_ADD:
1663 switch (fragType) {
1664 case ADD_MOVETO:
1665 break;
1666 case ADD_LINETO:
1667 last = 4;
1668 break;
caryclark1049f122015-04-20 08:31:59 -07001669 case ADD_CONICTO:
caryclarkdac1d172014-06-17 05:15:38 -07001670 case ADD_QUADTO:
1671 last = 6;
1672 break;
1673 case ADD_CUBICTO:
1674 last = 8;
1675 break;
1676 case ADD_CLOSE:
1677 case ADD_FILL:
1678 break;
1679 default:
1680 console.log("unknown REC_TYPE_ADD frag type: " + fragType);
1681 throw "stop execution";
1682 }
1683 break;
caryclark54359292015-03-26 07:52:43 -07001684 case REC_TYPE_AFTERPART:
1685 switch (fragType) {
1686 case PATH_LINE:
1687 last = 4;
1688 break;
caryclark1049f122015-04-20 08:31:59 -07001689 case PATH_CONIC:
caryclark54359292015-03-26 07:52:43 -07001690 case PATH_QUAD:
1691 last = 6;
1692 break;
1693 case PATH_CUBIC:
1694 last = 8;
1695 break;
1696 default:
1697 console.log("unknown REC_TYPE_ACTIVEPART frag type: " + fragType);
1698 throw "stop execution";
1699 }
1700 break;
caryclarkdac1d172014-06-17 05:15:38 -07001701 case REC_TYPE_SECT:
1702 switch (fragType) {
1703 case INTERSECT_LINE:
1704 first = 1; last = 5; first2 = 8; last2 = 12;
1705 break;
1706 case INTERSECT_LINE_2:
1707 first = 1; last = 5; first2 = 11; last2 = 15;
1708 break;
1709 case INTERSECT_LINE_NO:
1710 first = 0; last = 4; first2 = 4; last2 = 8;
1711 break;
caryclark1049f122015-04-20 08:31:59 -07001712 case INTERSECT_CONIC_LINE:
1713 first = 1; last = 7; first2 = 11; last2 = 15;
1714 break;
caryclarkdac1d172014-06-17 05:15:38 -07001715 case INTERSECT_QUAD_LINE:
1716 first = 1; last = 7; first2 = 10; last2 = 14;
1717 break;
caryclark1049f122015-04-20 08:31:59 -07001718 case INTERSECT_CONIC_LINE_2:
1719 first = 1; last = 7; first2 = 14; last2 = 18;
1720 break;
caryclarkdac1d172014-06-17 05:15:38 -07001721 case INTERSECT_QUAD_LINE_2:
1722 first = 1; last = 7; first2 = 13; last2 = 17;
1723 break;
caryclark1049f122015-04-20 08:31:59 -07001724 case INTERSECT_CONIC_LINE_NO:
1725 first = 0; last = 6; first2 = 7; last2 = 11;
1726 break;
caryclarkdac1d172014-06-17 05:15:38 -07001727 case INTERSECT_QUAD_LINE_NO:
1728 first = 0; last = 6; first2 = 6; last2 = 10;
1729 break;
caryclark1049f122015-04-20 08:31:59 -07001730 case INTERSECT_CONIC:
1731 first = 1; last = 7; first2 = 11; last2 = 17;
1732 break;
caryclarkdac1d172014-06-17 05:15:38 -07001733 case INTERSECT_QUAD:
1734 first = 1; last = 7; first2 = 10; last2 = 16;
1735 break;
caryclark1049f122015-04-20 08:31:59 -07001736 case INTERSECT_CONIC_2:
1737 first = 1; last = 7; first2 = 14; last2 = 20;
1738 break;
caryclarkdac1d172014-06-17 05:15:38 -07001739 case INTERSECT_QUAD_2:
1740 first = 1; last = 7; first2 = 13; last2 = 19;
1741 break;
caryclark1049f122015-04-20 08:31:59 -07001742 case INTERSECT_CONIC_NO:
1743 first = 0; last = 6; first2 = 7; last2 = 13;
1744 break;
caryclarkdac1d172014-06-17 05:15:38 -07001745 case INTERSECT_QUAD_NO:
1746 first = 0; last = 6; first2 = 6; last2 = 12;
1747 break;
1748 case INTERSECT_SELF_CUBIC:
1749 first = 1; last = 9;
1750 break;
1751 case INTERSECT_SELF_CUBIC_NO:
1752 first = 0; last = 8;
1753 break;
1754 case INTERSECT_CUBIC_LINE:
1755 first = 1; last = 9; first2 = 12; last2 = 16;
1756 break;
1757 case INTERSECT_CUBIC_LINE_2:
1758 first = 1; last = 9; first2 = 15; last2 = 19;
1759 break;
1760 case INTERSECT_CUBIC_LINE_3:
1761 first = 1; last = 9; first2 = 18; last2 = 22;
1762 break;
1763 case INTERSECT_CUBIC_LINE_NO:
1764 first = 0; last = 8; first2 = 8; last2 = 12;
1765 break;
1766 case INTERSECT_CUBIC_QUAD:
1767 first = 1; last = 9; first2 = 12; last2 = 18;
1768 break;
1769 case INTERSECT_CUBIC_QUAD_2:
1770 first = 1; last = 9; first2 = 15; last2 = 21;
1771 break;
1772 case INTERSECT_CUBIC_QUAD_3:
1773 first = 1; last = 9; first2 = 18; last2 = 24;
1774 break;
1775 case INTERSECT_CUBIC_QUAD_4:
1776 first = 1; last = 9; first2 = 21; last2 = 27;
1777 break;
1778 case INTERSECT_CUBIC_QUAD_NO:
1779 first = 0; last = 8; first2 = 8; last2 = 14;
1780 break;
1781 case INTERSECT_CUBIC:
1782 first = 1; last = 9; first2 = 12; last2 = 20;
1783 break;
1784 case INTERSECT_CUBIC_2:
1785 first = 1; last = 9; first2 = 15; last2 = 23;
1786 break;
1787 case INTERSECT_CUBIC_3:
1788 first = 1; last = 9; first2 = 18; last2 = 26;
1789 break;
1790 case INTERSECT_CUBIC_4:
1791 first = 1; last = 9; first2 = 21; last2 = 29;
1792 break;
1793 case INTERSECT_CUBIC_NO:
1794 first = 0; last = 8; first2 = 8; last2 = 16;
1795 break;
1796 default:
1797 console.log("unknown REC_TYPE_SECT frag type: " + fragType);
1798 throw "stop execution";
1799 }
1800 break;
1801 default:
1802 continue;
1803 }
1804 for (var idx = first; idx < last; idx += 2) {
1805 xmin = Math.min(xmin, frags[idx]);
1806 xmax = Math.max(xmax, frags[idx]);
1807 ymin = Math.min(ymin, frags[idx + 1]);
1808 ymax = Math.max(ymax, frags[idx + 1]);
1809 }
1810 for (var idx = first2; idx < last2; idx += 2) {
1811 xmin = Math.min(xmin, frags[idx]);
1812 xmax = Math.max(xmax, frags[idx]);
1813 ymin = Math.min(ymin, frags[idx + 1]);
1814 ymax = Math.max(ymax, frags[idx + 1]);
1815 }
1816 }
1817 }
1818 var angleBounds = [Infinity, Infinity, -Infinity, -Infinity];
1819 for (var tIndex = 0; tIndex < test.length; tIndex += 3) {
1820 var recType = test[tIndex];
1821 var records = test[tIndex + 2];
1822 for (var recordIndex = 0; recordIndex < records.length; recordIndex += 2) {
1823 var fragType = records[recordIndex];
1824 var frags = records[recordIndex + 1];
1825 switch (recType) {
1826 case REC_TYPE_ACTIVE_OP:
1827 if (!draw_op) {
1828 break;
1829 }
1830 {
1831 var curve = curvePartialByID(test, frags[0], frags[1], frags[2]);
1832 curve_extremes(curve, angleBounds);
1833 }
1834 break;
1835 case REC_TYPE_ANGLE:
1836 if (!draw_angle) {
1837 break;
1838 }
caryclark54359292015-03-26 07:52:43 -07001839 {
caryclarkdac1d172014-06-17 05:15:38 -07001840 var curve = curvePartialByID(test, frags[0], frags[4], frags[5]);
1841 curve_extremes(curve, angleBounds);
1842 curve = curvePartialByID(test, frags[6], frags[10], frags[11]);
1843 curve_extremes(curve, angleBounds);
1844 curve = curvePartialByID(test, frags[12], frags[16], frags[17]);
1845 }
1846 break;
caryclark624637c2015-05-11 07:21:27 -07001847 case REC_TYPE_COINCIDENCE:
1848 if (!draw_coincidence) {
1849 break;
1850 }
1851 {
1852 var curve = curvePartialByID(test, frags[0], frags[1], frags[2]);
1853 curve_extremes(curve, angleBounds);
1854 }
1855 break;
caryclarkdac1d172014-06-17 05:15:38 -07001856 case REC_TYPE_SORT:
1857 if (!draw_sort) {
1858 break;
1859 }
1860 if (fragType == SORT_UNARY || fragType == SORT_BINARY) {
1861 var curve = curvePartialByID(test, frags[0], frags[6], frags[8]);
1862 curve_extremes(curve, angleBounds);
1863 }
1864 break;
caryclark03b03ca2015-04-23 09:13:37 -07001865 case REC_TYPE_TOP:
1866 if (!draw_top) {
1867 break;
1868 }
1869 {
1870 var curve = curvePartialByID(test, frags[0], frags[1], frags[2]);
1871 curve_extremes(curve, angleBounds);
1872 }
1873 break;
caryclarkdac1d172014-06-17 05:15:38 -07001874 }
1875 }
1876 }
1877 xmin = Math.min(xmin, angleBounds[0]);
1878 ymin = Math.min(ymin, angleBounds[1]);
1879 xmax = Math.max(xmax, angleBounds[2]);
1880 ymax = Math.max(ymax, angleBounds[3]);
1881 setScale(xmin, xmax, ymin, ymax);
1882 if (hasPath == false && hasComputedPath == true && !draw_computed) {
caryclark1049f122015-04-20 08:31:59 -07001883 draw_computed = 7; // show quadratics, conics, and cubics
caryclarkdac1d172014-06-17 05:15:38 -07001884 }
1885 if (hasPath == true && hasComputedPath == false && draw_computed) {
1886 draw_computed = 0;
1887 }
1888}
1889
caryclark26ad22a2015-10-16 09:03:38 -07001890function curveByIDMatch(test, id, recMatch) {
caryclark54359292015-03-26 07:52:43 -07001891 var tIndex = -3;
1892 while ((tIndex += 3) < test.length) {
caryclarkdac1d172014-06-17 05:15:38 -07001893 var recType = test[tIndex];
caryclark54359292015-03-26 07:52:43 -07001894 if (recType == REC_TYPE_OP) {
1895 continue;
1896 }
caryclark26ad22a2015-10-16 09:03:38 -07001897 if (recType != recMatch) {
caryclarkdac1d172014-06-17 05:15:38 -07001898 return [];
1899 }
1900 var records = test[tIndex + 2];
1901 for (var recordIndex = 0; recordIndex < records.length; recordIndex += 2) {
1902 var fragType = records[recordIndex];
1903 var frags = records[recordIndex + 1];
1904 if (frags[0] == id) {
1905 switch (fragType) {
caryclark54359292015-03-26 07:52:43 -07001906 case PATH_LINE:
caryclarkdac1d172014-06-17 05:15:38 -07001907 return [frags[1], frags[2], frags[3], frags[4]];
caryclark54359292015-03-26 07:52:43 -07001908 case PATH_QUAD:
caryclarkdac1d172014-06-17 05:15:38 -07001909 return [frags[1], frags[2], frags[3], frags[4],
1910 frags[5], frags[6]];
caryclark1049f122015-04-20 08:31:59 -07001911 case PATH_CONIC:
1912 return [frags[1], frags[2], frags[3], frags[4],
1913 frags[5], frags[6], frags[7]];
caryclark54359292015-03-26 07:52:43 -07001914 case PATH_CUBIC:
caryclarkdac1d172014-06-17 05:15:38 -07001915 return [frags[1], frags[2], frags[3], frags[4],
1916 frags[5], frags[6], frags[7], frags[8]];
1917 }
1918 }
1919 }
caryclarkdac1d172014-06-17 05:15:38 -07001920 }
1921 return [];
1922}
1923
caryclark26ad22a2015-10-16 09:03:38 -07001924function curveByID(test, id) {
1925 var result = draw_path >= 4 ? curveByIDMatch(test, id, REC_TYPE_ALIGNED) : [];
1926 if (!result.length) {
1927 result = curveByIDMatch(test, id, REC_TYPE_PATH);
1928 }
1929 return result;
1930}
1931
1932function curvePartialByIDMatch(test, id, t0, t1, recMatch) {
caryclark54359292015-03-26 07:52:43 -07001933 var tIndex = -3;
1934 while ((tIndex += 3) < test.length) {
caryclarkdac1d172014-06-17 05:15:38 -07001935 var recType = test[tIndex];
caryclark54359292015-03-26 07:52:43 -07001936 if (recType == REC_TYPE_OP) {
1937 continue;
1938 }
caryclark26ad22a2015-10-16 09:03:38 -07001939 if (recType != recMatch) {
caryclarkdac1d172014-06-17 05:15:38 -07001940 return [];
1941 }
1942 var records = test[tIndex + 2];
1943 for (var recordIndex = 0; recordIndex < records.length; recordIndex += 2) {
1944 var fragType = records[recordIndex];
1945 var frags = records[recordIndex + 1];
1946 if (frags[0] == id) {
1947 switch (fragType) {
caryclark54359292015-03-26 07:52:43 -07001948 case PATH_LINE:
caryclarkdac1d172014-06-17 05:15:38 -07001949 return linePartial(frags[1], frags[2], frags[3], frags[4], t0, t1);
caryclark54359292015-03-26 07:52:43 -07001950 case PATH_QUAD:
caryclarkdac1d172014-06-17 05:15:38 -07001951 return quadPartial(frags[1], frags[2], frags[3], frags[4],
1952 frags[5], frags[6], t0, t1);
caryclark1049f122015-04-20 08:31:59 -07001953 case PATH_CONIC:
1954 return conicPartial(frags[1], frags[2], frags[3], frags[4],
1955 frags[5], frags[6], frags[7], t0, t1);
caryclark54359292015-03-26 07:52:43 -07001956 case PATH_CUBIC:
caryclarkdac1d172014-06-17 05:15:38 -07001957 return cubicPartial(frags[1], frags[2], frags[3], frags[4],
1958 frags[5], frags[6], frags[7], frags[8], t0, t1);
1959 }
1960 }
1961 }
caryclarkdac1d172014-06-17 05:15:38 -07001962 }
1963 return [];
1964}
1965
caryclark26ad22a2015-10-16 09:03:38 -07001966function curvePartialByID(test, id, t0, t1) {
1967 var result = draw_path >= 4 ? curvePartialByIDMatch(test, id, t0, t1, REC_TYPE_ALIGNED) : [];
1968 if (!result.length) {
1969 result = curvePartialByIDMatch(test, id, t0, t1, REC_TYPE_PATH);
1970 }
1971 return result;
1972}
1973
1974function idByCurveIDMatch(test, frag, type, recMatch) {
caryclark54359292015-03-26 07:52:43 -07001975 var tIndex = 0;
caryclarkdac1d172014-06-17 05:15:38 -07001976 while (tIndex < test.length) {
1977 var recType = test[tIndex];
caryclark26ad22a2015-10-16 09:03:38 -07001978 if (recType != recMatch) {
caryclark54359292015-03-26 07:52:43 -07001979 ++tIndex;
1980 continue;
caryclarkdac1d172014-06-17 05:15:38 -07001981 }
1982 var records = test[tIndex + 2];
1983 for (var recordIndex = 0; recordIndex < records.length; recordIndex += 2) {
1984 var fragType = records[recordIndex];
1985 var frags = records[recordIndex + 1];
caryclark54359292015-03-26 07:52:43 -07001986 if (frag.length != frags.length - 1) {
1987 continue;
1988 }
caryclarkdac1d172014-06-17 05:15:38 -07001989 switch (fragType) {
caryclark54359292015-03-26 07:52:43 -07001990 case PATH_LINE:
caryclarkdac1d172014-06-17 05:15:38 -07001991 if (frag[0] != frags[1] || frag[1] != frags[2]
1992 || frag[2] != frags[3] || frag[3] != frags[4]) {
1993 continue;
1994 }
1995 return frags[0];
caryclark54359292015-03-26 07:52:43 -07001996 case PATH_QUAD:
caryclarkdac1d172014-06-17 05:15:38 -07001997 if (frag[0] != frags[1] || frag[1] != frags[2]
1998 || frag[2] != frags[3] || frag[3] != frags[4]
1999 || frag[4] != frags[5] || frag[5] != frags[6]) {
2000 continue;
2001 }
2002 return frags[0];
caryclark1049f122015-04-20 08:31:59 -07002003 case PATH_CONIC:
2004 if (frag[0] != frags[1] || frag[1] != frags[2]
2005 || frag[2] != frags[3] || frag[3] != frags[4]
2006 || frag[4] != frags[5] || frag[5] != frags[6]
2007 || frag[6] != frags[7]) {
2008 continue;
2009 }
2010 return frags[0];
caryclark54359292015-03-26 07:52:43 -07002011 case PATH_CUBIC:
caryclarkdac1d172014-06-17 05:15:38 -07002012 if (frag[0] != frags[1] || frag[1] != frags[2]
2013 || frag[2] != frags[3] || frag[3] != frags[4]
2014 || frag[4] != frags[5] || frag[5] != frags[6]
2015 || frag[6] != frags[7] || frag[7] != frags[8]) {
2016 continue;
2017 }
2018 return frags[0];
2019 }
2020 }
2021 ++tIndex;
2022 }
2023 return -1;
2024}
2025
caryclark26ad22a2015-10-16 09:03:38 -07002026function idByCurve(test, frag, type) {
2027 var result = draw_path >= 4 ? idByCurveIDMatch(test, frag, type, REC_TYPE_ALIGNED) : [];
2028 if (!result.length) {
2029 result = idByCurveIDMatch(test, frag, type, REC_TYPE_PATH);
2030 }
2031 return result;
2032}
2033
caryclarkdac1d172014-06-17 05:15:38 -07002034function curve_extremes(curve, bounds) {
caryclark1049f122015-04-20 08:31:59 -07002035 var length = curve.length == 7 ? 6 : curve.length;
caryclarked0935a2015-10-22 07:23:52 -07002036 for (var index = 0; index < length; index += 2) {
caryclarkdac1d172014-06-17 05:15:38 -07002037 var x = curve[index];
2038 var y = curve[index + 1];
2039 bounds[0] = Math.min(bounds[0], x);
2040 bounds[1] = Math.min(bounds[1], y);
2041 bounds[2] = Math.max(bounds[2], x);
2042 bounds[3] = Math.max(bounds[3], y);
2043 }
2044}
2045
2046function setScale(x0, x1, y0, y1) {
2047 var srcWidth = x1 - x0;
2048 var srcHeight = y1 - y0;
2049 var usableWidth = screenWidth;
2050 var xDigits = Math.ceil(Math.log(Math.abs(xmax)) / Math.log(10));
2051 var yDigits = Math.ceil(Math.log(Math.abs(ymax)) / Math.log(10));
2052 usableWidth -= (xDigits + yDigits) * 10;
2053 usableWidth -= decimal_places * 10;
2054 if (draw_legend) {
2055 usableWidth -= 40;
2056 }
2057 var hscale = usableWidth / srcWidth;
2058 var vscale = screenHeight / srcHeight;
2059 scale = Math.min(hscale, vscale);
2060 var invScale = 1 / scale;
2061 var sxmin = x0 - invScale * 5;
2062 var symin = y0 - invScale * 10;
2063 var sxmax = x1 + invScale * (6 * decimal_places + 10);
2064 var symax = y1 + invScale * 10;
2065 srcWidth = sxmax - sxmin;
2066 srcHeight = symax - symin;
2067 hscale = usableWidth / srcWidth;
2068 vscale = screenHeight / srcHeight;
2069 scale = Math.min(hscale, vscale);
2070 srcLeft = sxmin;
2071 srcTop = symin;
2072}
2073
2074function drawArc(curve, op, from, to) {
2075 var type = PATH_LINE + (curve.length / 2 - 2);
2076 var pt = pointAtT(curve, type, op ? 0.4 : 0.6);
2077 var dy = pt.y - curve[1];
2078 var dx = pt.x - curve[0];
2079 var dist = Math.sqrt(dy * dy + dx * dx);
2080 var _dist = dist * scale;
2081 var angle = Math.atan2(dy, dx);
2082 var _px = (curve[0] - srcLeft) * scale;
2083 var _py = (curve[1] - srcTop) * scale;
2084 var divisor = 4;
2085 var endDist;
2086 do {
2087 var ends = [];
2088 for (var index = -1; index <= 1; index += 2) {
2089 var px = Math.cos(index * Math.PI / divisor);
2090 var py = Math.sin(index * Math.PI / divisor);
2091 ends.push(px);
2092 ends.push(py);
2093 }
2094 var endDx = (ends[2] - ends[0]) * scale * dist;
2095 var endDy = (ends[3] - ends[1]) * scale * dist;
2096 endDist = Math.sqrt(endDx * endDx + endDy * endDy);
2097 if (endDist < 100) {
2098 break;
2099 }
2100 divisor *= 2;
2101 } while (true);
2102 if (endDist < 30) {
2103 return;
2104 }
2105 if (op) {
2106 divisor *= 2;
2107 }
2108 ctx.strokeStyle = op ? "rgba(210,0,45, 0.4)" : "rgba(90,90,90, 0.5)";
2109 ctx.beginPath();
2110 ctx.arc(_px, _py, _dist, angle - Math.PI / divisor, angle + Math.PI / divisor, false);
2111 ctx.stroke();
2112 var saveAlign = ctx.textAlign;
2113 var saveStyle = ctx.fillStyle;
2114 var saveFont = ctx.font;
2115 ctx.textAlign = "center";
2116 ctx.fillStyle = "black";
2117 ctx.font = "normal 24px Arial";
2118 divisor *= 0.8;
2119 for (var index = -1; index <= 1; index += 2) {
2120 var px = curve[0] + Math.cos(angle + index * Math.PI / divisor) * dist;
2121 var py = curve[1] + Math.sin(angle + index * Math.PI / divisor) * dist;
2122 var _px = (px - srcLeft) * scale;
2123 var _py = (py - srcTop) * scale;
2124 ctx.fillText(index < 0 ? to.toString() : from.toString(), _px, _py + 8);
2125 }
2126 ctx.textAlign = saveAlign;
2127 ctx.fillStyle = saveStyle;
2128 ctx.font = saveFont;
2129}
2130
2131function drawPoint(px, py, end) {
caryclark1049f122015-04-20 08:31:59 -07002132 var length = drawnPts.length == 7 ? 6 : drawnPts.length;
2133 for (var pts = 0; pts < length; pts += 2) {
caryclarkdac1d172014-06-17 05:15:38 -07002134 var x = drawnPts[pts];
2135 var y = drawnPts[pts + 1];
2136 if (px == x && py == y) {
2137 return;
2138 }
2139 }
2140 drawnPts.push(px);
2141 drawnPts.push(py);
2142 var label = px.toFixed(decimal_places) + ", " + py.toFixed(decimal_places);
2143 var _px = (px - srcLeft) * scale;
2144 var _py = (py - srcTop) * scale;
2145 ctx.beginPath();
2146 ctx.arc(_px, _py, 3, 0, Math.PI*2, true);
2147 ctx.closePath();
2148 if (end) {
2149 ctx.fill();
2150 } else {
2151 ctx.stroke();
2152 }
2153 if (debug_xy) {
2154 ctx.textAlign = "left";
2155 ctx.fillText(label, _px + 5, _py);
2156 }
2157}
2158
caryclark1049f122015-04-20 08:31:59 -07002159function coordCount(curveType) {
2160 switch (curveType) {
2161 case PATH_LINE:
2162 return 4;
2163 case PATH_QUAD:
2164 return 6;
2165 case PATH_CONIC:
2166 return 6;
2167 case PATH_CUBIC:
2168 return 8;
2169 }
2170 return -1;
2171}
2172
caryclarkdac1d172014-06-17 05:15:38 -07002173function drawPoints(ptArray, curveType, drawControls) {
caryclark1049f122015-04-20 08:31:59 -07002174 var count = coordCount(curveType);
caryclarkdac1d172014-06-17 05:15:38 -07002175 for (var idx = 0; idx < count; idx += 2) {
2176 if (!drawControls && idx != 0 && idx != count - 2) {
2177 continue;
2178 }
2179 drawPoint(ptArray[idx], ptArray[idx + 1], idx == 0 || idx == count - 2);
2180 }
2181}
2182
2183function drawControlLines(curve, curveType, drawEnd) {
2184 if (curveType == PATH_LINE) {
2185 return;
2186 }
2187 ctx.strokeStyle = "rgba(0,0,0, 0.3)";
2188 drawLine(curve[0], curve[1], curve[2], curve[3]);
2189 drawLine(curve[2], curve[3], curve[4], curve[5]);
2190 if (curveType == PATH_CUBIC) {
2191 drawLine(curve[4], curve[5], curve[6], curve[7]);
2192 if (drawEnd > 1) {
2193 drawLine(curve[6], curve[7], curve[0], curve[1]);
2194 if (drawEnd > 2) {
2195 drawLine(curve[0], curve[1], curve[4], curve[5]);
2196 drawLine(curve[6], curve[7], curve[2], curve[3]);
2197 }
2198 }
2199 } else if (drawEnd > 1) {
2200 drawLine(curve[4], curve[5], curve[0], curve[1]);
2201 }
2202}
2203
2204function pointAtT(curve, curveType, t) {
2205 var xy = {};
2206 switch (curveType) {
2207 case PATH_LINE:
2208 var a = 1 - t;
2209 var b = t;
2210 xy.x = a * curve[0] + b * curve[2];
2211 xy.y = a * curve[1] + b * curve[3];
2212 break;
2213 case PATH_QUAD:
2214 var one_t = 1 - t;
2215 var a = one_t * one_t;
2216 var b = 2 * one_t * t;
2217 var c = t * t;
2218 xy.x = a * curve[0] + b * curve[2] + c * curve[4];
2219 xy.y = a * curve[1] + b * curve[3] + c * curve[5];
2220 break;
caryclark1049f122015-04-20 08:31:59 -07002221 case PATH_CONIC:
2222 var one_t = 1 - t;
2223 var a = one_t * one_t;
2224 var b = 2 * one_t * t;
2225 var c = t * t;
2226 xy.x = a * curve[0] + b * curve[2] * curve[6] + c * curve[4];
2227 xy.y = a * curve[1] + b * curve[3] * curve[6] + c * curve[5];
2228 var d = a + b * curve[6] + c;
2229 xy.x /= d;
2230 xy.y /= d;
2231 break;
caryclarkdac1d172014-06-17 05:15:38 -07002232 case PATH_CUBIC:
2233 var one_t = 1 - t;
2234 var one_t2 = one_t * one_t;
2235 var a = one_t2 * one_t;
2236 var b = 3 * one_t2 * t;
2237 var t2 = t * t;
2238 var c = 3 * one_t * t2;
2239 var d = t2 * t;
2240 xy.x = a * curve[0] + b * curve[2] + c * curve[4] + d * curve[6];
2241 xy.y = a * curve[1] + b * curve[3] + c * curve[5] + d * curve[7];
2242 break;
2243 }
2244 return xy;
2245}
2246
2247function drawPointAtT(curve, curveType) {
2248 var x, y;
2249 var xy = pointAtT(curve, curveType, curveT);
2250 drawPoint(xy.x, xy.y, true);
2251 if (!draw_intersectT) {
2252 return;
2253 }
2254 ctx.fillStyle = "red";
2255 drawTAtPointUp(xy.x, xy.y, curveT);
2256}
2257
2258function drawTAtPointUp(px, py, t) {
2259 var label = t.toFixed(decimal_places);
2260 var _px = (px - srcLeft)* scale;
2261 var _py = (py - srcTop) * scale;
2262 ctx.fillText(label, _px + 5, _py - 10);
2263}
2264
2265function drawTAtPointDown(px, py, t) {
2266 var label = t.toFixed(decimal_places);
2267 var _px = (px - srcLeft)* scale;
2268 var _py = (py - srcTop) * scale;
2269 ctx.fillText(label, _px + 5, _py + 10);
2270}
2271
2272function alreadyDrawnLine(x1, y1, x2, y2) {
2273 if (collect_bounds) {
2274 if (focus_enabled) {
2275 focusXmin = Math.min(focusXmin, x1, x2);
2276 focusYmin = Math.min(focusYmin, y1, y2);
2277 focusXmax = Math.max(focusXmax, x1, x2);
2278 focusYmax = Math.max(focusYmax, y1, y2);
2279 }
2280 return true;
2281 }
2282 for (var pts = 0; pts < drawnLines.length; pts += 4) {
2283 if (x1 == drawnLines[pts] && y1 == drawnLines[pts + 1]
2284 && x2 == drawnLines[pts + 2] && y2 == drawnLines[pts + 3]) {
2285 return true;
2286 }
2287 }
2288 drawnLines.push(x1);
2289 drawnLines.push(y1);
2290 drawnLines.push(x2);
2291 drawnLines.push(y2);
2292 return false;
2293}
2294
2295function drawLine(x1, y1, x2, y2) {
2296 if (alreadyDrawnLine(x1, y1, x2, y2)) {
2297 return;
2298 }
2299 ctx.beginPath();
2300 ctx.moveTo((x1 - srcLeft) * scale,
2301 (y1 - srcTop) * scale);
2302 ctx.lineTo((x2 - srcLeft) * scale,
2303 (y2 - srcTop) * scale);
2304 ctx.stroke();
2305}
2306
2307function linePartial(x1, y1, x2, y2, t1, t2) {
2308 var dx = x1 - x2;
2309 var dy = y1 - y2;
2310 var array = [
2311 x1 - t1 * dx,
2312 y1 - t1 * dy,
2313 x1 - t2 * dx,
2314 y1 - t2 * dy
2315 ];
2316 return array;
2317}
2318
2319function drawLinePartial(x1, y1, x2, y2, t1, t2) {
2320 var a = linePartial(x1, y1, x2, y2, t1, t2);
2321 var ax = a[0];
2322 var ay = a[1];
2323 var bx = a[2];
2324 var by = a[3];
2325 if (alreadyDrawnLine(ax, ay, bx, by)) {
2326 return;
2327 }
2328 ctx.beginPath();
2329 ctx.moveTo((ax - srcLeft) * scale,
2330 (ay - srcTop) * scale);
2331 ctx.lineTo((bx - srcLeft) * scale,
2332 (by - srcTop) * scale);
2333 ctx.stroke();
2334}
2335
2336function alreadyDrawnQuad(x1, y1, x2, y2, x3, y3) {
2337 if (collect_bounds) {
2338 if (focus_enabled) {
2339 focusXmin = Math.min(focusXmin, x1, x2, x3);
2340 focusYmin = Math.min(focusYmin, y1, y2, y3);
2341 focusXmax = Math.max(focusXmax, x1, x2, x3);
2342 focusYmax = Math.max(focusYmax, y1, y2, y3);
2343 }
2344 return true;
2345 }
2346 for (var pts = 0; pts < drawnQuads.length; pts += 6) {
2347 if (x1 == drawnQuads[pts] && y1 == drawnQuads[pts + 1]
2348 && x2 == drawnQuads[pts + 2] && y2 == drawnQuads[pts + 3]
2349 && x3 == drawnQuads[pts + 4] && y3 == drawnQuads[pts + 5]) {
2350 return true;
2351 }
2352 }
2353 drawnQuads.push(x1);
2354 drawnQuads.push(y1);
2355 drawnQuads.push(x2);
2356 drawnQuads.push(y2);
2357 drawnQuads.push(x3);
2358 drawnQuads.push(y3);
2359 return false;
2360}
2361
2362function drawQuad(x1, y1, x2, y2, x3, y3) {
2363 if (alreadyDrawnQuad(x1, y1, x2, y2, x3, y3)) {
2364 return;
2365 }
2366 ctx.beginPath();
2367 ctx.moveTo((x1 - srcLeft) * scale,
2368 (y1 - srcTop) * scale);
2369 ctx.quadraticCurveTo((x2 - srcLeft) * scale,
2370 (y2 - srcTop) * scale,
2371 (x3 - srcLeft) * scale,
2372 (y3 - srcTop) * scale);
2373 ctx.stroke();
2374}
2375
2376function interp(A, B, t) {
2377 return A + (B - A) * t;
2378}
2379
2380function interp_quad_coords(x1, x2, x3, t)
2381{
2382 var ab = interp(x1, x2, t);
2383 var bc = interp(x2, x3, t);
2384 var abc = interp(ab, bc, t);
2385 return abc;
2386}
2387
2388function quadPartial(x1, y1, x2, y2, x3, y3, t1, t2) {
2389 var ax = interp_quad_coords(x1, x2, x3, t1);
2390 var ay = interp_quad_coords(y1, y2, y3, t1);
2391 var dx = interp_quad_coords(x1, x2, x3, (t1 + t2) / 2);
2392 var dy = interp_quad_coords(y1, y2, y3, (t1 + t2) / 2);
2393 var cx = interp_quad_coords(x1, x2, x3, t2);
2394 var cy = interp_quad_coords(y1, y2, y3, t2);
2395 var bx = 2*dx - (ax + cx)/2;
2396 var by = 2*dy - (ay + cy)/2;
2397 var array = [
2398 ax, ay, bx, by, cx, cy
2399 ];
2400 return array;
2401}
2402
2403function drawQuadPartial(x1, y1, x2, y2, x3, y3, t1, t2) {
2404 var a = quadPartial(x1, y1, x2, y2, x3, y3, t1, t2);
2405 var ax = a[0];
2406 var ay = a[1];
2407 var bx = a[2];
2408 var by = a[3];
2409 var cx = a[4];
2410 var cy = a[5];
2411 if (alreadyDrawnQuad(ax, ay, bx, by, cx, cy)) {
2412 return;
2413 }
2414 ctx.beginPath();
2415 ctx.moveTo((ax - srcLeft) * scale,
2416 (ay - srcTop) * scale);
2417 ctx.quadraticCurveTo((bx - srcLeft) * scale,
2418 (by - srcTop) * scale,
2419 (cx - srcLeft) * scale,
2420 (cy - srcTop) * scale);
2421 ctx.stroke();
2422}
2423
caryclark1049f122015-04-20 08:31:59 -07002424function alreadyDrawnConic(x1, y1, x2, y2, x3, y3, w) {
2425 if (collect_bounds) {
2426 if (focus_enabled) {
2427 focusXmin = Math.min(focusXmin, x1, x2, x3);
2428 focusYmin = Math.min(focusYmin, y1, y2, y3);
2429 focusXmax = Math.max(focusXmax, x1, x2, x3);
2430 focusYmax = Math.max(focusYmax, y1, y2, y3);
2431 }
2432 return true;
2433 }
2434 for (var pts = 0; pts < drawnConics.length; pts += 8) {
2435 if (x1 == drawnConics[pts] && y1 == drawnCubics[pts + 1]
2436 && x2 == drawnCubics[pts + 2] && y2 == drawnCubics[pts + 3]
2437 && x3 == drawnCubics[pts + 4] && y3 == drawnCubics[pts + 5]
2438 && w == drawnCubics[pts + 6]) {
2439 return true;
2440 }
2441 }
2442 drawnConics.push(x1);
2443 drawnConics.push(y1);
2444 drawnConics.push(x2);
2445 drawnConics.push(y2);
2446 drawnConics.push(x3);
2447 drawnConics.push(y3);
2448 drawnCubics.push(w);
2449 return false;
2450}
2451
2452var kMaxConicToQuadPOW2 = 5;
2453
2454function computeQuadPOW2(curve, tol) {
2455 var a = curve[6] - 1;
2456 var k = a / (4 * (2 + a));
2457 var x = k * (curve[0] - 2 * curve[2] + curve[4]);
2458 var y = k * (curve[1] - 2 * curve[3] + curve[5]);
2459
2460 var error = Math.sqrt(x * x + y * y);
2461 var pow2;
2462 for (pow2 = 0; pow2 < kMaxConicToQuadPOW2; ++pow2) {
2463 if (error <= tol) {
2464 break;
2465 }
2466 error *= 0.25;
2467 }
2468 return pow2;
2469}
2470
2471function subdivide_w_value(w) {
2472 return Math.sqrt(0.5 + w * 0.5);
2473}
2474
2475function chop(curve, part1, part2) {
2476 var w = curve[6];
2477 var scale = 1 / (1 + w);
2478 part1[0] = curve[0];
2479 part1[1] = curve[1];
2480 part1[2] = (curve[0] + curve[2] * w) * scale;
2481 part1[3] = (curve[1] + curve[3] * w) * scale;
2482 part1[4] = part2[0] = (curve[0] + (curve[2] * w) * 2 + curve[4]) * scale * 0.5;
2483 part1[5] = part2[1] = (curve[1] + (curve[3] * w) * 2 + curve[5]) * scale * 0.5;
2484 part2[2] = (curve[2] * w + curve[4]) * scale;
2485 part2[3] = (curve[3] * w + curve[5]) * scale;
2486 part2[4] = curve[4];
2487 part2[5] = curve[5];
2488 part1[6] = part2[6] = subdivide_w_value(w);
2489}
2490
2491function subdivide(curve, level, pts) {
2492 if (0 == level) {
2493 pts.push(curve[2]);
2494 pts.push(curve[3]);
2495 pts.push(curve[4]);
2496 pts.push(curve[5]);
2497 } else {
2498 var part1 = [], part2 = [];
2499 chop(curve, part1, part2);
2500 --level;
2501 subdivide(part1, level, pts);
2502 subdivide(part2, level, pts);
2503 }
2504}
2505
2506function chopIntoQuadsPOW2(curve, pow2, pts) {
2507 subdivide(curve, pow2, pts);
2508 return 1 << pow2;
2509}
2510
2511function drawConicWithQuads(x1, y1, x2, y2, x3, y3, w) {
2512 if (alreadyDrawnConic(x1, y1, x2, y2, x3, y3, w)) {
2513 return;
2514 }
2515 ctx.beginPath();
2516 ctx.moveTo((x1 - srcLeft) * scale,
2517 (y1 - srcTop) * scale);
2518 var tol = 1 / scale;
2519 var curve = [x1, y1, x2, y2, x3, y3, w];
2520 var pow2 = computeQuadPOW2(curve, tol);
2521 var pts = [];
2522 chopIntoQuadsPOW2(curve, pow2, pts);
2523 for (var i = 0; i < pts.length; i += 4) {
2524 ctx.quadraticCurveTo(
2525 (pts[i + 0] - srcLeft) * scale, (pts[i + 1] - srcTop) * scale,
2526 (pts[i + 2] - srcLeft) * scale, (pts[i + 3] - srcTop) * scale);
2527 }
2528 ctx.stroke();
2529}
2530
2531function conic_eval_numerator(x1, x2, x3, w, t) {
2532 var src2w = x2 * w;
2533 var C = x1;
2534 var A = x3 - 2 * src2w + C;
2535 var B = 2 * (src2w - C);
2536 return (A * t + B) * t + C;
2537}
2538
2539
2540function conic_eval_denominator(w, t) {
2541 var B = 2 * (w - 1);
2542 var C = 1;
2543 var A = -B;
2544 return (A * t + B) * t + C;
2545}
2546
2547function conicPartial(x1, y1, x2, y2, x3, y3, w, t1, t2) {
2548 var ax = conic_eval_numerator(x1, x2, x3, w, t1);
2549 var ay = conic_eval_numerator(y1, y2, y3, w, t1);
2550 var az = conic_eval_denominator(w, t1);
2551 var midT = (t1 + t2) / 2;
2552 var dx = conic_eval_numerator(x1, x2, x3, w, midT);
2553 var dy = conic_eval_numerator(y1, y2, y3, w, midT);
2554 var dz = conic_eval_denominator(w, midT);
2555 var cx = conic_eval_numerator(x1, x2, x3, w, t2);
2556 var cy = conic_eval_numerator(y1, y2, y3, w, t2);
2557 var cz = conic_eval_denominator(w, t2);
2558 var bx = 2 * dx - (ax + cx) / 2;
2559 var by = 2 * dy - (ay + cy) / 2;
2560 var bz = 2 * dz - (az + cz) / 2;
2561 var dt = t2 - t1;
2562 var dt_1 = 1 - dt;
caryclark1049f122015-04-20 08:31:59 -07002563 var array = [
caryclarked0935a2015-10-22 07:23:52 -07002564 ax / az, ay / az, bx / bz, by / bz, cx / cz, cy / cz, 0
caryclark1049f122015-04-20 08:31:59 -07002565 ];
caryclarked0935a2015-10-22 07:23:52 -07002566 var dMidAC = { x:(array[0] + array[4]) / 2, y:(array[1] + array[5]) / 2 };
2567 var dMid = { x:dx / dz, y:dy / dz };
2568 var dWNumer = { x:dMidAC.x - dMid.x, y:dMidAC.y - dMid.y };
2569 var dWDenom = { x:dMid.x - array[2], y:dMid.y - array[3] };
2570 var partW = Math.sqrt(dWNumer.x * dWNumer.x + dWNumer.y * dWNumer.y)
2571 / Math.sqrt(dWDenom.x * dWDenom.x + dWDenom.y * dWDenom.y);
2572 array[6] = partW;
caryclark1049f122015-04-20 08:31:59 -07002573 return array;
2574}
2575
2576function drawConicPartial(x1, y1, x2, y2, x3, y3, w, t1, t2) {
2577 var a = conicPartial(x1, y1, x2, y2, x3, y3, w, t1, t2);
2578 var ax = a[0];
2579 var ay = a[1];
2580 var bx = a[2];
2581 var by = a[3];
2582 var cx = a[4];
2583 var cy = a[5];
2584 var w_ = a[6];
2585 drawConicWithQuads(ax, ay, bx, by, cx, cy, w_);
2586}
2587
caryclarkdac1d172014-06-17 05:15:38 -07002588function alreadyDrawnCubic(x1, y1, x2, y2, x3, y3, x4, y4) {
2589 if (collect_bounds) {
2590 if (focus_enabled) {
2591 focusXmin = Math.min(focusXmin, x1, x2, x3, x4);
2592 focusYmin = Math.min(focusYmin, y1, y2, y3, y4);
2593 focusXmax = Math.max(focusXmax, x1, x2, x3, x4);
2594 focusYmax = Math.max(focusYmax, y1, y2, y3, y4);
2595 }
2596 return true;
2597 }
2598 for (var pts = 0; pts < drawnCubics.length; pts += 8) {
2599 if (x1 == drawnCubics[pts] && y1 == drawnCubics[pts + 1]
2600 && x2 == drawnCubics[pts + 2] && y2 == drawnCubics[pts + 3]
2601 && x3 == drawnCubics[pts + 4] && y3 == drawnCubics[pts + 5]
2602 && x4 == drawnCubics[pts + 6] && y4 == drawnCubics[pts + 7]) {
2603 return true;
2604 }
2605 }
2606 drawnCubics.push(x1);
2607 drawnCubics.push(y1);
2608 drawnCubics.push(x2);
2609 drawnCubics.push(y2);
2610 drawnCubics.push(x3);
2611 drawnCubics.push(y3);
2612 drawnCubics.push(x4);
2613 drawnCubics.push(y4);
2614 return false;
2615}
2616
2617function drawCubic(x1, y1, x2, y2, x3, y3, x4, y4) {
2618 if (alreadyDrawnCubic(x1, y1, x2, y2, x3, y3, x4, y4)) {
2619 return;
2620 }
2621 ctx.beginPath();
2622 ctx.moveTo((x1 - srcLeft) * scale,
2623 (y1 - srcTop) * scale);
2624 ctx.bezierCurveTo((x2 - srcLeft) * scale,
2625 (y2 - srcTop) * scale,
2626 (x3 - srcLeft) * scale,
2627 (y3 - srcTop) * scale,
2628 (x4 - srcLeft) * scale,
2629 (y4 - srcTop) * scale);
2630 ctx.stroke();
2631}
2632
2633function interp_cubic_coords(x1, x2, x3, x4, t)
2634{
2635 var ab = interp(x1, x2, t);
2636 var bc = interp(x2, x3, t);
2637 var cd = interp(x3, x4, t);
2638 var abc = interp(ab, bc, t);
2639 var bcd = interp(bc, cd, t);
2640 var abcd = interp(abc, bcd, t);
2641 return abcd;
2642}
2643
2644function cubicPartial(x1, y1, x2, y2, x3, y3, x4, y4, t1, t2) {
2645 var ax = interp_cubic_coords(x1, x2, x3, x4, t1);
2646 var ay = interp_cubic_coords(y1, y2, y3, y4, t1);
2647 var ex = interp_cubic_coords(x1, x2, x3, x4, (t1*2+t2)/3);
2648 var ey = interp_cubic_coords(y1, y2, y3, y4, (t1*2+t2)/3);
2649 var fx = interp_cubic_coords(x1, x2, x3, x4, (t1+t2*2)/3);
2650 var fy = interp_cubic_coords(y1, y2, y3, y4, (t1+t2*2)/3);
2651 var dx = interp_cubic_coords(x1, x2, x3, x4, t2);
2652 var dy = interp_cubic_coords(y1, y2, y3, y4, t2);
2653 var mx = ex * 27 - ax * 8 - dx;
2654 var my = ey * 27 - ay * 8 - dy;
2655 var nx = fx * 27 - ax - dx * 8;
2656 var ny = fy * 27 - ay - dy * 8;
2657 var bx = (mx * 2 - nx) / 18;
2658 var by = (my * 2 - ny) / 18;
2659 var cx = (nx * 2 - mx) / 18;
2660 var cy = (ny * 2 - my) / 18;
2661 var array = [
2662 ax, ay, bx, by, cx, cy, dx, dy
2663 ];
2664 return array;
2665}
2666
2667function drawCubicPartial(x1, y1, x2, y2, x3, y3, x4, y4, t1, t2) {
2668 var a = cubicPartial(x1, y1, x2, y2, x3, y3, x4, y4, t1, t2);
2669 var ax = a[0];
2670 var ay = a[1];
2671 var bx = a[2];
2672 var by = a[3];
2673 var cx = a[4];
2674 var cy = a[5];
2675 var dx = a[6];
2676 var dy = a[7];
2677 if (alreadyDrawnCubic(ax, ay, bx, by, cx, cy, dx, dy)) {
2678 return;
2679 }
2680 ctx.beginPath();
2681 ctx.moveTo((ax - srcLeft) * scale,
2682 (ay - srcTop) * scale);
2683 ctx.bezierCurveTo((bx - srcLeft) * scale,
2684 (by - srcTop) * scale,
2685 (cx - srcLeft) * scale,
2686 (cy - srcTop) * scale,
2687 (dx - srcLeft) * scale,
2688 (dy - srcTop) * scale);
2689 ctx.stroke();
2690}
2691
2692function drawCurve(c) {
2693 switch (c.length) {
2694 case 4:
2695 drawLine(c[0], c[1], c[2], c[3]);
2696 break;
2697 case 6:
2698 drawQuad(c[0], c[1], c[2], c[3], c[4], c[5]);
2699 break;
caryclark1049f122015-04-20 08:31:59 -07002700 case 7:
2701 drawConicWithQuads(c[0], c[1], c[2], c[3], c[4], c[5], c[6]);
2702 break;
caryclarkdac1d172014-06-17 05:15:38 -07002703 case 8:
2704 drawCubic(c[0], c[1], c[2], c[3], c[4], c[5], c[6], c[7]);
2705 break;
2706 }
2707}
2708
2709function boundsWidth(pts) {
2710 var min = pts[0];
2711 var max = pts[0];
caryclark1049f122015-04-20 08:31:59 -07002712 var length = pts.length == 7 ? 6 : pts.length;
2713 for (var idx = 2; idx < length; idx += 2) {
caryclarkdac1d172014-06-17 05:15:38 -07002714 min = Math.min(min, pts[idx]);
2715 max = Math.max(max, pts[idx]);
2716 }
2717 return max - min;
2718}
2719
2720function boundsHeight(pts) {
2721 var min = pts[1];
2722 var max = pts[1];
caryclark1049f122015-04-20 08:31:59 -07002723 var length = pts.length == 7 ? 6 : pts.length;
2724 for (var idx = 3; idx < length; idx += 2) {
caryclarkdac1d172014-06-17 05:15:38 -07002725 min = Math.min(min, pts[idx]);
2726 max = Math.max(max, pts[idx]);
2727 }
2728 return max - min;
2729}
2730
2731function tangent(pts) {
2732 var dx = pts[2] - pts[0];
2733 var dy = pts[3] - pts[1];
2734 if (dx == 0 && dy == 0 && pts.length > 4) {
2735 dx = pts[4] - pts[0];
2736 dy = pts[5] - pts[1];
caryclark1049f122015-04-20 08:31:59 -07002737 if (dx == 0 && dy == 0 && pts.length == 8) {
caryclarkdac1d172014-06-17 05:15:38 -07002738 dx = pts[6] - pts[0];
2739 dy = pts[7] - pts[1];
2740 }
2741 }
2742 return Math.atan2(-dy, dx);
2743}
2744
2745function hodograph(cubic) {
2746 var hodo = [];
2747 hodo[0] = 3 * (cubic[2] - cubic[0]);
2748 hodo[1] = 3 * (cubic[3] - cubic[1]);
2749 hodo[2] = 3 * (cubic[4] - cubic[2]);
2750 hodo[3] = 3 * (cubic[5] - cubic[3]);
2751 hodo[4] = 3 * (cubic[6] - cubic[4]);
2752 hodo[5] = 3 * (cubic[7] - cubic[5]);
2753 return hodo;
2754}
2755
2756function hodograph2(cubic) {
2757 var quad = hodograph(cubic);
2758 var hodo = [];
2759 hodo[0] = 2 * (quad[2] - quad[0]);
2760 hodo[1] = 2 * (quad[3] - quad[1]);
2761 hodo[2] = 2 * (quad[4] - quad[2]);
2762 hodo[3] = 2 * (quad[5] - quad[3]);
2763 return hodo;
2764}
2765
2766function quadraticRootsReal(A, B, C, s) {
2767 if (A == 0) {
2768 if (B == 0) {
2769 s[0] = 0;
2770 return C == 0;
2771 }
2772 s[0] = -C / B;
2773 return 1;
2774 }
2775 /* normal form: x^2 + px + q = 0 */
2776 var p = B / (2 * A);
2777 var q = C / A;
2778 var p2 = p * p;
2779 if (p2 < q) {
2780 return 0;
2781 }
2782 var sqrt_D = 0;
2783 if (p2 > q) {
2784 sqrt_D = sqrt(p2 - q);
2785 }
2786 s[0] = sqrt_D - p;
2787 s[1] = -sqrt_D - p;
2788 return 1 + s[0] != s[1];
2789}
2790
2791function add_valid_ts(s, realRoots, t) {
2792 var foundRoots = 0;
2793 for (var index = 0; index < realRoots; ++index) {
2794 var tValue = s[index];
2795 if (tValue >= 0 && tValue <= 1) {
2796 for (var idx2 = 0; idx2 < foundRoots; ++idx2) {
2797 if (t[idx2] != tValue) {
2798 t[foundRoots++] = tValue;
2799 }
2800 }
2801 }
2802 }
2803 return foundRoots;
2804}
2805
2806function quadraticRootsValidT(a, b, c, t) {
2807 var s = [];
2808 var realRoots = quadraticRootsReal(A, B, C, s);
2809 var foundRoots = add_valid_ts(s, realRoots, t);
2810 return foundRoots != 0;
2811}
2812
2813function find_cubic_inflections(cubic, tValues) {
2814 var Ax = src[2] - src[0];
2815 var Ay = src[3] - src[1];
2816 var Bx = src[4] - 2 * src[2] + src[0];
2817 var By = src[5] - 2 * src[3] + src[1];
2818 var Cx = src[6] + 3 * (src[2] - src[4]) - src[0];
2819 var Cy = src[7] + 3 * (src[3] - src[5]) - src[1];
2820 return quadraticRootsValidT(Bx * Cy - By * Cx, (Ax * Cy - Ay * Cx),
2821 Ax * By - Ay * Bx, tValues);
2822}
2823
2824function dxy_at_t(curve, type, t) {
2825 var dxy = {};
2826 if (type == PATH_QUAD) {
2827 var a = t - 1;
2828 var b = 1 - 2 * t;
2829 var c = t;
2830 dxy.x = a * curve[0] + b * curve[2] + c * curve[4];
2831 dxy.y = a * curve[1] + b * curve[3] + c * curve[5];
caryclark1049f122015-04-20 08:31:59 -07002832 } else if (type == PATH_CONIC) {
2833 var p20x = curve[4] - curve[0];
2834 var p20y = curve[5] - curve[1];
2835 var p10xw = (curve[2] - curve[0]) * curve[6];
2836 var p10yw = (curve[3] - curve[1]) * curve[6];
2837 var coeff0x = curve[6] * p20x - p20x;
2838 var coeff0y = curve[6] * p20y - p20y;
2839 var coeff1x = p20x - 2 * p10xw;
2840 var coeff1y = p20y - 2 * p10yw;
2841 dxy.x = t * (t * coeff0x + coeff1x) + p10xw;
2842 dxy.y = t * (t * coeff0y + coeff1y) + p10yw;
caryclarkdac1d172014-06-17 05:15:38 -07002843 } else if (type == PATH_CUBIC) {
2844 var one_t = 1 - t;
2845 var a = curve[0];
2846 var b = curve[2];
2847 var c = curve[4];
2848 var d = curve[6];
2849 dxy.x = 3 * ((b - a) * one_t * one_t + 2 * (c - b) * t * one_t + (d - c) * t * t);
2850 a = curve[1];
2851 b = curve[3];
2852 c = curve[5];
2853 d = curve[7];
2854 dxy.y = 3 * ((b - a) * one_t * one_t + 2 * (c - b) * t * one_t + (d - c) * t * t);
2855 }
2856 return dxy;
2857}
2858
2859function drawLabel(num, px, py) {
2860 ctx.beginPath();
2861 ctx.arc(px, py, 8, 0, Math.PI*2, true);
2862 ctx.closePath();
2863 ctx.strokeStyle = "rgba(0,0,0, 0.4)";
2864 ctx.lineWidth = num == 0 || num == 3 ? 2 : 1;
2865 ctx.stroke();
2866 ctx.fillStyle = "black";
2867 ctx.font = "normal 10px Arial";
2868 // ctx.rotate(0.001);
2869 ctx.fillText(num, px - 2, py + 3);
2870 // ctx.rotate(-0.001);
2871}
2872
2873function drawLabelX(ymin, num, loc) {
2874 var px = (loc - srcLeft) * scale;
2875 var py = (ymin - srcTop) * scale - 20;
2876 drawLabel(num, px, py);
2877}
2878
2879function drawLabelY(xmin, num, loc) {
2880 var px = (xmin - srcLeft) * scale - 20;
2881 var py = (loc - srcTop) * scale;
2882 drawLabel(num, px, py);
2883}
2884
2885function drawHodoOrigin(hx, hy, hMinX, hMinY, hMaxX, hMaxY) {
2886 ctx.beginPath();
2887 ctx.moveTo(hx, hy - 100);
2888 ctx.lineTo(hx, hy);
2889 ctx.strokeStyle = hMinY < 0 ? "green" : "blue";
2890 ctx.stroke();
2891 ctx.beginPath();
2892 ctx.moveTo(hx, hy);
2893 ctx.lineTo(hx, hy + 100);
2894 ctx.strokeStyle = hMaxY > 0 ? "green" : "blue";
2895 ctx.stroke();
2896 ctx.beginPath();
2897 ctx.moveTo(hx - 100, hy);
2898 ctx.lineTo(hx, hy);
2899 ctx.strokeStyle = hMinX < 0 ? "green" : "blue";
2900 ctx.stroke();
2901 ctx.beginPath();
2902 ctx.moveTo(hx, hy);
2903 ctx.lineTo(hx + 100, hy);
2904 ctx.strokeStyle = hMaxX > 0 ? "green" : "blue";
2905 ctx.stroke();
2906}
2907
2908function scalexy(x, y, mag) {
2909 var length = Math.sqrt(x * x + y * y);
2910 return mag / length;
2911}
2912
caryclark03b03ca2015-04-23 09:13:37 -07002913function drawArrow(x, y, dx, dy, s) {
2914 var dscale = scalexy(dx, dy, 1 / scale * 100 * s);
caryclarkdac1d172014-06-17 05:15:38 -07002915 dx *= dscale;
2916 dy *= dscale;
2917 ctx.beginPath();
2918 ctx.moveTo((x - srcLeft) * scale, (y - srcTop) * scale);
2919 x += dx;
2920 y += dy;
2921 ctx.lineTo((x - srcLeft) * scale, (y - srcTop) * scale);
2922 dx /= 10;
2923 dy /= 10;
2924 ctx.lineTo((x - dy - srcLeft) * scale, (y + dx - srcTop) * scale);
2925 ctx.lineTo((x + dx * 2 - srcLeft) * scale, (y + dy * 2 - srcTop) * scale);
2926 ctx.lineTo((x + dy - srcLeft) * scale, (y - dx - srcTop) * scale);
2927 ctx.lineTo((x - srcLeft) * scale, (y - srcTop) * scale);
2928 ctx.strokeStyle = "rgba(0,75,0, 0.4)";
2929 ctx.stroke();
2930}
2931
2932function x_at_t(curve, t) {
2933 var one_t = 1 - t;
2934 if (curve.length == 4) {
2935 return one_t * curve[0] + t * curve[2];
2936 }
2937 var one_t2 = one_t * one_t;
2938 var t2 = t * t;
2939 if (curve.length == 6) {
2940 return one_t2 * curve[0] + 2 * one_t * t * curve[2] + t2 * curve[4];
2941 }
caryclark1049f122015-04-20 08:31:59 -07002942 if (curve.length == 7) {
2943 return (one_t2 * curve[0] + 2 * one_t * t * curve[2] * curve[6] + t2 * curve[4])
2944 / (one_t2 +2 * one_t * t * curve[6] + t2);
2945 }
caryclarkdac1d172014-06-17 05:15:38 -07002946 var a = one_t2 * one_t;
2947 var b = 3 * one_t2 * t;
2948 var c = 3 * one_t * t2;
2949 var d = t2 * t;
2950 return a * curve[0] + b * curve[2] + c * curve[4] + d * curve[6];
2951}
2952
2953function y_at_t(curve, t) {
2954 var one_t = 1 - t;
2955 if (curve.length == 4) {
2956 return one_t * curve[1] + t * curve[3];
2957 }
2958 var one_t2 = one_t * one_t;
2959 var t2 = t * t;
2960 if (curve.length == 6) {
2961 return one_t2 * curve[1] + 2 * one_t * t * curve[3] + t2 * curve[5];
2962 }
caryclark1049f122015-04-20 08:31:59 -07002963 if (curve.length == 7) {
2964 return (one_t2 * curve[1] + 2 * one_t * t * curve[3] * curve[6] + t2 * curve[5])
2965 / (one_t2 +2 * one_t * t * curve[6] + t2);
2966 }
caryclarkdac1d172014-06-17 05:15:38 -07002967 var a = one_t2 * one_t;
2968 var b = 3 * one_t2 * t;
2969 var c = 3 * one_t * t2;
2970 var d = t2 * t;
2971 return a * curve[1] + b * curve[3] + c * curve[5] + d * curve[7];
2972}
2973
2974function drawOrder(curve, label) {
2975 var px = x_at_t(curve, 0.75);
2976 var py = y_at_t(curve, 0.75);
2977 var _px = (px - srcLeft) * scale;
2978 var _py = (py - srcTop) * scale;
2979 ctx.beginPath();
2980 ctx.arc(_px, _py, 15, 0, Math.PI * 2, true);
2981 ctx.closePath();
2982 ctx.fillStyle = "white";
2983 ctx.fill();
2984 if (label == 'L') {
2985 ctx.strokeStyle = "rgba(255,0,0, 1)";
2986 ctx.fillStyle = "rgba(255,0,0, 1)";
2987 } else {
2988 ctx.strokeStyle = "rgba(0,0,255, 1)";
2989 ctx.fillStyle = "rgba(0,0,255, 1)";
2990 }
2991 ctx.stroke();
2992 ctx.font = "normal 16px Arial";
2993 ctx.textAlign = "center";
2994 ctx.fillText(label, _px, _py + 5);
2995 ctx.font = "normal 10px Arial";
2996}
2997
2998function drawID(curve, id) {
2999 var px = x_at_t(curve, 0.5);
3000 var py = y_at_t(curve, 0.5);
3001 var _px = (px - srcLeft) * scale;
3002 var _py = (py - srcTop) * scale;
3003 draw_id_at(id, _px, _py);
3004}
3005
3006function draw_id_at(id, _px, _py) {
3007 ctx.beginPath();
3008 ctx.arc(_px, _py, 15, 0, Math.PI * 2, true);
3009 ctx.closePath();
3010 ctx.fillStyle = "white";
3011 ctx.fill();
3012 ctx.strokeStyle = "rgba(127,127,0, 1)";
3013 ctx.fillStyle = "rgba(127,127,0, 1)";
3014 ctx.stroke();
3015 ctx.font = "normal 16px Arial";
3016 ctx.textAlign = "center";
3017 ctx.fillText(id, _px, _py + 5);
3018 ctx.font = "normal 10px Arial";
3019}
3020
3021function drawLinePartialID(id, x1, y1, x2, y2, t1, t2) {
3022 var curve = [x1, y1, x2, y2];
3023 drawCurvePartialID(id, curve, t1, t2);
3024}
3025
3026function drawQuadPartialID(id, x1, y1, x2, y2, x3, y3, t1, t2) {
3027 var curve = [x1, y1, x2, y2, x3, y3];
3028 drawCurvePartialID(id, curve, t1, t2);
3029}
3030
caryclark1049f122015-04-20 08:31:59 -07003031function drawConicPartialID(id, x1, y1, x2, y2, x3, y3, w, t1, t2) {
3032 var curve = [x1, y1, x2, y2, x3, y3, w];
3033 drawCurvePartialID(id, curve, t1, t2);
3034}
3035
caryclarkdac1d172014-06-17 05:15:38 -07003036function drawCubicPartialID(id, x1, y1, x2, y2, x3, y3, x4, y4, t1, t2) {
3037 var curve = [x1, y1, x2, y2, x3, y3, x4, y4];
3038 drawCurvePartialID(id, curve, t1, t2);
3039}
3040
3041function drawCurvePartialID(id, curve, t1, t2) {
3042 var px = x_at_t(curve, (t1 + t2) / 2);
3043 var py = y_at_t(curve, (t1 + t2) / 2);
3044 var _px = (px - srcLeft) * scale;
3045 var _py = (py - srcTop) * scale;
3046 draw_id_at(id, _px, _py);
3047}
3048
3049function drawCurveSpecials(test, curve, type) {
3050 if (pt_labels) {
3051 drawPoints(curve, type, pt_labels == 2);
3052 }
3053 if (control_lines != 0) {
3054 drawControlLines(curve, type, control_lines);
3055 }
3056 if (curve_t) {
3057 drawPointAtT(curve, type);
3058 }
3059 if (draw_midpoint) {
3060 var mid = pointAtT(curve, type, 0.5);
3061 drawPoint(mid.x, mid.y, true);
3062 }
3063 if (draw_id) {
3064 var id = idByCurve(test, curve, type);
3065 if (id >= 0) {
3066 drawID(curve, id);
3067 }
3068 }
3069 if (type == PATH_LINE) {
3070 return;
3071 }
3072 if (draw_deriviatives > 0) {
3073 var d = dxy_at_t(curve, type, 0);
caryclark03b03ca2015-04-23 09:13:37 -07003074 drawArrow(curve[0], curve[1], d.x, d.y, 1);
caryclarkdac1d172014-06-17 05:15:38 -07003075 if (draw_deriviatives == 2) {
3076 d = dxy_at_t(curve, type, 1);
3077 if (type == PATH_CUBIC) {
caryclark03b03ca2015-04-23 09:13:37 -07003078 drawArrow(curve[6], curve[7], d.x, d.y, 1);
caryclarkdac1d172014-06-17 05:15:38 -07003079 } else {
caryclark03b03ca2015-04-23 09:13:37 -07003080 drawArrow(curve[4], curve[5], d.x, d.y, 1);
caryclarkdac1d172014-06-17 05:15:38 -07003081 }
3082 }
3083 if (draw_midpoint) {
3084 var mid = pointAtT(curve, type, 0.5);
3085 d = dxy_at_t(curve, type, 0.5);
caryclark03b03ca2015-04-23 09:13:37 -07003086 drawArrow(mid.x, mid.y, d.x, d.y, 1);
caryclarkdac1d172014-06-17 05:15:38 -07003087 }
3088 }
3089 if (type != PATH_CUBIC) {
3090 return;
3091 }
caryclarkdac1d172014-06-17 05:15:38 -07003092 if (draw_sequence) {
3093 var ymin = Math.min(curve[1], curve[3], curve[5], curve[7]);
3094 for (var i = 0; i < 8; i+= 2) {
3095 drawLabelX(ymin, i >> 1, curve[i]);
3096 }
3097 var xmin = Math.min(curve[0], curve[2], curve[4], curve[6]);
3098 for (var i = 1; i < 8; i+= 2) {
3099 drawLabelY(xmin, i >> 1, curve[i]);
3100 }
3101 }
3102}
3103
3104function logCurves(test) {
3105 for (curves in test) {
3106 var curve = test[curves];
3107 dumpCurve(curve);
3108 }
3109}
3110
3111function curveToString(curve) {
3112 var str = "{{";
caryclark1049f122015-04-20 08:31:59 -07003113 var length = curve.length == 7 ? 6 : curve.length;
3114 if (curve.length == 7) {
3115 str += "{";
3116 }
3117 for (i = 0; i < length; i += 2) {
caryclarkdac1d172014-06-17 05:15:38 -07003118 str += curve[i].toFixed(decimal_places) + "," + curve[i + 1].toFixed(decimal_places);
3119 if (i < curve.length - 2) {
3120 str += "}, {";
3121 }
3122 }
caryclark1049f122015-04-20 08:31:59 -07003123 str += "}";
3124 if (curve.length == 7) {
3125 str += "}, " + curve[6].toFixed(decimal_places);
3126 }
3127 str += "}";
caryclarkdac1d172014-06-17 05:15:38 -07003128 return str;
3129}
3130
3131function dumpCurve(curve) {
3132 console.log(curveToString(curve));
3133}
3134
3135function draw(test, lines, title) {
3136 ctx.fillStyle = "rgba(0,0,0, 0.1)";
3137 ctx.font = "normal 50px Arial";
3138 ctx.textAlign = "left";
3139 ctx.fillText(title, 50, 50);
3140 ctx.font = "normal 10px Arial";
3141 ctx.lineWidth = "1.001"; "0.999";
3142 var secondPath = test.length;
3143 var closeCount = 0;
3144 logStart = -1;
3145 logRange = 0;
3146 // find last active rec type at this step
3147 var curType = test[0];
3148 var curStep = 0;
3149 var hasOp = false;
3150 var lastActive = 0;
3151 var lastAdd = 0;
caryclark624637c2015-05-11 07:21:27 -07003152 var lastCoin = 0;
caryclarkdac1d172014-06-17 05:15:38 -07003153 var lastSect = 0;
3154 var lastSort = 0;
3155 var lastMark = 0;
caryclark03b03ca2015-04-23 09:13:37 -07003156 var lastTop = 0;
caryclarkdac1d172014-06-17 05:15:38 -07003157 activeCount = 0;
3158 addCount = 0;
3159 angleCount = 0;
3160 opCount = 0;
3161 sectCount = 0;
3162 sortCount = 0;
caryclark03b03ca2015-04-23 09:13:37 -07003163 topCount = 0;
caryclarkdac1d172014-06-17 05:15:38 -07003164 markCount = 0;
3165 activeMax = 0;
3166 addMax = 0;
3167 angleMax = 0;
caryclark624637c2015-05-11 07:21:27 -07003168 coinMax = 0;
caryclarkdac1d172014-06-17 05:15:38 -07003169 opMax = 0;
3170 sectMax = 0;
3171 sectMax2 = 0;
3172 sortMax = 0;
caryclark03b03ca2015-04-23 09:13:37 -07003173 topMax = 0;
caryclarkdac1d172014-06-17 05:15:38 -07003174 markMax = 0;
3175 lastIndex = test.length - 3;
3176 for (var tIndex = 0; tIndex < test.length; tIndex += 3) {
3177 var recType = test[tIndex];
3178 if (!typeof recType == 'number' || recType < REC_TYPE_UNKNOWN || recType > REC_TYPE_LAST) {
3179 console.log("unknown rec type: " + recType);
3180 throw "stop execution";
3181 }
3182 // if (curType == recType && curType != REC_TYPE_ADD) {
3183 // continue;
3184 // }
3185 var inStepRange = step_limit == 0 || curStep < step_limit;
3186 curType = recType;
3187 if (recType == REC_TYPE_OP) {
3188 hasOp = true;
3189 continue;
3190 }
3191 if (recType == REC_TYPE_UNKNOWN) {
3192 // these types do not advance step
3193 continue;
3194 }
3195 var bumpStep = false;
3196 var records = test[tIndex + 2];
3197 var fragType = records[0];
3198 if (recType == REC_TYPE_ADD) {
3199 if (records.length != 2) {
3200 console.log("expect only two elements: " + records.length);
3201 throw "stop execution";
3202 }
3203 if (fragType == ADD_MOVETO || fragType == ADD_CLOSE) {
3204 continue;
3205 }
3206 ++addMax;
3207 if (!draw_add || !inStepRange) {
3208 continue;
3209 }
3210 lastAdd = tIndex;
3211 ++addCount;
3212 bumpStep = true;
3213 }
3214 if (recType == REC_TYPE_PATH && hasOp) {
3215 secondPath = tIndex;
3216 }
caryclark54359292015-03-26 07:52:43 -07003217 if (recType == REC_TYPE_PATH2 && hasOp) {
3218 secondPath = tIndex;
3219 }
caryclarkdac1d172014-06-17 05:15:38 -07003220 if (recType == REC_TYPE_ACTIVE) {
3221 ++activeMax;
3222 if (!draw_active || !inStepRange) {
3223 continue;
3224 }
3225 lastActive = tIndex;
3226 ++activeCount;
3227 bumpStep = true;
3228 }
3229 if (recType == REC_TYPE_ACTIVE_OP) {
3230 ++opMax;
3231 if (!draw_op || !inStepRange) {
3232 continue;
3233 }
3234 lastOp = tIndex;
3235 ++opCount;
3236 bumpStep = true;
3237 }
caryclark54359292015-03-26 07:52:43 -07003238 if (recType == REC_TYPE_AFTERPART) {
3239 if (draw_angle != 3 || !inStepRange) {
3240 continue;
3241 }
3242 lastAngle = tIndex;
3243 ++angleCount;
3244 bumpStep = true;
3245 }
caryclarkdac1d172014-06-17 05:15:38 -07003246 if (recType == REC_TYPE_ANGLE) {
3247 ++angleMax;
caryclark54359292015-03-26 07:52:43 -07003248 if (draw_angle == 0 || draw_angle == 3 || !inStepRange) {
caryclarkdac1d172014-06-17 05:15:38 -07003249 continue;
3250 }
3251 lastAngle = tIndex;
3252 ++angleCount;
3253 bumpStep = true;
3254 }
caryclark624637c2015-05-11 07:21:27 -07003255 if (recType == REC_TYPE_COINCIDENCE) {
3256 ++coinMax;
3257 if (!draw_coincidence || !inStepRange) {
3258 continue;
3259 }
3260 lastCoin = tIndex;
3261 ++coinCount;
3262 bumpStep = true;
3263 }
caryclarkdac1d172014-06-17 05:15:38 -07003264 if (recType == REC_TYPE_SECT) {
3265 if (records.length != 2) {
3266 console.log("expect only two elements: " + records.length);
3267 throw "stop execution";
3268 }
3269 ++sectMax;
3270 var sectBump = 1;
3271 switch (fragType) {
3272 case INTERSECT_LINE:
3273 case INTERSECT_QUAD_LINE:
3274 case INTERSECT_QUAD:
caryclark1049f122015-04-20 08:31:59 -07003275 case INTERSECT_CONIC_LINE:
3276 case INTERSECT_CONIC:
caryclarkdac1d172014-06-17 05:15:38 -07003277 case INTERSECT_SELF_CUBIC:
3278 case INTERSECT_CUBIC_LINE:
3279 case INTERSECT_CUBIC_QUAD:
3280 case INTERSECT_CUBIC:
3281 sectBump = 1;
3282 break;
3283 case INTERSECT_LINE_2:
3284 case INTERSECT_QUAD_LINE_2:
3285 case INTERSECT_QUAD_2:
caryclark1049f122015-04-20 08:31:59 -07003286 case INTERSECT_CONIC_LINE_2:
3287 case INTERSECT_CONIC_2:
caryclarkdac1d172014-06-17 05:15:38 -07003288 case INTERSECT_CUBIC_LINE_2:
3289 case INTERSECT_CUBIC_QUAD_2:
3290 case INTERSECT_CUBIC_2:
3291 sectBump = 2;
3292 break;
3293 case INTERSECT_LINE_NO:
3294 case INTERSECT_QUAD_LINE_NO:
3295 case INTERSECT_QUAD_NO:
caryclark1049f122015-04-20 08:31:59 -07003296 case INTERSECT_CONIC_LINE_NO:
3297 case INTERSECT_CONIC_NO:
caryclarkdac1d172014-06-17 05:15:38 -07003298 case INTERSECT_SELF_CUBIC_NO:
3299 case INTERSECT_CUBIC_LINE_NO:
3300 case INTERSECT_CUBIC_QUAD_NO:
3301 case INTERSECT_CUBIC_NO:
3302 sectBump = 0;
3303 break;
3304 case INTERSECT_CUBIC_LINE_3:
3305 case INTERSECT_CUBIC_QUAD_3:
3306 case INTERSECT_CUBIC_3:
3307 sectBump = 3;
3308 break;
3309 case INTERSECT_CUBIC_QUAD_4:
3310 case INTERSECT_CUBIC_4:
3311 sectBump = 4;
3312 break;
3313 default:
3314 console.log("missing case " + records.length);
3315 throw "stop execution";
3316 }
3317 sectMax2 += sectBump;
3318 if (draw_intersection <= 1 || !inStepRange) {
3319 continue;
3320 }
3321 lastSect = tIndex;
3322 sectCount += sectBump;
3323 bumpStep = true;
3324 }
3325 if (recType == REC_TYPE_SORT) {
3326 ++sortMax;
3327 if (!draw_sort || !inStepRange) {
3328 continue;
3329 }
3330 lastSort = tIndex;
3331 ++sortCount;
3332 bumpStep = true;
3333 }
caryclark03b03ca2015-04-23 09:13:37 -07003334 if (recType == REC_TYPE_TOP) {
3335 ++topMax;
3336 if (!draw_top || !inStepRange) {
3337 continue;
3338 }
3339 lastTop = tIndex;
3340 ++topCount;
3341 bumpStep = true;
3342 }
caryclarkdac1d172014-06-17 05:15:38 -07003343 if (recType == REC_TYPE_MARK) {
3344 ++markMax;
3345 if (!draw_mark || !inStepRange) {
3346 continue;
3347 }
3348 lastMark = tIndex;
3349 ++markCount;
3350 bumpStep = true;
3351 }
3352 if (bumpStep) {
3353 lastIndex = tIndex;
3354 logStart = test[tIndex + 1];
3355 logRange = records.length / 2;
3356 ++curStep;
3357 }
3358 }
3359 stepMax = (draw_add ? addMax : 0)
3360 + (draw_active ? activeMax : 0)
reed0dc4dd62015-03-24 13:55:33 -07003361 + (draw_angle ? angleMax : 0)
caryclark624637c2015-05-11 07:21:27 -07003362 + (draw_coincidence ? coinMax : 0)
caryclark54359292015-03-26 07:52:43 -07003363 + (draw_op ? opMax : 0)
caryclarkdac1d172014-06-17 05:15:38 -07003364 + (draw_sort ? sortMax : 0)
caryclark03b03ca2015-04-23 09:13:37 -07003365 + (draw_top ? topMax : 0)
caryclarkdac1d172014-06-17 05:15:38 -07003366 + (draw_mark ? markMax : 0)
3367 + (draw_intersection == 2 ? sectMax : draw_intersection == 3 ? sectMax2 : 0);
3368 if (stepMax == 0) {
caryclark624637c2015-05-11 07:21:27 -07003369 stepMax = addMax + activeMax + angleMax + coinMax + opMax + sortMax + topMax + markMax;
caryclarkdac1d172014-06-17 05:15:38 -07003370 }
3371 drawnPts = [];
3372 drawnLines = [];
3373 drawnQuads = [];
caryclark1049f122015-04-20 08:31:59 -07003374 drawnConics = [];
caryclarkdac1d172014-06-17 05:15:38 -07003375 drawnCubics = [];
3376 focusXmin = focusYmin = Infinity;
3377 focusXmax = focusYmax = -Infinity;
3378 var pathIndex = 0;
3379 var opLetter = 'S';
3380 for (var tIndex = lastIndex; tIndex >= 0; tIndex -= 3) {
3381 var recType = test[tIndex];
3382 var records = test[tIndex + 2];
3383 for (var recordIndex = 0; recordIndex < records.length; recordIndex += 2) {
3384 var fragType = records[recordIndex];
3385 if (!typeof fragType == 'number' || fragType < 1 || fragType > FRAG_TYPE_LAST) {
3386 console.log("unknown in range frag type: " + fragType);
3387 throw "stop execution";
3388 }
3389 var frags = records[recordIndex + 1];
3390 focus_enabled = false;
3391 switch (recType) {
3392 case REC_TYPE_COMPUTED:
3393 if (draw_computed == 0) {
3394 continue;
3395 }
3396 ctx.lineWidth = 1;
3397 ctx.strokeStyle = pathIndex == 0 ? "black" : "red";
3398 ctx.fillStyle = "blue";
3399 var drawThis = false;
3400 switch (fragType) {
3401 case PATH_QUAD:
caryclark1049f122015-04-20 08:31:59 -07003402 if ((draw_computed & 0x9) == 1 || ((draw_computed & 8) != 0
3403 && (draw_computed & 7) == pathIndex)) {
caryclarkdac1d172014-06-17 05:15:38 -07003404 drawQuad(frags[0], frags[1], frags[2], frags[3],
3405 frags[4], frags[5]);
3406 drawThis = true;
3407 }
3408 break;
caryclark1049f122015-04-20 08:31:59 -07003409 case PATH_CONIC:
3410 if ((draw_computed & 0xA) == 2 || ((draw_computed & 8) != 0
3411 && (draw_computed & 7) == pathIndex)) {
3412 drawConicWithQuads(frags[0], frags[1], frags[2], frags[3],
3413 frags[4], frags[5], frags[6]);
3414 drawThis = true;
3415 }
3416 break;
caryclarkdac1d172014-06-17 05:15:38 -07003417 case PATH_CUBIC:
caryclark1049f122015-04-20 08:31:59 -07003418 if ((draw_computed & 0xC) == 4 || ((draw_computed & 8) != 0
3419 && (draw_computed & 7) == pathIndex)) {
caryclarkdac1d172014-06-17 05:15:38 -07003420 drawCubic(frags[0], frags[1], frags[2], frags[3],
3421 frags[4], frags[5], frags[6], frags[7]);
3422 drawThis = true;
3423 }
3424 ++pathIndex;
3425 break;
3426 case COMPUTED_SET_1:
3427 pathIndex = 0;
3428 break;
3429 case COMPUTED_SET_2:
3430 pathIndex = 1;
3431 break;
3432 default:
3433 console.log("unknown REC_TYPE_COMPUTED frag type: " + fragType);
3434 throw "stop execution";
3435 }
3436 if (!drawThis || collect_bounds) {
3437 break;
3438 }
3439 drawCurveSpecials(test, frags, fragType);
3440 break;
caryclark26ad22a2015-10-16 09:03:38 -07003441 case REC_TYPE_ALIGNED:
3442 if (draw_path < 4) {
3443 continue;
3444 }
caryclarkdac1d172014-06-17 05:15:38 -07003445 case REC_TYPE_PATH:
caryclark54359292015-03-26 07:52:43 -07003446 case REC_TYPE_PATH2:
caryclark26ad22a2015-10-16 09:03:38 -07003447 if (REC_TYPE_ALIGNED != recType && draw_path >= 4) {
3448 continue;
3449 }
caryclarkdac1d172014-06-17 05:15:38 -07003450 if (!draw_path) {
3451 continue;
3452 }
3453 var firstPath = tIndex < secondPath;
3454 if ((draw_path & (firstPath ? 1 : 2)) == 0) {
3455 continue;
3456 }
3457 ctx.lineWidth = 1;
3458 ctx.strokeStyle = firstPath ? "black" : "red";
3459 ctx.fillStyle = "blue";
caryclark54359292015-03-26 07:52:43 -07003460 var frags2 = [];
caryclarkdac1d172014-06-17 05:15:38 -07003461 switch (fragType) {
3462 case PATH_LINE:
caryclark54359292015-03-26 07:52:43 -07003463 for (var i = 0; i < 4; ++ i) { frags2[i] = frags[i + 1]; }
3464 drawLine(frags2[0], frags2[1], frags2[2], frags2[3]);
caryclarkdac1d172014-06-17 05:15:38 -07003465 break;
3466 case PATH_QUAD:
caryclark54359292015-03-26 07:52:43 -07003467 for (var i = 0; i < 6; ++ i) { frags2[i] = frags[i + 1]; }
3468 drawQuad(frags2[0], frags2[1], frags2[2], frags2[3],
3469 frags2[4], frags2[5]);
caryclarkdac1d172014-06-17 05:15:38 -07003470 break;
caryclark1049f122015-04-20 08:31:59 -07003471 case PATH_CONIC:
3472 for (var i = 0; i < 7; ++ i) { frags2[i] = frags[i + 1]; }
3473 drawConicWithQuads(frags2[0], frags2[1], frags2[2], frags2[3],
3474 frags2[4], frags2[5], frags2[6]);
3475 break;
caryclarkdac1d172014-06-17 05:15:38 -07003476 case PATH_CUBIC:
caryclark54359292015-03-26 07:52:43 -07003477 for (var i = 0; i < 8; ++ i) { frags2[i] = frags[i + 1]; }
3478 drawCubic(frags2[0], frags2[1], frags2[2], frags2[3],
3479 frags2[4], frags2[5], frags2[6], frags2[7]);
caryclarkdac1d172014-06-17 05:15:38 -07003480 break;
3481 default:
caryclark26ad22a2015-10-16 09:03:38 -07003482 console.log("unknown " + recType + " frag type: " + fragType);
caryclarkdac1d172014-06-17 05:15:38 -07003483 throw "stop execution";
3484 }
3485 if (collect_bounds) {
3486 break;
3487 }
caryclark54359292015-03-26 07:52:43 -07003488 drawCurveSpecials(test, frags2, fragType);
caryclarkdac1d172014-06-17 05:15:38 -07003489 break;
3490 case REC_TYPE_OP:
3491 switch (fragType) {
3492 case OP_INTERSECT: opLetter = 'I'; break;
3493 case OP_DIFFERENCE: opLetter = 'D'; break;
3494 case OP_UNION: opLetter = 'U'; break;
3495 case OP_XOR: opLetter = 'X'; break;
3496 default:
3497 console.log("unknown REC_TYPE_OP frag type: " + fragType);
3498 throw "stop execution";
3499 }
3500 break;
3501 case REC_TYPE_ACTIVE:
3502 if (!draw_active || (step_limit > 0 && tIndex < lastActive)) {
3503 continue;
3504 }
3505 var x1 = frags[SPAN_X1];
3506 var y1 = frags[SPAN_Y1];
3507 var x2 = frags[SPAN_X2];
3508 var y2 = frags[SPAN_Y2];
caryclark1049f122015-04-20 08:31:59 -07003509 var x3, y3, x3, y4, t1, t2, w;
caryclarkdac1d172014-06-17 05:15:38 -07003510 ctx.lineWidth = 3;
3511 ctx.strokeStyle = "rgba(0,0,255, 0.3)";
3512 focus_enabled = true;
3513 switch (fragType) {
3514 case ACTIVE_LINE_SPAN:
3515 t1 = frags[SPAN_L_T];
3516 t2 = frags[SPAN_L_TEND];
3517 drawLinePartial(x1, y1, x2, y2, t1, t2);
3518 if (draw_id) {
3519 drawLinePartialID(frags[0], x1, y1, x2, y2, t1, t2);
3520 }
3521 break;
3522 case ACTIVE_QUAD_SPAN:
3523 x3 = frags[SPAN_X3];
3524 y3 = frags[SPAN_Y3];
3525 t1 = frags[SPAN_Q_T];
3526 t2 = frags[SPAN_Q_TEND];
3527 drawQuadPartial(x1, y1, x2, y2, x3, y3, t1, t2);
3528 if (draw_id) {
3529 drawQuadPartialID(frags[0], x1, y1, x2, y2, x3, y3, t1, t2);
3530 }
3531 break;
caryclark1049f122015-04-20 08:31:59 -07003532 case ACTIVE_CONIC_SPAN:
3533 x3 = frags[SPAN_X3];
3534 y3 = frags[SPAN_Y3];
3535 t1 = frags[SPAN_K_T];
3536 t2 = frags[SPAN_K_TEND];
3537 w = frags[SPAN_K_W];
3538 drawConicPartial(x1, y1, x2, y2, x3, y3, w, t1, t2);
3539 if (draw_id) {
3540 drawConicPartialID(frags[0], x1, y1, x2, y2, x3, y3, w, t1, t2);
3541 }
3542 break;
caryclarkdac1d172014-06-17 05:15:38 -07003543 case ACTIVE_CUBIC_SPAN:
3544 x3 = frags[SPAN_X3];
3545 y3 = frags[SPAN_Y3];
3546 x4 = frags[SPAN_X4];
3547 y4 = frags[SPAN_Y4];
3548 t1 = frags[SPAN_C_T];
3549 t2 = frags[SPAN_C_TEND];
3550 drawCubicPartial(x1, y1, x2, y2, x3, y3, x4, y4, t1, t2);
3551 if (draw_id) {
3552 drawCubicPartialID(frags[0], x1, y1, x2, y2, x3, y3, x4, y4, t1, t2);
3553 }
3554 break;
3555 default:
3556 console.log("unknown REC_TYPE_ACTIVE frag type: " + fragType);
3557 throw "stop execution";
3558 }
3559 break;
3560 case REC_TYPE_ACTIVE_OP:
3561 if (!draw_op || (step_limit > 0 && tIndex < lastOp)) {
3562 continue;
3563 }
3564 focus_enabled = true;
3565 ctx.lineWidth = 3;
3566 var activeSpan = frags[7] == "1";
3567 ctx.strokeStyle = activeSpan ? "rgba(45,160,0, 0.3)" : "rgba(255,45,0, 0.5)";
3568 var curve = curvePartialByID(test, frags[0], frags[1], frags[2]);
3569 drawCurve(curve);
3570 if (draw_op > 1) {
3571 drawArc(curve, false, frags[3], frags[4]);
3572 drawArc(curve, true, frags[5], frags[6]);
3573 }
3574 break;
3575 case REC_TYPE_ADD:
3576 if (!draw_add) {
3577 continue;
3578 }
3579 ctx.lineWidth = 3;
3580 ctx.strokeStyle = closeCount == 0 ? "rgba(0,0,255, 0.3)"
3581 : closeCount == 1 ? "rgba(0,127,0, 0.3)"
3582 : closeCount == 2 ? "rgba(0,127,127, 0.3)"
3583 : closeCount == 3 ? "rgba(127,127,0, 0.3)"
3584 : "rgba(127,0,127, 0.3)";
3585 focus_enabled = true;
3586 switch (fragType) {
3587 case ADD_MOVETO:
3588 break;
3589 case ADD_LINETO:
3590 if (step_limit == 0 || tIndex >= lastAdd) {
3591 drawLine(frags[0], frags[1], frags[2], frags[3]);
3592 }
3593 break;
3594 case ADD_QUADTO:
3595 if (step_limit == 0 || tIndex >= lastAdd) {
3596 drawQuad(frags[0], frags[1], frags[2], frags[3], frags[4], frags[5]);
3597 }
3598 break;
caryclark1049f122015-04-20 08:31:59 -07003599 case ADD_CONICTO:
3600 if (step_limit == 0 || tIndex >= lastAdd) {
3601 drawConicWithQuads(frags[0], frags[1], frags[2], frags[3],
3602 frags[4], frags[5], frags[6]);
3603 }
3604 break;
caryclarkdac1d172014-06-17 05:15:38 -07003605 case ADD_CUBICTO:
3606 if (step_limit == 0 || tIndex >= lastAdd) {
3607 drawCubic(frags[0], frags[1], frags[2], frags[3],
3608 frags[4], frags[5], frags[6], frags[7]);
3609 }
3610 break;
3611 case ADD_CLOSE:
3612 ++closeCount;
3613 break;
3614 case ADD_FILL:
3615 break;
3616 default:
3617 console.log("unknown REC_TYPE_ADD frag type: " + fragType);
3618 throw "stop execution";
3619 }
3620 break;
3621 case REC_TYPE_ANGLE:
caryclark54359292015-03-26 07:52:43 -07003622 angleBetween = frags[18] == "T";
3623 afterIndex = 0;
3624 if (draw_angle == 0 || draw_angle == 3 || (step_limit > 0 && tIndex < lastAngle)) {
caryclarkdac1d172014-06-17 05:15:38 -07003625 continue;
3626 }
3627 focus_enabled = true;
3628 ctx.lineWidth = 3;
3629 ctx.strokeStyle = "rgba(127,45,127, 0.3)";
caryclark54359292015-03-26 07:52:43 -07003630 var leftCurve = curvePartialByID(test, frags[0], frags[4], frags[5]);
3631 var midCurve = curvePartialByID(test, frags[6], frags[10], frags[11]);
3632 var rightCurve = curvePartialByID(test, frags[12], frags[16], frags[17]);
caryclarkdac1d172014-06-17 05:15:38 -07003633 drawCurve(leftCurve);
3634 drawCurve(rightCurve);
caryclark54359292015-03-26 07:52:43 -07003635 ctx.strokeStyle = angleBetween ? "rgba(0,160,45, 0.3)" : "rgba(255,0,45, 0.5)";
caryclarkdac1d172014-06-17 05:15:38 -07003636 drawCurve(midCurve);
3637 if (draw_angle > 1) {
3638 drawOrder(leftCurve, 'L');
3639 drawOrder(rightCurve, 'R');
3640 }
3641 break;
caryclark54359292015-03-26 07:52:43 -07003642 case REC_TYPE_AFTERPART:
3643 if (draw_angle != 3 || (step_limit > 0 && tIndex < lastAngle)) {
3644 continue;
3645 }
3646 ctx.strokeStyle = afterIndex == 0 ? "rgba(255,0,0, 1.0)"
3647 : (afterIndex == 1) == angleBetween ? "rgba(0,128,0, 1.0)"
3648 : "rgba(0,0,255, 1.0)";
3649 switch (fragType) {
3650 case PATH_LINE:
3651 drawLine(frags[0], frags[1], frags[2], frags[3]);
3652 break;
3653 case PATH_QUAD:
3654 drawQuad(frags[0], frags[1], frags[2], frags[3],
3655 frags[4], frags[5]);
3656 break;
caryclark1049f122015-04-20 08:31:59 -07003657 case PATH_CONIC:
3658 drawConicWithQuads(frags[0], frags[1], frags[2], frags[3],
3659 frags[4], frags[5], frags[6]);
3660 break;
caryclark54359292015-03-26 07:52:43 -07003661 case PATH_CUBIC:
3662 drawCubic(frags[0], frags[1], frags[2], frags[3],
caryclark1049f122015-04-20 08:31:59 -07003663 frags[4], frags[5], frags[6], frags[7]);
caryclark54359292015-03-26 07:52:43 -07003664 break;
3665 default:
3666 console.log("unknown REC_TYPE_AFTERPART frag type: " + fragType);
3667 throw "stop execution";
3668 }
3669 ++afterIndex;
3670 break;
caryclark624637c2015-05-11 07:21:27 -07003671 case REC_TYPE_COINCIDENCE:
3672 if (!draw_coincidence || (step_limit > 0 && tIndex < lastCoin)) {
3673 continue;
3674 }
3675 focus_enabled = true;
3676 ctx.lineWidth = 3;
3677 ctx.strokeStyle = "rgba(127,45,63, 0.3)";
3678 var curve = curvePartialByID(test, frags[0], frags[1], frags[2]);
3679 drawCurve(curve);
3680 break;
caryclarkdac1d172014-06-17 05:15:38 -07003681 case REC_TYPE_SECT:
3682 if (!draw_intersection) {
3683 continue;
3684 }
3685 if (draw_intersection != 1 && (step_limit > 0 && tIndex < lastSect)) {
3686 continue;
3687 }
3688 // draw_intersection == 1 : show all
3689 // draw_intersection == 2 : step == 0 ? show all : show intersection line #step
3690 // draw_intersection == 3 : step == 0 ? show all : show intersection #step
3691 ctx.lineWidth = 1;
3692 ctx.strokeStyle = "rgba(0,0,255, 0.3)";
3693 ctx.fillStyle = "blue";
3694 focus_enabled = true;
3695 var f = [];
3696 var c1s;
3697 var c1l;
3698 var c2s;
3699 var c2l;
3700 switch (fragType) {
3701 case INTERSECT_LINE:
3702 f.push(5, 6, 0, 7);
3703 c1s = 1; c1l = 4; c2s = 8; c2l = 4;
3704 break;
3705 case INTERSECT_LINE_2:
3706 f.push(5, 6, 0, 10);
3707 f.push(8, 9, 7, 15);
3708 c1s = 1; c1l = 4; c2s = 11; c2l = 4;
3709 break;
3710 case INTERSECT_LINE_NO:
3711 c1s = 0; c1l = 4; c2s = 4; c2l = 4;
3712 break;
3713 case INTERSECT_QUAD_LINE:
3714 f.push(7, 8, 0, 9);
3715 c1s = 1; c1l = 6; c2s = 10; c2l = 4;
3716 break;
3717 case INTERSECT_QUAD_LINE_2:
3718 f.push(7, 8, 0, 12);
3719 f.push(10, 11, 9, 17);
3720 c1s = 1; c1l = 6; c2s = 13; c2l = 4;
3721 break;
3722 case INTERSECT_QUAD_LINE_NO:
3723 c1s = 0; c1l = 6; c2s = 6; c2l = 4;
3724 break;
3725 case INTERSECT_QUAD:
3726 f.push(7, 8, 0, 9);
3727 c1s = 1; c1l = 6; c2s = 10; c2l = 6;
3728 break;
3729 case INTERSECT_QUAD_2:
3730 f.push(7, 8, 0, 12);
3731 f.push(10, 11, 9, 19);
3732 c1s = 1; c1l = 6; c2s = 13; c2l = 6;
3733 break;
3734 case INTERSECT_QUAD_NO:
3735 c1s = 0; c1l = 6; c2s = 6; c2l = 6;
3736 break;
caryclark1049f122015-04-20 08:31:59 -07003737 case INTERSECT_CONIC_LINE:
3738 f.push(8, 9, 0, 10);
3739 c1s = 1; c1l = 7; c2s = 11; c2l = 4;
3740 break;
3741 case INTERSECT_CONIC_LINE_2:
3742 f.push(8, 9, 0, 12);
3743 f.push(11, 12, 10, 18);
3744 c1s = 1; c1l = 7; c2s = 14; c2l = 4;
3745 break;
3746 case INTERSECT_CONIC_LINE_NO:
3747 c1s = 0; c1l = 7; c2s = 7; c2l = 4;
3748 break;
3749 case INTERSECT_CONIC:
3750 f.push(8, 9, 0, 10);
3751 c1s = 1; c1l = 7; c2s = 11; c2l = 7;
3752 break;
3753 case INTERSECT_CONIC_2:
3754 f.push(8, 9, 0, 13);
3755 f.push(11, 12, 10, 21);
3756 c1s = 1; c1l = 7; c2s = 14; c2l = 7;
3757 break;
3758 case INTERSECT_CONIC_NO:
3759 c1s = 0; c1l = 7; c2s = 7; c2l = 7;
3760 break;
caryclarkdac1d172014-06-17 05:15:38 -07003761 case INTERSECT_SELF_CUBIC:
3762 f.push(9, 10, 0, 11);
3763 c1s = 1; c1l = 8; c2s = 0; c2l = 0;
3764 break;
3765 case INTERSECT_SELF_CUBIC_NO:
3766 c1s = 0; c1l = 8; c2s = 0; c2l = 0;
3767 break;
3768 case INTERSECT_CUBIC_LINE:
3769 f.push(9, 10, 0, 11);
3770 c1s = 1; c1l = 8; c2s = 12; c2l = 4;
3771 break;
3772 case INTERSECT_CUBIC_LINE_2:
3773 f.push(9, 10, 0, 14);
3774 f.push(12, 13, 11, 19);
3775 c1s = 1; c1l = 8; c2s = 15; c2l = 4;
3776 break;
3777 case INTERSECT_CUBIC_LINE_3:
3778 f.push(9, 10, 0, 17);
3779 f.push(12, 13, 11, 22);
3780 f.push(15, 16, 14, 23);
3781 c1s = 1; c1l = 8; c2s = 18; c2l = 4;
3782 break;
3783 case INTERSECT_CUBIC_QUAD_NO:
3784 c1s = 0; c1l = 8; c2s = 8; c2l = 6;
3785 break;
3786 case INTERSECT_CUBIC_QUAD:
3787 f.push(9, 10, 0, 11);
3788 c1s = 1; c1l = 8; c2s = 12; c2l = 6;
3789 break;
3790 case INTERSECT_CUBIC_QUAD_2:
3791 f.push(9, 10, 0, 14);
3792 f.push(12, 13, 11, 21);
3793 c1s = 1; c1l = 8; c2s = 15; c2l = 6;
3794 break;
3795 case INTERSECT_CUBIC_QUAD_3:
3796 f.push(9, 10, 0, 17);
3797 f.push(12, 13, 11, 24);
3798 f.push(15, 16, 14, 25);
3799 c1s = 1; c1l = 8; c2s = 18; c2l = 6;
3800 break;
3801 case INTERSECT_CUBIC_QUAD_4:
3802 f.push(9, 10, 0, 20);
3803 f.push(12, 13, 11, 27);
3804 f.push(15, 16, 14, 28);
3805 f.push(18, 19, 17, 29);
3806 c1s = 1; c1l = 8; c2s = 21; c2l = 6;
3807 break;
3808 case INTERSECT_CUBIC_LINE_NO:
3809 c1s = 0; c1l = 8; c2s = 8; c2l = 4;
3810 break;
3811 case INTERSECT_CUBIC:
3812 f.push(9, 10, 0, 11);
3813 c1s = 1; c1l = 8; c2s = 12; c2l = 8;
3814 break;
3815 case INTERSECT_CUBIC_2:
3816 f.push(9, 10, 0, 14);
3817 f.push(12, 13, 11, 23);
3818 c1s = 1; c1l = 8; c2s = 15; c2l = 8;
3819 break;
3820 case INTERSECT_CUBIC_3:
3821 f.push(9, 10, 0, 17);
3822 f.push(12, 13, 11, 26);
3823 f.push(15, 16, 14, 27);
3824 c1s = 1; c1l = 8; c2s = 18; c2l = 8;
3825 break;
3826 case INTERSECT_CUBIC_4:
3827 f.push(9, 10, 0, 20);
3828 f.push(12, 13, 11, 29);
3829 f.push(15, 16, 14, 30);
3830 f.push(18, 19, 17, 31);
3831 c1s = 1; c1l = 8; c2s = 21; c2l = 8;
3832 break;
3833 case INTERSECT_CUBIC_NO:
3834 c1s = 0; c1l = 8; c2s = 8; c2l = 8;
3835 break;
3836 default:
3837 console.log("unknown REC_TYPE_SECT frag type: " + fragType);
3838 throw "stop execution";
3839 }
3840 if (draw_intersection != 1) {
3841 var id = -1;
3842 var curve;
3843 switch (c1l) {
3844 case 4:
3845 drawLine(frags[c1s], frags[c1s + 1], frags[c1s + 2], frags[c1s + 3]);
3846 if (draw_id) {
3847 curve = [frags[c1s], frags[c1s + 1], frags[c1s + 2], frags[c1s + 3]];
3848 id = idByCurve(test, curve, PATH_LINE);
3849 }
3850 break;
3851 case 6:
3852 drawQuad(frags[c1s], frags[c1s + 1], frags[c1s + 2], frags[c1s + 3],
3853 frags[c1s + 4], frags[c1s + 5]);
3854 if (draw_id) {
3855 curve = [frags[c1s], frags[c1s + 1], frags[c1s + 2], frags[c1s + 3],
3856 frags[c1s + 4], frags[c1s + 5]];
3857 id = idByCurve(test, curve, PATH_QUAD);
3858 }
3859 break;
caryclark1049f122015-04-20 08:31:59 -07003860 case 7:
3861 drawConicWithQuads(frags[c1s], frags[c1s + 1], frags[c1s + 2], frags[c1s + 3],
3862 frags[c1s + 4], frags[c1s + 5], frags[c1s + 6]);
3863 if (draw_id) {
3864 curve = [frags[c1s], frags[c1s + 1], frags[c1s + 2], frags[c1s + 3],
3865 frags[c1s + 4], frags[c1s + 5], frags[c1s + 6]];
3866 id = idByCurve(test, curve, PATH_CONIC);
3867 }
3868 break;
caryclarkdac1d172014-06-17 05:15:38 -07003869 case 8:
3870 drawCubic(frags[c1s], frags[c1s + 1], frags[c1s + 2], frags[c1s + 3],
3871 frags[c1s + 4], frags[c1s + 5], frags[c1s + 6], frags[c1s + 7]);
3872 if (draw_id) {
3873 curve = [frags[c1s], frags[c1s + 1], frags[c1s + 2], frags[c1s + 3],
3874 frags[c1s + 4], frags[c1s + 5], frags[c1s + 6], frags[c1s + 7]];
3875 id = idByCurve(test, curve, PATH_CUBIC);
3876 }
3877 break;
3878 }
3879 if (id >= 0) {
3880 drawID(curve, id);
3881 }
3882 id = -1;
3883 switch (c2l) {
3884 case 0:
3885 break;
3886 case 4:
3887 drawLine(frags[c2s], frags[c2s + 1], frags[c2s + 2], frags[c2s + 3]);
3888 if (draw_id) {
3889 curve = [frags[c2s], frags[c2s + 1], frags[c2s + 2], frags[c2s + 3]];
3890 id = idByCurve(test, curve, PATH_LINE);
3891 }
3892 break;
3893 case 6:
3894 drawQuad(frags[c2s], frags[c2s + 1], frags[c2s + 2], frags[c2s + 3],
3895 frags[c2s + 4], frags[c2s + 5]);
3896 if (draw_id) {
3897 curve = [frags[c2s], frags[c2s + 1], frags[c2s + 2], frags[c2s + 3],
3898 frags[c2s + 4], frags[c2s + 5]];
3899 id = idByCurve(test, curve, PATH_QUAD);
3900 }
3901 break;
caryclark1049f122015-04-20 08:31:59 -07003902 case 7:
3903 drawConicWithQuads(frags[c2s], frags[c2s + 1], frags[c2s + 2], frags[c2s + 3],
3904 frags[c2s + 4], frags[c2s + 5], frags[c2s + 6]);
3905 if (draw_id) {
3906 curve = [frags[c2s], frags[c2s + 1], frags[c2s + 2], frags[c2s + 3],
3907 frags[c2s + 4], frags[c2s + 5], frags[c2s + 6]];
3908 id = idByCurve(test, curve, PATH_CONIC);
3909 }
3910 break;
caryclarkdac1d172014-06-17 05:15:38 -07003911 case 8:
3912 drawCubic(frags[c2s], frags[c2s + 1], frags[c2s + 2], frags[c2s + 3],
3913 frags[c2s + 4], frags[c2s + 5], frags[c2s + 6], frags[c2s + 7]);
3914 if (draw_id) {
3915 curve = [frags[c2s], frags[c2s + 1], frags[c2s + 2], frags[c2s + 3],
3916 frags[c2s + 4], frags[c2s + 5], frags[c2s + 6], frags[c2s + 7]];
3917 id = idByCurve(test, curve, PATH_CUBIC);
3918 }
3919 break;
3920 }
3921 if (id >= 0) {
3922 drawID(curve, id);
3923 }
3924 }
3925 if (collect_bounds) {
3926 break;
3927 }
caryclark54359292015-03-26 07:52:43 -07003928 if (draw_intersection != 3 || step_limit == 0 || tIndex >= lastSect) {
3929 for (var idx = 0; idx < f.length; idx += 4) {
caryclarkdac1d172014-06-17 05:15:38 -07003930 drawPoint(frags[f[idx]], frags[f[idx + 1]], true);
3931 }
3932 }
3933 if (!draw_intersectT) {
3934 break;
3935 }
3936 ctx.fillStyle = "red";
caryclark54359292015-03-26 07:52:43 -07003937 if (draw_intersection != 3 || step_limit == 0 || tIndex >= lastSect) {
3938 for (var idx = 0; idx < f.length; idx += 4) {
caryclarkdac1d172014-06-17 05:15:38 -07003939 drawTAtPointUp(frags[f[idx]], frags[f[idx + 1]], frags[f[idx + 2]]);
3940 drawTAtPointDown(frags[f[idx]], frags[f[idx + 1]], frags[f[idx + 3]]);
3941 }
3942 }
3943 break;
3944 case REC_TYPE_SORT:
3945 if (!draw_sort || (step_limit > 0 && tIndex < lastSort)) {
3946 continue;
3947 }
3948 ctx.lineWidth = 3;
3949 ctx.strokeStyle = "rgba(127,127,0, 0.5)";
3950 focus_enabled = true;
3951 switch (fragType) {
3952 case SORT_UNARY:
3953 case SORT_BINARY:
3954 var curve = curvePartialByID(test, frags[0], frags[6], frags[8]);
3955 drawCurve(curve);
3956 break;
3957 default:
3958 console.log("unknown REC_TYPE_SORT frag type: " + fragType);
3959 throw "stop execution";
3960 }
3961 break;
caryclark03b03ca2015-04-23 09:13:37 -07003962 case REC_TYPE_TOP:
3963 if (!draw_top || (step_limit > 0 && tIndex < lastTop)) {
3964 continue;
3965 }
3966 ctx.lineWidth = 3;
3967 ctx.strokeStyle = "rgba(127,127,0, 0.5)";
3968 focus_enabled = true;
3969 {
3970 var curve = curvePartialByID(test, frags[0], frags[1], frags[2]);
3971 drawCurve(curve);
3972 var type = PATH_LINE + (curve.length / 2 - 2);
3973 var mid = pointAtT(curve, type, 0.5);
3974 var d = dxy_at_t(curve, type, 0.5);
3975 drawArrow(mid.x, mid.y, d.x, d.y, 0.3);
3976 }
3977 break;
caryclarkdac1d172014-06-17 05:15:38 -07003978 case REC_TYPE_MARK:
3979 if (!draw_mark || (step_limit > 0 && tIndex < lastMark)) {
3980 continue;
3981 }
3982 ctx.lineWidth = 3;
3983 ctx.strokeStyle = fragType >= MARK_DONE_LINE ?
3984 "rgba(127,0,127, 0.5)" : "rgba(127,127,0, 0.5)";
3985 focus_enabled = true;
3986 switch (fragType) {
3987 case MARK_LINE:
3988 case MARK_DONE_LINE:
3989 case MARK_UNSORTABLE_LINE:
3990 case MARK_SIMPLE_LINE:
3991 case MARK_SIMPLE_DONE_LINE:
3992 case MARK_DONE_UNARY_LINE:
3993 drawLinePartial(frags[1], frags[2], frags[3], frags[4],
3994 frags[5], frags[9]);
3995 if (draw_id) {
3996 drawLinePartialID(frags[0], frags[1], frags[2], frags[3], frags[4],
3997 frags[5], frags[9]);
3998 }
3999 break;
4000 case MARK_QUAD:
4001 case MARK_DONE_QUAD:
4002 case MARK_UNSORTABLE_QUAD:
4003 case MARK_SIMPLE_QUAD:
4004 case MARK_SIMPLE_DONE_QUAD:
4005 case MARK_DONE_UNARY_QUAD:
4006 drawQuadPartial(frags[1], frags[2], frags[3], frags[4],
4007 frags[5], frags[6], frags[7], frags[11]);
4008 if (draw_id) {
4009 drawQuadPartialID(frags[0], frags[1], frags[2], frags[3], frags[4],
4010 frags[5], frags[6], frags[7], frags[11]);
4011 }
4012 break;
4013 case MARK_CUBIC:
4014 case MARK_DONE_CUBIC:
4015 case MARK_UNSORTABLE_CUBIC:
4016 case MARK_SIMPLE_CUBIC:
4017 case MARK_SIMPLE_DONE_CUBIC:
4018 case MARK_DONE_UNARY_CUBIC:
4019 drawCubicPartial(frags[1], frags[2], frags[3], frags[4],
4020 frags[5], frags[6], frags[7], frags[8], frags[9], frags[13]);
4021 if (draw_id) {
4022 drawCubicPartialID(frags[0], frags[1], frags[2], frags[3], frags[4],
4023 frags[5], frags[6], frags[7], frags[8], frags[9], frags[13]);
4024 }
4025 break;
4026 case MARK_ANGLE_LAST:
4027 // FIXME: ignored for now
4028 break;
4029 default:
4030 console.log("unknown REC_TYPE_MARK frag type: " + fragType);
4031 throw "stop execution";
4032 }
4033 break;
4034 default:
4035 continue;
4036 }
4037 }
4038 switch (recType) {
4039 case REC_TYPE_SORT:
4040 if (!draw_sort || (step_limit > 0 && tIndex < lastSort)) {
4041 break;
4042 }
4043 var angles = []; // use tangent lines to describe arcs
4044 var windFrom = [];
4045 var windTo = [];
4046 var opp = [];
4047 var minXY = Number.MAX_VALUE;
4048 var partial;
4049 focus_enabled = true;
4050 var someUnsortable = false;
4051 for (var recordIndex = 0; recordIndex < records.length; recordIndex += 2) {
4052 var fragType = records[recordIndex];
4053 var frags = records[recordIndex + 1];
4054 var unsortable = (fragType == SORT_UNARY && frags[14]) ||
4055 (fragType == SORT_BINARY && frags[16]);
4056 someUnsortable |= unsortable;
4057 switch (fragType) {
4058 case SORT_UNARY:
4059 case SORT_BINARY:
4060 partial = curvePartialByID(test, frags[0], frags[6], frags[8]);
4061 break;
4062 default:
4063 console.log("unknown REC_TYPE_SORT frag type: " + fragType);
4064 throw "stop execution";
4065 }
4066 var dx = boundsWidth(partial);
4067 var dy = boundsHeight(partial);
4068 minXY = Math.min(minXY, dx * dx + dy * dy);
4069 if (collect_bounds) {
4070 continue;
4071 }
4072 angles.push(tangent(partial));
4073 var from = frags[12];
4074 var to = frags[12];
4075 var sgn = frags[10];
4076 if (sgn < 0) {
4077 from -= frags[11];
4078 } else if (sgn > 0) {
4079 to -= frags[11];
4080 }
4081 windFrom.push(from + (unsortable ? "!" : ""));
4082 windTo.push(to + (unsortable ? "!" : ""));
4083 opp.push(fragType == SORT_BINARY);
4084 if (draw_sort == 1) {
4085 drawOrder(partial, frags[12]);
4086 } else {
4087 drawOrder(partial, (recordIndex / 2) + 1);
4088 }
4089 }
4090 var radius = Math.sqrt(minXY) / 2 * scale;
4091 radius = Math.min(50, radius);
4092 var scaledRadius = radius / scale;
4093 var centerX = partial[0];
4094 var centerY = partial[1];
4095 if (collect_bounds) {
4096 if (focus_enabled) {
4097 focusXmin = Math.min(focusXmin, centerX - scaledRadius);
4098 focusYmin = Math.min(focusYmin, centerY - scaledRadius);
4099 focusXmax = Math.max(focusXmax, centerX + scaledRadius);
4100 focusYmax = Math.max(focusYmax, centerY + scaledRadius);
4101 }
4102 break;
4103 }
4104 break;
4105 default:
4106 break;
4107 }
4108 }
4109 if (collect_bounds) {
4110 return;
4111 }
4112 if (draw_log && logStart >= 0) {
4113 ctx.font = "normal 10px Arial";
4114 ctx.textAlign = "left";
4115 ctx.beginPath();
4116 var top = screenHeight - 20 - (logRange + 2) * 10;
4117 ctx.rect(50, top, screenWidth - 100, (logRange + 2) * 10);
4118 ctx.fillStyle = "white";
4119 ctx.fill();
4120 ctx.fillStyle = "rgba(0,0,0, 0.5)";
4121 if (logStart > 0) {
4122 ctx.fillText(lines[logStart - 1], 50, top + 8);
4123 }
4124 ctx.fillStyle = "black";
4125 for (var idx = 0; idx < logRange; ++idx) {
4126 ctx.fillText(lines[logStart + idx], 50, top + 18 + 10 * idx);
4127 }
4128 ctx.fillStyle = "rgba(0,0,0, 0.5)";
4129 if (logStart + logRange < lines.length) {
4130 ctx.fillText(lines[logStart + logRange], 50, top + 18 + 10 * logRange);
4131 }
4132 }
4133 if (draw_legend) {
4134 var pos = 0;
caryclark624637c2015-05-11 07:21:27 -07004135 var drawSomething = draw_add | draw_active | draw_angle | draw_coincidence | draw_sort | draw_mark;
caryclarkdac1d172014-06-17 05:15:38 -07004136 // drawBox(pos++, "yellow", "black", opLetter, true, '');
4137 drawBox(pos++, "rgba(0,0,255, 0.3)", "black", draw_intersection > 1 ? sectCount : sectMax2, draw_intersection, intersectionKey);
4138 drawBox(pos++, "rgba(0,0,255, 0.3)", "black", draw_add ? addCount : addMax, draw_add, addKey);
4139 drawBox(pos++, "rgba(0,0,255, 0.3)", "black", draw_active ? activeCount : activeMax, draw_active, activeKey);
4140 drawBox(pos++, "rgba(127,127,0, 0.3)", "black", draw_angle ? angleCount : angleMax, draw_angle, angleKey);
caryclark624637c2015-05-11 07:21:27 -07004141 drawBox(pos++, "rgba(127,127,0, 0.3)", "black", draw_coincidence ? coinCount : coinMax, draw_coincidence, coincidenceKey);
caryclarkdac1d172014-06-17 05:15:38 -07004142 drawBox(pos++, "rgba(127,127,0, 0.3)", "black", draw_op ? opCount : opMax, draw_op, opKey);
4143 drawBox(pos++, "rgba(127,127,0, 0.3)", "black", draw_sort ? sortCount : sortMax, draw_sort, sortKey);
caryclark03b03ca2015-04-23 09:13:37 -07004144 drawBox(pos++, "rgba(127,127,0, 0.3)", "black", draw_top ? topCount : topMax, draw_top, topKey);
caryclarkdac1d172014-06-17 05:15:38 -07004145 drawBox(pos++, "rgba(127,0,127, 0.3)", "black", draw_mark ? markCount : markMax, draw_mark, markKey);
4146 drawBox(pos++, "black", "white",
caryclark26ad22a2015-10-16 09:03:38 -07004147 (new Array('P', 'P1', 'P2', 'P', 'p', 'p1', 'p2'))[draw_path], draw_path != 0, pathKey);
caryclarkdac1d172014-06-17 05:15:38 -07004148 drawBox(pos++, "rgba(0,63,0, 0.7)", "white",
4149 (new Array('Q', 'Q', 'C', 'QC', 'Qc', 'Cq'))[draw_computed],
4150 draw_computed != 0, computedKey);
4151 drawBox(pos++, "green", "black", step_limit, drawSomething, '');
4152 drawBox(pos++, "green", "black", stepMax, drawSomething, '');
4153 drawBox(pos++, "rgba(255,0,0, 0.6)", "black", lastIndex, drawSomething & draw_log, '');
4154 drawBox(pos++, "rgba(255,0,0, 0.6)", "black", test.length - 1, drawSomething & draw_log, '');
4155 if (curve_t) {
4156 drawCurveTControl();
4157 }
4158 ctx.font = "normal 20px Arial";
4159 ctx.fillStyle = "rgba(0,0,0, 0.3)";
4160 ctx.textAlign = "right";
4161 ctx.fillText(scale.toFixed(decimal_places) + 'x' , screenWidth - 10, screenHeight - 5);
4162 }
4163 if (draw_hints) {
4164 ctx.font = "normal 10px Arial";
4165 ctx.fillStyle = "rgba(0,0,0, 0.5)";
4166 ctx.textAlign = "right";
4167 var y = 4;
4168 ctx.fillText("control lines : " + controlLinesKey, ctx.screenWidthwidth - 10, pos * 50 + y++ * 10);
4169 ctx.fillText("curve t : " + curveTKey, screenWidth - 10, pos * 50 + y++ * 10);
4170 ctx.fillText("deriviatives : " + deriviativesKey, screenWidth - 10, pos * 50 + y++ * 10);
4171 ctx.fillText("intersect t : " + intersectTKey, screenWidth - 10, pos * 50 + y++ * 10);
caryclarkdac1d172014-06-17 05:15:38 -07004172 ctx.fillText("log : " + logKey, screenWidth - 10, pos * 50 + y++ * 10);
4173 ctx.fillText("log curve : " + logCurvesKey, screenWidth - 10, pos * 50 + y++ * 10);
4174 ctx.fillText("mid point : " + midpointKey, screenWidth - 10, pos * 50 + y++ * 10);
4175 ctx.fillText("points : " + ptsKey, screenWidth - 10, pos * 50 + y++ * 10);
4176 ctx.fillText("sequence : " + sequenceKey, screenWidth - 10, pos * 50 + y++ * 10);
4177 ctx.fillText("xy : " + xyKey, screenWidth - 10, pos * 50 + y++ * 10);
4178 }
4179}
4180
4181function drawBox(y, backC, foreC, str, enable, label) {
4182 ctx.beginPath();
4183 ctx.fillStyle = backC;
4184 ctx.rect(screenWidth - 40, y * 50 + 10, 40, 30);
4185 ctx.fill();
4186 ctx.font = "normal 16px Arial";
4187 ctx.fillStyle = foreC;
4188 ctx.textAlign = "center";
4189 ctx.fillText(str, screenWidth - 20, y * 50 + 32);
4190 if (!enable) {
4191 ctx.fillStyle = "rgba(255,255,255, 0.5)";
4192 ctx.fill();
4193 }
4194 if (label != '') {
4195 ctx.font = "normal 9px Arial";
4196 ctx.fillStyle = "black";
4197 ctx.fillText(label, screenWidth - 47, y * 50 + 40);
4198 }
4199}
4200
4201function drawCurveTControl() {
4202 ctx.lineWidth = 2;
4203 ctx.strokeStyle = "rgba(0,0,0, 0.3)";
4204 ctx.beginPath();
4205 ctx.rect(screenWidth - 80, 40, 28, screenHeight - 80);
4206 ctx.stroke();
4207 var ty = 40 + curveT * (screenHeight - 80);
4208 ctx.beginPath();
4209 ctx.moveTo(screenWidth - 80, ty);
4210 ctx.lineTo(screenWidth - 85, ty - 5);
4211 ctx.lineTo(screenWidth - 85, ty + 5);
4212 ctx.lineTo(screenWidth - 80, ty);
4213 ctx.fillStyle = "rgba(0,0,0, 0.6)";
4214 ctx.fill();
4215 var num = curveT.toFixed(decimal_places);
4216 ctx.font = "normal 10px Arial";
4217 ctx.textAlign = "left";
4218 ctx.fillText(num, screenWidth - 78, ty);
4219}
4220
4221function ptInTControl() {
4222 var e = window.event;
4223 var tgt = e.target || e.srcElement;
4224 var left = tgt.offsetLeft;
4225 var top = tgt.offsetTop;
4226 var x = (e.clientX - left);
4227 var y = (e.clientY - top);
4228 if (x < screenWidth - 80 || x > screenWidth - 50) {
4229 return false;
4230 }
4231 if (y < 40 || y > screenHeight - 80) {
4232 return false;
4233 }
4234 curveT = (y - 40) / (screenHeight - 120);
4235 if (curveT < 0 || curveT > 1) {
4236 throw "stop execution";
4237 }
4238 return true;
4239}
4240
4241function drawTop() {
4242 if (tests[testIndex] == null) {
4243 var str = testDivs[testIndex].textContent;
4244 parse_all(str);
4245 var title = testDivs[testIndex].id.toString();
4246 testTitles[testIndex] = title;
4247 }
4248 init(tests[testIndex]);
4249 redraw();
4250}
4251
4252function redraw() {
4253 if (focus_on_selection) {
4254 collect_bounds = true;
4255 draw(tests[testIndex], testLines[testIndex], testTitles[testIndex]);
4256 collect_bounds = false;
4257 if (focusXmin < focusXmax && focusYmin < focusYmax) {
4258 setScale(focusXmin, focusXmax, focusYmin, focusYmax);
4259 }
4260 }
4261 ctx.beginPath();
4262 ctx.fillStyle = "white";
4263 ctx.rect(0, 0, screenWidth, screenHeight);
4264 ctx.fill();
4265 draw(tests[testIndex], testLines[testIndex], testTitles[testIndex]);
4266}
4267
4268function dumpCurvePartial(test, id, t0, t1) {
4269 var curve = curveByID(test, id);
4270 var name = ["line", "quad", "cubic"][curve.length / 2 - 2];
4271 console.log("id=" + id + " " + name + "=" + curveToString(curve)
4272 + " t0=" + t0 + " t1=" + t1
4273 + " partial=" + curveToString(curvePartialByID(test, id, t0, t1)));
4274}
4275
4276function dumpAngleTest(test, id, t0, t1) {
4277 var curve = curveByID(test, id);
4278 console.log(" { {" + curveToString(curve) + "}, "
4279 + curve.length / 2 + ", " + t0 + ", " + t1 + ", {} }, //");
4280}
4281
4282function dumpLogToConsole() {
4283 if (logStart < 0) {
4284 return;
4285 }
4286 var test = tests[testIndex];
4287 var recType = REC_TYPE_UNKNOWN;
4288 var records;
4289 for (var index = 0; index < test.length; index += 3) {
4290 var lastLineNo = test[index + 1];
4291 if (lastLineNo >= logStart && lastLineNo < logStart + logRange) {
4292 recType = test[index];
4293 records = test[index + 2];
4294 break;
4295 }
4296 }
4297 if (recType == REC_TYPE_UNKNOWN) {
4298 return;
4299 }
4300 var lines = testLines[testIndex];
4301 for (var idx = 0; idx < logRange; ++idx) {
4302 var line = lines[logStart + idx];
4303 console.log(line);
4304 for (var recordIndex = 0; recordIndex < records.length; recordIndex += 2) {
4305 var fragType = records[recordIndex];
4306 var frags = records[recordIndex + 1];
4307 if (recType == REC_TYPE_ANGLE && fragType == ANGLE_AFTER) {
caryclarkdac1d172014-06-17 05:15:38 -07004308 dumpCurvePartial(test, frags[0], frags[4], frags[5]);
4309 dumpCurvePartial(test, frags[6], frags[10], frags[11]);
4310 dumpCurvePartial(test, frags[12], frags[16], frags[17]);
4311 console.log("\nstatic IntersectData intersectDataSet[] = { //");
4312 dumpAngleTest(test, frags[0], frags[4], frags[5]);
4313 dumpAngleTest(test, frags[6], frags[10], frags[11]);
4314 dumpAngleTest(test, frags[12], frags[16], frags[17]);
4315 console.log("}; //");
4316 }
4317 }
4318 }
4319}
4320
4321var activeKey = 'a';
4322var pathKey = 'b';
4323var pathBackKey = 'B';
4324var centerKey = 'c';
caryclark624637c2015-05-11 07:21:27 -07004325var coincidenceKey = 'C';
caryclarkdac1d172014-06-17 05:15:38 -07004326var addKey = 'd';
4327var deriviativesKey = 'f';
4328var angleKey = 'g';
4329var angleBackKey = 'G';
caryclarkdac1d172014-06-17 05:15:38 -07004330var intersectionKey = 'i';
4331var intersectionBackKey = 'I';
4332var sequenceKey = 'j';
4333var midpointKey = 'k';
4334var logKey = 'l';
4335var logToConsoleKey = 'L';
4336var markKey = 'm';
4337var sortKey = 'o';
4338var opKey = 'p';
4339var opBackKey = 'P';
4340var computedKey = 'q';
4341var computedBackKey = 'Q';
4342var stepKey = 's';
4343var stepBackKey = 'S';
4344var intersectTKey = 't';
caryclark03b03ca2015-04-23 09:13:37 -07004345var topKey = 'T';
caryclarkdac1d172014-06-17 05:15:38 -07004346var curveTKey = 'u';
4347var controlLinesBackKey = 'V';
4348var controlLinesKey = 'v';
4349var ptsKey = 'x';
4350var xyKey = 'y';
4351var logCurvesKey = 'z';
4352var focusKey = '`';
4353var idKey = '.';
4354var retinaKey = '\\';
4355
4356function doKeyPress(evt) {
4357 var char = String.fromCharCode(evt.charCode);
4358 var focusWasOn = false;
4359 switch (char) {
4360 case '0':
4361 case '1':
4362 case '2':
4363 case '3':
4364 case '4':
4365 case '5':
4366 case '6':
4367 case '7':
4368 case '8':
4369 case '9':
4370 decimal_places = char - '0';
4371 redraw();
4372 break;
4373 case activeKey:
4374 draw_active ^= true;
4375 redraw();
4376 break;
4377 case addKey:
4378 draw_add ^= true;
4379 redraw();
4380 break;
4381 case angleKey:
caryclark54359292015-03-26 07:52:43 -07004382 draw_angle = (draw_angle + 1) % 4;
caryclarkdac1d172014-06-17 05:15:38 -07004383 redraw();
4384 break;
4385 case angleBackKey:
4386 draw_angle = (draw_angle + 2) % 3;
4387 redraw();
4388 break;
4389 case centerKey:
4390 setScale(xmin, xmax, ymin, ymax);
4391 redraw();
4392 break;
caryclark624637c2015-05-11 07:21:27 -07004393 case coincidenceKey:
4394 draw_coincidence ^= true;
4395 redraw();
4396 break;
caryclarkdac1d172014-06-17 05:15:38 -07004397 case controlLinesBackKey:
4398 control_lines = (control_lines + 3) % 4;
4399 redraw();
4400 break;
4401 case controlLinesKey:
4402 control_lines = (control_lines + 1) % 4;
4403 redraw();
4404 break;
4405 case computedBackKey:
4406 draw_computed = (draw_computed + 5) % 6;
4407 redraw();
4408 break;
4409 case computedKey:
4410 draw_computed = (draw_computed + 1) % 6;
4411 redraw();
4412 break;
4413 case curveTKey:
4414 curve_t ^= true;
4415 if (curve_t) {
4416 draw_legend = true;
4417 }
4418 redraw();
4419 break;
4420 case deriviativesKey:
4421 draw_deriviatives = (draw_deriviatives + 1) % 3;
4422 redraw();
4423 break;
4424 case focusKey:
4425 focus_on_selection ^= true;
4426 setScale(xmin, xmax, ymin, ymax);
4427 redraw();
4428 break;
caryclarkdac1d172014-06-17 05:15:38 -07004429 case idKey:
4430 draw_id ^= true;
4431 redraw();
4432 break;
4433 case intersectionBackKey:
4434 draw_intersection = (draw_intersection + 3) % 4;
4435 redraw();
4436 break;
4437 case intersectionKey:
4438 draw_intersection = (draw_intersection + 1) % 4;
4439 redraw();
4440 break;
4441 case intersectTKey:
4442 draw_intersectT ^= true;
4443 redraw();
4444 break;
4445 case logCurvesKey:
4446 logCurves(tests[testIndex]);
4447 break;
4448 case logKey:
4449 draw_log ^= true;
4450 redraw();
4451 break;
4452 case logToConsoleKey:
4453 if (draw_log) {
4454 dumpLogToConsole();
4455 }
4456 break;
4457 case markKey:
4458 draw_mark ^= true;
4459 redraw();
4460 break;
4461 case midpointKey:
4462 draw_midpoint ^= true;
4463 redraw();
4464 break;
4465 case opKey:
4466 draw_op = (draw_op + 1) % 3;
4467 redraw();
4468 break;
4469 case opBackKey:
4470 draw_op = (draw_op + 2) % 3;
4471 redraw();
4472 break;
4473 case pathKey:
caryclark26ad22a2015-10-16 09:03:38 -07004474 draw_path = (draw_path + 1) % (4 + (hasAlignedPath ? 3 : 0));
caryclarkdac1d172014-06-17 05:15:38 -07004475 redraw();
4476 break;
4477 case pathBackKey:
caryclark26ad22a2015-10-16 09:03:38 -07004478 draw_path = (draw_path + 3 + (hasAlignedPath ? 3 : 0)) % (4 + (hasAlignedPath ? 3 : 0));
caryclarkdac1d172014-06-17 05:15:38 -07004479 redraw();
4480 break;
4481 case ptsKey:
4482 pt_labels = (pt_labels + 1) % 3;
4483 redraw();
4484 break;
4485 case retinaKey:
4486 retina_scale ^= true;
4487 drawTop();
4488 break;
4489 case sequenceKey:
4490 draw_sequence ^= true;
4491 redraw();
4492 break;
4493 case sortKey:
4494 draw_sort = (draw_sort + 1) % 3;
4495 drawTop();
4496 break;
4497 case stepKey:
4498 step_limit++;
4499 if (step_limit > stepMax) {
4500 step_limit = stepMax;
4501 }
4502 redraw();
4503 break;
4504 case stepBackKey:
4505 step_limit--;
4506 if (step_limit < 0) {
4507 step_limit = 0;
4508 }
4509 redraw();
4510 break;
caryclark03b03ca2015-04-23 09:13:37 -07004511 case topKey:
4512 draw_top ^= true;
4513 redraw();
4514 break;
caryclarkdac1d172014-06-17 05:15:38 -07004515 case xyKey:
4516 debug_xy = (debug_xy + 1) % 3;
4517 redraw();
4518 break;
4519 case '-':
4520 focusWasOn = focus_on_selection;
4521 if (focusWasOn) {
4522 focus_on_selection = false;
4523 scale /= 1.2;
4524 } else {
4525 scale /= 2;
4526 calcLeftTop();
4527 }
4528 redraw();
4529 focus_on_selection = focusWasOn;
4530 break;
4531 case '=':
4532 case '+':
4533 focusWasOn = focus_on_selection;
4534 if (focusWasOn) {
4535 focus_on_selection = false;
4536 scale *= 1.2;
4537 } else {
4538 scale *= 2;
4539 calcLeftTop();
4540 }
4541 redraw();
4542 focus_on_selection = focusWasOn;
4543 break;
4544 case '?':
4545 draw_hints ^= true;
4546 if (draw_hints && !draw_legend) {
4547 draw_legend = true;
4548 }
4549 redraw();
4550 break;
4551 case '/':
4552 draw_legend ^= true;
4553 redraw();
4554 break;
4555 }
4556}
4557
4558function doKeyDown(evt) {
4559 var char = evt.keyCode;
4560 var preventDefault = false;
4561 switch (char) {
4562 case 37: // left arrow
4563 if (evt.shiftKey) {
4564 testIndex -= 9;
4565 }
4566 if (--testIndex < 0)
4567 testIndex = tests.length - 1;
4568 drawTop();
4569 preventDefault = true;
4570 break;
4571 case 39: // right arrow
4572 if (evt.shiftKey) {
4573 testIndex += 9;
4574 }
4575 if (++testIndex >= tests.length)
4576 testIndex = 0;
4577 drawTop();
4578 preventDefault = true;
4579 break;
4580 }
4581 if (preventDefault) {
4582 evt.preventDefault();
4583 return false;
4584 }
4585 return true;
4586}
4587
4588(function() {
4589 var hidden = "hidden";
4590
4591 // Standards:
4592 if (hidden in document)
4593 document.addEventListener("visibilitychange", onchange);
4594 else if ((hidden = "mozHidden") in document)
4595 document.addEventListener("mozvisibilitychange", onchange);
4596 else if ((hidden = "webkitHidden") in document)
4597 document.addEventListener("webkitvisibilitychange", onchange);
4598 else if ((hidden = "msHidden") in document)
4599 document.addEventListener("msvisibilitychange", onchange);
4600 // IE 9 and lower:
4601 else if ('onfocusin' in document)
4602 document.onfocusin = document.onfocusout = onchange;
4603 // All others:
4604 else
4605 window.onpageshow = window.onpagehide
4606 = window.onfocus = window.onblur = onchange;
4607
4608 function onchange (evt) {
4609 var v = 'visible', h = 'hidden',
4610 evtMap = {
4611 focus:v, focusin:v, pageshow:v, blur:h, focusout:h, pagehide:h
4612 };
4613
4614 evt = evt || window.event;
4615 if (evt.type in evtMap)
4616 document.body.className = evtMap[evt.type];
4617 else
4618 document.body.className = this[hidden] ? "hidden" : "visible";
4619 }
4620})();
4621
4622function calcXY() {
4623 var e = window.event;
4624 var tgt = e.target || e.srcElement;
4625 var left = tgt.offsetLeft;
4626 var top = tgt.offsetTop;
4627 mouseX = (e.clientX - left) / scale + srcLeft;
4628 mouseY = (e.clientY - top) / scale + srcTop;
4629}
4630
4631function calcLeftTop() {
4632 srcLeft = mouseX - screenWidth / 2 / scale;
4633 srcTop = mouseY - screenHeight / 2 / scale;
4634}
4635
4636var disableClick = false;
4637
4638function handleMouseClick() {
4639 if (disableClick) {
4640 return;
4641 }
4642 if (!curve_t || !ptInTControl()) {
4643 calcXY();
4644 calcLeftTop();
4645 }
4646 redraw();
4647// if (!curve_t || !ptInTControl()) {
4648// mouseX = screenWidth / 2 / scale + srcLeft;
4649// mouseY = screenHeight / 2 / scale + srcTop;
4650// }
4651}
4652
4653function handleMouseOver() {
4654 calcXY();
4655 if (debug_xy != 2) {
4656 return;
4657 }
4658 var num = mouseX.toFixed(decimal_places) + ", " + mouseY.toFixed(decimal_places);
4659 ctx.beginPath();
4660 ctx.rect(300,100,num.length * 6,10);
4661 ctx.fillStyle="white";
4662 ctx.fill();
4663 ctx.font = "normal 10px Arial";
4664 ctx.fillStyle="black";
4665 ctx.textAlign = "left";
4666 ctx.fillText(num, 300, 108);
4667}
4668
4669function start() {
4670 for (var i = 0; i < testDivs.length; ++i) {
4671 tests[i] = null;
4672 }
4673 testIndex = 0;
4674 drawTop();
4675 window.addEventListener('keypress', doKeyPress, true);
4676 window.addEventListener('keydown', doKeyDown, true);
4677 window.onresize = function() {
4678 drawTop();
4679 }
4680 /*
4681 window.onpagehide = function() {
4682 disableClick = true;
4683 }
4684 */
4685 window.onpageshow = function () {
4686 disableClick = false;
4687 }
4688}
4689
4690</script>
4691</head>
4692
4693<body onLoad="start();">
4694<canvas id="canvas" width="750" height="500"
4695 onmousemove="handleMouseOver()"
4696 onclick="handleMouseClick()"
4697 ></canvas >
4698</body>
4699</html>