Cross-sections and routing · 2 of 6
Offsets and parameters
A section does not have to be centered. offset moves the middle of a section away from the centerline: a positive offset to the left of the direction of travel, a negative one to the right. With a list of offsets, the line draws one section per offset:
define xsection rails(gap = 6um) {
metal 2um offset [gap / 2, -gap / 2] # two rails, gap apart
}Cross-sections take parameters like cells. The name alone uses the defaults; arguments go in parentheses, by position or by name:
shape straight with 30um, rails as a.start at self.origin # gap = 6um
shape straight with 30um, rails(gap = 10um) as b.start at (0, 20um)Inside a cell, an argument can be one of the cell's own parameters: rails(gap = gap).
Exercise
Give the cross-section heated two 1 µm wide heater strips on metal, their middles gap to the left and gap to the right of the core. Then make PhaseShifter draw its waveguide with its own gap, so that PhaseShifter with gap = 3um moves the heaters out.