Salome HOME
Fix MinDistance for node-group (SALOME_TESTS/Grids/smesh/imps_09/K0) V9_3_0a2
authoreap <eap@opencascade.com>
Wed, 6 Mar 2019 13:59:54 +0000 (16:59 +0300)
committereap <eap@opencascade.com>
Wed, 6 Mar 2019 13:59:54 +0000 (16:59 +0300)
+ Minor doc improvement

doc/salome/gui/SMESH/input/modules.rst
doc/salome/gui/SMESH/input/smesh_module.rst
doc/salome/gui/SMESH/input/smeshpy_interface.rst
src/SMESHUtils/SMESH_MeshAlgos.cxx
src/SMESHUtils/SMESH_PolyLine.cxx
src/SMESH_SWIG/smeshBuilder.py

index 6c673f6dbfb4513273465e79ca5e765cffa01194..88d2d2dc44dbccd6249431960887508a4fb7479d 100644 (file)
@@ -169,14 +169,16 @@ Creating groups
    Mesh.MakeGroupByCriteria
    Mesh.MakeGroupByFilter
    Mesh.FaceGroupsSeparatedByEdges
+   Mesh.CreateDimGroup
+   Mesh.ConvertToStandalone
    Mesh.GetGroups
    Mesh.NbGroups
    Mesh.GetGroupNames
    Mesh.GetGroupByName
 
 
-Using operations on groups
-==========================
+Operations on groups
+====================
 
 .. autosummary::
 
@@ -186,8 +188,6 @@ Using operations on groups
    Mesh.IntersectListOfGroups
    Mesh.CutGroups
    Mesh.CutListOfGroups
-   Mesh.CreateDimGroup
-   Mesh.ConvertToStandalone
 
 Deleting Groups
 ===============
@@ -204,6 +204,8 @@ Mesh Information
 .. autosummary::
 
    smeshBuilder.GetMeshInfo
+   Mesh.GetEngine
+   Mesh.GetGeomEngine
    Mesh.GetGeometryByMeshElement
    Mesh.MeshDimension
    Mesh.GetMeshInfo
@@ -269,6 +271,7 @@ Mesh Information
    Mesh.FindNodeClosestTo
    Mesh.FindElementsByPoint
    Mesh.GetPointState
+   Mesh.Get1DBranches
    Mesh.Dump
 
 ******************************
@@ -352,6 +355,7 @@ Adding nodes and elements
    Mesh.Make2DMeshFrom3D
    Mesh.MakeBoundaryMesh
    Mesh.MakeBoundaryElements
+   Mesh.Append
    Mesh.GetLastCreatedNodes
    Mesh.GetLastCreatedElems
    Mesh.ClearLastCreated
index 1178488c8daa3f0e47ec7957ca21a8e4a24e0c61..831452e430e1482eadcf5515e37617236998b3b3 100644 (file)
@@ -791,7 +791,11 @@ SMESH_GroupBase
 
 .. py:class:: SMESH_GroupBase
 
-   :doc:`Mesh group <grouping_elements>`
+   :doc:`Mesh group <grouping_elements>`. 
+   Base class of :class:`standalone group <SMESH_Group>`, 
+   :class:`group on geometry <SMESH_GroupOnGeom>` and 
+   :class:`group on filter <SMESH_GroupOnFilter>`.
+   Inherit all methods from :class:`SMESH_IDSource`.
 
    .. py:function:: SetName( name )
 
index 922a1e2b785495704861ac64c72d1c5556b56ee0..a08cb2d0ab0207d03c82a4f8898815bba22873b4 100644 (file)
@@ -55,7 +55,7 @@ A usual workflow to generate a mesh on geometry is following:
                netgen.SetMaxSize( 20. )
                netgen.SetFineness( smeshBuilder.VeryCoarse )
   
-#. :ref:`compute_anchor` the mesh (generate mesh nodes and elements):
+#. :ref:`Compute the mesh <compute_anchor>` (generate mesh nodes and elements):
        .. code-block:: python
 
                mesh.Compute()
@@ -66,10 +66,10 @@ GUI and then to get a corresponding Python script via
 all methods of any object in hand (e.g. a mesh group or a hypothesis)
 by calling *dir()* Python built-in function.
 
-All methods of the Mesh Group can be found in :ref:`tui_create_standalone_group` sample script.
+All methods of the :class:`Mesh Group <SMESH.SMESH_GroupBase>` can be found in :ref:`tui_create_standalone_group` sample script.
 
 An example below demonstrates usage of the Python API for 3D mesh
-generation and for retrieving information on mesh nodes and elements.
+generation and for retrieving basic information on mesh nodes, elements and groups.
 
 .. _example_3d_mesh:
 
