From: NathalieGore Date: Fri, 27 Sep 2024 11:38:20 +0000 (+0200) Subject: Problem Fatal Exception Case X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=refs%2Ftlpr%2F14%2Fhead;p=modules%2Fgeom.git Problem Fatal Exception Case --- 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():