def new_cloud(self, path=None) -> None: """ Charge le nouveau nuage Args: path (pathlib, optional): Chemin vers le fichier nuage. Defaults to None. """ global width_text, heigh_text, point_text if path is not None: liste_data, self.path, filename = data.data( path=path) # Recuperation des informations self.num_cloud += 1 else: liste_data, self.path, filename = data.data( self.num_cloud) # Recuperation des informations self.file_label["text"] = "fichier: " + filename self.cloud = liste_data[0] self.can_dim = liste_data[1] # Nouvelles dimensions du Canvas self.can.config(width=self.can_dim[0], heigh=self.can_dim[1]) width_text.set(int(self.can_dim[0])) heigh_text.set(int(self.can_dim[1])) point_text.set(len(liste_data[0])) self.update_win()
""" Recherche des points de l enveloppe convexe Args: cloud (list): Liste des points du nuage """ self.envelope = list() self.itteration = int() self.cloud = cloud self.list_points = self.cloud.copy() self.find_origin() self.find_next_point(self.origin, [self.origin[0] + mt.inf, self.origin[1]]) return self.envelope if __name__ == "__main__": from pathlib import Path # Appel systeme des paths import sys # Gestion de l interpreteur # Recuperation du chemin du programme DIRECTORY = Path(__file__).parents[1] # Ajout du chemin dans la liste des imports de l interpreteur sys.path.append(str(DIRECTORY)) import Script.data as data cloud, path, a = data.data() J = Jarvis() J.convex_hull(cloud[0])
self.can.delete("envelope_anim_convexe", "point_anim_right", "envelope_anim_anim_right") self.can.create_oval(point_c[0] - 5, point_c[1] - 5, point_c[0] + 5, point_c[1] + 5, fill=COLOR_QUICHKULL, tag="point_convexe") self.can.create_polygon(self.envelope_anim, fill="", outline=COLOR_QUICHKULL, tag=("envelope_anim_convexe")) # On recommence les recherches list_point_left, list_point_right = self.point_set( list_point, point_a, point_c) self.can.after(1000, self.find_next_point_animation, list_point_right, point_a, point_c) list_point_left, list_point_right = self.point_set( list_point, point_c, point_b) self.can.after(1000, self.find_next_point_animation, list_point_right, point_c, point_b) if __name__ == "__main__": import Script.data as data data, path, a = data.data() Win = QuickhullAnimation() Win.win_creat(data[0]) print("FIN")