laylight tour
0/25
2/4

Markers and ports · 2 of 4

Port to port

A marker position is a frame: a point with a direction. A marker on core.left_center points along +x like the anchor itself, and a marker on the end of an arc points the way the arc ends.

By convention, both the input and the output port of a component point downstream, the way the light travels. Placing a component's input on another component's output therefore joins them nose to tail — and, since both anchors have directions, turns the new component to follow:

place Waveguide at self.origin as a
place Bend at a.marker.output[0] as b        # the bend follows a
place Waveguide at b.marker.output[0] as c   # c heads the way b ends

When a cell has a marker named input, placing the cell by itself (Bend at …) uses Bend.marker.input[0] as the anchor; otherwise it uses origin. Any other marker location can be named: place Bend.marker.output[0] at ….

Placing one port on another also records a connection between them, which the last page of this chapter puts to use.

Exercise

Build Route out of the two components, each attached to the output of the one before: after the 20 µm waveguide a, a left bend, a 10 µm waveguide (the default length), a right bend (sweep −90°) and a final 5 µm waveguide.

loading compiler…

Edit the code, watch the layout, then press Submit to check your solution against the exercise.

Compiling…