def make_rotating_slits(length,
                        width,
                        N,
                        radius,
                        layers,
                        angle_ref=None,
                        angle_sweep=360):
    """

    :param length: Length of the slits in the circle
    :param width: Width of the slits in the circle
    :param N: Number of slits going around the circle
    :param radius: Radius of the circle
    :param layers: Layers to write the slits in
    :param angle_ref: if None, no angle reference lines are added. If '111' then add reference lines at 30/60 degrees. If '100' then add reference lines at 45/90 degrees.
    :return:
    """
    cell = Cell('RotatingSlits')
    if not (type(layers) == list): layers = [layers]
    allslits = Cell('All Slits')
    angles = np.linspace(0, angle_sweep, N)
    #        radius = length*12.
    translation = (radius, 0)
    for l in layers:
        membrane = Path([(-length / 2., 0), (length / 2., 0)],
                        width=width,
                        layer=l)
        membrane_cell = Cell('Membrane_w{:.0f}'.format(width * 1000))
        membrane_cell.add(membrane)
        slit = Cell("Slit")
        slit.add(membrane_cell, origin=translation)
        for angle in angles:
            allslits.add(slit, rotation=angle)
        cell.add(allslits)

        if angle_ref:
            labelCell = Cell('AngleLabels')
            lineCell = Cell('Line')
            pt1 = (-radius * 0.9, 0)
            pt2 = (radius * 0.9, 0)
            line = Path([pt1, pt2], width=width, layer=l)
            dLine = dashed_line(pt1, pt2, 2, width, l)
            lineCell.add(line)
            labelCell.add(lineCell, rotation=0)
            if angle_ref == '111':
                labelCell.add(lineCell, rotation=60)
                labelCell.add(lineCell, rotation=-60)
                labelCell.add(dLine, rotation=30)
                labelCell.add(dLine, rotation=90)
                labelCell.add(dLine, rotation=-30)
            elif angle_ref == '100':
                labelCell.add(lineCell, rotation=0)
                labelCell.add(lineCell, rotation=90)
                labelCell.add(dLine, rotation=45)
                labelCell.add(dLine, rotation=135)
            cell.add(labelCell)

        return cell
Beispiel #2
0
    def make_basel_align_marks(self, points, layers, mk_width=5):
        if not (type(layers) == list):
            layers = [layers]
        wafer_rad = self.wafer_r
        tri_height = np.sqrt(3.) / 2. * self.trisize
        # Shift the points from the old dicing lines to make the dashed dicing lines
        points1 = np.array(points) + (self.trisize / 2., 0.)
        points2 = np.array(points) + (self.trisize / 4., tri_height / 2.)
        new_pts = np.vstack((points1, points2))
        # Create a lineshape of the boundary of the circle
        c = self.waferShape.boundary
        # Create a set (unordered with unique entries)
        dicing_lines = set()
        # For each point in the lattice, create three lines (one along each direction)
        for x, y in new_pts:
            l0 = LineString([(-4. * wafer_rad, y), (4. * wafer_rad, y)])
            l1 = rotateshape(l0, 60, origin=(x, y))
            l2 = rotateshape(l0, -60, origin=(x, y))
            # See where these lines intersect the wafer outline
            i0 = c.intersection(l0)
            i1 = c.intersection(l1)
            i2 = c.intersection(l2)
            if not i0.geoms == []:
                p0s = tuple(map(tuple, np.round((i0.geoms[0].coords[0], i0.geoms[
                    1].coords[0]))))
                dicing_lines.add(p0s)  # Add these points to a unique unordered set
            if not i1.geoms == []:
                p1s = tuple(map(tuple, np.round((i1.geoms[0].coords[0], i1.geoms[
                    1].coords[0]))))
                dicing_lines.add(p1s)
            if not i2.geoms == []:
                p2s = tuple(map(tuple, np.round((i2.geoms[0].coords[0], i2.geoms[
                    1].coords[0]))))
                dicing_lines.add(p2s)

        hpoints1 = np.array(points) + (self.trisize / 8., tri_height / 4. + 300.)
        hpoints2 = np.array(points) + (-self.trisize / 8., -tri_height / 4. - 450.)
        hpoints = np.vstack((hpoints1, hpoints2))
        # Make horizontal lines to cleave each mini-triangle chip and make it fit in the 6x6mm chip holder in Basel
        for x, y in hpoints:
            l0 = LineString([(-4. * wafer_rad, y), (4. * wafer_rad, y)])
            # See where this line intersects the wafer outline
            i0 = c.intersection(l0)
            if not i0.geoms == []:
                p0s = tuple(map(tuple, np.round((i0.geoms[0].coords[0], i0.geoms[
                    1].coords[0]))))
                dicing_lines.add(p0s)  # Add these points to a unique unordered set

        # At the end of the loop, the set will contain a list of point pairs which can be used to make the dicing marks
        dmarks = Cell('DIC_MRKS')
        for l in layers:
            for p1, p2 in dicing_lines:
                # dicing_line = Path([p1, p2], width=mkWidth,layer=l)
                dicing_line = dashed_line(p1, p2, 500, mk_width, l)
                dmarks.add(dicing_line)
            self.add(dmarks)
