forked from Delapouite/JsClipper
-
Notifications
You must be signed in to change notification settings - Fork 0
/
demo.js
1400 lines (1355 loc) · 149 KB
/
demo.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
/* globals $, _, Raphael, ClipperLib, RGBColor */
var selectedPolygons = 1; // Texts
var subj = {
fillType: 1,
random: null,
subPolygons: 0,
totalPoints: 0
};
var clip = {
fillType: 1,
random: null,
subPolygons: 0,
totalPoints: 0
};
var solution = {
subPolygons: 0,
totalPoints: 0
};
var clipType = 3; // Xor
var clean = true;
var cleanDeltaDefault = 0.1;
var cleanDelta = cleanDeltaDefault;
var simplify = true;
var lighten = true;
var lightenDistanceDefault = 0.1;
var lightenDistance = lightenDistanceDefault;
var offsettablePoly = 'solution'; //, subject, clip
var joinType = 0;
var delta = -1;
var miterLimit = 2.0;
var autoFix = true;
var scale = 100;
var scaleAddition = 100;
var dontRoundAndScale = false;
var bevel = 0;
var explorerEnabled = true;
var clipper = new ClipperLib.Clipper();
var ss, cc, sss;
var offsetResult;
var p, p1, p2, p3;
var bench;
var lastCompletedBenchmark;
var benchmarkGlob = [];
var benchmarkElapsedTime = 0;
var benchmarkExports = '';
var benchmarkRunning = false;
var benchmarkAutomaticClick = false;
var benchmarkClickedButtonId;
var benchmarkRepeat = 0;
var benchmarkRepeatTimes;
// The Phantom image
var defaultCustomSubjectPolygon = '[[{"X":-29.42,"Y":106.23},{"X":-26.7,"Y":105.45},{"X":-11.55,"Y":101.73},{"X":0.12,"Y":99.72},{"X":9.69,"Y":98.94},{"X":17.63,"Y":99.17},{"X":24.29,"Y":100.23},{"X":23.93,"Y":92.91},{"X":24.08,"Y":81.36},{"X":25.12,"Y":70.62},{"X":26.99,"Y":60.59},{"X":29.66,"Y":51.22},{"X":33.11,"Y":42.43},{"X":37.31,"Y":34.29},{"X":42.16,"Y":26.9},{"X":47.77,"Y":20.05},{"X":53.98,"Y":13.98},{"X":60.82,"Y":8.61},{"X":68.2,"Y":4.01},{"X":76.04,"Y":0.24},{"X":84.37,"Y":-2.73},{"X":92.97,"Y":-4.8},{"X":101.89,"Y":-5.98},{"X":110.88,"Y":-6.23},{"X":120,"Y":-5.53},{"X":128.99,"Y":-3.88},{"X":137.63,"Y":-1.36},{"X":145.94,"Y":2.06},{"X":153.87,"Y":6.32},{"X":161.29,"Y":11.4},{"X":168.03,"Y":17.14},{"X":174.22,"Y":23.66},{"X":179.7,"Y":30.8},{"X":184.49,"Y":38.59},{"X":188.54,"Y":46.95},{"X":191.9,"Y":56.1},{"X":194.44,"Y":65.81},{"X":196.16,"Y":76.18},{"X":197,"Y":87.09},{"X":196.94,"Y":98.79},{"X":195.88,"Y":111.18},{"X":207.51,"Y":112.86},{"X":220.6,"Y":115.46},{"X":233.18,"Y":118.91},{"X":245.2,"Y":123.18},{"X":256.72,"Y":128.26},{"X":267.97,"Y":134.26},{"X":278.87,"Y":141.16},{"X":289.73,"Y":149.16},{"X":300.72,"Y":158.47},{"X":312.07,"Y":169.38},{"X":312.06,"Y":169.37},{"X":336.14,"Y":177.32},{"X":355.16,"Y":183.81},{"X":367.78,"Y":189},{"X":378.1,"Y":194.19},{"X":387.04,"Y":199.69},{"X":395.07,"Y":205.73},{"X":400.6,"Y":210.78},{"X":405.18,"Y":216.34},{"X":409.93,"Y":223.8},{"X":420.35,"Y":243.91},{"X":425.91,"Y":253.51},{"X":431.07,"Y":260.69},{"X":436.35,"Y":266.43},{"X":436.34,"Y":266.42},{"X":443.69,"Y":272.81},{"X":469.07,"Y":291.49},{"X":477.42,"Y":298.56},{"X":483.68,"Y":305.01},{"X":487.79,"Y":310.56},{"X":497.28,"Y":326.73},{"X":502.53,"Y":334.76},{"X":511.53,"Y":345.81},{"X":337.97,"Y":345.86},{"X":315.38,"Y":321.1},{"X":303.25,"Y":308.84},{"X":303.26,"Y":308.85},{"X":292.72,"Y":299.47},{"X":292.69,"Y":299.5},{"X":290.88,"Y":300.26},{"X":290.89,"Y":300.25},{"X":283.26,"Y":304.12},{"X":283.27,"Y":304.11},{"X":275.98,"Y":308.87},{"X":268.76,"Y":314.74},{"X":261.42,"Y":322.02},{"X":261.43,"Y":322.01},{"X":253.55,"Y":331.26},{"X":242.73,"Y":345.84},{"X":-29.42,"Y":345.86}],[{"X":127.69,"Y":269.76},{"X":127.68,"Y":269.77},{"X":133.88,"Y":268.63},{"X":133.87,"Y":268.64},{"X":139.54,"Y":266.65},{"X":139.53,"Y":266.66},{"X":144.66,"Y":263.86},{"X":144.65,"Y":263.87},{"X":149.4,"Y":260.18},{"X":149.39,"Y":260.19},{"X":153.81,"Y":255.5},{"X":158.06,"Y":249.51},{"X":162.29,"Y":241.74},{"X":166.81,"Y":231.1},{"X":166.8,"Y":231.11},{"X":176.87,"Y":202.06},{"X":182.04,"Y":188.77},{"X":182.04,"Y":188.78},{"X":182.02,"Y":188.77},{"X":181.74,"Y":188.64},{"X":181.75,"Y":188.65},{"X":179.85,"Y":188.27},{"X":178.29,"Y":188.8},{"X":178.3,"Y":188.79},{"X":176.74,"Y":190.4},{"X":176.75,"Y":190.39},{"X":173.98,"Y":196.05},{"X":173.14,"Y":196.87},{"X":172.34,"Y":196.57},{"X":171.01,"Y":194.4},{"X":174.86,"Y":188.74},{"X":180.8,"Y":179.01},{"X":185.49,"Y":169.61},{"X":185.48,"Y":169.62},{"X":188.88,"Y":160.79},{"X":188.87,"Y":160.8},{"X":191.15,"Y":152.4},{"X":191.14,"Y":152.41},{"X":192.39,"Y":144.4},{"X":192.38,"Y":144.41},{"X":192.65,"Y":136.76},{"X":192.65,"Y":136.77},{"X":191.95,"Y":129.43},{"X":191.96,"Y":129.44},{"X":190.36,"Y":122.45},{"X":189.2,"Y":126.33},{"X":186.64,"Y":132.72},{"X":183.5,"Y":138.19},{"X":179.85,"Y":142.75},{"X":175.82,"Y":146.34},{"X":171.49,"Y":149.01},{"X":166.88,"Y":150.79},{"X":162.01,"Y":151.66},{"X":157.07,"Y":151.61},{"X":152.08,"Y":150.61},{"X":147.07,"Y":148.62},{"X":142.21,"Y":145.63},{"X":137.56,"Y":141.62},{"X":133.27,"Y":136.62},{"X":129.46,"Y":130.68},{"X":129.03,"Y":130.72},{"X":129.04,"Y":130.71},{"X":124.06,"Y":131.87},{"X":124.07,"Y":131.86},{"X":119.96,"Y":133.69},{"X":116.46,"Y":136.26},{"X":116.47,"Y":136.25},{"X":113.27,"Y":139.82},{"X":107.23,"Y":149.32},{"X":104.14,"Y":153.18},{"X":101,"Y":155.72},{"X":97.49,"Y":157.4},{"X":93.11,"Y":158.38},{"X":88.02,"Y":158.61},{"X":83.43,"Y":157.91},{"X":79.22,"Y":156.35},{"X":75,"Y":153.77},{"X":70.26,"Y":149.63},{"X":60.57,"Y":138.77},{"X":54.38,"Y":132.43},{"X":54.39,"Y":132.44},{"X":49.11,"Y":128.26},{"X":43.79,"Y":125.19},{"X":43.54,"Y":126.2},{"X":43.55,"Y":126.19},{"X":43.13,"Y":133.69},{"X":43.13,"Y":133.68},{"X":43.66,"Y":140.71},{"X":43.65,"Y":140.7},{"X":45.09,"Y":147.46},{"X":45.08,"Y":147.45},{"X":47.49,"Y":154.24},{"X":47.48,"Y":154.23},{"X":51.23,"Y":161.76},{"X":63.98,"Y":182.09},{"X":67.55,"Y":189.18},{"X":69.73,"Y":195.4},{"X":70.92,"Y":201.58},{"X":71.16,"Y":207.87},{"X":70.43,"Y":214.58},{"X":68.63,"Y":221.85},{"X":68.56,"Y":221.68},{"X":68.68,"Y":203.83},{"X":68.68,"Y":203.84},{"X":68.16,"Y":197.1},{"X":68.17,"Y":197.11},{"X":67.05,"Y":192.75},{"X":67.06,"Y":192.76},{"X":65.5,"Y":189.85},{"X":65.51,"Y":189.86},{"X":63.49,"Y":187.86},{"X":60.94,"Y":186.59},{"X":60.95,"Y":186.6},{"X":57.55,"Y":186.01},{"X":57.78,"Y":189.41},{"X":57.77,"Y":189.4},{"X":59.32,"Y":201.46},{"X":59.31,"Y":201.45},{"X":61.68,"Y":212.76},{"X":61.67,"Y":212.75},{"X":64.76,"Y":223.11},{"X":64.75,"Y":223.1},{"X":68.47,"Y":232.45},{"X":72.73,"Y":240.71},{"X":77.44,"Y":247.84},{"X":82.45,"Y":253.81},{"X":82.44,"Y":253.8},{"X":87.82,"Y":258.8},{"X":93.45,"Y":262.8},{"X":93.44,"Y":262.79},{"X":99.44,"Y":265.89},{"X":99.43,"Y":265.88},{"X":105.67,"Y":268.07},{"X":105.66,"Y":268.06},{"X":112.58,"Y":269.42},{"X":112.57,"Y":269.41},{"X":120.65,"Y":270.08}],[{"X":121.49,"Y":240.71},{"X":118.05,"Y":239.68},{"X":115.54,"Y":238.06},{"X":113.86,"Y":235.97},{"X":112.96,"Y":233.43},{"X":112.86,"Y":230.29},{"X":112.9,"Y":230.33},{"X":114.24,"Y":231.32},{"X":114.23,"Y":231.31},{"X":117.3,"Y":232.52},{"X":117.29,"Y":232.51},{"X":122.05,"Y":233.17},{"X":132.1,"Y":233.03},{"X":140.49,"Y":233.06},{"X":139.8,"Y":234.49},{"X":137.79,"Y":236.7},{"X":134.63,"Y":238.72},{"X":130.41,"Y":240.25},{"X":125.83,"Y":240.94}],[{"X":90.76,"Y":219.11},{"X":91.11,"Y":218.28},{"X":92.59,"Y":216.41},{"X":95.22,"Y":214.69},{"X":99.6,"Y":213.14},{"X":106.53,"Y":211.9},{"X":117,"Y":211.2},{"X":143.09,"Y":211.3},{"X":151.49,"Y":210.93},{"X":151.31,"Y":211.49},{"X":149.72,"Y":213.46},{"X":147.43,"Y":214.88},{"X":143.97,"Y":215.82},{"X":138.58,"Y":216.09},{"X":117.5,"Y":214.37},{"X":117.51,"Y":214.38},{"X":108.81,"Y":214.35},{"X":101.81,"Y":215.22},{"X":101.82,"Y":215.21},{"X":95.89,"Y":216.85},{"X":95.9,"Y":216.84},{"X":90.72,"Y":219.22}],[{"X":131.9,"Y":198.38},{"X":131.72,"Y":195.25},{"X":132.38,"Y":192.96},{"X":133.78,"Y":191.21},{"X":136.84,"Y":189.34},{"X":140.91,"Y":187.09},{"X":142.52,"Y":185.35},{"X":143.3,"Y":183.24},{"X":143.3,"Y":183.25},{"X":143.22,"Y":183.13},{"X":141.54,"Y":180.12},{"X":139.65,"Y":174.9},{"X":138.32,"Y":168.14},{"X":137.62,"Y":158.87},{"X":137.76,"Y":144.77},{"X":142.77,"Y":159.79},{"X":145.49,"Y":170.4},{"X":146.69,"Y":178.4},{"X":146.78,"Y":184.55},{"X":146.02,"Y":189.28},{"X":144.58,"Y":192.89},{"X":142.54,"Y":195.66},{"X":139.94,"Y":197.69},{"X":136.5,"Y":199.14},{"X":132.22,"Y":199.86}],[{"X":108.17,"Y":188.43},{"X":106.35,"Y":187.41},{"X":105.13,"Y":185.72},{"X":104.56,"Y":183.25},{"X":104.61,"Y":183.31},{"X":104.81,"Y":183.53},{"X":104.8,"Y":183.52},{"X":106.39,"Y":184.64},{"X":106.38,"Y":184.63},{"X":108.44,"Y":184.92},{"X":114,"Y":183.64},{"X":116.83,"Y":183.49},{"X":119.09,"Y":184.26},{"X":121.14,"Y":185.99},{"X":120.5,"Y":186.31},{"X":114.98,"Y":188.22},{"X":110.98,"Y":188.8}],[{"X":163.89,"Y":141.31},{"X":166.4,"Y":137.22},{"X":174.87,"Y":127.72},{"X":177.63,"Y":123.62},{"X":179.28,"Y":119.59},{"X":179.28,"Y":119.6},{"X":179.24,"Y":119.6},{"X":179.25,"Y":119.59},{"X":176.7,"Y":119.79},{"X":176.71,"Y":119.78},{"X":170.65,"Y":120.87},{"X":170.66,"Y":120.86},{"X":164.55,"Y":122.95},{"X":164.56,"Y":122.94},{"X":148.93,"Y":130.62},{"X":148.93,"Y":130.61},{"X":149.21,"Y":132.61},{"X":149.2,"Y":132.6},{"X":150.57,"Y":136.41},{"X":152.55,"Y":139.41},{"X":152.54,"Y":139.4},{"X":155.11,"Y":141.71},{"X":155.1,"Y":141.7},{"X":158.43,"Y":143.41},{"X":158.42,"Y":143.4},{"X":162.62,"Y":144.5}],[{"X":90.87,"Y":144.21},{"X":90.86,"Y":144.22},{"X":93.93,"Y":139.6},{"X":97.47,"Y":134.4},{"X":99.02,"Y":130.65},{"X":99.02,"Y":130.66},{"X":98.92,"Y":130.62},{"X":98.93,"Y":130.63},{"X":63.23,"Y":119.65},{"X":67.31,"Y":125.14},{"X":73.8,"Y":132.62},{"X":73.79,"Y":132.61},{"X":79.3,"Y":137.68},{"X":84.84,"Y":141.56},{"X":84.83,"Y":141.55},{"X":90.59,"Y":144.44}],[{"X":128.47,"Y":127.41},{"X":128.46,"Y":127.42},{"X":134.55,"Y":125.73},{"X":134.54,"Y":125.74},{"X":141.57,"Y":122.7},{"X":141.56,"Y":122.71},{"X":154.9,"Y":115.21},{"X":164.19,"Y":110.32},{"X":171.16,"Y":107.57},{"X":177.57,"Y":106},{"X":183.83,"Y":105.4},{"X":190.12,"Y":105.74},{"X":182.19,"Y":101.42},{"X":182.2,"Y":101.43},{"X":175.96,"Y":98.85},{"X":175.97,"Y":98.86},{"X":170.13,"Y":97.45},{"X":170.14,"Y":97.46},{"X":164,"Y":96.98},{"X":157.13,"Y":97.46},{"X":157.08,"Y":97.55},{"X":156.47,"Y":98.59},{"X":153.09,"Y":103.35},{"X":149.58,"Y":106.83},{"X":145.83,"Y":109.3},{"X":141.79,"Y":110.89},{"X":137.21,"Y":111.67},{"X":131.97,"Y":111.55},{"X":125.78,"Y":110.38},{"X":117.8,"Y":107.78},{"X":92.32,"Y":96.78},{"X":92.33,"Y":96.79},{"X":83.94,"Y":93.95},{"X":83.95,"Y":93.96},{"X":77.47,"Y":92.65},{"X":77.48,"Y":92.66},{"X":72.09,"Y":92.45},{"X":67.49,"Y":93.16},{"X":67.5,"Y":93.15},{"X":63.28,"Y":94.72},{"X":63.29,"Y":94.71},{"X":59.49,"Y":97.13},{"X":55.9,"Y":100.53},{"X":55.91,"Y":100.52},{"X":52.52,"Y":105.09},{"X":49.25,"Y":111.18},{"X":52.77,"Y":110.06},{"X":58.91,"Y":108.7},{"X":64.9,"Y":108.31},{"X":70.86,"Y":108.86},{"X":77.27,"Y":110.42},{"X":84.53,"Y":113.27},{"X":105.04,"Y":123.87},{"X":105.03,"Y":123.86},{"X":111.74,"Y":126.51},{"X":111.73,"Y":126.5},{"X":117.29,"Y":127.77},{"X":117.28,"Y":127.76},{"X":122.82,"Y":128.06}]]';
// The Phantom Skull Ring
var defaultCustomClipPolygon = '[[{"X":385.77,"Y":166.95},{"X":386.68,"Y":182.21},{"X":386.15,"Y":187.13},{"X":384.96,"Y":190.99},{"X":382.95,"Y":194.32},{"X":379.91,"Y":197.42},{"X":375.8,"Y":200.17},{"X":370.59,"Y":202.47},{"X":364.37,"Y":204.13},{"X":357.67,"Y":204.95},{"X":350.93,"Y":204.85},{"X":344.71,"Y":203.87},{"X":339.59,"Y":202.19},{"X":335.52,"Y":199.95},{"X":332.61,"Y":197.37},{"X":330.67,"Y":194.53},{"X":329.62,"Y":191.41},{"X":329.4,"Y":187.83},{"X":330.02,"Y":183.99},{"X":331.34,"Y":181.14},{"X":333.27,"Y":179.05},{"X":336.11,"Y":177.4},{"X":340.71,"Y":176.05},{"X":352.22,"Y":173.98},{"X":356.3,"Y":172.51},{"X":361.25,"Y":169.4},{"X":370.03,"Y":163.12},{"X":373.94,"Y":161.22},{"X":377.01,"Y":160.6},{"X":379.53,"Y":160.94},{"X":381.9,"Y":162.19},{"X":384.3,"Y":164.67},{"X":385.77,"Y":166.93},{"X":385.77,"Y":166.95}],[{"X":270.77,"Y":163.84},{"X":273.88,"Y":163.4},{"X":276.36,"Y":163.91},{"X":280.12,"Y":166.08},{"X":285.42,"Y":169.2},{"X":291.02,"Y":171.33},{"X":299.79,"Y":173.33},{"X":307.68,"Y":175.13},{"X":311.52,"Y":176.78},{"X":314.01,"Y":178.71},{"X":315.73,"Y":181.15},{"X":316.83,"Y":184.41},{"X":317.2,"Y":188.89},{"X":316.7,"Y":192.44},{"X":315.33,"Y":195.6},{"X":313.05,"Y":198.56},{"X":309.77,"Y":201.19},{"X":305.39,"Y":203.45},{"X":299.95,"Y":205.12},{"X":293.7,"Y":205.99},{"X":287.12,"Y":205.96},{"X":280.75,"Y":205},{"X":275.02,"Y":203.24},{"X":270.05,"Y":200.77},{"X":266.08,"Y":197.81},{"X":263.1,"Y":194.47},{"X":260.95,"Y":190.7},{"X":259.68,"Y":186.54},{"X":259.29,"Y":181.92},{"X":259.86,"Y":176.86},{"X":261.36,"Y":171.68},{"X":263.13,"Y":168.56},{"X":265.48,"Y":166.25},{"X":268.64,"Y":164.55},{"X":270.77,"Y":163.84},{"X":270.77,"Y":163.84}],[{"X":303.94,"Y":227.57},{"X":303.74,"Y":222.63},{"X":304.44,"Y":218.35},{"X":305.94,"Y":214.59},{"X":308.24,"Y":211.27},{"X":311.35,"Y":208.46},{"X":315.13,"Y":206.32},{"X":319.55,"Y":204.91},{"X":324.31,"Y":204.37},{"X":329.09,"Y":204.77},{"X":333.4,"Y":206.03},{"X":337.08,"Y":208.03},{"X":339.99,"Y":210.61},{"X":342.11,"Y":213.69},{"X":343.43,"Y":217.19},{"X":343.94,"Y":221.2},{"X":343.59,"Y":225.38},{"X":342.53,"Y":228.01},{"X":340.69,"Y":230.17},{"X":337.79,"Y":232.02},{"X":333.81,"Y":233.34},{"X":328.46,"Y":234.03},{"X":322.02,"Y":233.83},{"X":315.23,"Y":232.68},{"X":309.37,"Y":230.81},{"X":305.39,"Y":228.73},{"X":303.99,"Y":227.61},{"X":303.94,"Y":227.57}],[{"X":421.16,"Y":64.34},{"X":421.16,"Y":64.45},{"X":422.7,"Y":96.81},{"X":424.28,"Y":149.29},{"X":425.26,"Y":216.18},{"X":425.57,"Y":327.02},{"X":220.65,"Y":327.02},{"X":220.41,"Y":312.05},{"X":219.69,"Y":230.46},{"X":219.9,"Y":144.66},{"X":221.01,"Y":65.92},{"X":233.74,"Y":65.34},{"X":264.63,"Y":64.78},{"X":325.38,"Y":65.31},{"X":363.93,"Y":65.31},{"X":393.46,"Y":64.48},{"X":420.05,"Y":62.8},{"X":420.8,"Y":62.92},{"X":421.16,"Y":64.34}],[{"X":404.57,"Y":215.13},{"X":404.58,"Y":215.08},{"X":405.83,"Y":205.87},{"X":406.55,"Y":194.49},{"X":406.3,"Y":183.7},{"X":405.16,"Y":173.57},{"X":403.17,"Y":164.03},{"X":400.34,"Y":155.01},{"X":396.73,"Y":146.61},{"X":392.34,"Y":138.76},{"X":387.23,"Y":131.54},{"X":381.47,"Y":125.02},{"X":375.05,"Y":119.16},{"X":368.04,"Y":114.01},{"X":360.39,"Y":109.58},{"X":352.3,"Y":105.99},{"X":343.88,"Y":103.28},{"X":335.22,"Y":101.47},{"X":326.42,"Y":100.59},{"X":317.57,"Y":100.64},{"X":308.77,"Y":101.63},{"X":300.3,"Y":103.53},{"X":292.06,"Y":106.33},{"X":284.32,"Y":109.94},{"X":277.01,"Y":114.36},{"X":270.11,"Y":119.65},{"X":263.83,"Y":125.67},{"X":258.83,"Y":131.66},{"X":253.44,"Y":139.77},{"X":248.35,"Y":149.13},{"X":244.11,"Y":158.88},{"X":241,"Y":168.28},{"X":239,"Y":177.21},{"X":238.09,"Y":185.4},{"X":238.17,"Y":192.9},{"X":239.13,"Y":199.57},{"X":240.91,"Y":205.61},{"X":243.45,"Y":211.04},{"X":246.09,"Y":214.67},{"X":249.63,"Y":217.9},{"X":254.56,"Y":221.04},{"X":270.07,"Y":228.23},{"X":275.76,"Y":231.57},{"X":279.77,"Y":234.93},{"X":282.82,"Y":238.64},{"X":285.08,"Y":242.87},{"X":286.61,"Y":247.72},{"X":287.31,"Y":253.67},{"X":287.19,"Y":274.82},{"X":287.8,"Y":281.39},{"X":288.94,"Y":285.57},{"X":290.57,"Y":288.43},{"X":292.56,"Y":290.24},{"X":295.1,"Y":291.3},{"X":295.83,"Y":283.75},{"X":296,"Y":265.6},{"X":296.31,"Y":250.76},{"X":297.29,"Y":241.67},{"X":299.29,"Y":240.75},{"X":303.08,"Y":239.94},{"X":307.26,"Y":240},{"X":307.66,"Y":242.7},{"X":309.02,"Y":256.43},{"X":310.57,"Y":291.19},{"X":311.49,"Y":291.54},{"X":314.95,"Y":293.31},{"X":316.6,"Y":294.82},{"X":316.6,"Y":295.52},{"X":315.35,"Y":295.94},{"X":315.99,"Y":296.02},{"X":317.2,"Y":295.47},{"X":318.2,"Y":293.99},{"X":319.04,"Y":290.81},{"X":319.39,"Y":284.37},{"X":318.41,"Y":262.35},{"X":318.37,"Y":251.85},{"X":319.08,"Y":245.75},{"X":320.27,"Y":242.05},{"X":321.29,"Y":240.77},{"X":323.08,"Y":240.08},{"X":328.27,"Y":240},{"X":329.31,"Y":244.13},{"X":330.19,"Y":252.03},{"X":330.63,"Y":273.92},{"X":331.25,"Y":284.25},{"X":332.33,"Y":289.99},{"X":333.7,"Y":293.31},{"X":335.26,"Y":295.12},{"X":337.01,"Y":295.94},{"X":337.81,"Y":294.94},{"X":339.33,"Y":291.52},{"X":340.32,"Y":286.68},{"X":340.61,"Y":279.64},{"X":339.38,"Y":260.18},{"X":339.31,"Y":251.49},{"X":340.05,"Y":245.84},{"X":341.39,"Y":241.87},{"X":342.36,"Y":240.75},{"X":344.31,"Y":240.04},{"X":351.49,"Y":240},{"X":351.67,"Y":240.9},{"X":352.45,"Y":248.35},{"X":352.58,"Y":274.14},{"X":353.27,"Y":282.2},{"X":354.5,"Y":287.31},{"X":356.13,"Y":290.68},{"X":358.13,"Y":292.86},{"X":359.27,"Y":289.89},{"X":360.62,"Y":284.2},{"X":361.32,"Y":276.58},{"X":361.16,"Y":258.89},{"X":361.45,"Y":247.8},{"X":365.47,"Y":242.21},{"X":370.89,"Y":236.4},{"X":377.72,"Y":230.54},{"X":385.94,"Y":224.78},{"X":395.31,"Y":219.41},{"X":404.57,"Y":215.13}]]';
var outputFormat = 'Clipper'; //, Plain, SVG
// this hold the original ClipperLib.MaxSteps value during benchmarks, ClipperLib.MaxSteps is set to 10 to make benchmarks comparable
var ClipperLibOriginalMaxSteps;
var windowWidth = $(document).width() * 0.9;
var updateEnlargedSVG = false;
var updateSVGSource = false;
var lsk = 0;
var randomSettings = {
current: 'norm',
rect: {
'default': {
clipPolygonCount: 1,
clipPointCount: 4,
subjPolygonCount: 2,
subjPointCount: 8
},
min: {
clipPolygonCount: 1,
clipPointCount: 4,
subjPolygonCount: 1,
subjPointCount: 4
},
max: {
clipPolygonCount: 100,
clipPointCount: 100,
subjPolygonCount: 100,
subjPointCount: 100
}
},
norm: {
'default': {
clipPolygonCount: 1,
clipPointCount: 3,
subjPolygonCount: 2,
subjPointCount: 8
},
min: {
clipPolygonCount: 1,
clipPointCount: 3,
subjPolygonCount: 1,
subjPointCount: 3
},
max: {
clipPolygonCount: 100,
clipPointCount: 100,
subjPolygonCount: 100,
subjPointCount: 100
}
}
};
var randomSetting = selectedPolygons === 4 ? randomSettings.rect['default'] : randomSettings.norm['default'];
var defaultPolygons = [
{ // GB and arrows
subj: '[[{"X":189,"Y":154},{"X":192,"Y":155},{"X":193,"Y":154},{"X":194,"Y":151},{"X":194,"Y":150},{"X":196,"Y":151},{"X":199,"Y":151},{"X":200,"Y":150},{"X":203,"Y":149},{"X":204,"Y":149},{"X":205,"Y":149},{"X":206,"Y":149},{"X":209,"Y":150},{"X":211,"Y":149},{"X":212,"Y":149},{"X":212,"Y":152},{"X":212,"Y":155},{"X":213,"Y":156},{"X":213,"Y":156},{"X":213,"Y":159},{"X":214,"Y":159},{"X":216,"Y":161},{"X":216,"Y":161},{"X":216,"Y":163},{"X":217,"Y":163},{"X":218,"Y":166},{"X":218,"Y":166},{"X":217,"Y":163},{"X":217,"Y":162},{"X":218,"Y":162},{"X":218,"Y":163},{"X":220,"Y":165},{"X":218,"Y":167},{"X":218,"Y":167},{"X":215,"Y":168},{"X":214,"Y":170},{"X":214,"Y":171},{"X":215,"Y":170},{"X":217,"Y":168},{"X":220,"Y":168},{"X":221,"Y":168},{"X":222,"Y":170},{"X":223,"Y":172},{"X":223,"Y":174},{"X":224,"Y":176},{"X":223,"Y":178},{"X":223,"Y":179},{"X":223,"Y":179},{"X":223,"Y":180},{"X":222,"Y":180},{"X":222,"Y":180},{"X":221,"Y":178},{"X":222,"Y":177},{"X":222,"Y":174},{"X":221,"Y":174},{"X":220,"Y":172},{"X":218,"Y":172},{"X":218,"Y":174},{"X":220,"Y":174},{"X":218,"Y":174},{"X":220,"Y":176},{"X":220,"Y":178},{"X":217,"Y":180},{"X":221,"Y":179},{"X":221,"Y":180},{"X":222,"Y":181},{"X":221,"Y":182},{"X":218,"Y":183},{"X":218,"Y":183},{"X":217,"Y":182},{"X":214,"Y":184},{"X":214,"Y":187},{"X":214,"Y":189},{"X":211,"Y":191},{"X":210,"Y":191},{"X":210,"Y":190},{"X":209,"Y":189},{"X":207,"Y":189},{"X":206,"Y":189},{"X":207,"Y":189},{"X":209,"Y":191},{"X":209,"Y":191},{"X":210,"Y":191},{"X":207,"Y":192},{"X":205,"Y":191},{"X":204,"Y":191},{"X":204,"Y":191},{"X":204,"Y":192},{"X":204,"Y":194},{"X":204,"Y":195},{"X":206,"Y":195},{"X":206,"Y":198},{"X":206,"Y":199},{"X":206,"Y":200},{"X":206,"Y":202},{"X":206,"Y":203},{"X":210,"Y":206},{"X":209,"Y":207},{"X":207,"Y":211},{"X":209,"Y":212},{"X":210,"Y":212},{"X":210,"Y":213},{"X":207,"Y":212},{"X":207,"Y":213},{"X":206,"Y":213},{"X":207,"Y":215},{"X":209,"Y":216},{"X":209,"Y":218},{"X":210,"Y":222},{"X":209,"Y":226},{"X":211,"Y":226},{"X":209,"Y":231},{"X":207,"Y":232},{"X":206,"Y":234},{"X":205,"Y":237},{"X":205,"Y":240},{"X":202,"Y":246},{"X":201,"Y":247},{"X":200,"Y":247},{"X":200,"Y":247},{"X":200,"Y":248},{"X":201,"Y":249},{"X":201,"Y":248},{"X":201,"Y":250},{"X":202,"Y":251},{"X":201,"Y":254},{"X":200,"Y":254},{"X":201,"Y":253},{"X":199,"Y":254},{"X":199,"Y":253},{"X":199,"Y":253},{"X":196,"Y":254},{"X":194,"Y":251},{"X":192,"Y":253},{"X":193,"Y":251},{"X":192,"Y":251},{"X":192,"Y":251},{"X":191,"Y":251},{"X":192,"Y":253},{"X":191,"Y":253},{"X":190,"Y":254},{"X":189,"Y":255},{"X":189,"Y":255},{"X":190,"Y":254},{"X":190,"Y":253},{"X":190,"Y":251},{"X":189,"Y":251},{"X":189,"Y":249},{"X":189,"Y":251},{"X":189,"Y":253},{"X":189,"Y":253},{"X":188,"Y":255},{"X":185,"Y":254},{"X":187,"Y":253},{"X":185,"Y":253},{"X":185,"Y":253},{"X":185,"Y":254},{"X":184,"Y":254},{"X":183,"Y":254},{"X":179,"Y":254},{"X":177,"Y":255},{"X":177,"Y":255},{"X":176,"Y":255},{"X":174,"Y":255},{"X":176,"Y":256},{"X":177,"Y":257},{"X":176,"Y":257},{"X":176,"Y":258},{"X":172,"Y":258},{"X":172,"Y":260},{"X":171,"Y":260},{"X":170,"Y":260},{"X":169,"Y":259},{"X":169,"Y":260},{"X":168,"Y":260},{"X":169,"Y":261},{"X":167,"Y":262},{"X":166,"Y":264},{"X":166,"Y":264},{"X":162,"Y":265},{"X":161,"Y":264},{"X":161,"Y":264},{"X":162,"Y":262},{"X":163,"Y":261},{"X":160,"Y":262},{"X":158,"Y":261},{"X":158,"Y":262},{"X":159,"Y":262},{"X":160,"Y":264},{"X":160,"Y":265},{"X":160,"Y":265},{"X":158,"Y":267},{"X":157,"Y":267},{"X":156,"Y":267},{"X":155,"Y":267},{"X":155,"Y":267},{"X":154,"Y":268},{"X":154,"Y":270},{"X":154,"Y":269},{"X":151,"Y":269},{"X":150,"Y":272},{"X":149,"Y":272},{"X":149,"Y":270},{"X":147,"Y":270},{"X":147,"Y":272},{"X":146,"Y":272},{"X":146,"Y":272},{"X":144,"Y":270},{"X":143,"Y":272},{"X":141,"Y":270},{"X":141,"Y":272},{"X":140,"Y":272},{"X":140,"Y":271},{"X":140,"Y":273},{"X":139,"Y":273},{"X":139,"Y":273},{"X":139,"Y":273},{"X":138,"Y":272},{"X":138,"Y":273},{"X":137,"Y":273},{"X":137,"Y":273},{"X":136,"Y":272},{"X":137,"Y":270},{"X":136,"Y":269},{"X":136,"Y":270},{"X":135,"Y":270},{"X":134,"Y":270},{"X":134,"Y":272},{"X":133,"Y":272},{"X":133,"Y":272},{"X":132,"Y":272},{"X":132,"Y":270},{"X":129,"Y":272},{"X":130,"Y":272},{"X":128,"Y":272},{"X":128,"Y":271},{"X":127,"Y":272},{"X":127,"Y":271},{"X":127,"Y":271},{"X":129,"Y":269},{"X":132,"Y":269},{"X":134,"Y":267},{"X":134,"Y":267},{"X":128,"Y":269},{"X":127,"Y":269},{"X":128,"Y":268},{"X":129,"Y":267},{"X":136,"Y":266},{"X":136,"Y":266},{"X":136,"Y":265},{"X":136,"Y":265},{"X":135,"Y":264},{"X":135,"Y":262},{"X":135,"Y":264},{"X":134,"Y":266},{"X":126,"Y":266},{"X":126,"Y":267},{"X":124,"Y":267},{"X":123,"Y":267},{"X":122,"Y":267},{"X":122,"Y":267},{"X":122,"Y":267},{"X":122,"Y":266},{"X":123,"Y":267},{"X":123,"Y":266},{"X":123,"Y":265},{"X":123,"Y":265},{"X":125,"Y":265},{"X":126,"Y":264},{"X":125,"Y":264},{"X":125,"Y":262},{"X":127,"Y":261},{"X":127,"Y":262},{"X":127,"Y":261},{"X":129,"Y":261},{"X":128,"Y":261},{"X":130,"Y":259},{"X":133,"Y":259},{"X":134,"Y":259},{"X":132,"Y":259},{"X":129,"Y":260},{"X":128,"Y":260},{"X":127,"Y":260},{"X":127,"Y":260},{"X":122,"Y":262},{"X":122,"Y":261},{"X":121,"Y":261},{"X":121,"Y":260},{"X":122,"Y":259},{"X":121,"Y":258},{"X":119,"Y":259},{"X":118,"Y":260},{"X":118,"Y":258},{"X":117,"Y":258},{"X":117,"Y":256},{"X":119,"Y":256},{"X":121,"Y":256},{"X":119,"Y":255},{"X":119,"Y":255},{"X":121,"Y":254},{"X":121,"Y":254},{"X":126,"Y":251},{"X":127,"Y":250},{"X":127,"Y":251},{"X":127,"Y":251},{"X":128,"Y":249},{"X":129,"Y":249},{"X":132,"Y":249},{"X":128,"Y":248},{"X":127,"Y":248},{"X":127,"Y":249},{"X":126,"Y":248},{"X":123,"Y":249},{"X":122,"Y":248},{"X":121,"Y":248},{"X":119,"Y":248},{"X":121,"Y":249},{"X":121,"Y":249},{"X":118,"Y":248},{"X":119,"Y":249},{"X":117,"Y":249},{"X":116,"Y":248},{"X":116,"Y":248},{"X":116,"Y":247},{"X":117,"Y":247},{"X":116,"Y":246},{"X":117,"Y":246},{"X":117,"Y":247},{"X":118,"Y":247},{"X":118,"Y":245},{"X":119,"Y":245},{"X":121,"Y":244},{"X":123,"Y":244},{"X":123,"Y":245},{"X":125,"Y":246},{"X":126,"Y":244},{"X":125,"Y":243},{"X":126,"Y":242},{"X":126,"Y":244},{"X":127,"Y":246},{"X":129,"Y":246},{"X":129,"Y":246},{"X":129,"Y":246},{"X":132,"Y":246},{"X":132,"Y":245},{"X":128,"Y":245},{"X":128,"Y":243},{"X":129,"Y":244},{"X":129,"Y":243},{"X":130,"Y":240},{"X":128,"Y":239},{"X":128,"Y":239},{"X":133,"Y":238},{"X":134,"Y":237},{"X":135,"Y":238},{"X":135,"Y":237},{"X":134,"Y":237},{"X":134,"Y":237},{"X":135,"Y":235},{"X":136,"Y":235},{"X":138,"Y":236},{"X":138,"Y":235},{"X":141,"Y":236},{"X":147,"Y":234},{"X":147,"Y":235},{"X":148,"Y":235},{"X":149,"Y":234},{"X":151,"Y":234},{"X":151,"Y":234},{"X":154,"Y":234},{"X":150,"Y":233},{"X":149,"Y":233},{"X":149,"Y":232},{"X":148,"Y":231},{"X":147,"Y":231},{"X":147,"Y":232},{"X":144,"Y":235},{"X":143,"Y":234},{"X":141,"Y":236},{"X":140,"Y":235},{"X":141,"Y":234},{"X":139,"Y":234},{"X":137,"Y":234},{"X":137,"Y":233},{"X":136,"Y":232},{"X":137,"Y":234},{"X":134,"Y":234},{"X":134,"Y":235},{"X":129,"Y":234},{"X":128,"Y":234},{"X":132,"Y":234},{"X":135,"Y":231},{"X":136,"Y":229},{"X":138,"Y":229},{"X":138,"Y":227},{"X":139,"Y":226},{"X":139,"Y":224},{"X":141,"Y":223},{"X":140,"Y":223},{"X":138,"Y":223},{"X":138,"Y":223},{"X":139,"Y":222},{"X":143,"Y":217},{"X":146,"Y":217},{"X":147,"Y":217},{"X":147,"Y":217},{"X":149,"Y":217},{"X":147,"Y":217},{"X":149,"Y":217},{"X":149,"Y":217},{"X":150,"Y":217},{"X":150,"Y":217},{"X":150,"Y":216},{"X":151,"Y":215},{"X":150,"Y":215},{"X":149,"Y":215},{"X":149,"Y":214},{"X":150,"Y":213},{"X":150,"Y":213},{"X":150,"Y":212},{"X":148,"Y":212},{"X":146,"Y":213},{"X":139,"Y":213},{"X":138,"Y":213},{"X":138,"Y":211},{"X":138,"Y":211},{"X":137,"Y":213},{"X":137,"Y":213},{"X":137,"Y":212},{"X":137,"Y":211},{"X":137,"Y":210},{"X":137,"Y":210},{"X":138,"Y":210},{"X":137,"Y":209},{"X":137,"Y":210},{"X":137,"Y":209},{"X":137,"Y":209},{"X":137,"Y":209},{"X":137,"Y":209},{"X":136,"Y":210},{"X":135,"Y":210},{"X":134,"Y":209},{"X":133,"Y":209},{"X":133,"Y":207},{"X":133,"Y":207},{"X":135,"Y":206},{"X":135,"Y":206},{"X":135,"Y":206},{"X":135,"Y":206},{"X":133,"Y":206},{"X":133,"Y":206},{"X":133,"Y":206},{"X":133,"Y":206},{"X":132,"Y":206},{"X":132,"Y":207},{"X":129,"Y":206},{"X":128,"Y":205},{"X":127,"Y":206},{"X":127,"Y":205},{"X":126,"Y":205},{"X":127,"Y":203},{"X":129,"Y":204},{"X":128,"Y":203},{"X":128,"Y":202},{"X":127,"Y":201},{"X":126,"Y":201},{"X":128,"Y":201},{"X":128,"Y":200},{"X":132,"Y":201},{"X":129,"Y":198},{"X":134,"Y":198},{"X":134,"Y":196},{"X":134,"Y":194},{"X":136,"Y":193},{"X":138,"Y":194},{"X":139,"Y":193},{"X":138,"Y":193},{"X":139,"Y":192},{"X":138,"Y":192},{"X":139,"Y":191},{"X":139,"Y":191},{"X":139,"Y":190},{"X":136,"Y":190},{"X":135,"Y":190},{"X":134,"Y":190},{"X":134,"Y":190},{"X":134,"Y":188},{"X":136,"Y":189},{"X":136,"Y":189},{"X":136,"Y":189},{"X":136,"Y":187},{"X":136,"Y":187},{"X":136,"Y":188},{"X":136,"Y":187},{"X":136,"Y":187},{"X":135,"Y":184},{"X":135,"Y":183},{"X":136,"Y":183},{"X":135,"Y":183},{"X":136,"Y":182},{"X":135,"Y":182},{"X":135,"Y":183},{"X":134,"Y":182},{"X":134,"Y":182},{"X":134,"Y":182},{"X":135,"Y":181},{"X":134,"Y":181},{"X":135,"Y":180},{"X":134,"Y":180},{"X":135,"Y":179},{"X":135,"Y":179},{"X":133,"Y":178},{"X":133,"Y":179},{"X":133,"Y":179},{"X":133,"Y":180},{"X":132,"Y":180},{"X":132,"Y":180},{"X":132,"Y":181},{"X":132,"Y":182},{"X":130,"Y":182},{"X":132,"Y":178},{"X":132,"Y":178},{"X":130,"Y":177},{"X":132,"Y":177},{"X":132,"Y":177},{"X":134,"Y":174},{"X":134,"Y":177},{"X":135,"Y":178},{"X":135,"Y":179},{"X":134,"Y":178},{"X":134,"Y":178},{"X":136,"Y":179},{"X":136,"Y":177},{"X":136,"Y":178},{"X":136,"Y":177},{"X":136,"Y":177},{"X":136,"Y":176},{"X":136,"Y":174},{"X":138,"Y":176},{"X":143,"Y":176},{"X":144,"Y":178},{"X":146,"Y":177},{"X":147,"Y":177},{"X":147,"Y":178},{"X":148,"Y":179},{"X":148,"Y":179},{"X":148,"Y":180},{"X":148,"Y":180},{"X":149,"Y":181},{"X":149,"Y":181},{"X":151,"Y":178},{"X":154,"Y":178},{"X":156,"Y":180},{"X":157,"Y":179},{"X":157,"Y":179},{"X":158,"Y":180},{"X":160,"Y":181},{"X":161,"Y":181},{"X":160,"Y":180},{"X":160,"Y":180},{"X":161,"Y":179},{"X":162,"Y":179},{"X":161,"Y":178},{"X":161,"Y":178},{"X":162,"Y":178},{"X":162,"Y":178},{"X":161,"Y":177},{"X":160,"Y":178},{"X":159,"Y":177},{"X":161,"Y":176},{"X":161,"Y":174},{"X":161,"Y":174},{"X":163,"Y":174},{"X":162,"Y":173},{"X":163,"Y":172},{"X":163,"Y":173},{"X":167,"Y":173},{"X":168,"Y":171},{"X":168,"Y":170},{"X":170,"Y":168},{"X":170,"Y":168},{"X":171,"Y":168},{"X":170,"Y":168},{"X":168,"Y":168},{"X":167,"Y":168},{"X":167,"Y":168},{"X":167,"Y":168},{"X":166,"Y":168},{"X":163,"Y":170},{"X":163,"Y":168},{"X":166,"Y":168},{"X":166,"Y":168},{"X":163,"Y":168},{"X":163,"Y":168},{"X":161,"Y":168},{"X":160,"Y":168},{"X":157,"Y":166},{"X":158,"Y":165},{"X":157,"Y":165},{"X":158,"Y":165},{"X":158,"Y":163},{"X":160,"Y":162},{"X":165,"Y":163},{"X":163,"Y":162},{"X":162,"Y":162},{"X":163,"Y":162},{"X":166,"Y":163},{"X":162,"Y":160},{"X":163,"Y":160},{"X":167,"Y":160},{"X":166,"Y":159},{"X":166,"Y":159},{"X":167,"Y":159},{"X":168,"Y":159},{"X":167,"Y":159},{"X":166,"Y":158},{"X":166,"Y":159},{"X":165,"Y":158},{"X":165,"Y":156},{"X":167,"Y":156},{"X":166,"Y":156},{"X":165,"Y":154},{"X":166,"Y":154},{"X":166,"Y":152},{"X":167,"Y":154},{"X":167,"Y":152},{"X":168,"Y":152},{"X":168,"Y":152},{"X":168,"Y":152},{"X":168,"Y":151},{"X":169,"Y":150},{"X":171,"Y":150},{"X":171,"Y":150},{"X":171,"Y":150},{"X":171,"Y":151},{"X":172,"Y":150},{"X":174,"Y":150},{"X":174,"Y":148},{"X":174,"Y":147},{"X":176,"Y":148},{"X":176,"Y":149},{"X":177,"Y":149},{"X":177,"Y":150},{"X":177,"Y":150},{"X":178,"Y":150},{"X":177,"Y":150},{"X":178,"Y":150},{"X":178,"Y":150},{"X":178,"Y":149},{"X":177,"Y":149},{"X":177,"Y":147},{"X":178,"Y":147},{"X":178,"Y":147},{"X":178,"Y":150},{"X":179,"Y":150},{"X":180,"Y":151},{"X":180,"Y":152},{"X":181,"Y":151},{"X":180,"Y":148},{"X":180,"Y":150},{"X":180,"Y":149},{"X":180,"Y":148},{"X":179,"Y":148},{"X":179,"Y":147},{"X":180,"Y":147},{"X":181,"Y":146},{"X":182,"Y":147},{"X":182,"Y":149},{"X":183,"Y":151},{"X":183,"Y":151},{"X":183,"Y":152},{"X":181,"Y":155},{"X":182,"Y":155},{"X":182,"Y":155},{"X":181,"Y":155},{"X":180,"Y":157},{"X":182,"Y":155},{"X":184,"Y":154},{"X":184,"Y":154},{"X":184,"Y":151},{"X":183,"Y":148},{"X":184,"Y":148},{"X":183,"Y":147},{"X":184,"Y":147},{"X":184,"Y":147},{"X":184,"Y":147},{"X":187,"Y":146},{"X":187,"Y":146},{"X":187,"Y":147},{"X":189,"Y":147},{"X":187,"Y":146},{"X":187,"Y":145},{"X":187,"Y":145},{"X":187,"Y":144},{"X":185,"Y":144},{"X":185,"Y":144},{"X":189,"Y":144},{"X":190,"Y":145},{"X":191,"Y":146},{"X":195,"Y":148},{"X":195,"Y":149},{"X":191,"Y":151}],[{"X":236,"Y":34},{"X":237,"Y":35},{"X":238,"Y":35},{"X":239,"Y":35},{"X":239,"Y":36},{"X":240,"Y":35},{"X":239,"Y":35},{"X":239,"Y":35},{"X":240,"Y":36},{"X":242,"Y":37},{"X":242,"Y":37},{"X":240,"Y":40},{"X":242,"Y":38},{"X":242,"Y":37},{"X":243,"Y":37},{"X":243,"Y":36},{"X":245,"Y":36},{"X":246,"Y":37},{"X":247,"Y":38},{"X":246,"Y":40},{"X":247,"Y":37},{"X":249,"Y":37},{"X":250,"Y":38},{"X":250,"Y":38},{"X":250,"Y":37},{"X":251,"Y":37},{"X":251,"Y":36},{"X":253,"Y":37},{"X":254,"Y":36},{"X":254,"Y":36},{"X":256,"Y":36},{"X":257,"Y":36},{"X":260,"Y":36},{"X":262,"Y":36},{"X":262,"Y":36},{"X":262,"Y":36},{"X":264,"Y":35},{"X":266,"Y":36},{"X":266,"Y":35},{"X":265,"Y":34},{"X":266,"Y":33},{"X":266,"Y":34},{"X":269,"Y":34},{"X":269,"Y":35},{"X":271,"Y":34},{"X":271,"Y":35},{"X":270,"Y":38},{"X":270,"Y":39},{"X":271,"Y":39},{"X":270,"Y":44},{"X":269,"Y":44},{"X":268,"Y":46},{"X":266,"Y":47},{"X":264,"Y":51},{"X":258,"Y":53},{"X":257,"Y":55},{"X":256,"Y":56},{"X":254,"Y":58},{"X":254,"Y":60},{"X":253,"Y":60},{"X":251,"Y":61},{"X":250,"Y":61},{"X":250,"Y":62},{"X":253,"Y":62},{"X":254,"Y":61},{"X":255,"Y":61},{"X":255,"Y":62},{"X":256,"Y":62},{"X":257,"Y":60},{"X":258,"Y":61},{"X":256,"Y":63},{"X":254,"Y":66},{"X":254,"Y":66},{"X":254,"Y":66},{"X":253,"Y":66},{"X":250,"Y":67},{"X":248,"Y":66},{"X":248,"Y":68},{"X":246,"Y":69},{"X":246,"Y":70},{"X":249,"Y":67},{"X":253,"Y":67},{"X":253,"Y":66},{"X":254,"Y":67},{"X":251,"Y":69},{"X":251,"Y":69},{"X":251,"Y":70},{"X":250,"Y":71},{"X":250,"Y":72},{"X":249,"Y":71},{"X":249,"Y":72},{"X":249,"Y":73},{"X":250,"Y":73},{"X":250,"Y":73},{"X":250,"Y":73},{"X":253,"Y":71},{"X":253,"Y":70},{"X":253,"Y":69},{"X":256,"Y":69},{"X":260,"Y":68},{"X":262,"Y":68},{"X":264,"Y":66},{"X":266,"Y":64},{"X":271,"Y":68},{"X":275,"Y":66},{"X":276,"Y":67},{"X":277,"Y":67},{"X":283,"Y":68},{"X":284,"Y":68},{"X":286,"Y":67},{"X":287,"Y":68},{"X":289,"Y":67},{"X":291,"Y":67},{"X":291,"Y":68},{"X":292,"Y":67},{"X":293,"Y":68},{"X":293,"Y":69},{"X":293,"Y":70},{"X":294,"Y":73},{"X":294,"Y":73},{"X":294,"Y":74},{"X":295,"Y":74},{"X":290,"Y":81},{"X":289,"Y":84},{"X":290,"Y":86},{"X":287,"Y":91},{"X":287,"Y":93},{"X":286,"Y":96},{"X":283,"Y":97},{"X":283,"Y":97},{"X":283,"Y":101},{"X":283,"Y":101},{"X":281,"Y":102},{"X":282,"Y":103},{"X":281,"Y":105},{"X":278,"Y":107},{"X":277,"Y":108},{"X":276,"Y":108},{"X":275,"Y":108},{"X":273,"Y":108},{"X":272,"Y":108},{"X":271,"Y":108},{"X":267,"Y":111},{"X":266,"Y":112},{"X":267,"Y":112},{"X":268,"Y":111},{"X":275,"Y":108},{"X":276,"Y":110},{"X":276,"Y":111},{"X":276,"Y":112},{"X":276,"Y":112},{"X":277,"Y":113},{"X":279,"Y":113},{"X":280,"Y":116},{"X":278,"Y":117},{"X":276,"Y":117},{"X":273,"Y":117},{"X":272,"Y":117},{"X":269,"Y":121},{"X":269,"Y":122},{"X":267,"Y":123},{"X":265,"Y":124},{"X":261,"Y":123},{"X":258,"Y":123},{"X":258,"Y":124},{"X":259,"Y":124},{"X":262,"Y":124},{"X":265,"Y":125},{"X":266,"Y":124},{"X":267,"Y":125},{"X":269,"Y":125},{"X":270,"Y":126},{"X":271,"Y":126},{"X":272,"Y":125},{"X":273,"Y":125},{"X":275,"Y":124},{"X":275,"Y":123},{"X":276,"Y":122},{"X":279,"Y":122},{"X":280,"Y":124},{"X":280,"Y":124},{"X":282,"Y":124},{"X":286,"Y":127},{"X":289,"Y":127},{"X":289,"Y":127},{"X":290,"Y":129},{"X":292,"Y":133},{"X":294,"Y":136},{"X":295,"Y":136},{"X":295,"Y":137},{"X":295,"Y":137},{"X":295,"Y":138},{"X":298,"Y":138},{"X":298,"Y":138},{"X":299,"Y":140},{"X":300,"Y":141},{"X":300,"Y":144},{"X":299,"Y":146},{"X":300,"Y":147},{"X":300,"Y":149},{"X":301,"Y":152},{"X":301,"Y":154},{"X":303,"Y":158},{"X":304,"Y":160},{"X":304,"Y":161},{"X":306,"Y":166},{"X":306,"Y":168},{"X":309,"Y":169},{"X":308,"Y":169},{"X":309,"Y":170},{"X":309,"Y":172},{"X":309,"Y":172},{"X":309,"Y":172},{"X":309,"Y":171},{"X":312,"Y":172},{"X":315,"Y":173},{"X":319,"Y":176},{"X":321,"Y":176},{"X":322,"Y":177},{"X":322,"Y":178},{"X":323,"Y":180},{"X":325,"Y":182},{"X":326,"Y":183},{"X":327,"Y":187},{"X":331,"Y":188},{"X":328,"Y":189},{"X":327,"Y":191},{"X":330,"Y":195},{"X":333,"Y":200},{"X":335,"Y":204},{"X":335,"Y":206},{"X":335,"Y":206},{"X":335,"Y":205},{"X":335,"Y":204},{"X":333,"Y":204},{"X":333,"Y":204},{"X":332,"Y":204},{"X":330,"Y":204},{"X":327,"Y":201},{"X":326,"Y":201},{"X":324,"Y":202},{"X":322,"Y":203},{"X":320,"Y":202},{"X":319,"Y":203},{"X":319,"Y":203},{"X":321,"Y":203},{"X":322,"Y":203},{"X":323,"Y":203},{"X":326,"Y":202},{"X":327,"Y":203},{"X":328,"Y":204},{"X":332,"Y":206},{"X":333,"Y":206},{"X":333,"Y":207},{"X":334,"Y":210},{"X":336,"Y":210},{"X":336,"Y":211},{"X":337,"Y":212},{"X":339,"Y":217},{"X":341,"Y":220},{"X":339,"Y":222},{"X":336,"Y":225},{"X":335,"Y":229},{"X":334,"Y":229},{"X":334,"Y":229},{"X":335,"Y":229},{"X":336,"Y":229},{"X":336,"Y":231},{"X":338,"Y":233},{"X":341,"Y":232},{"X":342,"Y":234},{"X":342,"Y":233},{"X":342,"Y":232},{"X":343,"Y":227},{"X":344,"Y":226},{"X":346,"Y":226},{"X":347,"Y":226},{"X":350,"Y":226},{"X":352,"Y":226},{"X":352,"Y":226},{"X":353,"Y":226},{"X":354,"Y":226},{"X":353,"Y":225},{"X":354,"Y":225},{"X":355,"Y":225},{"X":356,"Y":226},{"X":360,"Y":226},{"X":363,"Y":229},{"X":368,"Y":233},{"X":368,"Y":233},{"X":370,"Y":236},{"X":370,"Y":238},{"X":370,"Y":240},{"X":370,"Y":243},{"X":370,"Y":245},{"X":368,"Y":249},{"X":368,"Y":251},{"X":368,"Y":255},{"X":365,"Y":257},{"X":364,"Y":261},{"X":361,"Y":259},{"X":361,"Y":260},{"X":359,"Y":260},{"X":358,"Y":260},{"X":363,"Y":260},{"X":360,"Y":264},{"X":361,"Y":264},{"X":361,"Y":262},{"X":363,"Y":264},{"X":363,"Y":264},{"X":360,"Y":266},{"X":358,"Y":267},{"X":357,"Y":266},{"X":356,"Y":266},{"X":355,"Y":266},{"X":354,"Y":267},{"X":353,"Y":268},{"X":350,"Y":268},{"X":352,"Y":269},{"X":352,"Y":269},{"X":354,"Y":267},{"X":355,"Y":268},{"X":355,"Y":269},{"X":355,"Y":272},{"X":354,"Y":272},{"X":353,"Y":272},{"X":354,"Y":272},{"X":354,"Y":272},{"X":354,"Y":272},{"X":355,"Y":272},{"X":356,"Y":272},{"X":353,"Y":276},{"X":349,"Y":276},{"X":348,"Y":277},{"X":346,"Y":277},{"X":345,"Y":277},{"X":344,"Y":278},{"X":345,"Y":278},{"X":346,"Y":277},{"X":347,"Y":277},{"X":350,"Y":277},{"X":352,"Y":278},{"X":350,"Y":279},{"X":349,"Y":279},{"X":348,"Y":279},{"X":347,"Y":279},{"X":348,"Y":280},{"X":349,"Y":280},{"X":350,"Y":280},{"X":350,"Y":280},{"X":350,"Y":279},{"X":352,"Y":280},{"X":352,"Y":279},{"X":352,"Y":278},{"X":355,"Y":279},{"X":356,"Y":281},{"X":355,"Y":281},{"X":353,"Y":281},{"X":355,"Y":281},{"X":361,"Y":280},{"X":367,"Y":279},{"X":366,"Y":281},{"X":365,"Y":282},{"X":366,"Y":284},{"X":366,"Y":288},{"X":365,"Y":289},{"X":363,"Y":290},{"X":361,"Y":290},{"X":360,"Y":291},{"X":358,"Y":292},{"X":357,"Y":293},{"X":357,"Y":295},{"X":354,"Y":295},{"X":352,"Y":297},{"X":350,"Y":298},{"X":344,"Y":300},{"X":343,"Y":302},{"X":342,"Y":303},{"X":337,"Y":302},{"X":333,"Y":300},{"X":322,"Y":302},{"X":322,"Y":303},{"X":321,"Y":302},{"X":321,"Y":304},{"X":320,"Y":304},{"X":317,"Y":302},{"X":319,"Y":302},{"X":317,"Y":301},{"X":317,"Y":301},{"X":316,"Y":301},{"X":315,"Y":301},{"X":316,"Y":301},{"X":317,"Y":302},{"X":314,"Y":302},{"X":315,"Y":302},{"X":315,"Y":301},{"X":314,"Y":301},{"X":314,"Y":303},{"X":313,"Y":303},{"X":313,"Y":303},{"X":313,"Y":301},{"X":313,"Y":300},{"X":311,"Y":301},{"X":312,"Y":302},{"X":312,"Y":303},{"X":309,"Y":301},{"X":308,"Y":299},{"X":305,"Y":298},{"X":305,"Y":299},{"X":306,"Y":299},{"X":309,"Y":302},{"X":308,"Y":303},{"X":305,"Y":303},{"X":304,"Y":304},{"X":301,"Y":304},{"X":299,"Y":304},{"X":300,"Y":304},{"X":300,"Y":304},{"X":298,"Y":304},{"X":297,"Y":304},{"X":295,"Y":306},{"X":295,"Y":304},{"X":293,"Y":304},{"X":292,"Y":306},{"X":293,"Y":305},{"X":293,"Y":306},{"X":295,"Y":306},{"X":295,"Y":308},{"X":295,"Y":308},{"X":295,"Y":309},{"X":294,"Y":310},{"X":293,"Y":310},{"X":292,"Y":310},{"X":290,"Y":309},{"X":284,"Y":309},{"X":284,"Y":309},{"X":283,"Y":310},{"X":284,"Y":311},{"X":283,"Y":312},{"X":283,"Y":311},{"X":280,"Y":308},{"X":277,"Y":305},{"X":275,"Y":305},{"X":272,"Y":306},{"X":270,"Y":306},{"X":268,"Y":306},{"X":265,"Y":310},{"X":264,"Y":309},{"X":262,"Y":306},{"X":262,"Y":310},{"X":261,"Y":312},{"X":261,"Y":314},{"X":260,"Y":315},{"X":260,"Y":316},{"X":261,"Y":317},{"X":261,"Y":317},{"X":260,"Y":317},{"X":259,"Y":319},{"X":259,"Y":319},{"X":258,"Y":320},{"X":258,"Y":321},{"X":258,"Y":322},{"X":256,"Y":323},{"X":255,"Y":322},{"X":255,"Y":322},{"X":254,"Y":322},{"X":253,"Y":320},{"X":251,"Y":319},{"X":249,"Y":319},{"X":247,"Y":319},{"X":247,"Y":317},{"X":246,"Y":317},{"X":246,"Y":317},{"X":247,"Y":317},{"X":246,"Y":319},{"X":245,"Y":319},{"X":244,"Y":317},{"X":243,"Y":317},{"X":240,"Y":317},{"X":239,"Y":319},{"X":236,"Y":319},{"X":235,"Y":319},{"X":235,"Y":317},{"X":234,"Y":319},{"X":233,"Y":322},{"X":231,"Y":321},{"X":229,"Y":322},{"X":228,"Y":322},{"X":228,"Y":324},{"X":227,"Y":324},{"X":228,"Y":324},{"X":227,"Y":324},{"X":227,"Y":321},{"X":227,"Y":321},{"X":226,"Y":322},{"X":227,"Y":323},{"X":226,"Y":324},{"X":227,"Y":324},{"X":226,"Y":324},{"X":226,"Y":325},{"X":225,"Y":325},{"X":226,"Y":326},{"X":226,"Y":327},{"X":226,"Y":328},{"X":224,"Y":328},{"X":224,"Y":331},{"X":223,"Y":328},{"X":222,"Y":326},{"X":221,"Y":326},{"X":217,"Y":324},{"X":216,"Y":324},{"X":216,"Y":325},{"X":215,"Y":326},{"X":213,"Y":327},{"X":212,"Y":326},{"X":213,"Y":325},{"X":212,"Y":323},{"X":213,"Y":324},{"X":216,"Y":321},{"X":218,"Y":322},{"X":220,"Y":321},{"X":221,"Y":321},{"X":222,"Y":320},{"X":223,"Y":317},{"X":225,"Y":316},{"X":225,"Y":315},{"X":227,"Y":315},{"X":228,"Y":313},{"X":227,"Y":312},{"X":228,"Y":311},{"X":228,"Y":311},{"X":229,"Y":310},{"X":229,"Y":310},{"X":231,"Y":309},{"X":234,"Y":309},{"X":234,"Y":306},{"X":235,"Y":305},{"X":236,"Y":304},{"X":238,"Y":303},{"X":238,"Y":299},{"X":239,"Y":295},{"X":240,"Y":295},{"X":243,"Y":295},{"X":244,"Y":295},{"X":246,"Y":294},{"X":247,"Y":293},{"X":245,"Y":291},{"X":246,"Y":291},{"X":246,"Y":290},{"X":246,"Y":290},{"X":255,"Y":288},{"X":259,"Y":288},{"X":260,"Y":288},{"X":262,"Y":289},{"X":264,"Y":290},{"X":266,"Y":290},{"X":268,"Y":289},{"X":270,"Y":289},{"X":271,"Y":288},{"X":271,"Y":288},{"X":271,"Y":286},{"X":272,"Y":286},{"X":272,"Y":282},{"X":275,"Y":281},{"X":277,"Y":279},{"X":278,"Y":279},{"X":283,"Y":271},{"X":284,"Y":270},{"X":284,"Y":269},{"X":284,"Y":270},{"X":283,"Y":270},{"X":278,"Y":276},{"X":275,"Y":277},{"X":272,"Y":278},{"X":272,"Y":278},{"X":272,"Y":278},{"X":271,"Y":278},{"X":269,"Y":279},{"X":269,"Y":280},{"X":268,"Y":280},{"X":268,"Y":281},{"X":267,"Y":282},{"X":264,"Y":282},{"X":260,"Y":281},{"X":258,"Y":279},{"X":257,"Y":279},{"X":255,"Y":278},{"X":254,"Y":275},{"X":250,"Y":275},{"X":250,"Y":275},{"X":250,"Y":277},{"X":247,"Y":277},{"X":247,"Y":277},{"X":246,"Y":278},{"X":244,"Y":277},{"X":244,"Y":276},{"X":245,"Y":275},{"X":246,"Y":275},{"X":246,"Y":275},{"X":248,"Y":275},{"X":249,"Y":273},{"X":249,"Y":272},{"X":248,"Y":273},{"X":247,"Y":272},{"X":244,"Y":272},{"X":244,"Y":272},{"X":243,"Y":271},{"X":243,"Y":270},{"X":244,"Y":271},{"X":243,"Y":269},{"X":243,"Y":268},{"X":243,"Y":269},{"X":242,"Y":269},{"X":242,"Y":270},{"X":237,"Y":270},{"X":236,"Y":272},{"X":235,"Y":272},{"X":234,"Y":273},{"X":233,"Y":275},{"X":231,"Y":275},{"X":228,"Y":273},{"X":228,"Y":272},{"X":227,"Y":272},{"X":227,"Y":272},{"X":228,"Y":272},{"X":228,"Y":272},{"X":228,"Y":272},{"X":229,"Y":272},{"X":233,"Y":271},{"X":229,"Y":270},{"X":226,"Y":270},{"X":226,"Y":272},{"X":225,"Y":270},{"X":224,"Y":269},{"X":225,"Y":269},{"X":226,"Y":268},{"X":227,"Y":268},{"X":227,"Y":266},{"X":225,"Y":266},{"X":223,"Y":265},{"X":223,"Y":262},{"X":225,"Y":264},{"X":225,"Y":262},{"X":227,"Y":261},{"X":227,"Y":260},{"X":229,"Y":261},{"X":231,"Y":261},{"X":232,"Y":261},{"X":232,"Y":260},{"X":233,"Y":261},{"X":234,"Y":260},{"X":234,"Y":259},{"X":235,"Y":259},{"X":236,"Y":257},{"X":236,"Y":257},{"X":236,"Y":256},{"X":240,"Y":256},{"X":243,"Y":254},{"X":244,"Y":254},{"X":246,"Y":253},{"X":248,"Y":250},{"X":249,"Y":248},{"X":250,"Y":244},{"X":251,"Y":243},{"X":253,"Y":242},{"X":250,"Y":242},{"X":248,"Y":240},{"X":250,"Y":237},{"X":251,"Y":235},{"X":250,"Y":236},{"X":249,"Y":235},{"X":248,"Y":235},{"X":248,"Y":234},{"X":249,"Y":232},{"X":248,"Y":231},{"X":243,"Y":231},{"X":242,"Y":232},{"X":242,"Y":233},{"X":242,"Y":234},{"X":240,"Y":235},{"X":238,"Y":233},{"X":238,"Y":234},{"X":236,"Y":233},{"X":236,"Y":234},{"X":236,"Y":233},{"X":236,"Y":232},{"X":238,"Y":231},{"X":240,"Y":229},{"X":244,"Y":226},{"X":244,"Y":223},{"X":245,"Y":223},{"X":245,"Y":223},{"X":248,"Y":220},{"X":249,"Y":218},{"X":250,"Y":218},{"X":254,"Y":217},{"X":255,"Y":217},{"X":254,"Y":216},{"X":256,"Y":216},{"X":257,"Y":217},{"X":259,"Y":217},{"X":265,"Y":215},{"X":266,"Y":215},{"X":266,"Y":216},{"X":270,"Y":220},{"X":270,"Y":217},{"X":268,"Y":214},{"X":268,"Y":214},{"X":271,"Y":212},{"X":271,"Y":213},{"X":273,"Y":216},{"X":276,"Y":217},{"X":277,"Y":217},{"X":278,"Y":216},{"X":277,"Y":216},{"X":275,"Y":216},{"X":272,"Y":213},{"X":270,"Y":210},{"X":272,"Y":204},{"X":276,"Y":202},{"X":271,"Y":202},{"X":270,"Y":199},{"X":271,"Y":195},{"X":275,"Y":194},{"X":275,"Y":195},{"X":276,"Y":193},{"X":275,"Y":193},{"X":275,"Y":193},{"X":275,"Y":193},{"X":273,"Y":192},{"X":275,"Y":190},{"X":276,"Y":190},{"X":276,"Y":189},{"X":276,"Y":187},{"X":276,"Y":185},{"X":275,"Y":185},{"X":273,"Y":188},{"X":272,"Y":188},{"X":271,"Y":185},{"X":270,"Y":189},{"X":269,"Y":191},{"X":269,"Y":191},{"X":267,"Y":189},{"X":267,"Y":188},{"X":267,"Y":188},{"X":268,"Y":188},{"X":268,"Y":183},{"X":267,"Y":187},{"X":266,"Y":187},{"X":264,"Y":183},{"X":264,"Y":181},{"X":259,"Y":176},{"X":260,"Y":172},{"X":261,"Y":170},{"X":262,"Y":168},{"X":264,"Y":167},{"X":264,"Y":166},{"X":265,"Y":163},{"X":266,"Y":162},{"X":266,"Y":163},{"X":267,"Y":163},{"X":267,"Y":162},{"X":267,"Y":162},{"X":267,"Y":161},{"X":268,"Y":160},{"X":270,"Y":161},{"X":271,"Y":161},{"X":271,"Y":160},{"X":270,"Y":160},{"X":270,"Y":160},{"X":271,"Y":160},{"X":271,"Y":159},{"X":269,"Y":159},{"X":267,"Y":160},{"X":264,"Y":160},{"X":264,"Y":160},{"X":262,"Y":160},{"X":261,"Y":160},{"X":261,"Y":160},{"X":261,"Y":160},{"X":261,"Y":163},{"X":260,"Y":163},{"X":258,"Y":162},{"X":257,"Y":163},{"X":256,"Y":162},{"X":256,"Y":163},{"X":256,"Y":162},{"X":256,"Y":162},{"X":255,"Y":163},{"X":256,"Y":165},{"X":253,"Y":167},{"X":251,"Y":167},{"X":251,"Y":165},{"X":250,"Y":166},{"X":249,"Y":166},{"X":248,"Y":165},{"X":248,"Y":162},{"X":247,"Y":165},{"X":246,"Y":162},{"X":245,"Y":162},{"X":244,"Y":161},{"X":244,"Y":162},{"X":244,"Y":162},{"X":244,"Y":165},{"X":246,"Y":165},{"X":245,"Y":166},{"X":246,"Y":169},{"X":245,"Y":169},{"X":242,"Y":169},{"X":240,"Y":166},{"X":237,"Y":165},{"X":236,"Y":162},{"X":236,"Y":162},{"X":234,"Y":163},{"X":233,"Y":165},{"X":234,"Y":169},{"X":235,"Y":169},{"X":235,"Y":169},{"X":236,"Y":170},{"X":235,"Y":170},{"X":234,"Y":169},{"X":234,"Y":168},{"X":229,"Y":162},{"X":228,"Y":160},{"X":229,"Y":158},{"X":231,"Y":158},{"X":232,"Y":158},{"X":232,"Y":160},{"X":233,"Y":162},{"X":233,"Y":161},{"X":232,"Y":158},{"X":232,"Y":157},{"X":233,"Y":154},{"X":236,"Y":150},{"X":236,"Y":147},{"X":237,"Y":146},{"X":238,"Y":144},{"X":240,"Y":144},{"X":240,"Y":141},{"X":239,"Y":140},{"X":239,"Y":140},{"X":239,"Y":139},{"X":239,"Y":138},{"X":237,"Y":137},{"X":237,"Y":136},{"X":235,"Y":134},{"X":236,"Y":133},{"X":236,"Y":130},{"X":235,"Y":127},{"X":236,"Y":126},{"X":237,"Y":125},{"X":238,"Y":127},{"X":243,"Y":127},{"X":240,"Y":125},{"X":238,"Y":124},{"X":237,"Y":122},{"X":237,"Y":124},{"X":238,"Y":124},{"X":237,"Y":124},{"X":236,"Y":124},{"X":236,"Y":122},{"X":237,"Y":121},{"X":236,"Y":121},{"X":236,"Y":119},{"X":236,"Y":119},{"X":235,"Y":121},{"X":236,"Y":122},{"X":236,"Y":124},{"X":235,"Y":124},{"X":235,"Y":124},{"X":234,"Y":128},{"X":233,"Y":128},{"X":233,"Y":126},{"X":232,"Y":124},{"X":232,"Y":127},{"X":229,"Y":126},{"X":229,"Y":124},{"X":229,"Y":124},{"X":229,"Y":127},{"X":228,"Y":127},{"X":229,"Y":129},{"X":227,"Y":128},{"X":226,"Y":127},{"X":227,"Y":124},{"X":228,"Y":122},{"X":229,"Y":121},{"X":229,"Y":119},{"X":233,"Y":118},{"X":233,"Y":117},{"X":235,"Y":115},{"X":234,"Y":116},{"X":233,"Y":116},{"X":232,"Y":118},{"X":228,"Y":119},{"X":226,"Y":124},{"X":225,"Y":124},{"X":225,"Y":124},{"X":225,"Y":125},{"X":225,"Y":126},{"X":225,"Y":128},{"X":227,"Y":130},{"X":227,"Y":132},{"X":226,"Y":133},{"X":225,"Y":134},{"X":224,"Y":136},{"X":224,"Y":137},{"X":224,"Y":138},{"X":224,"Y":138},{"X":224,"Y":139},{"X":222,"Y":144},{"X":222,"Y":144},{"X":222,"Y":144},{"X":223,"Y":145},{"X":222,"Y":147},{"X":220,"Y":148},{"X":217,"Y":147},{"X":217,"Y":144},{"X":220,"Y":144},{"X":220,"Y":139},{"X":220,"Y":138},{"X":221,"Y":136},{"X":221,"Y":135},{"X":224,"Y":129},{"X":222,"Y":132},{"X":221,"Y":130},{"X":221,"Y":129},{"X":223,"Y":126},{"X":221,"Y":127},{"X":221,"Y":126},{"X":223,"Y":122},{"X":222,"Y":123},{"X":221,"Y":126},{"X":220,"Y":126},{"X":221,"Y":124},{"X":222,"Y":123},{"X":222,"Y":122},{"X":223,"Y":121},{"X":224,"Y":121},{"X":223,"Y":119},{"X":224,"Y":117},{"X":223,"Y":119},{"X":222,"Y":119},{"X":223,"Y":117},{"X":223,"Y":115},{"X":223,"Y":112},{"X":224,"Y":112},{"X":225,"Y":108},{"X":229,"Y":108},{"X":227,"Y":107},{"X":226,"Y":107},{"X":226,"Y":107},{"X":226,"Y":107},{"X":225,"Y":107},{"X":226,"Y":106},{"X":227,"Y":106},{"X":228,"Y":105},{"X":229,"Y":105},{"X":227,"Y":105},{"X":226,"Y":105},{"X":227,"Y":102},{"X":228,"Y":102},{"X":228,"Y":102},{"X":229,"Y":101},{"X":232,"Y":101},{"X":233,"Y":101},{"X":232,"Y":101},{"X":229,"Y":101},{"X":233,"Y":95},{"X":231,"Y":97},{"X":229,"Y":97},{"X":228,"Y":100},{"X":227,"Y":101},{"X":227,"Y":101},{"X":225,"Y":103},{"X":224,"Y":105},{"X":221,"Y":106},{"X":221,"Y":106},{"X":220,"Y":105},{"X":220,"Y":105},{"X":217,"Y":104},{"X":215,"Y":103},{"X":215,"Y":102},{"X":216,"Y":101},{"X":217,"Y":101},{"X":221,"Y":100},{"X":222,"Y":101},{"X":224,"Y":101},{"X":222,"Y":101},{"X":220,"Y":100},{"X":218,"Y":101},{"X":217,"Y":100},{"X":212,"Y":100},{"X":211,"Y":99},{"X":213,"Y":97},{"X":215,"Y":97},{"X":216,"Y":96},{"X":217,"Y":97},{"X":218,"Y":97},{"X":218,"Y":96},{"X":218,"Y":97},{"X":220,"Y":96},{"X":220,"Y":96},{"X":218,"Y":95},{"X":218,"Y":94},{"X":221,"Y":94},{"X":221,"Y":94},{"X":222,"Y":94},{"X":222,"Y":94},{"X":221,"Y":94},{"X":221,"Y":94},{"X":221,"Y":93},{"X":217,"Y":92},{"X":218,"Y":93},{"X":220,"Y":93},{"X":218,"Y":92},{"X":220,"Y":90},{"X":221,"Y":89},{"X":221,"Y":90},{"X":222,"Y":91},{"X":225,"Y":90},{"X":223,"Y":90},{"X":222,"Y":90},{"X":222,"Y":89},{"X":222,"Y":88},{"X":221,"Y":88},{"X":221,"Y":86},{"X":222,"Y":85},{"X":223,"Y":85},{"X":225,"Y":88},{"X":226,"Y":86},{"X":224,"Y":86},{"X":224,"Y":85},{"X":223,"Y":83},{"X":222,"Y":83},{"X":223,"Y":83},{"X":223,"Y":82},{"X":223,"Y":81},{"X":223,"Y":80},{"X":225,"Y":80},{"X":225,"Y":80},{"X":227,"Y":82},{"X":227,"Y":81},{"X":226,"Y":81},{"X":225,"Y":80},{"X":222,"Y":80},{"X":222,"Y":80},{"X":223,"Y":78},{"X":225,"Y":77},{"X":226,"Y":74},{"X":225,"Y":77},{"X":224,"Y":78},{"X":223,"Y":77},{"X":224,"Y":77},{"X":224,"Y":75},{"X":221,"Y":78},{"X":220,"Y":78},{"X":220,"Y":75},{"X":221,"Y":75},{"X":220,"Y":75},{"X":221,"Y":74},{"X":220,"Y":74},{"X":220,"Y":72},{"X":221,"Y":70},{"X":221,"Y":70},{"X":222,"Y":71},{"X":222,"Y":70},{"X":223,"Y":72},{"X":223,"Y":72},{"X":224,"Y":72},{"X":225,"Y":71},{"X":224,"Y":71},{"X":223,"Y":70},{"X":223,"Y":70},{"X":223,"Y":70},{"X":222,"Y":69},{"X":222,"Y":68},{"X":221,"Y":68},{"X":221,"Y":64},{"X":223,"Y":64},{"X":223,"Y":64},{"X":222,"Y":64},{"X":221,"Y":63},{"X":221,"Y":62},{"X":221,"Y":60},{"X":223,"Y":60},{"X":223,"Y":60},{"X":223,"Y":62},{"X":224,"Y":63},{"X":224,"Y":62},{"X":225,"Y":62},{"X":225,"Y":60},{"X":224,"Y":60},{"X":224,"Y":58},{"X":225,"Y":58},{"X":225,"Y":58},{"X":225,"Y":60},{"X":227,"Y":60},{"X":227,"Y":58},{"X":232,"Y":60},{"X":232,"Y":60},{"X":228,"Y":58},{"X":228,"Y":57},{"X":228,"Y":57},{"X":229,"Y":59},{"X":232,"Y":58},{"X":233,"Y":60},{"X":234,"Y":61},{"X":234,"Y":60},{"X":232,"Y":58},{"X":233,"Y":58},{"X":233,"Y":58},{"X":231,"Y":56},{"X":229,"Y":55},{"X":228,"Y":53},{"X":228,"Y":53},{"X":227,"Y":52},{"X":227,"Y":51},{"X":229,"Y":52},{"X":229,"Y":52},{"X":232,"Y":52},{"X":232,"Y":52},{"X":231,"Y":51},{"X":232,"Y":51},{"X":231,"Y":50},{"X":232,"Y":50},{"X":231,"Y":50},{"X":231,"Y":50},{"X":229,"Y":49},{"X":229,"Y":49},{"X":228,"Y":47},{"X":228,"Y":46},{"X":231,"Y":48},{"X":233,"Y":47},{"X":233,"Y":48},{"X":234,"Y":47},{"X":237,"Y":48},{"X":236,"Y":47},{"X":237,"Y":47},{"X":235,"Y":47},{"X":234,"Y":46},{"X":234,"Y":45},{"X":234,"Y":45},{"X":233,"Y":45},{"X":234,"Y":41},{"X":236,"Y":42},{"X":235,"Y":41},{"X":235,"Y":41},{"X":235,"Y":41},{"X":235,"Y":40},{"X":236,"Y":40},{"X":237,"Y":40},{"X":236,"Y":39},{"X":234,"Y":38},{"X":234,"Y":38},{"X":236,"Y":37}]]',
clip: '[[{"X":246,"Y":146},{"X":313,"Y":146},{"X":290,"Y":168},{"X":335,"Y":191},{"X":290,"Y":235},{"X":268,"Y":191},{"X":246,"Y":213}],[{"X":246,"Y":57},{"X":268,"Y":79},{"X":290,"Y":35},{"X":335,"Y":79},{"X":290,"Y":102},{"X":313,"Y":124},{"X":246,"Y":124}],[{"X":224,"Y":146},{"X":224,"Y":213},{"X":201,"Y":191},{"X":179,"Y":235},{"X":134,"Y":191},{"X":179,"Y":168},{"X":157,"Y":146}],[{"X":179,"Y":102},{"X":134,"Y":79},{"X":179,"Y":35},{"X":201,"Y":79},{"X":224,"Y":57},{"X":224,"Y":124},{"X":157,"Y":124}]]'
}, { // Texts
subj: '[[{"X":"28.18","Y":"205.95"},{"X":"28.18","Y":"105.07"},{"X":"48.27","Y":"105.07"},{"X":"48.28","Y":"110.23"},{"X":"54.15","Y":"107.22"},{"X":"59.69","Y":"105.39"},{"X":"65.04","Y":"104.66"},{"X":"72.07","Y":"105.08"},{"X":"78.09","Y":"106.31"},{"X":"81.57","Y":"107.68"},{"X":"84.84","Y":"110.05"},{"X":"88.03","Y":"113.63"},{"X":"90.87","Y":"118.22"},{"X":"92.71","Y":"123.12"},{"X":"94.06","Y":"129.73"},{"X":"94.70","Y":"138.25"},{"X":"94.41","Y":"147.24"},{"X":"93.31","Y":"155.42"},{"X":"91.66","Y":"161.49"},{"X":"89.46","Y":"166.25"},{"X":"86.67","Y":"170.32"},{"X":"83.75","Y":"173.13"},{"X":"80.65","Y":"174.92"},{"X":"75.51","Y":"176.56"},{"X":"69.28","Y":"177.50"},{"X":"63.74","Y":"177.55"},{"X":"57.05","Y":"176.72"},{"X":"51.42","Y":"175.15"},{"X":"48.27","Y":"173.79"},{"X":"48.27","Y":"205.95"},{"X":"48.27","Y":"205.95"},{"X":"28.18","Y":"205.95"}],[{"X":"48.28","Y":"120.42"},{"X":"48.38","Y":"164.32"},{"X":"52.31","Y":"166.53"},{"X":"56.14","Y":"167.74"},{"X":"61.35","Y":"168.35"},{"X":"65.96","Y":"167.83"},{"X":"69.49","Y":"166.59"},{"X":"72.20","Y":"164.73"},{"X":"74.29","Y":"162.19"},{"X":"76.19","Y":"157.95"},{"X":"77.71","Y":"152.00"},{"X":"78.63","Y":"144.11"},{"X":"78.66","Y":"136.61"},{"X":"77.89","Y":"129.16"},{"X":"76.59","Y":"124.08"},{"X":"74.84","Y":"120.60"},{"X":"72.55","Y":"118.04"},{"X":"69.77","Y":"116.28"},{"X":"65.91","Y":"115.07"},{"X":"60.69","Y":"114.57"},{"X":"56.85","Y":"115.18"},{"X":"53.10","Y":"116.68"},{"X":"48.91","Y":"119.57"},{"X":"48.28","Y":"120.39"},{"X":"48.28","Y":"120.42"}],[{"X":"132.15","Y":"104.65"},{"X":"139.94","Y":"105.10"},{"X":"146.11","Y":"106.30"},{"X":"151.03","Y":"108.11"},{"X":"155.15","Y":"110.57"},{"X":"158.60","Y":"113.67"},{"X":"161.35","Y":"117.41"},{"X":"163.45","Y":"121.89"},{"X":"165.10","Y":"127.80"},{"X":"166.07","Y":"135.09"},{"X":"166.22","Y":"143.93"},{"X":"165.51","Y":"151.69"},{"X":"164.06","Y":"158.12"},{"X":"162.01","Y":"163.28"},{"X":"159.40","Y":"167.47"},{"X":"156.32","Y":"170.74"},{"X":"152.52","Y":"173.40"},{"X":"147.87","Y":"175.49"},{"X":"142.07","Y":"176.99"},{"X":"134.92","Y":"177.77"},{"X":"127.42","Y":"177.67"},{"X":"120.74","Y":"176.71"},{"X":"115.29","Y":"175.07"},{"X":"110.74","Y":"172.78"},{"X":"106.95","Y":"169.86"},{"X":"103.92","Y":"166.34"},{"X":"101.48","Y":"162.04"},{"X":"99.57","Y":"156.68"},{"X":"98.29","Y":"150.05"},{"X":"97.78","Y":"141.98"},{"X":"98.18","Y":"134.19"},{"X":"99.36","Y":"127.55"},{"X":"101.22","Y":"122.01"},{"X":"103.68","Y":"117.38"},{"X":"106.77","Y":"113.52"},{"X":"110.41","Y":"110.41"},{"X":"114.84","Y":"107.89"},{"X":"120.07","Y":"106.06"},{"X":"126.27","Y":"104.95"},{"X":"132.11","Y":"104.65"},{"X":"132.15","Y":"104.65"}],[{"X":"117.86","Y":"140.93"},{"X":"118.75","Y":"153.65"},{"X":"119.63","Y":"158.05"},{"X":"121.31","Y":"161.73"},{"X":"123.57","Y":"164.71"},{"X":"126.01","Y":"166.43"},{"X":"129.14","Y":"167.44"},{"X":"133.32","Y":"167.70"},{"X":"137.17","Y":"167.11"},{"X":"140.03","Y":"165.83"},{"X":"142.14","Y":"163.92"},{"X":"143.62","Y":"161.33"},{"X":"145.05","Y":"155.97"},{"X":"145.97","Y":"148.23"},{"X":"146.12","Y":"137.89"},{"X":"145.44","Y":"129.22"},{"X":"144.13","Y":"122.91"},{"X":"142.80","Y":"119.58"},{"X":"140.91","Y":"117.26"},{"X":"138.39","Y":"115.66"},{"X":"135.07","Y":"114.75"},{"X":"131.03","Y":"114.64"},{"X":"127.21","Y":"115.38"},{"X":"124.25","Y":"116.82"},{"X":"122.07","Y":"118.86"},{"X":"120.53","Y":"121.59"},{"X":"119.03","Y":"126.93"},{"X":"118.09","Y":"134.21"},{"X":"117.86","Y":"140.81"},{"X":"117.86","Y":"140.93"}],[{"X":"172.03","Y":"177.00"},{"X":"172.03","Y":"76.33"},{"X":"191.91","Y":"76.33"},{"X":"191.91","Y":"177.00"},{"X":"191.91","Y":"177.00"},{"X":"172.03","Y":"177.00"}],[{"X":"224.60","Y":"196.88"},{"X":"221.39","Y":"198.11"},{"X":"215.61","Y":"199.00"},{"X":"208.60","Y":"199.21"},{"X":"204.09","Y":"190.40"},{"X":"211.28","Y":"190.55"},{"X":"214.82","Y":"189.98"},{"X":"217.84","Y":"188.66"},{"X":"220.35","Y":"186.54"},{"X":"222.45","Y":"183.44"},{"X":"224.33","Y":"178.55"},{"X":"225.80","Y":"173.86"},{"X":"195.43","Y":"105.07"},{"X":"215.95","Y":"105.07"},{"X":"235.40","Y":"149.04"},{"X":"252.44","Y":"105.07"},{"X":"265.17","Y":"105.14"},{"X":"233.73","Y":"186.25"},{"X":"231.07","Y":"190.77"},{"X":"228.03","Y":"194.27"},{"X":"224.70","Y":"196.82"},{"X":"224.60","Y":"196.88"}],[{"X":"292.60","Y":"192.98"},{"X":"298.73","Y":"192.56"},{"X":"303.08","Y":"191.46"},{"X":"305.98","Y":"189.91"},{"X":"307.86","Y":"187.98"},{"X":"308.96","Y":"185.54"},{"X":"309.26","Y":"183.06"},{"X":"309.20","Y":"173.81"},{"X":"304.04","Y":"175.83"},{"X":"298.03","Y":"177.13"},{"X":"291.00","Y":"177.63"},{"X":"284.29","Y":"177.05"},{"X":"278.60","Y":"175.70"},{"X":"274.88","Y":"174.11"},{"X":"271.82","Y":"171.71"},{"X":"268.90","Y":"168.11"},{"X":"266.25","Y":"163.24"},{"X":"264.52","Y":"157.97"},{"X":"263.31","Y":"150.88"},{"X":"262.81","Y":"141.60"},{"X":"263.34","Y":"132.62"},{"X":"264.61","Y":"125.23"},{"X":"266.40","Y":"119.67"},{"X":"268.74","Y":"115.31"},{"X":"271.95","Y":"111.17"},{"X":"275.11","Y":"108.42"},{"X":"278.30","Y":"106.76"},{"X":"283.81","Y":"105.35"},{"X":"290.52","Y":"104.67"},{"X":"295.16","Y":"104.90"},{"X":"299.98","Y":"105.99"},{"X":"306.08","Y":"108.50"},{"X":"309.26","Y":"110.23"},{"X":"309.26","Y":"105.06"},{"X":"329.35","Y":"105.06"},{"X":"329.23","Y":"182.37"},{"X":"328.37","Y":"186.78"},{"X":"326.76","Y":"190.49"},{"X":"324.35","Y":"193.73"},{"X":"321.15","Y":"196.44"},{"X":"316.95","Y":"198.74"},{"X":"311.55","Y":"200.55"},{"X":"304.61","Y":"201.78"},{"X":"296.23","Y":"202.25"},{"X":"286.50","Y":"201.75"},{"X":"279.10","Y":"200.55"},{"X":"271.33","Y":"198.26"},{"X":"269.50","Y":"197.28"},{"X":"268.04","Y":"186.11"},{"X":"273.14","Y":"188.62"},{"X":"280.19","Y":"191.16"},{"X":"286.81","Y":"192.48"},{"X":"292.48","Y":"192.97"},{"X":"292.60","Y":"192.98"}],[{"X":"309.26","Y":"120.42"},{"X":"308.13","Y":"119.26"},{"X":"303.52","Y":"116.46"},{"X":"299.14","Y":"114.93"},{"X":"296.63","Y":"114.57"},{"X":"291.87","Y":"115.12"},{"X":"288.19","Y":"116.39"},{"X":"285.33","Y":"118.31"},{"X":"282.99","Y":"121.03"},{"X":"281.19","Y":"124.65"},{"X":"279.81","Y":"130.01"},{"X":"278.92","Y":"137.91"},{"X":"278.88","Y":"145.11"},{"X":"279.69","Y":"152.40"},{"X":"281.18","Y":"158.05"},{"X":"283.08","Y":"162.12"},{"X":"285.18","Y":"164.65"},{"X":"287.89","Y":"166.53"},{"X":"291.41","Y":"167.79"},{"X":"296.02","Y":"168.34"},{"X":"301.23","Y":"167.79"},{"X":"305.10","Y":"166.63"},{"X":"309.03","Y":"164.44"},{"X":"309.26","Y":"164.24"},{"X":"309.26","Y":"164.24"},{"X":"309.26","Y":"120.42"}],[{"X":"369.84","Y":"104.65"},{"X":"377.62","Y":"105.10"},{"X":"383.80","Y":"106.30"},{"X":"388.72","Y":"108.11"},{"X":"392.84","Y":"110.56"},{"X":"396.29","Y":"113.67"},{"X":"399.04","Y":"117.41"},{"X":"401.13","Y":"121.89"},{"X":"402.78","Y":"127.80"},{"X":"403.75","Y":"135.08"},{"X":"403.90","Y":"143.93"},{"X":"403.19","Y":"151.69"},{"X":"401.74","Y":"158.12"},{"X":"399.70","Y":"163.28"},{"X":"397.08","Y":"167.47"},{"X":"394.00","Y":"170.74"},{"X":"390.20","Y":"173.40"},{"X":"385.55","Y":"175.49"},{"X":"379.75","Y":"176.99"},{"X":"372.60","Y":"177.77"},{"X":"365.11","Y":"177.67"},{"X":"358.43","Y":"176.71"},{"X":"352.98","Y":"175.07"},{"X":"348.43","Y":"172.78"},{"X":"344.63","Y":"169.86"},{"X":"341.60","Y":"166.34"},{"X":"339.16","Y":"162.04"},{"X":"337.26","Y":"156.68"},{"X":"335.98","Y":"150.05"},{"X":"335.46","Y":"141.97"},{"X":"335.86","Y":"134.19"},{"X":"337.04","Y":"127.55"},{"X":"338.90","Y":"122.01"},{"X":"341.37","Y":"117.38"},{"X":"344.45","Y":"113.52"},{"X":"348.10","Y":"110.41"},{"X":"352.52","Y":"107.89"},{"X":"357.76","Y":"106.06"},{"X":"363.95","Y":"104.95"},{"X":"369.79","Y":"104.65"},{"X":"369.84","Y":"104.65"}],[{"X":"355.55","Y":"140.93"},{"X":"356.44","Y":"153.65"},{"X":"357.32","Y":"158.05"},{"X":"358.99","Y":"161.73"},{"X":"361.25","Y":"164.71"},{"X":"363.70","Y":"166.43"},{"X":"366.83","Y":"167.44"},{"X":"371.01","Y":"167.70"},{"X":"374.86","Y":"167.11"},{"X":"377.72","Y":"165.83"},{"X":"379.82","Y":"163.92"},{"X":"381.31","Y":"161.33"},{"X":"382.74","Y":"155.97"},{"X":"383.65","Y":"148.23"},{"X":"383.81","Y":"137.89"},{"X":"383.12","Y":"129.22"},{"X":"381.82","Y":"122.91"},{"X":"380.48","Y":"119.58"},{"X":"378.60","Y":"117.26"},{"X":"376.07","Y":"115.66"},{"X":"372.76","Y":"114.75"},{"X":"368.72","Y":"114.64"},{"X":"364.90","Y":"115.38"},{"X":"361.94","Y":"116.82"},{"X":"359.76","Y":"118.86"},{"X":"358.22","Y":"121.60"},{"X":"356.71","Y":"126.93"},{"X":"355.77","Y":"134.21"},{"X":"355.55","Y":"140.81"},{"X":"355.55","Y":"140.93"}],[{"X":"471.82","Y":"121.68"},{"X":"471.82","Y":"177.00"},{"X":"456.69","Y":"177.00"},{"X":"456.58","Y":"122.81"},{"X":"455.77","Y":"120.25"},{"X":"454.20","Y":"118.25"},{"X":"451.80","Y":"116.74"},{"X":"448.06","Y":"115.65"},{"X":"442.84","Y":"115.25"},{"X":"438.30","Y":"116.22"},{"X":"435.19","Y":"117.70"},{"X":"432.97","Y":"119.70"},{"X":"430.36","Y":"123.35"},{"X":"429.69","Y":"124.95"},{"X":"429.69","Y":"177.00"},{"X":"409.38","Y":"177.00"},{"X":"409.38","Y":"105.07"},{"X":"429.69","Y":"105.07"},{"X":"429.70","Y":"110.91"},{"X":"434.67","Y":"107.84"},{"X":"440.16","Y":"105.83"},{"X":"445.62","Y":"104.85"},{"X":"452.21","Y":"104.70"},{"X":"457.71","Y":"105.40"},{"X":"461.98","Y":"106.78"},{"X":"465.33","Y":"108.76"},{"X":"468.28","Y":"111.73"},{"X":"470.35","Y":"115.03"},{"X":"471.52","Y":"118.58"},{"X":"471.82","Y":"121.56"},{"X":"471.82","Y":"121.68"}]]',
clip: '[[{"X":"115.54","Y":"216.41"},{"X":"113.01","Y":"217.26"},{"X":"105.79","Y":"218.58"},{"X":"96.36","Y":"219.18"},{"X":"88.73","Y":"218.69"},{"X":"82.86","Y":"217.48"},{"X":"78.40","Y":"215.73"},{"X":"74.91","Y":"213.42"},{"X":"72.12","Y":"210.49"},{"X":"69.88","Y":"206.77"},{"X":"68.13","Y":"201.83"},{"X":"66.93","Y":"195.19"},{"X":"66.45","Y":"186.51"},{"X":"67.03","Y":"179.19"},{"X":"68.36","Y":"173.03"},{"X":"70.25","Y":"168.30"},{"X":"72.58","Y":"164.82"},{"X":"75.62","Y":"161.94"},{"X":"79.35","Y":"159.71"},{"X":"84.02","Y":"158.09"},{"X":"89.93","Y":"157.11"},{"X":"96.97","Y":"156.93"},{"X":"105.18","Y":"157.69"},{"X":"114.58","Y":"159.65"},{"X":"116.44","Y":"168.59"},{"X":"110.93","Y":"166.65"},{"X":"105.50","Y":"165.51"},{"X":"98.32","Y":"165.06"},{"X":"94.16","Y":"165.58"},{"X":"90.96","Y":"166.82"},{"X":"88.62","Y":"168.68"},{"X":"86.96","Y":"171.17"},{"X":"85.31","Y":"175.67"},{"X":"84.32","Y":"181.28"},{"X":"84.15","Y":"188.62"},{"X":"84.83","Y":"196.53"},{"X":"86.18","Y":"202.53"},{"X":"87.64","Y":"205.97"},{"X":"89.52","Y":"208.29"},{"X":"92.02","Y":"209.92"},{"X":"95.18","Y":"210.85"},{"X":"99.07","Y":"210.96"},{"X":"105.48","Y":"210.28"},{"X":"111.84","Y":"208.54"},{"X":"116.32","Y":"206.45"},{"X":"116.62","Y":"206.17"},{"X":"115.55","Y":"216.31"},{"X":"115.54","Y":"216.41"}],[{"X":"120.11","Y":"219.00"},{"X":"120.11","Y":"132.31"},{"X":"137.23","Y":"132.31"},{"X":"137.23","Y":"219.00"},{"X":"137.23","Y":"219.00"},{"X":"120.11","Y":"219.00"}],[{"X":"153.34","Y":"132.13"},{"X":"156.60","Y":"132.56"},{"X":"159.17","Y":"133.77"},{"X":"161.19","Y":"135.77"},{"X":"162.61","Y":"138.40"},{"X":"163.19","Y":"141.48"},{"X":"162.87","Y":"144.75"},{"X":"161.71","Y":"147.51"},{"X":"159.79","Y":"149.80"},{"X":"157.51","Y":"151.22"},{"X":"154.46","Y":"151.96"},{"X":"151.02","Y":"151.84"},{"X":"148.34","Y":"150.92"},{"X":"146.08","Y":"149.20"},{"X":"144.28","Y":"146.63"},{"X":"143.38","Y":"143.78"},{"X":"143.37","Y":"140.64"},{"X":"144.20","Y":"137.77"},{"X":"145.94","Y":"135.15"},{"X":"148.14","Y":"133.37"},{"X":"150.80","Y":"132.38"},{"X":"153.33","Y":"132.13"},{"X":"153.34","Y":"132.13"}],[{"X":"144.58","Y":"219.00"},{"X":"144.58","Y":"157.06"},{"X":"161.88","Y":"157.06"},{"X":"161.88","Y":"219.00"},{"X":"161.88","Y":"219.00"},{"X":"144.58","Y":"219.00"}],[{"X":"168.78","Y":"243.93"},{"X":"168.78","Y":"157.06"},{"X":"186.09","Y":"157.06"},{"X":"186.19","Y":"161.44"},{"X":"191.55","Y":"158.75"},{"X":"196.41","Y":"157.22"},{"X":"201.17","Y":"156.70"},{"X":"207.60","Y":"157.21"},{"X":"212.99","Y":"158.51"},{"X":"216.03","Y":"160.11"},{"X":"219.02","Y":"162.82"},{"X":"222.00","Y":"166.95"},{"X":"223.86","Y":"171.04"},{"X":"225.25","Y":"176.56"},{"X":"226.01","Y":"184.02"},{"X":"225.94","Y":"191.67"},{"X":"225.03","Y":"199.56"},{"X":"223.55","Y":"205.37"},{"X":"221.48","Y":"209.86"},{"X":"218.90","Y":"213.53"},{"X":"216.12","Y":"216.03"},{"X":"213.05","Y":"217.58"},{"X":"207.99","Y":"218.94"},{"X":"201.87","Y":"219.54"},{"X":"195.30","Y":"219.05"},{"X":"189.90","Y":"217.79"},{"X":"186.09","Y":"216.23"},{"X":"186.09","Y":"243.93"},{"X":"186.09","Y":"243.93"},{"X":"168.78","Y":"243.93"}],[{"X":"186.09","Y":"170.27"},{"X":"186.13","Y":"208.05"},{"X":"189.79","Y":"210.09"},{"X":"193.53","Y":"211.16"},{"X":"197.86","Y":"211.53"},{"X":"201.86","Y":"210.97"},{"X":"204.91","Y":"209.73"},{"X":"207.25","Y":"207.87"},{"X":"209.01","Y":"205.27"},{"X":"210.72","Y":"200.64"},{"X":"211.90","Y":"194.30"},{"X":"212.32","Y":"186.82"},{"X":"211.80","Y":"179.19"},{"X":"210.69","Y":"174.07"},{"X":"209.11","Y":"170.68"},{"X":"207.06","Y":"168.30"},{"X":"204.40","Y":"166.63"},{"X":"200.81","Y":"165.59"},{"X":"196.18","Y":"165.25"},{"X":"192.24","Y":"166.16"},{"X":"188.91","Y":"167.87"},{"X":"186.21","Y":"169.99"},{"X":"186.09","Y":"170.26"},{"X":"186.09","Y":"170.27"}],[{"X":"231.09","Y":"243.93"},{"X":"231.09","Y":"157.06"},{"X":"248.39","Y":"157.06"},{"X":"248.50","Y":"161.44"},{"X":"253.86","Y":"158.75"},{"X":"258.72","Y":"157.22"},{"X":"263.48","Y":"156.70"},{"X":"269.91","Y":"157.21"},{"X":"275.30","Y":"158.51"},{"X":"278.34","Y":"160.11"},{"X":"281.33","Y":"162.82"},{"X":"284.31","Y":"166.96"},{"X":"286.17","Y":"171.04"},{"X":"287.56","Y":"176.57"},{"X":"288.32","Y":"184.02"},{"X":"288.25","Y":"191.67"},{"X":"287.34","Y":"199.56"},{"X":"285.86","Y":"205.37"},{"X":"283.79","Y":"209.86"},{"X":"281.21","Y":"213.53"},{"X":"278.43","Y":"216.04"},{"X":"275.35","Y":"217.58"},{"X":"270.29","Y":"218.94"},{"X":"264.18","Y":"219.54"},{"X":"257.60","Y":"219.05"},{"X":"252.21","Y":"217.78"},{"X":"248.40","Y":"216.23"},{"X":"248.40","Y":"243.93"},{"X":"248.40","Y":"243.93"},{"X":"231.09","Y":"243.93"}],[{"X":"248.39","Y":"170.27"},{"X":"248.44","Y":"208.05"},{"X":"252.10","Y":"210.09"},{"X":"255.84","Y":"211.16"},{"X":"260.17","Y":"211.53"},{"X":"264.17","Y":"210.97"},{"X":"267.22","Y":"209.73"},{"X":"269.56","Y":"207.87"},{"X":"271.32","Y":"205.27"},{"X":"273.03","Y":"200.64"},{"X":"274.21","Y":"194.30"},{"X":"274.63","Y":"186.82"},{"X":"274.12","Y":"179.19"},{"X":"273.00","Y":"174.07"},{"X":"271.42","Y":"170.68"},{"X":"269.38","Y":"168.30"},{"X":"266.72","Y":"166.64"},{"X":"263.12","Y":"165.59"},{"X":"258.49","Y":"165.25"},{"X":"254.56","Y":"166.16"},{"X":"251.23","Y":"167.86"},{"X":"248.52","Y":"169.99"},{"X":"248.40","Y":"170.26"},{"X":"248.39","Y":"170.27"}],[{"X":"302.11","Y":"132.13"},{"X":"305.37","Y":"132.56"},{"X":"307.93","Y":"133.77"},{"X":"309.95","Y":"135.77"},{"X":"311.37","Y":"138.40"},{"X":"311.95","Y":"141.48"},{"X":"311.63","Y":"144.75"},{"X":"310.47","Y":"147.51"},{"X":"308.56","Y":"149.80"},{"X":"306.27","Y":"151.22"},{"X":"303.22","Y":"151.96"},{"X":"299.79","Y":"151.84"},{"X":"297.10","Y":"150.92"},{"X":"294.85","Y":"149.20"},{"X":"293.04","Y":"146.63"},{"X":"292.14","Y":"143.78"},{"X":"292.13","Y":"140.64"},{"X":"292.97","Y":"137.77"},{"X":"294.71","Y":"135.15"},{"X":"296.90","Y":"133.37"},{"X":"299.56","Y":"132.38"},{"X":"302.10","Y":"132.13"},{"X":"302.11","Y":"132.13"}],[{"X":"293.34","Y":"219.00"},{"X":"293.34","Y":"157.06"},{"X":"310.65","Y":"157.06"},{"X":"310.65","Y":"219.00"},{"X":"310.65","Y":"219.00"},{"X":"293.34","Y":"219.00"}],[{"X":"371.24","Y":"171.37"},{"X":"371.24","Y":"219.00"},{"X":"358.21","Y":"219.00"},{"X":"358.11","Y":"172.27"},{"X":"357.35","Y":"170.01"},{"X":"355.81","Y":"168.19"},{"X":"353.32","Y":"166.83"},{"X":"349.52","Y":"165.99"},{"X":"345.63","Y":"165.91"},{"X":"341.71","Y":"166.90"},{"X":"339.11","Y":"168.36"},{"X":"336.70","Y":"171.02"},{"X":"335.06","Y":"173.87"},{"X":"334.96","Y":"219.00"},{"X":"317.48","Y":"219.00"},{"X":"317.48","Y":"157.06"},{"X":"334.96","Y":"157.06"},{"X":"335.01","Y":"162.07"},{"X":"339.49","Y":"159.34"},{"X":"344.58","Y":"157.56"},{"X":"349.77","Y":"156.78"},{"X":"355.76","Y":"156.84"},{"X":"360.47","Y":"157.70"},{"X":"364.07","Y":"159.18"},{"X":"366.81","Y":"161.26"},{"X":"369.25","Y":"164.29"},{"X":"370.67","Y":"167.42"},{"X":"371.23","Y":"170.82"},{"X":"371.24","Y":"171.27"},{"X":"371.24","Y":"171.37"}],[{"X":"401.90","Y":"232.76"},{"X":"407.58","Y":"232.33"},{"X":"411.33","Y":"231.29"},{"X":"413.88","Y":"229.75"},{"X":"415.39","Y":"227.89"},{"X":"416.16","Y":"225.48"},{"X":"416.21","Y":"216.25"},{"X":"411.46","Y":"218.08"},{"X":"405.72","Y":"219.22"},{"X":"399.44","Y":"219.51"},{"X":"393.19","Y":"218.76"},{"X":"388.30","Y":"217.32"},{"X":"385.44","Y":"215.70"},{"X":"382.67","Y":"212.97"},{"X":"380.07","Y":"208.95"},{"X":"378.24","Y":"204.52"},{"X":"376.93","Y":"198.51"},{"X":"376.28","Y":"190.44"},{"X":"376.52","Y":"182.65"},{"X":"377.58","Y":"175.38"},{"X":"379.16","Y":"170.07"},{"X":"381.22","Y":"166.08"},{"X":"384.14","Y":"162.28"},{"X":"387.11","Y":"159.77"},{"X":"390.08","Y":"158.35"},{"X":"395.48","Y":"157.12"},{"X":"401.76","Y":"156.70"},{"X":"406.66","Y":"157.40"},{"X":"412.02","Y":"159.31"},{"X":"416.24","Y":"161.51"},{"X":"416.24","Y":"157.06"},{"X":"433.55","Y":"157.06"},{"X":"433.43","Y":"223.84"},{"X":"432.54","Y":"227.93"},{"X":"430.90","Y":"231.30"},{"X":"428.49","Y":"234.16"},{"X":"425.23","Y":"236.55"},{"X":"420.86","Y":"238.51"},{"X":"415.19","Y":"239.93"},{"X":"407.89","Y":"240.69"},{"X":"399.04","Y":"240.53"},{"X":"391.61","Y":"239.58"},{"X":"384.09","Y":"237.51"},{"X":"382.01","Y":"236.48"},{"X":"380.74","Y":"226.84"},{"X":"385.59","Y":"229.19"},{"X":"391.82","Y":"231.36"},{"X":"398.16","Y":"232.49"},{"X":"401.75","Y":"232.75"},{"X":"401.90","Y":"232.76"}],[{"X":"416.25","Y":"170.27"},{"X":"414.97","Y":"169.05"},{"X":"410.96","Y":"166.71"},{"X":"406.83","Y":"165.39"},{"X":"404.44","Y":"165.28"},{"X":"400.31","Y":"165.96"},{"X":"397.15","Y":"167.34"},{"X":"394.75","Y":"169.35"},{"X":"392.82","Y":"172.20"},{"X":"391.40","Y":"176.14"},{"X":"390.35","Y":"182.50"},{"X":"390.04","Y":"190.14"},{"X":"390.67","Y":"197.15"},{"X":"391.97","Y":"202.39"},{"X":"393.71","Y":"206.20"},{"X":"395.76","Y":"208.58"},{"X":"398.42","Y":"210.25"},{"X":"401.86","Y":"211.27"},{"X":"406.04","Y":"211.51"},{"X":"410.92","Y":"210.69"},{"X":"414.49","Y":"209.16"},{"X":"416.25","Y":"208.01"},{"X":"416.25","Y":"170.27"},{"X":"416.25","Y":"170.27"}]]'
}, { // Rectangles
subj: '[[{"X":155,"Y":61.67},{"X":155,"Y":212.7},{"X":288.98,"Y":212.7},{"X":288.98,"Y":61.67},{"X":173.01999999999998,"Y":61.67},{"X":155,"Y":61.67}],[{"X":274.37,"Y":190.77},{"X":171.24,"Y":190.77},{"X":171.24,"Y":81.16},{"X":274.37,"Y":81.16},{"X":274.37,"Y":81.16},{"X":274.37,"Y":190.77}]]',
clip: '[[{"X":217.69,"Y":126.14},{"X":217.69,"Y":277.17},{"X":351.66999999999996,"Y":277.17},{"X":351.66999999999996,"Y":126.14},{"X":253.71,"Y":126.14},{"X":217.69,"Y":126.14}],[{"X":337.05,"Y":255.25},{"X":233.93,"Y":255.25},{"X":233.93,"Y":145.63},{"X":337.05,"Y":145.63},{"X":337.05,"Y":145.63},{"X":337.05,"Y":255.25}]]'
}, { // Same self intersecting
subj: '[[{"X":172,"Y":90},{"X":222,"Y":90},{"X":222,"Y":240},{"X":322,"Y":240},{"X":322,"Y":140},{"X":172,"Y":140}]]',
clip: '[[{"X":172,"Y":90},{"X":222,"Y":90},{"X":222,"Y":240},{"X":322,"Y":240},{"X":322,"Y":140},{"X":172,"Y":140}]]'
}, null, null, { // Star and rectangles
subj: '[[{"X":147.47,"Y":312.74},{"X":247.07,"Y":33.510000000000005},{"X":337.66,"Y":312.04},{"X":86.36,"Y":122.7},{"X":404.07,"Y":123.57},{"X":148.11,"Y":312.27},{"X":147.47,"Y":312.74}]]',
clip: '[[{"X":336.36,"Y":261.38},{"X":155.25,"Y":260.49},{"X":155.25,"Y":84.06},{"X":336.36,"Y":84.06},{"X":336.36,"Y":261.38},{"X":336.36,"Y":261.38}]]'
}, { // Spiral and rectangles
subj: '[[{"X":222.02,"Y":294.08},{"X":202.56,"Y":292.96},{"X":183.69,"Y":289.52},{"X":165.670002,"Y":283.86},{"X":148.5,"Y":275.99},{"X":132.45999999999998,"Y":266.02},{"X":117.8,"Y":254.11},{"X":104.75,"Y":240.45},{"X":93.72,"Y":225.49},{"X":84.85,"Y":209.5},{"X":78.12,"Y":192.5},{"X":73.73,"Y":175.06},{"X":71.6,"Y":156.89},{"X":71.83,"Y":139.51},{"X":74.33,"Y":123.52},{"X":79.1,"Y":108.05},{"X":86.16,"Y":93.15},{"X":95.270001,"Y":79.41},{"X":106.41,"Y":66.85},{"X":119.19,"Y":55.97},{"X":133.6,"Y":46.79},{"X":149.15,"Y":39.7},{"X":165.51999999999998,"Y":34.82},{"X":182.41,"Y":32.2300004},{"X":199.5,"Y":31.97},{"X":214.94,"Y":34.03},{"X":229.61,"Y":38.33},{"X":243.45,"Y":44.81},{"X":256.13,"Y":53.36},{"X":267.330004,"Y":63.75},{"X":276.63,"Y":75.5},{"X":283.960004,"Y":88.57},{"X":289.03,"Y":102.35},{"X":291.840003,"Y":116.77},{"X":292.340003,"Y":131.44},{"X":290.53999999999996,"Y":144.5},{"X":286.49,"Y":157.05},{"X":280.16999999999996,"Y":168.96},{"X":271.9,"Y":179.61},{"X":261.710004,"Y":188.89},{"X":250.1,"Y":196.31},{"X":237.4,"Y":201.68},{"X":223.99,"Y":204.85},{"X":209.93,"Y":205.76},{"X":197.13,"Y":204.33},{"X":185.11,"Y":200.63},{"X":173.99,"Y":194.74},{"X":164.19,"Y":186.85},{"X":156.22,"Y":177.51},{"X":150.18,"Y":166.82},{"X":146.41,"Y":155.44},{"X":144.89,"Y":143.56},{"X":145.63,"Y":132.5},{"X":148.59,"Y":122.14},{"X":153.8,"Y":112.36},{"X":160.93,"Y":103.88},{"X":169.89,"Y":96.86},{"X":180.09,"Y":91.81},{"X":191.1,"Y":88.95},{"X":202.47,"Y":88.37},{"X":212.8,"Y":90.1},{"X":222.22,"Y":93.95},{"X":230.55,"Y":99.81},{"X":237.37,"Y":107.36},{"X":242.28,"Y":116.28},{"X":244.92,"Y":125.8},{"X":245.3,"Y":135.670002},{"X":243.42,"Y":144.44},{"X":239.27,"Y":152.74},{"X":233.18,"Y":159.73},{"X":225.31,"Y":165.19},{"X":216.34,"Y":168.54},{"X":206.82,"Y":169.6},{"X":198.23,"Y":168.4},{"X":190.26,"Y":164.97},{"X":183.5,"Y":159.55},{"X":178.57999999999998,"Y":152.77},{"X":175.66,"Y":144.92},{"X":175,"Y":136.87},{"X":176.64,"Y":132.74},{"X":180.14,"Y":130},{"X":184.55,"Y":129.420002},{"X":188.66,"Y":131.13},{"X":191.34,"Y":134.670002},{"X":192.98,"Y":143.46},{"X":196.15,"Y":148.15},{"X":201.12,"Y":151.43},{"X":206.97,"Y":152.6},{"X":214.06,"Y":151.54},{"X":220.43,"Y":148.24},{"X":225.15,"Y":143.26},{"X":227.84,"Y":137.26},{"X":228.34,"Y":130.41},{"X":226.58,"Y":122.84},{"X":222.68,"Y":116.12},{"X":216.8,"Y":110.59},{"X":209.61,"Y":106.92},{"X":201.39,"Y":105.35},{"X":191.84,"Y":106.08},{"X":182.76,"Y":109.12},{"X":174.94,"Y":114.11},{"X":168.57999999999998,"Y":120.86},{"X":164.26,"Y":128.730002},{"X":162.09,"Y":137.44},{"X":162.230002,"Y":147.31},{"X":164.64,"Y":157.2},{"X":169.35,"Y":166.56},{"X":176.03,"Y":174.64},{"X":184.51999999999998,"Y":181.28},{"X":194.25,"Y":185.91},{"X":204.75,"Y":188.36},{"X":216.73,"Y":188.57},{"X":228.83,"Y":186.5},{"X":240.34,"Y":182.2},{"X":250.83,"Y":175.81},{"X":259.9,"Y":167.54},{"X":267.03,"Y":157.91},{"X":272.02,"Y":147.35},{"X":274.830004,"Y":136.01},{"X":275.340003,"Y":123.74},{"X":273.580004,"Y":110.68},{"X":269.580004,"Y":98.12},{"X":263.3,"Y":86.19},{"X":255.05,"Y":75.52},{"X":244.91,"Y":66.18},{"X":233.35,"Y":58.67},{"X":220.7,"Y":53.21},{"X":207.02,"Y":49.86},{"X":192.67,"Y":48.8},{"X":176.82999999999998,"Y":50},{"X":161.34,"Y":53.51},{"X":146.540002,"Y":59.27},{"X":132.76,"Y":67.17},{"X":120.53999999999999,"Y":76.85},{"X":109.92,"Y":88.25},{"X":101.32,"Y":100.89},{"X":94.75999999999999,"Y":114.7},{"X":90.52,"Y":129.07},{"X":88.57,"Y":143.93},{"X":88.92,"Y":160.71},{"X":91.63,"Y":177.58},{"X":96.66,"Y":193.91},{"X":103.9,"Y":209.38},{"X":113.37,"Y":223.97},{"X":124.72,"Y":237.14},{"X":137.93,"Y":248.89},{"X":152.59,"Y":258.78999999999996},{"X":168.44,"Y":266.65},{"X":185.18,"Y":272.34},{"X":202.83,"Y":275.85},{"X":221.07,"Y":277.07},{"X":241.43,"Y":276},{"X":261.24,"Y":272.63},{"X":280.52,"Y":266.98},{"X":299,"Y":259.12},{"X":316.43,"Y":249.14},{"X":332.56,"Y":237.17},{"X":346.94,"Y":223.57},{"X":359.59,"Y":208.35},{"X":370.15,"Y":191.97},{"X":378.51,"Y":174.7},{"X":384.69,"Y":156.54},{"X":388.59,"Y":137.75},{"X":390.64,"Y":115.98},{"X":393.21,"Y":112.35},{"X":397.26,"Y":110.5},{"X":401.4,"Y":110.83},{"X":405.08,"Y":113.33},{"X":407,"Y":117.34},{"X":406.15,"Y":134.39},{"X":402.81,"Y":154.2},{"X":397.18,"Y":173.48},{"X":389.22,"Y":192.25},{"X":379.12,"Y":209.96},{"X":366.88,"Y":226.64},{"X":352.8,"Y":241.8},{"X":336.88,"Y":255.47},{"X":319.51,"Y":267.26},{"X":300.93,"Y":277.02},{"X":281.38,"Y":284.66},{"X":260.81,"Y":290.13},{"X":239.75,"Y":293.26},{"X":222.07,"Y":294.08},{"X":222.02,"Y":294.08}]]',
clip: '[[{"X":210.91,"Y":210.89},{"X":107.65,"Y":210.65},{"X":107.65,"Y":27.58},{"X":210.91,"Y":27.75},{"X":210.91,"Y":36.45},{"X":210.91,"Y":210.89}],[{"X":304.24,"Y":323.13},{"X":210.91,"Y":322.86},{"X":210.91,"Y":70.9},{"X":304.24,"Y":70.91},{"X":304.24,"Y":148.61},{"X":304.24,"Y":323.13}],[{"X":407.5,"Y":254.59},{"X":304.24,"Y":254.35},{"X":304.24,"Y":71.28},{"X":407.5,"Y":71.28},{"X":407.5,"Y":71.28},{"X":407.5,"Y":254.59}]]'
}, { // Rounded grid and stars
subj: '[[{"X":346.2,"Y":66.31},{"X":332.04,"Y":53.81},{"X":316.43,"Y":43.18},{"X":299.87,"Y":34.73995},{"X":282.39,"Y":28.44},{"X":263.95,"Y":24.33},{"X":245.15,"Y":22.56002},{"X":226.27,"Y":23.13},{"X":207.6,"Y":26.04},{"X":189.74,"Y":31.18},{"X":172.6702,"Y":38.53},{"X":156.65,"Y":47.95},{"X":141.69,"Y":59.49},{"X":128.2902,"Y":72.8},{"X":116.65,"Y":87.67},{"X":107.11,"Y":103.62},{"X":99.64,"Y":120.65},{"X":94.37,"Y":138.47},{"X":91.33,"Y":157.11},{"X":90.63,"Y":175.99},{"X":92.2599,"Y":194.8},{"X":96.2401,"Y":213.27},{"X":102.42,"Y":230.8},{"X":110.74,"Y":247.42},{"X":121.26,"Y":263.1},{"X":133.6702,"Y":277.35},{"X":147.74,"Y":289.95},{"X":163.2698,"Y":300.69},{"X":179.77,"Y":309.25},{"X":197.21,"Y":315.68},{"X":215.62,"Y":319.92},{"X":234.41,"Y":321.81},{"X":253.29,"Y":321.38},{"X":271.98,"Y":318.6},{"X":289.87,"Y":313.58},{"X":307,"Y":306.36},{"X":323.09,"Y":297.05},{"X":338.12,"Y":285.62},{"X":351.62,"Y":272.4},{"X":363.37,"Y":257.61},{"X":373.02,"Y":241.73},{"X":380.61,"Y":224.76},{"X":386,"Y":206.97},{"X":389.18,"Y":188.35},{"X":390.01,"Y":169.48},{"X":388.5,"Y":150.65},{"X":384.65,"Y":132.16},{"X":378.61,"Y":114.59},{"X":370.4,"Y":97.91},{"X":359.99,"Y":82.15},{"X":347.69,"Y":67.82},{"X":346.21,"Y":66.32},{"X":346.2,"Y":66.31}],[{"X":375.03,"Y":172.21},{"X":373.83,"Y":190.15},{"X":370.54,"Y":206.57},{"X":362.32,"Y":203.86},{"X":365.47,"Y":187.07},{"X":366.32,"Y":169.7},{"X":364.79,"Y":152.38},{"X":360.96,"Y":135.73},{"X":354.9,"Y":119.76},{"X":346.72,"Y":104.76},{"X":336.39,"Y":90.77},{"X":324.26,"Y":78.32},{"X":320.42,"Y":74.77},{"X":325.57,"Y":67.97},{"X":338.69,"Y":80.27},{"X":350.08,"Y":94.19},{"X":359.52,"Y":109.5},{"X":366.74,"Y":125.65},{"X":371.75,"Y":142.61},{"X":374.49,"Y":160.09},{"X":375.03,"Y":172.07},{"X":375.03,"Y":172.21}],[{"X":129.2698,"Y":172.21},{"X":130.44,"Y":156.06},{"X":133.9598,"Y":140.26},{"X":139.75,"Y":125.15},{"X":147.69,"Y":111.05},{"X":157.6,"Y":98.25},{"X":169.15,"Y":87.09},{"X":174.15,"Y":94.2},{"X":163.0798,"Y":105.17},{"X":153.78,"Y":117.67},{"X":146.4802,"Y":131.44},{"X":141.37,"Y":146.17},{"X":138.57,"Y":161.5},{"X":138.13,"Y":177.08},{"X":140.05,"Y":192.54},{"X":140.87,"Y":196.58},{"X":132.61,"Y":199.24},{"X":129.82,"Y":183.3},{"X":129.2698,"Y":172.22},{"X":129.2698,"Y":172.21}],[{"X":327.6,"Y":172.21},{"X":326.42,"Y":186.54},{"X":325.15,"Y":191.85},{"X":317.08,"Y":189.04},{"X":318.84,"Y":175.67},{"X":318.28,"Y":162.2},{"X":315.43,"Y":149.02},{"X":310.34,"Y":136.54},{"X":303.19,"Y":125.11},{"X":293.99,"Y":114.85},{"X":292.48,"Y":113.21},{"X":297.61,"Y":106.36},{"X":307.64,"Y":116.67},{"X":315.86,"Y":128.4802},{"X":322.02,"Y":141.48},{"X":325.96,"Y":155.31},{"X":327.56,"Y":169.6},{"X":327.6,"Y":172},{"X":327.6,"Y":172.21}],[{"X":153.0198,"Y":172.21},{"X":154.19,"Y":157.87},{"X":157.7098,"Y":143.92},{"X":163.49,"Y":130.75},{"X":171.35,"Y":118.7},{"X":181.07,"Y":108.1},{"X":183.26,"Y":106.49},{"X":188.11,"Y":113.5},{"X":178.65,"Y":123.52},{"X":171.2098,"Y":134.7698},{"X":165.8,"Y":147.12},{"X":162.61,"Y":160.22},{"X":161.7098,"Y":173.67},{"X":163.13,"Y":187.08},{"X":163.36,"Y":189.28},{"X":155.22,"Y":191.74},{"X":153.18,"Y":177.51},{"X":153.0198,"Y":172.41},{"X":153.0198,"Y":172.21}],[{"X":303.92,"Y":172.21},{"X":302.73,"Y":184.43},{"X":294.39,"Y":181.76},{"X":295.2104,"Y":170.41},{"X":293.6597,"Y":159.14},{"X":289.8,"Y":148.43},{"X":283.81,"Y":138.76},{"X":278.44,"Y":132.51},{"X":283.57,"Y":125.63},{"X":291.73,"Y":134.82},{"X":297.98,"Y":145.39},{"X":302.07,"Y":156.97},{"X":303.84,"Y":169.12},{"X":303.92,"Y":172.12},{"X":303.92,"Y":172.21}],[{"X":200.38,"Y":172.21},{"X":201.53,"Y":162.7},{"X":204.93,"Y":153.75},{"X":210.37,"Y":145.87},{"X":211.36,"Y":145.15},{"X":216.39,"Y":152.18},{"X":211.93,"Y":159.27},{"X":209.51,"Y":167.29},{"X":209.16,"Y":174.43},{"X":200.68,"Y":177.07},{"X":200.38,"Y":172.28},{"X":200.38,"Y":172.21}],[{"X":279.9196,"Y":177.17},{"X":271.4,"Y":174.36},{"X":270.87,"Y":166.01},{"X":268.12,"Y":158.1},{"X":264.19,"Y":152.1},{"X":269.5,"Y":145.05},{"X":275.1597,"Y":152.78},{"X":278.81,"Y":161.64},{"X":280.22,"Y":171.11},{"X":279.93,"Y":177.09},{"X":279.9196,"Y":177.17}],[{"X":251.65,"Y":183.77},{"X":247.81,"Y":186.59},{"X":247.94,"Y":182.57},{"X":251.37,"Y":183.68},{"X":251.65,"Y":183.77}],[{"X":252.45,"Y":168.26},{"X":254.89,"Y":165.21},{"X":256.24,"Y":169.49},{"X":252.54,"Y":168.29},{"X":252.45,"Y":168.26}],[{"X":240.31,"Y":159.45},{"X":238.03,"Y":156.14},{"X":242.64,"Y":156.24},{"X":240.35,"Y":159.39},{"X":240.31,"Y":159.45}],[{"X":228.17,"Y":168.26},{"X":224.41,"Y":169.28},{"X":225.81,"Y":165.03},{"X":228.11,"Y":168.18},{"X":228.17,"Y":168.26}],[{"X":232.81,"Y":182.52},{"X":232.69,"Y":186.53},{"X":229.1,"Y":183.73},{"X":232.52,"Y":182.62},{"X":232.81,"Y":182.52}],[{"X":247.81,"Y":202.54},{"X":255.59,"Y":199.43},{"X":262.26,"Y":194.37},{"X":266.99,"Y":188.75},{"X":275.13,"Y":191.69},{"X":269.4604,"Y":199.41},{"X":262.13,"Y":205.57},{"X":253.54,"Y":209.81},{"X":247.81,"Y":211.35},{"X":247.81,"Y":211.35},{"X":247.81,"Y":202.54}],[{"X":252.07,"Y":143.27},{"X":243.96,"Y":141.17},{"X":235.59,"Y":141.32},{"X":228.44,"Y":143.14},{"X":223.38,"Y":136.11},{"X":232.48,"Y":133.12},{"X":242.03,"Y":132.38},{"X":251.47,"Y":133.94},{"X":257.2,"Y":136.21},{"X":252.09,"Y":143.25},{"X":252.07,"Y":143.27}],[{"X":213.83,"Y":188.68},{"X":219.16,"Y":195.14},{"X":226,"Y":199.96},{"X":232.81,"Y":202.54},{"X":232.71,"Y":211.33},{"X":223.6,"Y":208.4},{"X":215.45,"Y":203.37},{"X":208.72,"Y":196.55},{"X":205.5,"Y":191.38},{"X":213.77,"Y":188.7},{"X":213.83,"Y":188.68}],[{"X":232.81,"Y":226.54},{"X":232.63,"Y":235.34},{"X":220.63,"Y":232.69},{"X":209.38,"Y":227.76},{"X":199.29,"Y":220.77},{"X":190.72,"Y":211.98},{"X":183.98,"Y":201.71},{"X":182.64,"Y":198.8},{"X":190.9,"Y":196.16},{"X":196.92,"Y":205.81},{"X":204.8,"Y":214.02},{"X":214.19,"Y":220.45},{"X":224.71,"Y":224.8},{"X":232.61,"Y":226.52},{"X":232.81,"Y":226.54}],[{"X":247.81,"Y":226.54},{"X":258.86,"Y":223.83},{"X":269.11,"Y":218.89},{"X":278.13,"Y":211.95},{"X":285.53,"Y":203.31},{"X":289.8,"Y":196.15},{"X":298.05,"Y":198.84},{"X":291.8403,"Y":209.44},{"X":283.7104,"Y":218.65},{"X":273.98,"Y":226.14},{"X":262.99,"Y":231.62},{"X":251.15,"Y":234.87},{"X":247.81,"Y":235.36},{"X":247.81,"Y":235.36},{"X":247.81,"Y":226.54}],[{"X":266.2,"Y":123.84},{"X":255.67,"Y":119.53},{"X":244.47,"Y":117.5},{"X":233.1,"Y":117.82},{"X":222.03,"Y":120.47},{"X":214.38,"Y":123.79},{"X":209.48,"Y":116.59},{"X":220.74,"Y":111.68},{"X":232.73,"Y":109.05},{"X":245.01,"Y":108.77},{"X":257.11,"Y":110.86},{"X":268.5804,"Y":115.25},{"X":271.2896,"Y":116.84},{"X":266.35,"Y":123.63},{"X":266.2,"Y":123.84}],[{"X":202.29,"Y":132.6702},{"X":194.93,"Y":141.35},{"X":189.51,"Y":151.35},{"X":186.28,"Y":162.26},{"X":185.4,"Y":173.61},{"X":186.15,"Y":181.89},{"X":177.9,"Y":184.53},{"X":176.7,"Y":172.31},{"X":177.86,"Y":160.08},{"X":181.36,"Y":148.31},{"X":187.07,"Y":137.44},{"X":194.76,"Y":127.86},{"X":197.29,"Y":125.8},{"X":202.24,"Y":132.6},{"X":202.29,"Y":132.6702}],[{"X":168.2,"Y":203.48},{"X":174.63,"Y":215.34},{"X":182.98,"Y":225.92},{"X":193.01,"Y":234.94},{"X":204.42,"Y":242.12},{"X":216.89,"Y":247.24},{"X":230.06,"Y":250.14},{"X":232.81,"Y":250.45},{"X":232.66,"Y":259.23},{"X":218.49,"Y":256.8},{"X":204.91,"Y":252.05},{"X":192.3,"Y":245.13},{"X":180.99,"Y":236.24},{"X":171.2902,"Y":225.63},{"X":163.44,"Y":213.57},{"X":160.07,"Y":206.12},{"X":168.06,"Y":203.53},{"X":168.2,"Y":203.48}],[{"X":247.81,"Y":250.45},{"X":261.07,"Y":248.02},{"X":273.72,"Y":243.35},{"X":285.37,"Y":236.57},{"X":295.7104,"Y":227.91},{"X":304.42,"Y":217.62},{"X":311.26,"Y":206},{"X":312.63,"Y":203.56},{"X":320.65,"Y":206.36},{"X":313.94,"Y":219.08},{"X":305.24,"Y":230.53},{"X":294.7896,"Y":240.41},{"X":282.86,"Y":248.46},{"X":269.78,"Y":254.44},{"X":255.89,"Y":258.1696},{"X":247.81,"Y":259.24},{"X":247.81,"Y":259.24},{"X":247.81,"Y":250.45}],[{"X":280.24,"Y":104.53},{"X":268.0903,"Y":98.68},{"X":255.12,"Y":95},{"X":241.71,"Y":93.61},{"X":228.26,"Y":94.52},{"X":215.16,"Y":97.73},{"X":202.81,"Y":103.15},{"X":200.26,"Y":104.37},{"X":195.31,"Y":97.37},{"X":208.19,"Y":90.97},{"X":221.96,"Y":86.79},{"X":236.22,"Y":84.94},{"X":250.6,"Y":85.45},{"X":264.69,"Y":88.31},{"X":278.12,"Y":93.47},{"X":285.3304,"Y":97.52},{"X":280.4,"Y":104.31},{"X":280.24,"Y":104.53}],[{"X":240.31,"Y":69.85},{"X":224.77,"Y":71.03},{"X":209.88,"Y":74.47},{"X":195.4,"Y":80.25},{"X":186.27,"Y":85.13},{"X":181.44,"Y":78.15},{"X":195.74,"Y":70.57},{"X":211,"Y":65.16},{"X":226.88,"Y":62.04},{"X":243.04,"Y":61.27},{"X":259.15,"Y":62.84},{"X":274.86,"Y":66.7401},{"X":289.8304,"Y":72.9},{"X":299.23,"Y":78.4},{"X":294.06,"Y":85.16},{"X":280.23,"Y":77.97},{"X":265.47,"Y":72.98},{"X":250.12,"Y":70.31},{"X":240.53,"Y":69.85},{"X":240.31,"Y":69.85}],[{"X":145.5798,"Y":210.82},{"X":152.56,"Y":224.76},{"X":161.57,"Y":237.47},{"X":172.4,"Y":248.69},{"X":184.79,"Y":258.14},{"X":198.47,"Y":265.6},{"X":213.13,"Y":270.89},{"X":228.42,"Y":273.88},{"X":232.81,"Y":274.29},{"X":232.64,"Y":282.91},{"X":216.62,"Y":280.63},{"X":201.1,"Y":276.03},{"X":186.42,"Y":269.2},{"X":172.89,"Y":260.32},{"X":160.7902,"Y":249.58},{"X":150.36,"Y":237.2},{"X":141.8298,"Y":223.44},{"X":137.4202,"Y":213.47},{"X":145.41,"Y":210.88},{"X":145.5798,"Y":210.82}],[{"X":247.81,"Y":274.29},{"X":263.22,"Y":271.97},{"X":277.81,"Y":267.44},{"X":291.82,"Y":260.61},{"X":304.63,"Y":251.73},{"X":315.96,"Y":241.02},{"X":325.54,"Y":228.73},{"X":333.15,"Y":215.13},{"X":335.12,"Y":210.85},{"X":343.34,"Y":213.56},{"X":336.21,"Y":228.09},{"X":327.03,"Y":241.42},{"X":316.03,"Y":253.29},{"X":303.43,"Y":263.45},{"X":289.49,"Y":271.68},{"X":274.5,"Y":277.79},{"X":258.78,"Y":281.63},{"X":247.81,"Y":282.92},{"X":247.81,"Y":282.92},{"X":247.81,"Y":274.29}],[{"X":339.67,"Y":196.56},{"X":342.21,"Y":181.18},{"X":342.39,"Y":165.6},{"X":340.21,"Y":150.16},{"X":335.7,"Y":135.25},{"X":328.96,"Y":121.19},{"X":320.17,"Y":108.32},{"X":309.54,"Y":96.93},{"X":306.51,"Y":93.91},{"X":311.67,"Y":87.25},{"X":323.27,"Y":98.54},{"X":333.13,"Y":111.37},{"X":341.03,"Y":125.5},{"X":346.77,"Y":140.63},{"X":350.23,"Y":156.45},{"X":351.35,"Y":172.59},{"X":350.12,"Y":188.73},{"X":347.95,"Y":199.24},{"X":339.68,"Y":196.56},{"X":339.67,"Y":196.56}],[{"X":313.32,"Y":59.03},{"X":307.96,"Y":65.9601},{"X":292.9604,"Y":57.76},{"X":277,"Y":51.68},{"X":260.35,"Y":47.83},{"X":243.33,"Y":46.27},{"X":225.96,"Y":47.04},{"X":209.16,"Y":50.13},{"X":192.93,"Y":55.47},{"X":177.58,"Y":62.97},{"X":172.2698,"Y":65.87},{"X":167.5,"Y":58.9},{"X":182.96,"Y":50.31},{"X":199.42,"Y":43.83},{"X":216.59,"Y":39.58},{"X":234.17,"Y":37.62005},{"X":252.15,"Y":38},{"X":269.63,"Y":40.7},{"X":286.6,"Y":45.68},{"X":302.76,"Y":52.86},{"X":313.12,"Y":58.91},{"X":313.32,"Y":59.03}],[{"X":155.18,"Y":67.87},{"X":160.1,"Y":75.1},{"X":147.49,"Y":87.07},{"X":136.63,"Y":100.65},{"X":127.73,"Y":115.58},{"X":121.08,"Y":131.32},{"X":116.64,"Y":147.82},{"X":114.48,"Y":164.77},{"X":114.66,"Y":182.16},{"X":117.15,"Y":199.06},{"X":118.19,"Y":203.94},{"X":110.01,"Y":206.46},{"X":106.64,"Y":189.1},{"X":105.59,"Y":171.14},{"X":106.92,"Y":153.21},{"X":110.56,"Y":135.9},{"X":116.45,"Y":119.22},{"X":124.48,"Y":103.46},{"X":134.7,"Y":88.66},{"X":146.78,"Y":75.33},{"X":155.07,"Y":67.9601},{"X":155.18,"Y":67.87}],[{"X":114.68,"Y":220.85},{"X":123.06,"Y":218.44},{"X":130.4202,"Y":233.86},{"X":139.99,"Y":248.38},{"X":151.45,"Y":261.4604},{"X":164.59,"Y":272.84},{"X":179.16,"Y":282.33},{"X":194.62,"Y":289.61},{"X":210.92,"Y":294.71},{"X":227.77,"Y":297.55},{"X":232.81,"Y":297.95},{"X":232.52,"Y":306.7},{"X":214.97,"Y":304.53},{"X":197.86,"Y":300.07},{"X":181.48,"Y":293.39},{"X":166.12,"Y":284.61},{"X":151.82,"Y":273.7},{"X":139.0798,"Y":261.01},{"X":128.14,"Y":246.73},{"X":119.31,"Y":231.41},{"X":114.72,"Y":220.97},{"X":114.68,"Y":220.85}],[{"X":247.81,"Y":306.71},{"X":248.04,"Y":297.93},{"X":264.99,"Y":295.74},{"X":281.48,"Y":291.27},{"X":297.2,"Y":284.59},{"X":311.88,"Y":275.84},{"X":325.47,"Y":264.99},{"X":337.44,"Y":252.39},{"X":347.59,"Y":238.27},{"X":355.57,"Y":223.16},{"X":357.93,"Y":218.25},{"X":365.83,"Y":221.11},{"X":358.32,"Y":237.13},{"X":348.6,"Y":252.26},{"X":336.95,"Y":265.97},{"X":323.6,"Y":278.02},{"X":308.77,"Y":288.19},{"X":292.99,"Y":296.19},{"X":276.3,"Y":302.04},{"X":258.98,"Y":305.63},{"X":247.94,"Y":306.71},{"X":247.81,"Y":306.71}]]',
clip: '[[{"X":240.31,"Y":12.26},{"X":292.45,"Y":117.59},{"X":408.23,"Y":134.69},{"X":324.43,"Y":216.63},{"X":344.16,"Y":332.1},{"X":240.06,"Y":277.63},{"X":136.4,"Y":332},{"X":155.99,"Y":216.19},{"X":72.33,"Y":134.4202},{"X":188.37,"Y":117.5},{"X":240.28,"Y":12.30999},{"X":240.31,"Y":12.26}]]'
}, { // Glyph and grid
subj: '[[{"X":105.65,"Y":51.37},{"X":105.65,"Y":295.26},{"X":395.09,"Y":295.26},{"X":395.01,"Y":51.37},{"X":108.51,"Y":51.37},{"X":105.65,"Y":51.37}],[{"X":380.09,"Y":89.4799},{"X":349.33,"Y":89.4799},{"X":349.33,"Y":66.37},{"X":380.09,"Y":66.37},{"X":380.09,"Y":66.37},{"X":380.09,"Y":89.4799}],[{"X":257.87,"Y":127.7},{"X":257.87,"Y":104.48},{"X":288.63,"Y":104.48},{"X":288.44,"Y":127.7},{"X":283.0396,"Y":127.7},{"X":257.87,"Y":127.7}],[{"X":288.63,"Y":142.7},{"X":288.63,"Y":165.81},{"X":257.87,"Y":165.81},{"X":257.87,"Y":142.7},{"X":257.87,"Y":142.7},{"X":288.63,"Y":142.7}],[{"X":242.87,"Y":127.7},{"X":212.11,"Y":127.7},{"X":212.11,"Y":104.48},{"X":242.87,"Y":104.48},{"X":242.87,"Y":104.48},{"X":242.87,"Y":127.7}],[{"X":242.87,"Y":142.7},{"X":242.87,"Y":165.81},{"X":212.11,"Y":165.81},{"X":212.11,"Y":142.7},{"X":212.11,"Y":142.7},{"X":242.87,"Y":142.7}],[{"X":197.11,"Y":165.81},{"X":166.41,"Y":165.81},{"X":166.41,"Y":142.7},{"X":197.11,"Y":142.7},{"X":197.11,"Y":142.7},{"X":197.11,"Y":165.81}],[{"X":197.11,"Y":180.81},{"X":197.11,"Y":203.92},{"X":166.41,"Y":203.92},{"X":166.41,"Y":180.81},{"X":166.41,"Y":180.81},{"X":197.11,"Y":180.81}],[{"X":212.11,"Y":180.81},{"X":242.87,"Y":180.81},{"X":242.87,"Y":203.92},{"X":212.11,"Y":203.92},{"X":212.11,"Y":203.92},{"X":212.11,"Y":180.81}],[{"X":242.87,"Y":218.92},{"X":242.87,"Y":242.14},{"X":212.11,"Y":242.14},{"X":212.11,"Y":218.92},{"X":212.11,"Y":218.92},{"X":242.87,"Y":218.92}],[{"X":257.87,"Y":218.92},{"X":288.63,"Y":218.92},{"X":288.63,"Y":242.14},{"X":257.87,"Y":242.14},{"X":257.87,"Y":242.14},{"X":257.87,"Y":218.92}],[{"X":257.87,"Y":203.92},{"X":257.87,"Y":180.81},{"X":288.63,"Y":180.81},{"X":288.63,"Y":203.92},{"X":288.63,"Y":203.92},{"X":257.87,"Y":203.92}],[{"X":303.63,"Y":180.81},{"X":334.33004,"Y":180.81},{"X":334.33004,"Y":203.92},{"X":303.63,"Y":203.92},{"X":303.63,"Y":203.92},{"X":303.63,"Y":180.81}],[{"X":303.63,"Y":165.81},{"X":303.63,"Y":142.7},{"X":334.33004,"Y":142.7},{"X":334.33004,"Y":165.81},{"X":334.33004,"Y":165.81},{"X":303.63,"Y":165.81}],[{"X":303.63,"Y":127.7},{"X":303.63,"Y":104.48},{"X":334.33004,"Y":104.48},{"X":334.07,"Y":127.7},{"X":328.6696,"Y":127.7},{"X":303.63,"Y":127.7}],[{"X":303.63,"Y":89.4799},{"X":303.63,"Y":66.37},{"X":334.33004,"Y":66.37},{"X":334.15,"Y":89.4799},{"X":316.15,"Y":89.4799},{"X":303.63,"Y":89.4799}],[{"X":288.63,"Y":89.4799},{"X":257.87,"Y":89.4799},{"X":257.87,"Y":66.37},{"X":288.63,"Y":66.37},{"X":288.63,"Y":89.4799},{"X":288.63,"Y":89.4799}],[{"X":242.87,"Y":89.4799},{"X":212.11,"Y":89.4799},{"X":212.11,"Y":66.37},{"X":242.87,"Y":66.37},{"X":242.87,"Y":66.37},{"X":242.87,"Y":89.4799}],[{"X":197.11,"Y":89.4799},{"X":166.41,"Y":89.4799},{"X":166.41,"Y":66.37},{"X":197.11,"Y":66.37},{"X":197.11,"Y":66.37},{"X":197.11,"Y":89.4799}],[{"X":197.11,"Y":104.48},{"X":196.93,"Y":127.7},{"X":166.41,"Y":127.7},{"X":166.41,"Y":104.48},{"X":166.41,"Y":104.48},{"X":197.11,"Y":104.48}],[{"X":151.41,"Y":127.7},{"X":120.65,"Y":127.7},{"X":120.65,"Y":104.48},{"X":151.41,"Y":104.48},{"X":151.41,"Y":104.48},{"X":151.41,"Y":127.7}],[{"X":151.41,"Y":142.7},{"X":151.41,"Y":165.81},{"X":120.65,"Y":165.81},{"X":120.65,"Y":142.7},{"X":120.65,"Y":142.7},{"X":151.41,"Y":142.7}],[{"X":151.41,"Y":180.81},{"X":151.41,"Y":203.92},{"X":120.65,"Y":203.92},{"X":120.65,"Y":180.81},{"X":120.65,"Y":180.81},{"X":151.41,"Y":180.81}],[{"X":151.41,"Y":218.92},{"X":151.41,"Y":242.14},{"X":120.65,"Y":242.14},{"X":120.65,"Y":218.92},{"X":120.65,"Y":218.92},{"X":151.41,"Y":218.92}],[{"X":166.41,"Y":218.92},{"X":197.11,"Y":218.92},{"X":197.11,"Y":242.14},{"X":166.41,"Y":242.14},{"X":166.41,"Y":242.14},{"X":166.41,"Y":218.92}],[{"X":197.11,"Y":257.14},{"X":197.11,"Y":280.26},{"X":166.41,"Y":280.26},{"X":166.41,"Y":257.14},{"X":166.41,"Y":257.14},{"X":197.11,"Y":257.14}],[{"X":212.11,"Y":257.14},{"X":242.87,"Y":257.14},{"X":242.87,"Y":280.26},{"X":212.11,"Y":280.26},{"X":212.11,"Y":280.26},{"X":212.11,"Y":257.14}],[{"X":257.87,"Y":257.14},{"X":288.63,"Y":257.14},{"X":288.63,"Y":280.26},{"X":257.87,"Y":280.26},{"X":257.87,"Y":280.26},{"X":257.87,"Y":257.14}],[{"X":303.63,"Y":257.14},{"X":334.33004,"Y":257.14},{"X":334.33004,"Y":280.26},{"X":303.63,"Y":280.26},{"X":303.63,"Y":280.26},{"X":303.63,"Y":257.14}],[{"X":303.63,"Y":242.14},{"X":303.63,"Y":218.92},{"X":334.33004,"Y":218.92},{"X":334.33004,"Y":242.14},{"X":334.33004,"Y":242.14},{"X":303.63,"Y":242.14}],[{"X":349.33,"Y":218.92},{"X":380.09,"Y":218.92},{"X":380.09,"Y":242.14},{"X":349.33,"Y":242.14},{"X":349.33,"Y":242.14},{"X":349.33,"Y":218.92}],[{"X":349.33,"Y":203.92},{"X":349.33,"Y":180.81},{"X":380.09,"Y":180.81},{"X":380.09,"Y":203.92},{"X":380.09,"Y":203.92},{"X":349.33,"Y":203.92}],[{"X":349.33,"Y":165.81},{"X":349.33,"Y":142.7},{"X":380.09,"Y":142.7},{"X":380.09,"Y":165.81},{"X":380.09,"Y":165.81},{"X":349.33,"Y":165.81}],[{"X":349.33,"Y":127.7},{"X":349.33,"Y":104.48},{"X":380.09,"Y":104.48},{"X":379.9,"Y":127.7},{"X":374.5,"Y":127.7},{"X":349.33,"Y":127.7}],[{"X":151.41,"Y":66.37},{"X":151.12,"Y":89.4799},{"X":120.65,"Y":89.4799},{"X":120.65,"Y":66.37},{"X":120.65,"Y":66.37},{"X":151.41,"Y":66.37}],[{"X":120.65,"Y":257.14},{"X":151.41,"Y":257.14},{"X":151.41,"Y":280.26},{"X":120.65,"Y":280.26},{"X":120.65,"Y":280.26},{"X":120.65,"Y":257.14}],[{"X":349.33,"Y":280.26},{"X":349.33,"Y":257.14},{"X":380.09,"Y":257.14},{"X":380.09,"Y":280.26},{"X":380.09,"Y":280.26},{"X":349.33,"Y":280.26}]]',
clip: '[[{"X":305.08004,"Y":241.97},{"X":306,"Y":251.51},{"X":308.18,"Y":256.4},{"X":311.72,"Y":259.09003},{"X":317.31,"Y":260.01},{"X":324.71004,"Y":259.01},{"X":332.45,"Y":255.86},{"X":335.57,"Y":257.5396},{"X":337.6,"Y":260.44},{"X":336.94,"Y":262.33004},{"X":328.27,"Y":268.74},{"X":317.9,"Y":273.4196},{"X":307.94,"Y":275.49},{"X":296.26,"Y":275.23},{"X":286.64,"Y":272.99},{"X":279.7896,"Y":269.31},{"X":274.14,"Y":263.55},{"X":271.6597,"Y":260.21004},{"X":269.2,"Y":261.06},{"X":254.83,"Y":268.51},{"X":242.11,"Y":272.97},{"X":227.59,"Y":275.23},{"X":209.91,"Y":275.48},{"X":197.47,"Y":273.63},{"X":187.91,"Y":270.13},{"X":180.48002,"Y":265.09003},{"X":175.32,"Y":258.88},{"X":172.2098,"Y":251.44},{"X":171.1,"Y":242.23},{"X":172.24,"Y":233.63},{"X":175.49,"Y":226.24},{"X":181,"Y":219.54},{"X":189.42002,"Y":213.3},{"X":201.36,"Y":207.73},{"X":217.23,"Y":203.25},{"X":238.28,"Y":200.1},{"X":265.24,"Y":198.78},{"X":269.37,"Y":198.47},{"X":269.98,"Y":182.93},{"X":268.74,"Y":171.32},{"X":266.05,"Y":163.7098},{"X":261.58004,"Y":157.72},{"X":255.24,"Y":153.24},{"X":247.06,"Y":150.3298},{"X":235.44,"Y":149.13},{"X":224.71,"Y":150.05},{"X":215.91,"Y":153},{"X":210.23002,"Y":156.86},{"X":207.64,"Y":160.85},{"X":207.19,"Y":165.28},{"X":209.34,"Y":169.86},{"X":212.0198,"Y":174.15},{"X":212.14,"Y":177.99},{"X":209.8,"Y":181.78},{"X":204.22,"Y":185.79},{"X":197.62,"Y":187.68},{"X":188.65,"Y":187.43},{"X":182.41,"Y":185.39},{"X":178.45,"Y":181.77},{"X":176.2098,"Y":176.9},{"X":176.03,"Y":170.64},{"X":178.2,"Y":164.13},{"X":183.09,"Y":157.7},{"X":191.04002,"Y":151.36},{"X":202.01,"Y":145.8298},{"X":216.09,"Y":141.57},{"X":232.08,"Y":139.24},{"X":250.07,"Y":139.18},{"X":266.13,"Y":141.23002},{"X":279.05,"Y":145.06},{"X":289.1597,"Y":150.3},{"X":295.9196,"Y":156.19},{"X":300.73,"Y":163.41},{"X":303.85,"Y":172.47},{"X":305.07,"Y":183.78},{"X":305.07,"Y":241.97},{"X":305.08004,"Y":241.97}],[{"X":243.99,"Y":64.95},{"X":255.92,"Y":66.07},{"X":266.21004,"Y":69.28},{"X":274.98,"Y":74.44},{"X":280.65,"Y":80.19},{"X":284.03,"Y":86.85},{"X":285.26,"Y":94.52001},{"X":284.28,"Y":102.84},{"X":281.24,"Y":109.66},{"X":276.0396,"Y":115.43},{"X":267.89,"Y":120.46},{"X":257.68,"Y":123.93},{"X":245.79,"Y":125.33},{"X":232.93,"Y":124.53},{"X":222.21,"Y":121.74},{"X":213.14,"Y":117.11},{"X":207.36,"Y":111.92},{"X":203.7,"Y":105.75},{"X":201.94,"Y":98.18},{"X":202.34,"Y":90.12},{"X":204.86,"Y":83.4},{"X":210.01,"Y":76.81},{"X":217.49,"Y":71.33},{"X":227.17,"Y":67.31},{"X":238.35,"Y":65.2},{"X":243.75,"Y":64.95},{"X":243.99,"Y":64.95}],[{"X":269.99,"Y":212.88},{"X":269.48,"Y":208.76},{"X":266.59003,"Y":208.36},{"X":245.76,"Y":210.86},{"X":230.95,"Y":214.67},{"X":220.9,"Y":219.34},{"X":213.82,"Y":224.85},{"X":209.69,"Y":230.71},{"X":207.92002,"Y":237.03},{"X":208.4,"Y":244.49},{"X":210.86,"Y":250.57},{"X":215.2,"Y":255.08},{"X":221.69,"Y":258.13},{"X":230.57,"Y":259.43},{"X":242.52,"Y":258.58004},{"X":255.27,"Y":255.23},{"X":266.07,"Y":250.04},{"X":269.34003,"Y":247.02},{"X":269.99,"Y":244.81},{"X":269.99,"Y":212.88},{"X":269.99,"Y":212.88}],[{"X":243.63,"Y":73.34},{"X":235.93,"Y":74.4},{"X":230.07,"Y":77.36},{"X":225.65,"Y":82.21001},{"X":223.05,"Y":88.57},{"X":222.41,"Y":96.92},{"X":223.94,"Y":104.53},{"X":227.23,"Y":110.22},{"X":231.99,"Y":114.29},{"X":238.44,"Y":116.65},{"X":246.81,"Y":116.94},{"X":253.73,"Y":115.1},{"X":258.87,"Y":111.5},{"X":262.63,"Y":106.12},{"X":264.65,"Y":98.93},{"X":264.59003,"Y":90.25},{"X":262.47,"Y":83.41},{"X":258.6597,"Y":78.43},{"X":253.37,"Y":75.08},{"X":246.08,"Y":73.43},{"X":243.68,"Y":73.34},{"X":243.63,"Y":73.34}]]'
}, getCustomPolygons()
];
var SVG = {
scaledPaths: [],
subPolyLinks: null,
total: null,
create: function () {
p = Raphael('svgcontainer', 500, 350);
p.canvas.id = 'p';
var filter = '<filter id="innerbevel" x0="-50%" y0="-50%" width="200%" height="200%" >';
filter += '<feGaussianBlur in="SourceAlpha" stdDeviation="2" result="blur"/>';
filter += '<feOffset dy="3" dx="3"/>';
filter += '<feComposite in2="SourceAlpha" operator="arithmetic" k2="-1" k3="1" result="hlDiff"/>';
filter += '<feFlood flood-color="white" flood-opacity="0.8"/>'; // changed to 1.0 for speed
filter += '<feComposite in2="hlDiff" operator="in"/>';
filter += '<feComposite in2="SourceGraphic" operator="over" result="withGlow"/>';
filter += '<feOffset in="blur" dy="-3" dx="-3"/>';
filter += '<feComposite in2="SourceAlpha" operator="arithmetic" k2="-1" k3="1" result="shadowDiff"/>';
filter += '<feFlood flood-color="black" flood-opacity="0.5"/>'; // changed to 1.0 for speed
filter += '<feComposite in2="shadowDiff" operator="in"/>';
filter += '<feComposite in2="withGlow" operator="over"/>';
filter += '</filter>';
// Markers to show start, mid and end points of path
var markers = '<marker id="StartMarker" viewBox="0 0 10 10" refX="0" refY="5" markerUnits="strokeWidth" markerWidth="10" markerHeight="10" stroke="red" fill="none" orient="auto">';
markers += '<path d="M0,5L10,5M5,0L10,5M5,10L10,5">';
markers += '</marker>';
markers += '<marker id="MidMarker" viewBox="-1 -1 12 12" refX="5" refY="5" markerUnits="strokeWidth" markerWidth="4" markerHeight="4" stroke="red" fill="yellow" fill-opacity="0.5" orient="0" >';
markers += '<circle cx="5" cy="5" r="5"></circle>';
markers += '</marker>';
markers += '<marker id="EndMarker" viewBox="0 0 10 10" refX="5" refY="5" markerUnits="strokeWidth" markerWidth="8" markerHeight="8" stroke="blue" fill="none" orient="auto">';
markers += '<rect x="0" y="0" width="10" height="10"></rect>';
markers += '</marker>';
// This second invisible marker is needed to avoid noisy after images in Chrome:
markers += '<marker id="StartMarker2" viewBox="0 0 10 10" refX="0" refY="5" markerUnits="strokeWidth" markerWidth="10" markerHeight="10" stroke="none" fill="none" orient="auto">';
markers += '<path d="M0,5L10,5M5,0L10,5M5,10L10,5">';
markers += '</marker>';
markers += '<marker id="MidMarker2" viewBox="-1 -1 12 12" refX="5" refY="5" markerUnits="strokeWidth" markerWidth="4" markerHeight="4" stroke="none" fill="none" orient="0">';
markers += '<circle cx="5" cy="5" r="5"></circle>';
markers += '</marker>';
markers += '<marker id="EndMarker2" viewBox="0 0 10 10" refX="5" refY="5" markerUnits="strokeWidth" markerWidth="8" markerHeight="8" stroke="none" fill="none" orient="auto">';
markers += '<rect x="0" y="0" width="10" height="10"></rect>';
markers += '</marker>';
// http://stackoverflow.com/questions/3642035/jquerys-append-not-working-with-svg-element
$('body').append('<svg id="dummy" style="display:none"><defs>' + filter + markers + '</defs></svg>');
$('#p defs').append($('#innerbevel'), $('#dummy marker'));
$('#dummy').remove();
return p;
},
update: function() {
if (!p) p = SVG.create();
if (p1) p1.remove();
if (p2) p2.remove();
if (p3) p3.remove();
},
addPaths: function (a, b, c, subjFillType, clipFillType) {
if (a) {
subj.subPolygons = a.length;
a = this.polysToPath(a, 1);
if (explorerEnabled) {
if (typeof subj.subPolygons === 'undefined') subj.subPolygons = 0;
$('#subj_subpolygons').html(subj.subPolygons);
$('#subj_points_in_subpolygons').html(this.subPolyLinks);
$('#subj_points_total').html(this.total.toString());
subj.totalPoints = this.total;
}
}
if (b) {
clip.subPolygons = b.length;
b = this.polysToPath(b, 2);
if (explorerEnabled) {
if (typeof clip.subPolygons === 'undefined') clip.subPolygons = 0;
$('#clip_subpolygons').html(clip.subPolygons);
$('#clip_points_in_subpolygons').html(this.subPolyLinks);
$('#clip_points_total').html(this.total.toString());
clip.totalPoints = this.total;
}
}
solution.subPolygons = (typeof c !== 'undefined' && typeof c.length !== 'undefined') ? c.length : 0;
if (c) {
c = this.polysToPath(c, 3);
if (explorerEnabled) {
$('#solution_subpolygons').html(solution.subPolygons);
$('#solution_points_in_subpolygons').html(this.subPolyLinks);
$('#solution_points_total').html(this.total.toString());
solution.totalPoints = this.total;
}
}
if (explorerEnabled) {
$('#points_total').html((subj.totalPoints + clip.totalPoints + solution.totalPoints).toString());
if (isNaN(subj.subPolygons)) subj.subPolygons = 0;
else if (isNaN(clip.subPolygons)) clip.subPolygons = 0;
else if (isNaN(solution.subPolygons)) solution.subPolygons = 0;
$('#all_subpolygons').html(subj.subPolygons + clip.subPolygons + solution.subPolygons);
}
if (a) {
p1 = p.path(a);
p1.node.id = 'p1';
$('#p1').removeAttr('fill stroke')
.attr('fill-rule', subjFillType === 0 ? 'evenodd' : 'nonzero');
}
if (b) {
p2 = p.path(b);
p2.node.id = 'p2';
$('#p2').removeAttr('fill stroke')
.attr('fill-rule', clipFillType === 0 ? 'evenodd' : 'nonzero');
}
if (c) {
p3 = p.path(c);
p3.node.id = 'p3';
$('#p3').removeAttr('fill stroke');
if (bevel) {
$('#p3').attr('filter', 'url(#innerbevel)');
} else {
$('#p3').removeAttr('filter');
}
}
},
polysToPath: function (a, fr) {
this.scaledPaths[fr] = [];
var path = '', i, j, d;
this.subPolyCounts = [];
this.subPolyLinks = [];
this.total = 0;
if (!scale) scale = 1;
for (i = 0; i < a.length; i++) {
this.subPolyCounts.push(a[i].length);
d = '';
for (j = 0; j < a[i].length; j++) {
this.total++;
if (j === 0) {
d += 'M';
} else {
d += 'L';
}
d += (a[i][j].X / scale) + ', ' + (a[i][j].Y / scale);
}
d += 'Z';
path += d;
if (explorerEnabled) {
if (d.trim() === 'Z') d = '';
this.scaledPaths[fr].push(d);
this.subPolyLinks.push('<span class="subpolylinks" data-id="' + i + '" data-role="' + fr + '">' + a[i].length + '</span>');
}
}
if (explorerEnabled) this.subPolyLinks = this.subPolyLinks.join(', ');
if (path.trim() === 'Z') path = '';
return path;
}
};
function formatOutput(polygonString) {
if (typeof polygonString !== 'string' || polygonString === '') return '';
if (outputFormat === 'Clipper') {
return polygonString;
}
var polygons;
try {
polygons = JSON.parse(polygonString);
} catch (err) {
console.warn('Unable to parse polygon for output', err.message);
return '';
}
function getCoords(segment) {
return segment.X + ',' + segment.Y;
}
if (outputFormat === 'Plain') {
return '[' + polygons.map(function(polygon) {
return '[' + polygon.map(getCoords).join(', ') + ']';
}).join(',') + ']';
}
if (outputFormat === 'SVG') {
var result = polygons.map(function(polygon) {
return 'M' + polygon.map(getCoords).join(' L') + 'Z';
}).join(' ');
return (result.trim() !== 'MZ') ? result : '';
}
}
function getCustomPolygons() {
var value = $('#custom_polygons_select').val();
if (value) {
var customPolygons = $.totalStorage('custom_polygons');
return {
subj: customPolygons[value].subj,
clip: customPolygons[value].clip
};
}
return {
subj: defaultCustomSubjectPolygon,
clip: defaultCustomClipPolygon
};
}
function getRandomPolygons(which, polygon) {
var pointCount = randomSetting[which + 'PointCount'];
var polygonCount = randomSetting[which + 'PolygonCount'];
if (arguments.length === 1) polygon = _.parseInt($('input[name="polygons"]:checked').val());
if (polygon !== 4 && polygon !== 5) return new ClipperLib.Polygons();
var svg = $('#p');
var margin = 10;
randomSetting.randomMinX = 100 * margin;
randomSetting.randomMaxX = 100 * (parseFloat(svg.attr('width'), 10) - margin);
randomSetting.randomMinY = 100 * margin;
randomSetting.randomMaxY = 100 * (parseFloat(svg.attr('height'), 10) - margin);
var i, j, pp, np = new ClipperLib.Polygons(),
previousX = null,
previousY = null,
vertical = null,
previousVertical = null;
for (i = 0; i < polygonCount; i++) {
np[i] = new ClipperLib.Polygon();
for (j = 0; j < pointCount; j++) {
pp = new ClipperLib.IntPoint();
if (polygon === 4) {
vertical = !!_.random(0, 1); // 0 = horiz, 1 = vertic
if (previousVertical === vertical) {
vertical = !vertical;
}
// horiz => y remains same
if (!vertical) {
pp.X = _.random(randomSetting.randomMinX, randomSetting.randomMaxX);
pp.Y = (previousY === null) ? _.random(randomSetting.randomMinY, randomSetting.randomMaxY) : previousY;
// vertic => x remains same
} else {
pp.Y = _.random(randomSetting.randomMinY, randomSetting.randomMaxY);
pp.X = (previousX === null) ? _.random(randomSetting.randomMinX, randomSetting.randomMaxX) : previousX;
}
previousX = pp.X;
previousY = pp.Y;
previousVertical = vertical;
// last point fix
if (j === pointCount - 1 && pointCount !== 1) {
// horiz => y remains same
if (!vertical) {
pp.X = np[i][0].X;
// vertic => x remains same
} else {
pp.Y = np[i][0].Y;
}
}
} else {
pp.X = _.random(randomSetting.randomMinX, randomSetting.randomMaxX);
pp.Y = _.random(randomSetting.randomMinY, randomSetting.randomMaxY);
}
np[i].push(pp);
}
previousX = null;
previousY = null;
vertical = null;
previousVertical = null;
}
randomSetting.scale = scale;
return np;
}
function getPolygons(scaleAgain) {
var polygon = _.parseInt($('input[name="polygons"]:checked').val());
if(polygon !== 4 && polygon !== 5) {
ss = deserializeClipperPolygon(defaultPolygons[polygon].subj);
cc = deserializeClipperPolygon(defaultPolygons[polygon].clip);
} else {
if (!subj.random) subj.random = getRandomPolygons('subj');
if (!clip.random) clip.random = getRandomPolygons('clip');
if (scaleAgain) {
subj.random = scaleAgainRandomPoly(subj.random);
clip.random = scaleAgainRandomPoly(clip.random);
randomSetting.scale = scale;
}
ss = subj.random;
cc = clip.random;
}
sss = [[]];
}
function scaleAgainRandomPoly(poly) {
for (var i = 0; i < poly.length; i++) {
for (var j = 0; j < poly[i].length; j++) {
poly[i][j].X = round(poly[i][j].X / randomSetting.scale);
poly[i][j].Y = round(poly[i][j].Y / randomSetting.scale);
}
}
return poly;
}
function round(a) {
if (dontRoundAndScale) return a;
return Math.floor(a * scale);
}
function deserializeClipperPolygon(polygonString) {
lsk++;
var rawPolygons = JSON.parse(polygonString),
polygons = [[]], point;
for (var i = 0; i < rawPolygons.length; i++) {
polygons[i] = [];
for (var j = 0; j < rawPolygons[i].length; j++) {
if (isNaN(Number(rawPolygons[i][j].X)) || isNaN(Number(rawPolygons[i][j].Y))) {
return [[]];
}
point = new ClipperLib.IntPoint(round(Number(rawPolygons[i][j].X)), round(Number(rawPolygons[i][j].Y)));
if (benchmarkRunning) {
if (point.X > bench.maxPointX) bench.maxPointX = point.X;
if (point.Y > bench.maxPointY) bench.maxPointY = point.Y;
if (point.X < bench.minPointX) bench.minPointX = point.X;
if (point.Y < bench.minPointY) bench.minPointY = point.Y;
if (typeof bench.points['L' + point.X] === 'undefined') bench.points['L' + point.X] = scale + ':' + point.X + ':' + rawPolygons[i][j].X;
if (typeof bench.points['L' + point.Y] === 'undefined') bench.points['L' + point.Y] = scale + ':' + point.Y + ':' + rawPolygons[i][j].Y;
}
polygons[i].push(point);
}
}
return polygons;
}
function saveCustomPolygon(polygon, index) {
var customPolygons = $.totalStorage('custom_polygons');
if (!_.isArray(customPolygons) || _.isEmpty(customPolygons)) customPolygons = [];
if (typeof index === 'undefined') {
customPolygons.push(polygon);
} else {
customPolygons[index] = polygon;
}
updateCustomPolygonsSelect();
return $.totalStorage('custom_polygons', customPolygons);
}
function setDefaultCustomPolygons(reset) {
if (reset) $.totalStorage('custom_polygons', []);
saveCustomPolygon({
subj: defaultCustomSubjectPolygon,
clip: defaultCustomClipPolygon
}, 0);
}
function updateCustomPolygonsSelect() {
var arr = $.totalStorage('custom_polygons');
var value = _.parseInt($('#custom_polygons_select').val()) || 0;
$('#custom_polygons_select option').remove();
var i, arr_length = _.isArray(arr) ? arr.length : 0;
if (arr_length > 0)
for (i = 0; i < arr_length; i++) {
if (arr[i] !== null) $('#custom_polygons_select').append('<option ' + (i === value ? 'selected' : '') + ' value="' + i + '">Poly ' + i + '</option>');
}
// If previously selected value is removed, select the next one
if (arr_length > 0 && arr[value] === null)
for (i = _.parseInt(value); i < arr_length; i++) {
if (arr[i] !== null) {
$('#custom_polygons_select').val(i);
break;
}
}
$('#custom_polygons_select').change();
}
function updateEnlargedSVGSource() {
var source = $('#svgcontainer').html().replace(/\>/g, '>\n');
if (updateSVGSource) {
$('#svg_source_textarea').val(source);
}
if (updateEnlargedSVG) {
$('#enlarged_svg').html(source.replace(/ id=\"/g, ' id="_'));
var originalHeight = $('#_p').attr('height');
var originalWidth = $('#_p').attr('width');
// get bbox of all children of svg
$('body').append('<div id="dummy" style="display:block;visibility:hidden"><svg><g id="g123"></g></svg></div>');
$('#g123').append($('#_p').children().clone());
$('#dummy').html($('#dummy').html());
var bBox = $('#g123')[0].getBBox();
$('#dummy').remove();
$('#_p').attr('viewBox', (bBox.x - 5) + ' ' + (bBox.y - 5) + ' ' + (bBox.width + 10) + ' ' + (bBox.height + 10));
$('#enlarged_svg').html($('#enlarged_svg').html()).show();
$('#_p').attr('width', windowWidth).attr('height', _.parseInt((windowWidth / originalWidth) * originalHeight));
$('#_p1, #_p2, #_p3').css('stroke-width', 0.8 * (originalWidth / windowWidth));
}
}
function benchmark2(i) {
var startTime = new Date().getTime();
var obj = benchmarkGlob[i];
clean = false;
$('#clean').prop('checked', clean);
lighten = false;
$('#lighten').prop('checked', lighten);
joinType = obj.joinType;
$('input[name="joinType"][value="' + joinType + '"]').prop('checked', true);
offsettablePoly = obj.offsettablePoly;
$('input[name="offsettable_poly"][value="' + offsettablePoly + '"]').prop('checked', true);
delta = obj.delta;
$('#delta').val(delta);
miterLimit = obj.miterLimit;
$('#miterLimit').val(miterLimit);
autoFix = obj.autoFix;
$('#autoFix').prop('checked', autoFix);
simplify = obj.simplify;
$('#simplify').prop('checked', simplify);
subj.fillType = obj.subjectFillType;
$('input[name="subject_fillType"][value="' + subj.fillType + '"]').prop('checked', true);
clip.fillType = obj.clipFillType;
$('input[name="clip_fillType"][value="' + clip.fillType + '"]').prop('checked', true);
clipType = obj.clipType;
$('input[name="clipType"][value="' + clipType + '"]').prop('checked', true);
scale = obj.scale;
$('#scale').val(scale);
if (obj.polygonId === 4 || obj.polygonId === 5) randomSetting = obj.randomSetting;
$('input[name="polygons"][value="' + obj.polygonId + '"]').prop('checked', true).trigger('change');
obj = null;
lastCompletedBenchmark = i;
var endTime = new Date().getTime();
var time = endTime - startTime;
benchmarkElapsedTime += time;
benchmarkGlob[i].measuredTime = time;
benchmarkGlob[i].elapsedTime = benchmarkElapsedTime;
// update next timeouts
for (var lsk = i + 1; lsk < benchmarkGlob.length; lsk++) {
clearTimeout(benchmarkGlob[lsk].setTimeout);
benchmarkGlob[lsk].setTimeout = setTimeout('benchmark2(' + lsk + ')', benchmarkGlob[lsk].elapsedTime + lsk * benchmarkGlob[lsk].time);
}
var multipleRunsTable;
var elapsedTime = endTime - bench.list[0].start;
var results = Math.floor((i + 1) / benchmarkGlob.length * 100) + ' % (';
results += (elapsedTime / 1000).toFixed(1) + ' s) of ';
results += 'benchmark ' + (benchmarkRepeat + 1) + ' / ' + benchmarkRepeatTimes + '. ';
results += 'Remaining: ' + Math.floor((((elapsedTime / (i + 1)) * (benchmarkGlob.length - i + 1)) / 1000)) + ' s.';
$('#benchmark_multiple_status').html(results).css('display', 'table-cell');
if (i === 0) {
multipleRunsTable = bench.printMultipleRuns();
if ($('#benchmark_multiple_table').length) $('#benchmark_multiple_table').remove();
$('#benchmark_multiple_table_cont').append(multipleRunsTable);
} else if (i === benchmarkGlob.length - 1) {
if (!$('#benchmark_exports_textarea').length) {
var textarea = '<div id="benchmark_exports_textarea_div">';
textarea += '<button onClick="$(\'#benchmark_exports_textarea_div\').remove()" title="Hide Benchmark exports">Hide</button><br>';
textarea += '<textarea id="benchmark_exports_textarea"></textarea></div>';
$('#benchmark_exports_container').append(textarea);
}
if (!_.contains(benchmarkExports, 'maxPointX')) {
benchmarkExports += 'bench.maxPointX:' + bench.maxPointX + '\n';
benchmarkExports += 'bench.maxPointY:' + bench.maxPointY + '\n';
benchmarkExports += 'bench.minPointX:' + bench.minPointX + '\n';
benchmarkExports += 'bench.minPointY:' + bench.minPointY + '\n';
}
benchmarkExports += bench.totals + ';' + JSON.stringify($.browser) + '\n';
$('#benchmark_exports_textarea').val(benchmarkExports);
bench.totals_arr_multiple.push(bench.totals_arr[0]);
multipleRunsTable = bench.printMultipleRuns();
if ($('#benchmark_multiple_table').length) $('#benchmark_multiple_table').remove();
$('#benchmark_multiple_table_cont').append(multipleRunsTable);
benchmarkRepeat++;
var clickedBenchmark = $('#' + benchmarkClickedButtonId);
if (benchmarkRepeat < benchmarkRepeatTimes) {
benchmarkAutomaticClick = true;
clickedBenchmark.trigger('click');
} else {
disableBenchmarkButton(clickedBenchmark);
}
}
}
function disableBenchmarkButton(button) {
benchmarkGlob.length = 0;
benchmarkRepeat = 0;
benchmarkRunning = false;
ClipperLib.MaxSteps = ClipperLibOriginalMaxSteps;
button.html(button.html().replace('Stop', 'Run')).attr('title', button.attr('title').replace('Stop', 'Execute'));
$('button, input, select').prop('disabled', false);
$('#explorer_enabled').trigger('change');
}
var Benchmark = function () {
this.list = [];
this.cats = [];
this.cats.arr = [];
this.includeSVG = true;
this.totals = '';
this.totals_arr = [];
this.totals_arr_multiple = [];
this.maxPointX = Number.NEGATIVE_INFINITY;
this.minPointX = Number.POSITIVE_INFINITY;
this.maxPointY = Number.NEGATIVE_INFINITY;
this.minPointY = Number.POSITIVE_INFINITY;
this.points = [];
};
// cat = category, which name belongs to, name = code region name or function, which is measured
Benchmark.prototype.start = function (cat, name) {
if (!cat || !name) return;
this.list.push({
start: new Date().getTime(),
name: name,
cat: cat
});
return this.list.length - 1;
};
Benchmark.prototype.end = function (index) {
this.list[index].end = new Date().getTime();
this.list[index].time = this.list[index].end - this.list[index].start;
var this_list_cat = this.list[index].cat;
var this_list_cat_counts = this_list_cat + '_counts';
var this_list_cat_time_sum = this_list_cat + '_time_sum';
if (typeof this.cats[this_list_cat_counts] === 'undefined') this.cats.arr.push(this_list_cat);
if (typeof this.cats[this_list_cat_time_sum] === 'undefined') this.cats[this_list_cat_time_sum] = 0;
if (typeof this.cats[this_list_cat_counts] === 'undefined') this.cats[this_list_cat_counts] = 0;
this.cats[this_list_cat_time_sum] += this.list[index].time;
this.cats[this_list_cat_counts]++;
if (benchmarkGlob.length > 0) {
this.list[index].benchmarkGlob_index = lastCompletedBenchmark;
}
};
Benchmark.prototype.clear = function () {
this.list = [];
this.cats = [];
this.cats.arr = [];
this.includeSVG = true;
};
Benchmark.prototype.print = function (all) {
var i, tbl = '<table class="bench"><thead><tr><th>Num</th><th>Name</th><th>Category</th><th>Time</th></tr></thead><tbody>';
if (!_.isEmpty(this.list)) {
var startIndex = 0;
if (!all) {
startIndex = benchmarkGlob.length ? this.list.length - 3 : this.list.length - 16;
if (startIndex < 0) startIndex = 0;
}
for (i = startIndex; i < this.list.length; i++) {
tbl += '<tr><td>' + (i + 1) + '</td><td>' + this.list[i].name + '</td><td>' + this.list[i].cat + '</td><td>' + this.list[i].time + '</td></tr>';
}
}
tbl += '</tbody></table>';
this.totals = '';
this.totals_arr = [];
var tbl2 = '<table class="bench"><thead><tr><th>Num</th><th>Category</th><th>Calls</th><th>Sum</th><th>Avg</th></tr></thead><tbody>',
totals_arr_item = [],
item,
counts_sum = 0,
cat_time_sum = 0,
this_list_i_cat, this_list_i_cat_time_sum, this_list_i_cat_counts;
if (this.cats.arr.length > 0)
for (i = 0; i < this.cats.arr.length; i++) {
tbl2 += '<tr><td> ' + (i + 1) + '</td><td>';
this_list_i_cat = this.cats.arr[i];
tbl2 += this_list_i_cat;
tbl2 += '</td><td>';
this_list_i_cat_counts = this.cats[this_list_i_cat + '_counts'];
tbl2 += this_list_i_cat_counts;
counts_sum += this_list_i_cat_counts;
tbl2 += '</td><td>';
this_list_i_cat_time_sum = this.cats[this_list_i_cat + '_time_sum'];
tbl2 += this_list_i_cat_time_sum;
cat_time_sum += this_list_i_cat_time_sum;
tbl2 += '</td><td>';
tbl2 += (this_list_i_cat_time_sum / this_list_i_cat_counts).toFixed(4);
tbl2 += '</td></tr>';
}
tbl2 += '</tbody>';
if (this.cats.arr.length > 0) {
tbl2 += '<tfoot><tr><td colspan="2">Total</td>';
totals_arr_item.push(counts_sum);
this.totals += counts_sum + ';';
tbl2 += '<td>' + counts_sum + '</td>';
totals_arr_item.push(cat_time_sum);
this.totals += cat_time_sum + ';';
tbl2 += '<td>' + cat_time_sum + '</td>';
item = (cat_time_sum / counts_sum).toFixed(4);
totals_arr_item.push(item);
this.totals += item;
tbl2 += '<td style="padding: 4px; background-color: hsl(125, 73%, 80%); border: 3px solid black; font-weight: bold; font-size: 16px;">' + item + '</td>';
tbl2 += '</tr></tfoot>';
}
tbl2 += '</table>';
this.totals_arr.push(totals_arr_item);
tbl += tbl2;
var disabled = benchmarkRunning ? 'disabled' : '';
tbl += '<button ' + disabled + ' onClick="try { bench.clear();$(\'#benchmark_div\').html(bench.print()); } catch (e) {return false}">Clear Benchmarks</button>';
tbl += '<button ' + disabled + ' onClick="try { $(\'#benchmark_div\').html(bench.print(true)); } catch (e) {return false}">Show all</button>';
return tbl;
};
Benchmark.prototype.printMultipleRuns = function () {
var table = '<table class="bench" id="benchmark_multiple_table"><thead><tr><th>Num</th><th>Calls</th><th>Sum</th><th>Avg</th></tr></thead><tbody>';
var i, times = [];
for (i = 0; i < this.totals_arr_multiple.length; i++) {
times.push(this.totals_arr_multiple[i][1]);
}
var max = _.max(times);
var min = _.min(times);
var range = max - min;
var average = +_.average(times).toFixed(4);
var standardDeviation = _.stdDeviation(times).toFixed(4);
var minusRange = min - average;
var plusRange = max - average;
for (i = 0; i < this.totals_arr_multiple.length; i++) {
table += '<tr><td>';
table += (i + 1);
table += '</td><td>';
table += this.totals_arr_multiple[i][0];
table += '</td><td>';
table += this.totals_arr_multiple[i][1];
table += '</td><td>';
table += this.totals_arr_multiple[i][2];
table += '</td></tr>';
}
table += '<tr><td colspan="4" id="benchmark_multiple_status" style="display:none"></td></tr>';
if (!isNaN(average)) {
table += '<tr><td colspan="4">';
table += '<b>Average:</b> ' + average + ' ms<br>';
table += '<b>Min:</b> ' + min + ' ms<br>';
table += '<b>Max:</b> ' + max + ' ms<br>';
table += '<b>Range:</b> ' + range.toFixed(4) + ' ms<br>';
table += '<b>Minus-Range:</b> ' + minusRange.toFixed(4) + ' ms<br>';
table += '<b>Plus-Range:</b> ' + plusRange.toFixed(4) + ' ms<br>';
table += '<b>Stdev:</b> ' + standardDeviation + ' ms<br>';
table += '<b>Range/Average %:</b> ' + (range / average * 100).toFixed(4) + '<br>';
table += '<b>Minus-Range/Average %:</b> ' + (minusRange / average * 100).toFixed(4) + '<br>';
table += '<b>Plus-Range/Average %:</b> ' + (plusRange / average * 100).toFixed(4) + '<br>';
table += '<b>Stdev/Average %:</b> ' + (standardDeviation / average * 100).toFixed(4) + '<br>';
table += '</td></tr>';
}
table += '</tbody>';
return table;
};
function colorizeBoxes() {
var bgColor = new RGBColor($('#p').css('background-color')),
fillColor, strokeColor, fillOpacity, strokeOpacity;
for (var i = 1; i <= 3; i++) {
fillColor = new RGBColor($('#p' + i).css('fill'));
fillOpacity = $('#p' + i).css('fill-opacity');
fillColor = fillColor.flattenRGBA(fillOpacity, bgColor);
strokeColor = new RGBColor($('#p' + i).css('stroke'));
strokeOpacity = $('#p' + i).css('stroke-opacity');
strokeColor = strokeColor.flattenRGBA(strokeOpacity, bgColor);
$('#' + ['subject', 'clip', 'solution'][i - 1] + '_box').css('background-color', fillColor);
}
}
function bindHelp() {
$('#help_custom_polygon').click(function () {
var txt = 'A) You can add your own custom polygons in several formats:\n\n';
txt += '1) The program uses as an inner default the following format: JSON-stringified array of arrays of point objects eg. [[{"X":100,"Y":100},{"X":200,"Y":100},{"X":200,"Y":200},{"X":100,"Y":200}],[{"X":110,"Y":110},{"X":210,"Y":110},{"X":210,"Y":210},{"X":110,"Y":210}]]. This format allows to input sub polygons. Each sub polygon is an array of point objects. This format makes it easy to transfer polygons to other programs that use Clipper library and is suitable for storing polygons in database.\n\n';
txt += '2) JSON-stringified array of point objects eg. [{"X":100,"Y":100},{"X":200,"Y":100},{"X":200,"Y":200},{"X":100,"Y":200}]. This format doesn\'t allow to input sub polygons.\n\n';
txt += '3) JSON-stringified array of arrays of coordinates without "X" and "Y" eg. [[100,100,200,100,200,200,100,200],[110,110,210,110,210,210,110,210]]. This format allows to input sub polygons. Each sub polygon is an array of coordinates so that each x coordinate is followed by an y coordinate. This format makes it easy to transfer polygons to other programs that use Clipper library and is suitable for storing polygons in database.\n\n';
txt += '4) JSON-stringified array of x and y coordinates eg. [100,100,200,100,200,200,100,200] or [100 100 200 100 200 200 100 200] or [100 100,200 100,200 200,100 200] or the same without []:s. This format doesn\'t allow to input sub polygons.\n\n';
txt += '5) SVG path strings with commands MLVHZ or mlvhz eg. M100,100 L200,100 L200,200 L100,200Z M110,110 L210,110 L210,210 L110,210Z. This format allows to input sub polygons. Each subpolygon starts with M (moveto) command.\n\n';
txt += 'B) Custom polygons are saved in browser\'s Local Storage, so they should be tolerant for page reload and browser crashes.';
alert(txt);
});
$('#help_builtin_polygon_sets').click(function() {
var txt = 'Builtin polygon sets\n\n';
txt += 'You can add builtin polygon sets into Subj and Clip input fields to edit copies of them.\n\n';
txt += 'Note! Before saving, nothing happens. After saving, the SVG window is also updated.';
alert(txt);
});
$('#help_output_format').click(function() {
var txt = 'Output format\n\n';
txt += 'To change the polygon coordinate output format please use the above dropdown. The available formats are:\n\n';
txt += '- Clipper: [[{"X":100,"Y":100},{"X":200,"Y":200}]]\n\n';
txt += '- Plain: [[100,100,200,200]]\n\n';
txt += '- SVG: M100,100L200,200Z\n\n';
txt += 'There are two places where this has effect: 1) the above text box 2) the Subj and Clip text boxes in Custom Polygon fieldset.';
alert(txt);
});
}
function bindInputListeners() {
// reveal custom fieldsets
$('input[type="radio"][name="polygons"]').change(function () {
var val = _.parseInt($(this).val());
$('#custom_polygons_fieldset, #random_polygons_fieldset').hide();
if (val === 10) {
$('#custom_polygons_fieldset').show();
updateCustomPolygonsSelect();
$('#custom_polygons_select').change();
}
if (val === 4 || val === 5) {
$('#random_polygons_fieldset').show();
randomSettings.current = (val === 4) ? 'rect' : 'norm';
var r = randomSetting, rs = randomSettings;
// Test for ranges
if (r.clipPointCount < rs[rs.current].min.clipPointCount) r.clipPointCount = rs[rs.current].min.clipPointCount;
if (r.clipPointCount > rs[rs.current].max.clipPointCount) r.clipPointCount = rs[rs.current].max.clipPointCount;
$('#clip_point_count').val(r.clipPointCount);
if (r.clipPolygonCount < rs[rs.current].min.clipPolygonCount) r.clipPolygonCount = rs[rs.current].min.clipPolygonCount;
if (r.clipPolygonCount > rs[rs.current].max.clipPolygonCount) r.clipPolygonCount = rs[rs.current].max.clipPolygonCount;
$('#clip_polygon_count').val(r.clipPolygonCount);
if (r.subjPointCount < rs[rs.current].min.subjPointCount) r.subjPointCount = rs[rs.current].min.subjPointCount;
if (r.subjPointCount > rs[rs.current].max.subjPointCount) r.subjPointCount = rs[rs.current].max.subjPointCount;
$('#subj_point_count').val(r.subjPointCount);
if (r.subjPolygonCount < rs[rs.current].min.subjPolygonCount) r.subjPolygonCount = rs[rs.current].min.subjPolygonCount;
if (r.subjPolygonCount > rs[rs.current].max.subjPolygonCount) r.subjPolygonCount = rs[rs.current].max.subjPolygonCount;
$('#subj_polygon_count').val(r.subjPolygonCount);
subj.random = getRandomPolygons('subj', val);
clip.random = getRandomPolygons('clip', val);
}
makeClip();
});
$('#generate_random_polygons').hold(function () {
subj.random = getRandomPolygons('subj');
clip.random = getRandomPolygons('clip');
makeClip();
});
// Select dropdown
$('#sample_custom_polygon').change(function () {
var polygon = _.parseInt($(this).val());
var subj = '', clip = '';
dontRoundAndScale = true;
if(polygon !== 4 && polygon !== 5) {
subj = deserializeClipperPolygon(defaultPolygons[polygon].subj);
clip = deserializeClipperPolygon(defaultPolygons[polygon].clip);
} else {
subj = getRandomPolygons('subj', polygon);
clip = getRandomPolygons('clip', polygon);
}
dontRoundAndScale = false;
if (subj !== '') subj = JSON.stringify(subj);
if (clip !== '') clip = JSON.stringify(clip);
$('#custom_polygon_subj').val(formatOutput(subj));
$('#custom_polygon_clip').val(formatOutput(clip));
});
$('#save_custom_polygon').click(function () {
var subj = normalizeClipperPolygons($('#custom_polygon_subj').val());
var clip = normalizeClipperPolygons($('#custom_polygon_clip').val());
if (subj === false || clip === false) return false;
var value = _.parseInt($('#custom_polygons_select').val());
if (value) {
saveCustomPolygon({
subj: subj,
clip: clip
}, value);
alert('Polygon ' + value + ' updated!');
} else if (value === 0) {
alert('The default custom polygon cannot be overwrited. If you want to modify it, save it first as a new.');
}
else alert('Polygon update failed!');
});
$('#add_as_new_custom_polygon').click(function () {
var subj = normalizeClipperPolygons($('#custom_polygon_subj').val());
var clip = normalizeClipperPolygons($('#custom_polygon_clip').val());
if (subj === false || clip === false) return false;
var customPolygons = saveCustomPolygon({
subj: subj,
clip: clip
});
$('#custom_polygons_select').val(customPolygons.length - 1).change();
alert('New polygon ' + (customPolygons.length - 1) + ' added!');
});
$('#custom_polygons_select').change(function () {
var value = _.parseInt($('#custom_polygons_select').val());
var customPolygons = $.totalStorage('custom_polygons');
if (_.isArray(customPolygons) && customPolygons[value]) {
$('#custom_polygon_subj').val(formatOutput(customPolygons[value].subj));
$('#custom_polygon_clip').val(formatOutput(customPolygons[value].clip));
makeClip();
}
});
$('#remove_custom_polygon').click(function () {
var value = _.parseInt($('#custom_polygons_select').val());
if (value === 0) {
alert('Cannot remove the default polygon.');
} else if (value) {
if (confirm('Remove custom polygon ' + value + '?')) {
saveCustomPolygon(null, value);
}
}
});
$('#removeall_custom_polygon').click(function () {
var count = $('#custom_polygons_select option').length;
if (count > 1) {
if (confirm('Remove all ' + (count -1) + ' custom polygons?')) {
setDefaultCustomPolygons(true);
}
}
});
// Subject FillType
$('input[name="subject_fillType"]').change(function () {
subj.fillType = _.parseInt(this.value);
makeClip();
});
// Clip FillType
$('input[name="clip_fillType"]').change(function () {
clip.fillType = _.parseInt(this.value);
makeClip();
});
// Clip type (operation)
$('input[name="clipType"]').change(function () {
offsettablePoly = $('input[name="clipType"][value=""]').is(':checked') ? 'subject' : 'solution';
$('input[name="offsettable_poly"][value="' + offsettablePoly + '"]').prop('checked', true);
clipType = $('input[name="clipType"]:checked').val();
if (clipType !== '') clipType = _.parseInt(clipType);
makeClip();
});
// Cleaning and simplifying
$('#clean').change(function () {
clean = $(this).prop('checked');
if (clean && !$('#cleandelta').val()+''.trim()) {
cleanDelta = cleanDeltaDefault;
$('#cleandelta').val(cleanDelta);
}
makeClip();
});
$('#cleandelta').change(function () {
var value = parseFloat(this.value);
if (!isNaN(value)) cleanDelta = value;
makeClip();
});
$('#simplify').change(function () {
simplify = $(this).prop('checked');
makeClip();
});
$('#lighten').change(function () {
lighten = $(this).prop('checked');
if (lighten && !$('#lighten_distance').val()+''.trim()) {
lightenDistance = lightenDistanceDefault;
$('#lighten_distance').val(lightenDistance);
}
makeClip();
});
$('#lighten_distance').change(function () {
var value = parseFloat(this.value);
if (!isNaN(value)) lightenDistance = value;
makeClip();
});
// Offsetting
$('input[name="offsettable_poly"]').change(function () {
offsettablePoly = this.value;
// When offsettable poly is set to Subject or Clip, then boolean operations are not done.
// To show this to user, set clipType to "No"
if (offsettablePoly === 'subject' || offsettablePoly === 'clip') {
$('input[name="clipType"][value=""]').prop('checked', true);
clipType = '';
}
makeClip();
});
$('input[name="joinType"]').change(function () {
joinType = _.parseInt(this.value);
makeClip();
});
function getDeltaChanger(direction) {
return function () {
var original = $('#delta').val();
if (!isNaN(original)) delta = parseFloat(original);
delta += direction;
makeClip();
};
}
$('#delta_minus').hold(getDeltaChanger(-1));
$('#delta').change(getDeltaChanger(0));
$('#delta_plus').hold(getDeltaChanger(1));
function getMiterChanger(direction) {
return function() {
var original = $('#miterLimit').val();
if (!isNaN(original)) miterLimit = parseFloat(original);
miterLimit += direction;
if (miterLimit < 1.0) miterLimit = 1.0;
makeClip();
};
}
$('#miterLimit_minus').hold(getMiterChanger(-0.1));
$('#miterLimit').change(getMiterChanger(0));
$('#miterLimit_plus').hold(getMiterChanger(0.1));
$('#autoFix').change(function () {
autoFix = $(this).prop('checked');
makeClip();
});