Пример #1
0
def logo(text: str = "GDSFACTORY") -> Component:
    """Returns GDSfactory logo."""
    c = Component()
    elements = []
    for i, letter in enumerate(text):
        c << gf.components.text(letter, layer=(i + 1, 0), size=10)
        elements.append(c)

    c.distribute(
        elements="all",  # either 'all' or a list of objects
        direction="x",  # 'x' or 'y'
        spacing=1,
        separation=True,
    )
    return c
Пример #2
0
def cdsem_straight_all(
    straight: ComponentFactory = straight,
    cross_section: CrossSectionFactory = strip,
    layer: Tuple[int, int] = LAYER.WG,
    layers_cladding: List[Tuple[int, int]] = None,
    widths: Tuple[float, ...] = (0.4, 0.45, 0.5, 0.6, 0.8, 1.0),
    pixel_size: float = 1.0,
    length: float = LINE_LENGTH,
    spacing: float = 4.5,
) -> Component:
    c = Component()
    for width in widths:
        cross_section = partial(cross_section, width=width, layer=layer)
        c.add_ref(straight(length=length, cross_section=cross_section))

    c.distribute(direction="y", spacing=spacing)
    return c
Пример #3
0
def pcm_optical(
    widths: Tuple[float, ...] = (0.4, 0.45, 0.5, 0.6, 0.8, 1.0),
    dense_lines_width: float = 0.3,
    dense_lines_width_difference: float = 20e-3,
    dense_lines_gap: float = 0.3,
    dense_lines_labels: Tuple[str, ...] = ("DL", "DM", "DH"),
    straight: ComponentFactory = straight,
    bend90: ComponentFactory = bend_circular,
    layer: Tuple[int, int] = LAYER.WG,
    layers_cladding: List[Tuple[int, int]] = None,
    cross_section: CrossSectionFactory = strip,
    pixel_size: float = 1.0,
) -> Component:
    """column with all optical PCMs

    Args:
        widths:  for straight

    """
    c = Component()
    _c1 = cdsem_straight_all(
        straight=straight,
        layer=layer,
        layers_cladding=layers_cladding,
        widths=widths,
        cross_section=cross_section,
        pixel_size=pixel_size,
    )

    all_devices = [_c1]

    all_devices += [
        cdsem_uturn(
            width=width,
            straight=straight,
            bend90=bend90,
            layer=layer,
            layers_cladding=layers_cladding,
            cross_section=cross_section,
            pixel_size=pixel_size,
        ) for width in widths
    ]

    density_params = [
        (
            dense_lines_width - dense_lines_width_difference,
            dense_lines_gap - dense_lines_width_difference,
            dense_lines_labels[0],
        ),
        (dense_lines_width, dense_lines_gap, dense_lines_labels[1]),
        (
            dense_lines_width + dense_lines_width_difference,
            dense_lines_gap + dense_lines_width_difference,
            dense_lines_labels[2],
        ),
    ]

    all_devices += [
        cdsem_straight_density(
            width=w,
            trench_width=t,
            label=lbl,
            straight=straight,
            layer=layer,
            layers_cladding=layers_cladding,
            cross_section=cross_section,
            pixel_size=pixel_size,
        ) for w, t, lbl in density_params
    ]

    [c.add_ref(d) for d in all_devices]
    c.align(elements="all", alignment="xmin")
    c.distribute(elements="all", direction="y", spacing=5, separation=True)
    return c
Пример #4
0
def cdsem_all(
    widths: Tuple[float, ...] = (0.4, 0.45, 0.5, 0.6, 0.8, 1.0),
    dense_lines_width: Optional[float] = 0.3,
    dense_lines_width_difference: float = 20e-3,
    dense_lines_gap: float = 0.3,
    dense_lines_labels: Tuple[str, ...] = ("DL", "DM", "DH"),
    straight: ComponentFactory = straight_function,
    bend90: Optional[ComponentFactory] = bend_circular,
    cross_section: CrossSectionFactory = strip,
    text: ComponentFactory = text_rectangular_mini,
) -> Component:
    """column with all optical PCMs

    Args:
        widths: for straight lines

    """
    c = Component()
    _c1 = cdsem_straight(
        widths=widths,
        cross_section=cross_section,
    )

    all_devices = [_c1]

    if bend90:
        all_devices += [
            cdsem_bend180(
                width=width,
                straight=straight,
                bend90=bend90,
                cross_section=cross_section,
                text=text,
            ) for width in widths
        ]

    if dense_lines_width:
        density_params = [
            (
                dense_lines_width - dense_lines_width_difference,
                dense_lines_gap - dense_lines_width_difference,
                dense_lines_labels[0],
            ),
            (dense_lines_width, dense_lines_gap, dense_lines_labels[1]),
            (
                dense_lines_width + dense_lines_width_difference,
                dense_lines_gap + dense_lines_width_difference,
                dense_lines_labels[2],
            ),
        ]

        all_devices += [
            cdsem_straight_density(
                widths=[w] * 10,
                gaps=[g] * 10,
                label=lbl,
                cross_section=cross_section,
                text=text,
            ) for w, g, lbl in density_params
        ]

    [c.add_ref(d) for d in all_devices]
    c.align(elements="all", alignment="xmin")
    c.distribute(elements="all", direction="y", spacing=5, separation=True)
    return c