masque/examples/ellip_grating.py

32 lines
696 B
Python
Raw Permalink Normal View History

# Quick script for testing arcs
import numpy
import masque
2020-10-10 19:10:35 -07:00
import masque.file.klamath
from masque import shapes
def main():
2017-11-04 12:18:58 -07:00
pat = masque.Pattern(name='ellip_grating')
for rmin in numpy.arange(10, 15, 0.5):
pat.shapes.append(shapes.Arc(
radii=(rmin, rmin),
width=0.1,
2020-05-17 14:13:42 -07:00
angles=(-numpy.pi/4, numpy.pi/4),
layer=(0, 0),
))
2020-05-17 14:13:42 -07:00
pat.labels.append(masque.Label(string='grating centerline', offset=(1, 0), layer=(1, 2)))
2017-11-04 12:18:58 -07:00
pat.scale_by(1000)
pat.visualize()
2017-11-04 12:18:58 -07:00
pat2 = pat.copy()
pat2.name = 'grating2'
2020-10-10 19:10:35 -07:00
masque.file.klamath.writefile((pat, pat2), 'out.gds.gz', 1e-9, 1e-3)
if __name__ == '__main__':
main()