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.
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():