Home › Forums › Nazca › Questions and Answers › Where can I set straight-to-bend waveguide offset › Reply To: Where can I set straight-to-bend waveguide offset
28 June 2018 at 19:57
#4454
Ronald
Keymaster
In addition to Xaveer’s answer, the below examples show how to define a xsection and offset from scratch, i.e. without importing demofab. The first example uses the generic ‘strt’ and ‘bend’ functions to draw the waveguides.
import nazca as nd
xs1 = nd.add_xsection(name='new_xs')
xs1.os = 0.5
nd.strt(length=10, xs='new_xs').put()
nd.bend(angle=10, xs='new_xs').put()
nd.export_gds()
It can be convenient to work with ‘interconnects’ that remember their xs, width, radius, etc.
See the example below and the interconnect tutorial on how to use them.
import nazca as nd
xs1 = nd.add_xsection(name='new_xs')
xs1.os = 0.5
waveguide = nd.interconnects.Interconnect(width=2, radius=20, xs='new_xs')
waveguide.strt(length=10).put()
waveguide.bend(angle=10).put()
nd.export_gds()
Ronald