You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/src/routes.md
+128-1Lines changed: 128 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,7 +10,7 @@ To draw a `Path` from a `Route`, you can use [`Path(r::Route, sty)`](@ref).
10
10
11
11
More often, you won't work directly with the `Route` type but will instead use [`route!`](@ref) to extend an existing path to an endpoint according to the rules you specify.
12
12
13
-
## Route API
13
+
## Reference
14
14
15
15
```@docs
16
16
Paths.Route
@@ -24,6 +24,8 @@ More often, you won't work directly with the `Route` type but will instead use [
24
24
Paths.StraightAnd90
25
25
Paths.StraightAnd45
26
26
Paths.CompoundRouteRule
27
+
Paths.SingleChannelRouting
28
+
Paths.RouteChannel
27
29
```
28
30
29
31
### Route drawing
@@ -53,3 +55,128 @@ A `Route` supports endpoint inspection much like a `Path` does:
53
55
Paths.p1(::Paths.Route)
54
56
Paths.α1(::Paths.Route)
55
57
```
58
+
59
+
## Examples
60
+
61
+
### Channel routing
62
+
63
+
`RouteChannels` offer a way to run routes in parallel, with routes joining or leaving a channel at different points. Using `SingleChannelRouting`, we can set the "track" (a path offset from the channel centerline) for each route through the channel, as well as some rules for joining and leaving the channel from route start and end points. Here's a basic example with a straight channel:
64
+
65
+
```@example 1
66
+
using DeviceLayout, .PreferredUnits, FileIO
67
+
import DeviceLayout.Graphics: inch
68
+
# Define start and end points for various routes
69
+
p0s = [
70
+
Point(100.0, -200.0)μm, # Enter and exit from bottom
71
+
Point(600.0, -150)μm, # Enter from bottom, exit from right
72
+
Point(-100.0, -100.0)μm, # Enter from lower left, exit from right
73
+
Point(50.0, 150)μm, # Enter from top, exit from right
74
+
Point(100.0, 200.0)μm # Enter and exit from top
75
+
]
76
+
77
+
p1s = [
78
+
Point(400.0, -200.0)μm,
79
+
Point(1100.0, -150.0)μm,
80
+
Point(1200.0, 50.0)μm,
81
+
Point(1100.0, 150.0)μm,
82
+
Point(900.0, 200.0)μm
83
+
]
84
+
85
+
# Create channel
86
+
channel_path = Path()
87
+
straight!(channel_path, 1mm, Paths.Trace(0.1mm))
88
+
channel = Paths.RouteChannel(channel_path)
89
+
# Initialize paths
90
+
paths = [Path(p) for p in p0s]
91
+
# Define route rule
92
+
transition_rule = Paths.StraightAnd90(25μm) # Manhattan with 25μm bend radius
93
+
margin = 50.0μm # Room for bends between endpoints and channel
We can also have curved channels, like the `BSpline`-based example below. For the transition rule, `StraightAnd90` would no longer work for the paths that join the channel at an angle, so we use `BSplineRouting` instead. We also enable `auto_speed` and `auto_curvature` on that rule to help smooth out the B-splines and maintain continuous curvature.
0 commit comments