
.. DO NOT EDIT.
.. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY.
.. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE:
.. "examples/cylinder.py"
.. LINE NUMBERS ARE GIVEN BELOW.

.. only:: html

    .. note::
        :class: sphx-glr-download-link-note

        :ref:`Go to the end <sphx_glr_download_examples_cylinder.py>`
        to download the full example code.

.. rst-class:: sphx-glr-example-title

.. _sphx_glr_examples_cylinder.py:


Cylinder geometry example
-------------------------

Cylinder geometry example.

.. GENERATED FROM PYTHON SOURCE LINES 8-20

.. code-block:: Python



    from __future__ import annotations

    import pyvista as pv

    import skgmsh as sg

    edge_source = pv.Cylinder(resolution=16)
    edge_source.merge(pv.PolyData(edge_source.points), merge_points=True, inplace=True)
    edge_source.plot(show_edges=True, color="white", line_width=2)








.. tab-set::



   .. tab-item:: Static Scene



            
     .. image-sg:: /examples/images/sphx_glr_cylinder_001.png
        :alt: cylinder
        :srcset: /examples/images/sphx_glr_cylinder_001.png
        :class: sphx-glr-single-img
     


   .. tab-item:: Interactive Scene



       .. offlineviewer:: /home/docs/checkouts/readthedocs.org/user_builds/scikit-gmsh/checkouts/latest/docs/examples/images/sphx_glr_cylinder_001.vtksz






.. GENERATED FROM PYTHON SOURCE LINES 22-23

Generate the mesh.

.. GENERATED FROM PYTHON SOURCE LINES 23-28

.. code-block:: Python


    alg = sg.Delaunay3D(edge_source)
    mesh = alg.mesh
    mesh.plot(show_edges=True)








.. tab-set::



   .. tab-item:: Static Scene



            
     .. image-sg:: /examples/images/sphx_glr_cylinder_002.png
        :alt: cylinder
        :srcset: /examples/images/sphx_glr_cylinder_002.png
        :class: sphx-glr-single-img
     


   .. tab-item:: Interactive Scene



       .. offlineviewer:: /home/docs/checkouts/readthedocs.org/user_builds/scikit-gmsh/checkouts/latest/docs/examples/images/sphx_glr_cylinder_002.vtksz






.. GENERATED FROM PYTHON SOURCE LINES 29-30

Output the information of the mesh.

.. GENERATED FROM PYTHON SOURCE LINES 30-33

.. code-block:: Python


    print(mesh)





.. rst-class:: sphx-glr-script-out

 .. code-block:: none

    UnstructuredGrid (0x7e580a181120)
      N Cells:    68
      N Points:   36
      X Bounds:   -5.000e-01, 5.000e-01
      Y Bounds:   -5.000e-01, 5.000e-01
      Z Bounds:   -5.000e-01, 5.000e-01
      N Arrays:   0




.. GENERATED FROM PYTHON SOURCE LINES 34-35

Change the cell size of the mesh.

.. GENERATED FROM PYTHON SOURCE LINES 35-38

.. code-block:: Python


    alg.cell_size = 0.2
    alg.mesh.plot(show_edges=True, color="white", line_width=2)







.. tab-set::



   .. tab-item:: Static Scene



            
     .. image-sg:: /examples/images/sphx_glr_cylinder_003.png
        :alt: cylinder
        :srcset: /examples/images/sphx_glr_cylinder_003.png
        :class: sphx-glr-single-img
     


   .. tab-item:: Interactive Scene



       .. offlineviewer:: /home/docs/checkouts/readthedocs.org/user_builds/scikit-gmsh/checkouts/latest/docs/examples/images/sphx_glr_cylinder_003.vtksz







.. rst-class:: sphx-glr-timing

   **Total running time of the script:** (0 minutes 0.480 seconds)


.. _sphx_glr_download_examples_cylinder.py:

.. only:: html

  .. container:: sphx-glr-footer sphx-glr-footer-example

    .. container:: sphx-glr-download sphx-glr-download-jupyter

      :download:`Download Jupyter notebook: cylinder.ipynb <cylinder.ipynb>`

    .. container:: sphx-glr-download sphx-glr-download-python

      :download:`Download Python source code: cylinder.py <cylinder.py>`

    .. container:: sphx-glr-download sphx-glr-download-zip

      :download:`Download zipped: cylinder.zip <cylinder.zip>`


.. only:: html

 .. rst-class:: sphx-glr-signature

    `Gallery generated by Sphinx-Gallery <https://sphinx-gallery.github.io>`_
