Fixing typo critireas is criterias.
transforming_meshes_ex04.py
transforming_meshes_ex05.py
transforming_meshes_ex06.py
+ transforming_meshes_ex15.py
viewing_meshes_ex01.py
radial_prism_3d_algo.py
create_dual_mesh.py
--- /dev/null
+# Offset 2D mesh, sub-mesh, group or elements from filter.
+
+import salome
+salome.salome_init_without_session()
+
+import SMESH
+from salome.geom import geomBuilder
+from salome.smesh import smeshBuilder
+
+geom_builder = geomBuilder.New()
+smesh_builder = smeshBuilder.New()
+
+box = geom_builder.MakeBoxDXDYDZ(100, 100, 100)
+
+## -----------
+##
+## Offset mesh
+##
+## -----------
+
+init_mesh = smesh_builder.Mesh(box, "box")
+init_mesh.AutomaticTetrahedralization()
+init_mesh.Compute()
+
+#Offset triangular elements in mesh (expand the entire mesh)
+offset = 20
+mesh, mesh_group = init_mesh.Offset( init_mesh, offset, MakeGroups=False, CopyElements=False )
+assert isinstance( mesh, smeshBuilder.Mesh )
+assert len( mesh_group ) == 0
+offsetMeshArea = smesh_builder.GetArea(mesh)
+
+#Offset triangular elements in mesh (shrink the entire mesh)
+offset = -20
+mesh, mesh_group = init_mesh.Offset( init_mesh, offset, MakeGroups=False, CopyElements=False, NewMeshName="MeshShrink" )
+assert isinstance( mesh, smeshBuilder.Mesh )
+assert len( mesh_group ) == 0
+assert mesh.GetName() == "MeshShrink"
+shrinkMeshArea = smesh_builder.GetArea(mesh)
+
+assert offsetMeshArea > shrinkMeshArea
\ No newline at end of file
* :ref:`Translate <translation_page>` in the indicated direction the mesh or some of its elements.
* :ref:`Rotate <rotation_page>` by the indicated axis and angle the mesh or some of its elements.
* :ref:`Scale <scale_page>` the mesh or some of its elements.
+* :ref:`Offset <offset_elements_page>` the entire mesh, the sub-mesh or a selection of elements based on filters.
* :ref:`Mirror <symmetry_page>` the mesh through a point, a vector or a plane of symmetry.
* :ref:`double_nodes_page`. Duplication of nodes can be useful to emulate a crack in the model.
* :ref:`Merge Nodes<merging_nodes_page>` coincident within the indicated tolerance.
translation.rst
rotation.rst
scale.rst
+ offset_elements.rst
symmetry.rst
double_nodes_page.rst
sewing_meshes.rst
--- /dev/null
+.. _offset_elements_page:
+
+********************************
+Offset mesh
+********************************
+
+Offset 2D elements in mesh, submesh, group or elements from filter.
+
+*To offset all elements from mesh, sub-mesh or group:*
+
+.. |img| image:: ../images/image81.png
+
+#. In the **Modification** menu, select the **Transformations** then click *Offset* button |img| or click directly in the same button in the toolbar.
+
+ The following dialog box will appear:
+
+ .. image:: ../images/offset_mesh.png
+ :align: center
+
+ * Check the option **Select whole mesh, sub-mesh or group** if it is not set.
+ * Set the name of the mesh, sub-mesh or created group.
+ * Set the **Offset** value (negative offsets are allowed).
+ * Select **Move Elements** to offset the current mesh, **Copy Elements** to offset and duplicate them, or **Create a new mesh** to create a new mesh from the offset elements.
+
+#. Click the **Apply** or **Apply and Close** button to confirm the operation.
+
+
+*To offset all elements ids from a filter:*
+
+#. In the **Modification** menu, select the **Transformations** then click *Offset* button |img| or click directly in the same button from the toolbar.
+
+ * Uncheck the option **Select whole mesh, sub-mesh or group**.
+
+ .. image:: ../images/offset_mesh_from_filter.png
+ :align: center
+
+ * Then click on **Set_Filter** button
+
+ The dialog for filter for faces will appear:
+
+ .. image:: ../images/offset_filter_for_faces_gui.png
+ :align: center
+
+ * Define the desired criterias and then click the **Apply and Close** button to confirm the selection of elements.
+ * Set **Offset** value and mesh creation **options** as done for the first case.
+
+#. Click the **Apply** or **Apply and Close** button to confirm the operation.
+
+**See also:** A sample TUI Script of a :ref:`tui_offset_elements` transformation.
\ No newline at end of file
.. literalinclude:: ../../examples/transforming_meshes_ex14.py
:language: python
-:download:`Download this script <../../examples/transforming_meshes_ex14.py>`
\ No newline at end of file
+:download:`Download this script <../../examples/transforming_meshes_ex14.py>`
+
+.. _tui_offset_elements:
+
+Offset 2D mesh
+========================
+
+.. literalinclude:: ../../examples/transforming_meshes_ex15.py
+ :language: python
+
+:download:`Download this script <../../examples/transforming_meshes_ex15.py>`
\ No newline at end of file
myMeshOrSubMeshOrGroupFilter =
new SMESH_LogicalFilter(aListOfFilters, SMESH_LogicalFilter::LO_OR);
- myHelpFileName = "Offset_page.html";
+ myHelpFileName = "offset_elements.html";
Init();