コード例 #1
0
    def init_primitives(self):
        origin = DPoint(0, 0)

        # square box that clears out the area of the mark
        self.primitives["empty_box"] = Rectangle(DPoint(
            -self.leaf_outer, -self.leaf_outer),
                                                 2 * self.leaf_outer,
                                                 2 * self.leaf_outer,
                                                 inverse=True)

        self.primitives["cross"] = Cross(
            DPoint(-self.cross_out_a / 2, -self.cross_out_a / 2),
            self.cross_in_a, self.cross_out_a)

        Z = CPWParameters(self.leaf_outer - self.leaf_inner, 0)

        for i in range(self.leafs_N):
            start_angle = i * (self.leaf_angle +
                               self.empty_leaf_angle) - self.leaf_angle / 2
            trans = DCplxTrans(1, start_angle + 90, False, 0, -self.avg_r)
            self.primitives["leaf_" + str(i)] = CPW_arc(Z,
                                                        origin,
                                                        self.avg_r,
                                                        self.leaf_angle * pi /
                                                        180,
                                                        trans_in=trans)

        Z_empty = CPWParameters(0, self.empty_rings_width / 2)
        for i in range(1, self.empty_rings_N + 1):
            r = self.leaf_inner + (self.leaf_outer - self.leaf_inner) / (
                self.empty_rings_N + 1) * i
            self.primitives["empty_ring_" + str(i)] = CPW_arc(
                Z_empty, DVector(0, -r), r, 2 * pi)
コード例 #2
0
    def init_primitives(self):
        self.arc1 = CPW_arc(self.Z0, DPoint(0, 0), -self.r, pi / 2)
        self.primitives["arc1"] = self.arc1

        # making coil
        name = "coil0"
        setattr(self, name, Coil_type_1(self.Z0, DPoint(0, 0), self.L_coupling, self.r, self.L1))
        self.primitives[name] = getattr(self, name)
        # coils filling
        for i in range(self.N):
            name = "coil" + str(i + 1)
            prev_coil_end = getattr(self, "coil" + str(i)).connections[-1]
            setattr(
                self, name,
                Coil_type_1( self.Z0, prev_coil_end, self.L1, self.r, self.L1)
            )
            self.primitives[name] = getattr(self, name)

        # draw the "tail"
        self.arc_tail = CPW_arc(self.Z0, self.primitives["coil" + str(self.N)].end, -self.L1 / 2, -pi / 2)
        self.cop_tail = CPW(self.Z0.width, self.Z0.gap, self.arc_tail.end, self.arc_tail.end - DPoint(0, self.L2))

        # tail face is separated from ground by `b = width + 2*gap`
        self.cop_open_end = CPW(0, self.Z0.b / 2, self.cop_tail.end, self.cop_tail.end - DPoint(0, self.Z0.b))
        self.primitives["arc_tail"] = self.arc_tail
        self.primitives["cop_tail"] = self.cop_tail
        self.primitives["cop_open_end"] = self.cop_open_end

        self.connections = [DPoint(0, 0), self.cop_tail.end]
        self.angle_connections = [0, self.cop_tail.alpha_end]
コード例 #3
0
    def init_primitives(self):
        name = "coil0"
        setattr(
            self, name,
            Coil_type_1(self.Z0, DPoint(0, 0), self.L_coupling, self.r,
                        self.L1))
        self.primitives[name] = getattr(self, name)
        # coils filling
        for i in range(self.N):
            name = "coil" + str(i + 1)
            setattr(
                self, name,
                Coil_type_1(
                    self.Z0,
                    DPoint(-self.L1 + self.L_coupling,
                           -(i + 1) * (4 * self.r)), self.L1, self.r, self.L1))
            self.primitives[name] = getattr(self, name)

        # draw the "tail"
        self.arc_tail = CPW_arc(self.Z0,
                                self.primitives["coil" + str(self.N)].end,
                                -self.L1 / 2, -pi / 2)
        self.cop_tail = CPW(self.Z0.width, self.Z0.gap, self.arc_tail.end,
                            self.arc_tail.end - DPoint(0, self.L2))
        self.cop_open_end = CPW(0, self.Z0.b / 2, self.cop_tail.end,
                                self.cop_tail.end - DPoint(0, self.Z0.b))
        self.primitives["arc_tail"] = self.arc_tail
        self.primitives["cop_tail"] = self.cop_tail
        self.primitives["cop_open_end"] = self.cop_open_end

        self.connections = [DPoint(0, 0), self.cop_tail.end]
        self.angle_connections = [0, self.cop_tail.alpha_end]
