test_voronoi.cpp 93 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192
  1. #include <catch2/catch.hpp>
  2. #include <test_utils.hpp>
  3. #include <libslic3r/Polygon.hpp>
  4. #include <libslic3r/Polyline.hpp>
  5. #include <libslic3r/EdgeGrid.hpp>
  6. #include <libslic3r/Geometry.hpp>
  7. #include "libslic3r/Geometry/VoronoiUtilsCgal.hpp"
  8. #include <libslic3r/Geometry/VoronoiOffset.hpp>
  9. #include <libslic3r/Geometry/VoronoiVisualUtils.hpp>
  10. #include <numeric>
  11. // #define VORONOI_DEBUG_OUT
  12. #ifdef VORONOI_DEBUG_OUT
  13. #include <libslic3r/VoronoiVisualUtils.hpp>
  14. #endif
  15. using boost::polygon::voronoi_builder;
  16. using boost::polygon::voronoi_diagram;
  17. using namespace Slic3r;
  18. using VD = Slic3r::VoronoiDiagram;
  19. // https://svn.boost.org/trac10/ticket/12067
  20. // This bug seems to be confirmed.
  21. // Vojtech supposes that there may be no Voronoi edges produced for
  22. // the 1st and last sweep line positions.
  23. TEST_CASE("Voronoi missing edges - points 12067", "[Voronoi]")
  24. {
  25. Points pts {
  26. { -10, -20 },
  27. { 10, -20 },
  28. { 5, 0 },
  29. { 10, 20 },
  30. { -10, 20 },
  31. { -5, 0 }
  32. };
  33. #if 0
  34. for (Point &p : pts) {
  35. Vec2d q = p.cast<double>();
  36. p.x() = scale_(p.x());
  37. p.y() = scale_(p.y());
  38. }
  39. #endif
  40. #if 0
  41. // Try to rotate, maybe the issue is caused by incorrect handling of vertical or horizontal edges?
  42. double a = 0.18764587962597876897475f;
  43. double c = cos(a);
  44. double s = sin(a);
  45. for (Point &p : poly.points) {
  46. Vec2d q = p.cast<double>();
  47. p.x() = coord_t(q.x() * c + q.y() * s + 0.5);
  48. p.y() = coord_t(- q.x() * s + q.y() * c + 0.5);
  49. }
  50. #endif
  51. // Construction of the Voronoi Diagram.
  52. VD vd;
  53. construct_voronoi(pts.begin(), pts.end(), &vd);
  54. #ifdef VORONOI_DEBUG_OUT
  55. dump_voronoi_to_svg(debug_out_path("voronoi-pts.svg").c_str(),
  56. vd, pts, Lines());
  57. #endif
  58. // REQUIRE(closest_point.z() == Approx(1.));
  59. }
  60. // https://svn.boost.org/trac10/ticket/12707
  61. // This issue is confirmed, there are no self intersections in the polygon.
  62. // A minimal test case is created at the end of this test,
  63. // a new issue opened with the minimal test case:
  64. // https://github.com/boostorg/polygon/issues/43
  65. TEST_CASE("Voronoi missing edges - Alessandro gapfill 12707", "[Voronoi]")
  66. {
  67. Lines lines0 {
  68. { { 42127548, 699996}, { 42127548, 10135750 } },
  69. { { 42127548, 10135750}, { 50487352, 10135750 } },
  70. { { 50487352, 10135750}, { 50487352, 699995 } },
  71. { { 50487352, 699995}, { 51187348, 0 } },
  72. { { 51187348, 0}, { 64325952, 0 } },
  73. { { 64325952, 0}, { 64325952, 699996 } },
  74. { { 64325952, 699996}, { 51187348, 699996 } },
  75. { { 51187348, 699996}, { 51187348, 10835701 } },
  76. { { 51187348, 10835701}, { 41427552, 10835701 } },
  77. { { 41427552, 10835701}, { 41427552, 699996 } },
  78. { { 41427552, 699996}, { 28664848, 699996 } },
  79. { { 28664848, 699996}, { 28664848, 10835701 } },
  80. { { 28664848, 10835701}, { 19280052, 10835701 } },
  81. { { 19280052, 10835701}, { 27964852, 699996 } },
  82. { { 27964852, 699996}, { 28664848, 0 } },
  83. { { 28664848, 0}, { 41427551, 0 } },
  84. { { 41427551, 0}, { 42127548, 699996 } }
  85. };
  86. Lines lines1 {
  87. { { 42127548, 699996}, { 42127548, 10135750 } },
  88. { { 42127548, 10135750}, { 50487352, 10135750 } },
  89. { { 50487352, 10135750}, { 50487352, 699995 } },
  90. { { 50487352, 699995}, { 51187348, 0 } },
  91. { { 51187348, 0}, { 51187348, 10835701 } },
  92. { { 51187348, 10835701}, { 41427552, 10835701 } },
  93. { { 41427552, 10835701}, { 41427552, 699996 } },
  94. { { 41427552, 699996}, { 28664848, 699996 } },
  95. { { 28664848, 699996}, { 28664848, 10835701 } },
  96. { { 28664848, 10835701}, { 19280052, 10835701 } },
  97. { { 19280052, 10835701}, { 27964852, 699996 } },
  98. { { 27964852, 699996}, { 28664848, 0 } },
  99. { { 28664848, 0}, { 41427551, 0 } },
  100. { { 41427551, 0}, { 42127548, 699996 } }
  101. };
  102. Lines lines2 {
  103. { { 42127548, 699996}, { 42127548, 10135750 } },
  104. { { 42127548, 10135750}, { 50487352, 10135750 } },
  105. { { 50487352, 10135750}, { 50487352, 699995 } },
  106. { { 50487352, 699995}, { 51187348, 0 } },
  107. { { 51187348, 0}, { 51187348, 10835701 } },
  108. { { 51187348, 10835701}, { 41427552, 10835701 } },
  109. { { 41427552, 10835701}, { 41427552, 699996 } },
  110. { { 41427552, 699996}, { 28664848, 699996 } },
  111. { { 28664848, 699996}, { 28664848, 10835701 } },
  112. { { 28664848, 10835701}, { 19280052, 10835701 } },
  113. { { 19280052, 10835701}, { 28664848, 0 } },
  114. { { 28664848, 0}, { 41427551, 0 } },
  115. { { 41427551, 0}, { 42127548, 699996 } }
  116. };
  117. Lines lines3 {
  118. { { 42127548, 699996}, { 42127548, 10135750 } },
  119. { { 42127548, 10135750}, { 50487352, 10135750 } },
  120. { { 50487352, 10135750}, { 50487352, 699995 } },
  121. { { 50487352, 699995}, { 51187348, 0 } },
  122. { { 51187348, 0}, { 51187348, 10835701 } },
  123. { { 51187348, 10835701}, { 41427552, 10835701 } },
  124. { { 41427552, 10835701}, { 41427552, 699996 } },
  125. { { 41427552, 699996}, { 41427551, 0 } },
  126. { { 41427551, 0}, { 42127548, 699996 } }
  127. };
  128. Lines lines4 {
  129. { { 42127548, 699996}, { 42127548, 10135750 } },
  130. { { 42127548, 10135750}, { 50487352, 10135750 } },
  131. { { 50487352, 10135750}, { 50487352, 699995 } },
  132. { { 50487352, 699995}, { 51187348, 0 } },
  133. { { 51187348, 0}, { 51187348, 10835701 } },
  134. { { 51187348, 10835701}, { 41427552, 10835701 } },
  135. { { 41427552, 10835701}, { 41427551, 0 } },
  136. { { 41427551, 0}, { 42127548, 699996 } }
  137. };
  138. Polygon poly {
  139. { 0, 10000000},
  140. { 700000, 1}, // it has to be 1, higher number, zero or -1 work.
  141. { 700000, 9000000},
  142. { 9100000, 9000000},
  143. { 9100000, 0},
  144. {10000000, 10000000}
  145. };
  146. #if 1
  147. // Try to rotate, maybe the issue is caused by incorrect handling of vertical or horizontal edges?
  148. double a = 0.18764587962597876897475f;
  149. double c = cos(a);
  150. double s = sin(a);
  151. for (Point &p : poly.points) {
  152. Vec2d q = p.cast<double>();
  153. p.x() = coord_t(q.x() * c + q.y() * s + 0.5);
  154. p.y() = coord_t(- q.x() * s + q.y() * c + 0.5);
  155. }
  156. #endif
  157. std::mt19937 gen;
  158. std::uniform_int_distribution<coord_t> dist(-100, 100);
  159. #if 0
  160. for (Point &p : poly.points) {
  161. // Wiggle the points a bit to find out whether this fixes the voronoi diagram for this particular polygon.
  162. p.x() = (p.x() += dist(gen));
  163. p.y() = (p.y() += dist(gen));
  164. }
  165. #endif
  166. REQUIRE(intersecting_edges({ poly }).empty());
  167. Lines lines = to_lines(poly);
  168. VD vd;
  169. construct_voronoi(lines.begin(), lines.end(), &vd);
  170. #ifdef VORONOI_DEBUG_OUT
  171. dump_voronoi_to_svg(debug_out_path("voronoi-lines.svg").c_str(),
  172. vd, Points(), lines);
  173. #endif
  174. }
  175. TEST_CASE("Voronoi weirdness", "[Voronoi]")
  176. {
  177. Polygon poly2 {
  178. { 0, 0 },
  179. { 70000000, 0 },
  180. { 70000000, 1300000 },
  181. // { 70000001, 14000000 }
  182. { 70700000, 14000000 }
  183. };
  184. Polygon poly5 {
  185. { 35058884, -25732145 },
  186. { 35058884, -19586070 },
  187. { 32753739, -20246796 },
  188. { 28756244, -21010725 },
  189. { 24657532, -21657939 },
  190. { 20836260, -21960233 },
  191. { 16115145, -22070742 },
  192. { 11850152, -21839761 },
  193. { 7646240, -21470177 },
  194. { 3607605, -20786940 },
  195. { 1280947, -20329742 },
  196. { -292823, -19963790 },
  197. { -3844469, -18809741 },
  198. { -7237277, -17593723 },
  199. { -10225900, -16143761 },
  200. { -13030266, -14643721 },
  201. { -15404294, -12977561 },
  202. { -17601713, -11280712 },
  203. { -19241930, -9435607 },
  204. { -20714420, -7583739 },
  205. { -21726144, -5664355 },
  206. { -22579294, -3741947 },
  207. { -22966684, -1786321 },
  208. { -23200322, 170140 },
  209. { -22966684, 2126602 },
  210. { -22579296, 4082227 },
  211. { -21726148, 6004637 },
  212. { -20714424, 7924020 },
  213. { -19241932, 9775888 },
  214. { -17601717, 11620994 },
  215. { -15404423, 13317749 },
  216. { -13030276, 14984003 },
  217. { -10225910, 16484042 },
  218. { -7237288, 17934005 },
  219. { -3844482, 19150025 },
  220. { -292841, 20304074 },
  221. { 1280949, 20670031 },
  222. { 3607587, 21127226 },
  223. { 7646218, 21810465 },
  224. { 11850128, 22180055 },
  225. { 16115122, 22411036 },
  226. { 20836263, 22300531 },
  227. { 24657513, 21998239 },
  228. { 28756227, 21351025 },
  229. { 32753725, 20587092 },
  230. { 35058893, 19926309 },
  231. { 35058893, 35000000 },
  232. { -31657232, 35000000 },
  233. { -31657202, -35000000 },
  234. { 35058881, -35000000 }
  235. };
  236. Polygon poly7 {
  237. { 35058884, -25732145 },
  238. { 35058884, -19586070 },
  239. { -31657202, -35000000 },
  240. { 35058881, -35000000 }
  241. };
  242. // coord_t shift = 35058881;
  243. // coord_t shift_ok = 17000000;
  244. coord_t shift = 35058881;
  245. Polygon poly {
  246. // <-4, 0>: bug
  247. // -5: ok
  248. // 1 - ok
  249. { 0 + shift, -35000000 },
  250. { 0 + shift, -25732145 },
  251. { 0 + shift, -19586070 },
  252. { -66716086 + shift, -35000000 }
  253. };
  254. REQUIRE(intersecting_edges({ poly }).empty());
  255. REQUIRE(poly.area() > 0.);
  256. #if 0
  257. // Try to rotate, maybe the issue is caused by incorrect handling of vertical or horizontal edges?
  258. double a = 0.18764587962597876897475f;
  259. double c = cos(a);
  260. double s = sin(a);
  261. for (Point &p : poly.points) {
  262. Vec2d q = p.cast<double>();
  263. p.x() = coord_t(q.x() * c + q.y() * s + 0.5);
  264. p.y() = coord_t(- q.x() * s + q.y() * c + 0.5);
  265. }
  266. #endif
  267. VD vd;
  268. Lines lines = to_lines(poly);
  269. construct_voronoi(lines.begin(), lines.end(), &vd);
  270. #ifdef VORONOI_DEBUG_OUT
  271. dump_voronoi_to_svg(debug_out_path("voronoi-weirdness.svg").c_str(),
  272. vd, Points(), lines);
  273. #endif
  274. }
  275. // https://svn.boost.org/trac10/ticket/12903
  276. // division by zero reported, but this issue is most likely a non-issue, as it produces an infinity for the interval of validity
  277. // of the floating point calculation, therefore forcing a recalculation with extended accuracy.
  278. TEST_CASE("Voronoi division by zero 12903", "[Voronoi]")
  279. {
  280. Points pts { { 1, 1 }, { 3, 1 }, { 1, 3 }, { 3, 3 },
  281. { -1, 1 }, { 1, -1 }, { 5, 1 }, { 3, -1 },
  282. { -1, 3 }, { 1, 5 }, { 5, 3 }, { 3, 5 } };
  283. {
  284. auto pts2 { pts };
  285. std::sort(pts2.begin(), pts2.end(), [](auto &l, auto &r) { return (l.x() == r.x()) ? l.y() < r.y() : l.x() < r.x(); });
  286. // No point removed -> no duplicate.
  287. REQUIRE(std::unique(pts2.begin(), pts2.end()) == pts2.end());
  288. }
  289. VD vd;
  290. construct_voronoi(pts.begin(), pts.end(), &vd);
  291. #ifdef VORONOI_DEBUG_OUT
  292. // Scale the voronoi vertices and input points, so that the dump_voronoi_to_svg will display them correctly.
  293. for (auto &pt : vd.vertices()) {
  294. const_cast<double&>(pt.x()) = scale_(pt.x());
  295. const_cast<double&>(pt.y()) = scale_(pt.y());
  296. }
  297. for (auto &pt : pts)
  298. pt = Point::new_scale(pt.x(), pt.y());
  299. dump_voronoi_to_svg(debug_out_path("voronoi-div-by-zero.svg").c_str(), vd, pts, Lines());
  300. #endif
  301. }
  302. // https://svn.boost.org/trac10/ticket/12139
  303. // Funny sample from a dental industry?
  304. // Vojtech confirms this test fails and rightly so, because the input data contain self intersections.
  305. // This test is suppressed.
  306. TEST_CASE("Voronoi NaN coordinates 12139", "[Voronoi][!hide][!mayfail]")
  307. {
  308. Lines lines = {
  309. { { 260500,1564400 }, { 261040,1562960 } },
  310. { { 261040,1562960 }, { 260840,1561780 } },
  311. { { 260840,1561780 }, { 262620,1561480 } },
  312. { { 262620,1561480 }, { 263160,1561220 } },
  313. { { 263160,1561220 }, { 264100,1563259 } },
  314. { { 264100,1563259 }, { 262380,1566980 } },
  315. { { 262380,1566980 }, { 260500,1564400 } },
  316. { { 137520,1851640 }, { 132160,1851100 } },
  317. { { 132160,1851100 }, { 126460,1848779 } },
  318. { { 126460,1848779 }, { 123960,1847320 } },
  319. { { 123960,1847320 }, { 120960,1844559 } },
  320. { { 120960,1844559 }, { 119640,1843040 } },
  321. { { 119640,1843040 }, { 118320,1840900 } },
  322. { { 118320,1840900 }, { 117920,1838120 } },
  323. { { 117920,1838120 }, { 118219,1833340 } },
  324. { { 118219,1833340 }, { 116180,1835000 } },
  325. { { 116180,1835000 }, { 115999,1834820 } },
  326. { { 115999,1834820 }, { 114240,1836340 } },
  327. { { 114240,1836340 }, { 112719,1837260 } },
  328. { { 112719,1837260 }, { 109460,1838239 } },
  329. { { 109460,1838239 }, { 103639,1837480 } },
  330. { { 103639,1837480 }, { 99819,1835460 } },
  331. { { 99819,1835460 }, { 96320,1834260 } },
  332. { { 96320,1834260 }, { 95339,1834260 } },
  333. { { 95339,1834260 }, { 93660,1833720 } },
  334. { { 93660,1833720 }, { 90719,1833300 } },
  335. { { 90719,1833300 }, { 87860,1831660 } },
  336. { { 87860,1831660 }, { 84580,1830499 } },
  337. { { 84580,1830499 }, { 79780,1827419 } },
  338. { { 79780,1827419 }, { 76020,1824280 } },
  339. { { 76020,1824280 }, { 73680,1821180 } },
  340. { { 73680,1821180 }, { 72560,1818960 } },
  341. { { 72560,1818960 }, { 71699,1817719 } },
  342. { { 71699,1817719 }, { 70280,1814260 } },
  343. { { 70280,1814260 }, { 69460,1811060 } },
  344. { { 69460,1811060 }, { 69659,1807320 } },
  345. { { 69659,1807320 }, { 69640,1803300 } },
  346. { { 69640,1803300 }, { 69360,1799780 } },
  347. { { 69360,1799780 }, { 69320,1796720 } },
  348. { { 69320,1796720 }, { 69640,1793980 } },
  349. { { 69640,1793980 }, { 70160,1791780 } },
  350. { { 70160,1791780 }, { 72460,1784879 } },
  351. { { 72460,1784879 }, { 74420,1780780 } },
  352. { { 74420,1780780 }, { 76500,1772899 } },
  353. { { 76500,1772899 }, { 76760,1769359 } },
  354. { { 76760,1769359 }, { 76480,1766259 } },
  355. { { 76480,1766259 }, { 76839,1760360 } },
  356. { { 76839,1760360 }, { 77539,1756680 } },
  357. { { 77539,1756680 }, { 80540,1748140 } },
  358. { { 80540,1748140 }, { 84200,1742619 } },
  359. { { 84200,1742619 }, { 90900,1735220 } },
  360. { { 90900,1735220 }, { 94159,1732679 } },
  361. { { 94159,1732679 }, { 101259,1729559 } },
  362. { { 101259,1729559 }, { 107299,1727939 } },
  363. { { 107299,1727939 }, { 110979,1727919 } },
  364. { { 110979,1727919 }, { 113499,1727240 } },
  365. { { 113499,1727240 }, { 113619,1727359 } },
  366. { { 113619,1727359 }, { 114280,1727280 } },
  367. { { 114280,1727280 }, { 131440,1732560 } },
  368. { { 131440,1732560 }, { 118140,1727119 } },
  369. { { 118140,1727119 }, { 117120,1723759 } },
  370. { { 117120,1723759 }, { 113840,1720660 } },
  371. { { 113840,1720660 }, { 111399,1716760 } },
  372. { { 111399,1716760 }, { 109700,1712979 } },
  373. { { 109700,1712979 }, { 108879,1708400 } },
  374. { { 108879,1708400 }, { 108060,1696360 } },
  375. { { 108060,1696360 }, { 110040,1687760 } },
  376. { { 110040,1687760 }, { 112140,1682480 } },
  377. { { 112140,1682480 }, { 112540,1681780 } },
  378. { { 112540,1681780 }, { 115260,1678320 } },
  379. { { 115260,1678320 }, { 118720,1675320 } },
  380. { { 118720,1675320 }, { 126100,1670980 } },
  381. { { 126100,1670980 }, { 132400,1668080 } },
  382. { { 132400,1668080 }, { 136700,1667440 } },
  383. { { 136700,1667440 }, { 142440,1667159 } },
  384. { { 142440,1667159 }, { 143340,1666720 } },
  385. { { 143340,1666720 }, { 138679,1661319 } },
  386. { { 138679,1661319 }, { 137240,1657480 } },
  387. { { 137240,1657480 }, { 136760,1650739 } },
  388. { { 136760,1650739 }, { 136780,1647339 } },
  389. { { 136780,1647339 }, { 135940,1644280 } },
  390. { { 135940,1644280 }, { 136000,1640820 } },
  391. { { 136000,1640820 }, { 135480,1638020 } },
  392. { { 135480,1638020 }, { 137060,1634220 } },
  393. { { 137060,1634220 }, { 136320,1631340 } },
  394. { { 136320,1631340 }, { 134620,1629700 } },
  395. { { 134620,1629700 }, { 132460,1628199 } },
  396. { { 132460,1628199 }, { 132299,1627860 } },
  397. { { 132299,1627860 }, { 138360,1618020 } },
  398. { { 138360,1618020 }, { 142440,1611859 } },
  399. { { 142440,1611859 }, { 143180,1611299 } },
  400. { { 143180,1611299 }, { 144000,1611259 } },
  401. { { 144000,1611259 }, { 145960,1612540 } },
  402. { { 145960,1612540 }, { 146720,1613700 } },
  403. { { 146720,1613700 }, { 147700,1613539 } },
  404. { { 147700,1613539 }, { 148520,1614039 } },
  405. { { 148520,1614039 }, { 149840,1613740 } },
  406. { { 149840,1613740 }, { 150620,1614079 } },
  407. { { 150620,1614079 }, { 154760,1612740 } },
  408. { { 154760,1612740 }, { 159000,1608420 } },
  409. { { 159000,1608420 }, { 161120,1606780 } },
  410. { { 161120,1606780 }, { 164060,1605139 } },
  411. { { 164060,1605139 }, { 168079,1603620 } },
  412. { { 168079,1603620 }, { 170240,1603400 } },
  413. { { 170240,1603400 }, { 172400,1603499 } },
  414. { { 172400,1603499 }, { 194440,1613740 } },
  415. { { 194440,1613740 }, { 195880,1616460 } },
  416. { { 195880,1616460 }, { 197060,1618140 } },
  417. { { 197060,1618140 }, { 198039,1617860 } },
  418. { { 198039,1617860 }, { 198739,1618900 } },
  419. { { 198739,1618900 }, { 200259,1619200 } },
  420. { { 200259,1619200 }, { 201940,1618920 } },
  421. { { 201940,1618920 }, { 201700,1617139 } },
  422. { { 201700,1617139 }, { 203860,1618179 } },
  423. { { 203860,1618179 }, { 203500,1617540 } },
  424. { { 203500,1617540 }, { 205000,1616579 } },
  425. { { 205000,1616579 }, { 206780,1615020 } },
  426. { { 206780,1615020 }, { 210159,1614059 } },
  427. { { 210159,1614059 }, { 217080,1611080 } },
  428. { { 217080,1611080 }, { 219200,1611579 } },
  429. { { 219200,1611579 }, { 223219,1610980 } },
  430. { { 223219,1610980 }, { 224580,1610540 } },
  431. { { 224580,1610540 }, { 227460,1611440 } },
  432. { { 227460,1611440 }, { 229359,1611859 } },
  433. { { 229359,1611859 }, { 230620,1612580 } },
  434. { { 230620,1612580 }, { 232340,1614460 } },
  435. { { 232340,1614460 }, { 232419,1617040 } },
  436. { { 232419,1617040 }, { 231740,1619480 } },
  437. { { 231740,1619480 }, { 231880,1624899 } },
  438. { { 231880,1624899 }, { 231540,1625820 } },
  439. { { 231540,1625820 }, { 231700,1627079 } },
  440. { { 231700,1627079 }, { 231320,1628239 } },
  441. { { 231320,1628239 }, { 231420,1636080 } },
  442. { { 231420,1636080 }, { 231099,1637200 } },
  443. { { 231099,1637200 }, { 228660,1643280 } },
  444. { { 228660,1643280 }, { 227699,1644960 } },
  445. { { 227699,1644960 }, { 226080,1651140 } },
  446. { { 226080,1651140 }, { 225259,1653420 } },
  447. { { 225259,1653420 }, { 225159,1655399 } },
  448. { { 225159,1655399 }, { 223760,1659260 } },
  449. { { 223760,1659260 }, { 219860,1666360 } },
  450. { { 219860,1666360 }, { 219180,1667220 } },
  451. { { 219180,1667220 }, { 212580,1673680 } },
  452. { { 212580,1673680 }, { 207880,1676460 } },
  453. { { 207880,1676460 }, { 205560,1677560 } },
  454. { { 205560,1677560 }, { 199700,1678920 } },
  455. { { 199700,1678920 }, { 195280,1679420 } },
  456. { { 195280,1679420 }, { 193939,1679879 } },
  457. { { 193939,1679879 }, { 188780,1679440 } },
  458. { { 188780,1679440 }, { 188100,1679639 } },
  459. { { 188100,1679639 }, { 186680,1679339 } },
  460. { { 186680,1679339 }, { 184760,1679619 } },
  461. { { 184760,1679619 }, { 183520,1681440 } },
  462. { { 183520,1681440 }, { 183860,1682200 } },
  463. { { 183860,1682200 }, { 186620,1686120 } },
  464. { { 186620,1686120 }, { 190380,1688380 } },
  465. { { 190380,1688380 }, { 192780,1690739 } },
  466. { { 192780,1690739 }, { 195860,1694839 } },
  467. { { 195860,1694839 }, { 196620,1696539 } },
  468. { { 196620,1696539 }, { 197540,1701819 } },
  469. { { 197540,1701819 }, { 198939,1705699 } },
  470. { { 198939,1705699 }, { 198979,1711819 } },
  471. { { 198979,1711819 }, { 198240,1716900 } },
  472. { { 198240,1716900 }, { 197440,1720139 } },
  473. { { 197440,1720139 }, { 195340,1724639 } },
  474. { { 195340,1724639 }, { 194040,1726140 } },
  475. { { 194040,1726140 }, { 192559,1728239 } },
  476. { { 192559,1728239 }, { 187780,1732339 } },
  477. { { 187780,1732339 }, { 182519,1735520 } },
  478. { { 182519,1735520 }, { 181239,1736140 } },
  479. { { 181239,1736140 }, { 177340,1737619 } },
  480. { { 177340,1737619 }, { 175439,1738140 } },
  481. { { 175439,1738140 }, { 171380,1738880 } },
  482. { { 171380,1738880 }, { 167860,1739059 } },
  483. { { 167860,1739059 }, { 166040,1738920 } },
  484. { { 166040,1738920 }, { 163680,1738539 } },
  485. { { 163680,1738539 }, { 157660,1736859 } },
  486. { { 157660,1736859 }, { 154900,1735460 } },
  487. { { 154900,1735460 }, { 151420,1735159 } },
  488. { { 151420,1735159 }, { 142100,1736160 } },
  489. { { 142100,1736160 }, { 140880,1735920 } },
  490. { { 140880,1735920 }, { 142820,1736859 } },
  491. { { 142820,1736859 }, { 144080,1737240 } },
  492. { { 144080,1737240 }, { 144280,1737460 } },
  493. { { 144280,1737460 }, { 144239,1738120 } },
  494. { { 144239,1738120 }, { 144980,1739420 } },
  495. { { 144980,1739420 }, { 146340,1741039 } },
  496. { { 146340,1741039 }, { 147160,1741720 } },
  497. { { 147160,1741720 }, { 154260,1745800 } },
  498. { { 154260,1745800 }, { 156560,1746879 } },
  499. { { 156560,1746879 }, { 165180,1752679 } },
  500. { { 165180,1752679 }, { 168240,1755860 } },
  501. { { 168240,1755860 }, { 170940,1759260 } },
  502. { { 170940,1759260 }, { 173440,1762079 } },
  503. { { 173440,1762079 }, { 174540,1764079 } },
  504. { { 174540,1764079 }, { 176479,1766640 } },
  505. { { 176479,1766640 }, { 178900,1768960 } },
  506. { { 178900,1768960 }, { 180819,1772780 } },
  507. { { 180819,1772780 }, { 181479,1776859 } },
  508. { { 181479,1776859 }, { 181660,1788499 } },
  509. { { 181660,1788499 }, { 181460,1791740 } },
  510. { { 181460,1791740 }, { 181160,1792840 } },
  511. { { 181160,1792840 }, { 179580,1797180 } },
  512. { { 179580,1797180 }, { 174620,1808960 } },
  513. { { 174620,1808960 }, { 174100,1809839 } },
  514. { { 174100,1809839 }, { 171660,1812419 } },
  515. { { 171660,1812419 }, { 169639,1813840 } },
  516. { { 169639,1813840 }, { 168880,1814720 } },
  517. { { 168880,1814720 }, { 168960,1815980 } },
  518. { { 168960,1815980 }, { 169979,1819160 } },
  519. { { 169979,1819160 }, { 170080,1820159 } },
  520. { { 170080,1820159 }, { 168280,1830540 } },
  521. { { 168280,1830540 }, { 167580,1832200 } },
  522. { { 167580,1832200 }, { 165679,1835720 } },
  523. { { 165679,1835720 }, { 164720,1836819 } },
  524. { { 164720,1836819 }, { 161840,1841740 } },
  525. { { 161840,1841740 }, { 159880,1843519 } },
  526. { { 159880,1843519 }, { 158959,1844120 } },
  527. { { 158959,1844120 }, { 154960,1847500 } },
  528. { { 154960,1847500 }, { 152140,1848580 } },
  529. { { 152140,1848580 }, { 150440,1849520 } },
  530. { { 150440,1849520 }, { 144940,1850980 } },
  531. { { 144940,1850980 }, { 138340,1851700 } },
  532. { { 138340,1851700 }, { 137520,1851640 } },
  533. { { 606940,1873860 }, { 602860,1872460 } },
  534. { { 602860,1872460 }, { 600680,1871539 } },
  535. { { 600680,1871539 }, { 599300,1870640 } },
  536. { { 599300,1870640 }, { 598120,1869579 } },
  537. { { 598120,1869579 }, { 594680,1867180 } },
  538. { { 594680,1867180 }, { 589680,1861460 } },
  539. { { 589680,1861460 }, { 586300,1855020 } },
  540. { { 586300,1855020 }, { 584700,1848060 } },
  541. { { 584700,1848060 }, { 585199,1843499 } },
  542. { { 585199,1843499 }, { 584000,1842079 } },
  543. { { 584000,1842079 }, { 582900,1841480 } },
  544. { { 582900,1841480 }, { 581020,1839899 } },
  545. { { 581020,1839899 }, { 579440,1838040 } },
  546. { { 579440,1838040 }, { 577840,1834299 } },
  547. { { 577840,1834299 }, { 576160,1831859 } },
  548. { { 576160,1831859 }, { 574540,1828499 } },
  549. { { 574540,1828499 }, { 572140,1822860 } },
  550. { { 572140,1822860 }, { 570180,1815219 } },
  551. { { 570180,1815219 }, { 570080,1812280 } },
  552. { { 570080,1812280 }, { 570340,1808300 } },
  553. { { 570340,1808300 }, { 570160,1807119 } },
  554. { { 570160,1807119 }, { 570140,1804039 } },
  555. { { 570140,1804039 }, { 571640,1796660 } },
  556. { { 571640,1796660 }, { 571740,1794680 } },
  557. { { 571740,1794680 }, { 572279,1794039 } },
  558. { { 572279,1794039 }, { 575480,1788300 } },
  559. { { 575480,1788300 }, { 576379,1787419 } },
  560. { { 576379,1787419 }, { 577020,1786120 } },
  561. { { 577020,1786120 }, { 578000,1785100 } },
  562. { { 578000,1785100 }, { 579960,1783720 } },
  563. { { 579960,1783720 }, { 581420,1782079 } },
  564. { { 581420,1782079 }, { 585480,1778440 } },
  565. { { 585480,1778440 }, { 586680,1777079 } },
  566. { { 586680,1777079 }, { 590520,1774639 } },
  567. { { 590520,1774639 }, { 592440,1773199 } },
  568. { { 592440,1773199 }, { 595160,1772260 } },
  569. { { 595160,1772260 }, { 598079,1770920 } },
  570. { { 598079,1770920 }, { 601420,1769019 } },
  571. { { 601420,1769019 }, { 606400,1767280 } },
  572. { { 606400,1767280 }, { 607320,1766620 } },
  573. { { 607320,1766620 }, { 605760,1766460 } },
  574. { { 605760,1766460 }, { 604420,1766780 } },
  575. { { 604420,1766780 }, { 601660,1766579 } },
  576. { { 601660,1766579 }, { 597160,1766980 } },
  577. { { 597160,1766980 }, { 591420,1766720 } },
  578. { { 591420,1766720 }, { 585360,1765460 } },
  579. { { 585360,1765460 }, { 578540,1763680 } },
  580. { { 578540,1763680 }, { 574020,1761599 } },
  581. { { 574020,1761599 }, { 572520,1760560 } },
  582. { { 572520,1760560 }, { 570959,1759000 } },
  583. { { 570959,1759000 }, { 566580,1755620 } },
  584. { { 566580,1755620 }, { 563820,1752000 } },
  585. { { 563820,1752000 }, { 563140,1751380 } },
  586. { { 563140,1751380 }, { 560800,1747899 } },
  587. { { 560800,1747899 }, { 558640,1742280 } },
  588. { { 558640,1742280 }, { 557860,1741620 } },
  589. { { 557860,1741620 }, { 555820,1739099 } },
  590. { { 555820,1739099 }, { 553920,1737540 } },
  591. { { 553920,1737540 }, { 551900,1735179 } },
  592. { { 551900,1735179 }, { 551180,1733880 } },
  593. { { 551180,1733880 }, { 549540,1729559 } },
  594. { { 549540,1729559 }, { 548860,1720720 } },
  595. { { 548860,1720720 }, { 549080,1719099 } },
  596. { { 549080,1719099 }, { 548200,1714700 } },
  597. { { 548200,1714700 }, { 547560,1713860 } },
  598. { { 547560,1713860 }, { 544500,1711259 } },
  599. { { 544500,1711259 }, { 543939,1709780 } },
  600. { { 543939,1709780 }, { 544520,1705439 } },
  601. { { 544520,1705439 }, { 543520,1701519 } },
  602. { { 543520,1701519 }, { 543920,1699319 } },
  603. { { 543920,1699319 }, { 546360,1697440 } },
  604. { { 546360,1697440 }, { 546680,1695419 } },
  605. { { 546680,1695419 }, { 545600,1694180 } },
  606. { { 545600,1694180 }, { 543220,1692000 } },
  607. { { 543220,1692000 }, { 538260,1685139 } },
  608. { { 538260,1685139 }, { 537540,1683000 } },
  609. { { 537540,1683000 }, { 537020,1682220 } },
  610. { { 537020,1682220 }, { 535560,1675940 } },
  611. { { 535560,1675940 }, { 535940,1671220 } },
  612. { { 535940,1671220 }, { 536320,1669379 } },
  613. { { 536320,1669379 }, { 535420,1666400 } },
  614. { { 535420,1666400 }, { 533540,1664460 } },
  615. { { 533540,1664460 }, { 530720,1662860 } },
  616. { { 530720,1662860 }, { 529240,1662260 } },
  617. { { 529240,1662260 }, { 528780,1659160 } },
  618. { { 528780,1659160 }, { 528820,1653560 } },
  619. { { 528820,1653560 }, { 529779,1650900 } },
  620. { { 529779,1650900 }, { 536760,1640840 } },
  621. { { 536760,1640840 }, { 540360,1636120 } },
  622. { { 540360,1636120 }, { 541160,1635380 } },
  623. { { 541160,1635380 }, { 544719,1629480 } },
  624. { { 544719,1629480 }, { 545319,1626140 } },
  625. { { 545319,1626140 }, { 543560,1623740 } },
  626. { { 543560,1623740 }, { 539880,1620739 } },
  627. { { 539880,1620739 }, { 533400,1617300 } },
  628. { { 533400,1617300 }, { 527840,1613020 } },
  629. { { 527840,1613020 }, { 525200,1611579 } },
  630. { { 525200,1611579 }, { 524360,1610800 } },
  631. { { 524360,1610800 }, { 517320,1605739 } },
  632. { { 517320,1605739 }, { 516240,1604240 } },
  633. { { 516240,1604240 }, { 515220,1602000 } },
  634. { { 515220,1602000 }, { 514079,1594240 } },
  635. { { 514079,1594240 }, { 513740,1581460 } },
  636. { { 513740,1581460 }, { 514660,1577359 } },
  637. { { 514660,1577359 }, { 514660,1576380 } },
  638. { { 514660,1576380 }, { 514199,1575380 } },
  639. { { 514199,1575380 }, { 514680,1572860 } },
  640. { { 514680,1572860 }, { 513440,1573940 } },
  641. { { 513440,1573940 }, { 512399,1575580 } },
  642. { { 512399,1575580 }, { 511620,1576220 } },
  643. { { 511620,1576220 }, { 507840,1581880 } },
  644. { { 507840,1581880 }, { 504600,1584579 } },
  645. { { 504600,1584579 }, { 502440,1584599 } },
  646. { { 502440,1584599 }, { 499060,1584059 } },
  647. { { 499060,1584059 }, { 498019,1581960 } },
  648. { { 498019,1581960 }, { 497819,1581240 } },
  649. { { 497819,1581240 }, { 498019,1576039 } },
  650. { { 498019,1576039 }, { 497539,1574740 } },
  651. { { 497539,1574740 }, { 495459,1574460 } },
  652. { { 495459,1574460 }, { 492320,1575600 } },
  653. { { 492320,1575600 }, { 491040,1576360 } },
  654. { { 491040,1576360 }, { 490080,1575640 } },
  655. { { 490080,1575640 }, { 490020,1575040 } },
  656. { { 490020,1575040 }, { 490220,1574400 } },
  657. { { 490220,1574400 }, { 490819,1573440 } },
  658. { { 490819,1573440 }, { 492680,1568259 } },
  659. { { 492680,1568259 }, { 492920,1566799 } },
  660. { { 492920,1566799 }, { 495760,1563660 } },
  661. { { 495760,1563660 }, { 496100,1562139 } },
  662. { { 496100,1562139 }, { 497879,1560240 } },
  663. { { 497879,1560240 }, { 497059,1558020 } },
  664. { { 497059,1558020 }, { 495620,1557399 } },
  665. { { 495620,1557399 }, { 494800,1556839 } },
  666. { { 494800,1556839 }, { 493500,1555479 } },
  667. { { 493500,1555479 }, { 491860,1554100 } },
  668. { { 491860,1554100 }, { 487840,1552139 } },
  669. { { 487840,1552139 }, { 485900,1551720 } },
  670. { { 485900,1551720 }, { 483639,1555439 } },
  671. { { 483639,1555439 }, { 482080,1556480 } },
  672. { { 482080,1556480 }, { 480200,1556259 } },
  673. { { 480200,1556259 }, { 478519,1556259 } },
  674. { { 478519,1556259 }, { 474020,1554019 } },
  675. { { 474020,1554019 }, { 472660,1551539 } },
  676. { { 472660,1551539 }, { 471260,1549899 } },
  677. { { 471260,1549899 }, { 470459,1548020 } },
  678. { { 470459,1548020 }, { 469920,1545479 } },
  679. { { 469920,1545479 }, { 469079,1542939 } },
  680. { { 469079,1542939 }, { 469120,1541799 } },
  681. { { 469120,1541799 }, { 465840,1537139 } },
  682. { { 465840,1537139 }, { 463360,1539059 } },
  683. { { 463360,1539059 }, { 459680,1546900 } },
  684. { { 459680,1546900 }, { 458439,1547160 } },
  685. { { 458439,1547160 }, { 456480,1549319 } },
  686. { { 456480,1549319 }, { 454160,1551400 } },
  687. { { 454160,1551400 }, { 452819,1550820 } },
  688. { { 452819,1550820 }, { 451699,1549839 } },
  689. { { 451699,1549839 }, { 449620,1548440 } },
  690. { { 449620,1548440 }, { 449419,1548080 } },
  691. { { 449419,1548080 }, { 447879,1547720 } },
  692. { { 447879,1547720 }, { 446540,1546819 } },
  693. { { 446540,1546819 }, { 445720,1545640 } },
  694. { { 445720,1545640 }, { 444800,1545100 } },
  695. { { 444800,1545100 }, { 443500,1542899 } },
  696. { { 443500,1542899 }, { 443320,1541799 } },
  697. { { 443320,1541799 }, { 443519,1540220 } },
  698. { { 443519,1540220 }, { 445060,1537099 } },
  699. { { 445060,1537099 }, { 445840,1533040 } },
  700. { { 445840,1533040 }, { 442720,1529079 } },
  701. { { 442720,1529079 }, { 442479,1528360 } },
  702. { { 442479,1528360 }, { 436820,1529240 } },
  703. { { 436820,1529240 }, { 436279,1529200 } },
  704. { { 436279,1529200 }, { 433280,1529859 } },
  705. { { 433280,1529859 }, { 420220,1529899 } },
  706. { { 420220,1529899 }, { 414740,1528539 } },
  707. { { 414740,1528539 }, { 411340,1527960 } },
  708. { { 411340,1527960 }, { 406860,1524660 } },
  709. { { 406860,1524660 }, { 405379,1523080 } },
  710. { { 405379,1523080 }, { 403639,1520320 } },
  711. { { 403639,1520320 }, { 402040,1517220 } },
  712. { { 402040,1517220 }, { 400519,1517059 } },
  713. { { 400519,1517059 }, { 399180,1516720 } },
  714. { { 399180,1516720 }, { 395300,1515179 } },
  715. { { 395300,1515179 }, { 394780,1515080 } },
  716. { { 394780,1515080 }, { 394759,1515900 } },
  717. { { 394759,1515900 }, { 394339,1516579 } },
  718. { { 394339,1516579 }, { 393200,1516640 } },
  719. { { 393200,1516640 }, { 392599,1521799 } },
  720. { { 392599,1521799 }, { 391699,1525200 } },
  721. { { 391699,1525200 }, { 391040,1525600 } },
  722. { { 391040,1525600 }, { 390540,1526500 } },
  723. { { 390540,1526500 }, { 388999,1527939 } },
  724. { { 388999,1527939 }, { 387059,1531100 } },
  725. { { 387059,1531100 }, { 386540,1531440 } },
  726. { { 386540,1531440 }, { 382140,1531839 } },
  727. { { 382140,1531839 }, { 377360,1532619 } },
  728. { { 377360,1532619 }, { 375640,1532220 } },
  729. { { 375640,1532220 }, { 372580,1531019 } },
  730. { { 372580,1531019 }, { 371079,1529019 } },
  731. { { 371079,1529019 }, { 367280,1526039 } },
  732. { { 367280,1526039 }, { 366460,1521900 } },
  733. { { 366460,1521900 }, { 364320,1516400 } },
  734. { { 364320,1516400 }, { 363779,1515780 } },
  735. { { 363779,1515780 }, { 362220,1515320 } },
  736. { { 362220,1515320 }, { 361979,1515060 } },
  737. { { 361979,1515060 }, { 360820,1515739 } },
  738. { { 360820,1515739 }, { 353360,1518620 } },
  739. { { 353360,1518620 }, { 347840,1520080 } },
  740. { { 347840,1520080 }, { 342399,1521140 } },
  741. { { 342399,1521140 }, { 334899,1523380 } },
  742. { { 334899,1523380 }, { 333220,1523400 } },
  743. { { 333220,1523400 }, { 332599,1522919 } },
  744. { { 332599,1522919 }, { 329780,1521640 } },
  745. { { 329780,1521640 }, { 325360,1521220 } },
  746. { { 325360,1521220 }, { 319000,1520999 } },
  747. { { 319000,1520999 }, { 316180,1520240 } },
  748. { { 316180,1520240 }, { 312700,1518960 } },
  749. { { 312700,1518960 }, { 310520,1517679 } },
  750. { { 310520,1517679 }, { 309280,1517260 } },
  751. { { 309280,1517260 }, { 306440,1515040 } },
  752. { { 306440,1515040 }, { 304140,1512780 } },
  753. { { 304140,1512780 }, { 301640,1509720 } },
  754. { { 301640,1509720 }, { 301500,1509879 } },
  755. { { 301500,1509879 }, { 300320,1509059 } },
  756. { { 300320,1509059 }, { 299140,1507339 } },
  757. { { 299140,1507339 }, { 297340,1502659 } },
  758. { { 297340,1502659 }, { 298960,1508280 } },
  759. { { 298960,1508280 }, { 299120,1509299 } },
  760. { { 299120,1509299 }, { 298720,1510100 } },
  761. { { 298720,1510100 }, { 298420,1512240 } },
  762. { { 298420,1512240 }, { 297420,1514540 } },
  763. { { 297420,1514540 }, { 296900,1515340 } },
  764. { { 296900,1515340 }, { 294780,1517500 } },
  765. { { 294780,1517500 }, { 293040,1518380 } },
  766. { { 293040,1518380 }, { 289140,1521360 } },
  767. { { 289140,1521360 }, { 283600,1523300 } },
  768. { { 283600,1523300 }, { 280140,1525220 } },
  769. { { 280140,1525220 }, { 279620,1525679 } },
  770. { { 279620,1525679 }, { 274960,1527379 } },
  771. { { 274960,1527379 }, { 273440,1528819 } },
  772. { { 273440,1528819 }, { 269840,1532840 } },
  773. { { 269840,1532840 }, { 264800,1536240 } },
  774. { { 264800,1536240 }, { 261199,1540419 } },
  775. { { 261199,1540419 }, { 257359,1541400 } },
  776. { { 257359,1541400 }, { 250460,1539299 } },
  777. { { 250460,1539299 }, { 250240,1539400 } },
  778. { { 250240,1539400 }, { 249840,1540460 } },
  779. { { 249840,1540460 }, { 249779,1541140 } },
  780. { { 249779,1541140 }, { 248482,1539783 } },
  781. { { 248482,1539783 }, { 251320,1544120 } },
  782. { { 251320,1544120 }, { 252500,1548320 } },
  783. { { 252500,1548320 }, { 252519,1549740 } },
  784. { { 252519,1549740 }, { 253000,1553140 } },
  785. { { 253000,1553140 }, { 252920,1556539 } },
  786. { { 252920,1556539 }, { 253160,1556700 } },
  787. { { 253160,1556700 }, { 254019,1558220 } },
  788. { { 254019,1558220 }, { 253039,1559339 } },
  789. { { 253039,1559339 }, { 252300,1561920 } },
  790. { { 252300,1561920 }, { 251080,1565260 } },
  791. { { 251080,1565260 }, { 251120,1566160 } },
  792. { { 251120,1566160 }, { 249979,1570240 } },
  793. { { 249979,1570240 }, { 248799,1575380 } },
  794. { { 248799,1575380 }, { 247180,1579520 } },
  795. { { 247180,1579520 }, { 243380,1588440 } },
  796. { { 243380,1588440 }, { 241700,1591780 } },
  797. { { 241700,1591780 }, { 240280,1593080 } },
  798. { { 240280,1593080 }, { 231859,1598380 } },
  799. { { 231859,1598380 }, { 228840,1600060 } },
  800. { { 228840,1600060 }, { 226420,1601080 } },
  801. { { 226420,1601080 }, { 223620,1601940 } },
  802. { { 223620,1601940 }, { 220919,1603819 } },
  803. { { 220919,1603819 }, { 219599,1604420 } },
  804. { { 219599,1604420 }, { 218380,1605200 } },
  805. { { 218380,1605200 }, { 213219,1607260 } },
  806. { { 213219,1607260 }, { 210040,1607740 } },
  807. { { 210040,1607740 }, { 186439,1596440 } },
  808. { { 186439,1596440 }, { 185159,1594559 } },
  809. { { 185159,1594559 }, { 182239,1588300 } },
  810. { { 182239,1588300 }, { 181040,1585380 } },
  811. { { 181040,1585380 }, { 180380,1578580 } },
  812. { { 180380,1578580 }, { 180679,1573220 } },
  813. { { 180679,1573220 }, { 181220,1568539 } },
  814. { { 181220,1568539 }, { 181859,1565020 } },
  815. { { 181859,1565020 }, { 184499,1555500 } },
  816. { { 184499,1555500 }, { 183480,1558160 } },
  817. { { 183480,1558160 }, { 182600,1561700 } },
  818. { { 182600,1561700 }, { 171700,1554359 } },
  819. { { 171700,1554359 }, { 176880,1545920 } },
  820. { { 176880,1545920 }, { 189940,1529000 } },
  821. { { 189940,1529000 }, { 200040,1535759 } },
  822. { { 200040,1535759 }, { 207559,1531660 } },
  823. { { 207559,1531660 }, { 218039,1527520 } },
  824. { { 218039,1527520 }, { 222360,1526640 } },
  825. { { 222360,1526640 }, { 225439,1526440 } },
  826. { { 225439,1526440 }, { 231160,1527079 } },
  827. { { 231160,1527079 }, { 232300,1527399 } },
  828. { { 232300,1527399 }, { 236579,1529140 } },
  829. { { 236579,1529140 }, { 238139,1529120 } },
  830. { { 238139,1529120 }, { 238799,1529319 } },
  831. { { 238799,1529319 }, { 240999,1531780 } },
  832. { { 240999,1531780 }, { 238280,1528799 } },
  833. { { 238280,1528799 }, { 236900,1523840 } },
  834. { { 236900,1523840 }, { 236800,1522700 } },
  835. { { 236800,1522700 }, { 235919,1518880 } },
  836. { { 235919,1518880 }, { 236080,1514299 } },
  837. { { 236080,1514299 }, { 238260,1508380 } },
  838. { { 238260,1508380 }, { 240119,1505159 } },
  839. { { 240119,1505159 }, { 233319,1496360 } },
  840. { { 233319,1496360 }, { 239140,1490759 } },
  841. { { 239140,1490759 }, { 258760,1478080 } },
  842. { { 258760,1478080 }, { 263940,1484760 } },
  843. { { 263940,1484760 }, { 263460,1485159 } },
  844. { { 263460,1485159 }, { 265960,1483519 } },
  845. { { 265960,1483519 }, { 270380,1482020 } },
  846. { { 270380,1482020 }, { 272880,1481420 } },
  847. { { 272880,1481420 }, { 275700,1481400 } },
  848. { { 275700,1481400 }, { 278380,1481740 } },
  849. { { 278380,1481740 }, { 281220,1482979 } },
  850. { { 281220,1482979 }, { 284680,1484859 } },
  851. { { 284680,1484859 }, { 285979,1486140 } },
  852. { { 285979,1486140 }, { 290220,1489100 } },
  853. { { 290220,1489100 }, { 292680,1489520 } },
  854. { { 292680,1489520 }, { 293280,1490240 } },
  855. { { 293280,1490240 }, { 293140,1489160 } },
  856. { { 293140,1489160 }, { 293280,1488580 } },
  857. { { 293280,1488580 }, { 294100,1486980 } },
  858. { { 294100,1486980 }, { 294580,1484960 } },
  859. { { 294580,1484960 }, { 295680,1481660 } },
  860. { { 295680,1481660 }, { 297840,1477339 } },
  861. { { 297840,1477339 }, { 302240,1472280 } },
  862. { { 302240,1472280 }, { 307120,1469000 } },
  863. { { 307120,1469000 }, { 314500,1466340 } },
  864. { { 314500,1466340 }, { 324979,1464740 } },
  865. { { 324979,1464740 }, { 338999,1462059 } },
  866. { { 338999,1462059 }, { 345599,1461579 } },
  867. { { 345599,1461579 }, { 349020,1461620 } },
  868. { { 349020,1461620 }, { 353420,1461160 } },
  869. { { 353420,1461160 }, { 357000,1461500 } },
  870. { { 357000,1461500 }, { 359860,1461579 } },
  871. { { 359860,1461579 }, { 364520,1462740 } },
  872. { { 364520,1462740 }, { 367280,1464000 } },
  873. { { 367280,1464000 }, { 372020,1467560 } },
  874. { { 372020,1467560 }, { 373999,1469980 } },
  875. { { 373999,1469980 }, { 375580,1472240 } },
  876. { { 375580,1472240 }, { 376680,1474460 } },
  877. { { 376680,1474460 }, { 377259,1478620 } },
  878. { { 377259,1478620 }, { 379279,1480880 } },
  879. { { 379279,1480880 }, { 379260,1481600 } },
  880. { { 379260,1481600 }, { 378760,1482000 } },
  881. { { 378760,1482000 }, { 379300,1482040 } },
  882. { { 379300,1482040 }, { 380220,1482460 } },
  883. { { 380220,1482460 }, { 380840,1483020 } },
  884. { { 380840,1483020 }, { 385519,1482600 } },
  885. { { 385519,1482600 }, { 386019,1482320 } },
  886. { { 386019,1482320 }, { 386499,1481600 } },
  887. { { 386499,1481600 }, { 386540,1480139 } },
  888. { { 386540,1480139 }, { 387500,1478220 } },
  889. { { 387500,1478220 }, { 388280,1476100 } },
  890. { { 388280,1476100 }, { 390060,1473000 } },
  891. { { 390060,1473000 }, { 393659,1469460 } },
  892. { { 393659,1469460 }, { 396540,1467860 } },
  893. { { 396540,1467860 }, { 401260,1466040 } },
  894. { { 401260,1466040 }, { 406200,1465100 } },
  895. { { 406200,1465100 }, { 410920,1465439 } },
  896. { { 410920,1465439 }, { 420659,1467399 } },
  897. { { 420659,1467399 }, { 433500,1471480 } },
  898. { { 433500,1471480 }, { 441340,1473540 } },
  899. { { 441340,1473540 }, { 448620,1475139 } },
  900. { { 448620,1475139 }, { 450720,1475880 } },
  901. { { 450720,1475880 }, { 453299,1477059 } },
  902. { { 453299,1477059 }, { 456620,1478940 } },
  903. { { 456620,1478940 }, { 458480,1480399 } },
  904. { { 458480,1480399 }, { 461100,1482780 } },
  905. { { 461100,1482780 }, { 463820,1486519 } },
  906. { { 463820,1486519 }, { 464780,1488199 } },
  907. { { 464780,1488199 }, { 466579,1493960 } },
  908. { { 466579,1493960 }, { 467120,1497700 } },
  909. { { 467120,1497700 }, { 466999,1500280 } },
  910. { { 466999,1500280 }, { 467300,1502580 } },
  911. { { 467300,1502580 }, { 467399,1505280 } },
  912. { { 467399,1505280 }, { 466979,1506920 } },
  913. { { 466979,1506920 }, { 467920,1504780 } },
  914. { { 467920,1504780 }, { 468159,1505040 } },
  915. { { 468159,1505040 }, { 469400,1504859 } },
  916. { { 469400,1504859 }, { 470300,1505540 } },
  917. { { 470300,1505540 }, { 471240,1505200 } },
  918. { { 471240,1505200 }, { 471579,1504280 } },
  919. { { 471579,1504280 }, { 473939,1502379 } },
  920. { { 473939,1502379 }, { 476860,1500200 } },
  921. { { 476860,1500200 }, { 479800,1498620 } },
  922. { { 479800,1498620 }, { 480840,1498120 } },
  923. { { 480840,1498120 }, { 485220,1497480 } },
  924. { { 485220,1497480 }, { 489979,1497460 } },
  925. { { 489979,1497460 }, { 494899,1498700 } },
  926. { { 494899,1498700 }, { 500099,1501320 } },
  927. { { 500099,1501320 }, { 501439,1501839 } },
  928. { { 501439,1501839 }, { 503400,1502939 } },
  929. { { 503400,1502939 }, { 510760,1508340 } },
  930. { { 510760,1508340 }, { 513640,1510920 } },
  931. { { 513640,1510920 }, { 518579,1514599 } },
  932. { { 518579,1514599 }, { 519020,1515260 } },
  933. { { 519020,1515260 }, { 520700,1516480 } },
  934. { { 520700,1516480 }, { 524960,1521480 } },
  935. { { 524960,1521480 }, { 526820,1524820 } },
  936. { { 526820,1524820 }, { 528280,1527820 } },
  937. { { 528280,1527820 }, { 529120,1533120 } },
  938. { { 529120,1533120 }, { 528820,1537139 } },
  939. { { 528820,1537139 }, { 527020,1543920 } },
  940. { { 527020,1543920 }, { 526959,1546780 } },
  941. { { 526959,1546780 }, { 526420,1548060 } },
  942. { { 526420,1548060 }, { 527020,1547919 } },
  943. { { 527020,1547919 }, { 527620,1548160 } },
  944. { { 527620,1548160 }, { 528980,1548020 } },
  945. { { 528980,1548020 }, { 535180,1544980 } },
  946. { { 535180,1544980 }, { 540860,1542979 } },
  947. { { 540860,1542979 }, { 546480,1542720 } },
  948. { { 546480,1542720 }, { 547420,1542860 } },
  949. { { 547420,1542860 }, { 551800,1544140 } },
  950. { { 551800,1544140 }, { 558740,1547939 } },
  951. { { 558740,1547939 }, { 569920,1556259 } },
  952. { { 569920,1556259 }, { 573660,1560220 } },
  953. { { 573660,1560220 }, { 573040,1559500 } },
  954. { { 573040,1559500 }, { 574740,1559220 } },
  955. { { 574740,1559220 }, { 588480,1562899 } },
  956. { { 588480,1562899 }, { 585180,1576019 } },
  957. { { 585180,1576019 }, { 583440,1577979 } },
  958. { { 583440,1577979 }, { 584280,1582399 } },
  959. { { 584280,1582399 }, { 584520,1588960 } },
  960. { { 584520,1588960 }, { 583420,1601620 } },
  961. { { 583420,1601620 }, { 582840,1603880 } },
  962. { { 582840,1603880 }, { 579860,1611400 } },
  963. { { 579860,1611400 }, { 577980,1614579 } },
  964. { { 577980,1614579 }, { 577380,1616080 } },
  965. { { 577380,1616080 }, { 563800,1621579 } },
  966. { { 563800,1621579 }, { 561320,1622320 } },
  967. { { 561320,1622320 }, { 565080,1621960 } },
  968. { { 565080,1621960 }, { 571680,1620780 } },
  969. { { 571680,1620780 }, { 583260,1628340 } },
  970. { { 583260,1628340 }, { 583100,1630399 } },
  971. { { 583100,1630399 }, { 582200,1632160 } },
  972. { { 582200,1632160 }, { 595380,1627020 } },
  973. { { 595380,1627020 }, { 597400,1627320 } },
  974. { { 597400,1627320 }, { 602240,1628459 } },
  975. { { 602240,1628459 }, { 605660,1630260 } },
  976. { { 605660,1630260 }, { 610319,1634140 } },
  977. { { 610319,1634140 }, { 612340,1636319 } },
  978. { { 612340,1636319 }, { 614820,1638020 } },
  979. { { 614820,1638020 }, { 616460,1638740 } },
  980. { { 616460,1638740 }, { 620420,1639500 } },
  981. { { 620420,1639500 }, { 623000,1639280 } },
  982. { { 623000,1639280 }, { 624459,1639359 } },
  983. { { 624459,1639359 }, { 626180,1640159 } },
  984. { { 626180,1640159 }, { 627279,1640940 } },
  985. { { 627279,1640940 }, { 629980,1643759 } },
  986. { { 629980,1643759 }, { 632380,1648000 } },
  987. { { 632380,1648000 }, { 635020,1654800 } },
  988. { { 635020,1654800 }, { 636320,1659140 } },
  989. { { 636320,1659140 }, { 636680,1663620 } },
  990. { { 636680,1663620 }, { 636180,1665780 } },
  991. { { 636180,1665780 }, { 630620,1669720 } },
  992. { { 630620,1669720 }, { 628760,1672979 } },
  993. { { 628760,1672979 }, { 627540,1676859 } },
  994. { { 627540,1676859 }, { 627040,1680699 } },
  995. { { 627040,1680699 }, { 624700,1686500 } },
  996. { { 624700,1686500 }, { 623260,1688799 } },
  997. { { 623260,1688799 }, { 619620,1693799 } },
  998. { { 619620,1693799 }, { 621720,1694859 } },
  999. { { 621720,1694859 }, { 624940,1694379 } },
  1000. { { 624940,1694379 }, { 627120,1695600 } },
  1001. { { 627120,1695600 }, { 627740,1696120 } },
  1002. { { 627740,1696120 }, { 631120,1697460 } },
  1003. { { 631120,1697460 }, { 633980,1698340 } },
  1004. { { 633980,1698340 }, { 638380,1700460 } },
  1005. { { 638380,1700460 }, { 642660,1703300 } },
  1006. { { 642660,1703300 }, { 643620,1704140 } },
  1007. { { 643620,1704140 }, { 646300,1707000 } },
  1008. { { 646300,1707000 }, { 649060,1710880 } },
  1009. { { 649060,1710880 }, { 651160,1714879 } },
  1010. { { 651160,1714879 }, { 651740,1716559 } },
  1011. { { 651740,1716559 }, { 653139,1722619 } },
  1012. { { 653139,1722619 }, { 653020,1728320 } },
  1013. { { 653020,1728320 }, { 652719,1731420 } },
  1014. { { 652719,1731420 }, { 651619,1736360 } },
  1015. { { 651619,1736360 }, { 649819,1743160 } },
  1016. { { 649819,1743160 }, { 646440,1749059 } },
  1017. { { 646440,1749059 }, { 645219,1750399 } },
  1018. { { 645219,1750399 }, { 643959,1752679 } },
  1019. { { 643959,1752679 }, { 643959,1753740 } },
  1020. { { 643959,1753740 }, { 642140,1754240 } },
  1021. { { 642140,1754240 }, { 643760,1754099 } },
  1022. { { 643760,1754099 }, { 644320,1754280 } },
  1023. { { 644320,1754280 }, { 645000,1754879 } },
  1024. { { 645000,1754879 }, { 646940,1755620 } },
  1025. { { 646940,1755620 }, { 654779,1757820 } },
  1026. { { 654779,1757820 }, { 661100,1761559 } },
  1027. { { 661100,1761559 }, { 664099,1763980 } },
  1028. { { 664099,1763980 }, { 668220,1768480 } },
  1029. { { 668220,1768480 }, { 671920,1773640 } },
  1030. { { 671920,1773640 }, { 674939,1779540 } },
  1031. { { 674939,1779540 }, { 677760,1782440 } },
  1032. { { 677760,1782440 }, { 679080,1785739 } },
  1033. { { 679080,1785739 }, { 678780,1788100 } },
  1034. { { 678780,1788100 }, { 678020,1791500 } },
  1035. { { 678020,1791500 }, { 677120,1793600 } },
  1036. { { 677120,1793600 }, { 676860,1795800 } },
  1037. { { 676860,1795800 }, { 676440,1797320 } },
  1038. { { 676440,1797320 }, { 676459,1798519 } },
  1039. { { 676459,1798519 }, { 675620,1800159 } },
  1040. { { 675620,1800159 }, { 675520,1801019 } },
  1041. { { 675520,1801019 }, { 673360,1804899 } },
  1042. { { 673360,1804899 }, { 672740,1807079 } },
  1043. { { 672740,1807079 }, { 673300,1809260 } },
  1044. { { 673300,1809260 }, { 674539,1811019 } },
  1045. { { 674539,1811019 }, { 675499,1812020 } },
  1046. { { 675499,1812020 }, { 677660,1817240 } },
  1047. { { 677660,1817240 }, { 679659,1824280 } },
  1048. { { 679659,1824280 }, { 680380,1828779 } },
  1049. { { 680380,1828779 }, { 679519,1837999 } },
  1050. { { 679519,1837999 }, { 677940,1844379 } },
  1051. { { 677940,1844379 }, { 676940,1846900 } },
  1052. { { 676940,1846900 }, { 675479,1849379 } },
  1053. { { 675479,1849379 }, { 674000,1851200 } },
  1054. { { 674000,1851200 }, { 671380,1853480 } },
  1055. { { 671380,1853480 }, { 667019,1855240 } },
  1056. { { 667019,1855240 }, { 662540,1856060 } },
  1057. { { 662540,1856060 }, { 660960,1856599 } },
  1058. { { 660960,1856599 }, { 656240,1857020 } },
  1059. { { 656240,1857020 }, { 655600,1856960 } },
  1060. { { 655600,1856960 }, { 652839,1855880 } },
  1061. { { 652839,1855880 }, { 652019,1855840 } },
  1062. { { 652019,1855840 }, { 651459,1855060 } },
  1063. { { 651459,1855060 }, { 652179,1854359 } },
  1064. { { 652179,1854359 }, { 652019,1849919 } },
  1065. { { 652019,1849919 }, { 650620,1846920 } },
  1066. { { 650620,1846920 }, { 647299,1844540 } },
  1067. { { 647299,1844540 }, { 644500,1843819 } },
  1068. { { 644500,1843819 }, { 641860,1844859 } },
  1069. { { 641860,1844859 }, { 641059,1845340 } },
  1070. { { 641059,1845340 }, { 638860,1845820 } },
  1071. { { 638860,1845820 }, { 638000,1845820 } },
  1072. { { 638000,1845820 }, { 636340,1845479 } },
  1073. { { 636340,1845479 }, { 634980,1844800 } },
  1074. { { 634980,1844800 }, { 632660,1842979 } },
  1075. { { 632660,1842979 }, { 631140,1841120 } },
  1076. { { 631140,1841120 }, { 629140,1839520 } },
  1077. { { 629140,1839520 }, { 626640,1839540 } },
  1078. { { 626640,1839540 }, { 624159,1840739 } },
  1079. { { 624159,1840739 }, { 623820,1841380 } },
  1080. { { 623820,1841380 }, { 622440,1842719 } },
  1081. { { 622440,1842719 }, { 622100,1843680 } },
  1082. { { 622100,1843680 }, { 623780,1846100 } },
  1083. { { 623780,1846100 }, { 624580,1846920 } },
  1084. { { 624580,1846920 }, { 626120,1856720 } },
  1085. { { 626120,1856720 }, { 627440,1860000 } },
  1086. { { 627440,1860000 }, { 628000,1864299 } },
  1087. { { 628000,1864299 }, { 627380,1865999 } },
  1088. { { 627380,1865999 }, { 626260,1867580 } },
  1089. { { 626260,1867580 }, { 623660,1869520 } },
  1090. { { 623660,1869520 }, { 618680,1872780 } },
  1091. { { 618680,1872780 }, { 617699,1873140 } },
  1092. { { 617699,1873140 }, { 612000,1874160 } },
  1093. { { 612000,1874160 }, { 609840,1874220 } },
  1094. { { 609840,1874220 }, { 606940,1873860 } },
  1095. { { 136680,1926960 }, { 135500,1926360 } },
  1096. { { 135500,1926360 }, { 137360,1923060 } },
  1097. { { 137360,1923060 }, { 139500,1918559 } },
  1098. { { 139500,1918559 }, { 140780,1913239 } },
  1099. { { 140780,1913239 }, { 139600,1913020 } },
  1100. { { 139600,1913020 }, { 127380,1923600 } },
  1101. { { 127380,1923600 }, { 122800,1926059 } },
  1102. { { 122800,1926059 }, { 118879,1927719 } },
  1103. { { 118879,1927719 }, { 114420,1928300 } },
  1104. { { 114420,1928300 }, { 111480,1927020 } },
  1105. { { 111480,1927020 }, { 110619,1925399 } },
  1106. { { 110619,1925399 }, { 109620,1924200 } },
  1107. { { 109620,1924200 }, { 108860,1922780 } },
  1108. { { 108860,1922780 }, { 108479,1920999 } },
  1109. { { 108479,1920999 }, { 106600,1918080 } },
  1110. { { 106600,1918080 }, { 106220,1917740 } },
  1111. { { 106220,1917740 }, { 105199,1916960 } },
  1112. { { 105199,1916960 }, { 101460,1914859 } },
  1113. { { 101460,1914859 }, { 99480,1914379 } },
  1114. { { 99480,1914379 }, { 97179,1913499 } },
  1115. { { 97179,1913499 }, { 94900,1911100 } },
  1116. { { 94900,1911100 }, { 94100,1909639 } },
  1117. { { 94100,1909639 }, { 93379,1907740 } },
  1118. { { 93379,1907740 }, { 93960,1898259 } },
  1119. { { 93960,1898259 }, { 93739,1896460 } },
  1120. { { 93739,1896460 }, { 94299,1893080 } },
  1121. { { 94299,1893080 }, { 97240,1883440 } },
  1122. { { 97240,1883440 }, { 99799,1879780 } },
  1123. { { 99799,1879780 }, { 100400,1878120 } },
  1124. { { 100400,1878120 }, { 100199,1877200 } },
  1125. { { 100199,1877200 }, { 98940,1877460 } },
  1126. { { 98940,1877460 }, { 96320,1878480 } },
  1127. { { 96320,1878480 }, { 86020,1881039 } },
  1128. { { 86020,1881039 }, { 84340,1881080 } },
  1129. { { 84340,1881080 }, { 76780,1882600 } },
  1130. { { 76780,1882600 }, { 74380,1883580 } },
  1131. { { 74380,1883580 }, { 72679,1884019 } },
  1132. { { 72679,1884019 }, { 70900,1885940 } },
  1133. { { 70900,1885940 }, { 71240,1888340 } },
  1134. { { 71240,1888340 }, { 72720,1889940 } },
  1135. { { 72720,1889940 }, { 74640,1891360 } },
  1136. { { 74640,1891360 }, { 75620,1893179 } },
  1137. { { 75620,1893179 }, { 77140,1895340 } },
  1138. { { 77140,1895340 }, { 81040,1899500 } },
  1139. { { 81040,1899500 }, { 82760,1900380 } },
  1140. { { 82760,1900380 }, { 83720,1902300 } },
  1141. { { 83720,1902300 }, { 85459,1903700 } },
  1142. { { 85459,1903700 }, { 86960,1905940 } },
  1143. { { 86960,1905940 }, { 88280,1913020 } },
  1144. { { 88280,1913020 }, { 88160,1913539 } },
  1145. { { 88160,1913539 }, { 88020,1913860 } },
  1146. { { 88020,1913860 }, { 86080,1915200 } },
  1147. { { 86080,1915200 }, { 85660,1916740 } },
  1148. { { 85660,1916740 }, { 83899,1918799 } },
  1149. { { 83899,1918799 }, { 79360,1921160 } },
  1150. { { 79360,1921160 }, { 76400,1923140 } },
  1151. { { 76400,1923140 }, { 70800,1926180 } },
  1152. { { 70800,1926180 }, { 64460,1927659 } },
  1153. { { 64460,1927659 }, { 60880,1927820 } },
  1154. { { 60880,1927820 }, { 55780,1925580 } },
  1155. { { 55780,1925580 }, { 54940,1925040 } },
  1156. { { 54940,1925040 }, { 52199,1921700 } },
  1157. { { 52199,1921700 }, { 49680,1916579 } },
  1158. { { 49680,1916579 }, { 48719,1914180 } },
  1159. { { 48719,1914180 }, { 48620,1913080 } },
  1160. { { 48620,1913080 }, { 47640,1909120 } },
  1161. { { 47640,1909120 }, { 48280,1899319 } },
  1162. { { 48280,1899319 }, { 49140,1895600 } },
  1163. { { 49140,1895600 }, { 50320,1892899 } },
  1164. { { 50320,1892899 }, { 51559,1890640 } },
  1165. { { 51559,1890640 }, { 52140,1889960 } },
  1166. { { 52140,1889960 }, { 54640,1887999 } },
  1167. { { 54640,1887999 }, { 55639,1886500 } },
  1168. { { 55639,1886500 }, { 55720,1885080 } },
  1169. { { 55720,1885080 }, { 55439,1883220 } },
  1170. { { 55439,1883220 }, { 54640,1882159 } },
  1171. { { 54640,1882159 }, { 54100,1880300 } },
  1172. { { 54100,1880300 }, { 52479,1874079 } },
  1173. { { 52479,1874079 }, { 51700,1869000 } },
  1174. { { 51700,1869000 }, { 51600,1865419 } },
  1175. { { 51600,1865419 }, { 51720,1859820 } },
  1176. { { 51720,1859820 }, { 52160,1857260 } },
  1177. { { 52160,1857260 }, { 52539,1856120 } },
  1178. { { 52539,1856120 }, { 57240,1845720 } },
  1179. { { 57240,1845720 }, { 58280,1844400 } },
  1180. { { 58280,1844400 }, { 60639,1840820 } },
  1181. { { 60639,1840820 }, { 65580,1835540 } },
  1182. { { 65580,1835540 }, { 68340,1833340 } },
  1183. { { 68340,1833340 }, { 71660,1831480 } },
  1184. { { 71660,1831480 }, { 73460,1829960 } },
  1185. { { 73460,1829960 }, { 75200,1829319 } },
  1186. { { 75200,1829319 }, { 77200,1828960 } },
  1187. { { 77200,1828960 }, { 78640,1828920 } },
  1188. { { 78640,1828920 }, { 111780,1842700 } },
  1189. { { 111780,1842700 }, { 112800,1843480 } },
  1190. { { 112800,1843480 }, { 113879,1844879 } },
  1191. { { 113879,1844879 }, { 116379,1847379 } },
  1192. { { 116379,1847379 }, { 116360,1847580 } },
  1193. { { 116360,1847580 }, { 117100,1848799 } },
  1194. { { 117100,1848799 }, { 120160,1851799 } },
  1195. { { 120160,1851799 }, { 121860,1852320 } },
  1196. { { 121860,1852320 }, { 124280,1852679 } },
  1197. { { 124280,1852679 }, { 128920,1854659 } },
  1198. { { 128920,1854659 }, { 130840,1856360 } },
  1199. { { 130840,1856360 }, { 133520,1859460 } },
  1200. { { 133520,1859460 }, { 135079,1860860 } },
  1201. { { 135079,1860860 }, { 137280,1864440 } },
  1202. { { 137280,1864440 }, { 142980,1872899 } },
  1203. { { 142980,1872899 }, { 144600,1875840 } },
  1204. { { 144600,1875840 }, { 147240,1883480 } },
  1205. { { 147240,1883480 }, { 147460,1886539 } },
  1206. { { 147460,1886539 }, { 147660,1886920 } },
  1207. { { 147660,1886920 }, { 148399,1891720 } },
  1208. { { 148399,1891720 }, { 148820,1896799 } },
  1209. { { 148820,1896799 }, { 148399,1898880 } },
  1210. { { 148399,1898880 }, { 148799,1899420 } },
  1211. { { 148799,1899420 }, { 150520,1898539 } },
  1212. { { 150520,1898539 }, { 154760,1892760 } },
  1213. { { 154760,1892760 }, { 156580,1889240 } },
  1214. { { 156580,1889240 }, { 156940,1888900 } },
  1215. { { 156940,1888900 }, { 157540,1889540 } },
  1216. { { 157540,1889540 }, { 156860,1896819 } },
  1217. { { 156860,1896819 }, { 155639,1903940 } },
  1218. { { 155639,1903940 }, { 153679,1908100 } },
  1219. { { 153679,1908100 }, { 152859,1909039 } },
  1220. { { 152859,1909039 }, { 149660,1915580 } },
  1221. { { 149660,1915580 }, { 148000,1918600 } },
  1222. { { 148000,1918600 }, { 141640,1926980 } },
  1223. { { 141640,1926980 }, { 140060,1927899 } },
  1224. { { 140060,1927899 }, { 136960,1929019 } },
  1225. { { 136960,1929019 }, { 136680,1926960 } },
  1226. { { 627100,1941519 }, { 625120,1940060 } },
  1227. { { 625120,1940060 }, { 614580,1934680 } },
  1228. { { 614580,1934680 }, { 608780,1929319 } },
  1229. { { 608780,1929319 }, { 607400,1927679 } },
  1230. { { 607400,1927679 }, { 606160,1925920 } },
  1231. { { 606160,1925920 }, { 604480,1922240 } },
  1232. { { 604480,1922240 }, { 602420,1916819 } },
  1233. { { 602420,1916819 }, { 602279,1915260 } },
  1234. { { 602279,1915260 }, { 602880,1907960 } },
  1235. { { 602880,1907960 }, { 604140,1902719 } },
  1236. { { 604140,1902719 }, { 605880,1898539 } },
  1237. { { 605880,1898539 }, { 606640,1897399 } },
  1238. { { 606640,1897399 }, { 609680,1894420 } },
  1239. { { 609680,1894420 }, { 611099,1893640 } },
  1240. { { 611099,1893640 }, { 616099,1890340 } },
  1241. { { 616099,1890340 }, { 617520,1889160 } },
  1242. { { 617520,1889160 }, { 620220,1885540 } },
  1243. { { 620220,1885540 }, { 624480,1882260 } },
  1244. { { 624480,1882260 }, { 628660,1880280 } },
  1245. { { 628660,1880280 }, { 632520,1879659 } },
  1246. { { 632520,1879659 }, { 637760,1879859 } },
  1247. { { 637760,1879859 }, { 640899,1881500 } },
  1248. { { 640899,1881500 }, { 644220,1883980 } },
  1249. { { 644220,1883980 }, { 643900,1890860 } },
  1250. { { 643900,1890860 }, { 643060,1894160 } },
  1251. { { 643060,1894160 }, { 642459,1900320 } },
  1252. { { 642459,1900320 }, { 642400,1903120 } },
  1253. { { 642400,1903120 }, { 643819,1908519 } },
  1254. { { 643819,1908519 }, { 644700,1912560 } },
  1255. { { 644700,1912560 }, { 644640,1916380 } },
  1256. { { 644640,1916380 }, { 644959,1918600 } },
  1257. { { 644959,1918600 }, { 642540,1925620 } },
  1258. { { 642540,1925620 }, { 642439,1926640 } },
  1259. { { 642439,1926640 }, { 641860,1928300 } },
  1260. { { 641860,1928300 }, { 638700,1932939 } },
  1261. { { 638700,1932939 }, { 634820,1934200 } },
  1262. { { 634820,1934200 }, { 631980,1936539 } },
  1263. { { 631980,1936539 }, { 630160,1940600 } },
  1264. { { 630160,1940600 }, { 627740,1941640 } },
  1265. { { 627740,1941640 }, { 627400,1941660 } },
  1266. { { 627400,1941660 }, { 627100,1941519 } }
  1267. };
  1268. #if 0
  1269. // Verify whether two any two non-neighbor line segments intersect. They should not, otherwise the Voronoi builder
  1270. // is not guaranteed to succeed.
  1271. for (size_t i = 0; i < lines.size(); ++ i)
  1272. for (size_t j = i + 1; j < lines.size(); ++ j) {
  1273. Point &ip1 = lines[i].a;
  1274. Point &ip2 = lines[i].b;
  1275. Point &jp1 = lines[j].a;
  1276. Point &jp2 = lines[j].b;
  1277. if (&ip1 != &jp2 && &jp1 != &ip2) {
  1278. REQUIRE(! Slic3r::Geometry::segments_intersect(ip1, ip2, jp1, jp2));
  1279. }
  1280. }
  1281. #endif
  1282. VD vd;
  1283. construct_voronoi(lines.begin(), lines.end(), &vd);
  1284. for (const auto& edge : vd.edges())
  1285. if (edge.is_finite()) {
  1286. auto v0 = edge.vertex0();
  1287. auto v1 = edge.vertex1();
  1288. REQUIRE((v0->x() == 0 || std::isnormal(v0->x())));
  1289. REQUIRE((v0->y() == 0 || std::isnormal(v0->y())));
  1290. REQUIRE((v1->x() == 0 || std::isnormal(v1->x())));
  1291. REQUIRE((v1->y() == 0 || std::isnormal(v1->y())));
  1292. }
  1293. #ifdef VORONOI_DEBUG_OUT
  1294. dump_voronoi_to_svg(debug_out_path("voronoi-NaNs.svg").c_str(),
  1295. vd, Points(), lines, Polygons(), Lines(), 0.015);
  1296. #endif
  1297. }
  1298. struct OffsetTest {
  1299. double distance;
  1300. size_t num_outer;
  1301. size_t num_inner;
  1302. };
  1303. TEST_CASE("Voronoi offset", "[VoronoiOffset]")
  1304. {
  1305. Polygons poly_with_hole = { Polygon {
  1306. { 0, 10000000},
  1307. { 700000, 0},
  1308. { 700000, 9000000},
  1309. { 9100000, 9000000},
  1310. { 9100000, 0},
  1311. {10000000, 10000000}
  1312. }
  1313. };
  1314. double area = std::accumulate(poly_with_hole.begin(), poly_with_hole.end(), 0., [](double a, auto &poly){ return a + poly.area(); });
  1315. REQUIRE(area > 0.);
  1316. VD vd;
  1317. Lines lines = to_lines(poly_with_hole);
  1318. construct_voronoi(lines.begin(), lines.end(), &vd);
  1319. for (const OffsetTest &ot : {
  1320. OffsetTest { scale_(0.2), 1, 1 },
  1321. OffsetTest { scale_(0.4), 1, 1 },
  1322. OffsetTest { scale_(0.5), 1, 2 },
  1323. OffsetTest { scale_(0.505), 1, 2 },
  1324. OffsetTest { scale_(0.51), 1, 2 },
  1325. OffsetTest { scale_(0.52), 1, 1 },
  1326. OffsetTest { scale_(0.53), 1, 1 },
  1327. OffsetTest { scale_(0.54), 1, 1 },
  1328. OffsetTest { scale_(0.55), 1, 0 }
  1329. }) {
  1330. #if 0
  1331. Polygons offsetted_polygons_out = Slic3r::Voronoi::offset(vd, lines, ot.distance, scale_(0.005));
  1332. #ifdef VORONOI_DEBUG_OUT
  1333. dump_voronoi_to_svg(debug_out_path("voronoi-offset-out-%lf.svg", ot.distance).c_str(),
  1334. vd, Points(), lines, offsetted_polygons_out);
  1335. #endif
  1336. REQUIRE(offsetted_polygons_out.size() == ot.num_outer);
  1337. #endif
  1338. Polygons offsetted_polygons_in = Slic3r::Voronoi::offset(vd, lines, - ot.distance, scale_(0.005));
  1339. #ifdef VORONOI_DEBUG_OUT
  1340. dump_voronoi_to_svg(debug_out_path("voronoi-offset-in-%lf.svg", ot.distance).c_str(),
  1341. vd, Points(), lines, offsetted_polygons_in);
  1342. #endif
  1343. REQUIRE(offsetted_polygons_in.size() == ot.num_inner);
  1344. }
  1345. }
  1346. TEST_CASE("Voronoi offset 2", "[VoronoiOffset]")
  1347. {
  1348. coord_t mm = coord_t(scale_(1.));
  1349. Polygons poly = {
  1350. Polygon {
  1351. { 0, 0 },
  1352. { 1, 0 },
  1353. { 1, 1 },
  1354. { 2, 1 },
  1355. { 2, 0 },
  1356. { 3, 0 },
  1357. { 3, 2 },
  1358. { 0, 2 }
  1359. },
  1360. Polygon {
  1361. { 0, - 1 - 2 },
  1362. { 3, - 1 - 2 },
  1363. { 3, - 1 - 0 },
  1364. { 2, - 1 - 0 },
  1365. { 2, - 1 - 1 },
  1366. { 1, - 1 - 1 },
  1367. { 1, - 1 - 0 },
  1368. { 0, - 1 - 0 }
  1369. },
  1370. };
  1371. for (Polygon &p : poly)
  1372. for (Point &pt : p.points)
  1373. pt *= mm;
  1374. double area = std::accumulate(poly.begin(), poly.end(), 0., [](double a, auto &poly){ return a + poly.area(); });
  1375. REQUIRE(area > 0.);
  1376. VD vd;
  1377. Lines lines = to_lines(poly);
  1378. construct_voronoi(lines.begin(), lines.end(), &vd);
  1379. for (const OffsetTest &ot : {
  1380. OffsetTest { scale_(0.2), 2, 2 },
  1381. OffsetTest { scale_(0.4), 2, 2 },
  1382. OffsetTest { scale_(0.45), 2, 2 },
  1383. OffsetTest { scale_(0.48), 2, 2 },
  1384. OffsetTest { scale_(0.5), 2, 4 },
  1385. OffsetTest { scale_(0.505), 2, 4 },
  1386. OffsetTest { scale_(0.7), 2, 0 },
  1387. OffsetTest { scale_(0.8), 1, 0 }
  1388. }) {
  1389. Polygons offsetted_polygons_out = Slic3r::Voronoi::offset(vd, lines, ot.distance, scale_(0.005));
  1390. #ifdef VORONOI_DEBUG_OUT
  1391. dump_voronoi_to_svg(debug_out_path("voronoi-offset2-out-%lf.svg", ot.distance).c_str(),
  1392. vd, Points(), lines, offsetted_polygons_out);
  1393. #endif
  1394. REQUIRE(offsetted_polygons_out.size() == ot.num_outer);
  1395. Polygons offsetted_polygons_in = Slic3r::Voronoi::offset(vd, lines, - ot.distance, scale_(0.005));
  1396. #ifdef VORONOI_DEBUG_OUT
  1397. dump_voronoi_to_svg(debug_out_path("voronoi-offset2-in-%lf.svg", ot.distance).c_str(),
  1398. vd, Points(), lines, offsetted_polygons_in);
  1399. #endif
  1400. REQUIRE(offsetted_polygons_in.size() == ot.num_inner);
  1401. }
  1402. }
  1403. TEST_CASE("Voronoi offset 3", "[VoronoiOffset]")
  1404. {
  1405. coord_t mm = coord_t(scale_(1.));
  1406. Polygons poly = {
  1407. Polygon {
  1408. { 0, 0 },
  1409. { 2, 0 },
  1410. { 2, 1 },
  1411. { 3, 1 },
  1412. { 3, 0 },
  1413. { 5, 0 },
  1414. { 5, 2 },
  1415. { 4, 2 },
  1416. { 4, 3 },
  1417. { 1, 3 },
  1418. { 1, 2 },
  1419. { 0, 2 }
  1420. },
  1421. Polygon {
  1422. { 0, -1 - 2 },
  1423. { 1, -1 - 2 },
  1424. { 1, -1 - 3 },
  1425. { 4, -1 - 3 },
  1426. { 4, -1 - 2 },
  1427. { 5, -1 - 2 },
  1428. { 5, -1 - 0 },
  1429. { 3, -1 - 0 },
  1430. { 3, -1 - 1 },
  1431. { 2, -1 - 1 },
  1432. { 2, -1 - 0 },
  1433. { 0, -1 - 0 }
  1434. },
  1435. };
  1436. for (Polygon &p : poly) {
  1437. REQUIRE(p.area() > 0.);
  1438. for (Point &pt : p.points)
  1439. pt *= mm;
  1440. }
  1441. VD vd;
  1442. Lines lines = to_lines(poly);
  1443. construct_voronoi(lines.begin(), lines.end(), &vd);
  1444. for (const OffsetTest &ot : {
  1445. OffsetTest { scale_(0.2), 2, 2 },
  1446. OffsetTest { scale_(0.4), 2, 2 },
  1447. OffsetTest { scale_(0.49), 2, 2 },
  1448. OffsetTest { scale_(0.5), 2, 2 },
  1449. OffsetTest { scale_(0.51), 2, 2 },
  1450. OffsetTest { scale_(0.56), 2, 2 },
  1451. OffsetTest { scale_(0.6), 2, 2 },
  1452. OffsetTest { scale_(0.7), 2, 2 },
  1453. OffsetTest { scale_(0.8), 1, 6 },
  1454. OffsetTest { scale_(0.9), 1, 6 },
  1455. OffsetTest { scale_(0.99), 1, 6 },
  1456. OffsetTest { scale_(1.0), 1, 0 },
  1457. OffsetTest { scale_(1.01), 1, 0 },
  1458. }) {
  1459. Polygons offsetted_polygons_out = Slic3r::Voronoi::offset(vd, lines, ot.distance, scale_(0.005));
  1460. #ifdef VORONOI_DEBUG_OUT
  1461. dump_voronoi_to_svg(debug_out_path("voronoi-offset3-out-%lf.svg", ot.distance).c_str(),
  1462. vd, Points(), lines, offsetted_polygons_out);
  1463. #endif
  1464. REQUIRE(offsetted_polygons_out.size() == ot.num_outer);
  1465. Polygons offsetted_polygons_in = Slic3r::Voronoi::offset(vd, lines, - ot.distance, scale_(0.005));
  1466. #ifdef VORONOI_DEBUG_OUT
  1467. dump_voronoi_to_svg(debug_out_path("voronoi-offset3-in-%lf.svg", ot.distance).c_str(),
  1468. vd, Points(), lines, offsetted_polygons_in);
  1469. #endif
  1470. REQUIRE(offsetted_polygons_in.size() == ot.num_inner);
  1471. }
  1472. }
  1473. TEST_CASE("Voronoi offset with edge collapse", "[VoronoiOffset4]")
  1474. {
  1475. Polygons poly
  1476. {
  1477. // Outer contour
  1478. {
  1479. { 434890, -64754575 },
  1480. { 541060, -64669076 },
  1481. { 585647, -64583538 },
  1482. { 576999, -64484233 },
  1483. { 485666, -64191173 },
  1484. { 1029323, -63646261 },
  1485. { 1416925, -63666243 },
  1486. { 1541532, -63643075 },
  1487. { 1541535, -63643075 },
  1488. { 1541535, -63643074 },
  1489. { 1552612, -63641015 },
  1490. { 1631609, -63568270 },
  1491. { 1678393, -63443639 },
  1492. { 1725519, -63219942 },
  1493. { 1770552, -62903321 },
  1494. { 1742544, -62755934 },
  1495. { 1758152, -62588378 },
  1496. { 1702289, -62474826 },
  1497. { 1638627, -62242058 },
  1498. { 1671281, -61938568 },
  1499. { 1792676, -61478332 },
  1500. { 1934894, -60760597 },
  1501. { 2160333, -60064089 },
  1502. { 2638183, -58972890 },
  1503. { 2933095, -58478536 },
  1504. { 3173586, -58159527 },
  1505. { 3557779, -57556727 },
  1506. { 3707088, -57158174 },
  1507. { 3758053, -56907139 },
  1508. { 3935932, -56278649 },
  1509. { 4077331, -56033426 },
  1510. { 4151386, -55768739 },
  1511. { 4293796, -55561683 },
  1512. { 4383089, -55387391 },
  1513. { 4614128, -55201443 },
  1514. { 5268755, -54333831 },
  1515. { 5547634, -53797296 },
  1516. { 5573864, -53639250 },
  1517. { 5736812, -53304157 },
  1518. { 6090973, -52066302 },
  1519. { 6148630, -51666664 },
  1520. { 6189511, -50974991 },
  1521. { 6244112, -50774489 },
  1522. { 6302489, -50761556 },
  1523. { 6511179, -50579861 },
  1524. { 6778128, -50398667 },
  1525. { 6896879, -50350264 },
  1526. { 7388259, -49913262 },
  1527. { 7630584, -49602449 },
  1528. { 7886846, -48987881 },
  1529. { 7871333, -48318666 },
  1530. { 7770349, -47841179 },
  1531. { 7570223, -47234733 },
  1532. { 7283115, -46705503 },
  1533. { 6842948, -46056539 },
  1534. { 6612732, -45760004 },
  1535. { 6150430, -44991494 },
  1536. { 5564326, -44168114 },
  1537. { 5193032, -43807544 },
  1538. { 4932097, -43489047 },
  1539. { 3857385, -42548846 },
  1540. { 3764745, -42081468 },
  1541. { 3539887, -41422273 },
  1542. { 3283048, -40803856 },
  1543. { 3005925, -40367981 },
  1544. { 3136185, -39834533 },
  1545. { 3333757, -38499972 },
  1546. { 3360660, -38183895 },
  1547. { 3353375, -38036005 },
  1548. { 3398808, -37582504 },
  1549. { 3604229, -37221781 },
  1550. { 3698079, -36962934 },
  1551. { 4000449, -36007804 },
  1552. { 4256811, -35016707 },
  1553. { 4405951, -34581428 },
  1554. { 4364534, -34178439 },
  1555. { 4124603, -33432250 },
  1556. { 3806159, -32765167 },
  1557. { 3359088, -32109020 },
  1558. { 2880790, -31317192 },
  1559. { 1548334, -30402139 },
  1560. { -7, -30131023 },
  1561. { -1548347, -30402139 },
  1562. { -2880803, -31317189 },
  1563. { -3359100, -32109018 },
  1564. { -3806173, -32765166 },
  1565. { -4124617, -33432248 },
  1566. { -4364548, -34178436 },
  1567. { -4405966, -34581423 },
  1568. { -4256825, -35016707 },
  1569. { -4000461, -36007800 },
  1570. { -3698093, -36962933 },
  1571. { -3604243, -37221781 },
  1572. { -3398823, -37582501 },
  1573. { -3353390, -38036003 },
  1574. { -3360675, -38183892 },
  1575. { -3333772, -38499972 },
  1576. { -3136200, -39834530 },
  1577. { -3005940, -40367980 },
  1578. { -3283062, -40803852 },
  1579. { -3539902, -41422273 },
  1580. { -3764761, -42081468 },
  1581. { -3857402, -42548846 },
  1582. { -4932112, -43489047 },
  1583. { -5193047, -43807544 },
  1584. { -5564341, -44168114 },
  1585. { -6150446, -44991494 },
  1586. { -6612748, -45760000 },
  1587. { -6842965, -46056536 },
  1588. { -7283130, -46705503 },
  1589. { -7570238, -47234733 },
  1590. { -7770365, -47841179 },
  1591. { -7871349, -48318666 },
  1592. { -7886860, -48987873 },
  1593. { -7630599, -49602451 },
  1594. { -7388277, -49913260 },
  1595. { -6896896, -50350264 },
  1596. { -6778145, -50398667 },
  1597. { -6511196, -50579862 },
  1598. { -6302504, -50761557 },
  1599. { -6244127, -50774488 },
  1600. { -6189527, -50974989 },
  1601. { -6148648, -51666664 },
  1602. { -6090990, -52066302 },
  1603. { -5736829, -53304157 },
  1604. { -5573882, -53639250 },
  1605. { -5547651, -53797296 },
  1606. { -5268772, -54333831 },
  1607. { -4614145, -55201443 },
  1608. { -4383106, -55387389 },
  1609. { -4293814, -55561683 },
  1610. { -4151404, -55768739 },
  1611. { -4077350, -56033423 },
  1612. { -3935952, -56278647 },
  1613. { -3758072, -56907137 },
  1614. { -3707107, -57158170 },
  1615. { -3557796, -57556727 },
  1616. { -3173605, -58159527 },
  1617. { -2933113, -58478536 },
  1618. { -2638201, -58972890 },
  1619. { -2295003, -59738435 },
  1620. { -2160353, -60064089 },
  1621. { -1978487, -60596626 },
  1622. { -1792695, -61478332 },
  1623. { -1671298, -61938574 },
  1624. { -1638646, -62242058 },
  1625. { -1702306, -62474826 },
  1626. { -1758168, -62588380 },
  1627. { -1742563, -62755934 },
  1628. { -1770570, -62903317 },
  1629. { -1725537, -63219946 },
  1630. { -1678412, -63443639 },
  1631. { -1631627, -63568270 },
  1632. { -1553479, -63640201 },
  1633. { -1416944, -63666243 },
  1634. { -998854, -63645714 },
  1635. { -485685, -64191173 },
  1636. { -577019, -64484225 },
  1637. { -585667, -64583538 },
  1638. { -541079, -64669076 },
  1639. { -434910, -64754575 },
  1640. { -294192, -64810609 },
  1641. { 294172, -64810609 },
  1642. },
  1643. // Hole 1
  1644. {
  1645. { -842246, -45167428 },
  1646. { -1473641, -45154392 },
  1647. { -2181728, -45100161 },
  1648. { -2804308, -44985842 },
  1649. { -3100514, -44879269 },
  1650. { -3836807, -44802155 },
  1651. { -4035816, -44718913 },
  1652. { -4167175, -44583299 },
  1653. { -4496705, -44467674 },
  1654. { -4486674, -44382045 },
  1655. { -4343949, -44070577 },
  1656. { -3740991, -43494686 },
  1657. { -2701372, -43313358 },
  1658. { -1493599, -43312838 },
  1659. { -8, -43352868 },
  1660. { 1414575, -43313336 },
  1661. { 2701358, -43313358 },
  1662. { 3095462, -43374735 },
  1663. { 3740975, -43494686 },
  1664. { 4343934, -44070583 },
  1665. { 4486657, -44382044 },
  1666. { 4496688, -44467670 },
  1667. { 4167159, -44583300 },
  1668. { 4035800, -44718913 },
  1669. { 3836792, -44802155 },
  1670. { 3100498, -44879269 },
  1671. { 2804292, -44985842 },
  1672. { 2181712, -45100161 },
  1673. { 1473625, -45154389 },
  1674. { 842231, -45167428 },
  1675. { -8, -45232686 },
  1676. },
  1677. // Hole 2
  1678. {
  1679. { 1657455, -63016679 },
  1680. { 1723196, -63056286 },
  1681. { 1541535, -63643074 },
  1682. { 1541532, -63643075 },
  1683. { 1030020, -63645562 },
  1684. }
  1685. };
  1686. VD vd;
  1687. Lines lines = to_lines(poly);
  1688. construct_voronoi(lines.begin(), lines.end(), &vd);
  1689. for (const OffsetTest &ot : {
  1690. OffsetTest { scale_(0.2), 2, 2 },
  1691. OffsetTest { scale_(0.4), 2, 2 },
  1692. OffsetTest { scale_(0.49), 2, 3 },
  1693. OffsetTest { scale_(0.51), 2, 2 },
  1694. OffsetTest { scale_(0.56), 2, 2 },
  1695. OffsetTest { scale_(0.6), 2, 2 },
  1696. OffsetTest { scale_(0.7), 2, 2 },
  1697. OffsetTest { scale_(0.8), 2, 2 },
  1698. OffsetTest { scale_(0.9), 2, 2 },
  1699. OffsetTest { scale_(0.99), 1, 2 },
  1700. OffsetTest { scale_(1.0), 1, 2 },
  1701. OffsetTest { scale_(1.01), 1, 2 },
  1702. }) {
  1703. Polygons offsetted_polygons_out = Slic3r::Voronoi::offset(vd, lines, ot.distance, scale_(0.005));
  1704. #ifdef VORONOI_DEBUG_OUT
  1705. dump_voronoi_to_svg(debug_out_path("voronoi-offset3-out-%lf.svg", ot.distance).c_str(),
  1706. vd, Points(), lines, offsetted_polygons_out);
  1707. #endif
  1708. REQUIRE(offsetted_polygons_out.size() == ot.num_outer);
  1709. Polygons offsetted_polygons_in = Slic3r::Voronoi::offset(vd, lines, - ot.distance, scale_(0.005));
  1710. #ifdef VORONOI_DEBUG_OUT
  1711. dump_voronoi_to_svg(debug_out_path("voronoi-offset3-in-%lf.svg", ot.distance).c_str(),
  1712. vd, Points(), lines, offsetted_polygons_in);
  1713. #endif
  1714. REQUIRE(offsetted_polygons_in.size() == ot.num_inner);
  1715. }
  1716. }
  1717. // A sample extracted from file medallion_printable_fixed-teeth.stl from https://www.thingiverse.com/thing:1347129
  1718. // This test for offset scale_(2.9) and bigger
  1719. // triggers assert(r < std::max(d0, d1) + EPSILON) in function first_circle_segment_intersection_parameter.
  1720. TEST_CASE("Voronoi offset 5", "[VoronoiOffset5]")
  1721. {
  1722. Polygons poly = {
  1723. Polygon {
  1724. { 0 , -16077501 },
  1725. { 3015222 , -16142836 },
  1726. { 3072642 , -16138163 },
  1727. { 3094279 , -16105662 },
  1728. { 3110660 , -15140728 },
  1729. { 3157438 , -14105326 },
  1730. { 3338367 , -11081394 },
  1731. { 3443412 , -8381621 },
  1732. { 3472489 , -6084497 },
  1733. { 3445790 , -5962924 },
  1734. { 3061725 , -6003484 },
  1735. { 3030326 , -6030622 },
  1736. { 2989343 , -6270378 },
  1737. { 2903752 , -7368176 },
  1738. { 2856704 , -7740619 },
  1739. { 2795743 , -7978809 },
  1740. { 2729231 , -8098866 },
  1741. { 2666509 , -8131138 },
  1742. { 2614169 , -8112308 },
  1743. { 2561157 , -8032014 },
  1744. { 2488290 , -7479351 },
  1745. { 2453360 , -6911556 },
  1746. { 2456148 , -6463146 },
  1747. { 2546029 , -4580396 },
  1748. { 2688181 , -2593262 },
  1749. { 2717617 , -1700519 },
  1750. { 2682232 , -1128411 },
  1751. { 2631029 , -832886 },
  1752. { 2535941 , -504483 },
  1753. { 2399115 , -199303 },
  1754. { 2290997 , -171213 },
  1755. { 611824 , -132865 },
  1756. { 6419 , -375849 },
  1757. { -611825 , -132865 },
  1758. { -2377355 , -185241 },
  1759. { -2420740 , -231171 },
  1760. { -2535942 , -504484 },
  1761. { -2631030 , -832887 },
  1762. { -2684831 , -1150821 },
  1763. { -2714840 , -1586454 },
  1764. { -2688181 , -2593262 },
  1765. { -2546030 , -4580396 },
  1766. { -2456149 , -6463145 },
  1767. { -2453361 , -6911557 },
  1768. { -2488291 , -7479352 },
  1769. { -2561159 , -8032018 },
  1770. { -2614171 , -8112309 },
  1771. { -2666509 , -8131138 },
  1772. { -2729233 , -8098868 },
  1773. { -2795744 , -7978809 },
  1774. { -2856706 , -7740619 },
  1775. { -2903752 , -7368176 },
  1776. { -2989345 , -6270378 },
  1777. { -3030327 , -6030622 },
  1778. { -3061726 , -6003484 },
  1779. { -3445790 , -5962924 },
  1780. { -3472490 , -6084498 },
  1781. { -3468804 , -7244095 },
  1782. { -3399287 , -9714025 },
  1783. { -3338368 , -11081395 },
  1784. { -3141015 , -14446051 },
  1785. { -3094280 , -16105662 },
  1786. { -3072643 , -16138163 },
  1787. { -3008836 , -16143225 }
  1788. }
  1789. };
  1790. double area = std::accumulate(poly.begin(), poly.end(), 0., [](double a, auto &poly){ return a + poly.area(); });
  1791. REQUIRE(area > 0.);
  1792. VD vd;
  1793. Lines lines = to_lines(poly);
  1794. construct_voronoi(lines.begin(), lines.end(), &vd);
  1795. for (const OffsetTest &ot : {
  1796. OffsetTest { scale_(2.8), 1, 1 },
  1797. OffsetTest { scale_(2.9), 1, 1 },
  1798. OffsetTest { scale_(3.0), 1, 1 },
  1799. }) {
  1800. Polygons offsetted_polygons_out = Slic3r::Voronoi::offset(vd, lines, ot.distance, scale_(0.005));
  1801. #ifdef VORONOI_DEBUG_OUT
  1802. dump_voronoi_to_svg(debug_out_path("voronoi-offset5-out-%lf.svg", ot.distance).c_str(),
  1803. vd, Points(), lines, offsetted_polygons_out);
  1804. #endif
  1805. REQUIRE(offsetted_polygons_out.size() == ot.num_outer);
  1806. Polygons offsetted_polygons_in = Slic3r::Voronoi::offset(vd, lines, - ot.distance, scale_(0.005));
  1807. #ifdef VORONOI_DEBUG_OUT
  1808. dump_voronoi_to_svg(debug_out_path("voronoi-offset5-in-%lf.svg", ot.distance).c_str(),
  1809. vd, Points(), lines, offsetted_polygons_in);
  1810. #endif
  1811. REQUIRE(offsetted_polygons_in.size() == ot.num_inner);
  1812. }
  1813. }
  1814. TEST_CASE("Voronoi skeleton", "[VoronoiSkeleton]")
  1815. {
  1816. coord_t mm = coord_t(scale_(1.));
  1817. Polygons poly = {
  1818. Polygon {
  1819. { 0, 0 },
  1820. { 1, 0 },
  1821. { 1, 1 },
  1822. { 2, 1 },
  1823. { 2, 0 },
  1824. { 3, 0 },
  1825. { 3, 2 },
  1826. { 0, 2 }
  1827. },
  1828. Polygon {
  1829. { 0, - 1 - 2 },
  1830. { 3, - 1 - 2 },
  1831. { 3, - 1 - 0 },
  1832. { 2, - 1 - 0 },
  1833. { 2, - 1 - 1 },
  1834. { 1, - 1 - 1 },
  1835. { 1, - 1 - 0 },
  1836. { 0, - 1 - 0 }
  1837. },
  1838. };
  1839. for (Polygon &p : poly)
  1840. for (Point &pt : p.points)
  1841. pt *= mm;
  1842. double area = std::accumulate(poly.begin(), poly.end(), 0., [](double a, auto &poly){ return a + poly.area(); });
  1843. REQUIRE(area > 0.);
  1844. VD vd;
  1845. Lines lines = to_lines(poly);
  1846. construct_voronoi(lines.begin(), lines.end(), &vd);
  1847. Slic3r::Voronoi::annotate_inside_outside(vd, lines);
  1848. Slic3r::Voronoi::annotate_inside_outside(vd, lines);
  1849. static constexpr double threshold_alpha = M_PI / 12.; // 30 degrees
  1850. std::vector<Vec2d> skeleton_edges = Slic3r::Voronoi::skeleton_edges_rough(vd, lines, threshold_alpha);
  1851. REQUIRE(! skeleton_edges.empty());
  1852. }
  1853. // Simple detection with complexity N^2 if there is any point in the input polygons that doesn't have Voronoi vertex.
  1854. [[maybe_unused]] static bool has_missing_voronoi_vertices(const Polygons &polygons, const VD &vd)
  1855. {
  1856. auto are_equal = [](const VD::vertex_type v, const Point &p) { return (Vec2d(v.x(), v.y()) - p.cast<double>()).norm() <= SCALED_EPSILON; };
  1857. Points poly_points = to_points(polygons);
  1858. std::vector<bool> found_vertices(poly_points.size());
  1859. for (const Point &point : poly_points)
  1860. for (const auto &vertex : vd.vertices())
  1861. if (are_equal(vertex, point)) {
  1862. found_vertices[&point - &poly_points.front()] = true;
  1863. break;
  1864. }
  1865. return std::find(found_vertices.begin(), found_vertices.end(), false) != found_vertices.end();
  1866. }
  1867. // This case is composed of one square polygon, and one of the edges is divided into two parts by a point that lies on this edge.
  1868. // In some applications, this point is unnecessary and can be removed (merge two parts to one edge). But for the case of
  1869. // multi-material segmentation, these points are necessary. In this case, Voronoi vertex for the point, which divides the edge
  1870. // into two parts. Even we add more points to the edge, and then for these points, the Voronoin vertex is also missing. An
  1871. // infinity-edge passes through the missing Voronoi vertex. Therefore, this missing Voronoi vertex and edge can be reconstructed
  1872. // using the intersection between the infinity-edge with the input polygon.
  1873. // Rotation of the polygon solves this problem.
  1874. TEST_CASE("Voronoi missing vertex 1", "[VoronoiMissingVertex1]")
  1875. {
  1876. Polygon poly = {
  1877. { 25000000, 25000000},
  1878. {-25000000, 25000000},
  1879. {-25000000, -25000000},
  1880. {-12412500, -25000000},
  1881. // {- 1650000, -25000000},
  1882. { 25000000, -25000000}
  1883. };
  1884. // poly.rotate(PI / 6);
  1885. REQUIRE(poly.area() > 0.);
  1886. REQUIRE(intersecting_edges({poly}).empty());
  1887. VD vd;
  1888. Lines lines = to_lines(poly);
  1889. construct_voronoi(lines.begin(), lines.end(), &vd);
  1890. #ifdef VORONOI_DEBUG_OUT
  1891. dump_voronoi_to_svg(debug_out_path("voronoi-missing-vertex1-out.svg").c_str(), vd, Points(), lines);
  1892. #endif
  1893. // REQUIRE(!has_missing_voronoi_vertices({poly}, vd));
  1894. }
  1895. // This case is composed of two square polygons (contour and hole), and again one of the edges is divided into two parts by a
  1896. // point that lies on this edge, and for this point is Voronoi vertex missing. A difference between the previous and this case is
  1897. // that for this case, through the missing Voronoi vertex is passing a finite edge between two internal Voronoin vertices.
  1898. // Therefore, this missing Voronoi vertex and edge can be reconstructed using the intersection between the finite edge with the
  1899. // input polygon.
  1900. // Rotation of the polygons solves this problem.
  1901. TEST_CASE("Voronoi missing vertex 2", "[VoronoiMissingVertex2]")
  1902. {
  1903. Polygons poly = {
  1904. Polygon {
  1905. { 50000000, 50000000},
  1906. {-50000000, 50000000},
  1907. {-50000000, -50000000},
  1908. { 50000000, -50000000},
  1909. },
  1910. Polygon {
  1911. {-45000000, -45000000},
  1912. {-45000000, 45000000},
  1913. { 45000000, 45000000},
  1914. { 45000000, 8280000},
  1915. { 45000000, -45000000},
  1916. }
  1917. };
  1918. // polygons_rotate(poly, PI / 6);
  1919. double area = std::accumulate(poly.begin(), poly.end(), 0., [](double a, auto &poly) { return a + poly.area(); });
  1920. REQUIRE(area > 0.);
  1921. REQUIRE(intersecting_edges(poly).empty());
  1922. VD vd;
  1923. Lines lines = to_lines(poly);
  1924. construct_voronoi(lines.begin(), lines.end(), &vd);
  1925. #ifdef VORONOI_DEBUG_OUT
  1926. dump_voronoi_to_svg(debug_out_path("voronoi-missing-vertex2-out.svg").c_str(), vd, Points(), lines);
  1927. #endif
  1928. // REQUIRE(!has_missing_voronoi_vertices(poly, vd));
  1929. }
  1930. // This case is composed of two polygons, and again one of the edges is divided into two parts by a point that lies on this edge,
  1931. // and for this point is Voronoi vertex missing. A difference between the previous cases and this case through the missing
  1932. // Voronoi vertex is passing finite edge between one inner Voronoi vertex and one outer Voronoi vertex.
  1933. // Rotating the polygon also help solve this problem.
  1934. TEST_CASE("Voronoi missing vertex 3", "[VoronoiMissingVertex3]")
  1935. {
  1936. Polygons poly = {
  1937. Polygon {
  1938. {-29715088, -29310899},
  1939. {-29022573, -28618384},
  1940. {-27771147, -27366958},
  1941. {-28539221, -26519393},
  1942. {-30619013, -28586348},
  1943. {-29812018, -29407830},
  1944. },
  1945. Polygon {
  1946. {-27035112, -28071875},
  1947. {-27367482, -27770679},
  1948. {-28387008, -28790205},
  1949. {-29309438, -29712635},
  1950. {-29406319, -29809515},
  1951. {-29032985, -30179156},
  1952. }
  1953. };
  1954. double area = std::accumulate(poly.begin(), poly.end(), 0., [](double a, auto &poly){ return a + poly.area(); });
  1955. REQUIRE(area > 0.);
  1956. REQUIRE(intersecting_edges(poly).empty());
  1957. // polygons_rotate(poly, PI/180);
  1958. // polygons_rotate(poly, PI/6);
  1959. VD vd;
  1960. Lines lines = to_lines(poly);
  1961. construct_voronoi(lines.begin(), lines.end(), &vd);
  1962. #ifdef VORONOI_DEBUG_OUT
  1963. dump_voronoi_to_svg(debug_out_path("voronoi-missing-vertex3-out.svg").c_str(), vd, Points(), lines);
  1964. #endif
  1965. // REQUIRE(!has_missing_voronoi_vertices(poly, vd));
  1966. }
  1967. // In this case, the Voronoi vertex (146873, -146873) is included twice.
  1968. // Also, near to those duplicate Voronoi vertices is another Voronoi vertex (146872, -146872).
  1969. // Rotating the polygon will help solve this problem, but then there arise three very close Voronoi vertices.
  1970. // Rotating of the input polygon will help solve this problem.
  1971. TEST_CASE("Duplicate Voronoi vertices", "[Voronoi]")
  1972. {
  1973. Polygon poly = {
  1974. { 25000000, 25000000},
  1975. {-25000000, 25000000},
  1976. {-25000000, -25000000},
  1977. { 146872, -25000000},
  1978. { 9912498, -25000000},
  1979. { 25000000, -25000000},
  1980. { 25000000, - 8056252},
  1981. { 25000000, - 146873},
  1982. { 25000000, 10790627},
  1983. };
  1984. // poly.rotate(PI / 6);
  1985. REQUIRE(poly.area() > 0.);
  1986. REQUIRE(intersecting_edges({poly}).empty());
  1987. VD vd;
  1988. Lines lines = to_lines(poly);
  1989. construct_voronoi(lines.begin(), lines.end(), &vd);
  1990. #ifdef VORONOI_DEBUG_OUT
  1991. dump_voronoi_to_svg(debug_out_path("voronoi-duplicate-vertices-out.svg").c_str(), vd, Points(), lines);
  1992. #endif
  1993. [[maybe_unused]] auto has_duplicate_vertices = [](const VD &vd) -> bool {
  1994. std::vector<Vec2d> vertices;
  1995. for (const auto &vertex : vd.vertices())
  1996. vertices.emplace_back(Vec2d(vertex.x(), vertex.y()));
  1997. std::sort(vertices.begin(), vertices.end(), [](const Vec2d &l, const Vec2d &r) { return l.x() < r.x() || (l.x() == r.x() && l.y() < r.y()); });
  1998. return std::unique(vertices.begin(), vertices.end()) != vertices.end();
  1999. };
  2000. // REQUIRE(!has_duplicate_vertices(vd));
  2001. }
  2002. // In this case, there are three very close Voronoi vertices like in the previous test case after rotation. There is also one
  2003. // missing Voronoi vertex. One infinity-edge (after clip [(146872, -70146871), (146872, -146871)]) passes through this missing
  2004. // Voronoi vertex. This infinite edge [(146872, -70146871), (146872, -146871)] and edge [(146873, -146873), (0, 0)] are intersecting.
  2005. // They intersect probably because the three points are very close to each other, with a combination of the missing Voronoi vertex.
  2006. // Rotating of the input polygon will help solve this problem.
  2007. TEST_CASE("Intersecting Voronoi edges", "[Voronoi]")
  2008. {
  2009. Polygon poly = {
  2010. { 25000000, 25000000},
  2011. {-25000000, 25000000},
  2012. {-25000000, -25000000},
  2013. { 146872, -25000000},
  2014. { 25000000, -25000000},
  2015. { 25000000, - 146873},
  2016. };
  2017. // poly.rotate(PI / 6);
  2018. REQUIRE(poly.area() > 0.);
  2019. REQUIRE(intersecting_edges({poly}).empty());
  2020. VD vd;
  2021. Lines lines = to_lines(poly);
  2022. construct_voronoi(lines.begin(), lines.end(), &vd);
  2023. #ifdef VORONOI_DEBUG_OUT
  2024. dump_voronoi_to_svg(debug_out_path("voronoi-intersecting-edges-out.svg").c_str(), vd, Points(), lines);
  2025. #endif
  2026. [[maybe_unused]] auto has_intersecting_edges = [](const Polygon &poly, const VD &vd) -> bool {
  2027. BoundingBox bbox = get_extents(poly);
  2028. const double bbox_dim_max = double(std::max(bbox.size().x(), bbox.size().y()));
  2029. std::vector<Voronoi::Internal::segment_type> segments;
  2030. for (const Line &line : to_lines(poly))
  2031. segments.emplace_back(Voronoi::Internal::point_type(double(line.a.x()), double(line.a.y())),
  2032. Voronoi::Internal::point_type(double(line.b.x()), double(line.b.y())));
  2033. Lines edges;
  2034. for (const auto &edge : vd.edges())
  2035. if (edge.cell()->source_index() < edge.twin()->cell()->source_index()) {
  2036. if (edge.is_finite()) {
  2037. edges.emplace_back(Point(coord_t(edge.vertex0()->x()), coord_t(edge.vertex0()->y())),
  2038. Point(coord_t(edge.vertex1()->x()), coord_t(edge.vertex1()->y())));
  2039. } else if (edge.is_infinite()) {
  2040. std::vector<Voronoi::Internal::point_type> samples;
  2041. Voronoi::Internal::clip_infinite_edge(poly.points, segments, edge, bbox_dim_max, &samples);
  2042. if (!samples.empty())
  2043. edges.emplace_back(Point(coord_t(samples[0].x()), coord_t(samples[0].y())), Point(coord_t(samples[1].x()), coord_t(samples[1].y())));
  2044. }
  2045. }
  2046. Point intersect_point;
  2047. for (auto first_it = edges.begin(); first_it != edges.end(); ++first_it)
  2048. for (auto second_it = first_it + 1; second_it != edges.end(); ++second_it)
  2049. if (first_it->intersection(*second_it, &intersect_point) && first_it->a != intersect_point && first_it->b != intersect_point)
  2050. return true;
  2051. return false;
  2052. };
  2053. // REQUIRE(!has_intersecting_edges(poly, vd));
  2054. }
  2055. // In this case resulting Voronoi diagram is not planar. This case was distilled from GH issue #8474.
  2056. // Also, in GH issue #8514, a non-planar Voronoi diagram is generated for several polygons.
  2057. // Rotating the input polygon will solve this issue.
  2058. TEST_CASE("Non-planar voronoi diagram", "[VoronoiNonPlanar]")
  2059. {
  2060. Polygon poly {
  2061. { 5500000, -42000000},
  2062. { 8000000, -17000000},
  2063. { 8000000, 40000000},
  2064. { 7500000, 40000000},
  2065. { 7500000, -18000000},
  2066. { 6000001, -18000000},
  2067. { 6000000, 40000000},
  2068. { 5500000, 40000000},
  2069. };
  2070. // poly.rotate(PI / 6);
  2071. REQUIRE(poly.area() > 0.);
  2072. REQUIRE(intersecting_edges({poly}).empty());
  2073. VD vd;
  2074. Lines lines = to_lines(poly);
  2075. construct_voronoi(lines.begin(), lines.end(), &vd);
  2076. #ifdef VORONOI_DEBUG_OUT
  2077. dump_voronoi_to_svg(debug_out_path("voronoi-non-planar-out.svg").c_str(), vd, Points(), lines);
  2078. #endif
  2079. // REQUIRE(Geometry::VoronoiUtilsCgal::is_voronoi_diagram_planar_intersection(vd));
  2080. }