How to use the klayout.db.DSimplePolygon function in klayout

To help you get started, we’ve selected a few klayout examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github KLayout / klayout / testdata / pymod / bridge.py View on Github external
def test_1(self):
    p = db.DSimplePolygon(db.DBox(1,2,3,4))
    a = bridge.p2a(p)
    self.assertEqual(repr(bridge.p2a(p)), "[(1.0, 2.0), (1.0, 4.0), (3.0, 4.0), (3.0, 2.0)]")
github KLayout / klayout / testdata / pymod / bridge.py View on Github external
def test_2(self):
    p = db.DSimplePolygon(db.DBox(1,2,3,4))
    a = bridge.p2a(p)
    pp = bridge.a2p(a)
    self.assertEqual(repr(pp), "(1,2;1,4;3,4;3,2)")
    self.assertEqual(type(pp).__name__, "DSimplePolygon")