mirror of https://github.com/KLayout/klayout.git
Updated pykl Bridging code (markdown)
parent
88c0f9ad13
commit
68c3f61d1a
|
|
@ -5,9 +5,9 @@ Imagine you have a third-party library that accepts polygons, but not KLayout ob
|
|||
The Python solution was to iterate over the KLayout polygon and produce the array:
|
||||
|
||||
```Python
|
||||
import pykl.db
|
||||
import klayout.db
|
||||
|
||||
some_polygon = pykl.db.DSimplePolygon(pykl.db.DBox(0, 0, 100, 200))
|
||||
some_polygon = klayout.db.DSimplePolygon(klayout.db.DBox(0, 0, 100, 200))
|
||||
# make it more complex:
|
||||
some_polygon = some_polygon.round_corners(10.0, 10.0, 200)
|
||||
|
||||
|
|
@ -24,11 +24,11 @@ The solution is a specialized C module that performs this translation. I'd like
|
|||
With such a bridge, the code looks this way:
|
||||
|
||||
```Python
|
||||
import pykl.tl
|
||||
import pykl.db
|
||||
import klayout.tl
|
||||
import klayout.db
|
||||
import bridge_sample as bs
|
||||
|
||||
some_polygon = pykl.db.DSimplePolygon(pykl.db.DBox(0, 0, 100, 200))
|
||||
some_polygon = klayout.db.DSimplePolygon(klayout.db.DBox(0, 0, 100, 200))
|
||||
# make it more complex:
|
||||
some_polygon = some_polygon.round_corners(10.0, 10.0, 200)
|
||||
|
||||
Loading…
Reference in New Issue