]> SALOME platform Git repositories - modules/geom.git/commitdiff
Salome HOME
Problem Fatal Exception Case kleontev/38044_auto_repair 14/head
authorNathalieGore <nathalie.gore@opencascade.com>
Fri, 27 Sep 2024 11:38:20 +0000 (13:38 +0200)
committerNathalieGore <nathalie.gore@opencascade.com>
Fri, 27 Sep 2024 11:38:20 +0000 (13:38 +0200)
src/RepairGUIAdv/reparation_plugin_algo.py

index 6f57118d70a66f28f36f88c50508fddfbfe989cf..f5e3c46adfd0afca2c18e10096d4a9e9d02bb39a 100644 (file)
@@ -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():