#. Create an instance of :class:`smeshBuilder.smeshBuilder`:
.. code-block:: python
- :linenos:
from salome.smesh import smeshBuilder
smesh = smeshBuilder.New()
#. Create a :class:`smeshBuilder.Mesh` object:
.. code-block:: python
- :linenos:
mesh = smesh.Mesh( geometry )
#. Create and assign :ref:`algorithms <basic_meshing_algos_page>` by calling corresponding methods of the mesh. If a sub-shape is provided as an argument, a :ref:`sub-mesh <constructing_submeshes_page>` is implicitly created on this sub-shape:
.. code-block:: python
- :linenos:
regular1D = mesh.Segment()
mefisto = mesh.Triangle( smeshBuilder.MEFISTO )
#. Create and assign :ref:`hypotheses <about_hypo_page>` by calling corresponding methods of algorithms:
.. code-block:: python
- :linenos:
segLen10 = regular1D.LocalLength( 10. )
maxArea = mefisto.LocalLength( 100. )
#. :ref:`compute_anchor` the mesh (generate mesh nodes and elements):
.. code-block:: python
- :linenos:
mesh.Compute()
##############################
.. literalinclude:: ../../../examples/3dmesh.py
- :linenos:
:language: python
:download:`Download this script <../../../examples/3dmesh.py>`