Shapes and placement · 5 of 6
Paths
A path is a line with a width, drawn through a list of points — the natural way to write a route:
shape path with [(0, 0), (10um, 0), (10um, 5um)], 500nm as routeThe ends are flat, cut square to the first and the last segment.
Paths have two more anchors, start and end, and unlike the anchors so far they have a direction: start points along the first segment and end along the last one, both the way the path runs.
When a placement joins two anchors that have directions, laylight turns the shape so that the directions match. That makes continuing a path easy:
place tail.start at route.end # tail carries on where route stopsA plain point such as (0, 0) has the direction 0°, along +x. So place route.start at (0, 0) also turns the route so that it starts heading right — which the route above does already. To move a path without turning it, place its origin, the point (0, 0) of its own coordinates.
Exercise
Draw a U-turn: a path 1 µm wide that starts at the origin and runs 20 µm to the right, 10 µm up and 20 µm back to the left. Then attach the 5 µm path tail to the end of the route, so that it carries on in the same direction.