qcc_kplugin.joins¶
How a route ends on another line: a hanger coupler beside it, or merged into it with a T-junction.
merge splits the line at a point into two routes joined by a KQC WaveguideCoplanarSplitter (a T: ports
a / b along the line, c the stem) and returns the stem port for the new route to end on. unmerge
undoes it: the two halves become one route again and the stem route ends as a hanger coupler at the T’s place.
hanger_to_merge / merge_to_hanger convert an existing route end. The LOM model of the splitter is one
conductor, so a capacitor or a resonator on the stem is galvanically on the line.
Plain Python (no pya): unit-tested outside KLayout. Functions change the design dict in place and raise
ValueError with a message fit for the status bar.
Attributes¶
Functions¶
|
(arclength of the point of polyline |
|
Route |
|
Split route |
|
Route |
|
The point at arclength |
|
Unit normal of segment |
|
The merge T at an end of |
|
Remove merge T |
Module Contents¶
- qcc_kplugin.joins.arclength(pts, p) tuple[float, int, tuple]¶
(arclength of the point of polyline
ptsnearestp, its segment (1-based), that point).
- qcc_kplugin.joins.hanger_to_merge(design: dict, route: str, polyline_of, r: float, tee_params: dict | None = None) str¶
Route
routeends as a hanger coupler: merge it into that line with a T instead. Returns the T’s name.
- qcc_kplugin.joins.merge(design: dict, host: str, polyline, point, side: str, r: float, tee_params: dict | None = None, tee: str | None = None) dict¶
Split route
host(builtpolyline, bend radiusr) at the point nearestpointwith a T whose stem points tosideof the line. Returns{"tee", "stem", "stem_pos", "stem_dir", "second"}: the T’s name, its stem port ("T1.c"), the stem port’s position and direction, and the name of the second half.
- qcc_kplugin.joins.merge_to_hanger(design: dict, route: str, polyline_of, coupler: float = 300.0, ground_gap: float = 6.0, end: str = 'short') str¶
Route
routeends on a merge T’s stem: remove the T and end the route as a hanger coupler there instead.polyline_of(name)gives a built route’s polyline (the sidecar). Returns the line it now hangs from.
- qcc_kplugin.joins.point_at(pts, s: float) tuple¶
The point at arclength
salong polylinepts.
- qcc_kplugin.joins.side_normal(pts, segment: int, side: str) tuple¶
Unit normal of segment
segment(1-based) ofptsonside(“left” / “right” of the travel).
- qcc_kplugin.joins.tee_of(design: dict, route: str) str | None¶
The merge T at an end of
route(an instance ofTEE_CELLwhose stemcthe route ends on).
- qcc_kplugin.joins.unmerge(design: dict, tee: str) tuple[str, tuple]¶
Remove merge T
tee: its two halves become one route again (named as the first). Returns (that route, the T’s position).
- qcc_kplugin.joins.TEE_ARM = 11.0¶
- qcc_kplugin.joins.TEE_CELL = 'WaveguideCoplanarSplitter'¶