Ejemplo n.º 1
0
    def __init__(self, style=None, x=0, y=0, r1=80, r2=None):
        if r2 == None:
            r2 = r1
        super(Ellipse, self).__init__(style, Point(x, y))

        pathitems = []
        p1 = Point(x - r1, y)
        p2 = Point(x, y - r2)
        p3 = Point(x + r1, y)
        p4 = Point(x, y + r2)
        self.path = metapost.path.path(
            [
                smoothknot(*p1.toTuple()),
                tensioncurve(),
                smoothknot(*p2.toTuple()),
                tensioncurve(),
                smoothknot(*p3.toTuple()),
                tensioncurve(),
                smoothknot(*p4.toTuple()),
                tensioncurve(),
            ]
        )

        self.addJointPoint(Point(x - r1, y))
        self.addJointPoint(Point(x, y - r2))
        self.addJointPoint(Point(x + r1, y))
        self.addJointPoint(Point(x, y + r2))