예제 #1
0
def test_themes():
    vtki.set_plot_theme('paraview')
    vtki.set_plot_theme('document')
    vtki.set_plot_theme('default')
예제 #2
0
def test_themes():
    vtki.set_plot_theme('paraview')
예제 #3
0
import vtki
import numpy as np

################################################################################
#  First, create some points for the surface.

# Define a simple Gaussian surface
xx, yy = np.meshgrid(np.linspace(-200,200,20), np.linspace(-200,200,20))
A, b = 100, 100
zz = A*np.exp(-0.5*((xx/b)**2. + (yy/b)**2.))

# Get the points as a 2D NumPy array (N by 3)
points = np.c_[xx.reshape(-1), yy.reshape(-1), zz.reshape(-1)]
print(points[0:5, :])

################################################################################
# Now use those points to create a point cloud ``vtki`` data object. This will
# be encompassed in a :class:`vtki.PolyData` object.

# simply pass the numpy points to the PolyData constructor
cloud = vtki.PolyData(points)
vtki.set_plot_theme('doc')
cloud.plot(point_size=15)

################################################################################
# Now that we have a ``vtki`` data structure of the points, we can perform a
# triangulation to turn those boring discrete points into a connected surface.

surf = cloud.delaunay_2d()
surf.plot(show_edges=True)
예제 #4
0
import sys
if sys.version_info >= (3, 0):
    import faulthandler
    faulthandler.enable()

import os
# Set up vtki
import vtki
vtki.TESTING_OFFSCREEN = True
vtki.set_plot_theme('document')
vtki.rcParams['colorbar_orientation'] = 'vertical'
vtki.set_error_output_file('errors.txt')
vtki.FIGURE_PATH = os.path.join(os.path.abspath('./images/'),
                                'auto-generated/')
if not os.path.exists(vtki.FIGURE_PATH):
    os.makedirs(vtki.FIGURE_PATH)

# -- General configuration ------------------------------------------------
numfig = False

# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = [
    'sphinx.ext.autodoc',
    'sphinx.ext.napoleon',
    'sphinx.ext.doctest',
    'sphinx.ext.autosummary',
    'notfound.extension',
    'sphinx_copybutton',
    'sphinx_gallery.gen_gallery',