Ejemplo n.º 1
0
    def update_view(self):
        self.canv.delete("all")
        if len(self.vertexes) == 0:
            return
        for p in self.vertexes:
            self.canv.create_oval(p.x - self.diam / 2, p.y - self.diam / 2, p.x + self.diam / 2,
                                  p.y + self.diam / 2, fill=self.point_color,
                                  width=2, outline=self.outline_color)

        draw_polygon(self.vertexes, self.canv)
Ejemplo n.º 2
0
    def update_view(self):
        self.canv.delete("all")
        if len(self.vertexes) == 0:
            return
        for p in self.vertexes:
            self.canv.create_oval(p.x - self.diam / 2,
                                  p.y - self.diam / 2,
                                  p.x + self.diam / 2,
                                  p.y + self.diam / 2,
                                  fill=self.point_color,
                                  width=2,
                                  outline=self.outline_color)

        l = left_most(self.vertexes)
        r = Point(l.x, l.y - 0.001)
        self.hull = quick_hull(l, r, self.vertexes, [])
        draw_polygon(self.hull, self.canv)
Ejemplo n.º 3
0
 def on_touch_right(self, event):
     self.update_view()
     self.hull = simple_polygon_hull(self.vertexes, self.canv)
     draw_polygon(self.hull, self.canv, width=3)