Salome HOME
IPAL53051: 3D Extrusion fails
authoreap <eap@opencascade.com>
Wed, 16 Mar 2016 16:59:08 +0000 (19:59 +0300)
committereap <eap@opencascade.com>
Wed, 16 Mar 2016 16:59:08 +0000 (19:59 +0300)
+ minor doc modifs

doc/salome/examples/creating_meshes_ex02.py
doc/salome/examples/creating_meshes_ex03.py
doc/salome/gui/SMESH/images/prism_needs_hyps.png
doc/salome/gui/SMESH/input/prism_3d_algo.doc
doc/salome/gui/SMESH/input/quad_ijk_algo.doc
src/StdMeshers/StdMeshers_Prism_3D.cxx
src/StdMeshers/StdMeshers_ProjectionUtils.cxx
src/StdMeshers/StdMeshers_Projection_2D.cxx

index fe9f72f082364f2b8b9f0170f9cf7d7883cd4e22..3980d4d74ebd3b4cd1fc5f8387981bb5c5faa9bc 100644 (file)
@@ -1,4 +1,4 @@
-# Construction of a Submesh
+# Construction of a Sub-mesh
 
 import salome
 salome.salome_init()
@@ -20,27 +20,31 @@ EdgeX = geompy.GetEdgeNearPoint(box, p5)
 geompy.addToStudyInFather(box, EdgeX, "Edge [0,0,0 - 10,0,0]")
 
 # create a hexahedral mesh on the box
-quadra = smesh.Mesh(box, "Box : quadrangle 2D mesh")
+mesh = smesh.Mesh(box, "Box : hexahedral 3D mesh")
 
-# create a regular 1D algorithm for the faces
-algo1D = quadra.Segment()
+# create a Regular_1D algorithm for discretization of edges
+algo1D = mesh.Segment()
 
 # define "NumberOfSegments" hypothesis to cut
 # all the edges in a fixed number of segments
 algo1D.NumberOfSegments(4)
 
 # create a quadrangle 2D algorithm for the faces
-quadra.Quadrangle()
+mesh.Quadrangle()
 
-# construct a submesh on the edge with a local hypothesis
-algo_local = quadra.Segment(EdgeX)
+# construct a sub-mesh on the edge with a local Regular_1D algorithm
+algo_local = mesh.Segment(EdgeX)
 
-# define "Arithmetic1D" hypothesis to cut the edge in several segments with increasing arithmetic length
+# define "Arithmetic1D" hypothesis to cut EdgeX in several segments with length arithmetically
+# increasing from 1.0 to 4.0
 algo_local.Arithmetic1D(1, 4)
 
-# define "Propagation" hypothesis that propagates all other hypotheses
-# on all edges of the opposite side in case of quadrangular faces
+# define "Propagation" hypothesis that propagates algo_local and "Arithmetic1D" hypothesis
+# on all parallel edges of the box
 algo_local.Propagation()
 
+# assign a hexahedral algorithm
+mesh.Hexahedron()
+
 # compute the mesh
-quadra.Compute()
+mesh.Compute()
index 7cf85b786a4d0714564c97440e9c1670b444bf44..8687b8971a1c2cc486896492388372733252dbce 100644 (file)
@@ -1,4 +1,4 @@
-# Change priority of submeshes in Mesh
+# Change priority of sub-meshes in Mesh
 
 import salome
 salome.salome_init()
@@ -16,47 +16,44 @@ Box_1 = geompy.MakeBoxDXDYDZ(200, 200, 200)
 # create Mesh object on Box shape
 Mesh_1 = smesh.Mesh(Box_1)
 
-# assign mesh algorithms
+# assign mesh algorithms and hypotheses
 Regular_1D = Mesh_1.Segment()
 Nb_Segments_1 = Regular_1D.NumberOfSegments(20)
-Nb_Segments_1.SetDistrType( 0 )
 MEFISTO_2D = Mesh_1.Triangle()
 Max_Element_Area_1 = MEFISTO_2D.MaxElementArea(1200)
 Tetrahedron = Mesh_1.Tetrahedron()
 Max_Element_Volume_1 = Tetrahedron.MaxElementVolume(40000)
 
-# create submesh and assign algorithms on Face_1
+# create sub-mesh and assign algorithms on Face_1
 Regular_1D_1 = Mesh_1.Segment(geom=Face_1)
 Nb_Segments_2 = Regular_1D_1.NumberOfSegments(4)
