Salome HOME
Issue 0020580: Correcting documentation for user preferences
[modules/smesh.git] / doc / salome / gui / SMESH / input / tui_modifying_meshes.doc
index 342968ff78b2d14bc57800ec5f1c6a737bb5a0a3..66b6361fa0b724214ad4fc2481bc234471388625 100644 (file)
@@ -742,6 +742,7 @@ salome.sg.updateObjBrowser(1)
 
 \code
 import math
+import SMESH
 
 import SMESH_mechanic
 
@@ -750,7 +751,7 @@ smesh = SMESH_mechanic.smesh
 
 # create a group of faces to be revolved
 FacesRotate = [492, 493, 502, 503]
-GroupRotate = mesh.CreateGroup(SMESH.FACE,"Group of faces (rotate)")
+GroupRotate = mesh.CreateEmptyGroup(SMESH.FACE,"Group of faces (rotate)")
 GroupRotate.Add(FacesRotate)
 
 # define revolution angle and axis
@@ -814,4 +815,48 @@ isDone = pattern.MakeMesh(Mesh_1.GetMesh(), 0, 0)
 if (isDone != 1): print 'MakeMesh :', pattern.GetErrorCode()  
 \endcode
 
-*/
\ No newline at end of file
+<br>
+\anchor tui_quadratic
+<h2>Convert mesh to/from quadratic</h2>
+
+\code
+import geompy
+import smesh
+
+# create sphere of radius 100
+
+Sphere = geompy.MakeSphereR( 100 )
+geompy.addToStudy( Sphere, "Sphere" )
+
+# create simple trihedral mesh
+
+Mesh = smesh.Mesh(Sphere)
+Regular_1D = Mesh.Segment()
+Nb_Segments = Regular_1D.NumberOfSegments(5)
+MEFISTO_2D = Mesh.Triangle()
+Tetrahedron_Netgen = Mesh.Tetrahedron(algo=smesh.NETGEN)
+
+# compute mesh
+
+isDone = Mesh.Compute()
+
+# convert to quadratic
+# theForce3d = 1; this results in the medium node lying at the
+# middle of the line segments connecting start and end node of a mesh
+# element
+
+Mesh.ConvertToQuadratic( theForce3d=1 )
+
+# revert back to the non-quadratic mesh
+
+Mesh.ConvertFromQuadratic()
+
+# convert to quadratic
+# theForce3d = 0; this results in the medium node lying at the
+# geometrical edge from which the mesh element is built
+
+Mesh.ConvertToQuadratic( theForce3d=0 )
+
+\endcode
+
+*/