X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FSMESH_SWIG%2FStdMeshersBuilder.py;h=feacca7971cb929a338c1e7623cd78ae074f6640;hb=21c9336a4d74ec59fe881f6e436374c34e44fac7;hp=afcd449fb9ec38766601d1929ad9dcdbb52230bd;hpb=b2eb2c3cef7c6fffbcc17e027be5e4d0357a935a;p=modules%2Fsmesh.git diff --git a/src/SMESH_SWIG/StdMeshersBuilder.py b/src/SMESH_SWIG/StdMeshersBuilder.py index afcd449fb..feacca797 100644 --- a/src/SMESH_SWIG/StdMeshersBuilder.py +++ b/src/SMESH_SWIG/StdMeshersBuilder.py @@ -369,7 +369,7 @@ class StdMeshersBuilder_Segment(Mesh_Algorithm): def LengthNearVertex(self, length, vertex=0, UseExisting=0): import types store_geom = self.geom - if type(vertex) is types.IntType: + if isinstance(vertex, int): if vertex == 0 or vertex == 1: from salome.geom import geomBuilder vertex = self.mesh.geompyD.ExtractShapes(self.geom, geomBuilder.geomBuilder.ShapeType["VERTEX"],True)[vertex] @@ -382,7 +382,7 @@ class StdMeshersBuilder_Segment(Mesh_Algorithm): # 0D algorithm if self.geom is None: self.geom = store_geom - raise RuntimeError, "Attemp to create SegmentAroundVertex_0D algoritm on None shape" + raise RuntimeError("Attempt to create SegmentAroundVertex_0D algorithm on None shape") from salome.smesh.smeshBuilder import AssureGeomPublished, GetName, TreatHypoStatus AssureGeomPublished( self.mesh, self.geom ) name = GetName(self.geom) @@ -979,7 +979,7 @@ class StdMeshersBuilder_Prism3D(Mesh_Algorithm): ## Return 3D hypothesis holding the 1D one def Get3DHypothesis(self): if self.algoType != "RadialPrism_3D": - print "Prism_3D algorith doesn't support any hyposesis" + print("Prism_3D algorith doesn't support any hyposesis") return None return self.distribHyp @@ -987,7 +987,7 @@ class StdMeshersBuilder_Prism3D(Mesh_Algorithm): # hypothesis. Returns the created hypothesis def OwnHypothesis(self, hypType, args=[], so="libStdMeshersEngine.so"): if self.algoType != "RadialPrism_3D": - print "Prism_3D algorith doesn't support any hyposesis" + print("Prism_3D algorith doesn't support any hyposesis") return None if not self.nbLayers is None: self.mesh.GetMesh().RemoveHypothesis( self.geom, self.nbLayers ) @@ -1008,7 +1008,7 @@ class StdMeshersBuilder_Prism3D(Mesh_Algorithm): # the same parameters, else (default) - creates a new one def NumberOfLayers(self, n, UseExisting=0): if self.algoType != "RadialPrism_3D": - print "Prism_3D algorith doesn't support any hyposesis" + print("Prism_3D algorith doesn't support any hyposesis") return None self.mesh.RemoveHypothesis( self.distribHyp, self.geom ) from salome.smesh.smeshBuilder import IsEqual @@ -1024,7 +1024,7 @@ class StdMeshersBuilder_Prism3D(Mesh_Algorithm): # @param p the precision of rounding def LocalLength(self, l, p=1e-07): if self.algoType != "RadialPrism_3D": - print "Prism_3D algorith doesn't support any hyposesis" + print("Prism_3D algorith doesn't support any hyposesis") return None hyp = self.OwnHypothesis("LocalLength", [l,p]) hyp.SetLength(l) @@ -1037,7 +1037,7 @@ class StdMeshersBuilder_Prism3D(Mesh_Algorithm): # @param s the scale factor (optional) def NumberOfSegments(self, n, s=[]): if self.algoType != "RadialPrism_3D": - print "Prism_3D algorith doesn't support any hyposesis" + print("Prism_3D algorith doesn't support any hyposesis") return None if not s: hyp = self.OwnHypothesis("NumberOfSegments", [n]) @@ -1054,7 +1054,7 @@ class StdMeshersBuilder_Prism3D(Mesh_Algorithm): # @param end the length of the last segment def Arithmetic1D(self, start, end ): if self.algoType != "RadialPrism_3D": - print "Prism_3D algorith doesn't support any hyposesis" + print("Prism_3D algorith doesn't support any hyposesis") return None hyp = self.OwnHypothesis("Arithmetic1D", [start, end]) hyp.SetLength(start, 1) @@ -1068,7 +1068,7 @@ class StdMeshersBuilder_Prism3D(Mesh_Algorithm): # @param ratio the common ratio of the geometric progression def GeometricProgression(self, start, ratio ): if self.algoType != "RadialPrism_3D": - print "Prism_3D algorith doesn't support any hyposesis" + print("Prism_3D algorith doesn't support any hyposesis") return None hyp = self.OwnHypothesis("GeometricProgression", [start, ratio]) hyp.SetStartLength( start ) @@ -1081,7 +1081,7 @@ class StdMeshersBuilder_Prism3D(Mesh_Algorithm): # @param end for the length of the last segment def StartEndLength(self, start, end): if self.algoType != "RadialPrism_3D": - print "Prism_3D algorith doesn't support any hyposesis" + print("Prism_3D algorith doesn't support any hyposesis") return None hyp = self.OwnHypothesis("StartEndLength", [start, end]) hyp.SetLength(start, 1) @@ -1093,7 +1093,7 @@ class StdMeshersBuilder_Prism3D(Mesh_Algorithm): # @param fineness defines the quality of the mesh within the range [0-1] def AutomaticLength(self, fineness=0): if self.algoType != "RadialPrism_3D": - print "Prism_3D algorith doesn't support any hyposesis" + print("Prism_3D algorith doesn't support any hyposesis") return None hyp = self.OwnHypothesis("AutomaticLength") hyp.SetFineness( fineness ) @@ -1470,7 +1470,7 @@ class StdMeshersBuilder_Cartesian_3D(Mesh_Algorithm): # several functions, they must be accompanied by relative coordinates of # points dividing the whole shape into ranges where the functions apply; points # coodrinates should vary within (0.0, 1.0) range. Parameter \a t of the spacing - # function f(t) varies from 0.0 to 1.0 witin a shape range. + # function f(t) varies from 0.0 to 1.0 within a shape range. # Examples: # - "10.5" - defines a grid with a constant spacing # - [["1", "1+10*t", "11"] [0.1, 0.6]] - defines different spacing in 3 ranges. @@ -1489,7 +1489,7 @@ class StdMeshersBuilder_Cartesian_3D(Mesh_Algorithm): self.mesh.AddHypothesis( self.hyp, self.geom ) for axis, gridDef in enumerate( [xGridDef, yGridDef, zGridDef] ): - if not gridDef: raise ValueError, "Empty grid definition" + if not gridDef: raise ValueError("Empty grid definition") if isinstance( gridDef, str ): self.hyp.SetGridSpacing( [gridDef], [], axis ) elif isinstance( gridDef[0], str ): @@ -1566,7 +1566,7 @@ class StdMeshersBuilder_Cartesian_3D(Mesh_Algorithm): pass # end of StdMeshersBuilder_Cartesian_3D class ## Defines a stub 1D algorithm, which enables "manual" creation of nodes and -# segments usable by 2D algoritms +# segments usable by 2D algorithms # # It is created by calling smeshBuilder.Mesh.UseExistingSegments(geom=0) # @@ -1594,7 +1594,7 @@ class StdMeshersBuilder_UseExisting_1D(Mesh_Algorithm): pass # end of StdMeshersBuilder_UseExisting_1D class ## Defines a stub 2D algorithm, which enables "manual" creation of nodes and -# faces usable by 3D algoritms +# faces usable by 3D algorithms # # It is created by calling smeshBuilder.Mesh.UseExistingFaces(geom=0) #