mirror of https://github.com/KLayout/klayout.git
WIP
This commit is contained in:
parent
512cf604d0
commit
7351810e55
|
|
@ -82,11 +82,6 @@ public:
|
|||
*/
|
||||
void clear ();
|
||||
|
||||
/**
|
||||
* @brief Creates a constrained Delaunay triangulation from the given Region
|
||||
*/
|
||||
void create_constrained_delaunay (const db::Region ®ion, double dbu = 1.0);
|
||||
|
||||
// exposed for testing purposes:
|
||||
|
||||
/**
|
||||
|
|
@ -180,6 +175,11 @@ public:
|
|||
*/
|
||||
void remove_outside_triangles ();
|
||||
|
||||
/**
|
||||
* @brief Creates a constrained Delaunay triangulation from the given Region
|
||||
*/
|
||||
void create_constrained_delaunay (const db::Region ®ion, double dbu = 1.0);
|
||||
|
||||
// NOTE: these functions are SLOW and intended to test purposes only
|
||||
std::vector<db::Vertex *> find_touching (const db::DBox &box) const;
|
||||
std::vector<db::Vertex *> find_inside_circle (const db::DPoint ¢er, double radius) const;
|
||||
|
|
|
|||
|
|
@ -513,3 +513,28 @@ TEST(Triangle_test_heavy_find_point_around)
|
|||
|
||||
tl::info << tl::endl << "done.";
|
||||
}
|
||||
|
||||
TEST(Triangle_test_create_constrained_delaunay)
|
||||
{
|
||||
db::Region r;
|
||||
r.insert (db::Box (0, 0, 1000, 1000));
|
||||
|
||||
db::Region r2;
|
||||
r2.insert (db::Box (200, 200, 800, 800));
|
||||
|
||||
r -= r2;
|
||||
|
||||
db::Triangles tri;
|
||||
tri.create_constrained_delaunay (r);
|
||||
tri.remove_outside_triangles ();
|
||||
|
||||
EXPECT_EQ (tri.to_string (),
|
||||
"((1000, 0), (0, 0), (200, 200)), "
|
||||
"((0, 1000), (200, 200), (0, 0)), "
|
||||
"((1000, 0), (200, 200), (800, 200)), "
|
||||
"((1000, 0), (800, 200), (1000, 1000)), "
|
||||
"((800, 200), (800, 800), (1000, 1000)), "
|
||||
"((0, 1000), (1000, 1000), (800, 800)), "
|
||||
"((0, 1000), (800, 800), (200, 800)), "
|
||||
"((0, 1000), (200, 800), (200, 200))");
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue