Skip to content
Edit this page

ictdesigntools.parts.joins

Parts that join cable assemblies in a channel: adapters (couplers), cassettes, splitters, fusion and mechanical splices, from data/joins.toml, each drawn from the side as an engine component for cabling.channels.

A part's side view starts at its A face (x = 0) and ends at its B face (x = length_mm), with one row per port at the heights a drawing gives it, so plugs drawn with parts.plugs.plug_side meet it at depth_mm inside each face. Adapters take the TIA-568 connector colours like the plugs; cassettes and splitters show their internal fibers fanning from the rear ports to the front.

>>> j = join("cassette-mpo12-lc12")
>>> j.kind, j.a, j.b, j.a_ports, j.b_ports, j.connections
('cassette', 'mpo', 'lc', 1, 12, 2)
>>> join("plc-splitter-1x8").loss_db
10.7

joins cached

joins() -> dict[str, Join]

The parts in data/joins.toml, by slug.

Source code in src/ictdesigntools/parts/joins.py
@cache
def joins() -> dict[str, Join]:
    """The parts in ``data/joins.toml``, by slug."""
    out = {}
    for r in rows("joins", "join"):
        r = dict(r)
        r["schematic"] = tuple(r.get("schematic", ()))
        out[r["slug"]] = Join(**r)
    return out

join_side cached

join_side(
    slug: str,
    a_rows: tuple[float, ...],
    b_rows: tuple[float, ...],
    tone: str = "",
) -> Component

A join from the side, A face at x = 0 and B face at length_mm, with a port at each height in a_rows and b_rows (one row each for an adapter or a splice).

Source code in src/ictdesigntools/parts/joins.py
@cache
def join_side(slug: str, a_rows: tuple[float, ...], b_rows: tuple[float, ...],
              tone: str = "") -> Component:  # fmt: skip
    """A join from the side, A face at x = 0 and B face at ``length_mm``, with a port at each
    height in ``a_rows`` and ``b_rows`` (one row each for an adapter or a splice)."""
    j = join(slug)
    L, h = j.length_mm, j.height_mm
    items: list = []
    adapter = f"adapter-{tone or 'plain'}"
    if j.kind == "adapter":
        for y in a_rows:
            items.append(Rect(0, y - h / 2, L, h, rx=0.6, style=adapter))
            items.append(Rect(L / 2 - 0.9, y - h / 2 - 1.6, 1.8, h + 3.2, style="flange"))
    elif j.kind in ("cassette", "splitter"):
        ys = a_rows + b_rows
        top, bottom = min(ys) - h / 2 - 3, max(ys) + h / 2 + 3
        box = "module" if j.kind == "cassette" else "module-light"
        items.append(Rect(0, top, L, bottom - top, rx=1.0, style=box))
        port = 7.0
        for ya in a_rows:  # the fibers inside, fanning from the rear ports to the front
            for yb in b_rows:
                items.append(Polyline(tuple(s_curve((port, ya), (L - port, yb), 16)),
                                      style="inner-fiber"))  # fmt: skip
        for y in a_rows:
            items.append(Rect(-1.0, y - h / 2, port + 1.0, h, rx=0.4, style=adapter))
        for y in b_rows:
            items.append(Rect(L - port, y - h / 2, port + 1.0, h, rx=0.4, style=adapter))
    elif j.kind == "fusion-splice":
        for y in a_rows:
            items.append(Rect(0, y - h / 2, L, h, rx=h / 2, style="sleeve"))
            items.append(Polyline(((2.0, y - h * 0.22), (L - 2.0, y - h * 0.22)), style="rod"))
    elif j.kind == "mechanical-splice":
        for y in a_rows:
            items.append(Rect(0, y - h / 2, L, h, rx=0.6, style="clamp"))
            items.append(Rect(L * 0.3, y - h / 2 - 1.0, L * 0.4, 1.0, rx=0.3, style="flange"))
    return Component(f"join-{slug}-{tone or 'plain'}-{hash((a_rows, b_rows)) & 0xFFFFFF:06x}",
                     tuple(items), title=j.name)  # fmt: skip