File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -223,6 +223,38 @@ BOOST_AUTO_TEST_CASE(PolygonTest04)
223223 }
224224}
225225
226+ BOOST_AUTO_TEST_CASE (TouchingHolesTest)
227+ {
228+ std::list<p2t::Point> points;
229+ auto point = [&points](double a, double b){
230+ points.emplace_back (a, b);
231+ return &points.back ();
232+ };
233+ std::vector<p2t::Point*> polyline{
234+ point (0 , 0 ),
235+ point (1 , 0 ),
236+ point (0.5 , 1 ),
237+ };
238+ auto point_02_02 = p2t::Point (0.2 , 0.2 );
239+ std::vector<p2t::Point*> hole0 {
240+ point (0.1 , 0.1 ),
241+ point (0.2 , 0.1 ),
242+ &point_02_02,
243+ };
244+ std::vector<p2t::Point*> hole1 {
245+ &point_02_02,
246+ point (0.3 , 0.2 ),
247+ point (0.3 , 0.3 ),
248+ };
249+ p2t::CDT cdt{ polyline };
250+ cdt.AddHole (hole0);
251+ cdt.AddHole (hole1);
252+ BOOST_CHECK_NO_THROW (cdt.Triangulate ());
253+ const auto result = cdt.GetTriangles ();
254+ BOOST_REQUIRE_EQUAL (result.size (), 9 );
255+ BOOST_CHECK (p2t::IsDelaunay (result));
256+ }
257+
226258BOOST_AUTO_TEST_CASE (TestbedFilesTest)
227259{
228260 for (const auto & filename : { " custom.dat" , " diamond.dat" , " star.dat" , " test.dat" }) {
You can’t perform that action at this time.
0 commit comments