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::
Mesh.IntersectListOfGroups
Mesh.CutGroups
Mesh.CutListOfGroups
- Mesh.CreateDimGroup
- Mesh.ConvertToStandalone
Deleting Groups
===============
.. autosummary::
smeshBuilder.GetMeshInfo
+ Mesh.GetEngine
+ Mesh.GetGeomEngine
Mesh.GetGeometryByMeshElement
Mesh.MeshDimension
Mesh.GetMeshInfo
Mesh.FindNodeClosestTo
Mesh.FindElementsByPoint
Mesh.GetPointState
+ Mesh.Get1DBranches
Mesh.Dump
******************************
Mesh.Make2DMeshFrom3D
Mesh.MakeBoundaryMesh
Mesh.MakeBoundaryElements
+ Mesh.Append
Mesh.GetLastCreatedNodes
Mesh.GetLastCreatedElems
Mesh.ClearLastCreated
.. 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 )
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()
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:
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() {}
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
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;
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;
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 ):
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.
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.
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.