예제 #1
0
def AddEllipticalArc(self,
                     x,
                     y,
                     width,
                     height,
                     theta,
                     dtheta,
                     clockwise=False):
    """ Draws an arc of an ellipse within bounding rect (x,y,w,h) from
    startArc to endArc (in degrees, relative to the horizontal line of
    the eclipse)

    """
    import wx

    # compute the cubic bezier and add that to the path by calling
    # AddCurveToPoint
    sub_paths = svg_extras.bezier_arc(x, y, x + width, y + height, theta,
                                      dtheta)
    for sub_path in sub_paths:
        x1, y1, cx1, cy1, cx2, cy2, x2, y2 = sub_path

        path = wx.GraphicsRenderer_GetDefaultRenderer().CreatePath()
        path.MoveToPoint(x1, y1)
        path.AddCurveToPoint(cx1, cy1, cx2, cy2, x2, y2)

        self.AddPath(path)
        self.MoveToPoint(path.GetCurrentPoint())
        self.CloseSubpath()
예제 #2
0
 def AddEllipse(self, cx, cy, rx, ry):
     for i, (x1, y1, x2, y2, x3, y3, x4, y4) in enumerate(
         svg_extras.bezier_arc(cx - rx, cy - ry, cx + rx, cy + ry, 0, 360)
     ):
         if i == 0:
             self.move_to(x1, y1)
         self.curve_to(x2, y2, x3, y3, x4, y4)
 def AddEllipse(self, cx, cy, rx, ry):
     for i, (x1, y1, x2, y2, x3, y3, x4, y4) in enumerate(
             svg_extras.bezier_arc(cx - rx, cy - ry, cx + rx, cy + ry, 0,
                                   360)):
         if i == 0:
             self.move_to(x1, y1)
         self.curve_to(x2, y2, x3, y3, x4, y4)
예제 #4
0
파일: __init__.py 프로젝트: GaZ3ll3/enable
def AddEllipticalArc(self, x, y, width, height, theta, dtheta, clockwise=False):
    """ Draws an arc of an ellipse within bounding rect (x,y,w,h)
    from startArc to endArc (in degrees, relative to the horizontal line of the eclipse)"""

    # compute the cubic bezier and add that to the path by calling AddCurveToPoint
    sub_paths = svg_extras.bezier_arc(x, y, x+width, y+height, theta, dtheta)
    for sub_path in sub_paths:
        x1,y1, cx1, cy1, cx2, cy2, x2,y2 = sub_path

        path = wx.GraphicsRenderer_GetDefaultRenderer().CreatePath()
        path.MoveToPoint(x1, y1)
        path.AddCurveToPoint(cx1, cy1, cx2, cy2, x2, y2)

        self.AddPath(path)
        self.MoveToPoint(path.GetCurrentPoint())
        self.CloseSubpath()
예제 #5
0
 def AddEllipticalArcTo(self, x, y, w, h, theta0, dtheta, phi=0):
     for i, (x1, y1, x2, y2, x3, y3, x4, y4) in enumerate(svg_extras.bezier_arc(x, y, x + w, y + h, theta0, dtheta)):
         self.curve_to(x2, y2, x3, y3, x4, y4)
예제 #6
0
파일: renderer.py 프로젝트: alexlib/enable
 def AddEllipticalArcTo(self, x, y, w, h, theta0, dtheta, phi=0):
     arc = svg_extras.bezier_arc(x, y, x + w, y + h, theta0, dtheta)
     for i, (x1, y1, x2, y2, x3, y3, x4, y4) in enumerate(arc):
         self.curve_to(x2, y2, x3, y3, x4, y4)