mirror of
https://git.salome-platform.org/gitpub/modules/smesh.git
synced 2024-12-30 19:30:35 +05:00
make Mesh.MeshDimension() work in case w/o geometry
This commit is contained in:
parent
44d181bc0e
commit
577999dffd
@ -1107,10 +1107,12 @@ class Mesh:
|
|||||||
return self.smeshpyD.GetGeometryByMeshElement( self.mesh, theElementID, theGeomName )
|
return self.smeshpyD.GetGeometryByMeshElement( self.mesh, theElementID, theGeomName )
|
||||||
|
|
||||||
## Returns the mesh dimension depending on the dimension of the underlying shape
|
## Returns the mesh dimension depending on the dimension of the underlying shape
|
||||||
|
# or, if the mesh is not based on any shape, basing on deimension of elements
|
||||||
# @return mesh dimension as an integer value [0,3]
|
# @return mesh dimension as an integer value [0,3]
|
||||||
# @ingroup l1_auxiliary
|
# @ingroup l1_auxiliary
|
||||||
def MeshDimension(self):
|
def MeshDimension(self):
|
||||||
shells = self.geompyD.SubShapeAllIDs( self.geom, geompyDC.ShapeType["SHELL"] )
|
if self.mesh.HasShapeToMesh():
|
||||||
|
shells = self.geompyD.SubShapeAllIDs( self.geom, geompyDC.ShapeType["SOLID"] )
|
||||||
if len( shells ) > 0 :
|
if len( shells ) > 0 :
|
||||||
return 3
|
return 3
|
||||||
elif self.geompyD.NumberOfFaces( self.geom ) > 0 :
|
elif self.geompyD.NumberOfFaces( self.geom ) > 0 :
|
||||||
@ -1119,7 +1121,11 @@ class Mesh:
|
|||||||
return 1
|
return 1
|
||||||
else:
|
else:
|
||||||
return 0;
|
return 0;
|
||||||
pass
|
else:
|
||||||
|
if self.NbVolumes() > 0: return 3
|
||||||
|
if self.NbFaces() > 0: return 2
|
||||||
|
if self.NbEdges() > 0: return 1
|
||||||
|
return 0
|
||||||
|
|
||||||
## Evaluates size of prospective mesh on a shape
|
## Evaluates size of prospective mesh on a shape
|
||||||
# @return a list where i-th element is a number of elements of i-th SMESH.EntityType
|
# @return a list where i-th element is a number of elements of i-th SMESH.EntityType
|
||||||
|
Loading…
Reference in New Issue
Block a user