From 914d6bb7cb8a75f32eb3e38875ca5e19171425f1 Mon Sep 17 00:00:00 2001 From: Djalim Simaila Date: Fri, 12 May 2023 09:13:21 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=93=9D=20docs(README.md):=20capitalize=20?= =?UTF-8?q?the=20first=20letter=20of=20the=20title=20The=20first=20letter?= =?UTF-8?q?=20of=20the=20title=20"Analyse=20morphologique"=20was=20not=20c?= =?UTF-8?q?apitalized,=20which=20is=20inconsistent=20with=20the=20usual=20?= =?UTF-8?q?capitalization=20rules=20for=20titles.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 🖼️ chore(README.md): update image and fix typo in rotation instructions The image in the README.md file was updated to reflect the correct rotation instructions. A typo in the rotation instructions was also fixed. 👥 chore(README.md): fix typo in contributor's role A typo in the role of one of the contributors was fixed. 🐛 fix(data_processing.py): add missing half discretisation values to L calculation The calculation of L in the get_advanced_data function of data_processing.py was missing half the discretisation values at the beginning and end of the object. 🐛 fix(input.py): remove print statement A print statement was accidentally left in the from_xyz_file method of the ScannedObject class in input --- README.md | 8 ++++---- utils/data_processing/data_processing.py | 7 +++++-- utils/files/input.py | 9 ++++----- utils/gui/pyqt/main_window/MainWindow.py | 1 - utils/math/data_extraction.py | 2 +- 5 files changed, 14 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index 6d8a5df..9010cfd 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Analyse Morphologique -L'analyse morphologique est un outil développé par le laboratoire de géomécanique du centre PACA d'INRAE. Son objectif est d'extraire des informations sur la morphologie de scans 3D provenant de tests HET (Hydraulic Erosion Test). +"Analyse morphologique" est un outil développé par le laboratoire de géomécanique du centre PACA d'INRAE. Son objectif est d'extraire des informations sur la morphologie de scans 3D provenant de tests HET (Hydraulic Erosion Test). ## Fonctionnalités @@ -86,7 +86,7 @@ Graphiques 3D : - Pour effectuer une rotation, maintenez le clic gauche et déplacez la souris : - pour une rotation autour de l'axe x, déplacez la souris vers le haut ou le bas dans la zone indiquée en bleu. - pour une rotation autour de l'axe y, déplacez la souris dans une trajectoire de cercle suivant la zone indiquée en vert. - - pour une rotation autour de l'axe z, déplacez la souris dans une trajectoire de cercle suivant la zone indiquée en rouge. + - pour une rotation autour de l'axe z, déplacez la souris vers la gauche ou la droite dans la zone indiquée en rouge. ![images/4.png](images/4.png) @@ -130,12 +130,12 @@ flowchart TD - Implementation de la specification du projet. - Alexis DOGHMANE : [mail](mailto:alexis.doghmane@inrae.fr) - - Redacteurs des specifications du projet. + - Redacteur des specifications du projet. Avec du code de : - Jerome Duriez : [mail](mailto:jerome.duriez@inrae.fr) - - Redressement de l'objet 3D en passant par un alignemennt des axes de l'espace avec les axes d'inertie de l'objet 3D. + - Redressement de l'objet 3D en passant par un alignement des axes de l'espace avec les axes d'inertie de l'objet 3D. - Rick van Hattem : [mail](mailto:Wolph@Wol.ph) - Code permettant de calculer le centre de gravité d'un objet, la matrice d'inertie et le volume d'un objet 3D. [source](https://pypi.org/project/numpy-stl/) \ No newline at end of file diff --git a/utils/data_processing/data_processing.py b/utils/data_processing/data_processing.py index 04ef41b..b4421bc 100644 --- a/utils/data_processing/data_processing.py +++ b/utils/data_processing/data_processing.py @@ -78,7 +78,7 @@ def get_discrete_data(obj:ScannedObject, ndigits:int, delta_z:float=1, update_pr - Rayon moyen (en mm) : list of mean radius values - Rayon ecart type (en mm) : list of radius standard deviation values """ - + # Create the data dict colones = ["X moy (en mm)", "Y moy (en mm)", @@ -138,7 +138,7 @@ def get_advanced_data(discrete_data:dict, V_scan = 0, update_progress_bar= progr discrete_data["Z moy (en mm)"])) for index in range(len(vertices)-1): l += de.get_distance_between_two_vertices(vertices[index], vertices[index+1]) - L = de.get_distance_between_two_vertices(vertices[0], vertices[-1]) + L = de.get_distance_between_two_vertices(vertices[0], vertices[-1]) + discrete_data["Discretisation(en mm)"][-1] /2 + discrete_data["Discretisation(en mm)"][0] /2 T = l/L update_progress_bar(10) @@ -174,6 +174,9 @@ def get_advanced_data(discrete_data:dict, V_scan = 0, update_progress_bar= progr "Moyenne des rayons moyens 〈R〉":R_mean, "Ecart-type des rayons moyens σ_〈R〉":R_mean_std, "σ_〈R〉^tot":sigma_r_tot, + "H": H, + "L": L, + "l":l, "MI_l":MI_l, "MI_p":MI_p, "MI_mR":MI_mR, diff --git a/utils/files/input.py b/utils/files/input.py index 274ce2d..4cca4ca 100644 --- a/utils/files/input.py +++ b/utils/files/input.py @@ -130,7 +130,7 @@ class ScannedObject: z[count] -= zmin return ScannedObject(list(zip(x,y,z)), triangles, ) - + @staticmethod def from_xyz_file(file_path:str, delimiter:str = ' ', ratio:float=1, normalised:str = '')->'ScannedObject': """ @@ -145,7 +145,6 @@ class ScannedObject: with open(file_path, 'r',encoding='utf-8') as f: data = f.readlines() for line in data: - print(line) x.append(float(line.split(delimiter)[0])* ratio) y.append(float(line.split(delimiter)[1])* ratio) z.append(float(line.split(delimiter)[2])* ratio) @@ -234,7 +233,7 @@ class ScannedObject: splitted_data[-1].append(line) self.old_discrete = splitted_data return splitted_data - + def get_discrete_vertices_2(self, step:float = 1)->list: """ Discretize the vertices of the object using a length method. @@ -262,7 +261,7 @@ class ScannedObject: splitted_data.append([]) self.old_discrete = splitted_data return splitted_data - + def has_faces(self)->bool: """ Check if the object has faces. @@ -315,7 +314,7 @@ class ScannedObject: self.y = self.vertices[:,1] self.z = self.vertices[:,2] self.normalise() - + def normalise(self, axis:str = 'z'): """ Normalise the object. diff --git a/utils/gui/pyqt/main_window/MainWindow.py b/utils/gui/pyqt/main_window/MainWindow.py index e8c8cf5..f70e615 100644 --- a/utils/gui/pyqt/main_window/MainWindow.py +++ b/utils/gui/pyqt/main_window/MainWindow.py @@ -175,7 +175,6 @@ class MainWindow(QtWidgets.QMainWindow, Ui_MainWindow): button_callback=self.select_file).show_popup() return False if os.path.splitext(self.input_file_path.toPlainText())[1].lower() == ".xyz": - print("test") ErrorPopup("Attention!, Ce programme ne peut pas redresser les fichiers .xyz, assurez vous que l'objet est deja droit. Il sera aussi impossible d'utiliser le graphe 'Mesh3D'").show_popup() return True diff --git a/utils/math/data_extraction.py b/utils/math/data_extraction.py index 4e02445..51c9275 100644 --- a/utils/math/data_extraction.py +++ b/utils/math/data_extraction.py @@ -132,7 +132,7 @@ def get_theta_from_x_y(xi:float, yi:float, x_mean:float, y_mean:float): >>> get_theta_from_x_y(1,2,3,4) 0.7853981633974483 """ - return math.atan((yi - y_mean)/(xi-x_mean)) + return math.atan((xi-x_mean)/(yi-y_mean)) def get_true_theta_from_x_y(xi:float, yi:float, x_mean:float, y_mean:float): """