def make_rotating_branches(length,
                           width,
                           N,
                           radius,
                           layers,
                           angle_sweep=360,
                           angle_ref=False,
                           angle_offset=0):
    cell = Cell('RotatingBranches')
    if not (type(layers) == list):
        layers = [layers]
    allslits = Cell('All Slits')
    angles = np.linspace(0, angle_sweep, N)
    translation = (radius, 0)
    pt1 = np.array((-length / 2., -width / 2.)) + translation
    pt2 = np.array((length / 2., width / 2.)) + translation

    branch = make_branch(length, width, layers)
    for element in branch.elements:
        element.origin = [radius, 0]
    for angle in angles:
        allslits.add(branch.copy(), rotation=angle_offset + angle)
    cell.add(allslits)

    for l in layers:
        if angle_ref:
            labelCell = Cell('AngleLabels')
            lineCell = Cell('Line')
            pt1 = (0, 0)
            pt2 = (radius * 0.9, 0)
            line = Path([pt1, pt2], width=width, layer=l)
            dLine = dashed_line(pt1, pt2, 2, width, l)
            lineCell.add(line)

            rot_angle = 0
            while True:
                if abs(rot_angle) > abs(angle_sweep):
                    break
                if abs(rot_angle) % 60 == 0:
                    labelCell.add(lineCell, rotation=rot_angle)
                if (abs(rot_angle) - 30) % 60 == 0:
                    labelCell.add(dLine, rotation=rot_angle)
                rot_angle += np.sign(angle_sweep) * 15
            cell.add(labelCell)
    return cell
def make_rotating_slits(length,
                        width,
                        N,
                        radius,
                        layers,
                        angle_sweep=360,
                        angle_ref=False):
    cell = Cell('RotatingSlits')
    if not (type(layers) == list): layers = [layers]
    allslits = Cell('All Slits')
    angles = np.linspace(0, angle_sweep, N)
    #        radius = length*12.
    translation = (radius, 0)
    pt1 = np.array((-length / 2., -width / 2.)) + translation
    pt2 = np.array((length / 2., width / 2.)) + translation
    slit = Cell("Slit")
    for l in layers:
        rect = Rectangle(pt1, pt2, layer=l)
        slit.add(rect)
        for angle in angles:
            allslits.add(slit.copy(), rotation=angle)
        cell.add(allslits)

    for l in layers:
        if angle_ref:
            label_cell = Cell('AngleLabels')
            line_cell = Cell('Line')
            pt1 = (0, 0)
            pt2 = (radius * 0.9, 0)
            line = Path([pt1, pt2], width=width, layer=l)
            d_line = dashed_line(pt1, pt2, 2, width, l)
            line_cell.add(line)

            rot_angle = 0
            while True:
                if abs(rot_angle) > abs(angle_sweep):
                    break
                if abs(rot_angle) % 60 == 0:
                    label_cell.add(line_cell, rotation=rot_angle)
                if (abs(rot_angle) - 30) % 60 == 0:
                    label_cell.add(d_line, rotation=rot_angle)
                rot_angle += np.sign(angle_sweep) * 15
            cell.add(label_cell)
    return cell