-Nb_Segments_2.SetDistrType( 0 )
 MEFISTO_2D_1 = Mesh_1.Triangle(algo=smeshBuilder.MEFISTO,geom=Face_1)
-Length_From_Edges_2D = MEFISTO_2D_1.LengthFromEdges()
 SubMesh_1 = MEFISTO_2D_1.GetSubMesh()
 
-# create submesh and assign algorithms on Face_2
+# create sub-mesh and assign algorithms on Face_2
 Regular_1D_2 = Mesh_1.Segment(geom=Face_2)
 Nb_Segments_3 = Regular_1D_2.NumberOfSegments(8)
-Nb_Segments_3.SetDistrType( 0 )
 MEFISTO_2D_2 = Mesh_1.Triangle(algo=smeshBuilder.MEFISTO,geom=Face_2)
-Length_From_Edges_2D_1 = MEFISTO_2D_2.LengthFromEdges()
 SubMesh_2 = MEFISTO_2D_2.GetSubMesh()
 
-# create submesh and assign algorithms on Face_3
+# create sub-mesh and assign algorithms on Face_3
 Regular_1D_3 = Mesh_1.Segment(geom=Face_3)
 Nb_Segments_4 = Regular_1D_3.NumberOfSegments(12)
-Nb_Segments_4.SetDistrType( 0 )
 MEFISTO_2D_3 = Mesh_1.Triangle(algo=smeshBuilder.MEFISTO,geom=Face_3)
-Length_From_Edges_2D_2 = MEFISTO_2D_3.LengthFromEdges()
 SubMesh_3 = MEFISTO_2D_3.GetSubMesh()
 
-# check exisiting submesh priority order
+# check exisiting sub-mesh priority order
 [ [ SubMesh_1, SubMesh_3, SubMesh_2 ] ] = Mesh_1.GetMeshOrder()
-# set new submesh order
+isDone = Mesh_1.Compute()
+print "Nb elements at initial order of sub-meshes:", Mesh_1.NbElements()
+
+# set new sub-mesh order
 isDone = Mesh_1.SetMeshOrder( [ [ SubMesh_1, SubMesh_2, SubMesh_3 ] ])
 # compute mesh
 isDone = Mesh_1.Compute()
+print "Nb elements at new order of sub-meshes:", Mesh_1.NbElements()
 
-# clear mesh result and compute with other submesh order
-Mesh_1.Clear()
+# compute with other sub-mesh order
 isDone = Mesh_1.SetMeshOrder( [ [ SubMesh_2, SubMesh_1, SubMesh_3 ] ])
 isDone = Mesh_1.Compute()
+print "Nb elements at another order of sub-meshes:", Mesh_1.NbElements()
index 8c567809df180b98afe8c1ebf95f78bfffd5b275..d56d4309994ece8cc91152d868f6b85e47898f55 100644 (file)
Binary files a/doc/salome/gui/SMESH/images/prism_needs_hyps.png and b/doc/salome/gui/SMESH/images/prism_needs_hyps.png differ
index d377b549fba48f3514c584d8c461a661ece47d78..71ba2a9125d6d26b4fbd0807a2597e8f8ecb2b38 100644 (file)
@@ -41,7 +41,8 @@ The \b Global algorithms and hypotheses to be chosen at
 <li> 1D algorithm and hypothesis that will be applied for meshing
   (logically) vertical edges of the prism (which connect the top and the
   base faces of the prism). In the sample picture above these are
-  "Regular_1D" algorithm and "Nb. Segments_1" hypothesis.</li>
+  "Regular_1D" algorithm and "Nb. Segments" hypothesis named "Vertical
+  Nb. Segments".</li>
 </ul>
 
 The \b Local algorithms and hypotheses to be chosen at 
@@ -51,9 +52,9 @@ The \b Local algorithms and hypotheses to be chosen at
     meshing the top and the base prism 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, "BLSURF" algorithm meshes
-    "Face_1" base surface with triangles. (1D algorithm is not
-    assigned as "BLSURF" does not require divided edges to create a 2D mesh.)
+    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.)
   </li>
   <li> Optionally you can define a 1D sub-mesh on some vertical edges
     of stacked prisms, which will override the global 1D hypothesis mentioned
