.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "examples/MeshGeneration/demo_pasta.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_MeshGeneration_demo_pasta.py: Pasta Shapes ============ This example creates pasta shapes with mymesh.primitives using sweep construction methods (:func:`~mymesh.primitives.Extrude` and :func:`~mymesh.primitives.Revolve`). These demonstrate how meshes of complex shapes can be constructed starting with a single straight line. Please submit any new pasta constructions to toj@bu.edu .. GENERATED FROM PYTHON SOURCE LINES 13-16 .. code-block:: Python from mymesh.primitives import Line, Revolve, Extrude import numpy as np .. GENERATED FROM PYTHON SOURCE LINES 17-46 .. code-block:: Python ziti = Extrude( Revolve( Line([0,0,0.9],[0,0,1], n=5), 2*np.pi, np.pi/36, axis=0), 5, 1, axis=0) ziti.plot(bgcolor='w', color='#EBCB8B') penne = Extrude( Revolve( Line([0,0,0.9],[0,0,1], n=5), 2*np.pi, np.pi/36, axis=[1,1,1]), 5, 1, axis=0) penne.plot(bgcolor='w', color='#EBCB8B') gomiti = Revolve( # or elbow/macaroni Revolve( Line([0,0,1.5],[0,0,1.55], n=5), 2*np.pi, np.pi/36, axis=0, center=[0,0,1.25]), np.pi, np.pi/36, axis=1, center=[0,0,0.5]) gomiti.plot(bgcolor='w', color='#EBCB8B') fusilli = Revolve( # fusilli bucati to be specific Revolve( Line([0,0,.5], [0,0,.7], n=5), 2*np.pi, np.pi/36, axis=1, center=[0,0,.5]), 14*np.pi, np.pi/36, shift=5, axis=0) fusilli.plot(bgcolor='w', color='#EBCB8B') .. rst-class:: sphx-glr-horizontal * .. image-sg:: /examples/MeshGeneration/images/sphx_glr_demo_pasta_001.png :alt: demo pasta :srcset: /examples/MeshGeneration/images/sphx_glr_demo_pasta_001.png :class: sphx-glr-multi-img * .. image-sg:: /examples/MeshGeneration/images/sphx_glr_demo_pasta_002.png :alt: demo pasta :srcset: /examples/MeshGeneration/images/sphx_glr_demo_pasta_002.png :class: sphx-glr-multi-img * .. image-sg:: /examples/MeshGeneration/images/sphx_glr_demo_pasta_003.png :alt: demo pasta :srcset: /examples/MeshGeneration/images/sphx_glr_demo_pasta_003.png :class: sphx-glr-multi-img * .. image-sg:: /examples/MeshGeneration/images/sphx_glr_demo_pasta_004.png :alt: demo pasta :srcset: /examples/MeshGeneration/images/sphx_glr_demo_pasta_004.png :class: sphx-glr-multi-img .. rst-class:: sphx-glr-script-out .. code-block:: none RFBOutputContext() RFBOutputContext() RFBOutputContext() RFBOutputContext() .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 4.640 seconds) .. _sphx_glr_download_examples_MeshGeneration_demo_pasta.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: demo_pasta.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: demo_pasta.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: demo_pasta.zip ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_