Ejemplo n.º 1
0
    def _build_points(self, dip):
        bx = dip.body_width() / 2
        by = dip.body_length() / 2

        points = []
        points.extend(projectPoints(dip.matrix, map(Point2, [(-bx, by), (-bx,-by),(bx,-by),(bx,by) ])))

        for i in range(28):
            theta = -math.pi * i / 27

            points.append(projectPoint(dip.matrix, Point2(math.cos(theta) * units.MM, math.sin(theta) * units.MM + by)))

        return list(zip(points, points[1:] + points[0:1]))
Ejemplo n.º 2
0
    def _build_points(self, dip):
        bx = dip.body_width() / 2
        by = dip.body_length() / 2

        points = []
        points.extend(
            projectPoints(
                dip.matrix,
                map(Point2, [(-bx, by), (-bx, -by), (bx, -by), (bx, by)])))

        for i in range(28):
            theta = -math.pi * i / 27

            points.append(
                projectPoint(
                    dip.matrix,
                    Point2(
                        math.cos(theta) * units.MM,
                        math.sin(theta) * units.MM + by)))

        return list(zip(points, points[1:] + points[0:1]))
Ejemplo n.º 3
0
    def _build_points(self, cmp):
        """
        :type cmp: pcbre.model.passivecomponent.PassiveComponent
        :param cmp: 
        :return:
        """
        circ_groups = []

        if cmp.body_type == PassiveBodyType.CHIP:
            bx = cmp.body_corner_vec.x
            by = cmp.body_corner_vec.y
            circ_groups.append(
                map(Point2, [(-bx, by), (-bx, -by), (bx, -by), (bx, by)]))

        elif cmp.body_type == PassiveBodyType.TH_AXIAL:
            bx = cmp.body_corner_vec.x
            by = cmp.body_corner_vec.y
            circ_groups.append(
                map(Point2, [(-bx, by), (-bx, -by), (bx, -by), (bx, by)]))

            d = cmp.pin_d - cmp.pin_corner_vec.x
            print(bx, d)
            circ_groups.append([Point2(bx, 0), Point2(d, 0)])
            circ_groups.append([Point2(-bx, 0), Point2(-d, 0)])

        elif cmp.body_type == PassiveBodyType.TH_RADIAL:
            g = []
            m = cmp.body_corner_vec.mag()
            for i in range(32):
                p = Point2.fromPolar(i / 16 * math.pi, m)
                g.append(p)
            circ_groups.append(g)

        ll = []
        for group in circ_groups:
            newpoints = projectPoints(cmp.matrix, group)
            ll += list(zip(newpoints, newpoints[1:] + newpoints[0:1]))
        return ll
Ejemplo n.º 4
0
    def _build_points(self, cmp):
        """
        :type cmp: pcbre.model.passivecomponent.PassiveComponent
        :param cmp: 
        :return:
        """
        circ_groups = []

        if cmp.body_type == PassiveBodyType.CHIP:
            bx = cmp.body_corner_vec.x
            by = cmp.body_corner_vec.y
            circ_groups.append(map(Point2, [(-bx, by), (-bx,-by),(bx,-by),(bx,by) ]))

        elif cmp.body_type == PassiveBodyType.TH_AXIAL:
            bx = cmp.body_corner_vec.x
            by = cmp.body_corner_vec.y
            circ_groups.append(map(Point2, [(-bx, by), (-bx,-by),(bx,-by),(bx,by)]))

            d = cmp.pin_d - cmp.pin_corner_vec.x
            print(bx, d)
            circ_groups.append([Point2(bx, 0), Point2(d, 0)])
            circ_groups.append([Point2(-bx, 0), Point2(-d, 0)])

        elif cmp.body_type == PassiveBodyType.TH_RADIAL:
            g = []
            m = cmp.body_corner_vec.mag()
            for i in range(32):
                p = Point2.fromPolar(i/16*math.pi, m)
                g.append(p)
            circ_groups.append(g)


        ll = []
        for group in circ_groups:
            newpoints = projectPoints(cmp.matrix, group)
            ll += list(zip(newpoints, newpoints[1:] + newpoints[0:1]))
        return ll