X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=doc%2Fsalome%2Fgui%2FSMESH%2Finput%2Fsmeshpy_interface.rst;h=8fa865382b03539e7204d2a4681807d9b6ebe7c9;hb=21b39b999745333dff21ad9b309270722f59a36d;hp=7094b659216fdde31853739bf676b33f0cf40646;hpb=67312ab966a7c21fe835917978028643ffadd99e;p=modules%2Fsmesh.git diff --git a/doc/salome/gui/SMESH/input/smeshpy_interface.rst b/doc/salome/gui/SMESH/input/smeshpy_interface.rst index 7094b6592..8fa865382 100644 --- a/doc/salome/gui/SMESH/input/smeshpy_interface.rst +++ b/doc/salome/gui/SMESH/input/smeshpy_interface.rst @@ -11,7 +11,7 @@ Documentation of SALOME Mesh module Python API is available in two forms: - :doc:`Structured documentation `, where all methods and classes are grouped by their functionality. -- :ref:`Linear documentation ` grouped only by classes, declared in the :mod:`smeshBuilder` and :mod:`StdMeshersBuilder` Python packages. +- :ref:`Linear documentation ` grouped only by classes, declared in the :mod:`smeshBuilder` Python module. With SALOME 7.2, the Python interface for Mesh has been slightly modified to offer new functionality. You may have to modify your scripts generated with SALOME 6 or older versions. @@ -23,27 +23,24 @@ meshes. It can be used to create an empty mesh or to import mesh from the data f As soon as a mesh is created, it is possible to manage it via its own methods, described in class :class:`smeshBuilder.Mesh` documentation. -Class :class:`smeshstudytools.SMeshStudyTools` provides several methods to manipulate mesh objects in Salome study. +Class :class:`smeshstudytools.SMeshStudyTools` provides several methods to manipulate mesh objects in Salome study. A usual workflow to generate a mesh on geometry is following: #. Create an instance of :class:`smeshBuilder.smeshBuilder`: .. code-block:: python - :linenos: from salome.smesh import smeshBuilder - smesh = smeshBuilder.New( salome.myStudy ) + smesh = smeshBuilder.New() #. Create a :class:`smeshBuilder.Mesh` object: .. code-block:: python - :linenos: mesh = smesh.Mesh( geometry ) #. Create and assign :ref:`algorithms ` by calling corresponding methods of the mesh. If a sub-shape is provided as an argument, a :ref:`sub-mesh ` is implicitly created on this sub-shape: .. code-block:: python - :linenos: regular1D = mesh.Segment() mefisto = mesh.Triangle( smeshBuilder.MEFISTO ) @@ -52,29 +49,27 @@ A usual workflow to generate a mesh on geometry is following: #. Create and assign :ref:`hypotheses ` by calling corresponding methods of algorithms: .. code-block:: python - :linenos: segLen10 = regular1D.LocalLength( 10. ) maxArea = mefisto.LocalLength( 100. ) netgen.SetMaxSize( 20. ) netgen.SetFineness( smeshBuilder.VeryCoarse ) - -#. :ref:`compute_anchor` the mesh (generate mesh nodes and elements): + +#. :ref:`Compute the mesh ` (generate mesh nodes and elements): .. code-block:: python - :linenos: mesh.Compute() An easiest way to start with Python scripting is to do something in -GUI and then to get a corresponding Python script via +GUI and then to get a corresponding Python script via **File > Dump Study** menu item. Don't forget that you can get all methods of any object in hand (e.g. a mesh group or a hypothesis) by calling *dir()* Python built-in function. -All methods of the Mesh Group can be found in :ref:`tui_create_standalone_group` sample script. +All methods of the :class:`Mesh Group ` can be found in :ref:`tui_create_standalone_group` sample script. -An example below demonstrates usage of the Python API for 3d mesh -generation and for retrieving information on mesh nodes and elements. +An example below demonstrates usage of the Python API for 3D mesh +generation and for retrieving basic information on mesh nodes, elements and groups. .. _example_3d_mesh: @@ -82,7 +77,6 @@ Example of 3d mesh generation: ############################## .. literalinclude:: ../../../examples/3dmesh.py - :linenos: :language: python :download:`Download this script <../../../examples/3dmesh.py>` @@ -101,13 +95,10 @@ the following links: tui_transforming_meshes tui_viewing_meshes tui_quality_controls + tui_adaptation tui_measurements tui_work_on_objects_from_gui tui_notebook_smesh - tui_cartesian_algo - tui_use_existing_faces - tui_prism_3d_algo - tui_generate_flat_elements .. toctree:: :hidden: