| 1 |
"""Contains vrml examples.""" |
| 2 |
|
| 3 |
from __future__ import annotations |
| 4 |
|
| 5 |
from pyvista.examples.downloads import download_file |
| 6 |
|
| 7 |
|
| 8 |
def download_teapot(): # pragma: no cover |
| 9 |
"""Download the a 2-manifold solid version of the famous teapot example. |
| 10 |
|
| 11 |
The `Utah Teapot <https://en.wikipedia.org/wiki/Utah_teapot>`_, |
| 12 |
originally modeled by Martin Newell at the University of Utah in |
| 13 |
1975. No formal license has ever been issued for the original Newell |
| 14 |
dataset; the model has been freely distributed in computer graphics |
| 15 |
software for 50 years and is conventionally treated as public domain. |
| 16 |
|
| 17 |
Returns |
| 18 |
------- |
| 19 |
str |
| 20 |
Filename of the VRML file. |
| 21 |
|
| 22 |
Examples |
| 23 |
-------- |
| 24 |
>>> import pyvista as pv |
| 25 |
>>> from pyvista import examples |
| 26 |
>>> vrml_file = examples.vrml.download_teapot() |
| 27 |
>>> pl = pv.Plotter() |
| 28 |
>>> pl.import_vrml(vrml_file) |
| 29 |
>>> pl.show() |
| 30 |
|
| 31 |
""" |
| 32 |
return download_file('vrml/teapot.wrl') |
| 33 |
|
| 34 |
|
| 35 |
def download_sextant(): # pragma: no cover |
| 36 |
"""Download the sextant example. |
| 37 |
|
| 38 |
Returns |
| 39 |
------- |
| 40 |
str |
| 41 |
Filename of the VRML file. |
| 42 |
|
| 43 |
Examples |
| 44 |
-------- |
| 45 |
>>> import pyvista as pv |
| 46 |
>>> from pyvista import examples |
| 47 |
>>> vrml_file = examples.vrml.download_sextant() |
| 48 |
>>> pl = pv.Plotter() |
| 49 |
>>> pl.import_vrml(vrml_file) |
| 50 |
>>> pl.show() |
| 51 |
|
| 52 |
""" |
| 53 |
return download_file('vrml/sextant.wrl') |
| 54 |
|
| 55 |
|
| 56 |
def download_grasshopper(): # pragma: no cover |
| 57 |
"""Download the grasshoper example. |
| 58 |
|
| 59 |
.. versionadded:: 0.45 |
| 60 |
|
| 61 |
Returns |
| 62 |
------- |
| 63 |
str |
| 64 |
Filename of the VRML file. |
| 65 |
|
| 66 |
Examples |
| 67 |
-------- |
| 68 |
>>> import pyvista as pv |
| 69 |
>>> from pyvista import examples |
| 70 |
>>> vrml_file = examples.vrml.download_grasshopper() |
| 71 |
>>> pl = pv.Plotter() |
| 72 |
>>> pl.import_vrml(vrml_file) |
| 73 |
>>> pl.camera_position = pv.CameraPosition( |
| 74 |
... position=(25.0, 32.0, 44.0), |
| 75 |
... focal_point=(0.0, 0.931, -6.68), |
| 76 |
... viewup=(-0.20, 0.90, -0.44), |
| 77 |
... ) |
| 78 |
>>> pl.show() |
| 79 |
|
| 80 |
""" |
| 81 |
return download_file('grasshopper/grasshop.wrl') |