コード例 #4
0
    def init_primitives(self):
        self.arc1 = CPW_arc(self.Z0, DPoint(0, 0), -self.r, pi / 2)
        self.primitives["arc1"] = self.arc1

        p1 = self.arc1.end
        p2 = self.arc1.end + DPoint(0, -self.L0)
        self.cop_end_open = CPW(start=p1, end=p2, cpw_params=self.Z0)
        # open end tail face is separated from ground by `b = width + 2*gap`
        self.cop_end_open_gap = CPW(
            0, self.Z0.b / 2, self.cop_end_open.end,
            self.cop_end_open.end - DPoint(0, self.Z0.b))
        self.primitives["cpw_hor_end_open"] = self.cop_end_open
        self.primitives["cop_end_open_gap"] = self.cop_end_open_gap

        # making coil
        name = "coil0"
        setattr(
            self, name,
            Coil_type_1(self.Z0, DPoint(0, 0), self.L_coupling, self.r,
                        self.L1))
        self.primitives[name] = getattr(self, name)
        # coils filling
        for i in range(self.N):
            name = "coil" + str(i + 1)
            setattr(
                self, name,
                Coil_type_1(
                    self.Z0,
                    DPoint(-self.L1 + self.L_coupling,
                           -(i + 1) * (4 * self.r)), self.L1, self.r, self.L1))
            self.primitives[name] = getattr(self, name)

        # draw the shorted "tail"
        self.arc_end_shorted = CPW_arc(
            self.Z0, self.primitives["coil" + str(self.N)].end, -self.L1 / 2,
            -pi / 2)
        self.cop_end_shoted = CPW(
            self.Z0.width, self.Z0.gap, self.arc_end_shorted.end,
            self.arc_end_shorted.end - DPoint(0, self.L2))
        self.primitives["arc_end_shorted"] = self.arc_end_shorted
        self.primitives["cop_end_shoted"] = self.cop_end_shoted

        self.connections = [DPoint(0, 0), self.cop_end_open.end]
        self.angle_connections = [0, self.cop_end_open.alpha_end]
コード例 #5
0
ファイル: Design1.py プロジェクト: vdrhtc/KLayout-python
    def init_primitives(self):
        self.arc1 = CPW_arc(self.Z0, DPoint(0, 0), -self.r, pi / 2)
        self.primitives["arc1"] = self.arc1

        p1 = self.arc1.end
        p2 = self.arc1.end + DPoint(0, -self.L0)
        self.cop_vertical = CPW(start=p1, end=p2, cpw_params=self.Z0)
        # open end tail face is separated from ground by `b = width + 2*gap`

        self.primitives["cop_vertical"] = self.cop_vertical

        # draw the open-circuited "tail"

        self.cpw_end_open_RLPath = CPW_RL_Path(
            self.cop_vertical.end, self.tail_shape, cpw_parameters=self.Z0,
            turn_radiuses=self.tail_turn_radiuses,
            segment_lengths=self.tail_segment_lengths,
            turn_angles=self.tail_turn_angles,
            trans_in=self.tail_trans_in
        )
        self.primitives["cpw_end_open_RLPath"] = self.cpw_end_open_RLPath

        self.cpw_end_open_gap = CPW(
            0, self.Z0.b / 2,
            self.cpw_end_open_RLPath.end,
               self.cpw_end_open_RLPath.end - DPoint(0, self.Z0.b)
        )
        self.primitives["cpw_end_open_gap"] = self.cpw_end_open_gap

        # making coil
        name = "coil0"
        setattr(self, name, Coil_type_1(self.Z0, DPoint(0, 0), self.L_coupling, self.r, self.L1))
        self.primitives[name] = getattr(self, name)
        # coils filling
        for i in range(self.N):
            name = "coil" + str(i + 1)
            setattr(self, name,
                    Coil_type_1(self.Z0, DPoint(-self.L1 + self.L_coupling, -(i + 1) * (4 * self.r)), self.L1, self.r,
                                self.L1))
            self.primitives[name] = getattr(self, name)

        self.connections = [DPoint(0, 0), self.cpw_end_open_RLPath.end]
        self.angle_connections = [0, self.cpw_end_open_RLPath.alpha_end]