diff --git a/doc/salome/gui/SMESH/images/topo_equality.png b/doc/salome/gui/SMESH/images/topo_equality.png
new file mode 100644
index 000000000..119251a31
Binary files /dev/null and b/doc/salome/gui/SMESH/images/topo_equality.png differ
diff --git a/doc/salome/gui/SMESH/input/constructing_submeshes.doc b/doc/salome/gui/SMESH/input/constructing_submeshes.doc
index 43f99e5c5..04000e582 100644
--- a/doc/salome/gui/SMESH/input/constructing_submeshes.doc
+++ b/doc/salome/gui/SMESH/input/constructing_submeshes.doc
@@ -2,6 +2,8 @@
\page constructing_submeshes_page Constructing sub-meshes
+\tableofcontents
+
By purpose, the sub-mesh is an object used to assign to a sub-shape
different meshing parameters than those assigned to the main shape.
@@ -14,6 +16,8 @@ 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
elements of different types in the same mesh, etc.
+\section submesh_shape_section How to get a sub-shape for sub-mesh construction
+
A sub-shape to create a sub-mesh on should be retrieved from the main shape
in one of the following ways:
- In Geometry module, via New Entity > Explode menu.
@@ -27,6 +31,8 @@ in one of the following ways:
dialog showing \ref meshing_failed_anchor "meshing errors".
+\section submesh_priority How hypotheses are selected among sub-meshes
+
Internally, definition of meshing parameters to apply for
discretization of a certain sub-shape, for example an edge of a
compound of solids, starts from searching an algorithm, 1D as for the
@@ -62,6 +68,8 @@ an edge, the hypothesis assigned to a sub-shape with a lower ID will
be used for meshing. You can \ref submesh_order_anchor "change" mutual
priority of such concurrent sub-meshes.
+\section submesh_definition How to construct a sub-mesh
+
\n Construction of a sub-mesh consists of:
- Selecting a mesh which will encapsulate the sub-mesh
@@ -123,6 +131,8 @@ ID in Element ID field.
with which the sub-shape will appear in the Object Browser (if not yet
there).
+\section submesh_tree Sub-mesh in the Object Browser
+
In the Object Browser the structure of the new sub-mesh will be
displayed as follows:
@@ -133,9 +143,9 @@ It contains:
- a sub-mesh name (\a SubMeshFace1)
- a reference to the geometrical object on the basis of which the
sub-mesh has been constructed (Cylindrical Face_1);
-- Applied hypotheses folder containing the references to the
+
- Applied hypotheses folder containing references to
hypotheses assigned to the sub-mesh;
-- Applied algorithms folder containing the references to the
+
- Applied algorithms folder containing references to
algorithms assigned to the sub-mesh.
diff --git a/doc/salome/gui/SMESH/input/prism_3d_algo.doc b/doc/salome/gui/SMESH/input/prism_3d_algo.doc
index 71ba2a912..5f98399c7 100644
--- a/doc/salome/gui/SMESH/input/prism_3d_algo.doc
+++ b/doc/salome/gui/SMESH/input/prism_3d_algo.doc
@@ -49,21 +49,35 @@ The \b Local algorithms and hypotheses to be chosen at
\ref constructing_submeshes_page "Construction of sub-meshes" are:
- 1D and 2D algorithms and hypotheses that will be applied for
- meshing the top and the base prism faces. These faces can be meshed
+ meshing the top and the base prism
+ \ref submesh_shape_section "faces". These faces can be meshed
with any type of 2D elements: quadrangles, triangles, polygons or
- their mix. It is enough to define a sub-mesh on either the top or the base
- face. In the sample picture above, "NETGEN_1D2D" algorithm meshes
- "bottom disk" face with triangles. (1D algorithm is not
- assigned as "NETGEN_1D2D" does not require divided edges to create a 2D mesh.)
+ their mix. It is enough to define a sub-mesh on either the top or
+ the base face. In the sample picture above, "NETGEN_1D2D"
+ algorithm meshes "bottom disk" face with triangles. (1D algorithm
+ is not assigned as "NETGEN_1D2D" does not require divided edges to
+ create a 2D mesh.)
- - Optionally you can define a 1D sub-mesh on some vertical edges
- of stacked prisms, which will override the global 1D hypothesis mentioned
- above. In the Prism stacks picture, the
- vertical division is not equidistant on the whole length because
- a "Number Of Segments" hypothesis with Scale Factor=3 is assigned to
- the highlighted edge.
+
- Optionally you can define a 1D sub-mesh on some vertical
+ \ref submesh_shape_section "edges" of stacked prisms, which will
+ override the global 1D hypothesis mentioned above. In the Prism
+ stacks picture, the vertical division is not equidistant on
+ the whole length because a "Number Of Segments" hypothesis with
+ Scale Factor=3 is assigned to the highlighted edge.
+If 3D extrusion algorithm is assigned to a sub-mesh in a mesh
+with multiple sub-meshes, the described above approach may not work as
+expected. For example the bottom face may be meshed by other algorithm
+before 3D extrusion have a chance to project a mesh from the
+base face. This thing can happen with vertical edges as well. All
+these can lead to either a meshing failure or to an incorrect meshing.
+
+In such a case, it's necessary to explicitly define algorithms
+that 3D extrusion implicitly applies in a simple case:
+- assign \ref projection_1D2D algorithm to the top face and
+- assign a 1D algorithm to a group of all vertical edges.
+
\image html image157.gif "Prism with 3D extrusion meshing. Vertical division is different on neighbor edges because several local 1D hypotheses are assigned."
\sa a sample TUI Script of
diff --git a/doc/salome/gui/SMESH/input/projection_algos.doc b/doc/salome/gui/SMESH/input/projection_algos.doc
index 4e5b6e90d..de11a7ee0 100644
--- a/doc/salome/gui/SMESH/input/projection_algos.doc
+++ b/doc/salome/gui/SMESH/input/projection_algos.doc
@@ -2,9 +2,20 @@
\page projection_algos_page Projection Algorithms
-\n Projection algorithms allow to define the mesh of a geometrical
+\tableofcontents
+
+Projection algorithms allow to define the mesh of a geometrical
object by the projection of another already meshed geometrical object.
+\note Source and target geometrical objects mush be topologically
+equal, i.e. they must have same number of sub-shapes, connected to
+corresponding counterparts.
+
+\image html topo_equality.png Topologically equal faces suitable for 2D projection.
+
+
+\section projection_1D Projection 1D
+
Projection 1D algorithm allows to define the mesh of an edge
(or group of edges)
by the projection of another already meshed edge (or group of edges).
@@ -34,6 +45,8 @@ vertices are specified, the edges in the group must be connected.
The source and target groups must contain equal number of edges
and they must form topologically equal structures.
+\section projection_2D Projection 2D
+
\n Projection 2D algorithm allows to define the mesh of a face
(or group of faces) by the projection of another already meshed face
(or group of faces). This algorithm works only if all edges of the
@@ -64,12 +77,16 @@ The groups of faces are suitable for this algorithm only if they
contain an equal number of faces and form topologically equal
structures.
-\n Projection 1D-2D algorithm differs from Projection 2D
-algorithm in one aspect: it generates mesh segments on edges of
-the face according to the projected 2D elements; thus it does not
-require the edges to be meshed by any other 1D algorithm; moreover it
-does not allow to mesh edges of the face using another algorithm via
-definition of sub-meshes.
+\section projection_1D2D Projection 1D-2D
+
+\n Projection 1D-2D algorithm differs from
+\ref projection_2D algorithm in one aspect: it generates mesh segments
+on edges of the face according to the projected 2D elements; thus it
+does not require the edges to be meshed by any other 1D algorithm;
+moreover it does not allow to mesh edges of the face using another
+algorithm via definition of sub-meshes.
+
+\section projection_3D Projection 3D
\n Projection 3D algorithm allows to define the mesh of a shape by
the projection of another already meshed shape. This algorithm works
diff --git a/src/SMESH/SMESH_subMesh.cxx b/src/SMESH/SMESH_subMesh.cxx
index 5bb8a34b3..128316dcf 100644
--- a/src/SMESH/SMESH_subMesh.cxx
+++ b/src/SMESH/SMESH_subMesh.cxx
@@ -2079,10 +2079,10 @@ TopoDS_Shape SMESH_subMesh::getCollection(SMESH_Gen * theGen,
const TopoDS_Shape& S = subMesh->_subShape;
if ( S.ShapeType() != this->_subShape.ShapeType() )
continue;
- theSubs.push_back( subMesh );
if ( subMesh == this )
{
aBuilder.Add( aCompound, S );
+ theSubs.push_back( subMesh );
}
else if ( subMesh->GetComputeState() == READY_TO_COMPUTE )
{
@@ -2093,6 +2093,7 @@ TopoDS_Shape SMESH_subMesh::getCollection(SMESH_Gen * theGen,
aBuilder.Add( aCompound, S );
if ( !subMesh->SubMeshesComputed() )
theSubComputed = false;
+ theSubs.push_back( subMesh );
}
}
}
diff --git a/src/SMESHUtils/SMESH_MeshAlgos.cxx b/src/SMESHUtils/SMESH_MeshAlgos.cxx
index aa702977d..e65e20114 100644
--- a/src/SMESHUtils/SMESH_MeshAlgos.cxx
+++ b/src/SMESHUtils/SMESH_MeshAlgos.cxx
@@ -1252,6 +1252,7 @@ bool SMESH_MeshAlgos::IsOut( const SMDS_MeshElement* element, const gp_Pnt& poin
bool covexCorner = ( edgeNorm * edgeAdjacent * (rClosest==1. ? 1. : -1.)) < 0;
return covexCorner ? (out || out2) : (out && out2);
}
+
if ( element->GetType() == SMDSAbs_Edge ) // --------------------------------------------------
{
// point is out of edge if it is NOT ON any straight part of edge
@@ -1279,6 +1280,7 @@ bool SMESH_MeshAlgos::IsOut( const SMDS_MeshElement* element, const gp_Pnt& poin
}
return true;
}
+
// Node or 0D element -------------------------------------------------------------------------
{
gp_Vec n2p ( xyz[0], point );