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
|
#include "contour_test.h"
#include "canvas.h"
using namespace contour;
std::string to_string(const std::pair<Tri, Tri>& p) {
return to_string(p.first) + std::string(";") + to_string(p.second);
}
using std::to_string;
template <typename TT, typename = void>
struct has_to_string : std::false_type {};
template<typename TT>
struct has_to_string<TT, std::void_t<decltype(to_string(std::declval<TT>()))>> : std::true_type {};
template <typename TT, typename = void>
struct has_Dump_member : std::false_type {};
template<typename TT>
struct has_Dump_member<TT, std::void_t<decltype(std::declval<TT>().Dump())>> : std::true_type {};
constexpr auto equal = [](auto& a, auto& b) {return a==b; };
template <typename T, typename pred=decltype(equal)>
void TAssert(std::vector<std::pair<std::string, bool>>& ret,
const T& value, const T& should_be, std::string_view text,
pred pass = equal) {
if (!shall_draw()) return;
if (pass(value, should_be)) ret.emplace_back(std::string(text)+" - PASS", true);
else if constexpr (has_to_string<T>::value)
ret.emplace_back(std::string(text)+" "+to_string(value)+"!="+to_string(should_be), false);
else if constexpr (has_Dump_member<T>::value)
ret.emplace_back(std::string(text)+" "+value.Dump()+"!="+should_be.Dump(), false);
else if constexpr (std::is_convertible_v<T, std::string>)
ret.emplace_back(std::string(text)+" "+(std::string)value+"!="+(std::string)should_be, false);
else
ret.emplace_back(std::string(text)+" FAIL values mismatch", false);
}
void BAssert(std::vector<std::pair<std::string, bool>>& ret, bool pass, std::string_view text) {
if (!shall_draw()) return;
if (pass) ret.emplace_back(std::string(text)+" - PASS", true);
else ret.emplace_back(std::string(text)+" FAIL", false);
}
void DAssert(std::vector<std::pair<std::string, bool>>& ret, double A, double B, std::string_view text) {
TAssert(ret, A, B, text, &test_equal<double, double>);
}
std::string to_string(const std::vector<CPData>& cps) {
std::string ret;
for (auto& cp : cps)
ret.append(cp.Dump(false)).append("; ");
if (ret.size())
ret.pop_back();
return ret;
}
//Asserts that 'c' holds a simple contour with no holes and returns it.
const SimpleContour& GetSC(std::vector<std::pair<std::string, bool>>& ret, const Contour& c, std::string_view txt) {
BAssert(ret, c.size()==1, std::string(txt)+": is a single simplecontour 1");
BAssert(ret, !c[0].HasHoles(), std::string(txt)+": is a single simplecontour 2");
return c[0].Outline();
}
void AssertContainment(std::vector<std::pair<std::string, bool>>& R, const Contour& c, const Contour& d,
contour::EContourRelationType rel, std::string_view txt) {
using namespace contour;
EContourRelationType irel = switch_side(rel);
const SimpleContour& sc = GetSC(R, c, std::string(txt)+" 1");
const SimpleContour& dc = GetSC(R, d, std::string(txt)+" 2");
BAssert(R, sc.CheckContainment(dc)==rel, std::string(txt)+" res 1");
BAssert(R, dc.CheckContainment(sc)==irel, std::string(txt)+" res 2");
BAssert(R, dc.CheckContainment(sc.CreateInvert())==irel, std::string(txt)+" res 3");
BAssert(R, sc.CheckContainment(dc.CreateInvert())==rel, std::string(txt)+" res 3");
BAssert(R, sc.CreateInvert().CheckContainment(dc.CreateInvert())==rel, std::string(txt)+" res 4");
BAssert(R, dc.CreateInvert().CheckContainment(sc.CreateInvert())==irel, std::string(txt)+" res 5");
BAssert(R, sc.RelationTo(dc)==rel, std::string(txt)+" rel 1");
BAssert(R, dc.RelationTo(sc)==irel, std::string(txt)+" rel 2");
BAssert(R, dc.RelationTo(sc.CreateInvert())==irel, std::string(txt)+" rel 3");
BAssert(R, sc.RelationTo(dc.CreateInvert())==rel, std::string(txt)+" rel 3");
BAssert(R, sc.CreateInvert().RelationTo(dc.CreateInvert())==rel, std::string(txt)+" rel 4");
BAssert(R, dc.CreateInvert().RelationTo(sc.CreateInvert())==irel, std::string(txt)+" rel 5");
}
void UnionAssert(std::vector<std::pair<std::string, bool>>& R, const Contour& c, const Contour& d, std::string_view text) {
const Block est_bb = c.GetBoundingBox()+d.GetBoundingBox();
_SUPPRESS_ASSERT_PRINT;
const Contour U = c+d;
const Block bb = U.GetBoundingBox();
BAssert(R, fabs(est_bb.x.from-bb.x.from)+fabs(est_bb.y.from-bb.y.from)+fabs(est_bb.x.till-bb.x.till)+fabs(est_bb.y.till-bb.y.till)<1,
std::string(text)+": Not equal BB after positive union."+ bb.Dump(false)+" instead of "+est_bb.Dump(false));
}
//This assumes the intersect is not empty. If it should be that is easy to assert as such without this fn.
void IntersectAssert(std::vector<std::pair<std::string, bool>>& R, const Contour& c, const Contour& d, std::string_view text) {
const Block est_bb = c.GetBoundingBox()*d.GetBoundingBox();
_SUPPRESS_ASSERT_PRINT;
const Contour U = c*d;
const Block bb = U.GetBoundingBox();
BAssert(R, std::max(0., est_bb.x.from-bb.x.from)+std::max(0., est_bb.y.from-bb.y.from)+std::max(0., bb.x.till-est_bb.x.till)+std::max(0., bb.y.till-est_bb.y.till)<1,
std::string(text)+": Not smaller BB after positive intersect."+ bb.Dump(false)+" instead of "+est_bb.Dump(false));
BAssert(R, !U.IsEmpty(), std::string(text)+": Empty intersect.");
}
/** Here we test simple stuff in code.*/
void contour_unit_tests(bool do_image) {
if (shouldnt_do(0)) return;
using namespace std::literals;
std::vector<std::pair<std::string, bool>> R;
//Test MovePos and LinearExtend on flattened beziers.
Edge e(XY(176, 83), XY(92, 84), XY(176, 83), XY(126, 84)), f(e);
const double pos = e.MovePos2(0, 10);
f.Chop(0, pos);
DAssert(R, f.GetLength(), 10, "Chop length");
e.Chop(pos, 1);
auto [b, e2] = e.LinearExtend(10, false, true);
XY xy = b ? e2.GetStart() : e.GetStart(); //shall be close to (176,83)
TAssert(R, xy, XY(176, 83), "LinearExtend", [](const XY& a, const XY& b) {return a.test_equal(b, 0.01); });
Contour c, d;
Path p, l;
Edge ee, ff;
std::vector<CPData> cps;
bool r;
CPData cp;
//Test Crosspoints
c = Contour(0, 10, 0, 10);
p = {XY{0,0}, XY(0,10), XY(10,10)};
TAssert(R, to_string(c.CrossPoints(p, true, nullptr, CalcRelation)),
"XY(10,10)[(2:0),(1:1),overlap:opp:p2_ends]; XY(0,0)[(3:1),(0:0),overlap:opp:p2_ends];"s,
"CrossPoint: along box"sv);
p = {XY{0,0}, XY(10,0), XY(10,10)};
TAssert(R, to_string(c.CrossPoints(p, true, nullptr, CalcRelation)),
"XY(10,10)[(2:0),(1:1),overlap:p2_ends]; XY(0,0)[(3:1),(0:0),overlap:p2_ends];"s,
"CrossPoint: along box opposite dir"sv);
l = {XY{0,0}, XY{100,0}};
p = {XY{0,0}, XY{50,0}, XY{100, -10}};
TAssert(R, to_string(l.CrossPoints(true, nullptr, p, false, nullptr, CalcRelation)),
"XY(0,0)[(0:0),(0:0),overlap:both_end]; XY(50,0)[(0:0.5),(1:0),fork:bw:bw:l:r];"s,
"CrossPoint: Along and leave left"sv);
p = {XY{0,0}, XY{50,0}, XY{100, +10}};
TAssert(R, to_string(l.CrossPoints(true, nullptr, p, false, nullptr, CalcRelation)),
"XY(0,0)[(0:0),(0:0),overlap:both_end]; XY(50,0)[(0:0.5),(1:0),fork:bw:bw:r:l];"s,
"CrossPoint: Along and leave right"sv);
p = {XY{100, -10}, XY{50,0}, XY{0,0}};
TAssert(R, to_string(l.CrossPoints(true, nullptr, p, false, nullptr, CalcRelation)),
"XY(0,0)[(0:0),(1:1),overlap:opp:both_end]; XY(50,0)[(0:0.5),(1:0),fork:bw:fw:l:l:opp];"s,
"CrossPoint: Along and leave right opposite"sv);
p = {XY{100, +10}, XY{50,0}, XY{0,0}};
TAssert(R, to_string(l.CrossPoints(true, nullptr, p, false, nullptr, CalcRelation)),
"XY(0,0)[(0:0),(1:1),overlap:opp:both_end]; XY(50,0)[(0:0.5),(1:0),fork:bw:fw:r:r:opp];"s,
"CrossPoint: Along and leave left opposite"sv);
p = {XY{0, +10}, XY{50,0}, XY{100,+10}};
TAssert(R, to_string(l.CrossPoints(true, nullptr, p, false, nullptr, CalcRelation)),
"XY(50,0)[(0:0.5),(1:0),touch:r:l];"s,
"CrossPoint: touch from right"sv);
p = {XY{0, -10}, XY{50,0}, XY{100,-10}};
TAssert(R, to_string(l.CrossPoints(true, nullptr, p, false, nullptr, CalcRelation)),
"XY(50,0)[(0:0.5),(1:0),touch:l:r];"s,
"CrossPoint: touch from left"sv);
p = {XY{0,0}, XY{50,0}, XY{40,-10}, XY{60,-10}, XY{50,0}, XY{100,0}};
TAssert(R, to_string(l.CrossPoints(true, nullptr, p, false, nullptr, CalcRelation)),
"XY(0,0)[(0:0),(0:0),overlap:both_end]; XY(50,0)[(0:0.5),(1:0),fork:bw:bw:l:r]; XY(50,0)[(0:0.5),(4:0),fork:fw:fw:l:r]; XY(100,0)[(0:1),(4:1),overlap:both_end];"s,
"CrossPoint: Along, leave to left, join back at same point"sv);
p = {XY{0,0}, XY{50,0}, XY{40,+10}, XY{60,+10}, XY{50,0}, XY{100,0}};
TAssert(R, to_string(l.CrossPoints(true, nullptr, p, false, nullptr, CalcRelation)),
"XY(0,0)[(0:0),(0:0),overlap:both_end]; XY(50,0)[(0:0.5),(1:0),fork:bw:bw:r:l]; XY(50,0)[(0:0.5),(4:0),fork:fw:fw:r:l]; XY(100,0)[(0:1),(4:1),overlap:both_end];"s,
"CrossPoint: Along, leave to right, join back at same point"sv);
l = {XY{100,0}, XY{0,0}};
p = {XY{0,0}, XY{50,0}, XY{100, -10}};
TAssert(R, to_string(l.CrossPoints(true, nullptr, p, false, nullptr, CalcRelation)),
"XY(50,0)[(0:0.5),(1:0),fork:fw:bw:r:r:opp]; XY(0,0)[(0:1),(0:0),overlap:opp:both_end];"s,
"CrossPoint: Join from right opposite"sv);
p = {XY{0,0}, XY{50,0}, XY{100, +10}};
TAssert(R, to_string(l.CrossPoints(true, nullptr, p, false, nullptr, CalcRelation)),
"XY(50,0)[(0:0.5),(1:0),fork:fw:bw:l:l:opp]; XY(0,0)[(0:1),(0:0),overlap:opp:both_end];"s,
"CrossPoint: Join from left opposite"sv);
p = {XY{100, -10}, XY{50,0}, XY{0,0}};
TAssert(R, to_string(l.CrossPoints(true, nullptr, p, false, nullptr, CalcRelation)),
"XY(50,0)[(0:0.5),(1:0),fork:fw:fw:r:l]; XY(0,0)[(0:1),(1:1),overlap:both_end];"s,
"CrossPoint: Join from right"sv);
p = {XY{100, +10}, XY{50,0}, XY{0,0}};
TAssert(R, to_string(l.CrossPoints(true, nullptr, p, false, nullptr, CalcRelation)),
"XY(50,0)[(0:0.5),(1:0),fork:fw:fw:l:r]; XY(0,0)[(0:1),(1:1),overlap:both_end];"s,
"CrossPoint: Join from left"sv);
p = {XY{0, +10}, XY{50,0}, XY{100,+10}};
TAssert(R, to_string(l.CrossPoints(true, nullptr, p, false, nullptr, CalcRelation)),
"XY(50,0)[(0:0.5),(1:0),touch:l:l:opp];"s,
"CrossPoint: touch from left opposite"sv);
p = {XY{0, -10}, XY{50,0}, XY{100,-10}};
TAssert(R, to_string(l.CrossPoints(true, nullptr, p, false, nullptr, CalcRelation)),
"XY(50,0)[(0:0.5),(1:0),touch:r:r:opp];"s,
"CrossPoint: touch from right opposite"sv);
p = {XY{0,0}, XY{50,0}, XY{40,-10}, XY{60,-10}, XY{50,0}, XY{100,0}};
TAssert(R, to_string(l.CrossPoints(true, nullptr, p, false, nullptr, CalcRelation)),
"XY(100,0)[(0:0),(4:1),overlap:opp:both_end]; XY(50,0)[(0:0.5),(1:0),fork:fw:bw:r:r:opp]; XY(50,0)[(0:0.5),(4:0),fork:bw:fw:r:r:opp]; XY(0,0)[(0:1),(0:0),overlap:opp:both_end];"s,
"CrossPoint: Along, leave to right, join back at same point opposite"sv);
p = {XY{0,0}, XY{50,0}, XY{40,+10}, XY{60,+10}, XY{50,0}, XY{100,0}};
TAssert(R, to_string(l.CrossPoints(true, nullptr, p, false, nullptr, CalcRelation)),
"XY(100,0)[(0:0),(4:1),overlap:opp:both_end]; XY(50,0)[(0:0.5),(1:0),fork:fw:bw:l:l:opp]; XY(50,0)[(0:0.5),(4:0),fork:bw:fw:l:l:opp]; XY(0,0)[(0:1),(0:0),overlap:opp:both_end];"s,
"CrossPoint: Along, leave to left, join back at same point opposite"sv);
l = {XY{0,0}, XY{50,0}, XY{40,-10}, XY{60,-10}, XY{50,0}, XY{100,0}};
TAssert(R, to_string(l.CrossPoints(true, nullptr, p, false, nullptr, CalcRelation)),
"XY(0,0)[(0:0),(0:0),overlap:both_end]; XY(50,0)[(1:0),(1:0),fork:bw:bw:r:l]; XY(50,0)[(1:0),(4:0),touch:r:l]; XY(50,0)[(4:0),(1:0),touch:r:l]; XY(50,0)[(4:0),(4:0),fork:fw:fw:r:l]; XY(100,0)[(4:1),(4:1),overlap:both_end];"s,
"CrossPoint: Along, leave to left & right, join back at same point"sv);
TAssert(R, to_string(l.CrossPoints(true, nullptr, p, false, nullptr, CalcRelation+OverlapOnly)),
"XY(0,0)[(0:0),(0:0),overlap:both_end]; XY(50,0)[(0:1),(0:1),fork:bw:bw:r:l]; XY(50,0)[(4:0),(4:0),fork:fw:fw:r:l]; XY(100,0)[(4:1),(4:1),overlap:both_end];"s,
"CrossPoint: Along, leave to left & right, join back at same point overlap_only"sv);
//Test degenerate cases
l = Path{XY(0,0), XY(1,1), XY(2,2)};
p = Path{XY(0,0), XY(1,1), XY(0,0)};
TAssert(R, to_string(l.CrossPoints(false, nullptr, p, false, nullptr, CalcRelation)),
"XY(0,0)[(0:0),(0:0),overlap:both_end]; XY(0,0)[(0:0),(1:1),overlap:opp:both_end]; XY(1,1)[(1:0),(1:0),fork:bw:fw:-:-];"s,
"CrossPoint: Degenerate overlap"sv);
l = Path{XY(2,2), XY(1,1), XY(2,2)};
p = Path{XY(0,0), XY(1,1), XY(0,0)};
TAssert(R, to_string(l.CrossPoints(false, nullptr, p, false, nullptr, CalcRelation)),
"XY(1,1)[(1:0),(1:0),cross:?->?:?->?];"s,
"CrossPoint: Degenerate touch"sv);
//Test circular paths. Good behaviour on the start/endpoint, good bool returns
l = {XY(30,0), XY(30, 30), XY(0, 30), XY(0,0), XY(30,0)};
p = {XY(0,0), XY(30,0), XY(30, 30), XY(0, 30), XY(0,0)};
cps.clear();
r = l.CrossPoints(cps, true, nullptr, p, true, nullptr, CalcRelation);
BAssert(R, r, "Crosspoint: same box, cycled - retval");
BAssert(R, std::ranges::all_of(cps, [](const CPData& cp) { return cp.type.rel==CPRel::Overlap; }),
"Crosspoint: same box, cycled - all overlap");
TAssert(R, cps.size(), size_t(4),
"Crosspoint: same box, cycled - #crosspoints");
l = {XY(0,0), XY(10, 0), XY(30,0), XY(30, 30), XY(0, 30), XY(0,0)};
p = {XY(0,0), XY(20, 0), XY(30,0), XY(30, 30), XY(0, 30), XY(0,0)};
cps.clear();
r = l.CrossPoints(cps, true, nullptr, p, true, nullptr, CalcRelation);
BAssert(R, r, "Crosspoint: same box, cut differently - retval");
BAssert(R, std::ranges::all_of(cps, [](const CPData& cp) { return cp.type.rel==CPRel::Overlap; }),
"Crosspoint: same box, cut differently - all overlap");
TAssert(R, cps.size(), size_t(6),
"Crosspoint: same box, cut differently - #crosspoints");
l = {XY(10, 0), XY(30,0), XY(30, 30), XY(0, 30), XY(0,0), XY(10, 0)};
p = {XY(0,0), XY(20, 0), XY(30,0), XY(30, 30), XY(0, 30), XY(0,0)};
cps.clear();
r = l.CrossPoints(cps, true, nullptr, p, true, nullptr, CalcRelation);
BAssert(R, r, "Crosspoint: same box, cut differently & cycled - retval");
BAssert(R, std::ranges::all_of(cps, [](const CPData& cp) { return cp.type.rel==CPRel::Overlap; }),
"Crosspoint: same box, cut differently & cycled - all overlap");
TAssert(R, cps.size(), size_t(6),
"Crosspoint: same box, cut differently & cycled - #crosspoints");
l = p = SimpleContour(0, 30, 0, 30).GetEdges();
p.back().Split(0.333333333333333333333333333333333, ee, ff);
_ASSERT(ee.IsStraight());
_ASSERT(ff.IsStraight());
l.back() = ee;
l.push_back(ff);
p.back().Split(0.666666666666666666666666666666, ee, ff);
_ASSERT(ee.IsStraight());
_ASSERT(ff.IsStraight());
p.back() = ee;
p.push_back(ff);
cps.clear();
r = l.CrossPoints(cps, true, nullptr, p, true, nullptr, CalcRelation);
BAssert(R, r, "Crosspoint: same box2, cut differently - retval");
BAssert(R, std::ranges::all_of(cps, [](const CPData& cp) { return cp.type.rel==CPRel::Overlap; }),
"Crosspoint: same box2, cut differently & cycled - all overlap");
TAssert(R, cps.size(), size_t(6),
"Crosspoint: same box2, cut differently & cycled - #crosspoints");
l = p = SimpleContour(XY(0, 0), 10).GetEdges();
p.back().Split(0.333333333333333333333333333333333, ee, ff);
l.back() = ee;
l.push_back(ff);
p.back().Split(0.666666666666666666666666666666, ee, ff);
p.back() = ee;
p.push_back(ff);
cps.clear();
r = l.CrossPoints(cps, true, nullptr, p, true, nullptr, CalcRelation);
BAssert(R, r, "Crosspoint: same circle, cut differently - retval");
BAssert(R, std::ranges::all_of(cps, [](const CPData& cp) { return cp.type.rel==CPRel::Overlap; }),
"Crosspoint: same same circle, cut differently - all overlap");
TAssert(R, cps.size(), size_t(6),
"Crosspoint: same same circle, cut differently - #crosspoints");
//Actual crossing/touching
c = Block(10, 30, 0, 20);
TAssert(R, to_string(c.CrossPoints(Path{XY(20,10), XY(40,10)}, false, nullptr, CalcRelation)),
"XY(30,10)[(1:0.5),(0:0.5),cross:r->l:l->r];"s,
"CrossPoint: Cross out of box"sv);
TAssert(R, to_string(c.CrossPoints(Path{XY(0,10), XY(20,10)}, false, nullptr, CalcRelation)),
"XY(10,10)[(3:0.5),(0:0.5),cross:l->r:r->l];"s,
"CrossPoint: Cross into box"sv);
TAssert(R, to_string(c.CrossPoints(Path{XY(10,10), XY(20,10)}, false, nullptr, CalcRelation)),
"XY(10,10)[(3:0.5),(0:0),touch:r:-:p2_ends];"s,
"CrossPoint: Touch into box"sv);
TAssert(R, to_string(c.CrossPoints(Path{XY(30,10), XY(40,10)}, false, nullptr, CalcRelation)),
"XY(30,10)[(1:0.5),(0:0),touch:l:-:p2_ends];"s,
"CrossPoint: Touch out of box"sv);
TAssert(R, to_string(c.CrossPoints(Path{XY(20,-10), XY(40,10)}, false, nullptr, CalcRelation)),
"XY(30,0)[(1:0),(0:0.5),touch:l:r];"s,
"CrossPoint: Touch outside of box"sv);
//Test Leave/Enter
c = Block(-30, 0, -15, +15);
cp = c.CrossPoints(SimpleContour(XY(10, 0), 10), CalcRelation).front();
TAssert(R, std::pair(cp.enters(true), cp.leaves(true)), std::pair(Tri::True, Tri::True),
"CrossPoint: Leave/Enter: touch outside 1"sv);
TAssert(R, std::pair(cp.enters(), cp.leaves()), std::pair(Tri::False, Tri::False),
"CrossPoint: Leave/Enter: touch outside 2"sv);
cp = c.CrossPoints(SimpleContour(XY(-10, 0), 10), CalcRelation).front();
TAssert(R, std::pair(cp.enters(true), cp.leaves(true)), std::pair(Tri::False, Tri::False),
"CrossPoint: Leave/Enter: touch inside 1"sv);
TAssert(R, std::pair(cp.enters(), cp.leaves()), std::pair(Tri::True, Tri::True),
"CrossPoint: Leave/Enter: touch inside 2"sv);
cp = c.CrossPoints(Edge(XY(-5, 0), XY(0, 0)), CalcRelation).front();
TAssert(R, std::pair(cp.enters(true), cp.leaves(true)), std::pair(Tri::False, Tri::False),
"CrossPoint: Leave/Enter: end inside 1"sv);
TAssert(R, std::pair(cp.enters(), cp.leaves()), std::pair(Tri::False, Tri::True),
"CrossPoint: Leave/Enter: end inside 2"sv);
cp = c.CrossPoints(Edge(XY(0, 0), XY(-5, 0)), CalcRelation).front();
TAssert(R, std::pair(cp.enters(true), cp.leaves(true)), std::pair(Tri::False, Tri::False),
"CrossPoint: Leave/Enter: start inside 1"sv);
TAssert(R, std::pair(cp.enters(), cp.leaves()), std::pair(Tri::True, Tri::False),
"CrossPoint: Leave/Enter: start inside 2"sv);
cp = c.CrossPoints(Edge(XY(+5, 0), XY(0, 0)), CalcRelation).front();
TAssert(R, std::pair(cp.enters(true), cp.leaves(true)), std::pair(Tri::True, Tri::False),
"CrossPoint: Leave/Enter: end outside 1"sv);
TAssert(R, std::pair(cp.enters(), cp.leaves()), std::pair(Tri::False, Tri::False),
"CrossPoint: Leave/Enter: end outside 2"sv);
cp = c.CrossPoints(Edge(XY(0, 0), XY(+5, 0)), CalcRelation).front();
TAssert(R, std::pair(cp.enters(true), cp.leaves(true)), std::pair(Tri::False, Tri::True),
"CrossPoint: Leave/Enter: start outside 1"sv);
TAssert(R, std::pair(cp.enters(), cp.leaves()), std::pair(Tri::False, Tri::False),
"CrossPoint: Leave/Enter: start outside 2"sv);
cp = c.CrossPoints(Edge(XY(-5, 0), XY(+5, 0)), CalcRelation).front();
TAssert(R, std::pair(cp.enters(true), cp.leaves(true)), std::pair(Tri::False, Tri::True),
"CrossPoint: Leave/Enter: crosses out 1"sv);
TAssert(R, std::pair(cp.enters(), cp.leaves()), std::pair(Tri::False, Tri::True),
"CrossPoint: Leave/Enter: crosses out 1"sv);
cp = c.CrossPoints(Edge(XY(+5, 0), XY(-5, 0)), CalcRelation).front();
TAssert(R, std::pair(cp.enters(true), cp.leaves(true)), std::pair(Tri::True, Tri::False),
"CrossPoint: Leave/Enter: crosses in 1"sv);
TAssert(R, std::pair(cp.enters(), cp.leaves()), std::pair(Tri::True, Tri::False),
"CrossPoint: Leave/Enter: crosses in 2"sv);
cp = c.CrossPoints(Path{XY(+5, -5), XY(0,0), XY(0, +5)}, false, nullptr, CalcRelation).front();
TAssert(R, std::pair(cp.enters(true), cp.leaves(true)), std::pair(Tri::True, Tri::False),
"CrossPoint: Leave/Enter: joins from outside 1"sv);
TAssert(R, std::pair(cp.enters(), cp.leaves()), std::pair(Tri::False, Tri::False),
"CrossPoint: Leave/Enter: joins from outside 2"sv);
cp = c.CrossPoints(Path{XY(-5, -5), XY(0,0), XY(0, +5)}, false, nullptr, CalcRelation).front();
TAssert(R, std::pair(cp.enters(true), cp.leaves(true)), std::pair(Tri::False, Tri::False),
"CrossPoint: Leave/Enter: joins from inside 1"sv);
TAssert(R, std::pair(cp.enters(), cp.leaves()), std::pair(Tri::False, Tri::True),
"CrossPoint: Leave/Enter: joins from inside 2"sv);
cp = c.CrossPoints(Path{XY(0, -5), XY(0,0), XY(+5, +5)}, false, nullptr, CalcRelation).back();
TAssert(R, std::pair(cp.enters(true), cp.leaves(true)), std::pair(Tri::False, Tri::True),
"CrossPoint: Leave/Enter: leaves on the outside 1"sv);
TAssert(R, std::pair(cp.enters(), cp.leaves()), std::pair(Tri::False, Tri::False),
"CrossPoint: Leave/Enter: leaves on the outside 2"sv);
cp = c.CrossPoints(Path{XY(0, -5), XY(0,0), XY(-5, +5)}, false, nullptr, CalcRelation).back();
TAssert(R, std::pair(cp.enters(true), cp.leaves(true)), std::pair(Tri::False, Tri::False),
"CrossPoint: Leave/Enter: leaves on the inside 1"sv);
TAssert(R, std::pair(cp.enters(), cp.leaves()), std::pair(Tri::True, Tri::False),
"CrossPoint: Leave/Enter: leaves on the inside 2"sv);
//Check containment
c.assign(Path{XY(0,0), XY(10,0), XY(10,10), XY(0,10), XY(0,0)});
d.assign(Path{XY(0,10), XY(0,0), XY(10,0), XY(10,10), XY(0,10)});
AssertContainment(R, c, d, contour::EContourRelationType::REL_SAME, "Containment: rectangle");
d.assign(Path{XY(0,0), XY(5,0), XY(5,5), XY(10, 5), XY(10,10), XY(0,10), XY(0,0)}); //rectangle missing its upper-left corner
AssertContainment(R, c, d, contour::EContourRelationType::REL_B_INSIDE_A, "Containment: rect vs L-shape");
AssertContainment(R, c.CreateShifted(XY(10, 0)), d, contour::EContourRelationType::REL_APART, "Containment: rect beside L-shape");
p = Path{XY(10,0), XY(20,0), XY(20,10), XY(10,10), XY(10,0)}; //rectangle shifted left by 10 pixels
for (int i = 0; i<4; i++) {
std::rotate(p.begin(), p.begin()+3, p.end());
d.assign(p);
AssertContainment(R, c, d, contour::EContourRelationType::REL_APART, "Containment: 2 rects side-by-side "+std::to_string(i+1));
}
{
Contour A(Path{
Edge(XY(0x1.e3eb851eb852p+6,0x1.28p+4), XY(0x1.e3eb851eb852p+6,0x1.bp+3)),
Edge(XY(0x1.e3eb851eb852p+6,0x1.bp+3), XY(0x1.04f5c28f5c29p+7,0x1.38p+4)),
Edge(XY(0x1.04f5c28f5c29p+7,0x1.38p+4), XY(0x1.e3eb851eb852p+6,0x1.98p+4)),
Edge(XY(0x1.e3eb851eb852p+6,0x1.98p+4), XY(0x1.e3eb851eb852p+6,0x1.48p+4)),
Edge(XY(0x1.e3eb851eb852p+6,0x1.48p+4), XY(0x1.2ap+6,0x1.48p+4)),
Edge(XY(0x1.2ap+6,0x1.48p+4), XY(0x1.2ap+6,0x1.28p+4)),
Edge(XY(0x1.2ap+6,0x1.28p+4), XY(0x1.e3eb851eb852p+6,0x1.28p+4)),
}, ECloseType::IGNORE_OPEN_PATH, EForceClockwise::DONT);
Contour B(Path{
Edge(XY(0x1.32p+6,0x1p+1), XY(0x1.e3eb851eb851fp+6,0x1p+1)),
Edge(XY(0x1.e3eb851eb851fp+6,0x1p+1), XY(0x1.e3eb851eb851fp+6,0x1.2p+4)),
Edge(XY(0x1.e3eb851eb851fp+6,0x1.2p+4), XY(0x1.32p+6,0x1.2p+4)),
Edge(XY(0x1.32p+6,0x1.2p+4), XY(0x1.32p+6,0x1p+1)),
}, ECloseType::IGNORE_OPEN_PATH, EForceClockwise::DONT);
TAssert(R, GetSC(R, A, "Relation 1A").RelationTo(GetSC(R, B, "Relation 1B")), REL_APART,
"Relation 1C");
}
{
constexpr double ratio = 3/7.;
XY A(50, 90), B(40, 20), M = Mid(A, B, ratio);
XY p; double pos;
const double d = SectionPointDistance(A, B, M, &p, &pos);
DAssert(R, d, 0, "SectionPointDistance 1");
DAssert(R, pos, ratio, "SectionPointDistance 2");
DAssert(R, M.x, p.x, "SectionPointDistance 3a");
DAssert(R, M.y, p.y, "SectionPointDistance 3b");
}
{
Contour A(Path{
Edge(XY(0x1.58p+6,0x1.c6p+8), XY(0x1.2e46c20c80876p+8,0x1.9c1e16bcfe62p+8)),
Edge(XY(0x1.2e46c20c80876p+8,0x1.9c1e16bcfe62p+8), XY(0x1.2b02887b796bfp+8,0x1.99p+8)),
Edge(XY(0x1.2b02887b796bfp+8,0x1.99p+8), XY(0x1.3e6p+8,0x1.99p+8)),
Edge(XY(0x1.3e6p+8,0x1.99p+8), XY(0x1.384898d2a6a12p+9,0x1.c68cd8241f1p+8)),
Edge(XY(0x1.384898d2a6a12p+9,0x1.c68cd8241f1p+8), XY(0x1.43p+9,0x1.d6p+8), XY(0x1.3e74f7f7abc53p+9,0x1.c862ef133d1bdp+8), XY(0x1.43p+9,0x1.ce9b98a76f47fp+8)),
Edge(XY(0x1.43p+9,0x1.d6p+8), XY(0x1.348p+9,0x1.e6p+8), XY(0x1.43p+9,0x1.ded62888a7876p+8), XY(0x1.3c8214bbd7d2ap+9,0x1.e6p+8)),
Edge(XY(0x1.348p+9,0x1.e6p+8), XY(0x1.58p+6,0x1.e6p+8)),
Edge(XY(0x1.58p+6,0x1.e6p+8), XY(0x1.58p+6,0x1.c6p+8)),
}, ECloseType::IGNORE_OPEN_PATH, EForceClockwise::DONT);
Contour B(Path{
Edge(XY(0x1.58p+6,0x1.c6p+8), XY(0x1.384898d2a6a12p+9,0x1.c68cd8241f1p+8)),
Edge(XY(0x1.384898d2a6a12p+9,0x1.c68cd8241f1p+8), XY(0x1.348p+9,0x1.c6p+8), XY(0x1.3713cf5692d75p+9,0x1.c630fe784c0fdp+8), XY(0x1.35cf171394abdp+9,0x1.c6p+8)),
Edge(XY(0x1.348p+9,0x1.c6p+8), XY(0x1.58p+6,0x1.c6p+8)),
}, ECloseType::IGNORE_OPEN_PATH, EForceClockwise::DONT);
TAssert(R, GetSC(R, A, "Relation 2A").RelationTo(GetSC(R, B, "Relation 2B")), REL_B_INSIDE_A,
"Relation 2C");
}
{
const Edge A(XY(0x1.639e7c047bcbap+8, 0x1.b57a8202546c8p+6), XY(0x1.6524633c747f4p+8, 0x1.ac4809cbfd4d8p+6), XY(0x1.63bbda5f317e7p+8, 0x1.b49d349976358p+6), XY(0x1.64f2ff1a318a7p+8, 0x1.ad3c029dd380ap+6));
const Edge B(XY(0x1.68f1032a5a050p+8, 0x1.ffc1c736bee31p+6), XY(0x1.5a1d40cfb49e9p+8, 0x1.8369e12d52b37p+6), XY(0x1.68f1032a5a050p+8, 0x1.cdaee185b439bp+6), XY(0x1.6330d853c9c0bp+8, 0x1.a0fb5b2b88230p+6), true, 1);
auto cps = A.Crossing(B, false);
TAssert(R, cps.num, 1U, "Spec crossing 1");
for (unsigned u = 0; u<cps.num; u++) {
BAssert(R, A.Match(cps.xy[u], cps.pos_my[u]), "Spec crossing 2 CP"+std::to_string(u));
BAssert(R, B.Match(cps.xy[u], cps.pos_other[u]), "Spec crossing 3 CP"+std::to_string(u));
}
}
{
Contour A(Path{
Edge(XY(0x1.352ff274d2f9ep+8,0x1.2ed56cde59f94p+9), XY(0x1.358p+8,0x1.2fcp+9), XY(0x1.3563ca8b4a63ap+8,0x1.2f1ecc4e97622p+9), XY(0x1.358p+8,0x1.2f6dc07cf75c4p+9)),
Edge(XY(0x1.358p+8,0x1.2fcp+9), XY(0x1.3p+8,0x1.328p+9), XY(0x1.358p+8,0x1.3144cef77ccb4p+9), XY(0x1.33099deef9968p+8,0x1.328p+9)),
Edge(XY(0x1.3p+8,0x1.328p+9), XY(0x1.2a8p+8,0x1.2fcp+9), XY(0x1.2cf6621106698p+8,0x1.328p+9), XY(0x1.2a8p+8,0x1.3144cef77ccb4p+9)),
Edge(XY(0x1.2a8p+8,0x1.2fcp+9), XY(0x1.2acd039bd1adep+8,0x1.2ed9c581fe1c4p+9), XY(0x1.2a8p+8,0x1.2f6f5f9bf56bep+9), XY(0x1.2a9b1b834d8d9p+8,0x1.2f21e99f9ba0dp+9)),
Edge(XY(0x1.2acd039bd1adep+8,0x1.2ed9c581fe1c4p+9), XY(0x1.352ff274d2f9ep+8,0x1.2ed56cde59f94p+9)),
}, ECloseType::IGNORE_OPEN_PATH, EForceClockwise::DONT);
Contour B(Path{
Edge(XY(0x1.358p+8,0x1.2f4p+9), XY(0x1.358p+8,0x1.304p+9)),
Edge(XY(0x1.358p+8,0x1.304p+9), XY(0x1.b9p+8,0x1.304p+9)),
Edge(XY(0x1.b9p+8,0x1.304p+9), XY(0x1.b9p+8,0x1.32cp+9)),
Edge(XY(0x1.b9p+8,0x1.32cp+9), XY(0x1.c28p+8,0x1.2fcp+9)),
Edge(XY(0x1.c28p+8,0x1.2fcp+9), XY(0x1.b9p+8,0x1.2ccp+9)),
Edge(XY(0x1.b9p+8,0x1.2ccp+9), XY(0x1.b9p+8,0x1.2f4p+9)),
Edge(XY(0x1.b9p+8,0x1.2f4p+9), XY(0x1.358p+8,0x1.2f4p+9)),
}, ECloseType::IGNORE_OPEN_PATH, EForceClockwise::DONT);
TAssert(R, GetSC(R, A, "Relation 3A").RelationTo(GetSC(R, B, "Relation 3B")), REL_APART,
"Relation 3C");
}
{
Edge A(XY(0x1.1d39031f9a38ep+5, 0x1.123de9f852ebdp+6), XY(0x1.34c9b4d6c0d26p+5, 0x1.ddc3d7679bap+5), XY(0x1.27454f572e4fp+5, 0x1.069081a9ff1b9p+6), XY(0x1.2f0df5b9b6d3cp+5, 0x1.f5b9279ab051p+5));
Edge B(XY(0x1.1d39031f9a38ep+5, 0x1.123de9f852ebcp+6), XY(0x1.238bcb1451b89p+5, 0x1.0ae4a3e3449p+6), true, 1);
double posA[Edge::MAX_CP], posB[Edge::MAX_CP];
XY xy[Edge::MAX_CP];
int num = B.Crossing(A, false, xy, posB, posA);
TAssert(R, num, 1, "Strange edge case");
}
{
Contour A = Contour::UnsafeMake(HoledSimpleContour::UnsafeMake(SimpleContour::UnsafeMake(Path{
Edge(XY(0x1.5fc1cp+9,0x1.f8f7p+9), XY(0x1.5d8b5ca689c6ep+9,0x1.f8f7p+9)),
Edge(XY(0x1.5d8b5ca689c6ep+9,0x1.f8f7p+9), XY(0x1.48dacp+9,0x1.f622a52b45bf7p+9)),
Edge(XY(0x1.48dacp+9,0x1.f622a52b45bf7p+9), XY(0x1.48dacp+9,0x1.f097p+9)),
Edge(XY(0x1.48dacp+9,0x1.f097p+9), XY(0x1.204e0ce9ef1p+9,0x1.f097p+9)),
Edge(XY(0x1.204e0ce9ef1p+9,0x1.f097p+9), XY(0x1.ae5dbec13afc6p+8,0x1.e697p+9)),
Edge(XY(0x1.ae5dbec13afc6p+8,0x1.e697p+9), XY(0x1.34fcc0bf1294p+9,0x1.e697p+9)),
Edge(XY(0x1.34fcc0bf1294p+9,0x1.e697p+9), XY(0x1.52dacp+9,0x1.ed510d72b615fp+9)),
Edge(XY(0x1.52dacp+9,0x1.ed510d72b615fp+9), XY(0x1.52dacp+9,0x1.eef7p+9)),
Edge(XY(0x1.52dacp+9,0x1.eef7p+9), XY(0x1.5a2c37a1366ap+9,0x1.eef7p+9)),
Edge(XY(0x1.5a2c37a1366ap+9,0x1.eef7p+9), XY(0x1.5fc1e9b925593p+9,0x1.f039p+9)),
Edge(XY(0x1.5fc1e9b925593p+9,0x1.f039p+9), XY(0x1.5fc1cp+9,0x1.f039p+9)),
Edge(XY(0x1.5fc1cp+9,0x1.f039p+9), XY(0x1.5fc1cp+9,0x1.f8f7p+9)),
}), ContourList::UnsafeMake({})), ContourList::UnsafeMake({}));
Contour B = Contour::UnsafeMake(HoledSimpleContour::UnsafeMake(SimpleContour::UnsafeMake(Path{
Edge(XY(0x1.c6p+9,0x1.03cp+10), XY(0x1.ae5dbec13afc6p+8,0x1.e697p+9)),
Edge(XY(0x1.ae5dbec13afc6p+8,0x1.e697p+9), XY(0x1.5fc1e9b925593p+9,0x1.f039p+9)),
Edge(XY(0x1.5fc1e9b925593p+9,0x1.f039p+9), XY(0x1.c6p+9,0x1.03cp+10)),
}), ContourList::UnsafeMake({})), ContourList::UnsafeMake({}));
UnionAssert(R, A, B, "Union 1");
}
{
Contour A = Contour::UnsafeMake(HoledSimpleContour::UnsafeMake(SimpleContour::UnsafeMake(Path{
Edge(XY(0x1.22ee0ae381322p+6,0x1.01fec06ddb9aap+6), XY(0x1.2d353b8a6e8cdp+6,0x1.f763640a54269p+5)),
Edge(XY(0x1.2d353b8a6e8cdp+6,0x1.f763640a54269p+5), XY(0x1.33da4a2c31058p+6,0x1.ee698e8f07a8dp+5)),
Edge(XY(0x1.33da4a2c31058p+6,0x1.ee698e8f07a8dp+5), XY(0x1.3a61260f98bc6p+6,0x1.e4bf1565a52b9p+5)),
Edge(XY(0x1.3a61260f98bc6p+6,0x1.e4bf1565a52b9p+5), XY(0x1.481f256d49ddbp+6,0x1.ce7bb53e0b99dp+5)),
Edge(XY(0x1.481f256d49ddbp+6,0x1.ce7bb53e0b99dp+5), XY(0x1.4757ffcb052ffp+6,0x1.e1292af52b278p+5), true, 1),
Edge(XY(0x1.4757ffcb052ffp+6,0x1.e1292af52b278p+5), XY(0x1.3dcca64de4ec5p+6,0x1.206fda5d75ae0p+6), XY(0x1.4602431cfd732p+6,0x1.009b15ebb6bfap+6), XY(0x1.42cbd9ab95717p+6,0x1.10c293fa8efd9p+6)),
Edge(XY(0x1.3dcca64de4ec5p+6,0x1.206fda5d75ae0p+6), XY(0x1.3b2e70a25bb76p+6,0x1.28a685a34c17cp+6), true, 1),
Edge(XY(0x1.3b2e70a25bb76p+6,0x1.28a685a34c17cp+6), XY(0x1.22ee0ae381322p+6,0x1.01fec06ddb9aap+6)),
}), ContourList::UnsafeMake({})), ContourList::UnsafeMake({}));
Contour B = Contour::UnsafeMake(HoledSimpleContour::UnsafeMake(SimpleContour::UnsafeMake(Path{
Edge(XY(0x1.1664c0abe5eadp+6,0x1.2988cb930b96dp+6), XY(0x1.21d9baad6453ep+6,0x1.258940b569cf7p+6)),
Edge(XY(0x1.21d9baad6453ep+6,0x1.258940b569cf7p+6), XY(0x1.295b12bfc33dap+6,0x1.229255ca4b578p+6)),
Edge(XY(0x1.295b12bfc33dap+6,0x1.229255ca4b578p+6), XY(0x1.30cb219e45d52p+6,0x1.1f48a23b994b8p+6)),
Edge(XY(0x1.30cb219e45d52p+6,0x1.1f48a23b994b8p+6), XY(0x1.40a68bbb80c5bp+6,0x1.177df04fcc858p+6)),
Edge(XY(0x1.40a68bbb80c5bp+6,0x1.177df04fcc858p+6), XY(0x1.3dcc9ffd77810p+6,0x1.206fee2cb6c85p+6), true, 1),
Edge(XY(0x1.3dcc9ffd77810p+6,0x1.206fee2cb6c85p+6), XY(0x1.2a32111a1d67ep+6,0x1.4d102132281a3p+6), XY(0x1.38fc686435803p+6,0x1.2f89c8a43b94ep+6), XY(0x1.3264ecb619452p+6,0x1.3e96a46262737p+6)),
Edge(XY(0x1.2a32111a1d67ep+6,0x1.4d102132281a3p+6), XY(0x1.25e69771b1c85p+6,0x1.54a53aa5dd183p+6), true, 1),
Edge(XY(0x1.25e69771b1c85p+6,0x1.54a53aa5dd183p+6), XY(0x1.1664c0abe5eadp+6,0x1.2988cb930b96dp+6)),
}), ContourList::UnsafeMake({})), ContourList::UnsafeMake({}));
UnionAssert(R, A, B, "Union 2");
}
{
Contour A = Contour::UnsafeMake(HoledSimpleContour::UnsafeMake(SimpleContour::UnsafeMake(Path{
Edge(XY(0x1.ff8e4p+7,0x1.0ae9f3c689ff4p+9), XY(0x1.ff8e4p+7,0x1.1352p+9)),
Edge(XY(0x1.ff8e4p+7,0x1.1352p+9), XY(0x1.67512f785ef0cp+7,0x1.1352p+9)),
Edge(XY(0x1.67512f785ef0cp+7,0x1.1352p+9), XY(0x1.763dcf519ea34p+7,0x1.0952p+9)),
Edge(XY(0x1.763dcf519ea34p+7,0x1.0952p+9), XY(0x1.fabba6a14d42ap+7,0x1.0952p+9)),
Edge(XY(0x1.fabba6a14d42ap+7,0x1.0952p+9), XY(0x1.ff8e4p+7,0x1.0ae9f3c689ff4p+9)),
}), ContourList::UnsafeMake({})), ContourList::UnsafeMake({HoledSimpleContour::UnsafeMake(SimpleContour::UnsafeMake(Path{
Edge(XY(0x1.6fp+8,0x1.b8p+8), XY(0x1.75p+8,0x1.d8p+8), XY(0x1.72504f333ed2cp+8,0x1.b8p+8), XY(0x1.75p+8,0x1.c653aeeeb0f15p+8)),
Edge(XY(0x1.75p+8,0x1.d8p+8), XY(0x1.6fp+8,0x1.f8p+8), XY(0x1.75p+8,0x1.e9ac51114f0ebp+8), XY(0x1.72504f333ed2cp+8,0x1.f8p+8)),
Edge(XY(0x1.6fp+8,0x1.f8p+8), XY(0x1.98p+5,0x1.f8p+8)),
Edge(XY(0x1.98p+5,0x1.f8p+8), XY(0x1.68p+5,0x1.d8p+8), XY(0x1.7d7d8666096ap+5,0x1.f8p+8), XY(0x1.68p+5,0x1.e9ac51114f0ebp+8)),
Edge(XY(0x1.68p+5,0x1.d8p+8), XY(0x1.98p+5,0x1.b8p+8), XY(0x1.68p+5,0x1.c653aeeeb0f15p+8), XY(0x1.7d7d8666096ap+5,0x1.b8p+8)),
Edge(XY(0x1.98p+5,0x1.b8p+8), XY(0x1.6fp+8,0x1.b8p+8)),
}),ContourList::UnsafeMake({})),}));
Contour B = Contour::UnsafeMake(HoledSimpleContour::UnsafeMake(SimpleContour::UnsafeMake(Path{
Edge(XY(0x1.67512f785ef0cp+7,0x1.1352p+9), XY(0x1.94b29daf964cp+5,0x1.f7eceab497278p+8)),
Edge(XY(0x1.94b29daf964cp+5,0x1.f7eceab497278p+8), XY(0x1.6f79880902465p+8,0x1.f7e6bbc9d8cc8p+8)),
Edge(XY(0x1.6f79880902465p+8,0x1.f7e6bbc9d8cc8p+8), XY(0x1.67512f785ef0cp+7,0x1.1352p+9)),
}), ContourList::UnsafeMake({})), ContourList::UnsafeMake({}));
UnionAssert(R, A, B, "Union 3");
}
{
Contour A = Contour::UnsafeMake(HoledSimpleContour::UnsafeMake(SimpleContour::UnsafeMake(Path{
Edge(XY(0x1.8509619343574p+6,0x1.7f2ep+9), XY(0x1.a90fd2a2067ep+6,0x1.7bd2p+9)),
Edge(XY(0x1.a90fd2a2067ep+6,0x1.7bd2p+9), XY(0x1.6471cp+7,0x1.7bd2p+9)),
Edge(XY(0x1.6471cp+7,0x1.7bd2p+9), XY(0x1.6471cp+7,0x1.7f2ep+9)),
Edge(XY(0x1.6471cp+7,0x1.7f2ep+9), XY(0x1.8509619343574p+6,0x1.7f2ep+9)),
}), ContourList::UnsafeMake({})), ContourList::UnsafeMake({HoledSimpleContour::UnsafeMake(SimpleContour::UnsafeMake(Path{
Edge(XY(0x1.6fp+8,0x1.3c8p+9), XY(0x1.75p+8,0x1.558p+9), XY(0x1.72504f333ed2cp+8,0x1.3c8p+9), XY(0x1.75p+8,0x1.47b160aa7a3c8p+9)),
Edge(XY(0x1.75p+8,0x1.558p+9), XY(0x1.6fp+8,0x1.6e8p+9), XY(0x1.75p+8,0x1.634e9f5585c38p+9), XY(0x1.72504f333ed2cp+8,0x1.6e8p+9)),
Edge(XY(0x1.6fp+8,0x1.6e8p+9), XY(0x1.98p+5,0x1.6e8p+9)),
Edge(XY(0x1.98p+5,0x1.6e8p+9), XY(0x1.68p+5,0x1.558p+9), XY(0x1.7d7d8666096ap+5,0x1.6e8p+9), XY(0x1.68p+5,0x1.634e9f5585c38p+9)),
Edge(XY(0x1.68p+5,0x1.558p+9), XY(0x1.98p+5,0x1.3c8p+9), XY(0x1.68p+5,0x1.47b160aa7a3c8p+9), XY(0x1.7d7d8666096ap+5,0x1.3c8p+9)),
Edge(XY(0x1.98p+5,0x1.3c8p+9), XY(0x1.6fp+8,0x1.3c8p+9)),
}),ContourList::UnsafeMake({})),}));
Contour B = Contour::UnsafeMake(HoledSimpleContour::UnsafeMake(SimpleContour::UnsafeMake(Path{
Edge(XY(0x1.8509619343574p+6,0x1.7f2ep+9), XY(0x1.93d26741cd0d2p+5,0x1.6e68172dbf4c3p+9)),
Edge(XY(0x1.93d26741cd0d2p+5,0x1.6e68172dbf4c3p+9), XY(0x1.6f212842083a6p+8,0x1.6e7e89d23e10dp+9)),
Edge(XY(0x1.6f212842083a6p+8,0x1.6e7e89d23e10dp+9), XY(0x1.8509619343574p+6,0x1.7f2ep+9)),
}), ContourList::UnsafeMake({})), ContourList::UnsafeMake({}));
UnionAssert(R, A, B, "Union 4");
}
{
Contour A = Contour::UnsafeMake(HoledSimpleContour::UnsafeMake(SimpleContour::UnsafeMake(Path{
Edge(XY(0x1.6071cp+7,0x1.0952p+9), XY(0x1.763dcf519ea34p+7,0x1.0952p+9)),
Edge(XY(0x1.763dcf519ea34p+7,0x1.0952p+9), XY(0x1.67512f785ef0cp+7,0x1.1352p+9)),
Edge(XY(0x1.67512f785ef0cp+7,0x1.1352p+9), XY(0x1.6071cp+7,0x1.1352p+9)),
Edge(XY(0x1.6071cp+7,0x1.1352p+9), XY(0x1.6071cp+7,0x1.0952p+9)),
}), ContourList::UnsafeMake({})), ContourList::UnsafeMake({HoledSimpleContour::UnsafeMake(SimpleContour::UnsafeMake(Path{
Edge(XY(0x1.6fp+8,0x1.b8p+8), XY(0x1.75p+8,0x1.d8p+8), XY(0x1.72504f333ed2cp+8,0x1.b8p+8), XY(0x1.75p+8,0x1.c653aeeeb0f15p+8)),
Edge(XY(0x1.75p+8,0x1.d8p+8), XY(0x1.6fp+8,0x1.f8p+8), XY(0x1.75p+8,0x1.e9ac51114f0ebp+8), XY(0x1.72504f333ed2cp+8,0x1.f8p+8)),
Edge(XY(0x1.6fp+8,0x1.f8p+8), XY(0x1.98p+5,0x1.f8p+8)),
Edge(XY(0x1.98p+5,0x1.f8p+8), XY(0x1.68p+5,0x1.d8p+8), XY(0x1.7d7d8666096ap+5,0x1.f8p+8), XY(0x1.68p+5,0x1.e9ac51114f0ebp+8)),
Edge(XY(0x1.68p+5,0x1.d8p+8), XY(0x1.98p+5,0x1.b8p+8), XY(0x1.68p+5,0x1.c653aeeeb0f15p+8), XY(0x1.7d7d8666096ap+5,0x1.b8p+8)),
Edge(XY(0x1.98p+5,0x1.b8p+8), XY(0x1.6fp+8,0x1.b8p+8)),
}),ContourList::UnsafeMake({})),}));
Contour B = Contour::UnsafeMake(HoledSimpleContour::UnsafeMake(SimpleContour::UnsafeMake(Path{
Edge(XY(0x1.6071cp+7,0x1.1352p+9), XY(0x1.949f13258bacp+5,0x1.f7ec0573dbc54p+8)),
Edge(XY(0x1.949f13258bacp+5,0x1.f7ec0573dbc54p+8), XY(0x1.6f48989ea0878p+8,0x1.f7f7030322c15p+8)),
Edge(XY(0x1.6f48989ea0878p+8,0x1.f7f7030322c15p+8), XY(0x1.6071cp+7,0x1.1352p+9)),
}), ContourList::UnsafeMake({})), ContourList::UnsafeMake({}));
UnionAssert(R, A, B, "Union 5");
}
{
Contour A = Contour::UnsafeMake(HoledSimpleContour::UnsafeMake(SimpleContour::UnsafeMake(Path{
Edge(XY(0x1.cf7b81db65819p+7,0x1.4ep+7), XY(0x1.9dfef9db22d0ep+7,0x1.f4b45c22e65dap+6)),
Edge(XY(0x1.9dfef9db22d0ep+7,0x1.f4b45c22e65dap+6), XY(0x1.e4cda703188b1p+7,0x1.4ep+7)),
Edge(XY(0x1.e4cda703188b1p+7,0x1.4ep+7), XY(0x1.084a3d70a3d71p+8,0x1.4ep+7)),
Edge(XY(0x1.084a3d70a3d71p+8,0x1.4ep+7), XY(0x1.084a3d70a3d71p+8,0x1.82p+7)),
Edge(XY(0x1.084a3d70a3d71p+8,0x1.82p+7), XY(0x1.c76b851eb851fp+7,0x1.82p+7)),
Edge(XY(0x1.c76b851eb851fp+7,0x1.82p+7), XY(0x1.c76b851eb851fp+7,0x1.4ep+7)),
Edge(XY(0x1.c76b851eb851fp+7,0x1.4ep+7), XY(0x1.cf7b81db65819p+7,0x1.4ep+7)),
}), ContourList::UnsafeMake({})), ContourList::UnsafeMake({}));
Contour B = Contour::UnsafeMake(HoledSimpleContour::UnsafeMake(SimpleContour::UnsafeMake(Path{
Edge(XY(0x1.9ep+7,0x1.03p+7), XY(0x1.9ep+7,0x1.f2p+6)),
Edge(XY(0x1.9ep+7,0x1.f2p+6), XY(0x1.b1p+7,0x1.05p+7)),
Edge(XY(0x1.b1p+7,0x1.05p+7), XY(0x1.9ep+7,0x1.11p+7)),
Edge(XY(0x1.9ep+7,0x1.11p+7), XY(0x1.9ep+7,0x1.07p+7)),
Edge(XY(0x1.9ep+7,0x1.07p+7), XY(0x1.62p+6,0x1.07p+7)),
Edge(XY(0x1.62p+6,0x1.07p+7), XY(0x1.62p+6,0x1.03p+7)),
Edge(XY(0x1.62p+6,0x1.03p+7), XY(0x1.9ep+7,0x1.03p+7)),
}), ContourList::UnsafeMake({})), ContourList::UnsafeMake({HoledSimpleContour::UnsafeMake(SimpleContour::UnsafeMake(Path{
Edge(XY(0x1.6a020c49ba5e3p+6,0x1.c4p+6), XY(0x1.9dfef9db22d0ep+7,0x1.c4p+6)),
Edge(XY(0x1.9dfef9db22d0ep+7,0x1.c4p+6), XY(0x1.9dfef9db22d0ep+7,0x1.02p+7)),
Edge(XY(0x1.9dfef9db22d0ep+7,0x1.02p+7), XY(0x1.6a020c49ba5e3p+6,0x1.02p+7)),
Edge(XY(0x1.6a020c49ba5e3p+6,0x1.02p+7), XY(0x1.6a020c49ba5e3p+6,0x1.c4p+6)),
}),ContourList::UnsafeMake({})),}));
IntersectAssert(R, A, B, "Intersect 1");
}
{
Contour A = Contour::UnsafeMake(HoledSimpleContour::UnsafeMake(SimpleContour::UnsafeMake(Path{
Edge(XY(0x1.634e2c108178ap+10,0x1.4cf5273ef513ap+7), XY(0x1.59p+10,0x1.1e8p+7)),
Edge(XY(0x1.59p+10,0x1.1e8p+7), XY(0x1.687388e4d3c3fp+10,0x1.4cf5273ef513ap+7)),
Edge(XY(0x1.687388e4d3c3fp+10,0x1.4cf5273ef513ap+7), XY(0x1.73f16991cfedap+10,0x1.4cf5273ef513ap+7)),
Edge(XY(0x1.73f16991cfedap+10,0x1.4cf5273ef513ap+7), XY(0x1.75316991cfedap+10,0x1.56f5273ef513ap+7), XY(0x1.74a224bc7d043p+10,0x1.4cf5273ef513ap+7), XY(0x1.75316991cfedap+10,0x1.516f4de98c5f1p+7)),
Edge(XY(0x1.75316991cfedap+10,0x1.56f5273ef513ap+7), XY(0x1.75316991cfedap+10,0x1.643d273ef513ap+7)),
Edge(XY(0x1.75316991cfedap+10,0x1.643d273ef513ap+7), XY(0x1.73f16991cfedap+10,0x1.6e3d273ef513ap+7), XY(0x1.75316991cfedap+10,0x1.69c300945dc83p+7), XY(0x1.74a224bc7d043p+10,0x1.6e3d273ef513ap+7)),
Edge(XY(0x1.73f16991cfedap+10,0x1.6e3d273ef513ap+7), XY(0x1.5fe2b991cfedap+10,0x1.6e3d273ef513ap+7)),
Edge(XY(0x1.5fe2b991cfedap+10,0x1.6e3d273ef513ap+7), XY(0x1.5ea2b991cfedap+10,0x1.643d273ef513ap+7), XY(0x1.5f31fe6722d71p+10,0x1.6e3d273ef513ap+7), XY(0x1.5ea2b991cfedap+10,0x1.69c300945dc83p+7)),
Edge(XY(0x1.5ea2b991cfedap+10,0x1.643d273ef513ap+7), XY(0x1.5ea2b991cfedap+10,0x1.56f5273ef513ap+7)),
Edge(XY(0x1.5ea2b991cfedap+10,0x1.56f5273ef513ap+7), XY(0x1.5fe2b991cfedap+10,0x1.4cf5273ef513ap+7), XY(0x1.5ea2b991cfedap+10,0x1.516f4de98c5f1p+7), XY(0x1.5f31fe6722d71p+10,0x1.4cf5273ef513ap+7)),
Edge(XY(0x1.5fe2b991cfedap+10,0x1.4cf5273ef513ap+7), XY(0x1.634e2c108178ap+10,0x1.4cf5273ef513ap+7)),
}), ContourList::UnsafeMake({})), ContourList::UnsafeMake({HoledSimpleContour::UnsafeMake(SimpleContour::UnsafeMake(Path{
Edge(XY(0x1.a2c08p+10,0x1.acp+7), XY(0x1.d6bf8p+10,0x1.acp+7)),
Edge(XY(0x1.d6bf8p+10,0x1.acp+7), XY(0x1.d6bf8p+10,0x1.06p+8)),
Edge(XY(0x1.d6bf8p+10,0x1.06p+8), XY(0x1.a2c08p+10,0x1.06p+8)),
Edge(XY(0x1.a2c08p+10,0x1.06p+8), XY(0x1.a2c08p+10,0x1.acp+7)),
}),ContourList::UnsafeMake({})),HoledSimpleContour::UnsafeMake(SimpleContour::UnsafeMake(Path{
Edge(XY(0x1.b91p+10,0x1.9p+7), XY(0x1.b91p+10,0x1.85p+7)),
Edge(XY(0x1.b91p+10,0x1.85p+7), XY(0x1.bc8p+10,0x1.96p+7)),
Edge(XY(0x1.bc8p+10,0x1.96p+7), XY(0x1.b91p+10,0x1.a7p+7)),
Edge(XY(0x1.b91p+10,0x1.a7p+7), XY(0x1.b91p+10,0x1.9cp+7)),
Edge(XY(0x1.b91p+10,0x1.9cp+7), XY(0x1.03p+9,0x1.9cp+7)),
Edge(XY(0x1.03p+9,0x1.9cp+7), XY(0x1.03p+9,0x1.9p+7)),
Edge(XY(0x1.03p+9,0x1.9p+7), XY(0x1.b91p+10,0x1.9p+7)),
}),ContourList::UnsafeMake({})),HoledSimpleContour::UnsafeMake(SimpleContour::UnsafeMake(Path{
Edge(XY(0x1.0f72p+10,0x1.68p+7), XY(0x1.2b9ep+10,0x1.68p+7)),
Edge(XY(0x1.2b9ep+10,0x1.68p+7), XY(0x1.2b9ep+10,0x1.8d4p+7)),
Edge(XY(0x1.2b9ep+10,0x1.8d4p+7), XY(0x1.0f72p+10,0x1.8d4p+7)),
Edge(XY(0x1.0f72p+10,0x1.8d4p+7), XY(0x1.0f72p+10,0x1.68p+7)),
}),ContourList::UnsafeMake({})),HoledSimpleContour::UnsafeMake(SimpleContour::UnsafeMake(Path{
Edge(XY(0x1.17a908p+10,0x1.9d4p+7), XY(0x1.2366f8p+10,0x1.9d4p+7)),
Edge(XY(0x1.2366f8p+10,0x1.9d4p+7), XY(0x1.2366f8p+10,0x1.b488p+7)),
Edge(XY(0x1.2366f8p+10,0x1.b488p+7), XY(0x1.17a908p+10,0x1.b488p+7)),
Edge(XY(0x1.17a908p+10,0x1.b488p+7), XY(0x1.17a908p+10,0x1.9d4p+7)),
}),ContourList::UnsafeMake({})),HoledSimpleContour::UnsafeMake(SimpleContour::UnsafeMake(Path{
Edge(XY(0x1.fa8p+8,0x1.88p+7), XY(0x1.fa8p+8,0x1.7ep+7)),
Edge(XY(0x1.fa8p+8,0x1.7ep+7), XY(0x1.02p+9,0x1.8ap+7)),
Edge(XY(0x1.02p+9,0x1.8ap+7), XY(0x1.fa8p+8,0x1.96p+7)),
Edge(XY(0x1.fa8p+8,0x1.96p+7), XY(0x1.fa8p+8,0x1.8cp+7)),
Edge(XY(0x1.fa8p+8,0x1.8cp+7), XY(0x1.ap+3,0x1.8cp+7)),
Edge(XY(0x1.ap+3,0x1.8cp+7), XY(0x1.ap+3,0x1.88p+7)),
Edge(XY(0x1.ap+3,0x1.88p+7), XY(0x1.fa8p+8,0x1.88p+7)),
}),ContourList::UnsafeMake({})),HoledSimpleContour::UnsafeMake(SimpleContour::UnsafeMake(Path{
Edge(XY(0x1.6ceap+7,0x1.6p+7), XY(0x1.540bp+8,0x1.6p+7)),
Edge(XY(0x1.540bp+8,0x1.6p+7), XY(0x1.540bp+8,0x1.854p+7)),
Edge(XY(0x1.540bp+8,0x1.854p+7), XY(0x1.6ceap+7,0x1.854p+7)),
Edge(XY(0x1.6ceap+7,0x1.854p+7), XY(0x1.6ceap+7,0x1.6p+7)),
}),ContourList::UnsafeMake({})),HoledSimpleContour::UnsafeMake(SimpleContour::UnsafeMake(Path{
Edge(XY(0x1.db884p+7,0x1.8d4p+7), XY(0x1.1cbbep+8,0x1.8d4p+7)),
Edge(XY(0x1.1cbbep+8,0x1.8d4p+7), XY(0x1.1cbbep+8,0x1.a488p+7)),
Edge(XY(0x1.1cbbep+8,0x1.a488p+7), XY(0x1.db884p+7,0x1.a488p+7)),
Edge(XY(0x1.db884p+7,0x1.a488p+7), XY(0x1.db884p+7,0x1.8d4p+7)),
}),ContourList::UnsafeMake({})),}));
Contour B = Contour::UnsafeMake(HoledSimpleContour::UnsafeMake(SimpleContour::UnsafeMake(Path{
Edge(XY(0x1.5afp+10,0x1.4bp+7), XY(0x1.59p+10,0x1.5a8p+7), XY(0x1.5afp+10,0x1.538f7744624b2p+7), XY(0x1.5a11eee88c496p+10,0x1.5a8p+7)),
Edge(XY(0x1.59p+10,0x1.5a8p+7), XY(0x1.571p+10,0x1.4bp+7), XY(0x1.57ee111773b6ap+10,0x1.5a8p+7), XY(0x1.571p+10,0x1.538f7744624b2p+7)),
Edge(XY(0x1.571p+10,0x1.4bp+7), XY(0x1.59p+10,0x1.3b8p+7), XY(0x1.571p+10,0x1.427088bb9db4ep+7), XY(0x1.57ee111773b6ap+10,0x1.3b8p+7)),
Edge(XY(0x1.59p+10,0x1.3b8p+7), XY(0x1.5afp+10,0x1.4bp+7), XY(0x1.5a11eee88c496p+10,0x1.3b8p+7), XY(0x1.5afp+10,0x1.427088bb9db4ep+7)),
}), ContourList::UnsafeMake({})), ContourList::UnsafeMake({HoledSimpleContour::UnsafeMake(SimpleContour::UnsafeMake(Path{
Edge(XY(0x1.5afp+10,0x1.49p+7), XY(0x1.e1dp+10,0x1.49p+7)),
Edge(XY(0x1.e1dp+10,0x1.49p+7), XY(0x1.e1dp+10,0x1.3ap+7)),
Edge(XY(0x1.e1dp+10,0x1.3ap+7), XY(0x1.e54p+10,0x1.4bp+7)),
Edge(XY(0x1.e54p+10,0x1.4bp+7), XY(0x1.e1dp+10,0x1.5cp+7)),
Edge(XY(0x1.e1dp+10,0x1.5cp+7), XY(0x1.e1dp+10,0x1.4dp+7)),
Edge(XY(0x1.e1dp+10,0x1.4dp+7), XY(0x1.5afp+10,0x1.4dp+7)),
Edge(XY(0x1.5afp+10,0x1.4dp+7), XY(0x1.5afp+10,0x1.49p+7)),
}),ContourList::UnsafeMake({})),HoledSimpleContour::UnsafeMake(SimpleContour::UnsafeMake(Path{
Edge(XY(0x1.1fcp+8,0x1.4bp+7), XY(0x1.18p+8,0x1.5a8p+7), XY(0x1.1fcp+8,0x1.538f7744624b2p+7), XY(0x1.1c47bba231259p+8,0x1.5a8p+7)),
Edge(XY(0x1.18p+8,0x1.5a8p+7), XY(0x1.104p+8,0x1.4bp+7), XY(0x1.13b8445dceda7p+8,0x1.5a8p+7), XY(0x1.104p+8,0x1.538f7744624b2p+7)),
Edge(XY(0x1.104p+8,0x1.4bp+7), XY(0x1.18p+8,0x1.3b8p+7), XY(0x1.104p+8,0x1.427088bb9db4ep+7), XY(0x1.13b8445dceda7p+8,0x1.3b8p+7)),
Edge(XY(0x1.18p+8,0x1.3b8p+7), XY(0x1.1fcp+8,0x1.4bp+7), XY(0x1.1c47bba231259p+8,0x1.3b8p+7), XY(0x1.1fcp+8,0x1.427088bb9db4ep+7)),
}),ContourList::UnsafeMake({})),HoledSimpleContour::UnsafeMake(SimpleContour::UnsafeMake(Path{
Edge(XY(0x1.1fcp+8,0x1.45p+7), XY(0x1.571p+10,0x1.45p+7)),
Edge(XY(0x1.571p+10,0x1.45p+7), XY(0x1.571p+10,0x1.51p+7)),
Edge(XY(0x1.571p+10,0x1.51p+7), XY(0x1.1fcp+8,0x1.51p+7)),
Edge(XY(0x1.1fcp+8,0x1.51p+7), XY(0x1.1fcp+8,0x1.45p+7)),
}),ContourList::UnsafeMake({})),HoledSimpleContour::UnsafeMake(SimpleContour::UnsafeMake(Path{
Edge(XY(0x1.cd0dp+9,0x1.1ap+7), XY(0x1.07098p+10,0x1.1ap+7)),
Edge(XY(0x1.07098p+10,0x1.1ap+7), XY(0x1.07098p+10,0x1.3f4p+7)),
Edge(XY(0x1.07098p+10,0x1.3f4p+7), XY(0x1.cd0dp+9,0x1.3f4p+7)),
Edge(XY(0x1.cd0dp+9,0x1.3f4p+7), XY(0x1.cd0dp+9,0x1.1ap+7)),
}),ContourList::UnsafeMake({})),HoledSimpleContour::UnsafeMake(SimpleContour::UnsafeMake(Path{
Edge(XY(0x1.6cp+5,0x1.41p+7), XY(0x1.104p+8,0x1.41p+7)),
Edge(XY(0x1.104p+8,0x1.41p+7), XY(0x1.104p+8,0x1.55p+7)),
Edge(XY(0x1.104p+8,0x1.55p+7), XY(0x1.6cp+5,0x1.55p+7)),
Edge(XY(0x1.6cp+5,0x1.55p+7), XY(0x1.6cp+5,0x1.41p+7)),
}),ContourList::UnsafeMake({})),}));
UnionAssert(R, A, B, "Union 6");
}
{
Contour A = Contour::UnsafeMake(HoledSimpleContour::UnsafeMake(SimpleContour::UnsafeMake(Path{
Edge(XY(0x1.2c48139908494p+8,0x1.12p+9), XY(0x1.43e1d1dca3ca9p+8,0x1.04cp+9)),
Edge(XY(0x1.43e1d1dca3ca9p+8,0x1.04cp+9), XY(0x1.350147ae147aep+8,0x1.124f79ee24e66p+9)),
Edge(XY(0x1.350147ae147aep+8,0x1.124f79ee24e66p+9), XY(0x1.350147ae147aep+8,0x1.1fp+9)),
Edge(XY(0x1.350147ae147aep+8,0x1.1fp+9), XY(0x1.1afeb851eb852p+8,0x1.1fp+9)),
Edge(XY(0x1.1afeb851eb852p+8,0x1.1fp+9), XY(0x1.1afeb851eb852p+8,0x1.12p+9)),
Edge(XY(0x1.1afeb851eb852p+8,0x1.12p+9), XY(0x1.2c48139908494p+8,0x1.12p+9)),
}), ContourList::UnsafeMake({})), ContourList::UnsafeMake({}));
Contour B = Contour::UnsafeMake(HoledSimpleContour::UnsafeMake(SimpleContour::UnsafeMake(Path{
Edge(XY(0x1.348p+8,0x1.adp+8), XY(0x1.1ee0f1266407p+8,0x1.adp+8)),
Edge(XY(0x1.1ee0f1266407p+8,0x1.adp+8), XY(0x1.0bp+8,0x1.991f0ed99bf9p+8)),
Edge(XY(0x1.0bp+8,0x1.991f0ed99bf9p+8), XY(0x1.0bp+8,0x1.94e0f1266407p+8)),
Edge(XY(0x1.0bp+8,0x1.94e0f1266407p+8), XY(0x1.1ee0f1266407p+8,0x1.81p+8)),
Edge(XY(0x1.1ee0f1266407p+8,0x1.81p+8), XY(0x1.330f876ccdfc8p+9,0x1.81p+8)),
Edge(XY(0x1.330f876ccdfc8p+9,0x1.81p+8), XY(0x1.3dp+9,0x1.94e0f1266407p+8)),
Edge(XY(0x1.3dp+9,0x1.94e0f1266407p+8), XY(0x1.3dp+9,0x1.991f0ed99bf9p+8)),
Edge(XY(0x1.3dp+9,0x1.991f0ed99bf9p+8), XY(0x1.330f876ccdfc8p+9,0x1.adp+8)),
Edge(XY(0x1.330f876ccdfc8p+9,0x1.adp+8), XY(0x1.284p+9,0x1.adp+8)),
Edge(XY(0x1.284p+9,0x1.adp+8), XY(0x1.3856309cdd6d1p+9,0x1.ba539ec64525ep+8), XY(0x1.2e68408ac85e6p+9,0x1.adp+8), XY(0x1.345231f7cd16ap+9,0x1.b24ba17c24791p+8)),
Edge(XY(0x1.3856309cdd6d1p+9,0x1.ba539ec64525ep+8), XY(0x1.3fp+9,0x1.da8p+8), XY(0x1.3c5a2f41edc38p+9,0x1.c25b9c1065d2dp+8), XY(0x1.3fp+9,0x1.ce2f7eea6f431p+8)),
Edge(XY(0x1.3fp+9,0x1.da8p+8), XY(0x1.3fp+9,0x1.ed8p+8)),
Edge(XY(0x1.3fp+9,0x1.ed8p+8), XY(0x1.3856309cdd6d1p+9,0x1.06d6309cdd6d1p+9), XY(0x1.3fp+9,0x1.f9d0811590bcfp+8), XY(0x1.3c5a2f41edc38p+9,0x1.02d231f7cd16ap+9)),
Edge(XY(0x1.3856309cdd6d1p+9,0x1.06d6309cdd6d1p+9), XY(0x1.284p+9,0x1.0d8p+9), XY(0x1.345231f7cd16ap+9,0x1.0ada2f41edc38p+9), XY(0x1.2e68408ac85e7p+9,0x1.0d8p+9)),
Edge(XY(0x1.284p+9,0x1.0d8p+9), XY(0x1.330f876ccdfc8p+9,0x1.0d8p+9)),
Edge(XY(0x1.330f876ccdfc8p+9,0x1.0d8p+9), XY(0x1.3dp+9,0x1.1770789332038p+9)),
Edge(XY(0x1.3dp+9,0x1.1770789332038p+9), XY(0x1.3dp+9,0x1.238p+9)),
Edge(XY(0x1.3dp+9,0x1.238p+9), XY(0x1.0bp+8,0x1.238p+9)),
Edge(XY(0x1.0bp+8,0x1.238p+9), XY(0x1.0bp+8,0x1.0d8p+9)),
Edge(XY(0x1.0bp+8,0x1.0d8p+9), XY(0x1.348p+8,0x1.0d8p+9)),
Edge(XY(0x1.348p+8,0x1.0d8p+9), XY(0x1.14539ec64525ep+8,0x1.06d6309cdd6d1p+9), XY(0x1.282f7eea6f432p+8,0x1.0d8p+9), XY(0x1.1c5b9c1065d2cp+8,0x1.0ada2f41edc38p+9)),
Edge(XY(0x1.14539ec64525ep+8,0x1.06d6309cdd6d1p+9), XY(0x1.11p+8,0x1.04f77bb143fep+9), XY(0x1.1328386c2d0b6p+8,0x1.06407d6fd15fdp+9), XY(0x1.120bac27a77c7p+8,0x1.05a07c28f6034p+9)),
Edge(XY(0x1.11p+8,0x1.04f77bb143fep+9), XY(0x1.11p+8,0x1.0cp+9)),
Edge(XY(0x1.11p+8,0x1.0cp+9), XY(0x1.1p+7,0x1.0cp+9)),
Edge(XY(0x1.1p+7,0x1.0cp+9), XY(0x1.1p+7,0x1.fap+8)),
Edge(XY(0x1.1p+7,0x1.fap+8), XY(0x1.041f0ed99bf9p+8,0x1.fap+8)),
Edge(XY(0x1.041f0ed99bf9p+8,0x1.fap+8), XY(0x1.0bc7879981c02p+8,0x1.00d43c5ff2e3bp+9)),
Edge(XY(0x1.0bc7879981c02p+8,0x1.00d43c5ff2e3bp+9), XY(0x1.07p+8,0x1.ed8p+8), XY(0x1.08c18e3166ff3p+8,0x1.fb85827a7d1b1p+8), XY(0x1.07p+8,0x1.f4976af645fcep+8)),
Edge(XY(0x1.07p+8,0x1.ed8p+8), XY(0x1.07p+8,0x1.da8p+8)),
Edge(XY(0x1.07p+8,0x1.da8p+8), XY(0x1.14539ec64525ep+8,0x1.ba539ec64525ep+8), XY(0x1.07p+8,0x1.ce2f7eea6f433p+8), XY(0x1.0c4ba17c24791p+8,0x1.c25b9c1065d2bp+8)),
Edge(XY(0x1.14539ec64525ep+8,0x1.ba539ec64525ep+8), XY(0x1.348p+8,0x1.adp+8), XY(0x1.1c5b9c1065d2cp+8,0x1.b24ba17c2479p+8), XY(0x1.282f7eea6f432p+8,0x1.adp+8)),
}), ContourList::UnsafeMake({HoledSimpleContour::UnsafeMake(SimpleContour::UnsafeMake(Path{
Edge(XY(0x1.0bp+8,0x1.da8p+8), XY(0x1.0bp+8,0x1.ed8p+8)),
Edge(XY(0x1.0bp+8,0x1.ed8p+8), XY(0x1.348p+8,0x1.0b8p+9), XY(0x1.0bp+8,0x1.0235bc9139438p+9), XY(0x1.1d9486dd8d78fp+8,0x1.0b8p+9)),
Edge(XY(0x1.348p+8,0x1.0b8p+9), XY(0x1.284p+9,0x1.0b8p+9)),
Edge(XY(0x1.284p+9,0x1.0b8p+9), XY(0x1.3dp+9,0x1.ed8p+8), XY(0x1.33b5bc9139438p+9,0x1.0b8p+9), XY(0x1.3dp+9,0x1.0235bc9139438p+9)),
Edge(XY(0x1.3dp+9,0x1.ed8p+8), XY(0x1.3dp+9,0x1.da8p+8)),
Edge(XY(0x1.3dp+9,0x1.da8p+8), XY(0x1.284p+9,0x1.b1p+8), XY(0x1.3dp+9,0x1.c39486dd8d78fp+8), XY(0x1.33b5bc9139438p+9,0x1.b1p+8)),
Edge(XY(0x1.284p+9,0x1.b1p+8), XY(0x1.348p+8,0x1.b1p+8)),
Edge(XY(0x1.348p+8,0x1.b1p+8), XY(0x1.0bp+8,0x1.da8p+8), XY(0x1.1d9486dd8d78fp+8,0x1.b1p+8), XY(0x1.0bp+8,0x1.c39486dd8d78fp+8)),
}),ContourList::UnsafeMake({HoledSimpleContour::UnsafeMake(SimpleContour::UnsafeMake(Path{
Edge(XY(0x1.169533c17d985p+9,0x1.cf8p+8), XY(0x1.153f5c28f5c29p+9,0x1.cf8p+8)),
Edge(XY(0x1.153f5c28f5c29p+9,0x1.cf8p+8), XY(0x1.153f5c28f5c29p+9,0x1.b68p+8)),
Edge(XY(0x1.153f5c28f5c29p+9,0x1.b68p+8), XY(0x1.21c0a3d70a3d7p+9,0x1.b68p+8)),
Edge(XY(0x1.21c0a3d70a3d7p+9,0x1.b68p+8), XY(0x1.21c0a3d70a3d7p+9,0x1.cf8p+8)),
Edge(XY(0x1.21c0a3d70a3d7p+9,0x1.cf8p+8), XY(0x1.1ab69e0595552p+9,0x1.cf8p+8)),
Edge(XY(0x1.1ab69e0595552p+9,0x1.cf8p+8), XY(0x1.121a17fb0c74bp+9,0x1.ea8p+8)),
Edge(XY(0x1.121a17fb0c74bp+9,0x1.ea8p+8), XY(0x1.169533c17d985p+9,0x1.cf8p+8)),
}),ContourList::UnsafeMake({})),HoledSimpleContour::UnsafeMake(SimpleContour::UnsafeMake(Path{
Edge(XY(0x1.268cc34ae392ap+8,0x1.b6p+8), XY(0x1.f94f52a70c886p+8,0x1.b6p+8)),
Edge(XY(0x1.f94f52a70c886p+8,0x1.b6p+8), XY(0x1.f94f52a70c886p+8,0x1.d8p+8)),
Edge(XY(0x1.f94f52a70c886p+8,0x1.d8p+8), XY(0x1.268cc34ae392ap+8,0x1.d8p+8)),
Edge(XY(0x1.268cc34ae392ap+8,0x1.d8p+8), XY(0x1.268cc34ae392ap+8,0x1.b6p+8)),
}),ContourList::UnsafeMake({})),HoledSimpleContour::UnsafeMake(SimpleContour::UnsafeMake(Path{
Edge(XY(0x1.25p+9,0x1.ea8p+8), XY(0x1.25p+9,0x1.e58p+8)),
Edge(XY(0x1.25p+9,0x1.e58p+8), XY(0x1.29cp+9,0x1.eb8p+8)),
Edge(XY(0x1.29cp+9,0x1.eb8p+8), XY(0x1.25p+9,0x1.f18p+8)),
Edge(XY(0x1.25p+9,0x1.f18p+8), XY(0x1.25p+9,0x1.ec8p+8)),
Edge(XY(0x1.25p+9,0x1.ec8p+8), XY(0x1.318p+8,0x1.ec8p+8)),
Edge(XY(0x1.318p+8,0x1.ec8p+8), XY(0x1.318p+8,0x1.ea8p+8)),
Edge(XY(0x1.318p+8,0x1.ea8p+8), XY(0x1.25p+9,0x1.ea8p+8)),
}),ContourList::UnsafeMake({})),HoledSimpleContour::UnsafeMake(SimpleContour::UnsafeMake(Path{
Edge(XY(0x1.acf53f7ced916p+8,0x1.dap+8), XY(0x1.d08ac083126e9p+8,0x1.dap+8)),
Edge(XY(0x1.d08ac083126e9p+8,0x1.dap+8), XY(0x1.d08ac083126e9p+8,0x1.eap+8)),
Edge(XY(0x1.d08ac083126e9p+8,0x1.eap+8), XY(0x1.acf53f7ced916p+8,0x1.eap+8)),
Edge(XY(0x1.acf53f7ced916p+8,0x1.eap+8), XY(0x1.acf53f7ced916p+8,0x1.dap+8)),
}),ContourList::UnsafeMake({})),})),})), ContourList::UnsafeMake({HoledSimpleContour::UnsafeMake(SimpleContour::UnsafeMake(Path{
Edge(XY(0x1.3672b30f13257p+9,0x1.a639a8bb75ae3p+8), XY(0x1.4481da23a5561p+9,0x1.bc8p+8)),
Edge(XY(0x1.4481da23a5561p+9,0x1.bc8p+8), XY(0x1.4e40a3d70a3d7p+9,0x1.bc8p+8)),
Edge(XY(0x1.4e40a3d70a3d7p+9,0x1.bc8p+8), XY(0x1.4e40a3d70a3d7p+9,0x1.d58p+8)),
Edge(XY(0x1.4e40a3d70a3d7p+9,0x1.d58p+8), XY(0x1.41bf5c28f5c29p+9,0x1.d58p+8)),
Edge(XY(0x1.41bf5c28f5c29p+9,0x1.d58p+8), XY(0x1.41bf5c28f5c29p+9,0x1.c23506acfe39cp+8)),
Edge(XY(0x1.41bf5c28f5c29p+9,0x1.c23506acfe39cp+8), XY(0x1.3672b30f13257p+9,0x1.a639a8bb75ae3p+8)),
}),ContourList::UnsafeMake({})),HoledSimpleContour::UnsafeMake(SimpleContour::UnsafeMake(Path{
Edge(XY(0x1.297eb851eb852p+8,0x1.418p+9), XY(0x1.1df6e73ffc0bbp+8,0x1.418p+9)),
Edge(XY(0x1.1df6e73ffc0bbp+8,0x1.418p+9), XY(0x1.09p+8,0x1.37048c6001fa3p+9)),
Edge(XY(0x1.09p+8,0x1.37048c6001fa3p+9), XY(0x1.09p+8,0x1.337b739ffe05dp+9)),
Edge(XY(0x1.09p+8,0x1.337b739ffe05dp+9), XY(0x1.1df6e73ffc0bbp+8,0x1.29p+9)),
Edge(XY(0x1.1df6e73ffc0bbp+8,0x1.29p+9), XY(0x1.33848c6001fa3p+9,0x1.29p+9)),
Edge(XY(0x1.33848c6001fa3p+9,0x1.29p+9), XY(0x1.3ep+9,0x1.337b739ffe05dp+9)),
Edge(XY(0x1.3ep+9,0x1.337b739ffe05dp+9), XY(0x1.3ep+9,0x1.37048c6001fa3p+9)),
Edge(XY(0x1.3ep+9,0x1.37048c6001fa3p+9), XY(0x1.33848c6001fa3p+9,0x1.418p+9)),
Edge(XY(0x1.33848c6001fa3p+9,0x1.418p+9), XY(0x1.428147ae147aep+8,0x1.418p+9)),
Edge(XY(0x1.428147ae147aep+8,0x1.418p+9), XY(0x1.428147ae147aep+8,0x1.4c4p+9)),
Edge(XY(0x1.428147ae147aep+8,0x1.4c4p+9), XY(0x1.297eb851eb852p+8,0x1.4c4p+9)),
Edge(XY(0x1.297eb851eb852p+8,0x1.4c4p+9), XY(0x1.297eb851eb852p+8,0x1.47a24688a009fp+9)),
Edge(XY(0x1.297eb851eb852p+8,0x1.47a24688a009fp+9), XY(0x1.13p+8,0x1.45cp+9)),
Edge(XY(0x1.13p+8,0x1.45cp+9), XY(0x1.297eb851eb852p+8,0x1.4431ea0565098p+9)),
Edge(XY(0x1.297eb851eb852p+8,0x1.4431ea0565098p+9), XY(0x1.297eb851eb852p+8,0x1.418p+9)),
}),ContourList::UnsafeMake({})),HoledSimpleContour::UnsafeMake(SimpleContour::UnsafeMake(Path{
Edge(XY(0x1.41bf8e6172d02p+9,0x1.938p+8), XY(0x1.3bf1df14a81afp+9,0x1.7dp+8)),
Edge(XY(0x1.3bf1df14a81afp+9,0x1.7dp+8), XY(0x1.4604233b31ee3p+9,0x1.938p+8)),
Edge(XY(0x1.4604233b31ee3p+9,0x1.938p+8), XY(0x1.4e40a3d70a3d7p+9,0x1.938p+8)),
Edge(XY(0x1.4e40a3d70a3d7p+9,0x1.938p+8), XY(0x1.4e40a3d70a3d7p+9,0x1.ac8p+8)),
Edge(XY(0x1.4e40a3d70a3d7p+9,0x1.ac8p+8), XY(0x1.41bf5c28f5c29p+9,0x1.ac8p+8)),
Edge(XY(0x1.41bf5c28f5c29p+9,0x1.ac8p+8), XY(0x1.41bf5c28f5c29p+9,0x1.938p+8)),
Edge(XY(0x1.41bf5c28f5c29p+9,0x1.938p+8), XY(0x1.41bf8e6172d02p+9,0x1.938p+8)),
}),ContourList::UnsafeMake({})),HoledSimpleContour::UnsafeMake(SimpleContour::UnsafeMake(Path{
Edge(XY(0x1.91d7626799994p+7,0x1.13cp+9), XY(0x1.97449b3e96b9cp+7,0x1.0cp+9)),
Edge(XY(0x1.97449b3e96b9cp+7,0x1.0cp+9), XY(0x1.9d88ad7354331p+7,0x1.13cp+9)),
Edge(XY(0x1.9d88ad7354331p+7,0x1.13cp+9), XY(0x1.b1028f5c28f5cp+7,0x1.13cp+9)),
Edge(XY(0x1.b1028f5c28f5cp+7,0x1.13cp+9), XY(0x1.b1028f5c28f5cp+7,0x1.204p+9)),
Edge(XY(0x1.b1028f5c28f5cp+7,0x1.204p+9), XY(0x1.7efd70a3d70a4p+7,0x1.204p+9)),
Edge(XY(0x1.7efd70a3d70a4p+7,0x1.204p+9), XY(0x1.7efd70a3d70a4p+7,0x1.13cp+9)),
Edge(XY(0x1.7efd70a3d70a4p+7,0x1.13cp+9), XY(0x1.91d7626799994p+7,0x1.13cp+9)),
}),ContourList::UnsafeMake({})),HoledSimpleContour::UnsafeMake(SimpleContour::UnsafeMake(Path{
Edge(XY(0x1.aedc8acebad06p+7,0x1.d38p+8), XY(0x1.b53dd576f1091p+7,0x1.bd00000000001p+8)),
Edge(XY(0x1.b53dd576f1091p+7,0x1.bd00000000001p+8), XY(0x1.bc9e99c77f432p+7,0x1.d38p+8)),
Edge(XY(0x1.bc9e99c77f432p+7,0x1.d38p+8), XY(0x1.cf028f5c28f5cp+7,0x1.d38p+8)),
Edge(XY(0x1.cf028f5c28f5cp+7,0x1.d38p+8), XY(0x1.cf028f5c28f5cp+7,0x1.ec8p+8)),
Edge(XY(0x1.cf028f5c28f5cp+7,0x1.ec8p+8), XY(0x1.9cfd70a3d70a4p+7,0x1.ec8p+8)),
Edge(XY(0x1.9cfd70a3d70a4p+7,0x1.ec8p+8), XY(0x1.9cfd70a3d70a4p+7,0x1.d38p+8)),
Edge(XY(0x1.9cfd70a3d70a4p+7,0x1.d38p+8), XY(0x1.aedc8acebad06p+7,0x1.d38p+8)),
}),ContourList::UnsafeMake({})),HoledSimpleContour::UnsafeMake(SimpleContour::UnsafeMake(Path{
Edge(XY(0x1.0cp+7,0x1.448p+9), XY(0x1.2ap+7,0x1.3dp+9), XY(0x1.0cp+7,0x1.405b9cfff1789p+9), XY(0x1.196e73ffc5e24p+7,0x1.3dp+9)),
Edge(XY(0x1.2ap+7,0x1.3dp+9), XY(0x1.04p+8,0x1.3dp+9)),
Edge(XY(0x1.04p+8,0x1.3dp+9), XY(0x1.13p+8,0x1.448p+9), XY(0x1.0c48c6001d0eep+8,0x1.3dp+9), XY(0x1.13p+8,0x1.405b9cfff1789p+9)),
Edge(XY(0x1.13p+8,0x1.448p+9), XY(0x1.13p+8,0x1.47p+9)),
Edge(XY(0x1.13p+8,0x1.47p+9), XY(0x1.04p+8,0x1.4e8p+9), XY(0x1.13p+8,0x1.4b2463000e877p+9), XY(0x1.0c48c6001d0eep+8,0x1.4e8p+9)),
Edge(XY(0x1.04p+8,0x1.4e8p+9), XY(0x1.2ap+7,0x1.4e8p+9)),
Edge(XY(0x1.2ap+7,0x1.4e8p+9), XY(0x1.0cp+7,0x1.47p+9), XY(0x1.196e73ffc5e24p+7,0x1.4e8p+9), XY(0x1.0cp+7,0x1.4b2463000e877p+9)),
Edge(XY(0x1.0cp+7,0x1.47p+9), XY(0x1.0cp+7,0x1.448p+9)),
}),ContourList::UnsafeMake({})),HoledSimpleContour::UnsafeMake(SimpleContour::UnsafeMake(Path{
Edge(XY(0x1.0cp+7,0x1.297b739ffe05dp+9), XY(0x1.27edce7ff8176p+7,0x1.228p+9)),
Edge(XY(0x1.27edce7ff8176p+7,0x1.228p+9), XY(0x1.050918c003f45p+8,0x1.228p+9)),
Edge(XY(0x1.050918c003f45p+8,0x1.228p+9), XY(0x1.13p+8,0x1.297b739ffe05dp+9)),
Edge(XY(0x1.13p+8,0x1.297b739ffe05dp+9), XY(0x1.13p+8,0x1.2d048c6001fa3p+9)),
Edge(XY(0x1.13p+8,0x1.2d048c6001fa3p+9), XY(0x1.050918c003f45p+8,0x1.34p+9)),
Edge(XY(0x1.050918c003f45p+8,0x1.34p+9), XY(0x1.27edce7ff8176p+7,0x1.34p+9)),
Edge(XY(0x1.27edce7ff8176p+7,0x1.34p+9), XY(0x1.0cp+7,0x1.2d048c6001fa3p+9)),
Edge(XY(0x1.0cp+7,0x1.2d048c6001fa3p+9), XY(0x1.0cp+7,0x1.297b739ffe05dp+9)),
}),ContourList::UnsafeMake({})),HoledSimpleContour::UnsafeMake(SimpleContour::UnsafeMake(Path{
Edge(XY(0x1.1p+7,0x1.ac8p+8), XY(0x1.2bp+7,0x1.9fp+8), XY(0x1.1p+7,0x1.a50b4dccb2a5dp+8), XY(0x1.1c169b99654bap+7,0x1.9fp+8)),
Edge(XY(0x1.2bp+7,0x1.9fp+8), XY(0x1.038p+8,0x1.9fp+8)),
Edge(XY(0x1.038p+8,0x1.9fp+8), XY(0x1.11p+8,0x1.ac8p+8), XY(0x1.0af4b2334d5a3p+8,0x1.9fp+8), XY(0x1.11p+8,0x1.a50b4dccb2a5dp+8)),
Edge(XY(0x1.11p+8,0x1.ac8p+8), XY(0x1.11p+8,0x1.af8p+8)),
Edge(XY(0x1.11p+8,0x1.af8p+8), XY(0x1.038p+8,0x1.bdp+8), XY(0x1.11p+8,0x1.b6f4b2334d5a3p+8), XY(0x1.0af4b2334d5a3p+8,0x1.bdp+8)),
Edge(XY(0x1.038p+8,0x1.bdp+8), XY(0x1.2bp+7,0x1.bdp+8)),
Edge(XY(0x1.2bp+7,0x1.bdp+8), XY(0x1.1p+7,0x1.af8p+8), XY(0x1.1c169b99654bap+7,0x1.bdp+8), XY(0x1.1p+7,0x1.b6f4b2334d5a3p+8)),
Edge(XY(0x1.1p+7,0x1.af8p+8), XY(0x1.1p+7,0x1.ac8p+8)),
}),ContourList::UnsafeMake({})),HoledSimpleContour::UnsafeMake(SimpleContour::UnsafeMake(Path{
Edge(XY(0x1.1p+7,0x1.84e0f1266407p+8), XY(0x1.29c1e24cc80ep+7,0x1.78p+8)),
Edge(XY(0x1.29c1e24cc80ep+7,0x1.78p+8), XY(0x1.041f0ed99bf9p+8,0x1.78p+8)),
Edge(XY(0x1.041f0ed99bf9p+8,0x1.78p+8), XY(0x1.11p+8,0x1.84e0f1266407p+8)),
Edge(XY(0x1.11p+8,0x1.84e0f1266407p+8), XY(0x1.11p+8,0x1.891f0ed99bf9p+8)),
Edge(XY(0x1.11p+8,0x1.891f0ed99bf9p+8), XY(0x1.041f0ed99bf9p+8,0x1.96p+8)),
Edge(XY(0x1.041f0ed99bf9p+8,0x1.96p+8), XY(0x1.29c1e24cc80ep+7,0x1.96p+8)),
Edge(XY(0x1.29c1e24cc80ep+7,0x1.96p+8), XY(0x1.1p+7,0x1.891f0ed99bf9p+8)),
Edge(XY(0x1.1p+7,0x1.891f0ed99bf9p+8), XY(0x1.1p+7,0x1.84e0f1266407p+8)),
}),ContourList::UnsafeMake({})),}));
Contour x = A*B; //This used to trigger an ASSERT PRINT when setting startpos
//This was because we have an edge crossing a sharp spike in two CPs. Then these two CPs are
//merged, and we snap to the end of the spike. This takes the CP far away from the original edge.
//We have made ASSERT tolerance adaptive in this case to avoid triggering the assert.
}
//Now print results
const size_t failed = std::ranges::count(R, false, &std::pair<std::string, bool>::second);
if (do_image) {
R.emplace(R.begin(), failed ? "The following unit tests failed:" : "All unit tests passed!", failed==0);
const auto imax = std::ranges::max_element(R, {}, [](auto& p) {return p.second ? 0 : p.first.length(); });
const size_t m = imax->second ? 0: imax->first.length();
CairoContext canvas(0, Block(0, std::max(m*1.2, 174.), 0, std::max(20.,double(failed+1)*6)), "Unit tests");
cairo_set_font_size(canvas.cr, 5);
double y = 0;
for (auto& [msg, success] : R)
if (!success || y==0) {
cairo_set_source_rgb(canvas.cr, int(!success)/2., int(success)/2., 0.);
cairo_move_to(canvas.cr, 5, y);
thread_safe_cairo_show_text(canvas.cr, msg.c_str());
y += 6;
}
} else {
std::cout<<(failed ? "The following unit tests failed:" : "All unit tests passed!")<<std::endl;
for (auto& [msg, success] : R)
if (!success) std::cout<<msg<<std::endl;
}
}
|