Hello,
i have been looking how to use the smesh.IsApplicable() function, to ensure if it is possible or not to use extrusion 3D hypothesis to a solid. In the user guide MESH module, there is no mention of this, in the developper guide Mesh module, I can not search for it directly but if i use google to search in it i dont have any luck (using site:https://docs.salome-platform.org/latest/tui/SMESH/index.html IsApplicable
).
from the print help of python I do not get much more info…
help(smesh.IsApplicable)
Help on method IsApplicable in module SMESH:
IsApplicable(*args) method of salome.smesh.smeshBuilder.smeshBuilder instance
and if i try to run it without info (trying to guide me from the error message for wrong outputs) i got:
Traceback (most recent call last):
File "<input>", line 1, in <module>
File "C:\SALOME-9.10.0\W64\SMESH\bin\salome\SMESH_Gen_idl.py", line 498, in IsApplicable
return self._obj.invoke("IsApplicable", _0_SMESH.SMESH_Gen._d_IsApplicable, args)
TypeError: Operation requires 4 arguments; 2 given
but i dont know what are each argument, and if I go to the mentionned file i only get:
def IsApplicable(self, *args):
return self._obj.invoke("IsApplicable", _0_SMESH.SMESH_Gen._d_IsApplicable, args)
any help regarding how to use this function, or how to dig deeper, would be helpful.
thanks,
edit:
finding the definition of the function in SOURCES/SMESH/idl/SMESH_Gen.idl
/*!
* Returns true if algorithm can be used to mesh a given geometry
* \param theAlgoType - the algorithm type
* \param theLibName - a name of the Plug-in library implementing the algorithm
* \param theShapeObject - the geometry to mesh
* \param toCheckAll - if \c True, returns \c True if all shapes are meshable,
* else, returns \c True if at least one shape is meshable
*/
boolean IsApplicable( in string theAlgoType,
in string theLibName,
in GEOM::GEOM_Object theShapeObject,
in boolean toCheckAll );
what was still missing was what algorithm and librery.
for this one can create a mesh with the desired algorithm select in the object browser the algorithm created in algorithm section of Mesh section
and run
ID=salome.sg.getSelected(0)
test=salome.IDToObject(salome.sg.getSelected(0))
test.GetName()
test.GetLibName()
to get the theAlgoType and theLibName.
Edit 2.
Before running smesh.IsApplicable() a dummy mesh needs to be created eg.,
box_dummy=geompy.MakeBoxDXDYDZ(1,1,1)
Mesh_dummy = smesh.Mesh(box_dummy,'Mesh_dummy')
Mesh_dummy.Prism(geom=box_dummy)
if not the function retunrs always True even if the IsApplicable is not true.