.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "examples/Meshes/Mesh7.py" .. LINE NUMBERS ARE GIVEN BELOW. .. only:: html .. note:: :class: sphx-glr-download-link-note :ref:`Go to the end ` to download the full example code. .. rst-class:: sphx-glr-example-title .. _sphx_glr_examples_Meshes_Mesh7.py: Mesh7 ===== Meshing a 3D part in revolution. .. GENERATED FROM PYTHON SOURCE LINES 12-54 .. tab-set:: .. tab-item:: Static Scene .. image-sg:: /examples/Meshes/images/sphx_glr_Mesh7_001.png :alt: Mesh7 :srcset: /examples/Meshes/images/sphx_glr_Mesh7_001.png :class: sphx-glr-single-img .. tab-item:: Interactive Scene .. offlineviewer:: /home/docs/checkouts/readthedocs.org/user_builds/easyfea/checkouts/v1.10.1/docs/examples/Meshes/images/sphx_glr_Mesh7_001.vtksz .. tab-set:: .. tab-item:: Static Scene .. image-sg:: /examples/Meshes/images/sphx_glr_Mesh7_002.png :alt: Mesh7 :srcset: /examples/Meshes/images/sphx_glr_Mesh7_002.png :class: sphx-glr-single-img .. tab-item:: Interactive Scene .. offlineviewer:: /home/docs/checkouts/readthedocs.org/user_builds/easyfea/checkouts/v1.10.1/docs/examples/Meshes/images/sphx_glr_Mesh7_002.vtksz .. code-block:: Python :lineno-start: 13 import numpy as np from EasyFEA import Display, ElemType, PyVista from EasyFEA.Geoms import Point, Points, Circle, Line if __name__ == "__main__": Display.Clear() width = 1 height = 2 radius = 1 meshSize = width / 5 pt1 = Point(radius, 0, r=width / 3) pt2 = Point(radius + width, 0, r=width / 3) pt3 = Point(radius + width, height, r=-width / 3) pt4 = Point(radius, height, r=-width / 3) contour = Points([pt1, pt2, pt3, pt4], meshSize) circle1 = Circle(Point(width / 2 + radius, height * 1 / 4), width / 3, width / 10) circle2 = Circle(Point(width / 2 + radius, height * 3 / 4), width / 3, width / 10) circle3 = Circle( Point(width / 2 + radius, height / 2), width / 3, width / 10, False ) inclusions = [circle1, circle2, circle3] axis = Line(Point(), Point(radius / 3, height)) axis.name = "rot axis" plotter = PyVista.Plot_Geoms([contour, *inclusions, axis]).show() angle = 360 * 4 / 6 perimeter = angle * np.pi / 180 * radius layers = [perimeter // meshSize] mesh = contour.Mesh_Revolve(inclusions, axis, angle, layers, ElemType.PRISM6) PyVista.Plot_Mesh(mesh).show() .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 0.749 seconds) .. _sphx_glr_download_examples_Meshes_Mesh7.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: Mesh7.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: Mesh7.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: Mesh7.zip ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_