示例#1
0
def crossing_arm(
    wg_width: float = 0.5,
    r1: float = 3.0,
    r2: float = 1.1,
    w: float = 1.2,
    L: float = 3.4,
) -> Component:
    """arm of a crossing"""
    c = pp.Component()
    _ellipse = ellipse(radii=(r1, r2), layer=LAYER.SLAB150).ref()
    c.add(_ellipse)
    c.absorb(_ellipse)

    a = pp.drc.snap_to_1nm_grid(L + w / 2)
    h = wg_width / 2

    taper_pts = [
        (-a, h),
        (-w / 2, w / 2),
        (w / 2, w / 2),
        (a, h),
        (a, -h),
        (w / 2, -w / 2),
        (-w / 2, -w / 2),
        (-a, -h),
    ]

    c.add_polygon(taper_pts, layer=LAYER.WG)
    c.add_port(name="W0",
               midpoint=(-a, 0),
               orientation=180,
               width=wg_width,
               layer=LAYER.WG)

    c.add_port(name="E0",
               midpoint=(a, 0),
               orientation=0,
               width=wg_width,
               layer=LAYER.WG)

    return c
def crossing_arm(wg_width=0.5, r1=3.0, r2=1.1, w=1.2, L=3.4):
    """
    """
    cmp = pp.Component()
    _ellipse = ellipse(radii=(r1, r2), layer=LAYER.SLAB150).ref()
    cmp.add(_ellipse)
    cmp.absorb(_ellipse)

    a = L + w / 2
    h = wg_width / 2

    taper_pts = [
        (-a, h),
        (-w / 2, w / 2),
        (w / 2, w / 2),
        (a, h),
        (a, -h),
        (w / 2, -w / 2),
        (-w / 2, -w / 2),
        (-a, -h),
    ]

    cmp.add_polygon(taper_pts, layer=LAYER.WG)
    cmp.add_port(name="W0",
                 midpoint=(-a, 0),
                 orientation=180,
                 width=wg_width,
                 layer=LAYER.WG)

    cmp.add_port(name="E0",
                 midpoint=(a, 0),
                 orientation=0,
                 width=wg_width,
                 layer=LAYER.WG)

    return cmp
示例#3
0
def crossing_etched(
    wg_width=0.5,
    r1=3.0,
    r2=1.1,
    w=1.2,
    L=3.4,
    layer_wg=LAYER.WG,
    layer_slab=LAYER.SLAB150,
):
    """
    Waveguide crossing:
    - The full crossing has to be on WG layer (to start with a 220nm slab)
    - Then we etch the ellipses down to 150nm slabs and we keep linear taper at 220nm. What we write is what we etch on this step
    """

    # Draw the ellipses
    c = pp.Component()
    _ellipse1 = ellipse(radii=(r1, r2), layer=layer_wg).ref()
    _ellipse2 = ellipse(radii=(r2, r1), layer=layer_wg).ref()
    c.add(_ellipse1)
    c.add(_ellipse2)
    c.absorb(_ellipse1)
    c.absorb(_ellipse2)

    #
    a = L + w / 2
    h = wg_width / 2

    taper_cross_pts = [
        (-a, h),
        (-w / 2, w / 2),
        (-h, a),
        (h, a),
        (w / 2, w / 2),
        (a, h),
        (a, -h),
        (w / 2, -w / 2),
        (h, -a),
        (-h, -a),
        (-w / 2, -w / 2),
        (-a, -h),
    ]

    tapers_poly = c.add_polygon(taper_cross_pts, layer=layer_wg)

    b = a - 0.1  # To make sure we get 4 distinct polygons when doing bool ops
    tmp_polygon = [(-b, b), (b, b), (b, -b), (-b, -b)]

    polys_etch = gdspy.fast_boolean([tmp_polygon],
                                    tapers_poly,
                                    "not",
                                    layer=layer_slab)
    c.add(polys_etch)

    positions = [(a, 0), (0, a), (-a, 0), (0, -a)]
    angles = [0, 90, 180, 270]

    i = 0
    for p, angle in zip(positions, angles):
        c.add_port(
            name="tmp{}".format(i),
            midpoint=p,
            orientation=angle,
            width=wg_width,
            layer=layer_wg,
        )
        i += 1

    c = pp.port.rename_ports_by_orientation(c)
    return c