test_clipper_utils.cpp 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440
  1. #include <catch_main.hpp>
  2. #include <numeric>
  3. #include <iostream>
  4. #include <boost/filesystem.hpp>
  5. #include "libslic3r/ClipperUtils.hpp"
  6. #include "libslic3r/ExPolygon.hpp"
  7. #include "libslic3r/SVG.hpp"
  8. using namespace Slic3r;
  9. SCENARIO("Various Clipper operations - xs/t/11_clipper.t", "[ClipperUtils]") {
  10. // CCW oriented contour
  11. Slic3r::Polygon square{ { 200, 100 }, {200, 200}, {100, 200}, {100, 100} };
  12. // CW oriented contour
  13. Slic3r::Polygon hole_in_square{ { 160, 140 }, { 140, 140 }, { 140, 160 }, { 160, 160 } };
  14. Slic3r::ExPolygon square_with_hole(square, hole_in_square);
  15. GIVEN("square_with_hole") {
  16. WHEN("offset") {
  17. Polygons result = Slic3r::offset(square_with_hole, 5.f);
  18. THEN("offset matches") {
  19. REQUIRE(result == Polygons {
  20. { { 205, 205 }, { 95, 205 }, { 95, 95 }, { 205, 95 }, },
  21. { { 145, 145 }, { 145, 155 }, { 155, 155 }, { 155, 145 } } });
  22. }
  23. }
  24. WHEN("offset_ex") {
  25. ExPolygons result = Slic3r::offset_ex(square_with_hole, 5.f);
  26. THEN("offset matches") {
  27. REQUIRE(result == ExPolygons { {
  28. { { 205, 205 }, { 95, 205 }, { 95, 95 }, { 205, 95 }, },
  29. { { 145, 145 }, { 145, 155 }, { 155, 155 }, { 155, 145 } } } } );
  30. }
  31. }
  32. WHEN("offset2_ex") {
  33. ExPolygons result = Slic3r::offset2_ex({square_with_hole}, 5.f, -2.f);
  34. THEN("offset matches") {
  35. REQUIRE(result == ExPolygons { {
  36. { { 203, 203 }, { 97, 203 }, { 97, 97 }, { 203, 97 } },
  37. { { 143, 143 }, { 143, 157 }, { 157, 157 }, { 157, 143 } } } } );
  38. }
  39. }
  40. }
  41. GIVEN("square_with_hole 2") {
  42. Slic3r::ExPolygon square_with_hole(
  43. { { 20000000, 20000000 }, { 0, 20000000 }, { 0, 0 }, { 20000000, 0 } },
  44. { { 5000000, 15000000 }, { 15000000, 15000000 }, { 15000000, 5000000 }, { 5000000, 5000000 } });
  45. WHEN("offset2_ex") {
  46. Slic3r::ExPolygons result = Slic3r::offset2_ex(ExPolygons { square_with_hole }, -1.f, 1.f);
  47. THEN("offset matches") {
  48. REQUIRE(result.size() == 1);
  49. REQUIRE(square_with_hole.area() == result.front().area());
  50. }
  51. }
  52. }
  53. GIVEN("square and hole") {
  54. WHEN("diff_ex") {
  55. ExPolygons result = Slic3r::diff_ex(Polygons{ square }, Polygons{ hole_in_square });
  56. THEN("hole is created") {
  57. REQUIRE(result.size() == 1);
  58. REQUIRE(square_with_hole.area() == result.front().area());
  59. }
  60. }
  61. }
  62. GIVEN("polyline") {
  63. Slic3r::Polyline polyline { { 50, 150 }, { 300, 150 } };
  64. WHEN("intersection_pl") {
  65. Polylines result = Slic3r::intersection_pl({ polyline }, { square, hole_in_square });
  66. THEN("correct number of result lines") {
  67. REQUIRE(result.size() == 2);
  68. }
  69. THEN("result lines have correct length") {
  70. // results are in no particular order
  71. REQUIRE(result[0].length() == 40);
  72. REQUIRE(result[1].length() == 40);
  73. }
  74. }
  75. WHEN("diff_pl") {
  76. Polylines result = Slic3r::diff_pl(Polylines{ polyline }, Polygons{ square, hole_in_square });
  77. THEN("correct number of result lines") {
  78. REQUIRE(result.size() == 3);
  79. }
  80. // results are in no particular order
  81. THEN("the left result line has correct length") {
  82. REQUIRE(std::count_if(result.begin(), result.end(), [](const Slic3r::Polyline &pl) { return pl.length() == 50; }) == 1);
  83. }
  84. THEN("the right result line has correct length") {
  85. REQUIRE(std::count_if(result.begin(), result.end(), [](const Slic3r::Polyline &pl) { return pl.length() == 100; }) == 1);
  86. }
  87. THEN("the central result line has correct length") {
  88. REQUIRE(std::count_if(result.begin(), result.end(), [](const Slic3r::Polyline &pl) { return pl.length() == 20; }) == 1);
  89. }
  90. }
  91. }
  92. GIVEN("Clipper bug #96 / Slic3r issue #2028") {
  93. Slic3r::Polyline subject{
  94. { 44735000, 31936670 }, { 55270000, 31936670 }, { 55270000, 25270000 }, { 74730000, 25270000 }, { 74730000, 44730000 }, { 68063296, 44730000 }, { 68063296, 55270000 }, { 74730000, 55270000 },
  95. { 74730000, 74730000 }, { 55270000, 74730000 }, { 55270000, 68063296 }, { 44730000, 68063296 }, { 44730000, 74730000 }, { 25270000, 74730000 }, { 25270000, 55270000 }, { 31936670, 55270000 },
  96. { 31936670, 44730000 }, { 25270000, 44730000 }, { 25270000, 25270000 }, { 44730000, 25270000 }, { 44730000, 31936670 } };
  97. Slic3r::Polygon clip { {75200000, 45200000}, {54800000, 45200000}, {54800000, 24800000}, {75200000, 24800000} };
  98. Slic3r::Polylines result = Slic3r::intersection_pl(Polylines{ subject }, clip);
  99. THEN("intersection_pl - result is not empty") {
  100. REQUIRE(result.size() == 1); }
  101. result = Slic3r::intersection_pl(subject, Polygons{clip});
  102. THEN("intersection_pl(2) - result is not empty") {
  103. REQUIRE(result.size() == 1);
  104. }
  105. }
  106. GIVEN("Clipper bug #122") {
  107. Slic3r::Polyline subject { { 1975, 1975 }, { 25, 1975 }, { 25, 25 }, { 1975, 25 }, { 1975, 1975 } };
  108. Slic3r::Polygons clip { { { 2025, 2025 }, { -25, 2025 } , { -25, -25 }, { 2025, -25 } },
  109. { { 525, 525 }, { 525, 1475 }, { 1475, 1475 }, { 1475, 525 } } };
  110. Slic3r::Polylines result = Slic3r::intersection_pl(Polylines{ subject }, clip);
  111. THEN("intersection_pl - result is not empty") {
  112. REQUIRE(result.size() == 1);
  113. REQUIRE(result.front().points.size() == 5);
  114. }
  115. result = Slic3r::intersection_pl(subject, Polygons{clip});
  116. THEN("intersection_pl(2) - result is not empty") {
  117. REQUIRE(result.size() == 1);
  118. REQUIRE(result.front().points.size() == 5);
  119. }
  120. }
  121. GIVEN("Clipper bug #126") {
  122. Slic3r::Polyline subject { { 200000, 19799999 }, { 200000, 200000 }, { 24304692, 200000 }, { 15102879, 17506106 }, { 13883200, 19799999 }, { 200000, 19799999 } };
  123. Slic3r::Polygon clip { { 15257205, 18493894 }, { 14350057, 20200000 }, { -200000, 20200000 }, { -200000, -200000 }, { 25196917, -200000 } };
  124. Slic3r::Polylines result = Slic3r::intersection_pl(Polylines{ subject }, clip);
  125. THEN("intersection_pl - result is not empty") {
  126. REQUIRE(result.size() == 1);
  127. }
  128. THEN("intersection_pl - result has same length as subject polyline") {
  129. REQUIRE(result.front().length() == Approx(subject.length()));
  130. }
  131. result = Slic3r::intersection_pl(subject, Polygons{clip});
  132. THEN("intersection_pl(2) - result is not empty") {
  133. REQUIRE(result.size() == 1);
  134. }
  135. THEN("intersection_pl(2) - result has same length as subject polyline") {
  136. REQUIRE(result.front().length() == Approx(subject.length()));
  137. }
  138. result = Slic3r::intersection_pl(Polylines{subject}, Polygons{clip});
  139. THEN("intersection_pl(3) - result is not empty") {
  140. REQUIRE(result.size() == 1);
  141. }
  142. THEN("intersection_pl(3) - result has same length as subject polyline") {
  143. REQUIRE(result.front().length() == Approx(subject.length()));
  144. }
  145. }
  146. #if 0
  147. {
  148. # Clipper does not preserve polyline orientation
  149. my $polyline = Slic3r::Polyline->new([50, 150], [300, 150]);
  150. my $result = Slic3r::Geometry::Clipper::intersection_pl([$polyline], [$square]);
  151. is scalar(@$result), 1, 'intersection_pl - correct number of result lines';
  152. is_deeply $result->[0]->pp, [[100, 150], [200, 150]], 'clipped line orientation is preserved';
  153. }
  154. {
  155. # Clipper does not preserve polyline orientation
  156. my $polyline = Slic3r::Polyline->new([300, 150], [50, 150]);
  157. my $result = Slic3r::Geometry::Clipper::intersection_pl([$polyline], [$square]);
  158. is scalar(@$result), 1, 'intersection_pl - correct number of result lines';
  159. is_deeply $result->[0]->pp, [[200, 150], [100, 150]], 'clipped line orientation is preserved';
  160. }
  161. {
  162. # Disabled until Clipper bug #127 is fixed
  163. my $subject = [
  164. Slic3r::Polyline->new([-90000000, -100000000], [-90000000, 100000000]), # vertical
  165. Slic3r::Polyline->new([-100000000, -10000000], [100000000, -10000000]), # horizontal
  166. Slic3r::Polyline->new([-100000000, 0], [100000000, 0]), # horizontal
  167. Slic3r::Polyline->new([-100000000, 10000000], [100000000, 10000000]), # horizontal
  168. ];
  169. my $clip = Slic3r::Polygon->new(# a circular, convex, polygon
  170. [99452190, 10452846], [97814760, 20791169], [95105652, 30901699], [91354546, 40673664], [86602540, 50000000],
  171. [80901699, 58778525], [74314483, 66913061], [66913061, 74314483], [58778525, 80901699], [50000000, 86602540],
  172. [40673664, 91354546], [30901699, 95105652], [20791169, 97814760], [10452846, 99452190], [0, 100000000],
  173. [-10452846, 99452190], [-20791169, 97814760], [-30901699, 95105652], [-40673664, 91354546],
  174. [-50000000, 86602540], [-58778525, 80901699], [-66913061, 74314483], [-74314483, 66913061],
  175. [-80901699, 58778525], [-86602540, 50000000], [-91354546, 40673664], [-95105652, 30901699],
  176. [-97814760, 20791169], [-99452190, 10452846], [-100000000, 0], [-99452190, -10452846],
  177. [-97814760, -20791169], [-95105652, -30901699], [-91354546, -40673664], [-86602540, -50000000],
  178. [-80901699, -58778525], [-74314483, -66913061], [-66913061, -74314483], [-58778525, -80901699],
  179. [-50000000, -86602540], [-40673664, -91354546], [-30901699, -95105652], [-20791169, -97814760],
  180. [-10452846, -99452190], [0, -100000000], [10452846, -99452190], [20791169, -97814760],
  181. [30901699, -95105652], [40673664, -91354546], [50000000, -86602540], [58778525, -80901699],
  182. [66913061, -74314483], [74314483, -66913061], [80901699, -58778525], [86602540, -50000000],
  183. [91354546, -40673664], [95105652, -30901699], [97814760, -20791169], [99452190, -10452846], [100000000, 0]
  184. );
  185. my $result = Slic3r::Geometry::Clipper::intersection_pl($subject, [$clip]);
  186. is scalar(@$result), scalar(@$subject), 'intersection_pl - expected number of polylines';
  187. is sum(map scalar(@$_), @$result), scalar(@$subject) * 2, 'intersection_pl - expected number of points in polylines';
  188. }
  189. #endif
  190. }
  191. SCENARIO("Various Clipper operations - t/clipper.t", "[ClipperUtils]") {
  192. GIVEN("square with hole") {
  193. // CCW oriented contour
  194. Slic3r::Polygon square { { 10, 10 }, { 20, 10 }, { 20, 20 }, { 10, 20 } };
  195. Slic3r::Polygon square2 { { 5, 12 }, { 25, 12 }, { 25, 18 }, { 5, 18 } };
  196. // CW oriented contour
  197. Slic3r::Polygon hole_in_square { { 14, 14 }, { 14, 16 }, { 16, 16 }, { 16, 14 } };
  198. WHEN("intersection_ex with another square") {
  199. ExPolygons intersection = Slic3r::intersection_ex(Polygons{ square, hole_in_square }, Polygons{ square2 });
  200. THEN("intersection area matches (hole is preserved)") {
  201. ExPolygon match({ { 20, 18 }, { 10, 18 }, { 10, 12 }, { 20, 12 } },
  202. { { 14, 16 }, { 16, 16 }, { 16, 14 }, { 14, 14 } });
  203. REQUIRE(intersection.size() == 1);
  204. REQUIRE(intersection.front().area() == Approx(match.area()));
  205. }
  206. }
  207. }
  208. GIVEN("square with hole 2") {
  209. // CCW oriented contour
  210. Slic3r::Polygon square { { 0, 0 }, { 40, 0 }, { 40, 40 }, { 0, 40 } };
  211. Slic3r::Polygon square2 { { 10, 10 }, { 30, 10 }, { 30, 30 }, { 10, 30 } };
  212. // CW oriented contour
  213. Slic3r::Polygon hole { { 15, 15 }, { 15, 25 }, { 25, 25 }, {25, 15 } };
  214. WHEN("union_ex with another square") {
  215. ExPolygons union_ = Slic3r::union_ex(Polygons{ square, square2, hole });
  216. THEN("union of two ccw and one cw is a contour with no holes") {
  217. REQUIRE(union_.size() == 1);
  218. REQUIRE(union_.front() == ExPolygon { { 40, 40 }, { 0, 40 }, { 0, 0 }, { 40, 0 } } );
  219. }
  220. }
  221. WHEN("diff_ex with another square") {
  222. ExPolygons diff = Slic3r::diff_ex(Polygons{ square, square2 }, Polygons{ hole });
  223. THEN("difference of a cw from two ccw is a contour with one hole") {
  224. REQUIRE(diff.size() == 1);
  225. REQUIRE(diff.front().area() == Approx(ExPolygon({ {40, 40}, {0, 40}, {0, 0}, {40, 0} }, { {15, 25}, {25, 25}, {25, 15}, {15, 15} }).area()));
  226. }
  227. }
  228. }
  229. GIVEN("yet another square") {
  230. Slic3r::Polygon square { { 10, 10 }, { 20, 10 }, { 20, 20 }, { 10, 20 } };
  231. Slic3r::Polyline square_pl = square.split_at_first_point();
  232. WHEN("no-op diff_pl") {
  233. Slic3r::Polylines res = Slic3r::diff_pl({ square_pl }, {});
  234. THEN("returns the right number of polylines") {
  235. REQUIRE(res.size() == 1);
  236. }
  237. THEN("returns the unmodified input polyline") {
  238. REQUIRE(res.front().points.size() == square_pl.points.size());
  239. }
  240. }
  241. }
  242. }
  243. template<e_ordering o = e_ordering::OFF, class P, class Tree>
  244. double polytree_area(const Tree &tree, std::vector<P> *out)
  245. {
  246. traverse_pt<o>(tree, out);
  247. return std::accumulate(out->begin(), out->end(), 0.0,
  248. [](double a, const P &p) { return a + p.area(); });
  249. }
  250. size_t count_polys(const ExPolygons& expolys)
  251. {
  252. size_t c = 0;
  253. for (auto &ep : expolys) c += ep.holes.size() + 1;
  254. return c;
  255. }
  256. TEST_CASE("Traversing Clipper PolyTree", "[ClipperUtils]") {
  257. // Create a polygon representing unit box
  258. Slic3r::Polygon unitbox;
  259. const int32_t UNIT = int32_t(1. / SCALING_FACTOR);
  260. unitbox.points = Points{Point{0, 0}, Point{UNIT, 0}, Point{UNIT, UNIT}, Point{0, UNIT}};
  261. Slic3r::Polygon box_frame = unitbox;
  262. box_frame.scale(20, 10);
  263. Slic3r::Polygon hole_left = unitbox;
  264. hole_left.scale(8);
  265. hole_left.translate(UNIT, UNIT);
  266. hole_left.reverse();
  267. Slic3r::Polygon hole_right = hole_left;
  268. hole_right.translate(UNIT * 10, 0);
  269. Slic3r::Polygon inner_left = unitbox;
  270. inner_left.scale(4);
  271. inner_left.translate(UNIT * 3, UNIT * 3);
  272. Slic3r::Polygon inner_right = inner_left;
  273. inner_right.translate(UNIT * 10, 0);
  274. Polygons reference = union_({box_frame, hole_left, hole_right, inner_left, inner_right});
  275. ClipperLib::PolyTree tree = union_pt(reference);
  276. double area_sum = box_frame.area() + hole_left.area() +
  277. hole_right.area() + inner_left.area() +
  278. inner_right.area();
  279. REQUIRE(area_sum > 0);
  280. SECTION("Traverse into Polygons WITHOUT spatial ordering") {
  281. Polygons output;
  282. REQUIRE(area_sum == Approx(polytree_area(tree.GetFirst(), &output)));
  283. REQUIRE(output.size() == reference.size());
  284. }
  285. SECTION("Traverse into ExPolygons WITHOUT spatial ordering") {
  286. ExPolygons output;
  287. REQUIRE(area_sum == Approx(polytree_area(tree.GetFirst(), &output)));
  288. REQUIRE(count_polys(output) == reference.size());
  289. }
  290. SECTION("Traverse into Polygons WITH spatial ordering") {
  291. Polygons output;
  292. REQUIRE(area_sum == Approx(polytree_area<e_ordering::ON>(tree.GetFirst(), &output)));
  293. REQUIRE(output.size() == reference.size());
  294. }
  295. SECTION("Traverse into ExPolygons WITH spatial ordering") {
  296. ExPolygons output;
  297. REQUIRE(area_sum == Approx(polytree_area<e_ordering::ON>(tree.GetFirst(), &output)));
  298. REQUIRE(count_polys(output) == reference.size());
  299. }
  300. }
  301. TEST_CASE("Testing offset and offset_ex ", "[ClipperUtils]") {
  302. SECTION("contour growth create hole")
  303. {
  304. std::vector<std::pair<double, double>> unscaled_array = {{0, 0}, {10, 0}, {10, 4.5}, {7, 4.5}, {7,3}, {3,3}, {3,7}, {7,7}, {7,5.5}, {10,5.5}, {10,10}, {0,10}};
  305. Slic3r::Polygon src_polygon;
  306. for(auto pt: unscaled_array)
  307. src_polygon.points.emplace_back(scale_t(pt.first), scale_t(pt.second));
  308. REQUIRE(src_polygon.is_valid());
  309. Polygons result = Slic3r::offset(src_polygon, scale_d(1), ClipperLib::JoinType::jtMiter, 3);
  310. REQUIRE(result.size() == 2);
  311. REQUIRE(result[0].is_counter_clockwise() || result[1].is_counter_clockwise());
  312. REQUIRE(result[0].is_clockwise() || result[1].is_clockwise());
  313. ExPolygons result_ex = Slic3r::offset_ex(ExPolygon(src_polygon), scale_d(1), ClipperLib::JoinType::jtMiter, 3);
  314. REQUIRE(result_ex.size() == 1);
  315. REQUIRE(result_ex[0].holes.size() == 1);
  316. REQUIRE(result_ex[0].contour.is_counter_clockwise());
  317. REQUIRE(result_ex[0].holes[0].is_clockwise());
  318. result_ex = union_ex(result);
  319. REQUIRE(result_ex.size() == 1);
  320. REQUIRE(result_ex[0].holes.size() == 1);
  321. REQUIRE(result_ex[0].contour.is_counter_clockwise());
  322. REQUIRE(result_ex[0].holes[0].is_clockwise());
  323. }
  324. }
  325. TEST_CASE("Testing ", "[ClipperUtils]") {
  326. Slic3r::Polygon src_polygon(
  327. {{-29766902, -30710288}, {-30290102, -30802646}, {-30799114, -30715083}, {-31876243, -30562718},
  328. {-33030941, -30449754}, {-33231822, -30436946}, {-34268178, -30384775}, {-34891023, -30367930},
  329. {-34938429, -30367343}, {-36307009, -30380364}, {-36686920, -30395327}, {-38057500, -30465424},
  330. {-38066183, -30465841}, {-39121269, -30543247}, {-39144586, -30545052}, {-41393647, -30762768},
  331. {-41400772, -30763367}, {-42606470, -30898534}, {-43049745, -30951762}, {-43526989, -31152101},
  332. {-44543970, -31296610}, {-49896253, -32067648}, {-53031149, -32453333}, {-54983432, -32629283},
  333. {-55876108, -32681239}, {-57207787, -32710144}, {-57287031, -32707371}, {-56999037, -31773098},
  334. {-57020109, -31574537}, {-57153102, -31460716}, {-59114378, -30732754}, {-59554951, -30452156},
  335. {-59664101, -30265002}, {-59753496, -29913462}, {-59728476, -29015470}, {-59648533, -27590938},
  336. {-59696516, -27427759}, {-59871882, -27324947}, {-60861946, -27207800}, {-60553293, -26514064},
  337. {-60221446, -25827699}, {-59983819, -25377161}, {-59431848, -24334493}, {-58071530, -22002475},
  338. {-57086298, -20406564}, {-54532068, -16383584}, {-54152045, -16033352}, {-53418323, -14810628},
  339. {-53037302, -14152026}, {-52585902, -13384179}, {-52093130, -12530959}, {-52089199, -12523696},
  340. {-51416049, -11301170}, {-51399188, -11269626}, {-50899221, -10293557}, {-50548785, -9599755},
  341. {-50422361, -9325954}, {-49913114, -8198227}, {-49857361, -8070473}, {-49486084, -7130146},
  342. {-49262185, -6546354}, {-48814997, -5175926}, {-48666648, -4650820}, {-48416355, -3640670},
  343. {-48173788, -2389333}, {-48059689, -1542776}, {-47989236, -963142}, {-47988421, -954092},
  344. {-47908090, 106824}, {-47878053, 573422}, {-47849952, 1687025}, {-47645107, 4755332},
  345. {-47768143, 5288883}, {-47768047, 5291706}, {-47527604, 7621018}, {-47663943, 7838131},
  346. {-47525823, 8455742}, {-47689343, 9155509}, {-47795210, 10268834}, {-47978714, 11428999},
  347. {-48194112, 12344043}, {-48481144, 13309478}, {-48642179, 13794190}, {-48842780, 14334161},
  348. {-49197836, 15187901}, {-49588991, 16033320}, {-49853153, 16562549}, {-50513053, 17792804},
  349. {-50882667, 18419696}, {-51438514, 19339116}, {-51718684, 19773192}, {-52179489, 20475205},
  350. {-52491489, 20942905}, {-52496021, 20949622}, {-53290936, 22086329}, {-53752870, 22724706},
  351. {-54177967, 23303509}, {-54181286, 23308060}, {-55141698, 24578760}, {-55144467, 24582493},
  352. {-55936527, 25607586}, {-56390354, 26180675}, {-56401601, 26194795}, {-57375148, 27425084},
  353. {-57796140, 27725621}, {-58510273, 28592781}, {-65026204, 36326237}, {-66321141, 37899688},
  354. {-67553055, 39431322}, {-68707652, 40912081}, {-69414421, 41847539}, {-70373648, 43171709},
  355. {-70802160, 43801970}, {-69626708, 44423826}, {-69500832, 44580612}, {-69517438, 44759180},
  356. {-70402232, 46571248}, {-70631353, 47139129}, {-70790322, 47645204}, {-70880079, 48170004},
  357. {-70836022, 48432201}, {-70393757, 48597581}, {-69696951, 48717065}, {-69166672, 48746854},
  358. {-66168401, 48719007}, {-66004571, 48777066}, {-65913199, 48953792}, {-65819709, 50214929},
  359. {-64567977, 49966674}, {-63318168, 49705469}, {-60009943, 48909169}, {-56515788, 47981280},
  360. {-54126539, 47316536}, {-46386391, 45110400}, {-43369296, 44277479}, {-40263700, 43467720},
  361. {-39395835, 43264181}, {-37625205, 42849082}, {-37483166, 42819432}, {-36253801, 42563516},
  362. {-35674412, 42454458}, {-35515136, 42424491}, {-35048870, 42199191}, {-34862709, 42168781},
  363. {-33252621, 41926411}, {-32502942, 41835599}, {-31999592, 41778303}, {-31076021, 41691629},
  364. {-30193707, 41636746}, {-29260187, 41590640}, {-29176144, 41589180}, {-28142088, 41581326},
  365. {-27548623, 41596261}, {-26950500, 41621514}, {-26907420, 41624187}, {-27296983, 41112633},
  366. {-27381326, 40996047}, {-27989012, 40963451}, {-28138692, 40959253}, {-29172601, 40940110},
  367. {-30216723, 40958086}, {-30968347, 40990968}, {-32059596, 41069576}, {-32574047, 41111839},
  368. {-33323922, 41188523}, {-33355502, 41192102}, {-34970203, 41401547}, {-35176124, 41432378},
  369. {-35690171, 41369764}, {-36438808, 41490323}, {-37698617, 41699347}, {-39653744, 42065692},
  370. {-43800396, 42915182}, {-45342457, 43261526}, {-45348345, 43262775}, {-50568599, 44305692},
  371. {-50574460, 44306791}, {-53615613, 44840310}, {-53623507, 44841566}, {-55534335, 45114997},
  372. {-56455716, 45222015}, {-56990415, 45265339}, {-58176151, 45361070}, {-58988986, 45390201},
  373. {-59754351, 45388396}, {-60364211, 45358767}, {-61360217, 45251837}, {-62159687, 45076387},
  374. {-62794134, 44850846}, {-63424043, 44497175}, {-63912607, 44054027}, {-64275381, 43487793},
  375. {-64498459, 42717071}, {-64535148, 42192268}, {-64471205, 41405650}, {-64314543, 40690545},
  376. {-64120100, 40058090}, {-63874462, 39404122}, {-63581000, 38726318}, {-63242248, 38023061},
  377. {-63048962, 37665614}, {-62451850, 36563209}, {-61998277, 35793781}, {-61994661, 35787838},
  378. {-61010738, 34219433}, {-61006329, 34212647}, {-59353428, 31755703}, {-58915997, 31155400},
  379. {-58904968, 31139811}, {-58173450, 30074020}, {-57605465, 29308774}, {-57267309, 28853350},
  380. {-56935597, 28379741}, {-56758677, 27893678}, {-55833774, 26626414}, {-55384145, 26031982},
  381. {-55378724, 26024436}, {-54620031, 24974408}, {-54614601, 24966864}, {-53686336, 23672495},
  382. {-53263954, 23077836}, {-52819950, 22424397}, {-52812898, 22413958}, {-52039562, 21262463},
  383. {-51720551, 20779964}, {-51268827, 20062375}, {-51004463, 19621601}, {-50993923, 19603829},
  384. {-50450501, 18677012}, {-50134549, 18108099}, {-49637035, 17140780}, {-49202252, 16226805},
  385. {-48915776, 15586329}, {-48502177, 14536860}, {-48293881, 13926867}, {-48131171, 13424218},
  386. {-47957911, 12802996}, {-47710562, 11741154}, {-47547264, 10744476}, {-47411827, 9350391},
  387. {-47399989, 9163312}, {-47526019, 8468044}, {-47381692, 7839505}, {-47527604, 7621018},
  388. {-47487457, 5279674}, {-47644915, 4762661}, {-47645107, 4755332}, {-47560209, 1681367},
  389. {-47560253, 1679345}, {-47591199, 565817}, {-47610875, 84616}, {-47689099, -976457},
  390. {-47742308, -1576171}, {-47842045, -2389891}, {-47996471, -3333559}, {-48219314, -4396851},
  391. {-48438557, -5270192}, {-48712153, -6237043}, {-49060161, -7284025}, {-49063021, -7292452},
  392. {-49415948, -8239818}, {-49473812, -8389762}, {-49953551, -9530354}, {-50412680, -10529202},
  393. {-50415227, -10534771}, {-50893546, -11521628}, {-50916067, -11567425}, {-51554754, -12808303},
  394. {-52019235, -13695926}, {-52446210, -14467999}, {-52801876, -15142704}, {-52808818, -15155800},
  395. {-53480037, -16413921}, {-53584936, -16919960}, {-53843700, -17435906}, {-53846126, -17440877},
  396. {-54868733, -19595920}, {-54872166, -19603470}, {-55326937, -20648845}, {-55543581, -21190124},
  397. {-55680915, -21533885}, {-56036127, -22524045}, {-56325917, -23486648}, {-56536000, -24407114},
  398. {-56625601, -25224967}, {-56678029, -25738177}, {-56653328, -26373647}, {-56547823, -26988562},
  399. {-56342934, -27593803}, {-56040970, -28128453}, {-55803719, -28427693}, {-55381973, -28822864},
  400. {-54839359, -29182948}, {-54386222, -29398844}, {-53567537, -29700868}, {-52853584, -29879786},
  401. {-52093673, -30015999}, {-51292005, -30115523}, {-50452932, -30183406}, {-49578991, -30224183},
  402. {-49569346, -30224448}, {-47759328, -30239656}, {-47749986, -30239561}, {-45372177, -30171922},
  403. {-44666915, -30125409}, {-43916922, -30103842}, {-43639264, -30083267}, {-43130808, -30180062},
  404. {-42674180, -30139307}, {-41463591, -30058983}, {-41449327, -30058073}, {-39193983, -29919875},
  405. {-39155994, -29917901}, {-38098825, -29878010}, {-38081454, -29877418}, {-36709714, -29835798},
  406. {-36306241, -29836742}, {-34937704, -29853628}, {-34254369, -29892783}, {-34238932, -29893784},
  407. {-33203711, -29965009}, {-32164627, -30082538}, {-31146078, -30236999}, {-30227180, -30411554},
  408. {-29766902, -30710288}});
  409. }