From 4e90f531cf20ed5e76f6737e5123d2ff4d1167e6 Mon Sep 17 00:00:00 2001 From: NathalieGore Date: Fri, 27 Sep 2024 13:38:20 +0200 Subject: [PATCH] Problem Fatal Exception Case --- src/RepairGUIAdv/reparation_plugin_algo.py | 29 ++++++++++++++++------ 1 file changed, 22 insertions(+), 7 deletions(-) diff --git a/src/RepairGUIAdv/reparation_plugin_algo.py b/src/RepairGUIAdv/reparation_plugin_algo.py index 6f57118d7..f5e3c46ad 100644 --- a/src/RepairGUIAdv/reparation_plugin_algo.py +++ b/src/RepairGUIAdv/reparation_plugin_algo.py @@ -32,10 +32,13 @@ from salome.geom import geomBuilder from qtsalome import QFileDialog, QApplication, pyqtSignal import GEOM +import SMESH, SALOMEDS +from salome.smesh import smeshBuilder +smesh = smeshBuilder.New() + salome.salome_init() geompy = geomBuilder.New() - def run(args_dict, progress_emitter): """ Helper function to call run() with arguments parsed from dictionary. @@ -75,14 +78,26 @@ def run(args_dict, progress_emitter): logging.info('\Debug: %s', Debug) progress_emitter.emit() - - for i in range(5000): - vertex = geompy.MakeVertex(0,0,0) - logging.info('\I: %s', i) + nbTry = 500 + ratioMin = 0.09 + ratioMax = 0.11 + for i in range(nbTry): + face = geompy.ImportBREP("FatalException.brep") + aire = geompy.BasicProperties(face)[1] + Mesh = smesh.Mesh(face,'Mesh') + MG_CADSurf = Mesh.Triangle(algo=smeshBuilder.MG_CADSurf) + MG_CADSurf_Parameters = MG_CADSurf.Parameters() + MG_CADSurf_Parameters.SetMaxSize( ratioMax * aire ) + MG_CADSurf_Parameters.SetMinSize( ratioMin * aire ) + MG_CADSurf_Parameters.SetPhySize( aire * ((ratioMin+2*ratioMax)/3) ) + MG_CADSurf_Parameters.SetGradation( 1.1 ) + isDone = Mesh.Compute() if not progress_emitter.emit(): - return False + return False + + progress_emitter.emit() - return vertex + return face def test(): -- 2.39.2