mirror of
https://git.salome-platform.org/gitpub/modules/smesh.git
synced 2025-01-26 16:40:32 +05:00
fix exception at "m = smesh.Mesh()"
This commit is contained in:
parent
b309f2d9ae
commit
0dbdc33fef
@ -986,6 +986,7 @@ class Mesh:
|
||||
self.geompyD=geompyD
|
||||
if obj is None:
|
||||
obj = 0
|
||||
objHasName = False
|
||||
if obj != 0:
|
||||
objHasName = True
|
||||
if isinstance(obj, geompyDC.GEOM._objref_GEOM_Object):
|
||||
@ -1107,19 +1108,25 @@ class Mesh:
|
||||
return self.smeshpyD.GetGeometryByMeshElement( self.mesh, theElementID, theGeomName )
|
||||
|
||||
## 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]
|
||||
# @ingroup l1_auxiliary
|
||||
def MeshDimension(self):
|
||||
shells = self.geompyD.SubShapeAllIDs( self.geom, geompyDC.ShapeType["SHELL"] )
|
||||
if len( shells ) > 0 :
|
||||
return 3
|
||||
elif self.geompyD.NumberOfFaces( self.geom ) > 0 :
|
||||
return 2
|
||||
elif self.geompyD.NumberOfEdges( self.geom ) > 0 :
|
||||
return 1
|
||||
if self.mesh.HasShapeToMesh():
|
||||
shells = self.geompyD.SubShapeAllIDs( self.geom, geompyDC.ShapeType["SOLID"] )
|
||||
if len( shells ) > 0 :
|
||||
return 3
|
||||
elif self.geompyD.NumberOfFaces( self.geom ) > 0 :
|
||||
return 2
|
||||
elif self.geompyD.NumberOfEdges( self.geom ) > 0 :
|
||||
return 1
|
||||
else:
|
||||
return 0;
|
||||
else:
|
||||
return 0;
|
||||
pass
|
||||
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
|
||||
# @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