[bos #38044][EDF] (2023-T3) Support for automatic reparation. An attempt to pass to the parent process an ID instead of reference for result object.

This commit is contained in:
Konstantin Leontev 2024-10-03 17:37:37 +01:00
parent 0c71d36f22
commit 6bc13470f7
2 changed files with 33 additions and 20 deletions

View File

@ -196,6 +196,10 @@ def execute(selected_object, algo_name, args_dict, is_dump_on = True, is_copy_on
logger.error('Could not get a result object after exec of %s file!', str(algo_name))
return None
# Temporary case to check of it's safe to passe result as ID instead of object
result_object = geompy.GetObject(result_object)
geompy.addToStudy(result_object, args_dict['result_name'])
if is_dump_on:
args_str = make_dump_args(algo_name, args_dict_str, is_dump_on, is_copy_on)
save_to_dump(geompy, selected_object, result_object, args_str)

View File

@ -29,7 +29,7 @@ from time import sleep
import salome
from salome.geom import geomBuilder
from qtsalome import QFileDialog, QApplication, pyqtSignal
from qtsalome import QFileDialog, QApplication
import GEOM
import SMESH, SALOMEDS
@ -77,27 +77,36 @@ def run(args_dict, progress_emitter):
logging.info('\Tol_max: %s', maxTol)
logging.info('\Debug: %s', Debug)
progress_emitter.emit()
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
# Temporary case to check of it's safe to passe result as ID instead of object
box = geompy.MakeBoxDXDYDZ(200, 400, 300)
entry = box.GetEntry()
print('entry: ', entry)
return entry
progress_emitter.emit()
# return entry
# return box
return face
# progress_emitter.emit()
# nbTry = 500
# ratioMin = 0.09
# ratioMax = 0.11
# for i in range(nbTry):
# face = geompy.ImportBREP("/home/kleontev/dev/38044_auto_repair/ImportBrepCrash/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
# progress_emitter.emit()
# return face
def test():