index 1ba49dd831126b3ad473c17b1802d7fbfebba876..90e7eea94213266497f5561a433bd422593f77f1 100644 (file)
@@ -20,8 +20,8 @@ The algorithm treats any face as quadrangle. If a face is bound by
 more than four edges, four most sharp vertices are considered as
 corners of the quadrangle and all edges between these vertices are
 treated as quadrangle sides. In the case of three edges, the vertex
-specified by the user is considered as a degenerated side of the
-quadrangle. 
+specified by the user is considered as a fourth degenerated side of the
+quadrangle.
 
 \image html quad_meshes.png "Algorithm generates a structured mesh on complex faces provided that edges are properly discretized"
 
index d2413b56469081654c7e11fe7de8133d3666a167..5c0a5af0f29f951674211b4567b8f28a3b7de226 100644 (file)
@@ -1330,7 +1330,7 @@ bool StdMeshers_Prism_3D::compute(const Prism_3D::TPrismTopo& thePrism)
 
   // update state of sub-meshes (mostly in order to erase improper errors)
   SMESH_subMesh* sm = myHelper->GetMesh()->GetSubMesh( thePrism.myShape3D );
-  SMESH_subMeshIteratorPtr smIt = sm->getDependsOnIterator(/*includeSelf=*/false);
+  SMESH_subMeshIteratorPtr smIt = sm->getDependsOnIterator(/*includeSelf=*/true);
   while ( smIt->more() )
   {
     sm = smIt->next();
index 51a6398690b0a87fddc2df6443ec7cd0dc8019a6..06aa33a57e792b714b95650ea3004f00cecad35c 100644 (file)
@@ -1868,7 +1868,7 @@ StdMeshers_ProjectionUtils::GetPropagationEdge( SMESH_Mesh*                 aMes
             int prevChainSize = aChain.Extent();
             if ( aChain.Add(anOppE) > prevChainSize ) { // ... anOppE is not in aChain
               // Add found edge to the chain oriented so that to
-              // have it co-directed with a forward MainEdge
+              // have it co-directed with a fromEdge
               TopAbs_Orientation ori = anE.Orientation();
               if ( anOppE.Orientation() == fourEdges[found].Orientation() )
                 ori = TopAbs::Reverse( ori );
@@ -1931,7 +1931,7 @@ FindMatchingNodesOnFaces( const TopoDS_Face&     face1,
 
   helper1.SetSubShape( face1 );
   helper2.SetSubShape( face2 );
-  if ( helper1.HasSeam() != helper2.HasSeam() )
+  if ( helper1.HasRealSeam() != helper2.HasRealSeam() )
     RETURN_BAD_RESULT("Different faces' geometry");
 
   // Data to call SMESH_MeshEditor::FindMatchingNodes():
index 66c8936280fb7271407aa60b095616cb84c763ae..648510c94af2315add439def074434488040267a 100644 (file)
@@ -821,8 +821,8 @@ namespace {
         // find trsf
         const int totNbSeg = 50;
         vector< gp_XY > srcPnts, tgtPnts;
-        srcPnts.resize( totNbSeg );
-        tgtPnts.resize( totNbSeg );
+        srcPnts.reserve( totNbSeg );
+        tgtPnts.reserve( totNbSeg );
         for ( size_t iW = 0; iW < srcWires.size(); ++iW )
         {
           const double minSegLen = srcWires[iW]->Length() / totNbSeg;
@@ -1392,10 +1392,19 @@ bool StdMeshers_Projection_2D::Compute(SMESH_Mesh& theMesh, const TopoDS_Shape&
         }
       }
     }
-    else if ( nbEdgesInWires.front() == 1 )
+    else if ( nbEdgesInWires.front() == 1 ) // a sole edge in a wire
     {
-      // TODO::Compare orientation of curves in a sole edge
-      //RETURN_BAD_RESULT("Not implemented case");
+      TopoDS_Edge srcE1 = srcEdges.front(), tgtE1 = tgtEdges.front();
+      for ( size_t iW = 0; iW < srcWires.size(); ++iW )
+      {
+        StdMeshers_FaceSidePtr srcWire = srcWires[iW];
+        for ( int iE = 0; iE < srcWire->NbEdges(); ++iE )
+          if ( srcE1.IsSame( srcWire->Edge( iE )))
+          {
+            reverse = ( tgtE1.Orientation() != tgtWires[iW]->Edge( iE ).Orientation() );
+            break;
+          }
+      }
     }
     else
     {