2017-04-19 18:55:44 -07:00
|
|
|
# Quick script for testing arcs
|
|
|
|
|
|
|
|
import numpy
|
|
|
|
|
|
|
|
import masque
|
2023-07-17 20:22:04 -07:00
|
|
|
from masque.file import gdsii
|
2017-04-19 18:55:44 -07:00
|
|
|
from masque import shapes
|
|
|
|
|
|
|
|
|
|
|
|
def main():
|
2017-11-04 12:18:58 -07:00
|
|
|
pat = masque.Pattern(name='ellip_grating')
|
2023-07-17 20:22:04 -07:00
|
|
|
layer = (0, 0)
|
|
|
|
pat.shapes[layer].extend([
|
|
|
|
shapes.Arc(
|
2017-04-19 18:55:44 -07:00
|
|
|
radii=(rmin, rmin),
|
|
|
|
width=0.1,
|
2020-05-17 14:13:42 -07:00
|
|
|
angles=(-numpy.pi/4, numpy.pi/4),
|
2023-07-17 20:22:04 -07:00
|
|
|
)
|
|
|
|
for rmin in numpy.arange(10, 15, 0.5)]
|
|
|
|
)
|
2017-04-19 18:55:44 -07:00
|
|
|
|
2023-07-17 20:22:04 -07:00
|
|
|
pat.label(string='grating centerline', offset=(1, 0), layer=(1, 2))
|
2020-05-17 14:13:42 -07:00
|
|
|
|
2017-11-04 12:18:58 -07:00
|
|
|
pat.scale_by(1000)
|
2017-04-19 18:55:44 -07:00
|
|
|
pat.visualize()
|
2017-11-04 12:18:58 -07:00
|
|
|
|
2023-07-17 20:22:04 -07:00
|
|
|
lib = {
|
|
|
|
'ellip_grating': pat,
|
|
|
|
'grating2': pat.copy(),
|
|
|
|
}
|
|
|
|
|
|
|
|
gdsii.writefile(lib, 'out.gds.gz', meters_per_unit=1e-9, logical_units_per_unit=1e-3)
|
2017-04-19 18:55:44 -07:00
|
|
|
|
|
|
|
|
|
|
|
if __name__ == '__main__':
|
|
|
|
main()
|