示例#1
0
 def createnormpath(self, epsilon=_marker):
     if epsilon is _marker:
         return normpath([normsubpath([normline_pt(self.x_pt, self.y_pt, self.x_pt, self.y_pt)])])
     elif epsilon is None:
         return normpath([normsubpath([pdfmoveto_pt(self.x_pt, self.y_pt, self.x_pt, self.y_pt)],
                                      epsilon=epsilon)])
     else:
         return normpath([normsubpath([normline_pt(self.x_pt, self.y_pt, self.x_pt, self.y_pt)],
                                      epsilon=epsilon)])
示例#2
0
 def updatenormpath(self, normpath, context):
     if normpath.normsubpaths[-1].closed:
         normpath.append(normsubpath([normline_pt(context.x_pt, context.y_pt,
                                                      *_arcpoint(self.x_pt, self.y_pt, self.r_pt, self.angle1))],
                                     epsilon=normpath.normsubpaths[-1].epsilon))
     else:
         normpath.normsubpaths[-1].append(normline_pt(context.x_pt, context.y_pt,
                                                      *_arcpoint(self.x_pt, self.y_pt, self.r_pt, self.angle1)))
     normpath.normsubpaths[-1].extend(_arctobezierpath(self.x_pt, self.y_pt, self.r_pt, self.angle1, self.angle2))
     context.x_pt, context.y_pt = _arcpoint(self.x_pt, self.y_pt, self.r_pt, self.angle2)
示例#3
0
 def updatenormpath(self, normpath, context):
     if normpath.normsubpaths[-1].closed:
         normpath.append(normsubpath([normline_pt(context.x_pt, context.y_pt,
                                                      *_arcpoint(self.x_pt, self.y_pt, self.r_pt, self.angle1))],
                                     epsilon=normpath.normsubpaths[-1].epsilon))
     else:
         normpath.normsubpaths[-1].append(normline_pt(context.x_pt, context.y_pt,
                                                      *_arcpoint(self.x_pt, self.y_pt, self.r_pt, self.angle1)))
     bpathitems = _arctobezierpath(self.x_pt, self.y_pt, self.r_pt, self.angle2, self.angle1)
     bpathitems.reverse()
     for bpathitem in bpathitems:
         normpath.normsubpaths[-1].append(bpathitem.reversed())
     context.x_pt, context.y_pt = _arcpoint(self.x_pt, self.y_pt, self.r_pt, self.angle2)
示例#4
0
文件: path.py 项目: dcf21/pyxplot7
 def updatenormpath(self, normpath, context):
     x0_pt, y0_pt = context.x_pt, context.y_pt
     for point_pt in self.points_pt:
         normpath.normsubpaths[-1].append(
             normline_pt(x0_pt, y0_pt, *point_pt))
         x0_pt, y0_pt = point_pt
     context.x_pt, context.y_pt = x0_pt, y0_pt
示例#5
0
 def updatenormpath(self, normpath, context):
     if normpath.normsubpaths[-1].epsilon is not None:
         normpath.append(normsubpath([normline_pt(self.x_pt, self.y_pt, self.x_pt, self.y_pt)],
                                     epsilon=normpath.normsubpaths[-1].epsilon))
     else:
         normpath.append(normsubpath(epsilon=normpath.normsubpaths[-1].epsilon))
     context.x_pt = context.subfirstx_pt = self.x_pt
     context.y_pt = context.subfirsty_pt = self.y_pt
示例#6
0
 def updatenormpath(self, normpath, context):
     x0_pt, y0_pt = context.x_pt, context.y_pt
     for point_pt in self.points_pt:
         normpath.normsubpaths[-1].append(normline_pt(x0_pt, y0_pt, *point_pt))
         x0_pt, y0_pt = point_pt
     context.x_pt, context.y_pt = x0_pt, y0_pt
示例#7
0
 def updatenormpath(self, normpath, context):
     normpath.normsubpaths[-1].append(normline_pt(context.x_pt, context.y_pt,
                                                  context.x_pt + self.dx_pt, context.y_pt + self.dy_pt))
     context.x_pt += self.dx_pt
     context.y_pt += self.dy_pt