Esempio n. 1
0
#==============================================================================
# Adding text
#==============================================================================
# The function text() creates a Device, just like waveguide.  Use it and
# manipulate it like any other Device
t = D2.add_ref(pg.text('Hello\nworld!', size=10, justify='center'))
t.move([0, 40]).rotate(45)
quickplot(D2)

#==============================================================================
# Labeling
#==============================================================================
# This label will display in a GDS viewer, but will not be rendered
# or printed like the polygons created by the text()
D2.label('First label', mwg1.center)
D2.label('Second label', mwg2.center)

#==============================================================================
# Saving the file as a .gds
#==============================================================================
D2.write_gds('MultiMultiWaveguideTutorial.gds')

#==============================================================================
# Using Layers
#==============================================================================
# Let's make a new blank device DL and add some text to it, but this time on
# different layers
DL = Device()

# You can specify any layer in one of three ways:
Esempio n. 2
0
# The function text() creates a Device, just like waveguide.  Use it and
# manipulate it like any other Device
t = D2.add_ref(pg.text('Hello\nworld!', size=10, justify='center'))
t.move([0, 40]).rotate(45)
qp(D2)

#==============================================================================
# Labeling
#==============================================================================
# We can also label (annotate) our devices, in order to record information
# directly into the final GDS file without putting any extra geometry onto any
# layer
# This label will display in a GDS viewer, but will not be rendered
# or printed like the polygons created by the text()

D2.label(text='First label', position=mwg1.center)
D2.label('Second label', mwg2.center)

# It's very useful for recording information about the devices or layout
D2.label(text='The x size of this\nlayout is %s' % D2.xsize,
         position=(D2.xmax, D2.ymax),
         layer=255)

# Again, note we have to write the GDS for it to be visible (view in KLayout)
D2.write_gds('MultiMultiWaveguideWithLabels.gds')

#==============================================================================
# Saving the file as a .gds
#==============================================================================
D2.write_gds('MultiMultiWaveguideTutorial.gds')