Salome HOME
Merge from V6_main 11/02/2013
[modules/smesh.git] / doc / salome / examples / modifying_meshes_ex24.py
diff --git a/doc/salome/examples/modifying_meshes_ex24.py b/doc/salome/examples/modifying_meshes_ex24.py
new file mode 100644 (file)
index 0000000..d07a7ca
--- /dev/null
@@ -0,0 +1,21 @@
+# Revolution
+
+import math
+import SMESH
+
+import SMESH_mechanic
+
+mesh  = SMESH_mechanic.mesh
+smesh = SMESH_mechanic.smesh
+
+# create a group of faces to be revolved
+FacesRotate = [492, 493, 502, 503]
+GroupRotate = mesh.CreateEmptyGroup(SMESH.FACE,"Group of faces (rotate)")
+GroupRotate.Add(FacesRotate)
+
+# define revolution angle and axis
+angle45 = 45 * math.pi / 180
+axisXYZ = SMESH.AxisStruct(-38.3128, -73.3658, -23.321, -13.3402, -13.3265, 6.66632)
+
+# perform revolution of an object
+mesh.RotationSweepObject(GroupRotate, axisXYZ, angle45, 4, 1e-5)