index 55c5f50253bed26288668235f25414c9e26e4549..a2c9c10368fe357f5ee0c6011b6ac255774f8ff5 100644 (file)
@@ -238,6 +238,7 @@ namespace // Utils used in SMESH_ElementSearcherImpl::FindElementsByPoint()
     void getElementsInBox    ( const Bnd_B3d& box,  TElemSeq& foundElems );
     void getElementsInSphere ( const gp_XYZ& center, const double radius, TElemSeq& foundElems );
     ElementBndBoxTree* getLeafAtPoint( const gp_XYZ& point );
+    int  getNbElements();
 
   protected:
     ElementBndBoxTree() {}
@@ -466,6 +467,27 @@ namespace // Utils used in SMESH_ElementSearcherImpl::FindElementsByPoint()
     return 0;
   }
 
+  //================================================================================
+  /*!
+   * \brief Return number of elements
+   */
+  //================================================================================
+
+  int ElementBndBoxTree::getNbElements()
+  {
+    int nb = 0;
+    if ( isLeaf() )
+    {
+      nb = _elements.size();
+    }
+    else
+    {
+      for (int i = 0; i < 8; i++)
+        nb += ((ElementBndBoxTree*) myChildren[i])->getNbElements();
+    }
+    return nb;
+  }
+
   //================================================================================
   /*!
    * \brief Construct the element box
@@ -1302,6 +1324,23 @@ gp_XYZ SMESH_ElementSearcherImpl::Project(const gp_Pnt&            point,
       minDist = d;
     }
   }
+  if ( minDist > radius )
+  {
+    ElementBndBoxTree::TElemSeq elems2;
+    ebbTree->getElementsInSphere( p, minDist, elems2 );
+    for ( e = elems2.begin(); e != elems2.end(); ++e )
+    {
+      if ( elems.count( *e ))
+        continue;
+      double d = SMESH_MeshAlgos::GetDistance( *e, point, &proj );
+      if ( d < minDist )
+      {
+        bestProj = proj;
+        elem = *e;
+        minDist = d;
+      }
+    }
+  }
   if ( closestElem ) *closestElem = elem;
 
   return bestProj;
index b244a7560e99a2a3227776a50b61fd61e40ffa03..82ace285912eba5086e0b76940d3397ee20027bc 100644 (file)
@@ -154,7 +154,10 @@ namespace
       if ( !path.SetCutAtCorner( cornerNode, fIt->next(), plnNorm, plnOrig ))
         continue;
 
-      if ( !myAvoidSet.insert( path.myNode1.Node() ).second ||
+      if ( path.myDot1 == 0 &&
+           !myAvoidSet.insert( path.myNode1.Node() ).second )
+        continue;
+      if ( path.myDot2 == 0 &&
            !myAvoidSet.insert( path.myNode2.Node() ).second )
         continue;
 
index 64ee3091fac4d11ff59c6b0682d2f9bfb3cc2865..cf5facce8bf828eb22d885810a5953152efc049a 100644 (file)
@@ -4384,7 +4384,8 @@ class Mesh(metaclass = MeshMeta):
 
         Returns:
              A list of edge groups and a list of corresponding node groups,
-             where the group is a list of IDs of edges or elements.
+             where the group is a list of IDs of edges or elements, like follows
+             [[[branch_edges_1],[branch_edges_2]], [[branch_nodes_1],[branch_nodes_2]]].
              If a group is closed, the first and last nodes of the group are same.
         """
         if isinstance( edges, Mesh ):
@@ -6947,7 +6948,7 @@ class Mesh(metaclass = MeshMeta):
 
     def GetLength(self, elemId=None):
         """
-        Get length of all given 1D elements or sum length of all 1D mesh elements
+        Get length of given 1D elements or of all 1D mesh elements
 
         Parameters:
             elemId: either a mesh element ID or a list of IDs or :class:`sub-mesh, group or filter <SMESH.SMESH_IDSource>`. By default sum length of all 1D elements will be calculated.
@@ -6977,7 +6978,7 @@ class Mesh(metaclass = MeshMeta):
 
     def GetArea(self, elemId=None):
         """
-        Get area of given 2D elements or sum area of all 2D mesh elements
+        Get area of given 2D elements or of all 2D mesh elements
 
         Parameters:
             elemId: either a mesh element ID or a list of IDs or :class:`sub-mesh, group or filter <SMESH.SMESH_IDSource>`. By default sum area of all 2D elements will be calculated.
@@ -7007,7 +7008,7 @@ class Mesh(metaclass = MeshMeta):
 
     def GetVolume(self, elemId=None):
         """
-        Get volume of a 3D element or sum of volumes of all 3D mesh elements
+        Get volume of given 3D elements or of all 3D mesh elements
 
         Parameters:
             elemId: either a mesh element ID or a list of IDs or :class:`sub-mesh, group or filter <SMESH.SMESH_IDSource>`. By default sum volume of all 3D elements will be calculated.