Salome HOME
Minor DOC changes
authoreap <eap@opencascade.com>
Thu, 26 May 2016 14:38:08 +0000 (17:38 +0300)
committereap <eap@opencascade.com>
Thu, 26 May 2016 14:38:08 +0000 (17:38 +0300)
doc/salome/examples/3dmesh.py
doc/salome/gui/SMESH/input/smeshpy_interface.doc
doc/salome/gui/SMESH/input/tui_work_on_objects_from_gui.doc
src/SMESH/SMESH_MeshEditor.cxx

index 57a1440e0c554951fd92a49147ae2d8e8bb94216..665534d80700f9e58784827da94735f56ff3976c 100644 (file)
@@ -1,4 +1,4 @@
-# 3d mesh generation
+# 3d mesh generation and mesh exploration
 
 import salome
 salome.salome_init()
@@ -76,3 +76,20 @@ tetra.Compute()
 
 # Create a mesh group of all triangles generated on geom faces present in faces_group
 group = tetra.Group(faces_group)
+
+###
+# Explore the mesh
+###
+
+# Retrieve coordinates of nodes
+coordStr = ""
+for node in tetra.GetNodesId():
+    x,y,z = tetra.GetNodeXYZ( node )
+    coordStr += "%s (%s, %s, %s) " % ( node, x,y,z )
+    pass
+
+# Retrieve nodal connectivity of triangles
+triaStr = ""
+for tria in tetra.GetElementsByType( SMESH.FACE ):
+    nodes = tetra.GetElemNodes( tria )
+    triaStr += "%s (%s, %s, %s) " % ( tria, nodes[0], nodes[1], nodes[2] )
index 92bd2f41da0aaaec4e1355ffcb97bafb05046bee..bbb287f2fb5433a0027ed990dacd3c64757a88e7 100644 (file)
@@ -18,7 +18,7 @@ in the \ref smeshBuilder and \ref StdMeshersBuilder Python packages.
 Class \ref smeshBuilder.smeshBuilder "smeshBuilder" provides an interface to create and handle
 meshes. It can be used to create an empty mesh or to import mesh from the data file.
 
-As soon as mesh is created, it is possible to manage it via its own
+As soon as mesh is created, it is possible to manage it via its own
 methods, described in class \ref smeshBuilder.Mesh "Mesh" documentation.
 
 Class \ref smeshstudytools.SMeshStudyTools "SMeshStudyTools" provides several methods to manipulate mesh objects in Salome study. 
@@ -57,7 +57,7 @@ A usual workflow to generate a mesh on geometry is following:
     <pre>
       \ref Mesh.Compute "mesh.Compute"()
     </pre>
-    </li>
+  </li>
 </ol>
 
 An easiest way to start with Python scripting is to do something in
@@ -68,7 +68,8 @@ by calling \a dir() Python built-in function.
 
 All methods of the Mesh Group can be found in \ref tui_create_standalone_group sample script.
 
-An example below demonstrates usage of the Python API for 3d mesh generation. 
+An example below demonstrates usage of the Python API for 3d mesh
+generation and for retrieving information on mesh nodes and elements.
 
 \anchor example_3d_mesh
 <h2>Example of 3d mesh generation:</h2>
index 569d821a91f89bb732c02ae920f71e071aa4a3ac..ddd1658a7f54985e28cf3eaca0ef1ed882a8ebc3 100644 (file)
@@ -4,16 +4,23 @@
 
 It is sometimes useful to work alternatively in the GUI of SALOME and in the Python Console. To fetch an object from the TUI simply type:
 
-\code
-myMesh_ref = salome.IDToObject("ID")  
-// were ID is the string looking like "0:1:2:3" that appears in the object browser in the Entry column 
-// ( If hidden show it by right clicking and checking the checkbox Entry)
+\code{.py}
+myMesh_ref = salome.IDToObject( ID )
+# were ID is a string looking like "0:1:2:3" that appears in the Object Browser in the Entry column.
+# ( If hidden, show it by right clicking and checking the checkbox Entry )
 myMesh = smesh.Mesh(myMesh_ref)
 \endcode
 or 
-\code
+\code{.py}
 myMesh_ref = salome.myStudy.FindObjectByPath("/Mesh/myMesh").GetObject() 
-// "/Mesh/myMesh" is the path to the desired object in the object browser
+#'/Mesh/myMesh' is a path to the desired object in the Object Browser
+myMesh = smesh.Mesh(myMesh_ref)
+\endcode
+or 
+\code{.py}
+# get a selected mesh
+from salome.gui import helper
+myMesh_ref = helper.getSObjectSelected()[0].GetObject() 
 myMesh = smesh.Mesh(myMesh_ref)
 \endcode
 
index e4f2bda0016f622017fc722f46e86d4370c17b7b..5969649c0fc4d14099f0a406c5f5c71c6da239f4 100644 (file)
@@ -2124,7 +2124,7 @@ namespace
 
     // No adjacent prisms. Select a variant with a best aspect ratio.
 
-    double badness[2] = { 0, 0 };
+    double badness[2] = { 0., 0. };
     static SMESH::Controls::NumericalFunctorPtr aspectRatio( new SMESH::Controls::AspectRatio);
     const SMDS_MeshNode** nodes = vol.GetNodes();
     for ( int variant = 0; variant < nbVariants; ++variant )