Skip to content

Commit

Permalink
Link api docs in examples for Mesh Creation (pyvista#5811)
Browse files Browse the repository at this point in the history
* link api docs in examples for load

* Apply suggestions from code review

* Update examples/00-load/create-polyhedron.py

* Update examples/00-load/create-uniform-grid.py

Co-authored-by: MatthewFlamm <39341281+MatthewFlamm@users.noreply.github.com>

* Add KochanekSpline

---------

Co-authored-by: Tetsuo Koyama <tkoyama010@gmail.com>
  • Loading branch information
MatthewFlamm and tkoyama010 authored Mar 23, 2024
1 parent 75f095a commit c34dfac
Show file tree
Hide file tree
Showing 17 changed files with 23 additions and 7 deletions.
3 changes: 3 additions & 0 deletions doc/source/api/utilities/geometric.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
.. _geometry_api:

Geometry
--------
PyVista includes several functions to generate simple geometric
Expand Down Expand Up @@ -48,6 +50,7 @@ Geometric Objects
Dodecahedron
Icosahedron
Icosphere
KochanekSpline
Line
MultipleLines
Octahedron
Expand Down
2 changes: 2 additions & 0 deletions doc/source/api/utilities/parametric.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
.. _parametric_api:

Parametric Objects
------------------

Expand Down
3 changes: 2 additions & 1 deletion examples/00-load/create-explicit-structured-grid.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
Creating an Explicit Structured Grid
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Create an explicit structured grid from NumPy arrays.
Create an explicit structured grid from NumPy arrays using
:class:`pyvista.ExplicitStructuredGrid`.
"""

Expand Down
3 changes: 2 additions & 1 deletion examples/00-load/create-geometric-objects.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
Geometric Objects
~~~~~~~~~~~~~~~~~
The "Hello, world!" of VTK
The "Hello, world!" of VTK.
Uses objects from :ref:`geometry_api`.
"""

import pyvista as pv
Expand Down
1 change: 1 addition & 0 deletions examples/00-load/create-kochanek-spline.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
~~~~~~~~~~~~~~~~~~~~~~~~
Create a Kochanek spline/polyline from a numpy array of XYZ vertices.
Uses :func:`pyvista.KochanekSpline`.
"""

# sphinx_gallery_start_ignore
Expand Down
2 changes: 1 addition & 1 deletion examples/00-load/create-parametric-geometric-objects.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
Parametric Geometric Objects
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Creating parametric objects
Creating parametric objects from :ref:`parametric_api`.
"""

from math import pi
Expand Down
2 changes: 1 addition & 1 deletion examples/00-load/create-polyhedron.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
This example shows how to build a simple :class:`pyvista.UnstructuredGrid`
using polyhedra. We will be using VTK types to determine which type of cells we
are building.
are building. A list of cell types is given in :class:`pyvista.CellType`.
First, we import the required libraries.
"""
Expand Down
1 change: 1 addition & 0 deletions examples/00-load/create-structured-surface.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Create a StructuredGrid surface from NumPy arrays
using :class:`pyvista.StructuredGrid`.
"""

import numpy as np
Expand Down
2 changes: 1 addition & 1 deletion examples/00-load/create-surface-draped.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
some example data for this: 1) XYZ coordinates of a GPR path and 2) a 2D array
of data values produced from the GPR.
the data here are wacky (it's difficult to get shareable data of decent
The data here are wacky (it's difficult to get shareable data of decent
quality), so ignore them but pay attention to the structure. The coordinates we
have are technically shifted up and we have some NaN filler above the surface
- its weird and just ignore it. You'll typically have a more uniform looking
Expand Down
1 change: 1 addition & 0 deletions examples/00-load/create-tri-surface.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
~~~~~~~~~~~~~~~~~~~~~~~~~~~
Create a surface from a set of points through a Delaunay triangulation.
This example uses :func:`pyvista.PolyDataFilters.delaunay_2d`.
"""

import numpy as np
Expand Down
2 changes: 2 additions & 0 deletions examples/00-load/create-truss.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Plot connections between points in 3D as cylinders, colored by scalars.
Lines are created in a :class:`pyvista.PolyData` and then rendered as
cylinders.
"""
Expand Down
1 change: 1 addition & 0 deletions examples/00-load/create-uniform-grid.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
~~~~~~~~~~~~~~~~~~~~~~~
Create a simple uniform grid from a 3D NumPy array of values.
This example uses :class:`pyvista.ImageData`.
"""

Expand Down
1 change: 1 addition & 0 deletions examples/00-load/create-unstructured-surface.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Create an irregular, unstructured grid from NumPy arrays.
This example uses :class:`pyvista.UnstructuredGrid`.
"""

import numpy as np
Expand Down
2 changes: 1 addition & 1 deletion examples/00-load/load-gltf.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
###############################################################################
# Set up the plotter and enable environment textures. This works well
# for physically based rendering enabled meshes like the damaged
# helmet example.
# helmet example. Use :func:`pyvista.Plotter.import_gltf` to import file.

# sphinx_gallery_start_ignore
PYVISTA_GALLERY_FORCE_STATIC = True
Expand Down
1 change: 1 addition & 0 deletions examples/00-load/load-vrml.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

###############################################################################
# Set up the plotter and import VRML file.
# Use :func:`pyvista.Plotter.import_vrml` to import file.

pl = pyvista.Plotter()
pl.import_vrml(sextant_file)
Expand Down
1 change: 1 addition & 0 deletions examples/00-load/read-dolfin.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
PyVista leverages `meshio`_ to read many mesh formats not natively supported
by VTK including the `FEniCS/Dolfin`_ XML format.
This example uses :func:`pyvista.read`.
.. _meshio: https://github.com/nschloe/meshio
.. _FEniCS/Dolfin: https://fenicsproject.org
Expand Down
2 changes: 1 addition & 1 deletion examples/00-load/read-parallel.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
# Note that a ``.pvtu`` file is available alongside a directory. This
# directory contains all the parallel files or pieces that make the whole mesh.
# We can simply read the ``.pvtu`` file and VTK will handle putting the mesh
# together.
# together. In PyVista, this is accomplished through :func:`pyvista.read`.
mesh = pv.read(filename)
mesh

Expand Down

0 comments on commit c34dfac

Please sign in to comment.