示例#1
0
 def curve(self, *points):
     """Add a Bezier curve from self.pos to points[-1]
     every other points are the control points of the Bezier curve (which
     will thus be of degree len(points) )
     """
     assert len(points) == 3
     points = [rotate(p, self.theta) for p in points]
     self.svg.append('C %s,%s %s,%s %s,%s' % tuple(itertools.chain(*points)))
     self.pos = points[-1]
示例#2
0
 def curve(self, *points):
     """Add a Bezier curve from self.pos to points[-1]
     every other points are the control points of the Bezier curve (which
     will thus be of degree len(points) )
     """
     assert len(points) == 3
     points = [rotate(p, self.theta) for p in points]
     self.svg.append('C %s,%s %s,%s %s,%s' % tuple(itertools.chain(*points)))
     self.pos = points[-1]
示例#3
0
 def arc(self, p, r, sweep):
     p = rotate(p, self.theta)
     self.svg.append('A %s,%s 0,0,%s %s,%s' % (r, r, str(sweep), p[0], p[1]))
     self.pos = p
示例#4
0
 def line(self, p):
     p = rotate(p, self.theta)
     self.svg.append('L %s,%s' % (p[0], p[1]))
     self.pos = p
示例#5
0
 def arc(self, p, r, sweep):
     p = rotate(p, self.theta)
     self.svg.append('A %s,%s 0,0,%s %s,%s' %
                     (r, r, str(sweep), p[0], p[1]))
     self.pos = p
示例#6
0
 def line(self, p):
     p = rotate(p, self.theta)
     self.svg.append('L %s,%s' % (p[0], p[1]))
     self.pos = p