-
Notifications
You must be signed in to change notification settings - Fork 184
/
maskprep_flat.py
51 lines (40 loc) · 1.17 KB
/
maskprep_flat.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
import warnings
from gplugins.klayout.dataprep.regions import (
Region,
RegionCollection,
boolean_not,
boolean_or,
copy,
size,
)
message = """
gdsfactory.simulation have been moved to gplugins
Make sure you have gplugins installed and use gplugins instead of gdsfactory.simulation
You can replace:
import gdsfactory.geometry.maskprep_flat as dp -> import gplugins.klayout.dataprep.regions as dp
You can install gplugins with:
pip install gplugins
"""
warnings.warn(message)
__all__ = [
"boolean_not",
"boolean_or",
"copy",
"size",
"Region",
"RegionCollection",
]
if __name__ == "__main__":
import gdsfactory as gf
import gdsfactory.geometry.maskprep_flat as dp
from gdsfactory.generic_tech.layer_map import LAYER as l
c = gf.Component()
ring = c << gf.components.coupler_ring()
floorplan = c << gf.components.bbox(ring.bbox, layer=l.FLOORPLAN)
c.write_gds("src.gds")
d = dp.RegionCollection(filepath="src.gds", layermap=dict(l))
fill_cell = d.get_fill(
d.FLOORPLAN - d.WG, size=(0.1, 0.1), spacing=(0.1, 0.1), fill_layers=(l.WG,)
)
fill_cell.write("fill.gds")
gf.show("fill.gds")