Structurally, the sub-mesh is a mesh on a certain sub-shape, or a group of
sub-shapes, possibly generated using different meshing algorithms
and/or hypotheses than those used to generate the mesh on other
-sub-shapes.
+sub-shapes. Elements generated on a sub-shape can be retrieved without
+explicit creation of a sub-mesh by creating a *Group on Geometry* using
+:ref:`Create Groups from Geometry <create_groups_from_geometry_page>` dialog.
Creation of a sub-mesh allows to control individually meshing of a
certain sub-shape, thus to get a locally coarser or finer mesh, to get
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
+An example below demonstrates usage of the Python API for 3D mesh
generation and for retrieving information on mesh nodes and elements.
.. _example_3d_mesh:
bool ElementsOnShape::Classifier::isOutOfSolid (const gp_Pnt& p)
{
+ if ( isOutOfBox( p )) return true;
mySolidClfr->Perform( p, myTol );
return ( mySolidClfr->State() != TopAbs_IN && mySolidClfr->State() != TopAbs_ON );
}
bool ElementsOnShape::Classifier::isOutOfFace (const gp_Pnt& p)
{
+ if ( isOutOfBox( p )) return true;
myProjFace.Perform( p );
if ( myProjFace.IsDone() && myProjFace.LowerDistance() <= myTol )
{
bool ElementsOnShape::Classifier::isOutOfEdge (const gp_Pnt& p)
{
+ if ( isOutOfBox( p )) return true;
myProjEdge.Perform( p );
return ! ( myProjEdge.NbPoints() > 0 && myProjEdge.LowerDistance() <= myTol );
}
namespace
{
- enum { GroupOnFilter_OutOfDate = -1 };
+ enum { GroupOnFilter_OutOfDate = -777 };
// a map to count not yet loaded meshes
static std::map< int, int > theStudyIDToMeshCounter;
std::vector<int> data;
for ( size_t i = 0; i < meshInfo->length(); ++i )
- if ( meshInfo[i] > 0 )
+ if ( meshInfo[i] > 0 || meshInfo[i] == GroupOnFilter_OutOfDate )
{
data.push_back( DriverMED::GetMedGeoType( SMDSAbs_EntityType( i ))); //medTypes[ i ] );
data.push_back( meshInfo[ i ] );