mirror of
https://git.salome-platform.org/gitpub/modules/smesh.git
synced 2025-01-14 10:40:34 +05:00
0022100: EDF 2413 SMESH: Take into account TRIA7
0022098: EDF 2036 SMESH: Create groups from none conected parts of a mesh + def NbBiQuadTriangles(self): + def ClearLastCreated(self): def GetFilter(self,elementType, CritType=FT_Undefined, Compare=FT_EqualTo, Threshold="", UnaryOp=FT_Undefined, Tolerance=1e-07, + mesh=None):
This commit is contained in:
parent
70fad16a15
commit
22dd2b977a
@ -520,25 +520,19 @@ class smeshBuilder(object, SMESH._objref_SMESH_Gen):
|
|||||||
return aMesh
|
return aMesh
|
||||||
|
|
||||||
## Creates a Mesh object(s) importing data from the given MED file
|
## Creates a Mesh object(s) importing data from the given MED file
|
||||||
# @return a list of Mesh class instances
|
# @return a tuple ( list of Mesh class instances, SMESH.DriverMED_ReadStatus )
|
||||||
# @ingroup l2_impexp
|
# @ingroup l2_impexp
|
||||||
def CreateMeshesFromMED( self,theFileName ):
|
def CreateMeshesFromMED( self,theFileName ):
|
||||||
aSmeshMeshes, aStatus = SMESH._objref_SMESH_Gen.CreateMeshesFromMED(self,theFileName)
|
aSmeshMeshes, aStatus = SMESH._objref_SMESH_Gen.CreateMeshesFromMED(self,theFileName)
|
||||||
aMeshes = []
|
aMeshes = [ Mesh(self, self.geompyD, m) for m in aSmeshMeshes ]
|
||||||
for iMesh in range(len(aSmeshMeshes)) :
|
|
||||||
aMesh = Mesh(self, self.geompyD, aSmeshMeshes[iMesh])
|
|
||||||
aMeshes.append(aMesh)
|
|
||||||
return aMeshes, aStatus
|
return aMeshes, aStatus
|
||||||
|
|
||||||
## Creates a Mesh object(s) importing data from the given SAUV file
|
## Creates a Mesh object(s) importing data from the given SAUV file
|
||||||
# @return a list of Mesh class instances
|
# @return a tuple ( list of Mesh class instances, SMESH.DriverMED_ReadStatus )
|
||||||
# @ingroup l2_impexp
|
# @ingroup l2_impexp
|
||||||
def CreateMeshesFromSAUV( self,theFileName ):
|
def CreateMeshesFromSAUV( self,theFileName ):
|
||||||
aSmeshMeshes, aStatus = SMESH._objref_SMESH_Gen.CreateMeshesFromSAUV(self,theFileName)
|
aSmeshMeshes, aStatus = SMESH._objref_SMESH_Gen.CreateMeshesFromSAUV(self,theFileName)
|
||||||
aMeshes = []
|
aMeshes = [ Mesh(self, self.geompyD, m) for m in aSmeshMeshes ]
|
||||||
for iMesh in range(len(aSmeshMeshes)) :
|
|
||||||
aMesh = Mesh(self, self.geompyD, aSmeshMeshes[iMesh])
|
|
||||||
aMeshes.append(aMesh)
|
|
||||||
return aMeshes, aStatus
|
return aMeshes, aStatus
|
||||||
|
|
||||||
## Creates a Mesh object importing data from the given STL file
|
## Creates a Mesh object importing data from the given STL file
|
||||||
@ -550,18 +544,15 @@ class smeshBuilder(object, SMESH._objref_SMESH_Gen):
|
|||||||
return aMesh
|
return aMesh
|
||||||
|
|
||||||
## Creates Mesh objects importing data from the given CGNS file
|
## Creates Mesh objects importing data from the given CGNS file
|
||||||
# @return an instance of Mesh class
|
# @return a tuple ( list of Mesh class instances, SMESH.DriverMED_ReadStatus )
|
||||||
# @ingroup l2_impexp
|
# @ingroup l2_impexp
|
||||||
def CreateMeshesFromCGNS( self, theFileName ):
|
def CreateMeshesFromCGNS( self, theFileName ):
|
||||||
aSmeshMeshes, aStatus = SMESH._objref_SMESH_Gen.CreateMeshesFromCGNS(self,theFileName)
|
aSmeshMeshes, aStatus = SMESH._objref_SMESH_Gen.CreateMeshesFromCGNS(self,theFileName)
|
||||||
aMeshes = []
|
aMeshes = [ Mesh(self, self.geompyD, m) for m in aSmeshMeshes ]
|
||||||
for iMesh in range(len(aSmeshMeshes)) :
|
|
||||||
aMesh = Mesh(self, self.geompyD, aSmeshMeshes[iMesh])
|
|
||||||
aMeshes.append(aMesh)
|
|
||||||
return aMeshes, aStatus
|
return aMeshes, aStatus
|
||||||
|
|
||||||
## Creates a Mesh object importing data from the given GMF file
|
## Creates a Mesh object importing data from the given GMF file
|
||||||
# @return [ an instance of Mesh class, SMESH::ComputeError ]
|
# @return [ an instance of Mesh class, SMESH.ComputeError ]
|
||||||
# @ingroup l2_impexp
|
# @ingroup l2_impexp
|
||||||
def CreateMeshesFromGMF( self, theFileName ):
|
def CreateMeshesFromGMF( self, theFileName ):
|
||||||
aSmeshMesh, error = SMESH._objref_SMESH_Gen.CreateMeshesFromGMF(self,
|
aSmeshMesh, error = SMESH._objref_SMESH_Gen.CreateMeshesFromGMF(self,
|
||||||
@ -675,10 +666,10 @@ class smeshBuilder(object, SMESH._objref_SMESH_Gen):
|
|||||||
Tolerance=1e-07):
|
Tolerance=1e-07):
|
||||||
if not CritType in SMESH.FunctorType._items:
|
if not CritType in SMESH.FunctorType._items:
|
||||||
raise TypeError, "CritType should be of SMESH.FunctorType"
|
raise TypeError, "CritType should be of SMESH.FunctorType"
|
||||||
aCriterion = self.GetEmptyCriterion()
|
aCriterion = self.GetEmptyCriterion()
|
||||||
aCriterion.TypeOfElement = elementType
|
aCriterion.TypeOfElement = elementType
|
||||||
aCriterion.Type = self.EnumToLong(CritType)
|
aCriterion.Type = self.EnumToLong(CritType)
|
||||||
aCriterion.Tolerance = Tolerance
|
aCriterion.Tolerance = Tolerance
|
||||||
|
|
||||||
aThreshold = Threshold
|
aThreshold = Threshold
|
||||||
|
|
||||||
@ -732,6 +723,30 @@ class smeshBuilder(object, SMESH._objref_SMESH_Gen):
|
|||||||
else:
|
else:
|
||||||
raise ValueError,\
|
raise ValueError,\
|
||||||
"The Threshold should be an ID of mesh face and not '%s'"%aThreshold
|
"The Threshold should be an ID of mesh face and not '%s'"%aThreshold
|
||||||
|
elif CritType == FT_ConnectedElements:
|
||||||
|
# Checks the Threshold
|
||||||
|
if isinstance(aThreshold, geomBuilder.GEOM._objref_GEOM_Object): # shape
|
||||||
|
aCriterion.ThresholdID = aThreshold.GetStudyEntry()
|
||||||
|
if not aCriterion.ThresholdID:
|
||||||
|
name = aThreshold.GetName()
|
||||||
|
if not name:
|
||||||
|
name = "%s_%s"%(aThreshold.GetShapeType(), id(aThreshold)%10000)
|
||||||
|
aCriterion.ThresholdID = self.geompyD.addToStudy( aThreshold, name )
|
||||||
|
elif isinstance(aThreshold, int): # node id
|
||||||
|
aCriterion.Threshold = aThreshold
|
||||||
|
elif isinstance(aThreshold, list): # 3 point coordinates
|
||||||
|
if len( aThreshold ) < 3:
|
||||||
|
raise ValueError, "too few point coordinates, must be 3"
|
||||||
|
aCriterion.ThresholdStr = " ".join( [str(c) for c in aThreshold[:3]] )
|
||||||
|
elif isinstance(aThreshold, str):
|
||||||
|
if aThreshold.isdigit():
|
||||||
|
aCriterion.Threshold = aThreshold # node id
|
||||||
|
else:
|
||||||
|
aCriterion.ThresholdStr = aThreshold # hope that it's point coordinates
|
||||||
|
else:
|
||||||
|
raise ValueError,\
|
||||||
|
"The Threshold should either a VERTEX, or a node ID, "\
|
||||||
|
"or a list of point coordinates and not '%s'"%aThreshold
|
||||||
elif CritType == FT_ElemGeomType:
|
elif CritType == FT_ElemGeomType:
|
||||||
# Checks the Threshold
|
# Checks the Threshold
|
||||||
try:
|
try:
|
||||||
@ -817,13 +832,17 @@ class smeshBuilder(object, SMESH._objref_SMESH_Gen):
|
|||||||
Compare=FT_EqualTo,
|
Compare=FT_EqualTo,
|
||||||
Threshold="",
|
Threshold="",
|
||||||
UnaryOp=FT_Undefined,
|
UnaryOp=FT_Undefined,
|
||||||
Tolerance=1e-07):
|
Tolerance=1e-07,
|
||||||
|
mesh=None):
|
||||||
aCriterion = self.GetCriterion(elementType, CritType, Compare, Threshold, UnaryOp, FT_Undefined,Tolerance)
|
aCriterion = self.GetCriterion(elementType, CritType, Compare, Threshold, UnaryOp, FT_Undefined,Tolerance)
|
||||||
aFilterMgr = self.CreateFilterManager()
|
aFilterMgr = self.CreateFilterManager()
|
||||||
aFilter = aFilterMgr.CreateFilter()
|
aFilter = aFilterMgr.CreateFilter()
|
||||||
aCriteria = []
|
aCriteria = []
|
||||||
aCriteria.append(aCriterion)
|
aCriteria.append(aCriterion)
|
||||||
aFilter.SetCriteria(aCriteria)
|
aFilter.SetCriteria(aCriteria)
|
||||||
|
if mesh:
|
||||||
|
if isinstance( mesh, Mesh ): aFilter.SetMesh( mesh.GetMesh() )
|
||||||
|
else : aFilter.SetMesh( mesh )
|
||||||
aFilterMgr.UnRegister()
|
aFilterMgr.UnRegister()
|
||||||
return aFilter
|
return aFilter
|
||||||
|
|
||||||
@ -2025,6 +2044,12 @@ class Mesh:
|
|||||||
def NbTrianglesOfOrder(self, elementOrder):
|
def NbTrianglesOfOrder(self, elementOrder):
|
||||||
return self.mesh.NbTrianglesOfOrder(elementOrder)
|
return self.mesh.NbTrianglesOfOrder(elementOrder)
|
||||||
|
|
||||||
|
## Returns the number of biquadratic triangles in the mesh
|
||||||
|
# @return an integer value
|
||||||
|
# @ingroup l1_meshinfo
|
||||||
|
def NbBiQuadTriangles(self):
|
||||||
|
return self.mesh.NbBiQuadTriangles()
|
||||||
|
|
||||||
## Returns the number of quadrangles in the mesh
|
## Returns the number of quadrangles in the mesh
|
||||||
# @return an integer value
|
# @return an integer value
|
||||||
# @ingroup l1_meshinfo
|
# @ingroup l1_meshinfo
|
||||||
@ -4086,6 +4111,11 @@ class Mesh:
|
|||||||
def GetLastCreatedElems(self):
|
def GetLastCreatedElems(self):
|
||||||
return self.editor.GetLastCreatedElems()
|
return self.editor.GetLastCreatedElems()
|
||||||
|
|
||||||
|
## Clear sequences of nodes and elements created by mesh edition oparations
|
||||||
|
# @ingroup l1_auxiliary
|
||||||
|
def ClearLastCreated(self):
|
||||||
|
self.editor.ClearLastCreated()
|
||||||
|
|
||||||
## Creates a hole in a mesh by doubling the nodes of some particular elements
|
## Creates a hole in a mesh by doubling the nodes of some particular elements
|
||||||
# @param theNodes identifiers of nodes to be doubled
|
# @param theNodes identifiers of nodes to be doubled
|
||||||
# @param theModifiedElems identifiers of elements to be updated by the new (doubled)
|
# @param theModifiedElems identifiers of elements to be updated by the new (doubled)
|
||||||
|
Loading…
Reference in New Issue
Block a user