Ejemplo n.º 1
0
 def arcTo(self, x1, y1, x2, y2, startAng=0, extent=90):
     """Like arc, but draws a line from the current point to
     the start if the start is not the current point."""
     pointList = pdfgeom.bezierArc(x1, y1, x2, y2, startAng, extent)
     self._code.append("%s l" % fp_str(pointList[0][:2]))
     for curve in pointList:
         self._code.append("%s c" % fp_str(curve[2:]))
Ejemplo n.º 2
0
    def arc(self, x1,y1, x2,y2, startAng=0, extent=90):
        """Contributed to piddlePDF by Robert Kern, 28/7/99.
        Draw a partial ellipse inscribed within the rectangle x1,y1,x2,y2,
        starting at startAng degrees and covering extent degrees.   Angles
        start with 0 to the right (+x) and increase counter-clockwise.
        These should have x1<x2 and y1<y2.

        The algorithm is an elliptical generalization of the formulae in
        Jim Fitzsimmon's TeX tutorial <URL: http://www.tinaja.com/bezarc1.pdf>."""

        self._curves(pdfgeom.bezierArc(x1,y1, x2,y2, startAng, extent))
Ejemplo n.º 3
0
 def ellipse(self, x, y, width, height):
     """adds an ellipse to the path"""
     self._curves(pdfgeom.bezierArc(x, y, x + width,y + height, 0, 360))
Ejemplo n.º 4
0
 def arcTo(self, x1,y1, x2,y2, startAng=0, extent=90):
     """Like arc, but draws a line from the current point to
     the start if the start is not the current point."""
     self._curves(pdfgeom.bezierArc(x1,y1, x2,y2, startAng, extent),'lineTo')
Ejemplo n.º 5
0
 def ellipse(self, x, y, width, height):
     """adds an ellipse to the path"""
     pointList = pdfgeom.bezierArc(x, y, x + width, y + height, 0, 360)
     self._code.append("%s m" % fp_str(pointList[0][:2]))
     for curve in pointList:
         self._code.append("%s c" % fp_str(curve[2:]))