<p> </p>
-<p class="whs2">from geompy import
- *</p>
+<p class="whs2"><span style="font-family: 'Lucida Console', monospace;">import
+ geompy</span></p>
<p class="whs2">import smesh</p>
-<p> </p>
-
-<p># create vertices</p>
-
-<p class="whs2">Point111 = MakeVertex(
- 0, 0, 0)</p>
-
-<p class="whs2">Point211 = MakeVertex(10,
- 0, 0)</p>
-
-<p class="whs2">Point121 = MakeVertex(
- 0, 10, 0)</p>
-
-<p class="whs2">Point221 = MakeVertex(10,
- 10, 0)</p>
-
-<p class="whs2">Point112 = MakeVertex(
- 0, 0, 10)</p>
-
-<p class="whs2">Point212 = MakeVertex(10,
- 0, 10)</p>
-
-<p class="whs2">Point122 = MakeVertex(
- 0, 10, 10)</p>
-
-<p class="whs2">Point222 = MakeVertex(10,
- 10, 10)</p>
-
-<p> </p>
-
-<p># create edges</p>
-
-<p class="whs2">EdgeX111 = MakeEdge(Point111,
- Point211)</p>
-
-<p class="whs2">EdgeX121 = MakeEdge(Point121,
- Point221)</p>
-
-<p class="whs2">EdgeX112 = MakeEdge(Point112,
- Point212)</p>
-
-<p class="whs2">EdgeX122 = MakeEdge(Point122,
- Point222)</p>
-
-<p class="whs2">EdgeY11 = MakeEdge(Point111,
- Point121)</p>
-
-<p class="whs2">EdgeY21 = MakeEdge(Point211,
- Point221)</p>
-
-<p class="whs2">EdgeY12 = MakeEdge(Point112,
- Point122)</p>
-
-<p class="whs2">EdgeY22 = MakeEdge(Point212,
- Point222)</p>
-
-<p class="whs2">EdgeZ111 = MakeEdge(Point111,
- Point112)</p>
-
-<p class="whs2">EdgeZ211 = MakeEdge(Point211,
- Point212)</p>
-
-<p class="whs2">EdgeZ121 = MakeEdge(Point121,
- Point122)</p>
-
-<p class="whs2">EdgeZ221 = MakeEdge(Point221,
- Point222)</p>
-
-<p> </p>
-
-<p># create faces</p>
-
-<p class="whs2">FaceX11 = MakeQuad(EdgeY11,
- EdgeZ111, EdgeY12, EdgeZ121)</p>
-
-<p class="whs2">FaceX21 = MakeQuad(EdgeY21,
- EdgeZ211, EdgeY22, EdgeZ221)</p>
-
-<p class="whs2">FaceY111 = MakeQuad(EdgeX111,
- EdgeZ111, EdgeX112, EdgeZ211)</p>
-
-<p class="whs2">FaceY121 = MakeQuad(EdgeX121,
- EdgeZ121, EdgeX122, EdgeZ221)</p>
-
-<p class="whs2">FaceZ11 = MakeQuad(EdgeX111,
- EdgeY11, EdgeX121, EdgeY21)</p>
-
-<p class="whs2">FaceZ12 = MakeQuad(EdgeX112,
- EdgeY12, EdgeX122, EdgeY22)</p>
-
-<p> </p>
-
-<p># create a solid</p>
-
-<p class="whs2">Block = MakeHexa(FaceX11,
- FaceX21, FaceY111, FaceY121, FaceZ11, FaceZ12)</p>
-
-<p> </p>
+<p class="whs2"> </p>
-<p># create a compound</p>
+<p class="whs3"># create a box</p>
-<p class="whs2">box = MakeCompound([Block])</p>
+<p class="whs2">box = geompy.MakeBoxDXDYDZ(10.,
+ 10., 10.)</p>
-<p> </p>
+<p class="whs2">geompy.addToStudy(box,
+ "Box")</p>
-<p># add in the study</p>
+<p class="whs2"> </p>
-<p class="whs2">box_id = addToStudy(box,
- "Box compound")</p>
+<p class="whs3"># create a hexahedral
+ mesh on the box</p>
-<p> </p>
+<p class="whs2">hexa = smesh.Mesh(box,
+ "Box : hexahedrical mesh")</p>
-<p># create a hexahedral mesh on the box</p>
+<p class="whs2"> </p>
-<p class="whs2">hexa = smesh.Mesh(box,
- "Box compound : hexahedrical mesh")</p>
+<p class="whs3"># create a Regular 1D
+ algorithm for edges</p>
-<p class="whs2">algo = hexa.Segment()</p>
+<p class="whs2">algo1D = hexa.Segment()</p>
-<p> </p>
+<p class="whs2"> </p>
-<p># define "NumberOfSegments" hypothesis to cut an edge in a
- fixed number of segments</p>
+<p class="whs3"># define "Arithmetic1D"
+ hypothesis to cut all edges in several segments with increasing arithmetic
+ length </p>
-<p class="whs2">algo.NumberOfSegments(4)</p>
+<p class="whs2">algo1D.Arithmetic1D(1,
+ 4)</p>
-<p> </p>
+<p class="whs2"> </p>
-<p># create a quadrangle 2D algorithm for faces</p>
+<p class="whs3"># create a quadrangle
+ 2D algorithm for faces</p>
<p class="whs2">hexa.Quadrangle()</p>
-<p> </p>
+<p class="whs2"> </p>
-<p># create a hexahedron 3D algorithm for solids</p>
+<p class="whs3"># create a hexahedron
+ 3D algorithm for solids</p>
<p class="whs2">hexa.Hexahedron()</p>
-<p> </p>
-
-<p># create a local hypothesis</p>
-
-<p class="whs2">algo = hexa.Segment(EdgeX111)</p>
-
-<p> </p>
-
-<p># define "Arithmetic1D" hypothesis to cut an edge in several
- segments with arithmetic length increasing</p>
-
-<p class="whs2">algo.Arithmetic1D(1,
- 4)</p>
-
-<p> </p>
-
-<p># define "Propagation" hypothesis that propagates all other
- hypothesis on all edges on the opposite side in case of quadrangular faces</p>
-
-<p class="whs2">algo.Propagation()</p>
-
-<p> </p>
+<p class="whs2"> </p>
-<p># compute the mesh</p>
+<p class="whs3"># compute the mesh</p>
<p class="whs2">hexa.Compute() </p>
<h4><a name=bookmark9>Deflection 1D and Number of Segments</a></h4>
-<p class="whs2"> </p>
+<p class="whs2"><span style="font-family: 'Lucida Console', monospace;">import
+ geompy</span></p>
<p class="whs2">import smesh</p>
-<p class="whs2">import geompy</p>
-
-<p class="whs2">import salome</p>
-
-<p class="whs2">gg = salome.ImportComponentGUI("GEOM")</p>
-
<p class="whs2"> </p>
-<p class="whs3"># create vertices</p>
+<p class="whs3"># create a face from
+ arc and straight segment</p>
-<p class="whs2">px =
- geompy.MakeVertex(100., 0. ,
- 0. )</p>
+<p class="whs2">px = geompy.MakeVertex(100.,
+ 0. , 0.
+ )</p>
-<p class="whs2">py =
- geompy.MakeVertex(0. ,
- 100., 0. )</p>
+<p class="whs2">py = geompy.MakeVertex(0.
+ , 100.,
+ 0. )</p>
-<p class="whs2">pz =
- geompy.MakeVertex(0. ,
- 0. , 100.)</p>
+<p class="whs2">pz = geompy.MakeVertex(0.
+ , 0. ,
+ 100.)</p>
<p class="whs2"> </p>
-<p class="whs3"># create a vector from
- two points</p>
-
-<p class="whs2">vxy = geompy.MakeVector(px,
+<p class="whs2">exy = geompy.MakeEdge(px,
py)</p>
-<p class="whs2"> </p>
-
-<p class="whs3"># create an arc from
- three points</p>
-
<p class="whs2">arc = geompy.MakeArc(py,
pz, px)</p>
<p class="whs2"> </p>
-<p class="whs3"># create a wire</p>
-
-<p class="whs2">wire = geompy.MakeWire([vxy,
+<p class="whs2">wire = geompy.MakeWire([exy,
arc])</p>
-<p class="whs2">isPlanarFace = 1</p>
-
<p class="whs2"> </p>
-<p class="whs3"># create a face from
- the wire</p>
+<p class="whs2">isPlanarFace = 1</p>
<p class="whs2">face1 = geompy.MakeFace(wire,
isPlanarFace)</p>
-<p class="whs2"> </p>
-
-<p class="whs3"><span style="font-family: 'Times New Roman', serif;">#
- get edges from the face</span></p>
-
-<p class="whs2">vxy,arc = geompy.SubShapeAll(face1,geompy.ShapeType["EDGE"])</p>
-
-<p class="whs3"> </p>
-
-<p class="whs3"># add objects in the
- study</p>
-
-<p class="whs2">id_face1 = geompy.addToStudy(face1,"Face1")</p>
-
-<p class="whs2">id_arc = geompy.addToStudyInFather(face1,arc,"Arc
- Edge")</p>
+<p class="whs2">geompy.addToStudy(face1,"Face1")</p>
<p class="whs2"> </p>
-<p class="whs3"># display faces</p>
-
-<p class="whs2">gg.createAndDisplayGO(id_face1)</p>
+<p class="whs3"># get edges from the
+ face</p>
-<p class="whs2">gg.setDisplayMode(id_face1,1)</p>
+<p class="whs2">e_straight,e_arc =
+ geompy.SubShapeAll(face1, geompy.ShapeType["EDGE"])</p>
-<p class="whs2">gg.setTransparency(id_face1,0.2)</p>
+<p class="whs2">geompy.addToStudyInFather(face1,
+ e_arc, "Arc Edge")</p>
<p class="whs2"> </p>
<p class="whs3"># create hexahedral mesh</p>
<p class="whs2">hexa = smesh.Mesh(face1,
- "Face compound : hexahedrical mesh")</p>
-
-<p class="whs2">algo = hexa.Triangle()</p>
+ "Face : triangle mesh")</p>
<p class="whs2"> </p>
-<p class="whs3"># define "MaxElementArea"
- hypothesis</p>
-
-<p class="whs2">algo.MaxElementArea(30)</p>
-
-<p class="whs2"> </p>
+<p class="whs3"># define "NumberOfSegments"
+ hypothesis to cut a straight edge in a fixed number of segments</p>
-<p class="whs3"># create a local hypothesis
- on the wire</p>
+<p class="whs2">algo1D = hexa.Segment()</p>
-<p class="whs2">algo = hexa.Segment(wire)</p>
+<p class="whs2">algo1D.NumberOfSegments(6)</p>
<p class="whs2"> </p>
-<p class="whs3"># define "NumberOfSegments"
- hypothesis to cut a straight edge in a fixed number of segments</p>
+<p class="whs3"># define "MaxElementArea"
+ hypothesis</p>
-<p class="whs2">algo.NumberOfSegments(6)</p>
+<p class="whs2">algo2D = hexa.Triangle()</p>
+
+<p class="whs2">algo2D.MaxElementArea(70.0)</p>
<p class="whs2"> </p>
<p class="whs3"># define a local "Deflection1D"
hypothesis on the arc</p>
-<p class="whs2">algo = hexa.Segment(arc)</p>
-
-<p class="whs2">algo.Deflection1D(1)</p>
+<p class="whs2">algo_local = hexa.Segment(e_arc)</p>
-<p class="whs2"> </p>
+<p class="whs2">algo_local.Deflection1D(1.0)</p>
<p class="whs2"> </p>
<p class="whs2">hexa.Compute() </p>
-<p> </p>
-
<h4><a name=bookmark2>Start and End Length</a></h4>
-<p class="whs2">from geompy import
- *</p>
+<p class="whs2"><span style="font-family: 'Lucida Console', monospace;">from
+ geompy import *</span></p>
<p class="whs2">import smesh</p>
-<p> </p>
-
-<p># create vertices</p>
-
-<p class="whs2">Point111 = MakeVertex(
- 0, 0, 0)</p>
-
-<p class="whs2">Point211 = MakeVertex(10,
- 0, 0)</p>
-
-<p class="whs2">Point121 = MakeVertex(
- 0, 10, 0)</p>
-
-<p class="whs2">Point221 = MakeVertex(10,
- 10, 0)</p>
-
-<p class="whs2">Point112 = MakeVertex(
- 0, 0, 10)</p>
-
-<p class="whs2">Point212 = MakeVertex(10,
- 0, 10)</p>
-
-<p class="whs2">Point122 = MakeVertex(
- 0, 10, 10)</p>
-
-<p class="whs2">Point222 = MakeVertex(10,
- 10, 10)</p>
-
-<p> </p>
-
-<p># create edges</p>
-
-<p class="whs2">EdgeX111 = MakeEdge(Point111,
- Point211)</p>
-
-<p class="whs2">EdgeX121 = MakeEdge(Point121,
- Point221)</p>
-
-<p class="whs2">EdgeX112 = MakeEdge(Point112,
- Point212)</p>
-
-<p class="whs2">EdgeX122 = MakeEdge(Point122,
- Point222)</p>
-
-<p class="whs2">EdgeY11 = MakeEdge(Point111,
- Point121)</p>
-
-<p class="whs2">EdgeY21 = MakeEdge(Point211,
- Point221)</p>
-
-<p class="whs2">EdgeY12 = MakeEdge(Point112,
- Point122)</p>
-
-<p class="whs2">EdgeY22 = MakeEdge(Point212,
- Point222)</p>
-
-<p class="whs2">EdgeZ111 = MakeEdge(Point111,
- Point112)</p>
-
-<p class="whs2">EdgeZ211 = MakeEdge(Point211,
- Point212)</p>
-
-<p class="whs2">EdgeZ121 = MakeEdge(Point121,
- Point122)</p>
-
-<p class="whs2">EdgeZ221 = MakeEdge(Point221,
- Point222)</p>
-
-<p> </p>
-
-<p># create faces</p>
-
-<p class="whs2">FaceX11 = MakeQuad(EdgeY11,
- EdgeZ111, EdgeY12, EdgeZ121)</p>
-
-<p class="whs2">FaceX21 = MakeQuad(EdgeY21,
- EdgeZ211, EdgeY22, EdgeZ221)</p>
-
-<p class="whs2">FaceY111 = MakeQuad(EdgeX111,
- EdgeZ111, EdgeX112, EdgeZ211)</p>
-
-<p class="whs2">FaceY121 = MakeQuad(EdgeX121,
- EdgeZ121, EdgeX122, EdgeZ221)</p>
-
-<p class="whs2">FaceZ11 = MakeQuad(EdgeX111,
- EdgeY11, EdgeX121, EdgeY21)</p>
-
-<p class="whs2">FaceZ12 = MakeQuad(EdgeX112,
- EdgeY12, EdgeX122, EdgeY22)</p>
-
-<p> </p>
+<p class="whs2"> </p>
-<p># create a solid</p>
+<p class="whs3"># create a box</p>
-<p class="whs2">Block = MakeHexa(FaceX11,
- FaceX21, FaceY111, FaceY121, FaceZ11, FaceZ12)</p>
+<p class="whs2">box = MakeBoxDXDYDZ(10.,
+ 10., 10.)</p>
-<p> </p>
+<p class="whs2">addToStudy(box, "Box")</p>
-<p># create a compound</p>
+<p class="whs2"> </p>
-<p class="whs2">box = MakeCompound([Block])</p>
+<p class="whs3"># get one edge of the
+ box to put local hypothesis on</p>
-<p> </p>
+<p class="whs2">p5 = MakeVertex(5.,
+ 0., 0.)</p>
-<p># add in the study</p>
+<p class="whs2">EdgeX = GetEdgeNearPoint(box,
+ p5)</p>
-<p class="whs2">box_id = addToStudy(box,
- "Box compound")</p>
+<p class="whs2">addToStudyInFather(box,
+ EdgeX, "Edge [0,0,0 - 10,0,0]")</p>
-<p> </p>
+<p class="whs2"> </p>
-<p># create a hexahedral mesh on the box</p>
+<p class="whs3"># create a hexahedral
+ mesh on the box</p>
<p class="whs2">hexa = smesh.Mesh(box,
- "Box compound : hexahedrical mesh")</p>
-
-<p class="whs2">algo = hexa.Segment()</p>
-
-<p> </p>
-
-<p># define "NumberOfSegments" hypothesis to cut an edge in a
- fixed number of segments</p>
+ "Box : hexahedrical mesh")</p>
-<p class="whs2">algo.NumberOfSegments(4)</p>
+<p class="whs2"> </p>
-<p> </p>
+<p class="whs3"># set algorithms</p>
-<p># create a quadrangle 2D algorithm for faces</p>
+<p class="whs2">algo1D = hexa.Segment()</p>
<p class="whs2">hexa.Quadrangle()</p>
-<p> </p>
-
-<p># create a hexahedron 3D algorithm for solids</p>
-
<p class="whs2">hexa.Hexahedron()</p>
-<p> </p>
-
-<p># create a local hypothesis</p>
-
-<p class="whs2">algo = hexa.Segment(EdgeX111)</p>
-
-<p> </p>
-
-<p># define "StartEndLength" hypothesis to cut an edge in several
- segments with increasing geometric length </p>
-
-<p class="whs2">algo.StartEndLength(1,
- 6)</p>
-
-<p> </p>
-
-<p># define "Propagation" hypothesis that propagates all other
- hypothesis on all edges on the opposite side in case of quadrangular faces</p>
-
-<p class="whs2">algo.Propagation()</p>
-
-<p> </p>
-
-<p># compute the mesh</p>
-
-<p class="whs2">hexa.Compute() </p>
-
<p class="whs2"> </p>
-<h4><a name=bookmark3>Average Length</a></h4>
-
-<p class="whs2">from geompy import
- *</p>
+<p class="whs3"># define "NumberOfSegments"
+ hypothesis to cut an edge in a fixed number of segments</p>
-<p class="whs2">import smesh</p>
+<p class="whs2">algo1D.NumberOfSegments(4)</p>
<p class="whs2"> </p>
-<p class="whs3"># create vertices</p>
-
-<p class="whs2">Point111 = MakeVertex(
- 0, 0, 0)</p>
-
-<p class="whs2">Point211 = MakeVertex(10,
- 0, 0)</p>
-
-<p class="whs2">Point121 = MakeVertex(
- 0, 10, 0)</p>
-
-<p class="whs2">Point221 = MakeVertex(10,
- 10, 0)</p>
-
-<p class="whs2">Point112 = MakeVertex(
- 0, 0, 10)</p>
-
-<p class="whs2">Point212 = MakeVertex(10,
- 0, 10)</p>
-
-<p class="whs2">Point122 = MakeVertex(
- 0, 10, 10)</p>
+<p class="whs3"># create a local hypothesis</p>
-<p class="whs2">Point222 = MakeVertex(10,
- 10, 10)</p>
+<p class="whs2">algo_local = hexa.Segment(EdgeX)</p>
<p class="whs2"> </p>
-<p class="whs3"># create edges</p>
-
-<p class="whs2">EdgeX111 = MakeEdge(Point111,
- Point211)</p>
-
-<p class="whs2">EdgeX121 = MakeEdge(Point121,
- Point221)</p>
-
-<p class="whs2">EdgeX112 = MakeEdge(Point112,
- Point212)</p>
-
-<p class="whs2">EdgeX122 = MakeEdge(Point122,
- Point222)</p>
-
-<p class="whs2">EdgeY11 = MakeEdge(Point111,
- Point121)</p>
-
-<p class="whs2">EdgeY21 = MakeEdge(Point211,
- Point221)</p>
-
-<p class="whs2">EdgeY12 = MakeEdge(Point112,
- Point122)</p>
+<p class="whs3"># define "StartEndLength"
+ hypothesis to cut an edge in several segments with increasing geometric
+ length</p>
-<p class="whs2">EdgeY22 = MakeEdge(Point212,
- Point222)</p>
+<p class="whs2">algo_local.StartEndLength(1,
+ 6)</p>
-<p class="whs2">EdgeZ111 = MakeEdge(Point111,
- Point112)</p>
+<p class="whs2"> </p>
-<p class="whs2">EdgeZ211 = MakeEdge(Point211,
- Point212)</p>
+<p class="whs3"># define "Propagation"
+ hypothesis that propagates all other hypothesis</p>
-<p class="whs2">EdgeZ121 = MakeEdge(Point121,
- Point122)</p>
+<p class="whs3"># on all edges on the
+ opposite side in case of quadrangular faces</p>
-<p class="whs2">EdgeZ221 = MakeEdge(Point221,
- Point222)</p>
+<p class="whs2">algo_local.Propagation()</p>
<p class="whs2"> </p>
-<p class="whs3"># create faces</p>
-
-<p class="whs2">FaceX11 = MakeQuad(EdgeY11,
- EdgeZ111, EdgeY12, EdgeZ121)</p>
-
-<p class="whs2">FaceX21 = MakeQuad(EdgeY21,
- EdgeZ211, EdgeY22, EdgeZ221)</p>
+<p class="whs3"># compute the mesh</p>
-<p class="whs2">FaceY111 = MakeQuad(EdgeX111,
- EdgeZ111, EdgeX112, EdgeZ211)</p>
+<p class="whs2">hexa.Compute() </p>
-<p class="whs2">FaceY121 = MakeQuad(EdgeX121,
- EdgeZ121, EdgeX122, EdgeZ221)</p>
+<h4><a name=bookmark3>Average Length</a></h4>
-<p class="whs2">FaceZ11 = MakeQuad(EdgeX111,
- EdgeY11, EdgeX121, EdgeY21)</p>
+<p class="whs2"><span style="font-family: 'Lucida Console', monospace;">from
+ geompy import *</span></p>
-<p class="whs2">FaceZ12 = MakeQuad(EdgeX112,
- EdgeY12, EdgeX122, EdgeY22)</p>
+<p class="whs2">import smesh</p>
<p class="whs2"> </p>
-<p class="whs3"># create a solid</p>
+<p class="whs3"># create a box</p>
-<p class="whs2">Block = MakeHexa(FaceX11,
- FaceX21, FaceY111, FaceY121, FaceZ11, FaceZ12)</p>
+<p class="whs2">box = MakeBoxDXDYDZ(10.,
+ 10., 10.)</p>
-<p class="whs2"> </p>
+<p class="whs2">addToStudy(box, "Box")</p>
-<p class="whs3"># create a compound</p>
+<p class="whs2"> </p>
-<p class="whs2">box = MakeCompound([Block])</p>
+<p class="whs3"># get one edge of the
+ box to put local hypothesis on</p>
-<p class="whs2"> </p>
+<p class="whs2">p5 = MakeVertex(5.,
+ 0., 0.)</p>
-<p class="whs3"># add in the study</p>
+<p class="whs2">EdgeX = GetEdgeNearPoint(box,
+ p5)</p>
-<p class="whs2">box_id = addToStudy(box,
- "Box compound")</p>
+<p class="whs2">addToStudyInFather(box,
+ EdgeX, "Edge [0,0,0 - 10,0,0]")</p>
<p class="whs2"> </p>
mesh on the box</p>
<p class="whs2">hexa = smesh.Mesh(box,
- "Box compound : hexahedrical mesh")</p>
-
-<p class="whs2">algo = hexa.Segment()</p>
+ "Box : hexahedrical mesh")</p>
<p class="whs2"> </p>
-<p class="whs3"># define "NumberOfSegments"
- hypothesis to cut an edge in a fixed number of segments</p>
-
-<p class="whs2">algo.NumberOfSegments(4)</p>
-
-<p class="whs2"> </p>
+<p class="whs3"># set algorithms</p>
-<p class="whs3"># create a quadrangle
- 2D algorithm for faces</p>
+<p class="whs2">algo1D = hexa.Segment()</p>
<p class="whs2">hexa.Quadrangle()</p>
+<p class="whs2">hexa.Hexahedron()</p>
+
<p class="whs2"> </p>
-<p class="whs3"># create a hexahedron
- 3D algorithm for solids</p>
+<p class="whs3"># define "NumberOfSegments"
+ hypothesis to cut all edges in a fixed number of segments</p>
-<p class="whs2">hexa.Hexahedron()</p>
+<p class="whs2">algo1D.NumberOfSegments(4)</p>
<p class="whs2"> </p>
-<p class="whs3"># create a local hypothesis</p>
+<p class="whs3"># create a sub-mesh</p>
-<p class="whs2">algo = hexa.Segment(EdgeX111)</p>
+<p class="whs2">algo_local = hexa.Segment(EdgeX)</p>
<p class="whs2"> </p>
<p class="whs3"># define "LocalLength"
hypothesis to cut an edge in several segments with the same length</p>
-<p class="whs2">algo.LocalLength(2)</p>
+<p class="whs2">algo_local.LocalLength(2.)</p>
<p class="whs2"> </p>
<p class="whs3"># define "Propagation"
- hypothesis that propagates all other hypothesis on all edges on<span style="font-family: 'Times New Roman', serif;">
- the opposite side in case of quadrangular faces</span></p>
+ hypothesis that propagates all other hypothesis</p>
+
+<p class="whs3"># on all edges on the
+ opposite side in case of quadrangular faces</p>
-<p class="whs2">algo.Propagation()</p>
+<p class="whs2">algo_local.Propagation()</p>
<p class="whs2"> </p>
<p class="whs2">hexa.Compute() </p>
-<p class="whs2"> </p>
-
-<p class="whs2"> </p>
-
<h3>Defining 2D and 3D hypotheses</h3>
<h4><a name=bookmark4>Maximum Element Area</a></h4>
<p class="whs4"><span style="font-family: 'Lucida Console', monospace;">import
smesh</span></p>
-<p class="whs4">import geompy</p>
-
<p class="whs4">import salome</p>
<p class="whs4"> </p>
<h4><a name=bookmark5>Maximum Element Volume</a></h4>
<p class="whs4"><span style="font-family: 'Lucida Console', monospace;">import
- salome</span></p>
-
-<p class="whs4">import geompy</p>
-
-<p class="whs4">import StdMeshers</p>
+ geompy</span></p>
-<p class="whs4">import NETGENPlugin</p>
+<p class="whs4">import smesh</p>
<p class="whs4"> </p>
-<p class="whs4">smesh = salome.lcc.FindOrLoadComponent("FactoryServer",
- "SMESH")</p>
+<p class="whs5"># create a cylinder</p>
-<p class="whs4">smeshgui = salome.ImportComponentGUI("SMESH")</p>
+<p class="whs4">cyl = geompy.MakeCylinderRH(30.,
+ 50.)</p>
-<p class="whs4">smeshgui.Init(salome.myStudyId);</p>
+<p class="whs4">geompy.addToStudy(cyl,
+ "cyl")</p>
<p class="whs4"> </p>
-<p class="whs5"># create a box</p>
+<p class="whs5"># create a mesh on
+ the cylinder</p>
-<p class="whs4">box = geompy.MakeCylinderRH(30,
- 50) #MakeBox(0., 0., 0., </p>
-
-<p class="whs4">100., 200., 300.)</p>
+<p class="whs4">tetra = smesh.Mesh(cyl,
+ "Cylinder : tetrahedrical mesh")</p>
<p class="whs4"> </p>
-<p class="whs5"># add the box in the
- study</p>
-
-<p class="whs4">idbox = geompy.addToStudy(box,
- "box")</p>
-
-<p class="whs4"> </p>
-
-<p class="whs5"># create a set of hypotheses</p>
-
-<p class="whs5"> </p>
-
-<p class="whs5"># Number of Segments</p>
-
-<p class="whs4">numberOfSegments
- = 7</p>
-
-<p class="whs4">hypNbSeg = smesh.CreateHypothesis("NumberOfSegments",
- "libStdMeshersEngine.so")</p>
+<p class="whs5"># assign algorithms</p>
-<p class="whs4">hypNbSeg.SetNumberOfSegments(numberOfSegments)</p>
+<p class="whs4">algo1D = tetra.Segment()</p>
-<p class="whs4">print hypNbSeg.GetName()</p>
+<p class="whs4">algo2D = tetra.Triangle()</p>
-<p class="whs4">print hypNbSeg.GetNumberOfSegments()</p>
-
-<p class="whs4">smeshgui.SetName(salome.ObjectToID(hypNbSeg),
- "NumberOfSegments_7")</p>
+<p class="whs4">algo3D = tetra.Tetrahedron(smesh.NETGEN)</p>
<p class="whs4"> </p>
-<p class="whs5"># Max Element Area</p>
-
-<p class="whs4">maxElementArea =
- 800</p>
-
-<p class="whs4">hypArea = smesh.CreateHypothesis("MaxElementArea",
- "libStdMeshersEngine.so")</p>
+<p class="whs5"># assign 1D and 2D
+ hypotheses</p>
-<p class="whs4">hypArea.SetMaxElementArea(maxElementArea)</p>
+<p class="whs4">algo1D.NumberOfSegments(7)</p>
-<p class="whs4">print hypArea.GetName()</p>
-
-<p class="whs4">print hypArea.GetMaxElementArea()</p>
-
-<p class="whs4">smeshgui.SetName(salome.ObjectToID(hypArea),
- "MaxElementArea_800")</p>
+<p class="whs4">algo2D.MaxElementArea(150.)</p>
<p class="whs4"> </p>
-<p class="whs5"># Max Element Volume</p>
-
-<p class="whs4">maxElementVolume
- = 900</p>
-
-<p class="whs4">hypVolume = smesh.CreateHypothesis("MaxElementVolume",
- "libStdMeshersEngine.so")</p>
-
-<p class="whs4">hypVolume.SetMaxElementVolume(maxElementVolume)</p>
-
-<p class="whs4">print hypVolume.GetName()</p>
-
-<p class="whs4">print hypVolume.GetMaxElementVolume()</p>
-
-<p class="whs4">smeshgui.SetName(salome.ObjectToID(hypVolume),
- "MaxElementVolume_900")</p>
-
-<p class="whs4"> </p>
-
-<p class="whs5"># create a set of algorithms</p>
-
-<p class="whs5"> </p>
-
-<p class="whs5"># Regular_1D</p>
-
-<p class="whs4">regular1D = smesh.CreateHypothesis("Regular_1D",
- "libStdMeshersEngine.so")</p>
-
-<p class="whs4">smeshgui.SetName(salome.ObjectToID(regular1D),
- "Wire Discretisation")</p>
-
-<p class="whs4"> </p>
-
-<p class="whs5"># MEFISTO_2D</p>
-
-<p class="whs4">mefisto2D = smesh.CreateHypothesis("MEFISTO_2D",
- "libStdMeshersEngine.so")</p>
-
-<p class="whs4">smeshgui.SetName(salome.ObjectToID(mefisto2D),
- "MEFISTO_2D")</p>
-
-<p class="whs4"> </p>
-
-<p class="whs5"># NETGEN_3D (Tetrahedron
- meshing algorithm)</p>
-
-<p class="whs4">tetra3D = smesh.CreateHypothesis("NETGEN_3D",
- "libNETGENEngine.so")</p>
-
-<p class="whs4">smeshgui.SetName(salome.ObjectToID(tetra3D),
- "NETGEN_3D")</p>
-
-<p class="whs4"> </p>
-
-<p class="whs5"># initialize a mesh
- with the box</p>
-
-<p class="whs4">mesh = smesh.CreateMesh(box)</p>
-
-<p class="whs4">smeshgui.SetName(salome.ObjectToID(mesh),
- "MeshBox")</p>
-
-<p class="whs4"> </p>
-
-<p class="whs5"># add hypotheses and
- algorithms to the box</p>
-
-<p class="whs4">mesh.AddHypothesis(box,hypNbSeg)</p>
-
-<p class="whs4">mesh.AddHypothesis(box,hypArea)</p>
-
-<p class="whs4">mesh.AddHypothesis(box,hypVolume)</p>
-
-<p class="whs4">mesh.AddHypothesis(box,regular1D)</p>
-
-<p class="whs4">mesh.AddHypothesis(box,mefisto2D)</p>
+<p class="whs5"># assign Max Element
+ Volume hypothesis</p>
-<p class="whs4">mesh.AddHypothesis(box,tetra3D)</p>
+<p class="whs4">algo3D.MaxElementVolume(200.)</p>
<p class="whs4"> </p>
<p class="whs5"># compute the mesh</p>
-<p class="whs4">ret = smesh.Compute(mesh,box)</p>
+<p class="whs4">ret = tetra.Compute()</p>
<p class="whs4">if ret == 0:</p>
<p class="whs4">else:</p>
<p class="whs4"> print
- "Computation succeded"</p>
-
-<p class="whs4">salome.sg.updateObjBrowser(1)
- </p>
-
-<p class="whs4"> </p>
+ "Computation succeded" </p>
<h4><a name=bookmark6>Length from Edges</a></h4>
<p class="whs2"><span style="font-family: 'Lucida Console', monospace;">import
- salome</span></p>
-
-<p class="whs2">import geompy</p>
+ geompy</span></p>
<p class="whs2">import smesh</p>
<p class="whs2">sketcher2 = geompy.MakeSketcher("Sketcher:F
20 20:TT 50 20:TT 50 50:TT 20 50:WW")</p>
-<p class="whs2">isPlanarFace = 1</p>
-
<p class="whs2"> </p>
<p class="whs3"># create a face from
two wires</p>
-<p class="whs2">face1 = geompy.MakeFaces([sketcher1,
- sketcher2],isPlanarFace)</p>
-
-<p class="whs2"> </p>
+<p class="whs2">isPlanarFace = 1</p>
-<p class="whs3"># add object in the study</p>
+<p class="whs2">face1 = geompy.MakeFaces([sketcher1,
+ sketcher2], isPlanarFace)</p>
-<p class="whs2">id_face1 = geompy.addToStudy(face1,"Face1")</p>
+<p class="whs2">geompy.addToStudy(face1,
+ "Face1")</p>
<p class="whs2"> </p>
<p class="whs3"># Define 1D meshing</p>
-<p class="whs2">algo = tria.Segment()</p>
+<p class="whs2">algo1D = tria.Segment()</p>
-<p class="whs2">algo.NumberOfSegments(2)</p>
+<p class="whs2">algo1D.NumberOfSegments(2)</p>
<p class="whs2"> </p>
<p class="whs3"># create and assign the
algorithm for 2D meshing with triangles</p>
-<p class="whs2">algo = tria.Triangle()</p>
+<p class="whs2">algo2D = tria.Triangle()</p>
<p class="whs2"> </p>
<p class="whs3"># create and assign "LengthFromEdges"
- hypothesis to build triangles </p>
-
-<p class="whs3"># based on the length
- of the edges taken from the wire</p>
+ hypothesis to build triangles<span style="font-family: 'Times New Roman', serif;">
+ based on the length of the edges taken from the wire</span></p>
-<p class="whs2">algo.LengthFromEdges()</p>
+<p class="whs2">algo2D.LengthFromEdges()</p>
<p class="whs2"> </p>
<h4><a name=bookmark7>Propagation</a></h4>
-<p class="whs2"><span style="font-family: 'Lucida Console', monospace;">from
- geompy import *</span></p>
+<p class="whs2">from geompy import
+ *</p>
<p class="whs2">import smesh</p>
<p class="whs2"> </p>
-<p class="whs3"># create vertices</p>
-
-<p class="whs2">Point111 = MakeVertex(
- 0, 0, 0)</p>
+<p class="whs3"># create a box</p>
-<p class="whs2">Point211 = MakeVertex(10,
- 0, 0)</p>
+<p class="whs2">box = MakeBoxDXDYDZ(10.,
+ 10., 10.)</p>
-<p class="whs2">Point121 = MakeVertex(
- 0, 10, 0)</p>
+<p class="whs2">addToStudy(box, "Box")</p>
-<p class="whs2">Point221 = MakeVertex(10,
- 10, 0)</p>
+<p class="whs2"> </p>
-<p class="whs2">Point112 = MakeVertex(
- 0, 0, 10)</p>
+<p class="whs3"># get one edge of the
+ box to put local hypothesis on</p>
-<p class="whs2">Point212 = MakeVertex(10,
- 0, 10)</p>
+<p class="whs2">p5 = MakeVertex(5.,
+ 0., 0.)</p>
-<p class="whs2">Point122 = MakeVertex(
- 0, 10, 10)</p>
+<p class="whs2">EdgeX = GetEdgeNearPoint(box,
+ p5)</p>
-<p class="whs2">Point222 = MakeVertex(10,
- 10, 10)</p>
+<p class="whs2">addToStudyInFather(box,
+ EdgeX, "Edge [0,0,0 - 10,0,0]")</p>
<p class="whs2"> </p>
-<p class="whs3"># create edges</p>
+<p class="whs3"># create a hexahedral
+ mesh on the box</p>
-<p class="whs2">EdgeX111 = MakeEdge(Point111,
- Point211)</p>
+<p class="whs2">hexa = smesh.Mesh(box,
+ "Box : hexahedrical mesh")</p>
-<p class="whs2">EdgeX121 = MakeEdge(Point121,
- Point221)</p>
+<p class="whs2"> </p>
-<p class="whs2">EdgeX112 = MakeEdge(Point112,
- Point212)</p>
+<p class="whs3"># set global algorithms
+ and hypotheses</p>
-<p class="whs2">EdgeX122 = MakeEdge(Point122,
- Point222)</p>
+<p class="whs2">algo1D = hexa.Segment()</p>
-<p class="whs2">EdgeY11 = MakeEdge(Point111,
- Point121)</p>
+<p class="whs2">hexa.Quadrangle()</p>
-<p class="whs2">EdgeY21 = MakeEdge(Point211,
- Point221)</p>
+<p class="whs2">hexa.Hexahedron()</p>
-<p class="whs2">EdgeY12 = MakeEdge(Point112,
- Point122)</p>
+<p class="whs2">algo1D.NumberOfSegments(4)</p>
-<p class="whs2">EdgeY22 = MakeEdge(Point212,
- Point222)</p>
+<p class="whs2"> </p>
-<p class="whs2">EdgeZ111 = MakeEdge(Point111,
- Point112)</p>
+<p class="whs3"># create a sub-mesh with
+ local 1D hypothesis and propagation</p>
-<p class="whs2">EdgeZ211 = MakeEdge(Point211,
- Point212)</p>
+<p class="whs2">algo_local = hexa.Segment(EdgeX)</p>
-<p class="whs2">EdgeZ121 = MakeEdge(Point121,
- Point122)</p>
+<p class="whs2"> </p>
+
+<p class="whs3"># define "Arithmetic1D"
+ hypothesis to cut an edge in several segments with increasing length</p>
-<p class="whs2">EdgeZ221 = MakeEdge(Point221,
- Point222)</p>
+<p class="whs2">algo_local.Arithmetic1D(1,
+ 4)</p>
<p class="whs2"> </p>
-<p class="whs3"># create faces</p>
+<p class="whs3"># define "Propagation"
+ hypothesis that propagates all other 1D hypotheses</p>
-<p class="whs2">FaceX11 = MakeQuad(EdgeY11,
- EdgeZ111, EdgeY12, EdgeZ121)</p>
+<p class="whs3"># from all edges on the
+ opposite side of a face in case of quadrangular faces</p>
-<p class="whs2">FaceX21 = MakeQuad(EdgeY21,
- EdgeZ211, EdgeY22, EdgeZ221)</p>
+<p class="whs2">algo_local.Propagation()</p>
-<p class="whs2">FaceY111 = MakeQuad(EdgeX111,
- EdgeZ111, EdgeX112, EdgeZ211)</p>
+<p class="whs2"> </p>
-<p class="whs2">FaceY121 = MakeQuad(EdgeX121,
- EdgeZ121, EdgeX122, EdgeZ221)</p>
+<p class="whs3"># compute the mesh</p>
-<p class="whs2">FaceZ11 = MakeQuad(EdgeX111,
- EdgeY11, EdgeX121, EdgeY21)</p>
+<p><span style="font-family: 'Lucida Console', monospace;">hexa.Compute()</span>
+ </p>
-<p class="whs2">FaceZ12 = MakeQuad(EdgeX112,
- EdgeY12, EdgeX122, EdgeY22)</p>
+<h3><a name=bookmark8>Defining Meshing Algorithms</a></h3>
-<p class="whs2"> </p>
+<p class="whs4">import geompy</p>
-<p class="whs3"># create a solid</p>
+<p class="whs4">import smesh</p>
-<p class="whs2">box = MakeHexa(FaceX11,
- FaceX21, FaceY111, FaceY121, FaceZ11, FaceZ12)</p>
+<p class="whs6"> </p>
-<p class="whs2"> </p>
+<p class="whs6"># create a box</p>
-<p class="whs3"># add in the study</p>
+<p class="whs4">box = geompy.MakeBoxDXDYDZ(10.,
+ 10., 10.)</p>
-<p class="whs2">box_id = addToStudy(box,
+<p class="whs4">geompy.addToStudy(box,
"Box")</p>
-<p class="whs2"> </p>
+<p class="whs4"> </p>
-<p class="whs3"># create a hexahedral
+<p class="whs6"># 1. Create a hexahedral
mesh on the box</p>
-<p class="whs2">hexa = smesh.Mesh(box,
+<p class="whs4">hexa = smesh.Mesh(box,
"Box : hexahedrical mesh")</p>
-<p class="whs2"> </p>
+<p class="whs6"> </p>
-<p class="whs3"># create an 1D algorithm
+<p class="whs6"># create a Regular 1D algorithm
for edges</p>
-<p class="whs2">algo = hexa.Segment()</p>
-
-<p class="whs2"> </p>
-
-<p class="whs3"># define "NumberOfSegments"
- hypothesis to cut an edge in a fixed number of segments</p>
-
-<p class="whs2">algo.NumberOfSegments(4)</p>
-
-<p class="whs2"> </p>
-
-<p class="whs3"># create a quadrangle
- 2D algorithm for faces</p>
-
-<p class="whs2">hexa.Quadrangle()</p>
+<p class="whs4">algo1D = hexa.Segment()</p>
-<p class="whs2"> </p>
+<p class="whs6"> </p>
-<p class="whs3"># create a hexahedron
- 3D algorithm for solids</p>
+<p class="whs6"># create a quadrangle 2D
+ algorithm for faces</p>
-<p class="whs2">hexa.Hexahedron()</p>
+<p class="whs4">algo2D = hexa.Quadrangle()</p>
-<p class="whs2"> </p>
+<p class="whs6"> </p>
-<p class="whs3"># create a local hypothesis</p>
+<p class="whs6"># create a hexahedron 3D
+ algorithm for solids</p>
-<p class="whs2">algo = hexa.Segment(EdgeX111)</p>
+<p class="whs4">algo3D = hexa.Hexahedron()</p>
-<p class="whs2"> </p>
+<p class="whs6"> </p>
-<p class="whs3"># define "Arithmetic1D"
- hypothesis to cut an edge<span style="font-family: 'Times New Roman', serif;">
- in several segments with increasing length</span></p>
+<p class="whs6"># define hypotheses</p>
-<p class="whs2">algo.Arithmetic1D(1,
+<p class="whs4">algo1D.Arithmetic1D(1,
4)</p>
-<p class="whs2"> </p>
-
-<p class="whs3"># define "Propagation"
- hypothesis that propagates all other 1D hypotheses</p>
-
-<p class="whs3"># from all edges on the
- opposite side of a face in case of quadrangular faces</p>
+<p class="whs6"> </p>
-<p class="whs2">algo.Propagation()</p>
+<p class="whs6"># compute the mesh</p>
-<p class="whs2"> </p>
+<p class="whs4">hexa.Compute()</p>
-<p class="whs3"># compute the mesh</p>
+<p class="whs6"> </p>
-<p class="whs2">hexa.Compute() </p>
+<p class="whs6"># 2. Create a tetrahedral
+ mesh on the box</p>
-<h3><a name=bookmark8>Defining Meshing Algorithms</a></h3>
+<p class="whs4">tetra = smesh.Mesh(box,
+ "Box : tetrahedrical mesh")</p>
-<p class="whs4"><span style="font-family: 'Lucida Console', monospace;">import
- salome</span></p>
-
-<p class="whs4">import StdMeshers</p>
+<p class="whs6"> </p>
-<p class="whs4">import NETGENPlugin</p>
+<p class="whs6"># create a Regular 1D algorithm
+ for edges</p>
-<p class="whs4"> </p>
+<p class="whs4">algo1D = tetra.Segment()</p>
-<p class="whs4">smesh = salome.lcc.FindOrLoadComponent("FactoryServer",
- "SMESH")</p>
+<p class="whs6"> </p>
-<p class="whs4">smeshgui = salome.ImportComponentGUI("SMESH")</p>
+<p class="whs6"># create a Mefisto 2D algorithm
+ for faces</p>
-<p class="whs4">smeshgui.Init(salome.myStudyId);</p>
+<p class="whs4">algo2D = tetra.Triangle()</p>
<p class="whs6"> </p>
-<p class="whs6"># create algorithms</p>
-
-<p class="whs4">print "--------------------------
- create Algorithms"</p>
+<p class="whs6"># create a Netgen 3D algorithm
+ for solids</p>
-<p class="whs4">print "--------------------------
- Regular_1D (Wire discretisation)"</p>
+<p class="whs4">algo3D = tetra.Tetrahedron(smesh.NETGEN)</p>
-<p class="whs4">regular1D = smesh.CreateHypothesis("Regular_1D",
- "libStdMeshersEngine.so")</p>
+<p class="whs6"> </p>
-<p class="whs4">smeshgui.SetName(salome.ObjectToID(regular1D),
- "Wire Discretisation")</p>
+<p class="whs6"># define hypotheses</p>
-<p class="whs4"> </p>
+<p class="whs4">algo1D.Arithmetic1D(1,
+ 4)</p>
-<p class="whs4">print "--------------------------
- MEFISTO_2D (Triangle meshing algorithm)"</p>
+<p class="whs4">algo2D.LengthFromEdges()</p>
-<p class="whs4">mefisto2D = smesh.CreateHypothesis("MEFISTO_2D",
- "libStdMeshersEngine.so")</p>
+<p class="whs6"> </p>
-<p class="whs4">smeshgui.SetName(salome.ObjectToID(mefisto2D),
- "MEFISTO_2D")</p>
+<p class="whs6"># compute the mesh</p>
-<p class="whs4"> </p>
+<p class="whs4">tetra.Compute()</p>
-<p class="whs4">print "--------------------------
- Quadrangle_2D (Quadrangle meshing algorithm)"</p>
+<p class="whs6"> </p>
-<p class="whs4">quad2D = smesh.CreateHypothesis(
- "Quadrangle_2D", "libStdMeshersEngine.so" )</p>
+<p class="whs6"># 3. Create a tetrahedral
+ mesh on the box with NETGEN_2D3D algorithm</p>
-<p class="whs4">smeshgui.SetName(salome.ObjectToID(quad2D),
- "Quadrangle_2D")</p>
+<p class="whs4">tetraN = smesh.Mesh(box,
+ "Box : tetrahedrical mesh by NETGEN_2D3D")</p>
-<p class="whs4"> </p>
+<p class="whs6"> </p>
-<p class="whs4">print "--------------------------
- Hexa_3D (Hexahedron meshing algorithm)"</p>
+<p class="whs6"># create a Netgen_2D3D
+ algorithm for solids</p>
-<p class="whs4">hexa3D = smesh.CreateHypothesis("Hexa_3D",
- "libStdMeshersEngine.so")</p>
+<p class="whs4">is3D = 1</p>
-<p class="whs4">smeshgui.SetName(salome.ObjectToID(hexa3D),
- "HEXA_3D")</p>
+<p class="whs4">algo3D = tetraN.Netgen(is3D)</p>
-<p class="whs4"> </p>
+<p class="whs6"> </p>
-<p class="whs4">print "--------------------------
- NETGEN_3D (Tetrahedron meshing algorithm)"</p>
+<p class="whs6"># define hypotheses</p>
-<p class="whs4">netgen3D = smesh.CreateHypothesis("NETGEN_3D",
- "libNETGENEngine.so")</p>
+<p class="whs4">n23_params = algo3D.Parameters()</p>
-<p class="whs4">smeshgui.SetName(salome.ObjectToID(netgen3D),
- "NETGEN_3D")</p>
+<p class="whs6"> </p>
-<p class="whs4">salome.sg.updateObjBrowser(1)</p>
+<p class="whs6"># compute the mesh</p>
-<p class="whs6"> </p>
+<p class="whs4">tetraN.Compute()
+ </p>
<script type="text/javascript" language="javascript1.2">
<!--