Пример #1
0
 def draw_network(self):
     for n in self.nodes:
         if n.parent is not None:
             dye.draw_line(n.parent.pos, n.pos, color=self.line_color, thickness=self.line_thickness)
     if self.draw_nodes:
         for n in self.nodes:
             dye.Oval(center=n.pos, radius=self.node_marker_radius).stroke(color=self.node_color)
Пример #2
0
 def test_draw_line(self):
     with dye.Image(200, 200) as img:
         dye.draw_line((0, 0), (200, 200), color=RED, thickness=5)
         dye.draw_line((0, 200), (200, 0), color=BLUE)
     self.save(img, 'Thick-Red thin-blue full-sized cross')