from SMESH_mechanic import *
# create group of edges
all_edges = mesh.GetElementsByType(SMESH.EDGE)
-grp = mesh.MakeGroupByIds("edges group", SMESH.EDGE, all_edges[:len(all_edges)/4])
+grp = mesh.MakeGroupByIds("edges group", SMESH.EDGE, all_edges[:len(all_edges) // 4])
import SALOMEDS
c = SALOMEDS.Color(0.1, 0.5, 1.0)
grp.SetColor(c)
# remove half of mesh faces from the smallest face
faceFaces = mesh.GetSubMeshElementsId(face)
-faceToRemove = faceFaces[: len(faceFaces)/2]
+faceToRemove = faceFaces[: len(faceFaces) // 2]
mesh.RemoveElements( faceToRemove )
# make a group of volumes missing the removed faces
# remove some faces
faces = init_mesh.GetElementsByType( SMESH.FACE )
nb_faces = len( faces )
-rm_face = faces[ : nb_faces/2]
+rm_face = faces[ : nb_faces // 2]
init_mesh.RemoveElements( rm_face )
# restore boundary in this mesh
# remove some edges
edges = init_mesh.GetElementsByType( SMESH.EDGE )
nb_edges = len( edges )
-rm_edge = edges[ : nb_edges/2]
+rm_edge = edges[ : nb_edges // 2]
init_mesh.RemoveElements( rm_edge )
# @param name Study name of the mesh
# @ingroup l2_construct
def __init__(self, smeshpyD, geompyD, obj=0, name=0):
- self.smeshpyD=smeshpyD
- self.geompyD=geompyD
+ self.smeshpyD = smeshpyD
+ self.geompyD = geompyD
if obj is None:
obj = 0
objHasName = False
# with old dump scripts which call SMESH_Mesh directly and not via smeshBuilder.Mesh
#
class meshProxy(SMESH._objref_SMESH_Mesh):
- def __init__(self):
- SMESH._objref_SMESH_Mesh.__init__(self)
+ def __init__(self, *args):
+ SMESH._objref_SMESH_Mesh.__init__(self, *args)
def __deepcopy__(self, memo=None):
new = self.__class__()
return new
## Private class wrapping SMESH.SMESH_SubMesh in order to add Compute()
#
class submeshProxy(SMESH._objref_SMESH_subMesh):
- def __init__(self):
- SMESH._objref_SMESH_subMesh.__init__(self)
+ def __init__(self, *args):
+ SMESH._objref_SMESH_subMesh.__init__(self, *args)
self.mesh = None
def __deepcopy__(self, memo=None):
new = self.__class__()
# smeshBuilder.Mesh
#
class meshEditor(SMESH._objref_SMESH_MeshEditor):
- def __init__(self):
- SMESH._objref_SMESH_MeshEditor.__init__(self)
+ def __init__(self, *args):
+ SMESH._objref_SMESH_MeshEditor.__init__(self, *args)
self.mesh = None
def __getattr__(self, name ): # method called if an attribute not found
if not self.mesh: # look for name() method in Mesh class