Ejemplo n.º 1
0
 def _draw_points(self, outline=False):
     ht = self.thickness / 2.0  # half of the asterisk's thickness
     hs = self.size / 2.0  # half of the asterisk's size
     pts = []
     for s in range(0, self.spokes):
         spoke = [-ht, -ht, -ht, -hs, ht, -hs, ht, -ht]
         pts += rotate_points(spoke, (0, 0),
                              s * (360.0 / self.spokes),
                              flat=True)
     if self.rotation != 0:
         pts = rotate_points(pts, (0, 0), self.rotation, flat=True)
     return pts
Ejemplo n.º 2
0
 def _draw_points(self, outline=False):
     ht = self.thickness / 2.0  # half of the asterisk's thickness
     hss = self.size / 2.0  # half of the asterisk's straight (vertical/horizontal) size
     hds = sqrt(2 * (hss**2))  # half of the asterisk's diagonal size
     spokes = 8
     pts = []
     for s in range(0, spokes):
         if s % 2 == 0:  # alternate between short/flat and long/pointed spokes
             spoke = [-ht, ht, -ht, hss, ht, hss, ht, ht]
         else:
             spoke = [-ht, ht, -ht, hds - ht, 0, hds, ht, hds - ht, ht, ht]
         pts += rotate_points(spoke, (0, 0),
                              s * (-360.0 / spokes),
                              flat=True)
     if self.rotation != 0:
         pts = rotate_points(pts, (0, 0), self.rotation, flat=True)
     return pts
Ejemplo n.º 3
0
 def _draw_points(self, outline=False):
     so = self.stroke_offset + self.stroke_width / 2.0 if outline else self.stroke_offset
     half_y = self.height / 2.0 + so
     half_x = (half_y * 2) / (self.height / (self.base / 2.0)
                              )  # to preserve angles when adding stroke
     pts = [-half_x, half_y, 0, -half_y, half_x, half_y]
     if self.rotation != 0:
         pts = rotate_points(pts, (0, 0), self.rotation, flat=True)
     return pts
Ejemplo n.º 4
0
 def _draw_points(self, outline=False):
     so = self.stroke_offset + self.stroke_width / 2.0 if outline else self.stroke_offset
     x1 = -(self.object_width / 2.0 + so)
     y1 = -(self.object_height / 2.0 + so)
     x2 = (self.object_width / 2.0 + so)
     y2 = (self.object_height / 2.0 + so)
     pts = [x1, y1, x2, y1, x2, y2, x1, y2]
     if self.rotation != 0:
         pts = rotate_points(pts, (0, 0), self.rotation, flat=True)
     return pts
Ejemplo n.º 5
0
 def _draw_points(self, outline=False):
     sw = self.stroke_width
     so = self.stroke_offset + sw / 2.0 if outline else self.stroke_offset
     ht = self.thickness / 2.0 + so  # half of the cross' thickness
     hs = self.object_width / 2.0 + so  # half of the cross' size
     pts = []
     pts += [-hs, ht, -ht, ht, -ht, hs]  # upper-left corner
     pts += [ht, hs, ht, ht, hs, ht]  # upper-right corner
     pts += [hs, -ht, ht, -ht, ht, -hs]  # lower-right corner
     pts += [-ht, -hs, -ht, -ht, -hs, -ht]  # lower-left corner
     if self.rotation != 0:
         pts = rotate_points(pts, (0, 0), self.rotation, flat=True)
     return pts
Ejemplo n.º 6
0
 def _draw_points(self, outline=False):
     so = self.stroke_offset + self.stroke_width / 2.0 if outline else self.stroke_offset
     xo = -(self.tail_w +
            self.head_w) / 2.0 - so  # starting x value (x origin)
     half_hh = (self.head_w + 2 * so) / (self.head_w / (self.head_h / 2.0)
                                         )  # half head height
     pts = []
     # draw the tail
     pts += [xo + self.tail_w, self.tail_h / 2.0 + so]
     pts += [xo, self.tail_h / 2.0 + so]
     pts += [xo, -self.tail_h / 2.0 - so]
     pts += [xo + self.tail_w, -self.tail_h / 2.0 - so]
     # draw the head
     pts += [xo + self.tail_w, -half_hh]
     pts += [xo + self.tail_w + self.head_w + so * 2, 0]
     pts += [xo + self.tail_w, half_hh]
     if self.rotation != 0:
         pts = rotate_points(pts, (0, 0), self.rotation, flat=True)
     return pts