except ImportError:
noNETGENPlugin = 1
pass
-
+
# Types of algo
REGULAR = 1
PYTHON = 2
# MirrorType enumeration
POINT = SMESH_MeshEditor.POINT
-AXIS = SMESH_MeshEditor.AXIS
+AXIS = SMESH_MeshEditor.AXIS
PLANE = SMESH_MeshEditor.PLANE
# Smooth_Method enumeration
class smeshDC(SMESH._objref_SMESH_Gen):
def init_smesh(self,theStudy,geompyD):
- self.SetCurrentStudy(theStudy)
self.geompyD=geompyD
self.SetGeomEngine(geompyD)
-
+ self.SetCurrentStudy(theStudy)
+
def Mesh(self, obj=0, name=0):
return Mesh(self,self.geompyD,obj,name)
aCriterion.Compare = self.EnumToLong(FT_EqualTo)
aTreshold = Compare
- if CritType in [FT_BelongToGeom, FT_BelongToPlane, FT_BelongToGenSurface,
+ if CritType in [FT_BelongToGeom, FT_BelongToPlane, FT_BelongToGenSurface,
FT_BelongToCylinder, FT_LyingOnGeom]:
# Check treshold
if isinstance(aTreshold, geompyDC.GEOM._objref_GEOM_Object):
print "Error: Treshold should be a string."
return None
elif CritType in [FT_FreeBorders, FT_FreeEdges, FT_BadOrientedVolume]:
- # Here we don't need treshold
+ # Here we do not need treshold
if aTreshold == FT_LogicalNOT:
aCriterion.UnaryOp = self.EnumToLong(FT_LogicalNOT)
elif aTreshold in [FT_LogicalAND, FT_LogicalOR]:
omniORB.registerObjref(SMESH._objref_SMESH_Gen._NP_RepositoryId, smeshDC)
-## Mother class to define algorithm, recommended to don't use directly.
+## Mother class to define algorithm, recommended to do not use directly.
#
# More details.
class Mesh_Algorithm:
# @class Mesh_Algorithm
# @brief Class Mesh_Algorithm
- hypos = {}
+ #17908#hypos = {}
#def __init__(self,smesh):
# self.smesh=smesh
self.subm = None
self.algo = None
- def FindHypothesis(self,hypname, args):
- key = "%s %s %s" % (self.__class__.__name__, hypname, args)
- if Mesh_Algorithm.hypos.has_key( key ):
- return Mesh_Algorithm.hypos[ key ]
- return None
+ #17908#def FindHypothesis(self,hypname, args):
+ #17908# key = "%s %s %s" % (self.__class__.__name__, hypname, args)
+ #17908# if Mesh_Algorithm.hypos.has_key( key ):
+ #17908# return Mesh_Algorithm.hypos[ key ]
+ #17908# return None
## If the algorithm is global, return 0; \n
# else return the submesh associated to this algorithm.
## Get id of algo
def GetId(self):
return self.algo.GetId()
-
+
## Private method.
def Create(self, mesh, geom, hypo, so="libStdMeshersEngine.so"):
if geom is None:
## Private method
def Hypothesis(self, hyp, args=[], so="libStdMeshersEngine.so", UseExisting=0):
CreateNew = 1
- if UseExisting:
- hypo = self.FindHypothesis(hyp, args)
- if hypo: CreateNew = 0
- pass
+ #17908#if UseExisting:
+ #17908# hypo = self.FindHypothesis(hyp, args)
+ #17908# if hypo: CreateNew = 0
+ #17908# pass
if CreateNew:
hypo = self.mesh.smeshpyD.CreateHypothesis(hyp, so)
key = "%s %s %s" % (self.__class__.__name__, hyp, args)
- Mesh_Algorithm.hypos[key] = hypo
+ #17908#Mesh_Algorithm.hypos[key] = hypo
a = ""
s = "="
i = 0
# More details.
class Mesh_Segment(Mesh_Algorithm):
- algo = 0 # algorithm object common for all Mesh_Segment's
+ #17908#algo = 0 # algorithm object common for all Mesh_Segments
## Private constructor.
def __init__(self, mesh, geom=0):
Mesh_Algorithm.__init__(self)
- if not Mesh_Segment.algo:
- Mesh_Segment.algo = self.Create(mesh, geom, "Regular_1D")
- else:
- self.Assign( Mesh_Segment.algo, mesh, geom)
- pass
+ #17908#if not Mesh_Segment.algo:
+ #17908# Mesh_Segment.algo = self.Create(mesh, geom, "Regular_1D")
+ #17908#else:
+ #17908# self.Assign( Mesh_Segment.algo, mesh, geom)
+ #17908# pass
+ self.Create(mesh, geom, "Regular_1D")
## Define "LocalLength" hypothesis to cut an edge in several segments with the same length
# @param l for the length of segments that cut an edge
hyp = self.Hypothesis("LocalLength", [l], UseExisting=UseExisting)
hyp.SetLength(l)
return hyp
-
+
## Define "NumberOfSegments" hypothesis to cut an edge in several fixed number of segments
# @param n for the number of segments that cut an edge
# @param s for the scale factor (optional)
hyp.SetScaleFactor(s)
hyp.SetNumberOfSegments(n)
return hyp
-
+
## Define "Arithmetic1D" hypothesis to cut an edge in several segments with arithmetic length increasing
# @param start for the length of the first segment
# @param end for the length of the last segment
# More details.
class Mesh_CompositeSegment(Mesh_Segment):
- algo = 0 # algorithm object common for all Mesh_CompositeSegment's
+ #17908#algo = 0 # algorithm object common for all Mesh_CompositeSegments
## Private constructor.
def __init__(self, mesh, geom=0):
- if not Mesh_CompositeSegment.algo:
- Mesh_CompositeSegment.algo = self.Create(mesh, geom, "CompositeSegment_1D")
- else:
- self.Assign( Mesh_CompositeSegment.algo, mesh, geom)
- pass
+ #17908#if not Mesh_CompositeSegment.algo:
+ #17908# Mesh_CompositeSegment.algo = self.Create(mesh, geom, "CompositeSegment_1D")
+ #17908#else:
+ #17908# self.Assign( Mesh_CompositeSegment.algo, mesh, geom)
+ #17908# pass
+ self.Create(mesh, geom, "CompositeSegment_1D")
# Public class: Mesh_Segment_Python
# More details.
class Mesh_Segment_Python(Mesh_Segment):
- algo = 0 # algorithm object common for all Mesh_Segment_Python's
+ #17908#algo = 0 # algorithm object common for all Mesh_Segment_Pythons
## Private constructor.
def __init__(self, mesh, geom=0):
import Python1dPlugin
- if not Mesh_Segment_Python.algo:
- Mesh_Segment_Python.algo = self.Create(mesh, geom, "Python_1D", "libPython1dEngine.so")
- else:
- self.Assign( Mesh_Segment_Python.algo, mesh, geom)
- pass
+ #17908#if not Mesh_Segment_Python.algo:
+ #17908# Mesh_Segment_Python.algo = self.Create(mesh, geom, "Python_1D", "libPython1dEngine.so")
+ #17908#else:
+ #17908# self.Assign( Mesh_Segment_Python.algo, mesh, geom)
+ #17908# pass
+ self.Create(mesh, geom, "Python_1D", "libPython1dEngine.so")
## Define "PythonSplit1D" hypothesis based on the Erwan Adam patch, awaiting equivalent SALOME functionality
# @param n for the number of segments that cut an edge
params = 0
# algorithm objects common for all instances of Mesh_Triangle
- algoMEF = 0
- algoNET = 0
- algoNET_2D = 0
+ #17908#algoMEF = 0
+ #17908#algoNET = 0
+ #17908#algoNET_2D = 0
## Private constructor.
def __init__(self, mesh, algoType, geom=0):
Mesh_Algorithm.__init__(self)
if algoType == MEFISTO:
- if not Mesh_Triangle.algoMEF:
- Mesh_Triangle.algoMEF = self.Create(mesh, geom, "MEFISTO_2D")
- else:
- self.Assign( Mesh_Triangle.algoMEF, mesh, geom)
- pass
+ #17908#if not Mesh_Triangle.algoMEF:
+ #17908# Mesh_Triangle.algoMEF = self.Create(mesh, geom, "MEFISTO_2D")
+ #17908#else:
+ #17908# self.Assign( Mesh_Triangle.algoMEF, mesh, geom)
+ #17908# pass
+ self.Create(mesh, geom, "MEFISTO_2D")
pass
elif algoType == NETGEN:
if noNETGENPlugin:
print "Warning: NETGENPlugin module unavailable"
pass
- if not Mesh_Triangle.algoNET:
- Mesh_Triangle.algoNET = self.Create(mesh, geom, "NETGEN_2D", "libNETGENEngine.so")
- else:
- self.Assign( Mesh_Triangle.algoNET, mesh, geom)
- pass
+ #17908#if not Mesh_Triangle.algoNET:
+ #17908# Mesh_Triangle.algoNET = self.Create(mesh, geom, "NETGEN_2D", "libNETGENEngine.so")
+ #17908#else:
+ #17908# self.Assign( Mesh_Triangle.algoNET, mesh, geom)
+ #17908# pass
+ self.Create(mesh, geom, "NETGEN_2D", "libNETGENEngine.so")
pass
elif algoType == NETGEN_2D:
if noNETGENPlugin:
print "Warning: NETGENPlugin module unavailable"
pass
- if not Mesh_Triangle.algoNET_2D:
- Mesh_Triangle.algoNET_2D = self.Create(mesh, geom,
- "NETGEN_2D_ONLY", "libNETGENEngine.so")
- else:
- self.Assign( Mesh_Triangle.algoNET_2D, mesh, geom)
- pass
+ #17908#if not Mesh_Triangle.algoNET_2D:
+ #17908# Mesh_Triangle.algoNET_2D = self.Create(mesh, geom,
+ #17908# "NETGEN_2D_ONLY", "libNETGENEngine.so")
+ #17908#else:
+ #17908# self.Assign( Mesh_Triangle.algoNET_2D, mesh, geom)
+ #17908# pass
+ self.Create(mesh, geom, "NETGEN_2D_ONLY", "libNETGENEngine.so")
pass
self.algoType = algoType
#
# Only for algoType == NETGEN
def SetMaxSize(self, theSize):
- if self.params == 0 and self.Parameters():
+ if self.params == 0:
+ self.Parameters()
+ if self.params is not None:
self.params.SetMaxSize(theSize)
-
+
## Set SecondOrder flag
#
# Only for algoType == NETGEN
def SetSecondOrder(self, theVal):
- if self.params == 0 and self.Parameters():
+ if self.params == 0:
+ self.Parameters()
+ if self.params is not None:
self.params.SetSecondOrder(theVal)
- return
## Set Optimize flag
#
# Only for algoType == NETGEN
def SetOptimize(self, theVal):
- if self.params == 0 and self.Parameters():
+ if self.params == 0:
+ self.Parameters()
+ if self.params is not None:
self.params.SetOptimize(theVal)
## Set Fineness
#
# Only for algoType == NETGEN
def SetFineness(self, theFineness):
- if self.params == 0 and self.Parameters():
+ if self.params == 0:
+ self.Parameters()
+ if self.params is not None:
self.params.SetFineness(theFineness)
-
- ## Set GrowthRate
+
+ ## Set GrowthRate
#
# Only for algoType == NETGEN
def SetGrowthRate(self, theRate):
- if self.params == 0 and self.Parameters():
+ if self.params == 0:
+ self.Parameters()
+ if self.params is not None:
self.params.SetGrowthRate(theRate)
## Set NbSegPerEdge
#
# Only for algoType == NETGEN
def SetNbSegPerEdge(self, theVal):
- if self.params == 0 and self.Parameters():
+ if self.params == 0:
+ self.Parameters()
+ if self.params is not None:
self.params.SetNbSegPerEdge(theVal)
## Set NbSegPerRadius
#
# Only for algoType == NETGEN
def SetNbSegPerRadius(self, theVal):
- if self.params == 0 and self.Parameters():
+ if self.params == 0:
+ self.Parameters()
+ if self.params is not None:
self.params.SetNbSegPerRadius(theVal)
pass
-
-
+
+
# Public class: Mesh_Quadrangle
# -----------------------------
# More details.
class Mesh_Quadrangle(Mesh_Algorithm):
- algo = 0 # algorithm object common for all Mesh_Quadrangle's
+ #17908#algo = 0 # algorithm object common for all Mesh_Quadrangles
## Private constructor.
def __init__(self, mesh, geom=0):
Mesh_Algorithm.__init__(self)
- if not Mesh_Quadrangle.algo:
- Mesh_Quadrangle.algo = self.Create(mesh, geom, "Quadrangle_2D")
- else:
- self.Assign( Mesh_Quadrangle.algo, mesh, geom)
- pass
+ #17908#if not Mesh_Quadrangle.algo:
+ #17908# Mesh_Quadrangle.algo = self.Create(mesh, geom, "Quadrangle_2D")
+ #17908#else:
+ #17908# self.Assign( Mesh_Quadrangle.algo, mesh, geom)
+ #17908# pass
+ self.Create(mesh, geom, "Quadrangle_2D")
## Define "QuadranglePreference" hypothesis, forcing construction
# of quadrangles if the number of nodes on opposite edges is not the same
params = 0
algoType = 0
- algoNET = 0 # algorithm object common for all Mesh_Tetrahedron's
- algoGHS = 0 # algorithm object common for all Mesh_Tetrahedron's
- algoFNET = 0 # algorithm object common for all Mesh_Tetrahedron's
+ #17908#algoNET = 0 # algorithm object common for all Mesh_Tetrahedrons
+ #17908#algoGHS = 0 # algorithm object common for all Mesh_Tetrahedrons
+ #17908#algoFNET = 0 # algorithm object common for all Mesh_Tetrahedrons
## Private constructor.
def __init__(self, mesh, algoType, geom=0):
Mesh_Algorithm.__init__(self)
if algoType == NETGEN:
- if not Mesh_Tetrahedron.algoNET:
- Mesh_Tetrahedron.algoNET = self.Create(mesh, geom, "NETGEN_3D", "libNETGENEngine.so")
- else:
- self.Assign( Mesh_Tetrahedron.algoNET, mesh, geom)
- pass
+ #17908#if not Mesh_Tetrahedron.algoNET:
+ #17908# Mesh_Tetrahedron.algoNET = self.Create(mesh, geom, "NETGEN_3D", "libNETGENEngine.so")
+ #17908#else:
+ #17908# self.Assign( Mesh_Tetrahedron.algoNET, mesh, geom)
+ #17908# pass
+ self.Create(mesh, geom, "NETGEN_3D", "libNETGENEngine.so")
pass
elif algoType == GHS3D:
- if not Mesh_Tetrahedron.algoGHS:
- import GHS3DPlugin
- Mesh_Tetrahedron.algoGHS = self.Create(mesh, geom, "GHS3D_3D" , "libGHS3DEngine.so")
- else:
- self.Assign( Mesh_Tetrahedron.algoGHS, mesh, geom)
- pass
+ #17908#if not Mesh_Tetrahedron.algoGHS:
+ #17908# import GHS3DPlugin
+ #17908# Mesh_Tetrahedron.algoGHS = self.Create(mesh, geom, "GHS3D_3D" , "libGHS3DEngine.so")
+ #17908#else:
+ #17908# self.Assign( Mesh_Tetrahedron.algoGHS, mesh, geom)
+ #17908# pass
+ import GHS3DPlugin
+ self.Create(mesh, geom, "GHS3D_3D" , "libGHS3DEngine.so")
pass
elif algoType == FULL_NETGEN:
if noNETGENPlugin:
print "Warning: NETGENPlugin module has not been imported."
- if not Mesh_Tetrahedron.algoFNET:
- Mesh_Tetrahedron.algoFNET = self.Create(mesh, geom, "NETGEN_2D3D", "libNETGENEngine.so")
- else:
- self.Assign( Mesh_Tetrahedron.algoFNET, mesh, geom)
- pass
+ #17908#if not Mesh_Tetrahedron.algoFNET:
+ #17908# Mesh_Tetrahedron.algoFNET = self.Create(mesh, geom, "NETGEN_2D3D", "libNETGENEngine.so")
+ #17908#else:
+ #17908# self.Assign( Mesh_Tetrahedron.algoFNET, mesh, geom)
+ #17908# pass
+ self.Create(mesh, geom, "NETGEN_2D3D", "libNETGENEngine.so")
pass
self.algoType = algoType
return self.params
else:
print "Algo doesn't support this hypothesis"
- return None
-
+ return None
+
## Set MaxSize
def SetMaxSize(self, theSize):
if self.params == 0:
if self.params == 0:
self.Parameters()
self.params.SetFineness(theFineness)
-
- ## Set GrowthRate
+
+ ## Set GrowthRate
def SetGrowthRate(self, theRate):
if self.params == 0:
self.Parameters()
# More details.
class Mesh_Hexahedron(Mesh_Algorithm):
- algo = 0 # algorithm object common for all Mesh_Hexahedron's
+ #17908#algo = 0 # algorithm object common for all Mesh_Hexahedrons
## Private constructor.
def __init__(self, mesh, geom=0):
Mesh_Algorithm.__init__(self)
- if not Mesh_Hexahedron.algo:
- Mesh_Hexahedron.algo = self.Create(mesh, geom, "Hexa_3D")
- else:
- self.Assign( Mesh_Hexahedron.algo, mesh, geom)
- pass
+ #17908#if not Mesh_Hexahedron.algo:
+ #17908# Mesh_Hexahedron.algo = self.Create(mesh, geom, "Hexa_3D")
+ #17908#else:
+ #17908# self.Assign( Mesh_Hexahedron.algo, mesh, geom)
+ #17908# pass
+ self.Create(mesh, geom, "Hexa_3D")
# Deprecated, only for compatibility!
# Public class: Mesh_Netgen
is3D = 0
- algoNET23 = 0 # algorithm object common for all Mesh_Netgen's
- algoNET2 = 0 # algorithm object common for all Mesh_Netgen's
+ #17908#algoNET23 = 0 # algorithm object common for all Mesh_Netgens
+ #17908#algoNET2 = 0 # algorithm object common for all Mesh_Netgens
## Private constructor.
def __init__(self, mesh, is3D, geom=0):
self.is3D = is3D
if is3D:
- if not Mesh_Netgen.algoNET23:
- Mesh_Netgen.algoNET23 = self.Create(mesh, geom, "NETGEN_2D3D", "libNETGENEngine.so")
- else:
- self.Assign( Mesh_Netgen.algoNET23, mesh, geom)
- pass
+ #17908#if not Mesh_Netgen.algoNET23:
+ #17908# Mesh_Netgen.algoNET23 = self.Create(mesh, geom, "NETGEN_2D3D", "libNETGENEngine.so")
+ #17908#else:
+ #17908# self.Assign( Mesh_Netgen.algoNET23, mesh, geom)
+ #17908# pass
+ self.Create(mesh, geom, "NETGEN_2D3D", "libNETGENEngine.so")
pass
else:
- if not Mesh_Netgen.algoNET2:
- Mesh_Netgen.algoNET2 = self.Create(mesh, geom, "NETGEN_2D", "libNETGENEngine.so")
- else:
- self.Assign( Mesh_Netgen.algoNET2, mesh, geom)
- pass
+ #17908#if not Mesh_Netgen.algoNET2:
+ #17908# Mesh_Netgen.algoNET2 = self.Create(mesh, geom, "NETGEN_2D", "libNETGENEngine.so")
+ #17908#else:
+ #17908# self.Assign( Mesh_Netgen.algoNET2, mesh, geom)
+ #17908# pass
+ self.Create(mesh, geom, "NETGEN_2D", "libNETGENEngine.so")
pass
## Define hypothesis containing parameters of the algorithm
# More details.
class Mesh_Projection1D(Mesh_Algorithm):
- algo = 0 # algorithm object common for all Mesh_Projection1D's
+ #17908#algo = 0 # algorithm object common for all Mesh_Projection1Ds
## Private constructor.
def __init__(self, mesh, geom=0):
Mesh_Algorithm.__init__(self)
- if not Mesh_Projection1D.algo:
- Mesh_Projection1D.algo = self.Create(mesh, geom, "Projection_1D")
- else:
- self.Assign( Mesh_Projection1D.algo, mesh, geom)
- pass
+ #17908#if not Mesh_Projection1D.algo:
+ #17908# Mesh_Projection1D.algo = self.Create(mesh, geom, "Projection_1D")
+ #17908#else:
+ #17908# self.Assign( Mesh_Projection1D.algo, mesh, geom)
+ #17908# pass
+ self.Create(mesh, geom, "Projection_1D")
## Define "Source Edge" hypothesis, specifying a meshed edge to
# take a mesh pattern from, and optionally association of vertices
# More details.
class Mesh_Projection2D(Mesh_Algorithm):
- algo = 0 # algorithm object common for all Mesh_Projection2D's
+ #17908#algo = 0 # algorithm object common for all Mesh_Projection2Ds
## Private constructor.
def __init__(self, mesh, geom=0):
Mesh_Algorithm.__init__(self)
- if not Mesh_Projection2D.algo:
- Mesh_Projection2D.algo = self.Create(mesh, geom, "Projection_2D")
- else:
- self.Assign( Mesh_Projection2D.algo, mesh, geom)
- pass
+ #17908#if not Mesh_Projection2D.algo:
+ #17908# Mesh_Projection2D.algo = self.Create(mesh, geom, "Projection_2D")
+ #17908#else:
+ #17908# self.Assign( Mesh_Projection2D.algo, mesh, geom)
+ #17908# pass
+ self.Create(mesh, geom, "Projection_2D")
## Define "Source Face" hypothesis, specifying a meshed face to
# take a mesh pattern from, and optionally association of vertices
# More details.
class Mesh_Projection3D(Mesh_Algorithm):
- algo = 0 # algorithm object common for all Mesh_Projection3D's
+ #17908#algo = 0 # algorithm object common for all Mesh_Projection3Ds
## Private constructor.
def __init__(self, mesh, geom=0):
Mesh_Algorithm.__init__(self)
- if not Mesh_Projection3D.algo:
- Mesh_Projection3D.algo = self.Create(mesh, geom, "Projection_3D")
- else:
- self.Assign( Mesh_Projection3D.algo, mesh, geom)
- pass
+ #17908#if not Mesh_Projection3D.algo:
+ #17908# Mesh_Projection3D.algo = self.Create(mesh, geom, "Projection_3D")
+ #17908#else:
+ #17908# self.Assign( Mesh_Projection3D.algo, mesh, geom)
+ #17908# pass
+ self.Create(mesh, geom, "Projection_3D")
## Define "Source Shape 3D" hypothesis, specifying a meshed solid to
# take a mesh pattern from, and optionally association of vertices
# More details.
class Mesh_Prism3D(Mesh_Algorithm):
- algo = 0 # algorithm object common for all Mesh_Prism3D's
+ #17908#algo = 0 # algorithm object common for all Mesh_Prism3Ds
## Private constructor.
def __init__(self, mesh, geom=0):
Mesh_Algorithm.__init__(self)
- if not Mesh_Prism3D.algo:
- Mesh_Prism3D.algo = self.Create(mesh, geom, "Prism_3D")
- else:
- self.Assign( Mesh_Prism3D.algo, mesh, geom)
- pass
+ #17908#if not Mesh_Prism3D.algo:
+ #17908# Mesh_Prism3D.algo = self.Create(mesh, geom, "Prism_3D")
+ #17908#else:
+ #17908# self.Assign( Mesh_Prism3D.algo, mesh, geom)
+ #17908# pass
+ self.Create(mesh, geom, "Prism_3D")
# Public class: Mesh_RadialPrism
# -------------------------------
# More details.
class Mesh_RadialPrism3D(Mesh_Algorithm):
- algo = 0 # algorithm object common for all Mesh_RadialPrism3D's
+ #17908#algo = 0 # algorithm object common for all Mesh_RadialPrism3Ds
## Private constructor.
def __init__(self, mesh, geom=0):
Mesh_Algorithm.__init__(self)
- if not Mesh_RadialPrism3D.algo:
- Mesh_RadialPrism3D.algo = self.Create(mesh, geom, "RadialPrism_3D")
- else:
- self.Assign( Mesh_RadialPrism3D.algo, mesh, geom)
- pass
+ #17908#if not Mesh_RadialPrism3D.algo:
+ #17908# Mesh_RadialPrism3D.algo = self.Create(mesh, geom, "RadialPrism_3D")
+ #17908#else:
+ #17908# self.Assign( Mesh_RadialPrism3D.algo, mesh, geom)
+ #17908# pass
+ self.Create(mesh, geom, "RadialPrism_3D")
+
self.distribHyp = self.Hypothesis( "LayerDistribution", UseExisting=0)
self.nbLayers = None
# -------------------------------
class Mesh_UseExisting(Mesh_Algorithm):
- algo1D = 0 # StdMeshers_UseExisting_1D object common for all Mesh_UseExisting
- algo2D = 0 # StdMeshers_UseExisting_2D object common for all Mesh_UseExisting
+ #17908#algo1D = 0 # StdMeshers_UseExisting_1D object common for all Mesh_UseExisting
+ #17908#algo2D = 0 # StdMeshers_UseExisting_2D object common for all Mesh_UseExisting
def __init__(self, dim, mesh, geom=0):
if dim == 1:
- if not Mesh_UseExisting.algo1D:
- Mesh_UseExisting.algo1D= self.Create(mesh, geom, "UseExisting_1D")
- else:
- self.Assign( Mesh_UseExisting.algo1D, mesh, geom)
- pass
+ #17908#if not Mesh_UseExisting.algo1D:
+ #17908# Mesh_UseExisting.algo1D= self.Create(mesh, geom, "UseExisting_1D")
+ #17908#else:
+ #17908# self.Assign( Mesh_UseExisting.algo1D, mesh, geom)
+ #17908# pass
+ self.Create(mesh, geom, "UseExisting_1D")
else:
- if not Mesh_UseExisting.algo2D:
- Mesh_UseExisting.algo2D= self.Create(mesh, geom, "UseExisting_2D")
- else:
- self.Assign( Mesh_UseExisting.algo2D, mesh, geom)
- pass
+ #17908#if not Mesh_UseExisting.algo2D:
+ #17908# Mesh_UseExisting.algo2D= self.Create(mesh, geom, "UseExisting_2D")
+ #17908#else:
+ #17908# self.Assign( Mesh_UseExisting.algo2D, mesh, geom)
+ #17908# pass
+ self.Create(mesh, geom, "UseExisting_2D")
# Public class: Mesh
# ==================
## Method that associates given shape to the mesh(entails the mesh recreation)
# @param geom shape to be meshed(GEOM_Object)
def SetShape(self, geom):
- self.mesh = self.smeshpyD.CreateMesh(geom)
-
+ self.mesh = self.smeshpyD.CreateMesh(geom)
+
## Return true if hypotheses are defined well
# @param theMesh is an instance of Mesh class
# @param theSubObject subshape of a mesh shape
return self.smeshpyD.GetAlgoState(self.mesh, theSubObject)
## Return geometrical object the given element is built on.
- # The returned geometrical object, if not nil, is either found in the
+ # The returned geometrical object, if not nil, is either found in the
# study or is published by this method with the given name
# @param theMesh is an instance of Mesh class
# @param theElementID an id of the mesh element
self.Quadrangle()
pass
if dim > 2 :
- self.Hexahedron()
+ self.Hexahedron()
pass
return self.Compute()
## Create a mesh group based on geometric object \a grp
# and give a \a name, \n if this parameter is not defined
# the name is the same as the geometric group name \n
- # Note: Works like GroupOnGeom().
+ # Note: Works like GroupOnGeom().
# @param grp is a geometric group, a vertex, an edge, a face or a solid
# @param name is the name of the mesh group
# @return SMESH_GroupOnGeom
def GetShapeID(self, id):
return self.mesh.GetShapeID(id)
- ## For given element returns ID of result shape after
+ ## For given element returns ID of result shape after
# FindShape() from SMESH_MeshEditor
# \n If there is not element for given ID - returns -1
def GetShapeIDForElem(self,id):
# @param MaxNbOfIterations maximum number of iterations
# @param MaxAspectRatio varies in range [1.0, inf]
# @param Method is Laplacian(LAPLACIAN_SMOOTH) or Centroidal(CENTROIDAL_SMOOTH)
- def SmoothObject(self, theObject, IDsOfFixedNodes,
+ def SmoothObject(self, theObject, IDsOfFixedNodes,
MaxNbOfIterations, MaxxAspectRatio, Method):
- return self.editor.SmoothObject(theObject, IDsOfFixedNodes,
+ return self.editor.SmoothObject(theObject, IDsOfFixedNodes,
MaxNbOfIterations, MaxxAspectRatio, Method)
## Parametric smooth the given elements
return self.editor.SmoothParametricObject(theObject, IDsOfFixedNodes,
MaxNbOfIterations, MaxAspectRatio, Method)
- ## Converts all mesh to quadratic one, deletes old elements, replacing
+ ## Converts all mesh to quadratic one, deletes old elements, replacing
# them with quadratic ones with the same id.
def ConvertToQuadratic(self, theForce3d):
self.editor.ConvertToQuadratic(theForce3d)
## Converts all mesh from quadratic to ordinary ones,
- # deletes old quadratic elements, \n replacing
+ # deletes old quadratic elements, \n replacing
# them with ordinary mesh elements with the same id.
def ConvertFromQuadratic(self):
return self.editor.ConvertFromQuadratic()
## Generate new elements by extrusion of the elements with given ids
# @param IDsOfElements list of elements ids for extrusion
- # @param StepVector vector, defining the direction and value of extrusion
+ # @param StepVector vector, defining the direction and value of extrusion
# @param NbOfSteps the number of steps
# @param MakeGroups to generate new groups from existing ones
def ExtrusionSweep(self, IDsOfElements, StepVector, NbOfSteps, MakeGroups=False):
## Generate new elements by extrusion of the elements with given ids
# @param IDsOfElements is ids of elements
- # @param StepVector vector, defining the direction and value of extrusion
+ # @param StepVector vector, defining the direction and value of extrusion
# @param NbOfSteps the number of steps
# @param ExtrFlags set flags for performing extrusion
# @param SewTolerance uses for comparing locations of nodes if flag
## Generate new elements by extrusion of the elements belong to object
# @param theObject object wich elements should be processed
- # @param StepVector vector, defining the direction and value of extrusion
+ # @param StepVector vector, defining the direction and value of extrusion
# @param NbOfSteps the number of steps
# @param MakeGroups to generate new groups from existing ones
def ExtrusionSweepObject(self, theObject, StepVector, NbOfSteps, MakeGroups=False):
## Generate new elements by extrusion of the elements belong to object
# @param theObject object wich elements should be processed
- # @param StepVector vector, defining the direction and value of extrusion
+ # @param StepVector vector, defining the direction and value of extrusion
# @param NbOfSteps the number of steps
# @param MakeGroups to generate new groups from existing ones
def ExtrusionSweepObject1D(self, theObject, StepVector, NbOfSteps, MakeGroups=False):
## Generate new elements by extrusion of the elements belong to object
# @param theObject object wich elements should be processed
- # @param StepVector vector, defining the direction and value of extrusion
- # @param NbOfSteps the number of steps
+ # @param StepVector vector, defining the direction and value of extrusion
+ # @param NbOfSteps the number of steps
# @param MakeGroups to generate new groups from existing ones
def ExtrusionSweepObject2D(self, theObject, StepVector, NbOfSteps, MakeGroups=False):
if ( isinstance( StepVector, geompyDC.GEOM._objref_GEOM_Object)):
# @param NodeStart the first or the last node on the edge. It is used to define the direction of extrusion
# @param HasAngles allows the shape to be rotated around the path to get the resulting mesh in a helical fashion
# @param Angles list of angles
- # @param HasRefPoint allows to use base point
+ # @param HasRefPoint allows to use base point
# @param RefPoint point around which the shape is rotated(the mass center of the shape by default).
# User can specify any point as the Base Point and the shape will be rotated with respect to this point.
# @param MakeGroups to generate new groups from existing ones
# @param NodeStart the first or the last node on the edge. It is used to define the direction of extrusion
# @param HasAngles allows the shape to be rotated around the path to get the resulting mesh in a helical fashion
# @param Angles list of angles
- # @param HasRefPoint allows to use base point
+ # @param HasRefPoint allows to use base point
# @param RefPoint point around which the shape is rotated(the mass center of the shape by default).
# User can specify any point as the Base Point and the shape will be rotated with respect to this point.
# @param MakeGroups to generate new groups from existing ones
HasAngles, Angles, HasRefPoint, RefPoint,
MakeGroups=False, LinearVariation=False):
if ( isinstance( RefPoint, geompyDC.GEOM._objref_GEOM_Object)):
- RefPoint = self.smeshpyD.GetPointStruct(RefPoint)
+ RefPoint = self.smeshpyD.GetPointStruct(RefPoint)
if MakeGroups:
return self.editor.ExtrusionAlongPathObjectMakeGroups(theObject, PathMesh.GetMesh(),
PathShape, NodeStart, HasAngles,
# @param IDsOfElements list of elements ids
# @param Axis axis of rotation(AxisStruct or geom line)
# @param AngleInRadians angle of rotation(in radians)
- # @param Copy allows to copy the rotated elements
+ # @param Copy allows to copy the rotated elements
# @param MakeGroups to generate new groups from existing ones (if Copy)
def Rotate (self, IDsOfElements, Axis, AngleInRadians, Copy, MakeGroups=False):
if IDsOfElements == []:
return self.editor.ChangeElemNodes(ide, newIDs)
## If during last operation of MeshEditor some nodes were
- # created this method returns list of it's IDs, \n
+ # created this method returns list of its IDs, \n
# if new nodes not created - returns empty list
def GetLastCreatedNodes(self):
return self.editor.GetLastCreatedNodes()
## If during last operation of MeshEditor some elements were
- # created this method returns list of it's IDs, \n
+ # created this method returns list of its IDs, \n
# if new elements not creared - returns empty list
def GetLastCreatedElems(self):
return self.editor.GetLastCreatedElems()