\anchor tui_quadrangle_parameters
<h2>Quadrangle Parameters example </h2>
\code
-import geompy
-import smesh
-import StdMeshers
+from smesh import *
+SetCurrentStudy(salome.myStudy)
# Get 1/4 part from the disk face.
Box_1 = geompy.MakeBoxDXDYDZ(100, 100, 100)
# Set the Geometry for meshing
Mesh_1 = smesh.Mesh(Common_1)
-# Create Quadrangle parameters and define the Base Vertex.
-Quadrangle_Parameters_1 = smesh.CreateHypothesis('QuadrangleParams')
-Quadrangle_Parameters_1.SetTriaVertex( 8 )
# Define 1D hypothesis and cmpute the mesh
Regular_1D = Mesh_1.Segment()
Nb_Segments_1 = Regular_1D.NumberOfSegments(10)
Nb_Segments_1.SetDistrType( 0 )
-status = Mesh_1.AddHypothesis(Quadrangle_Parameters_1)
-Quadrangle_2D = Mesh_1.Quadrangle()
+
+# Create Quadrangle parameters and define the Base Vertex.
+Quadrangle_2D = Mesh_1.Quadrangle().TriangleVertex( 8 )
+
Mesh_1.Compute()
\endcode
+
+\anchor tui_import
+<h2>"Use Existing Elements" example </h2>
+\code
+
+from smesh import *
+SetCurrentStudy(salome.myStudy)
+
+# Make a patritioned box
+
+box = geompy.MakeBoxDXDYDZ(100,100,100)
+
+N = geompy.MakeVectorDXDYDZ( 1,0,0 )
+O = geompy.MakeVertex( 50,0,0 )
+plane = geompy.MakePlane( O, N, 200 ) # plane YOZ
+
+shape2boxes = geompy.MakeHalfPartition( box, plane )
+boxes = geompy.SubShapeAllSorted(shape2boxes, geompy.ShapeType["SOLID"])
+
+geompy.addToStudy( boxes[0], "boxes[0]")
+geompy.addToStudy( boxes[1], "boxes[1]")
+midFace0 = geompy.SubShapeAllSorted(boxes[0], geompy.ShapeType["FACE"])[5]
+geompy.addToStudyInFather( boxes[0], midFace0, "middle Face")
+midFace1 = geompy.SubShapeAllSorted(boxes[1], geompy.ShapeType["FACE"])[0]
+geompy.addToStudyInFather( boxes[1], midFace1, "middle Face")
+
+# Mesh one of boxes with quadrangles. It is a source mesh
+
+srcMesh = Mesh(boxes[0], "source mesh") # box coloser to CS origin
+nSeg1 = srcMesh.Segment().NumberOfSegments(4)
+srcMesh.Quadrangle()
+srcMesh.Compute()
+srcFaceGroup = srcMesh.GroupOnGeom( midFace0, "src faces", FACE )
+
+# Import faces from midFace0 to the target mesh
+
+tgtMesh = Mesh(boxes[1], "target mesh")
+importAlgo = tgtMesh.UseExisting2DElements(midFace1)
+import2hyp = importAlgo.SourceFaces( [srcFaceGroup] )
+tgtMesh.Segment().NumberOfSegments(3)
+tgtMesh.Quadrangle()
+tgtMesh.Compute()
+
+# Import the whole source mesh with groups
+import2hyp.SetCopySourceMesh(True,True)
+tgtMesh.Compute()
+\endcode
+
+
\n Other meshing algorithms:
<ul>
--- /dev/null
+/*!
+
+\page import_algos_page Use Existing Elements Algorithms
+
+\n Use Existing Elements algorithms allow to define the mesh of a geometrical
+object by the importing suitably located mesh elements from another
+mesh. The mesh elements to import from the other mesh are to be contained in
+groups. If several groups are used to mesh one geometry, validity of
+nodal connectivity of result mesh must be assured by connectivity of
+the source mesh; no geometrical checks are performed to merge
+different nodes at same locations.
+<br> The source elements must totally cover the meshed geometry.
+The source elements lying partially over the geometry will not be used.
+<br>
+These algorithms can be used to mesh a very complex geometry part by
+part, by storing meshes of parts in files and then fusing them
+together using these algorithms.
+<br>
+
+<b>Use Existing 1D Elements</b> algorithm allows to define the mesh of
+a geometrical edge (or group of edges)
+by the importing of mesh edges of another mesh contained in a group (or groups).
+\n To apply this algorithm select the edge to be meshed (indicated in
+the field \b Geometry of <b>Create mesh</b> dialog box),
+<b>Use existing 1D elements</b> in the list of 1D algorithms and click the
+<em>"Add Hypothesis"</em> button.
+The following dialog box will appear:
+
+\image html hyp_source_edges.png
+
+In this menu you can define the \b Name of the algorithm, the
+<b>Groups of Edges</b> to import elements from, <b> To copy mesh</b>
+the selected <b>Groups of Edges</b> belong to as a whole and <b>To
+copy groups</b> along with the whole mesh.
+<br>
+
+<b>Use Existing 2D Elements</b> algorithm allows to define the mesh of
+a geometrical face (or group of faces)
+by the importing of mesh faces of another mesh contained in a group (or groups).
+\n To apply this algorithm select the edge to be meshed (indicated in
+the field \b Geometry of <b>Create mesh</b> dialog box),
+<b>Use existing 2D elements</b> in the list of 2D algorithms and click the
+<em>"Add Hypothesis"</em> button.
+The following dialog box will appear:
+
+\image html hyp_source_faces.png
+
+In this menu you can define the \b Name of the algorithm, the
+<b>Groups of Faces</b> to import elements from, <b> To copy mesh</b>
+the selected <b>Groups of Fcaes</b> belong to as a whole and <b>To
+copy groups</b> along with the whole mesh.
+<br>
+
+<br><b>See Also</b> a sample TUI Script of a
+\ref tui_import "Use Existing Elements Algorithms".
+
+*/
+