From 4a6c7e6216f0b4775f7f1cbf761e52677472f343 Mon Sep 17 00:00:00 2001 From: Marco Musy Date: Thu, 16 Apr 2020 00:26:54 +0200 Subject: [PATCH] 2.4 --- notebooks/{basic => advanced}/fitline.ipynb | 9 +- notebooks/basic/pca.ipynb | 43 +- setup.py | 3 + tests/dolfinx/test_aaa.py | 17 +- vtkplotter/addons.py | 1 + vtkplotter/analysis.py | 388 +-- vtkplotter/base.py | 13 +- vtkplotter/docs.py | 2358 ++++++++--------- vtkplotter/examples/advanced/README.md | 2 + vtkplotter/examples/advanced/centerline1.py | 10 +- vtkplotter/examples/advanced/centerline2.py | 2 +- .../examples/{basic => advanced}/fitline.py | 17 +- vtkplotter/examples/advanced/fitplanes.py | 10 +- vtkplotter/examples/advanced/fitspheres1.py | 3 +- vtkplotter/examples/advanced/fitspheres2.py | 21 +- .../advanced/moving_least_squares1D.py | 2 +- .../advanced/moving_least_squares2D.py | 5 +- vtkplotter/examples/advanced/recosurface.py | 8 +- vtkplotter/examples/advanced/skeletonize.py | 7 +- .../examples/advanced/thinplate_morphing2.py | 16 +- vtkplotter/examples/basic/README.md | 2 - vtkplotter/examples/basic/align1.py | 5 +- vtkplotter/examples/basic/boolean.py | 6 +- vtkplotter/examples/basic/closewindow.py | 2 +- vtkplotter/examples/basic/colorcubes.py | 15 +- vtkplotter/examples/basic/lights.py | 2 +- vtkplotter/examples/basic/pca.py | 34 +- vtkplotter/examples/basic/run_all.sh | 194 +- .../examples/other/dolfin/elastodynamics.py | 3 +- vtkplotter/examples/other/makeVideo.py | 25 +- .../examples/other/spherical_harmonics1.py | 38 +- vtkplotter/examples/pyplot/covid19.py | 12 +- vtkplotter/examples/volumetric/probeLine.py | 3 +- .../volumetric/readVolumeAsIsoSurface.py | 8 +- vtkplotter/mesh.py | 140 +- vtkplotter/plotter.py | 6 +- vtkplotter/settings.py | 8 +- vtkplotter/shapes.py | 344 +-- vtkplotter/utils.py | 10 +- vtkplotter/version.py | 2 +- vtkplotter/volume.py | 1 + vtkplotter/vtkio.py | 133 +- 42 files changed, 1941 insertions(+), 1987 deletions(-) rename notebooks/{basic => advanced}/fitline.ipynb (83%) rename vtkplotter/examples/{basic => advanced}/fitline.py (57%) diff --git a/notebooks/basic/fitline.ipynb b/notebooks/advanced/fitline.ipynb similarity index 83% rename from notebooks/basic/fitline.ipynb rename to notebooks/advanced/fitline.ipynb index 39a3f902..820529df 100644 --- a/notebooks/basic/fitline.ipynb +++ b/notebooks/advanced/fitline.ipynb @@ -32,14 +32,7 @@ "# 'data' still contains the last iteration points\n", "vp += Points(data, r=2, c=\"yellow\")\n", "\n", - "# the first fitted slope direction is stored\n", - "# in mesh.info['slope] and mesh.info['normal]\n", - "print(\"Line Fit slope = \", vp.actors[0].info[\"slope\"])\n", - "\n", - "plane = fitPlane(data) # fit a plane\n", - "print(\"Plan Fit normal=\", plane.info[\"normal\"])\n", - "\n", - "vp += plane\n", + "vp += fitPlane(data) # fit a plane\n", "\n", "vp.show()" ] diff --git a/notebooks/basic/pca.ipynb b/notebooks/basic/pca.ipynb index 87b1c1e9..0504770a 100644 --- a/notebooks/basic/pca.ipynb +++ b/notebooks/basic/pca.ipynb @@ -2,35 +2,9 @@ "cells": [ { "cell_type": "code", - "execution_count": 4, + "execution_count": null, "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "\u001b[1m\u001b[32minside points # 249\u001b[0m\n", - "\u001b[1m\u001b[31moutside points # 251\u001b[0m\n", - "\u001b[1ma-sphericity: 0.010310868419372739\u001b[0m\n", - "\u001b[1mError in triangulate()\u001b[0m\n", - "\u001b[1mError in triangulate()\u001b[0m\n" - ] - }, - { - "data": { - "application/vnd.jupyter.widget-view+json": { - "model_id": "a3837ca4488f4c97900adfae6f30cade", - "version_major": 2, - "version_minor": 0 - }, - "text/plain": [ - "Plot(antialias=3, axes=['x', 'y', 'z'], axes_helper=1.0, background_color=16777215, camera=[0.5632771544478462…" - ] - }, - "metadata": {}, - "output_type": "display_data" - } - ], + "outputs": [], "source": [ "\"\"\"\n", "Draw the PCA (Principal Component Analysis) ellipsoid that contains\n", @@ -52,27 +26,20 @@ "vp += Points(ipts, c=\"g\")\n", "vp += Points(opts, c=\"r\")\n", "\n", - "printc(\"inside points #\", len(ipts), c='g')\n", - "printc(\"outside points #\", len(opts), c='r')\n", + "printc(\"inside points #\", ipts.N(), c='g')\n", + "printc(\"outside points #\", opts.N(), c='r')\n", "printc(\"a-sphericity:\", elli.asphericity())\n", "vp.show()" ] }, { "cell_type": "code", - "execution_count": 2, + "execution_count": null, "metadata": {}, "outputs": [], "source": [ "closePlotter()" ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [] } ], "metadata": { diff --git a/setup.py b/setup.py index 5c5c4076..f904a734 100644 --- a/setup.py +++ b/setup.py @@ -83,6 +83,8 @@ # rm examples/other/voronoi3d.txt examples/other/voronoi3d.txt.vol # rm examples/other/embryo.html examples/other/embryo.x3d +# comment out defs in docs.py + # git status # git add [files] # git commit -a -m 'comment' @@ -98,6 +100,7 @@ # release examples ## to generate documentation: +# comment in defs in docs.py # Install the dependencies in docs/requirements.txt # pip install -r docs/requirements.txt # diff --git a/tests/dolfinx/test_aaa.py b/tests/dolfinx/test_aaa.py index 2ac73bed..c6304cca 100644 --- a/tests/dolfinx/test_aaa.py +++ b/tests/dolfinx/test_aaa.py @@ -13,13 +13,13 @@ import numpy as np from petsc4py import PETSc -import dolfin -from dolfin import (MPI, BoxMesh, DirichletBC, Function, VectorFunctionSpace, - cpp) -from dolfin.cpp.mesh import CellType -from dolfin.fem import apply_lifting, assemble_matrix, assemble_vector, set_bc +import dolfinx +from dolfinx import (MPI, UnitCubeMesh, + DirichletBC, Function, VectorFunctionSpace, cpp) +from dolfinx.cpp.mesh import CellType +from dolfinx.fem import apply_lifting, assemble_matrix, assemble_vector, set_bc #from dolfin.io import XDMFFile -from dolfin.la import VectorSpaceBasis +from dolfinx.la import VectorSpaceBasis from ufl import (Identity, SpatialCoordinate, TestFunction, TrialFunction, as_vector, dx, grad, inner, sym, tr) @@ -67,7 +67,7 @@ def build_nullspace(V): # MPI.comm_world, [np.array([0.0, 0.0, 0.0]), # np.array([2.0, 1.0, 1.0])], [12, 12, 12], # CellType.tetrahedron, dolfin.cpp.mesh.GhostMode.none) -cmap = dolfin.fem.create_coordinate_map(mesh.ufl_domain()) +cmap = dolfinx.fem.create_coordinate_map(mesh.ufl_domain()) mesh.geometry.coord_mapping = cmap def boundary(x): @@ -168,7 +168,6 @@ def sigma(v): offscreen=1) ################################################################################# -import numpy as np from vtkplotter import settings, screenshot actor = settings.plotter_instance.actors[0] solution = actor.scalars(0) @@ -179,8 +178,6 @@ def sigma(v): print('min', 'mean', 'max, N:') print(np.min(solution), np.mean(solution), np.max(solution), len(solution)) - - # Plot solution # import matplotlib.pyplot as plt # import dolfin.plotting diff --git a/vtkplotter/addons.py b/vtkplotter/addons.py index 247ac285..7834a682 100644 --- a/vtkplotter/addons.py +++ b/vtkplotter/addons.py @@ -139,6 +139,7 @@ def addScalarBar(mesh, titprop.ShadowOff() titprop.SetColor(c) titprop.SetVerticalJustificationToTop() + titprop.SetFontSize(titleFontSize) sb.SetTitle(title) sb.SetVerticalTitleSeparation(titleYOffset) sb.SetTitleTextProperty(titprop) diff --git a/vtkplotter/analysis.py b/vtkplotter/analysis.py index 5f4a29a3..1155f7d6 100644 --- a/vtkplotter/analysis.py +++ b/vtkplotter/analysis.py @@ -31,8 +31,6 @@ "fitSphere", "pcaEllipsoid", "smoothMLS3D", - "smoothMLS2D", - "smoothMLS1D", "booleanOperation", "surfaceIntersection", "probePoints", @@ -170,7 +168,7 @@ def alignLandmarks(source, target, rigid=False): tf.SetTransform(lmt) tf.Update() mesh = Mesh(tf.GetOutput()) - mesh.info["transform"] = lmt + mesh.transform = lmt pr = vtk.vtkProperty() pr.DeepCopy(source.GetProperty()) mesh.SetProperty(pr) @@ -231,7 +229,7 @@ def alignICP(source, target, iters=100, rigid=False): landmarkTransform.SetTargetLandmarks(targetPoints) if rigid: landmarkTransform.SetModeToRigidBody() - mesh.info["transform"] = landmarkTransform + mesh.transform = landmarkTransform return mesh @@ -270,7 +268,7 @@ def alignProcrustes(sources, rigid=False): mesh.SetProperty(s.GetProperty()) acts.append(mesh) assem = Assembly(acts) - assem.info["transform"] = procrustes.GetLandmarkTransform() + assem.transform = procrustes.GetLandmarkTransform() return assem @@ -279,7 +277,7 @@ def fitLine(points): """ Fits a line through points. - Extra info is stored in ``mesh.info['slope']``, ``mesh.info['center']``, ``mesh.info['variances']``. + Extra info is stored in ``Line.slope``, ``Line.center``, ``Line.variances``. |fitline| |fitline.py|_ """ @@ -296,9 +294,9 @@ def fitLine(points): p1 = datamean - a * vv p2 = datamean + b * vv l = shapes.Line(p1, p2, lw=1) - l.info["slope"] = vv - l.info["center"] = datamean - l.info["variances"] = dd + l.slope = vv + l.center = datamean + l.variances = dd return l @@ -306,7 +304,7 @@ def fitPlane(points): """ Fits a plane to a set of points. - Extra info is stored in ``mesh.info['normal']``, ``mesh.info['center']``, ``mesh.info['variance']``. + Extra info is stored in ``Plane.normal``, ``Plane.center``, ``Plane.variance``. .. hint:: Example: |fitplanes.py|_ """ @@ -319,9 +317,9 @@ def fitPlane(points): s = np.linalg.norm(xyz_max - xyz_min) n = np.cross(vv[0], vv[1]) pla = shapes.Plane(datamean, n, s, s) - pla.info["normal"] = n - pla.info["center"] = datamean - pla.info["variance"] = dd[2] + pla.normal = n + pla.center = datamean + pla.variance = dd[2] return pla @@ -329,7 +327,7 @@ def fitSphere(coords): """ Fits a sphere to a set of points. - Extra info is stored in ``mesh.info['radius']``, ``mesh.info['center']``, ``mesh.info['residue']``. + Extra info is stored in ``Sphere.radius``, ``Sphere.center``, ``Sphere.residue``. .. hint:: Example: |fitspheres1.py|_ @@ -356,9 +354,9 @@ def fitSphere(coords): else: residue = 0 s = shapes.Sphere(center, radius, c=(1,0,0)).wireframe(1) - s.info["radius"] = radius - s.info["center"] = center - s.info["residue"] = residue + s.radius = radius # used by fitSphere + s.center = center + s.residue = residue return s @@ -378,11 +376,7 @@ def pcaEllipsoid(points, pvalue=0.95): |pca| |cell_colony| """ - try: - from scipy.stats import f - except ImportError: - colors.printc("Error in pcaEllipsoid(): scipy not installed. Skip.", c=1) - return None + from scipy.stats import f if isinstance(points, Mesh): coords = points.points() @@ -429,126 +423,126 @@ def pcaEllipsoid(points, pvalue=0.95): return elli -def smoothMLS1D(mesh, f=0.2, radius=None, showNLines=0): - """ - Smooth mesh or points with a `Moving Least Squares` variant. - The list ``mesh.info['variances']`` contain the residue calculated for each point. - Input mesh's polydata is modified. - - :param float f: smoothing factor - typical range is [0,2]. - :param int showNLines: build a mesh showing the fitting line for N random points. - - .. hint:: |moving_least_squares1D.py|_ |skeletonize.py|_ - - |moving_least_squares1D| |skeletonize| - """ - coords = mesh.points() - ncoords = len(coords) - Ncp = int(ncoords * f / 10) - nshow = int(ncoords) - if showNLines: - ndiv = int(nshow / showNLines) - - if not radius and Ncp < 4: - colors.printc("smoothMLS1D: Please choose a fraction higher than " + str(f), c=1) - Ncp = 4 - - variances, newline, acts = [], [], [] - for i, p in enumerate(coords): - - points = mesh.closestPoint(p, N=Ncp, radius=radius) - if len(points) < 4: - continue - - points = np.array(points) - pointsmean = points.mean(axis=0) # plane center - uu, dd, vv = np.linalg.svd(points - pointsmean) - newp = np.dot(p - pointsmean, vv[0]) * vv[0] + pointsmean - variances.append(dd[1] + dd[2]) - newline.append(newp) - - if showNLines and not i % ndiv: - fline = fitLine(points) # fitting plane - iapts = shapes.Points(points) # blue points - acts += [fline, iapts] - - pcloud = shapes.Points(newline, c="r", alpha=0.5) - pcloud.GetProperty().SetPointSize(mesh.GetProperty().GetPointSize()) - - if showNLines: - asse = Assembly([pcloud] + acts) - asse.info["variances"] = np.array(variances) - return asse # NB: a demo mesh is returned - else: - pcloud.info["variances"] = np.array(variances) - return pcloud - -def smoothMLS2D(mesh, f=0.2, radius=None, decimate=1, showNPlanes=0): - """ - Smooth mesh or points with a `Moving Least Squares` algorithm variant. - The list ``mesh.info['variances']`` contains the residue calculated for each point. - - :param float f: smoothing factor - typical range is [0,2]. Ignored if ``radius`` is set. - :param float radius: radius search in absolute units. If set then ``f`` is ignored. - :param int decimate: decimation integer factor. - :param showNPlanes: build a demo object showing the fitting plane for N random points. - - .. hint:: |moving_least_squares2D.py|_ |recosurface.py|_ - - |moving_least_squares2D| |recosurface| - """ - coords = mesh.points() - ncoords = len(coords) - Ncp = int(ncoords * f / 100) - nshow = int(ncoords / decimate) - decimate = int(decimate) - if showNPlanes: - ndiv = int(nshow / showNPlanes * decimate) - - if radius: - print("smoothMLS2D: Searching radius, #pt:", radius, ncoords) - else: - if Ncp < 5: - colors.printc("~target Please choose a fraction higher than " + str(f), c=1) - Ncp = 5 - print("smoothMLS2D: Searching #neighbours, #pt:", Ncp, ncoords) - - variances, newpts, acts = [], [], [] - pb = utils.ProgressBar(0, ncoords) - for i, p in enumerate(coords): - pb.print("smoothing mesh ...") - if i % decimate: - continue - - points = mesh.closestPoint(p, N=Ncp, radius=radius) - if radius and len(points) < 5: - continue - - pointsmean = points.mean(axis=0) # plane center - uu, dd, vv = np.linalg.svd(points - pointsmean) - a, b, c = np.cross(vv[0], vv[1]) # normal - d, e, f = pointsmean # plane center - x, y, z = p - t = a * d - a * x + b * e - b * y + c * f - c * z # /(a*a+b*b+c*c) - variances.append(dd[2]) - newpts.append((x + t*a, y + t*b, z + t*c)) - - if showNPlanes and not i % ndiv: - plane = fitPlane(points).alpha(0.3) # fitting plane - iapts = shapes.Points(points) # blue points - acts += [plane, iapts] - - pcloud = shapes.Points(newpts, c="r", alpha=0.5, r=2) - pcloud.GetProperty().SetPointSize(mesh.GetProperty().GetPointSize()) - - if showNPlanes: - asse = Assembly([pcloud] + acts) - asse.info["variances"] = np.array(variances) - return asse # NB: a demo Assembly is returned - else: - pcloud.info["variances"] = np.array(variances) - - return pcloud +#def smoothMLS1D(mesh, f=0.2, radius=None, showNLines=0): +# """ +# Smooth mesh or points with a `Moving Least Squares` variant. +# The list ``mesh.info['variances']`` contain the residue calculated for each point. +# Input mesh's polydata is modified. +# +# :param float f: smoothing factor - typical range is [0,2]. +# :param int showNLines: build a mesh showing the fitting line for N random points. +# +# .. hint:: |moving_least_squares1D.py|_ |skeletonize.py|_ +# +# |moving_least_squares1D| |skeletonize| +# """ +# coords = mesh.points() +# ncoords = len(coords) +# Ncp = int(ncoords * f / 10) +# nshow = int(ncoords) +# if showNLines: +# ndiv = int(nshow / showNLines) +# +# if not radius and Ncp < 4: +# colors.printc("smoothMLS1D: Please choose a fraction higher than " + str(f), c=1) +# Ncp = 4 +# +# variances, newline, acts = [], [], [] +# for i, p in enumerate(coords): +# +# points = mesh.closestPoint(p, N=Ncp, radius=radius) +# if len(points) < 4: +# continue +# +# points = np.array(points) +# pointsmean = points.mean(axis=0) # plane center +# uu, dd, vv = np.linalg.svd(points - pointsmean) +# newp = np.dot(p - pointsmean, vv[0]) * vv[0] + pointsmean +# variances.append(dd[1] + dd[2]) +# newline.append(newp) +# +# if showNLines and not i % ndiv: +# fline = fitLine(points) # fitting plane +# iapts = shapes.Points(points) # blue points +# acts += [fline, iapts] +# +# pcloud = shapes.Points(newline, c="r", alpha=0.5) +# pcloud.GetProperty().SetPointSize(mesh.GetProperty().GetPointSize()) +# +# if showNLines: +# asse = Assembly([pcloud] + acts) +# asse.info["variances"] = np.array(variances) +# return asse # NB: a demo mesh is returned +# else: +# pcloud.info["variances"] = np.array(variances) +# return pcloud +# +#def smoothMLS2D(mesh, f=0.2, radius=None, decimate=1, showNPlanes=0): +# """ +# Smooth mesh or points with a `Moving Least Squares` algorithm variant. +# The list ``mesh.info['variances']`` contains the residue calculated for each point. +# +# :param float f: smoothing factor - typical range is [0,2]. Ignored if ``radius`` is set. +# :param float radius: radius search in absolute units. If set then ``f`` is ignored. +# :param int decimate: decimation integer factor. +# :param showNPlanes: build a demo object showing the fitting plane for N random points. +# +# .. hint:: |moving_least_squares2D.py|_ |recosurface.py|_ +# +# |moving_least_squares2D| |recosurface| +# """ +# coords = mesh.points() +# ncoords = len(coords) +# Ncp = int(ncoords * f / 100) +# nshow = int(ncoords / decimate) +# decimate = int(decimate) +# if showNPlanes: +# ndiv = int(nshow / showNPlanes * decimate) +# +# if radius: +# print("smoothMLS2D: Searching radius, #pt:", radius, ncoords) +# else: +# if Ncp < 5: +# colors.printc("~target Please choose a fraction higher than " + str(f), c=1) +# Ncp = 5 +# print("smoothMLS2D: Searching #neighbours, #pt:", Ncp, ncoords) +# +# variances, newpts, acts = [], [], [] +# pb = utils.ProgressBar(0, ncoords) +# for i, p in enumerate(coords): +# pb.print("smoothing mesh ...") +# if i % decimate: +# continue +# +# points = mesh.closestPoint(p, N=Ncp, radius=radius) +# if radius and len(points) < 5: +# continue +# +# pointsmean = points.mean(axis=0) # plane center +# uu, dd, vv = np.linalg.svd(points - pointsmean) +# a, b, c = np.cross(vv[0], vv[1]) # normal +# d, e, f = pointsmean # plane center +# x, y, z = p +# t = a * d - a * x + b * e - b * y + c * f - c * z # /(a*a+b*b+c*c) +# variances.append(dd[2]) +# newpts.append((x + t*a, y + t*b, z + t*c)) +# +# if showNPlanes and not i % ndiv: +# plane = fitPlane(points).alpha(0.3) # fitting plane +# iapts = shapes.Points(points) # blue points +# acts += [plane, iapts] +# +# pcloud = shapes.Points(newpts, c="r", alpha=0.5, r=2) +# pcloud.GetProperty().SetPointSize(mesh.GetProperty().GetPointSize()) +# +# if showNPlanes: +# asse = Assembly([pcloud] + acts) +# asse.info["variances"] = np.array(variances) +# return asse # NB: a demo Assembly is returned +# else: +# pcloud.info["variances"] = np.array(variances) +# +# return pcloud def smoothMLS3D(meshs, neighbours=10): @@ -614,64 +608,87 @@ def smoothMLS3D(meshs, neighbours=10): return act -def recoSurface(pts, bins=256, radius=None): +def extractSurface(volume, radius=0.5): + """Generate the zero-crossing isosurface from truncated signed distance volume in input. + Output is an ``Mesh`` object. + """ + img = _getinput(volume) + fe = vtk.vtkExtractSurface() + fe.SetInputData(img) + fe.SetRadius(radius) + fe.Update() + return Mesh(fe.GetOutput()) + + +def recoSurface(pts, dims=(250,250,250), radius=None, + sampleSize=None, holeFilling=True, bounds=(), pad=0.1): """ Surface reconstruction from a scattered cloud of points. - :param int bins: number of voxels in x, y and z to control precision. + :param int dims: number of voxels in x, y and z to control precision. + :param float radius: radius of influence of each point. + Smaller values generally improve performance markedly. + Note that after the signed distance function is computed, + any voxel taking on the value >= radius + is presumed to be "unseen" or uninitialized. + :param int sampleSize: if normals are not present + they will be calculated using this sample size per point. + :param bool holeFilling: enables hole filling, this generates + separating surfaces between the empty and unseen portions of the volume. + :param list bounds: region in space in which to perform the sampling + in format (xmin,xmax, ymin,ymax, zim, zmax) + :param float pad: increase by this fraction the bounding box |recosurface| |recosurface.py|_ """ + if not utils.isSequence(dims): + dims = (dims,dims,dims) if isinstance(pts, Mesh): - pts = pts.points() - N = len(pts) - if N < 50: - print("recoSurface: Use at least 50 points.") - return None - pts = np.array(pts) - - ptsSource = vtk.vtkPointSource() - ptsSource.SetNumberOfPoints(N) - ptsSource.Update() - vpts = ptsSource.GetOutput().GetPoints() - for i, p in enumerate(pts): - vpts.SetPoint(i, p) - polyData = ptsSource.GetOutput() - - distance = vtk.vtkSignedDistance() - f = 0.1 - x0, x1, y0, y1, z0, z1 = polyData.GetBounds() - distance.SetBounds(x0-(x1-x0)*f, x1+(x1-x0)*f, - y0-(y1-y0)*f, y1+(y1-y0)*f, - z0-(z1-z0)*f, z1+(z1-z0)*f) + polyData = pts.polydata() + else: + polyData = shapes.Points(pts).polydata() + + sdf = vtk.vtkSignedDistance() + + if len(bounds)==6: + sdf.SetBounds(bounds) + else: + x0, x1, y0, y1, z0, z1 = polyData.GetBounds() + sdf.SetBounds(x0-(x1-x0)*pad, x1+(x1-x0)*pad, + y0-(y1-y0)*pad, y1+(y1-y0)*pad, + z0-(z1-z0)*pad, z1+(z1-z0)*pad) + if polyData.GetPointData().GetNormals(): - distance.SetInputData(polyData) + sdf.SetInputData(polyData) else: normals = vtk.vtkPCANormalEstimation() normals.SetInputData(polyData) - normals.SetSampleSize(int(N / 50)) + if not sampleSize: + sampleSize = int(polyData.GetNumberOfPoints()/50) + normals.SetSampleSize(sampleSize) normals.SetNormalOrientationToGraphTraversal() - distance.SetInputConnection(normals.GetOutputPort()) - print("Recalculating normals for", N, "Points, sample size=", int(N / 50)) + sdf.SetInputConnection(normals.GetOutputPort()) + #print("Recalculating normals with sample size =", sampleSize) if radius is None: b = polyData.GetBounds() - diagsize = np.sqrt((b[1] - b[0]) ** 2 + (b[3] - b[2]) ** 2 + (b[5] - b[4]) ** 2) - radius = diagsize / bins * 5 - distance.SetRadius(radius) - distance.SetDimensions(bins, bins, bins) - distance.Update() + diagsize = np.sqrt((b[1]-b[0])**2 + (b[3]-b[2])**2 + (b[5]-b[4])**2) + radius = diagsize / (sum(dims)/3) * 5 + #print("Calculating mesh from points with radius =", radius) + + sdf.SetRadius(radius) + sdf.SetDimensions(dims) + sdf.Update() - print("Calculating mesh from points with R =", radius) surface = vtk.vtkExtractSurface() surface.SetRadius(radius * 0.99) - surface.HoleFillingOn() + surface.SetHoleFilling(holeFilling) surface.ComputeNormalsOff() surface.ComputeGradientsOff() - surface.SetInputConnection(distance.GetOutputPort()) + surface.SetInputConnection(sdf.GetOutputPort()) surface.Update() - return Mesh(surface.GetOutput(), "gold").bc("tomato") + return Mesh(surface.GetOutput()) def cluster(points, radius): @@ -1168,19 +1185,6 @@ def mesh2Volume(mesh, spacing=(1, 1, 1)): imgstenc.Update() return Volume(imgstenc.GetOutput()) - -def extractSurface(volume, radius=0.5): - """Generate the zero-crossing isosurface from truncated signed distance volume in input. - Output is an ``Mesh`` object. - """ - img = _getinput(volume) - fe = vtk.vtkExtractSurface() - fe.SetInputData(img) - fe.SetRadius(radius) - fe.Update() - return Mesh(fe.GetOutput()).phong() - - def projectSphereFilter(mesh): """ Project a spherical-like object onto a plane. @@ -1828,6 +1832,8 @@ def pointDensity(mesh, dims=(30,30,30), bounds=None, radius=None, computeGradien See example script: |pointDensity.py|_ """ + if not utils.isSequence(dims): + dims = (dims,dims,dims) pdf = vtk.vtkPointDensityFilter() pdf.SetInputData(mesh.polydata()) pdf.SetSampleDimensions(dims) diff --git a/vtkplotter/base.py b/vtkplotter/base.py index f1707b62..4e42d7a0 100644 --- a/vtkplotter/base.py +++ b/vtkplotter/base.py @@ -52,6 +52,7 @@ def __init__(self): self.renderedAt = set() self.flagText = None self._mapper = None + self.transform = None def mapper(self, newMapper=None): """Return the ``vtkMapper`` data object, or update it with a new one.""" @@ -449,11 +450,6 @@ def scale(self, s=None, absolute=False): self.SetScale(np.multiply(self.GetScale(), s)) return self - def print(self): - """Print ``Mesh``, ``Assembly``, ``Volume`` or ``Image`` infos.""" - utils.printInfo(self) - return self - def on(self): """Switch on object visibility. Object is not removed.""" self.VisibilityOn() @@ -626,12 +622,11 @@ def cellCenters(self): def getTransform(self): """ - Check if ``info['transform']`` exists and returns a ``vtkTransform``. + Check if ``info.transform`` exists and returns a ``vtkTransform``. Otherwise return current user transformation (where the object is currently placed). """ - if "transform" in self.info.keys(): - T = self.info["transform"] - return T + if self.transform: + return self.transform else: T = self.GetMatrix() tr = vtk.vtkTransform() diff --git a/vtkplotter/docs.py b/vtkplotter/docs.py index 5eb3e6d6..16bd3f39 100644 --- a/vtkplotter/docs.py +++ b/vtkplotter/docs.py @@ -56,7 +56,7 @@ def tips(): msg += "| x toggle mesh visibility |\n" msg += "| X invoke a cutter widget tool |\n" msg += "| 1-3 change mesh color |\n" - msg += "| 4 use scalars as colors, if present |\n" + msg += "| 4 use data array as colors, if present |\n" msg += "| 5 change background color |\n" msg += "| 0-9 (on keypad) change axes style |\n" msg += "| k cycle available lighting styles |\n" @@ -121,1183 +121,1183 @@ def tips(): """ -#_defs = "" - -_defs = """ - -.. |tutorial_spline| image:: https://user-images.githubusercontent.com/32848391/35976041-15781de8-0cdf-11e8-997f-aeb725bc33cc.png - :width: 300 px - -.. |tutorial.py| replace:: tutorial.py -.. _tutorial.py: https://github.com/marcomusy/vtkplotter/blob/master/vtkplotter/examples/tutorial.py - - -.. |thinplate_grid.py| replace:: thinplate_grid.py -.. _thinplate_grid.py: https://github.com/marcomusy/vtkplotter/blob/master/vtkplotter/examples/advanced/thinplate_grid.py -.. |thinplate_grid| image:: https://user-images.githubusercontent.com/32848391/51433540-d188b380-1c4c-11e9-81e7-a1cf4642c54b.png - :width: 300 px - :target: thinplate_grid.py_ - :alt: thinplate_grid.py - -.. |gyroscope2.py| replace:: gyroscope2.py -.. _gyroscope2.py: https://github.com/marcomusy/vtkplotter/blob/master/vtkplotter/examples/simulations/gyroscope2.py -.. |gyroscope2| image:: https://user-images.githubusercontent.com/32848391/50738942-687b5780-11d9-11e9-97f0-72bbd63f7d6e.gif - :width: 300 px - :target: gyroscope2.py_ - :alt: gyroscope2.py - -.. |trail.py| replace:: trail.py -.. _trail.py: https://github.com/marcomusy/vtkplotter/blob/master/vtkplotter/examples/basic/trail.py -.. |trail| image:: https://user-images.githubusercontent.com/32848391/58370826-4aee2680-7f0b-11e9-91e6-3120770cfede.gif - :width: 300 px - :target: trail.py_ - :alt: trail.py - -.. |fillholes.py| replace:: fillholes.py -.. _fillholes.py: https://github.com/marcomusy/vtkplotter/blob/master/vtkplotter/examples/basic/fillholes.py - -.. |quadratic_morphing.py| replace:: quadratic_morphing.py -.. _quadratic_morphing.py: https://github.com/marcomusy/vtkplotter/blob/master/vtkplotter/examples/advanced/quadratic_morphing.py -.. |quadratic_morphing| image:: https://user-images.githubusercontent.com/32848391/50738890-db380300-11d8-11e9-9cef-4c1276cca334.jpg - :width: 300 px - :target: quadratic_morphing.py_ - :alt: quadratic_morphing.py - -.. |align1.py| replace:: align1.py -.. _align1.py: https://github.com/marcomusy/vtkplotter/blob/master/vtkplotter/examples/basic/align1.py -.. |align1| image:: https://user-images.githubusercontent.com/32848391/50738875-c196bb80-11d8-11e9-8bdc-b80fd01a928d.jpg - :width: 300 px - :target: align1.py_ - :alt: align1.py - -.. |align2.py| replace:: align2.py -.. _align2.py: https://github.com/marcomusy/vtkplotter/blob/master/vtkplotter/examples/basic/align2.py -.. |align2| image:: https://user-images.githubusercontent.com/32848391/50738874-c196bb80-11d8-11e9-9587-2177d1680b70.jpg - :width: 300 px - :target: align2.py_ - :alt: align2.py - -.. |mirror.py| replace:: mirror.py -.. _mirror.py: https://github.com/marcomusy/vtkplotter/blob/master/vtkplotter/examples/basic/mirror.py -.. |mirror| image:: https://user-images.githubusercontent.com/32848391/50738855-bf346180-11d8-11e9-97a0-c9aaae6ce052.jpg - :target: mirror.py_ - :alt: mirror.py - -.. |shrink.py| replace:: shrink.py -.. _shrink.py: https://github.com/marcomusy/vtkplotter/blob/master/vtkplotter/examples/basic/shrink.py -.. |shrink| image:: https://user-images.githubusercontent.com/32848391/46819143-41042280-cd83-11e8-9492-4f53679887fa.png - :width: 300 px - :target: shrink.py_ - :alt: shrink.py - -.. |aspring.py| replace:: aspring.py -.. _aspring.py: https://github.com/marcomusy/vtkplotter/blob/master/vtkplotter/examples/simulations/aspring.py -.. |aspring| image:: https://user-images.githubusercontent.com/32848391/36788885-e97e80ae-1c8f-11e8-8b8f-ffc43dad1eb1.gif - :width: 300 px - :target: aspring.py_ - :alt: aspring.py - -.. |delaunay2d.py| replace:: delaunay2d.py -.. _delaunay2d.py: https://github.com/marcomusy/vtkplotter/blob/master/vtkplotter/examples/basic/delaunay2d.py -.. |delaunay2d| image:: https://user-images.githubusercontent.com/32848391/50738865-c0658e80-11d8-11e9-8616-b77363aa4695.jpg - :width: 300 px - :target: delaunay2d.py_ - :alt: delaunay2d.py - -.. |moving_least_squares1D.py| replace:: moving_least_squares1D.py -.. _moving_least_squares1D.py: https://github.com/marcomusy/vtkplotter/blob/master/vtkplotter/examples/advanced/moving_least_squares1D.py -.. |moving_least_squares1D| image:: https://user-images.githubusercontent.com/32848391/50738937-61544980-11d9-11e9-8be8-8826032b8baf.jpg - :width: 300 px - :target: moving_least_squares1D.py_ - :alt: moving_least_squares1D.py - -.. |recosurface.py| replace:: recosurface.py -.. _recosurface.py: https://github.com/marcomusy/vtkplotter/blob/master/vtkplotter/examples/advanced/recosurface.py -.. |recosurface| image:: https://user-images.githubusercontent.com/32848391/46817107-b3263880-cd7e-11e8-985d-f5d158992f0c.png - :target: recosurface.py_ - :alt: recosurface.py - -.. |fatlimb.py| replace:: fatlimb.py -.. _fatlimb.py: https://github.com/marcomusy/vtkplotter/blob/master/vtkplotter/examples/advanced/fatlimb.py -.. |fatlimb| image:: https://user-images.githubusercontent.com/32848391/50738945-7335ec80-11d9-11e9-9d3f-c6c19df8f10d.jpg - :width: 300 px - :target: fatlimb.py_ - :alt: fatlimb.py - -.. |largestregion.py| replace:: largestregion.py -.. _largestregion.py: https://github.com/marcomusy/vtkplotter/blob/master/vtkplotter/examples/basic/largestregion.py - -.. |fitplanes.py| replace:: fitplanes.py -.. _fitplanes.py: https://github.com/marcomusy/vtkplotter/blob/master/vtkplotter/examples/advanced/fitplanes.py - -.. |mesh_coloring.py| replace:: mesh_coloring.py -.. _mesh_coloring.py: https://github.com/marcomusy/vtkplotter/blob/master/vtkplotter/examples/basic/mesh_coloring.py -.. |mesh_coloring| image:: https://user-images.githubusercontent.com/32848391/50738856-bf346180-11d8-11e9-909c-a3f9d32c4e8c.jpg - :width: 300 px - :target: mesh_coloring.py_ - :alt: mesh_coloring.py - -.. |mesh_alphas.py| replace:: mesh_alphas.py -.. _mesh_alphas.py: https://github.com/marcomusy/vtkplotter/blob/master/vtkplotter/examples/basic/mesh_alphas.py -.. |mesh_alphas| image:: https://user-images.githubusercontent.com/32848391/50738857-bf346180-11d8-11e9-80a1-d283aed0b305.jpg - :width: 300 px - :target: mesh_alphas.py_ - :alt: mesh_alphas.py - -.. |mesh_bands.py| replace:: mesh_bands.py -.. _mesh_bands.py: https://github.com/marcomusy/vtkplotter/blob/master/vtkplotter/examples/basic/mesh_bands.py -.. |mesh_bands| image:: https://user-images.githubusercontent.com/32848391/51211548-26a78b00-1916-11e9-9306-67b677d1be3a.png - :width: 300 px - :target: mesh_bands.py_ - :alt: mesh_bands.py - -.. |mesh_custom.py| replace:: mesh_custom.py -.. _mesh_custom.py: https://github.com/marcomusy/vtkplotter/blob/master/vtkplotter/examples/mesh_custom.py -.. |mesh_custom| image:: https://user-images.githubusercontent.com/32848391/51390972-20d9c180-1b31-11e9-955d-025f1ef24cb7.png - :width: 300 px - :target: mesh_custom.py_ - :alt: mesh_custom.py - -.. |connVtx.py| replace:: connVtx.py -.. _connVtx.py: https://github.com/marcomusy/vtkplotter/blob/master/vtkplotter/examples/basic/connVtx.py -.. |connVtx| image:: https://user-images.githubusercontent.com/32848391/51558919-ec436e00-1e80-11e9-91ac-0787c35fc20e.png - :width: 300 px - :target: connVtx.py_ - :alt: connVtx.py - -.. |spherical_harmonics1.py| replace:: spherical_harmonics1.py -.. _spherical_harmonics1.py: https://github.com/marcomusy/vtkplotter/blob/master/vtkplotter/examples/other/spherical_harmonics1.py - -.. |spherical_harmonics2.py| replace:: spherical_harmonics2.py -.. _spherical_harmonics2.py: https://github.com/marcomusy/vtkplotter/blob/master/vtkplotter/examples/other/spherical_harmonics2.py - -.. |skeletonize.py| replace:: skeletonize.py -.. _skeletonize.py: https://github.com/marcomusy/vtkplotter/blob/master/vtkplotter/examples/advanced/skeletonize.py -.. |skeletonize| image:: https://user-images.githubusercontent.com/32848391/46820954-c5f13b00-cd87-11e8-87aa-286528a09de8.png - :target: spherical_harmonics2.py_ - :alt: skeletonize.py - -.. |gyroscope1.py| replace:: gyroscope1.py -.. _gyroscope1.py: https://github.com/marcomusy/vtkplotter/blob/master/vtkplotter/examples/simulations/gyroscope1.py -.. |gyroscope1| image:: https://user-images.githubusercontent.com/32848391/39766016-85c1c1d6-52e3-11e8-8575-d167b7ce5217.gif - :width: 300 px - :target: gyroscope1.py_ - :alt: gyroscope1.py - -.. |icon.py| replace:: icon.py -.. _icon.py: https://github.com/marcomusy/vtkplotter/blob/master/vtkplotter/examples/basic/icon.py -.. |icon| image:: https://user-images.githubusercontent.com/32848391/50739009-2bfc2b80-11da-11e9-9e2e-a5e0e987a91a.jpg - :width: 300 px - :target: icon.py_ - -.. |lights.py| replace:: lights.py -.. _lights.py: https://github.com/marcomusy/vtkplotter/blob/master/vtkplotter/examples/basic/lights.py - :width: 300 px - :target: lights.py_ - :alt: lights.py - -.. |lorenz.py| replace:: lorenz.py -.. _lorenz.py: https://github.com/marcomusy/vtkplotter/blob/master/vtkplotter/examples/basic/lorenz.py -.. |lorenz| image:: https://user-images.githubusercontent.com/32848391/46818115-be7a6380-cd80-11e8-8ffb-60af2631bf71.png - :width: 300 px - :target: lorenz.py_ - :alt: lorenz.py - -.. |sliders.py| replace:: sliders.py -.. _sliders.py: https://github.com/marcomusy/vtkplotter/blob/master/vtkplotter/examples/basic/sliders.py -.. |sliders| image:: https://user-images.githubusercontent.com/32848391/50738848-be033480-11d8-11e9-9b1a-c13105423a79.jpg - :width: 300 px - :target: sliders.py_ - :alt: sliders.py - -.. |buttons.py| replace:: buttons.py -.. _buttons.py: https://github.com/marcomusy/vtkplotter/blob/master/vtkplotter/examples/basic/buttons.py -.. |buttons| image:: https://user-images.githubusercontent.com/32848391/50738870-c0fe2500-11d8-11e9-9b78-92754f5c5968.jpg - :width: 300 px - :target: buttons.py_ - :alt: buttons.py - -.. |cutter.py| replace:: cutter.py -.. _cutter.py: https://github.com/marcomusy/vtkplotter/blob/master/vtkplotter/examples/basic/cutter.py -.. |cutter| image:: https://user-images.githubusercontent.com/32848391/50738866-c0658e80-11d8-11e9-955b-551d4d8b0db5.jpg - :width: 300 px - :target: cutter.py_ - :alt: cutter.py - -.. |makeVideo.py| replace:: makeVideo.py -.. _makeVideo.py: https://github.com/marcomusy/vtkplotter/blob/master/vtkplotter/examples/other/makeVideo.py -.. |makeVideo| image:: https://user-images.githubusercontent.com/32848391/50739007-2bfc2b80-11da-11e9-97e6-620a3541a6fa.jpg - :width: 300 px - :target: makeVideo.py_ - :alt: makeVideo.py - -.. |fitspheres1.py| replace:: fitspheres1.py -.. _fitspheres1.py: https://github.com/marcomusy/vtkplotter/blob/master/vtkplotter/examples/advanced/fitspheres1.py - -.. |fitspheres2.py| replace:: fitspheres2.py -.. _fitspheres2.py: https://github.com/marcomusy/vtkplotter/blob/master/vtkplotter/examples/advanced/fitspheres2.py -.. |fitspheres2| image:: https://user-images.githubusercontent.com/32848391/50738943-687b5780-11d9-11e9-87a6-054e0fe76241.jpg - :width: 300 px - :target: fitspheres2.py_ - :alt: fitspheres2.py - -.. |plot4_fxy.py| replace:: plot4_fxy.py -.. _plot4_fxy.py: https://github.com/marcomusy/vtkplotter/blob/master/vtkplotter/examples/pyplot/plot4_fxy.py -.. |plot4_fxy| image:: https://user-images.githubusercontent.com/32848391/36611824-fd524fac-18d4-11e8-8c76-d3d1b1bb3954.png - :width: 300 px - :target: plot4_fxy.py_ - :alt: plot4_fxy.py - -.. |histo_hexagonal.py| replace:: histo_hexagonal.py -.. _histo_hexagonal.py: https://github.com/marcomusy/vtkplotter/blob/master/vtkplotter/examples/pyplot/histo_hexagonal.py -.. |histo_hexagonal| image:: https://user-images.githubusercontent.com/32848391/72434748-b471bc80-379c-11ea-95d7-d70333770582.png - :width: 300 px - :target: histo_hexagonal.py_ - :alt: histo_hexagonal.py - -.. |histo_1D.py| replace:: histo_1D.py -.. _histo_1D.py: https://github.com/marcomusy/vtkplotter/blob/master/vtkplotter/examples/pyplot/histo_1D.py -.. |histo_1D| image:: https://user-images.githubusercontent.com/32848391/68141260-77cc4e00-ff2d-11e9-9280-0efc5b87314d.png - :width: 300 px - :target: histo_1D.py_ - :alt: histo_1D.py - -.. |histo_violin.py| replace:: histo_violin.py -.. _histo_violin.py: https://github.com/marcomusy/vtkplotter/blob/master/vtkplotter/examples/pyplot/histo_violin.py -.. |histo_violin| image:: https://user-images.githubusercontent.com/32848391/73481240-b55d3d80-439b-11ea-89a4-6c35ecc84b0d.png - :width: 300 px - :target: histo_violin.py_ - :alt: histo_violin.py - - -.. |align3.py| replace:: align3.py -.. _align3.py: https://github.com/marcomusy/vtkplotter/blob/master/vtkplotter/examples/basic/align3.py -.. |align3| image:: https://user-images.githubusercontent.com/32848391/50738873-c196bb80-11d8-11e9-8653-a41108a5f02d.png - :width: 300 px - :target: align3.py_ - :alt: align3.py - -.. |pca.py| replace:: pca.py -.. _pca.py: https://github.com/marcomusy/vtkplotter/blob/master/vtkplotter/examples/basic/pca.py -.. |pca| image:: https://user-images.githubusercontent.com/32848391/50738852-be9bcb00-11d8-11e9-8ac8-ad9278d9cee0.jpg - :width: 300 px - :target: pca.py_ - :alt: pca.py - -.. |cell_colony.py| replace:: cell_colony.py -.. _cell_colony.py: https://github.com/marcomusy/vtkplotter/blob/master/vtkplotter/examples/simulations/cell_colony.py -.. |cell_colony| image:: https://user-images.githubusercontent.com/32848391/50738947-7335ec80-11d9-11e9-9a45-6053b4eaf9f9.jpg - :width: 300 px - :target: cell_colony.py_ - :alt: cell_colony.py - -.. |mesh_smoothers.py| replace:: mesh_smoothers.py -.. _mesh_smoothers.py: https://github.com/marcomusy/vtkplotter/blob/master/vtkplotter/examples/advanced/mesh_smoothers.py -.. |mesh_smoothers| image:: https://user-images.githubusercontent.com/32848391/50738939-67e2c100-11d9-11e9-90cb-716ff3f03f67.jpg - :width: 300 px - :target: mesh_smoothers.py_ - :alt: mesh_smoothers.py - -.. |moving_least_squares3D.py| replace:: moving_least_squares3D.py -.. _moving_least_squares3D.py: https://github.com/marcomusy/vtkplotter/blob/master/vtkplotter/examples/advanced/moving_least_squares3D.py -.. |moving_least_squares3D| image:: https://user-images.githubusercontent.com/32848391/50738935-61544980-11d9-11e9-9c20-f2ce944d2238.jpg - :width: 300 px - :target: moving_least_squares3D.py_ - :alt: moving_least_squares3D.py - -.. |moving_least_squares2D.py| replace:: moving_least_squares2D.py -.. _moving_least_squares2D.py: https://github.com/marcomusy/vtkplotter/blob/master/vtkplotter/examples/advanced/moving_least_squares2D.py -.. |moving_least_squares2D| image:: https://user-images.githubusercontent.com/32848391/50738936-61544980-11d9-11e9-9efb-e2a923762b72.jpg - :width: 300 px - :target: moving_least_squares2D.py_ - :alt: moving_least_squares2D.py - -.. |boolean.py| replace:: boolean.py -.. _boolean.py: https://github.com/marcomusy/vtkplotter/blob/master/vtkplotter/examples/basic/boolean.py -.. |boolean| image:: https://user-images.githubusercontent.com/32848391/50738871-c0fe2500-11d8-11e9-8812-442b69be6db9.png - :width: 300 px - :target: boolean.py_ - :alt: boolean.py - -.. |surfIntersect.py| replace:: surfIntersect.py -.. _surfIntersect.py: https://github.com/marcomusy/vtkplotter/blob/master/vtkplotter/examples/basic/surfIntersect.py - -.. |probeLine.py| replace:: probeLine.py -.. _probeLine.py: https://github.com/marcomusy/vtkplotter/blob/master/vtkplotter/examples/volumetric/probeLine.py -.. |probeLine| image:: https://user-images.githubusercontent.com/32848391/48198460-3aa0a080-e359-11e8-982d-23fadf4de66f.jpg - :width: 300 px - :target: probeLine.py_ - :alt: probeLine.py - -.. |probePlane.py| replace:: probePlane.py -.. _probePlane.py: https://github.com/marcomusy/vtkplotter/blob/master/vtkplotter/examples/volumetric/probePlane.py -.. |probePlane| image:: https://user-images.githubusercontent.com/32848391/48198461-3aa0a080-e359-11e8-8c29-18f287f105e6.jpg - :width: 300 px - :target: probePlane.py_ - :alt: probePlane.py - -.. |volumeOperations.py| replace:: volumeOperations.py -.. _volumeOperations.py: https://github.com/marcomusy/vtkplotter/blob/master/vtkplotter/examples/volumetric/volumeOperations.py -.. |volumeOperations| image:: https://user-images.githubusercontent.com/32848391/48198940-d1ba2800-e35a-11e8-96a7-ffbff797f165.jpg - :width: 300 px - :alt: volumeOperations.py - -.. |clustering.py| replace:: clustering.py -.. _clustering.py: https://github.com/marcomusy/vtkplotter/blob/master/vtkplotter/examples/basic/clustering.py -.. |clustering| image:: https://user-images.githubusercontent.com/32848391/46817286-2039ce00-cd7f-11e8-8b29-42925e03c974.png - :width: 300 px - :target: clustering.py_ - :alt: clustering.py - -.. |thinplate_morphing1.py| replace:: thinplate_morphing1.py -.. _thinplate_morphing1.py: https://github.com/marcomusy/vtkplotter/blob/master/vtkplotter/examples/advanced/thinplate_morphing1.py -.. |thinplate_morphing1| image:: https://user-images.githubusercontent.com/32848391/51403917-34495480-1b52-11e9-956c-918c7805a9b5.png - :width: 300 px - :target: thinplate_morphing1.py_ - :alt: thinplate_morphing1.py - -.. |colorcubes.py| replace:: colorcubes.py -.. _colorcubes.py: https://github.com/marcomusy/vtkplotter/blob/master/vtkplotter/examples/basic/colorcubes.py -.. |colorcubes| image:: https://user-images.githubusercontent.com/32848391/50738867-c0658e80-11d8-11e9-9e05-ac69b546b7ec.png - :width: 300 px - :target: colorcubes.py_ - :alt: colorcubes.py - -.. |colorpalette.py| replace:: colorpalette.py -.. _colorpalette.py: https://github.com/marcomusy/vtkplotter/blob/master/vtkplotter/examples/other/colorpalette.py -.. |colorpalette| image:: https://user-images.githubusercontent.com/32848391/50739011-2c94c200-11da-11e9-8f36-ede1b2a014a8.jpg - :width: 300 px - :target: colorpalette.py - :alt: colorpalette.py - -.. |colormaps| image:: https://user-images.githubusercontent.com/32848391/50738804-577e1680-11d8-11e9-929e-fca17a8ac6f3.jpg - :width: 450 px - :alt: colormaps - -.. |tannerhelland| replace:: tannerhelland -.. _tannerhelland: http://www.tannerhelland.com/4435/convert-temperature-rgb-algorithm-code - -.. |colorprint.py| replace:: printc.py -.. _colorprint.py: https://github.com/marcomusy/vtkplotter/blob/master/vtkplotter/examples/other/printc.py -.. |colorprint| image:: https://user-images.githubusercontent.com/32848391/50739010-2bfc2b80-11da-11e9-94de-011e50a86e61.jpg - :target: colorprint.py_ - :alt: colorprint.py - -.. |ribbon.py| replace:: ribbon.py -.. _ribbon.py: https://github.com/marcomusy/vtkplotter/blob/master/vtkplotter/examples/basic/ribbon.py -.. |ribbon| image:: https://user-images.githubusercontent.com/32848391/50738851-be9bcb00-11d8-11e9-80ee-bd73c1c29c06.jpg - :width: 300 px - :target: ribbon.py_ - :alt: ribbon.py - -.. |manyspheres.py| replace:: manyspheres.py -.. _manyspheres.py: https://github.com/marcomusy/vtkplotter/blob/master/vtkplotter/examples/basic/manyspheres.py -.. |manyspheres| image:: https://user-images.githubusercontent.com/32848391/46818673-1f566b80-cd82-11e8-9a61-be6a56160f1c.png - :target: manyspheres.py_ - -.. |manypoints.py| replace:: manypoints.py -.. _manypoints.py: https://github.com/marcomusy/vtkplotter/blob/master/vtkplotter/examples/basic/manypoints.py - -.. |earth.py| replace:: earth.py -.. _earth.py: https://github.com/marcomusy/vtkplotter/blob/master/vtkplotter/examples/basic/earth.py -.. |earth| image:: https://user-images.githubusercontent.com/32848391/51031592-5a448700-159d-11e9-9b66-bee6abb18679.png - :width: 300 px - :target: earth.py_ - :alt: earth.py - -.. |brownian2D.py| replace:: brownian2D.py -.. _brownian2D.py: https://github.com/marcomusy/vtkplotter/blob/master/vtkplotter/examples/simulations/brownian2D.py -.. |brownian2D| image:: https://user-images.githubusercontent.com/32848391/50738948-73ce8300-11d9-11e9-8ef6-fc4f64c4a9ce.gif - :width: 300 px - :target: brownian2D.py_ - -.. |gas.py| replace:: gas.py -.. _gas.py: https://github.com/marcomusy/vtkplotter/blob/master/vtkplotter/examples/simulations/gas.py -.. |gas| image:: https://user-images.githubusercontent.com/32848391/50738954-7e891800-11d9-11e9-95aa-67c92ca6476b.gif - :width: 300 px - :target: gas.py_ - :alt: gas.py - -.. |tube.py| replace:: tube.py -.. _tube.py: https://github.com/marcomusy/vtkplotter/blob/master/vtkplotter/examples/basic/tube.py -.. |tube| image:: https://user-images.githubusercontent.com/32848391/51801626-adc30000-2240-11e9-8866-9d9d5d8790ab.png - :width: 300 px - :target: tube.py_ - :alt: tube.py - -.. |mesh_threshold.py| replace:: mesh_threshold.py -.. _mesh_threshold.py: https://github.com/marcomusy/vtkplotter/blob/master/vtkplotter/examples/basic/mesh_threshold.py -.. |mesh_threshold| image:: https://user-images.githubusercontent.com/32848391/51807663-4762cf80-228a-11e9-9d0c-184bb11a97bf.png - :width: 300 px - :target: mesh_threshold.py_ - :alt: mesh_threshold.py - -.. |cutWithMesh.py| replace:: cutWithMesh.py -.. _cutWithMesh.py: https://github.com/marcomusy/vtkplotter/blob/master/vtkplotter/examples/advanced/cutWithMesh.py -.. |cutWithMesh| image:: https://user-images.githubusercontent.com/32848391/51808907-e7c0f000-229a-11e9-98a7-fefc7261b3c3.png - :width: 300 px - :target: cutWithMesh.py_ - :alt: cutWithMesh.py - -.. |paraboloid| image:: https://user-images.githubusercontent.com/32848391/51211547-260ef480-1916-11e9-95f6-4a677e37e355.png - :width: 300 px - :alt: paraboloid - -.. |isosurfaces.py| replace:: isosurfaces.py -.. _isosurfaces.py: https://github.com/marcomusy/vtkplotter/blob/master/vtkplotter/examples/volumetric/isosurfaces.py -.. |isosurfaces| image:: https://user-images.githubusercontent.com/32848391/51558920-ec436e00-1e80-11e9-9d96-aa9b7c72d58b.png - :width: 300 px - :target: isosurfaces.py_ - :alt: isosurfaces.py - -.. |meshquality.py| replace:: meshquality.py -.. _meshquality.py: https://github.com/marcomusy/vtkplotter/blob/master/vtkplotter/examples/advanced/meshquality.py -.. |meshquality| image:: https://user-images.githubusercontent.com/32848391/51831269-fb4b7580-22f1-11e9-81ea-13467a5649ca.png - :width: 300 px - :target: meshquality.py_ - :alt: meshquality.py - -.. |geodesic.py| replace:: geodesic.py -.. _geodesic.py: https://github.com/marcomusy/vtkplotter/blob/master/vtkplotter/examples/advanced/geodesic.py -.. |geodesic| image:: https://user-images.githubusercontent.com/32848391/51855637-015f4780-232e-11e9-92ca-053a558e7f70.png - :width: 300 px - :target: geodesic.py_ - :alt: geodesic.py - - -.. |cutAndCap.py| replace:: cutAndCap.py -.. _cutAndCap.py: https://github.com/marcomusy/vtkplotter/blob/master/vtkplotter/examples/advanced/cutAndCap.py -.. |cutAndCap| image:: https://user-images.githubusercontent.com/32848391/51930515-16ee7300-23fb-11e9-91af-2b6b3d626246.png - :width: 300 px - :target: cutAndCap.py_ - :alt: cutAndCap.py - - -.. |convexHull.py| replace:: convexHull.py -.. _convexHull.py: https://github.com/marcomusy/vtkplotter/blob/master/vtkplotter/examples/advanced/convexHull.py -.. |convexHull| image:: https://user-images.githubusercontent.com/32848391/51932732-068cc700-2400-11e9-9b68-30294a4fa4e3.png - :width: 300 px - :target: convexHull.py_ - :alt: convexHull.py - -.. |curvature| image:: https://user-images.githubusercontent.com/32848391/51934810-c2e88c00-2404-11e9-8e7e-ca0b7984bbb7.png - :alt: curvature - -.. |progbar| image:: https://user-images.githubusercontent.com/32848391/51858823-ed1f4880-2335-11e9-8788-2d102ace2578.png - :alt: progressbar - -.. |multiwindows| image:: https://user-images.githubusercontent.com/32848391/50738853-be9bcb00-11d8-11e9-9c8e-69864ad7c045.jpg - :alt: multiwindows - -.. |annotations.py| replace:: annotations.py -.. _annotations.py: https://github.com/marcomusy/vtkplotter/blob/master/vtkplotter/examples/pyplot/annotations.py - -.. |Cone| image:: https://raw.githubusercontent.com/lorensen/VTKExamples/master/src/Testing/Baseline/Cxx/GeometricObjects/TestCone.png - :width: 300 px - -.. |Cylinder| image:: https://raw.githubusercontent.com/lorensen/VTKExamples/master/src/Testing/Baseline/Cxx/GeometricObjects/TestCylinder.png - :width: 300 px - -.. |Disk| image:: https://raw.githubusercontent.com/lorensen/VTKExamples/master/src/Testing/Baseline/Cxx/GeometricObjects/TestDisk.png - :width: 300 px - -.. |OrientedArrow| image:: https://raw.githubusercontent.com/lorensen/VTKExamples/master/src/Testing/Baseline/Cxx/GeometricObjects/TestOrientedArrow.png - :width: 300 px - -.. |Plane| image:: https://raw.githubusercontent.com/lorensen/VTKExamples/master/src/Testing/Baseline/Cxx/GeometricObjects/TestPlane.png - :width: 300 px - -.. |Polygon| image:: https://raw.githubusercontent.com/lorensen/VTKExamples/master/src/Testing/Baseline/Cxx/GeometricObjects/TestRegularPolygonSource.png - :width: 300 px - -.. |Sphere| image:: https://raw.githubusercontent.com/lorensen/VTKExamples/master/src/Testing/Baseline/Cxx/GeometricObjects/TestSphere.png - :width: 300 px - - -.. |embryoslider| image:: https://user-images.githubusercontent.com/32848391/52141624-975ce000-2656-11e9-8d31-2a3c92ab79d6.png - :width: 300 px - -.. |isosurfaces1| image:: https://user-images.githubusercontent.com/32848391/52141625-975ce000-2656-11e9-91fc-291e072fc4c1.png - :width: 300 px - -.. |splitmesh.py| replace:: splitmesh.py -.. _splitmesh.py: https://github.com/marcomusy/vtkplotter/blob/master/vtkplotter/examples/advanced/splitmesh.py -.. |splitmesh| image:: https://user-images.githubusercontent.com/32848391/52141626-97f57680-2656-11e9-80ea-fcd3571a6422.png - :width: 300 px - :target: splitmesh.py_ - :alt: splitmesh.py - -.. |thinplate_morphing2.py| replace:: thinplate_morphing2.py -.. _thinplate_morphing2.py: https://github.com/marcomusy/vtkplotter/blob/master/vtkplotter/examples/advanced/thinplate_morphing2.py -.. |thinplate_morphing2| image:: https://user-images.githubusercontent.com/32848391/52142303-9927a300-2658-11e9-98db-ebad4883f99f.png - :width: 300 px - :target: thinplate_morphing2.py_ - :alt: thinplate_morphing2.py - -.. |projectsphere.py| replace:: projectsphere.py -.. _projectsphere.py: https://github.com/marcomusy/vtkplotter/blob/master/vtkplotter/examples/advanced/projectsphere.py -.. |projectsphere| image:: https://user-images.githubusercontent.com/32848391/52144163-c9be0b80-265d-11e9-9ce6-d6f2b919c214.png - :width: 300 px - :target: projectsphere.py_ - :alt: projectsphere.py - - -.. |mesh2volume.py| replace:: mesh2volume.py -.. _mesh2volume.py: https://github.com/marcomusy/vtkplotter/blob/master/vtkplotter/examples/volumetric/mesh2volume.py -.. |mesh2volume| image:: https://user-images.githubusercontent.com/32848391/52168902-5638fe80-2730-11e9-8033-8e470a3d4f0f.jpg - :width: 300 px - :target: mesh2volume.py_ - :alt: mesh2volume.py - -.. |markpoint.py| replace:: markpoint.py -.. _markpoint.py: https://github.com/marcomusy/vtkplotter/blob/master/vtkplotter/examples/pyplot/markpoint.py -.. |markpoint| image:: https://user-images.githubusercontent.com/32848391/52169969-1fb7af80-2741-11e9-937f-5c331d9a1d11.jpg - :width: 300 px - :target: markpoint.py_ - :alt: markpoint.py - -.. |readVolumeAsIsoSurface.py| replace:: readVolumeAsIsoSurface.py -.. _readVolumeAsIsoSurface.py: https://github.com/marcomusy/vtkplotter/blob/master/vtkplotter/examples/volumetric/readVolumeAsIsoSurface.py - -.. |read_vti.py| replace:: read_vti.py -.. _read_vti.py: https://github.com/marcomusy/vtkplotter/blob/master/vtkplotter/examples/volumetric/read_vti.py -.. |read_vti| image:: https://user-images.githubusercontent.com/32848391/50739036-6bc31300-11da-11e9-89b3-04a75187f812.jpg - :width: 300 px - :target: read_vti.py_ - :alt: read_vti.py - -.. |glyphs.py| replace:: glyphs.py -.. _glyphs.py: https://github.com/marcomusy/vtkplotter/blob/master/vtkplotter/examples/basic/glyphs.py -.. |glyphs| image:: https://user-images.githubusercontent.com/32848391/52233403-47cd1d00-28bf-11e9-86b0-cbceebbde0de.jpg - :width: 300 px - :target: glyphs.py_ - :alt: glyphs.py - -.. |glyphs_arrows.py| replace:: glyphs_arrows.py -.. _glyphs_arrows.py: https://github.com/marcomusy/vtkplotter/blob/master/vtkplotter/examples/basic/glyphs_arrows.py -.. |glyphs_arrows| image:: https://user-images.githubusercontent.com/32848391/55897850-a1a0da80-5bc1-11e9-81e0-004c8f396b43.jpg - :width: 300 px - :target: glyphs_arrows.py_ - :alt: glyphs_arrows.py - -.. |interpolateField.py| replace:: interpolateField.py -.. _interpolateField.py: https://github.com/marcomusy/vtkplotter/blob/master/vtkplotter/examples/advanced/interpolateField.py -.. |interpolateField| image:: https://user-images.githubusercontent.com/32848391/52416117-25b6e300-2ae9-11e9-8d86-575b97e543c0.png - :width: 300 px - :target: interpolateField.py_ - :alt: interpolateField.py - -.. |rotateImage.py| replace:: rotateImage.py -.. _rotateImage.py: https://github.com/marcomusy/vtkplotter/blob/master/vtkplotter/examples/basic/rotateImage.py -.. |rotateImage| image:: https://user-images.githubusercontent.com/32848391/52416910-fb662500-2aea-11e9-88ba-9c73128e8666.jpg - :width: 300 px - :target: rotateImage.py_ - :alt: rotateImage.py - -.. |basicshapes| image:: https://user-images.githubusercontent.com/32848391/50738811-58af4380-11d8-11e9-9bfb-378c27c9d26f.png - :alt: basicshapes - -.. |lines| image:: https://user-images.githubusercontent.com/32848391/52503049-ac9cb600-2be4-11e9-86af-72a538af14ef.png - :width: 300 px - :alt: lines - -.. |vlogo_large| image:: https://user-images.githubusercontent.com/32848391/52522716-4fa70b80-2c89-11e9-92a7-0d22cbe34758.png - :alt: vlogo_large - -.. |vlogo_medium| image:: https://user-images.githubusercontent.com/32848391/52522717-503fa200-2c89-11e9-87ab-67eb44652e24.png - :alt: vlogo_medium - -.. |vlogo_small| image:: https://user-images.githubusercontent.com/32848391/52522718-50d83880-2c89-11e9-80ff-df1b5618a84a.png - :alt: vlogo_small - -.. |vlogo_small_dark| image:: https://user-images.githubusercontent.com/32848391/52522719-50d83880-2c89-11e9-8b90-a1c21c27b007.png - :alt: vlogo_small_dark - -.. |vlogo_tube| image:: https://user-images.githubusercontent.com/32848391/52522720-5170cf00-2c89-11e9-8b1d-a7a5cf75e71b.png - :alt: vlogo_tube - -.. |vlogo_tube_dark| image:: https://user-images.githubusercontent.com/32848391/52522721-5170cf00-2c89-11e9-8fbb-6efa13940aa1.png - :alt: vlogo_tube_dark - -.. |fitline.py| replace:: fitline.py -.. _fitline.py: https://github.com/marcomusy/vtkplotter/blob/master/vtkplotter/examples/basic/fitline.py -.. |fitline| image:: https://user-images.githubusercontent.com/32848391/50738864-c0658e80-11d8-11e9-8754-c670f1f331d6.jpg - :width: 300 px - :target: fitline.py_ - :alt: fitline.py - -.. |sliders3d.py| replace:: sliders3d.py -.. _sliders3d.py: https://github.com/marcomusy/vtkplotter/blob/master/vtkplotter/examples/basic/sliders3d.py -.. |sliders3d| image:: https://user-images.githubusercontent.com/32848391/52859555-4efcf200-312d-11e9-9290-6988c8295163.png - :width: 300 px - :target: sliders3d.py_ - :alt: sliders3d.py - -.. |ex01_showmesh.py| replace:: ex01_showmesh.py -.. _ex01_showmesh.py: https://github.com/marcomusy/vtkplotter/blob/master/vtkplotter/examples/other/dolfin/ex01_show-mesh.py -.. |ex01_showmesh| image:: https://user-images.githubusercontent.com/32848391/53026243-d2d31900-3462-11e9-9dde-518218c241b6.jpg - :width: 300 px - :target: ex01_showmesh.py_ - :alt: ex01_showmesh.py - -.. |ex02_tetralize-mesh.py| replace:: ex02_tetralize-mesh.py -.. _ex02_tetralize-mesh.py: https://github.com/marcomusy/vtkplotter/blob/master/vtkplotter/examples/other/dolfin/ex02_tetralize-mesh.py -.. |ex02_tetralize-mesh| image:: https://user-images.githubusercontent.com/32848391/53026244-d2d31900-3462-11e9-835a-1fa9d66d3dae.png - :width: 300 px - :target: ex02_tetralize-mesh.py_ - :alt: ex02_tetralize-mesh.py - -.. |ex06_elasticity1.py| replace:: ex06_elasticity1.py -.. _ex06_elasticity1.py: https://github.com/marcomusy/vtkplotter/blob/master/vtkplotter/examples/other/dolfin/ex06_elasticity1.py -.. |ex06_elasticity1| image:: https://user-images.githubusercontent.com/32848391/53026245-d2d31900-3462-11e9-9db4-96211569d114.jpg - :width: 300 px - :target: ex06_elasticity1.py_ - :alt: ex06_elasticity1.py - -.. |ex06_elasticity2.py| replace:: ex06_elasticity2.py -.. _ex06_elasticity2.py: https://github.com/marcomusy/vtkplotter/blob/master/vtkplotter/examples/other/dolfin/ex06_elasticity2.py -.. |ex06_elasticity2| image:: https://user-images.githubusercontent.com/32848391/53026246-d36baf80-3462-11e9-96a5-8eaf0bb0f9a4.jpg - :width: 300 px - :target: ex06_elasticity2.py_ - :alt: ex06_elasticity2.py - - -.. |flatarrow.py| replace:: flatarrow.py -.. _flatarrow.py: https://github.com/marcomusy/vtkplotter/blob/master/vtkplotter/examples/other/basic/flatarrow.py -.. |flatarrow| image:: https://user-images.githubusercontent.com/32848391/54612632-97c00780-4a59-11e9-8532-940c25a5dfd8.png - :width: 300 px - :target: flatarrow.py_ - :alt: flatarrow.py - -.. |printhisto| image:: https://user-images.githubusercontent.com/32848391/55073046-03732780-508d-11e9-9bf9-c5de8631dd73.png - :width: 300 px - -.. |pmatrix| image:: https://user-images.githubusercontent.com/32848391/55098070-6da3c080-50bd-11e9-8f2b-be94a3f01831.png - :width: 300 px - -.. |distance2mesh.py| replace:: distance2mesh.py -.. _distance2mesh.py: https://github.com/marcomusy/vtkplotter/blob/master/vtkplotter/examples/basic/distance2mesh.py -.. |distance2mesh| image:: https://user-images.githubusercontent.com/32848391/55965881-b5a71380-5c77-11e9-8680-5bddceab813a.png - :width: 300 px - :target: distance2mesh.py_ - :alt: distance2mesh.py - -.. |pendulum.py| replace:: pendulum.py -.. _pendulum.py: https://github.com/marcomusy/vtkplotter/blob/master/vtkplotter/examples/simulations/pendulum.py -.. |pendulum| image:: https://user-images.githubusercontent.com/32848391/55420020-51e56200-5576-11e9-8513-4a5d93913b17.png - :width: 300 px - :target: pendulum.py_ - :alt: pendulum.py - -.. |latex.py| replace:: latex.py -.. _latex.py: https://github.com/marcomusy/vtkplotter/blob/master/vtkplotter/examples/pyplot/latex.py -.. |latex| image:: https://user-images.githubusercontent.com/32848391/55568648-6190b200-5700-11e9-9547-0798c588a7a5.png - :width: 300 px - :target: latex.py_ - :alt: latex.py - -.. |ft04_heat_gaussian.py| replace:: ft04_heat_gaussian.py -.. _ft04_heat_gaussian.py: https://github.com/marcomusy/vtkplotter/blob/master/vtkplotter/examples/other/dolfin/ft04_heat_gaussian.py -.. |ft04_heat_gaussian| image:: https://user-images.githubusercontent.com/32848391/55578167-88a5ae80-5715-11e9-84ea-bdab54099887.gif - :width: 300 px - :target: ft04_heat_gaussian.py_ - :alt: ft04_heat_gaussian.py - -.. |cutcube| image:: https://user-images.githubusercontent.com/32848391/55965516-08cc9680-5c77-11e9-8d23-720f6c088ea2.png - :width: 200 px - -.. |intline| image:: https://user-images.githubusercontent.com/32848391/55967065-eee08300-5c79-11e9-8933-265e1bab9f7e.png - :width: 300 px - -.. |cropped| image:: https://user-images.githubusercontent.com/32848391/57081955-0ef1e800-6cf6-11e9-99de-b45220939bc9.png - :width: 300 px - -.. |dolfinmesh| image:: https://user-images.githubusercontent.com/32848391/53026243-d2d31900-3462-11e9-9dde-518218c241b6.jpg - :width: 300 px - -.. |turing_pattern.py| replace:: turing_pattern.py -.. _turing_pattern.py: https://github.com/marcomusy/vtkplotter/blob/master/vtkplotter/examples/other/dolfin/turing_pattern.py -.. |turing_pattern| image:: https://user-images.githubusercontent.com/32848391/56056437-77cfeb00-5d5c-11e9-9887-828e5745d547.gif - :width: 300 px - :target: turing_pattern.py_ - :alt: turing_pattern.py - -.. |demo_cahn-hilliard.py| replace:: demo_cahn-hilliard.py -.. _demo_cahn-hilliard.py: https://github.com/marcomusy/vtkplotter/blob/master/vtkplotter/examples/other/dolfin/demo_cahn-hilliard.py -.. |demo_cahn-hilliard| image:: https://user-images.githubusercontent.com/32848391/56664730-edb34b00-66a8-11e9-9bf3-73431f2a98ac.gif - :width: 300 px - :target: demo_cahn-hilliard.py_ - :alt: demo_cahn-hilliard.py - - -.. |navier-stokes_lshape.py| replace:: navier-stokes_lshape.py -.. _navier-stokes_lshape.py: https://github.com/marcomusy/vtkplotter/blob/master/vtkplotter/examples/other/dolfin/navier-stokes_lshape.py -.. |navier-stokes_lshape| image:: https://user-images.githubusercontent.com/32848391/56671156-6bc91f00-66b4-11e9-8c58-e6b71e2ad1d0.gif - :width: 300 px - :target: navier-stokes_lshape.py_ - :alt: navier-stokes_lshape.py - - -.. |mesh_map2cell.py| replace:: mesh_map2cell.py -.. _mesh_map2cell.py: https://github.com/marcomusy/vtkplotter/blob/master/vtkplotter/examples/basic/mesh_map2cell.py -.. |mesh_map2cell| image:: https://user-images.githubusercontent.com/32848391/56600859-0153a880-65fa-11e9-88be-34fd96b18e9a.png - :width: 300 px - :target: mesh_map2cell.py_ - :alt: mesh_map2cell.py - - -.. |ex03_poisson.py| replace:: ex03_poisson.py -.. _ex03_poisson.py: https://github.com/marcomusy/vtkplotter/blob/master/vtkplotter/examples/other/dolfin/ex03_poisson.py -.. |ex03_poisson| image:: https://user-images.githubusercontent.com/32848391/54925524-bec18200-4f0e-11e9-9eab-29fd61ef3b8e.png - :width: 300 px - :target: ex03_poisson.py_ - :alt: ex03_poisson.py - -.. |elastodynamics.py| replace:: elastodynamics.py -.. _elastodynamics.py: https://github.com/marcomusy/vtkplotter/blob/master/vtkplotter/examples/other/dolfin/elastodynamics.py -.. |elastodynamics| image:: https://user-images.githubusercontent.com/32848391/54932788-bd4a8680-4f1b-11e9-9326-33645171a45e.gif - :width: 300 px - :target: elastodynamics.py_ - :alt: elastodynamics.py - -.. |ft02_poisson_membrane.py| replace:: ft02_poisson_membrane.py -.. _ft02_poisson_membrane.py: https://github.com/marcomusy/vtkplotter/blob/master/vtkplotter/examples/other/dolfin/ft02_poisson_membrane.py -.. |ft02_poisson_membrane| image:: https://user-images.githubusercontent.com/32848391/55499287-ed91d380-5645-11e9-8e9a-e31e2e3b1649.jpg - :width: 300 px - :target: ft02_poisson_membrane.py_ - :alt: ft02_poisson_membrane.py - - -.. |stokes.py| replace:: stokes.py -.. _stokes.py: https://github.com/marcomusy/vtkplotter/blob/master/vtkplotter/examples/other/dolfin/stokes.py -.. |stokes| image:: https://user-images.githubusercontent.com/32848391/55098209-aba0e480-50bd-11e9-8842-42d3f0b2d9c8.png - :width: 300 px - :target: stokes.py_ - :alt: stokes.py - -.. |stokes1.py| replace:: stokes1.py -.. _stokes1.py: https://github.com/marcomusy/vtkplotter/blob/master/vtkplotter/examples/other/dolfin/stokes.py -.. |stokes1| image:: https://user-images.githubusercontent.com/32848391/56986911-6116fa00-6b8c-11e9-83f5-5b4efe430c0c.jpg - :width: 300 px - :target: stokes1.py_ - :alt: stokes1.py - -.. |demo_submesh.py| replace:: demo_submesh.py -.. _demo_submesh.py: https://github.com/marcomusy/vtkplotter/blob/master/vtkplotter/examples/other/dolfin/demo_submesh.py -.. |demo_submesh| image:: https://user-images.githubusercontent.com/32848391/56675428-4e984e80-66bc-11e9-90b0-43dde7e4cc29.png - :width: 300 px - :target: demo_submesh.py_ - :alt: demo_submesh.py - -.. |pi_estimate.py| replace:: pi_estimate.py -.. _pi_estimate.py: https://github.com/marcomusy/vtkplotter/blob/master/vtkplotter/examples/other/dolfin/pi_estimate.py -.. |pi_estimate| image:: https://user-images.githubusercontent.com/32848391/56675429-4e984e80-66bc-11e9-9217-a0652a8e74fe.png - :width: 300 px - :target: pi_estimate.py_ - :alt: pi_estimate.py - -.. |isolines.py| replace:: isolines.py -.. _isolines.py: https://github.com/marcomusy/vtkplotter/blob/master/vtkplotter/examples/basic/isolines.py -.. |isolines| image:: https://user-images.githubusercontent.com/32848391/72433087-f00a8780-3798-11ea-9778-991f0abeca70.png - :width: 300 px - :target: isolines.py_ - :alt: isolines.py - -.. |inset.py| replace:: inset.py -.. _inset.py: https://github.com/marcomusy/vtkplotter/blob/master/vtkplotter/examples/other/inset.py -.. |inset| image:: https://user-images.githubusercontent.com/32848391/56758560-3c3f1300-6797-11e9-9b33-49f5a4876039.jpg - :width: 300 px - :target: inset.py_ - :alt: inset.py - -.. |legosurface.py| replace:: legosurface.py -.. _legosurface.py: https://github.com/marcomusy/vtkplotter/blob/master/vtkplotter/examples/volumetric/legosurface.py -.. |legosurface| image:: https://user-images.githubusercontent.com/32848391/56820682-da40e500-684c-11e9-8ea3-91cbcba24b3a.png - :width: 300 px - :target: legosurface.py_ - :alt: legosurface.py - - -.. |streamribbons.py| replace:: streamribbons.py -.. _streamribbons.py: https://github.com/marcomusy/vtkplotter/blob/master/vtkplotter/examples/volumetric/streamribbons.py -.. |streamribbons| image:: https://user-images.githubusercontent.com/32848391/56963999-9145a500-6b5a-11e9-9461-0037c471faab.png - :width: 300 px - :target: streamribbons.py_ - :alt: streamribbons.py - - -.. |streamlines1.py| replace:: streamlines1.py -.. _streamlines1.py: https://github.com/marcomusy/vtkplotter/blob/master/vtkplotter/examples/volumetric/streamlines1.py -.. |streamlines1| image:: https://user-images.githubusercontent.com/32848391/56964002-9145a500-6b5a-11e9-9e3f-da712609d896.png - :width: 300 px - :target: streamlines1.py_ - :alt: streamlines1.py - -.. |streamlines2.py| replace:: streamlines2.py -.. _streamlines2.py: https://github.com/marcomusy/vtkplotter/blob/master/vtkplotter/examples/volumetric/streamlines2.py -.. |streamlines2| image:: https://user-images.githubusercontent.com/32848391/56964001-9145a500-6b5a-11e9-935b-1b2425bd7dd2.png - :width: 300 px - :target: streamlines2.py_ - :alt: streamlines2.py - -.. |office.py| replace:: office.py -.. _office.py: https://github.com/marcomusy/vtkplotter/blob/master/vtkplotter/examples/volumetric/office.py -.. |office| image:: https://user-images.githubusercontent.com/32848391/56964003-9145a500-6b5a-11e9-9d9e-9736d90e1900.png - :width: 300 px - :target: office.py_ - :alt: office.py - -.. |value-iteration.py| replace:: value-iteration.py -.. _value-iteration.py: https://github.com/marcomusy/vtkplotter/blob/master/vtkplotter/examples/other/value-iteration.py -.. |value-iteration| image:: https://user-images.githubusercontent.com/32848391/56964055-afaba080-6b5a-11e9-99cf-3fac99df9878.jpg - :width: 300 px - :target: value-iteration.py_ - :alt: value-iteration.py - -.. |magnetostatics.py| replace:: magnetostatics.py -.. _magnetostatics.py: https://github.com/marcomusy/vtkplotter/blob/master/vtkplotter/examples/other/dolfin/magnetostatics.py -.. |magnetostatics| image:: https://user-images.githubusercontent.com/32848391/56985162-fb287380-6b87-11e9-9cf9-045bd08c3b9b.jpg - :width: 300 px - :target: magnetostatics.py_ - :alt: magnetostatics.py - -.. |voronoi3d.py| replace:: voronoi3d.py -.. _voronoi3d.py: https://github.com/marcomusy/vtkplotter/blob/master/vtkplotter/examples/other/voronoi3d.py -.. |voronoi3d| image:: http://math.lbl.gov/voro++/obliquevoro.png - :width: 300 px - :target: voronoi3d.py_ - :alt: voronoi3d.py - -.. |export_x3d.py| replace:: export_x3d.py -.. _export_x3d.py: https://github.com/marcomusy/vtkplotter/blob/master/vtkplotter/examples/other/export_x3d.py -.. |export_x3d| image:: https://user-images.githubusercontent.com/32848391/57160341-c6ffbd80-6de8-11e9-95ff-7215ce642bc5.jpg - :width: 300 px - :target: export_x3d.py_ - :alt: export_x3d.py - - -.. |silhouette.py| replace:: silhouette.py -.. _silhouette.py: https://github.com/marcomusy/vtkplotter/blob/master/vtkplotter/examples/basic/silhouette.py -.. |silhouette| image:: https://user-images.githubusercontent.com/32848391/57179369-8e5df380-6e7d-11e9-99b4-3b1a120dd375.png - :width: 300 px - :target: silhouette.py_ - :alt: silhouette.py - -.. |shadow.py| replace:: shadow.py -.. _shadow.py: https://github.com/marcomusy/vtkplotter/blob/master/vtkplotter/examples/basic/shadow.py -.. |shadow| image:: https://user-images.githubusercontent.com/32848391/57312574-1d714280-70ee-11e9-8741-04fc5386d692.png - :width: 300 px - :target: shadow.py_ - :alt: shadow.py - -.. |airplanes.py| replace:: airplanes.py -.. _airplanes.py: https://github.com/marcomusy/vtkplotter/blob/master/vtkplotter/examples/simulations/.py -.. |airplanes| image:: https://user-images.githubusercontent.com/32848391/57341963-b8910900-713c-11e9-898a-84b6d3712bce.gif - :width: 300 px - :target: airplanes.py_ - :alt: airplanes.py - - -.. |heatconv.py| replace:: heatconv.py -.. _heatconv.py: https://github.com/marcomusy/vtkplotter/blob/master/vtkplotter/examples/other/dolfin/heatconv.py -.. |heatconv| image:: https://user-images.githubusercontent.com/32848391/57455107-b200af80-726a-11e9-897d-9c7bcb9854ac.gif - :width: 300 px - :target: heatconv.py_ - :alt: heatconv.py - -.. |scalemesh.py| replace:: scalemesh.py -.. _scalemesh.py: https://github.com/marcomusy/vtkplotter/blob/master/vtkplotter/examples/other/dolfin/scalemesh.py -.. |scalemesh| image:: https://user-images.githubusercontent.com/32848391/57393382-431c4b80-71c3-11e9-9a2c-8abb172f5468.png - :width: 300 px - :target: scalemesh.py_ - :alt: scalemesh.py - -.. |elasticbeam.py| replace:: elasticbeam.py -.. _elasticbeam.py: https://github.com/marcomusy/vtkplotter/blob/master/vtkplotter/examples/other/dolfin/elasticbeam.py -.. |elasticbeam| image:: https://user-images.githubusercontent.com/32848391/57476429-d7a3ae00-7296-11e9-9f50-8f456823ef3d.png - :width: 300 px - :target: elasticbeam.py_ - :alt: elasticbeam.py - -.. |specular.py| replace:: specular.py -.. _specular.py: https://github.com/marcomusy/vtkplotter/blob/master/vtkplotter/examples/basic/specular.py -.. |specular| image:: https://user-images.githubusercontent.com/32848391/57543051-8c030a00-7353-11e9-84cd-b01f3449d255.jpg - :width: 300 px - :target: specular.py_ - :alt: specular.py - -.. |wavy_1d.py| replace:: wavy_1d.py -.. _wavy_1d.py: https://github.com/marcomusy/vtkplotter/blob/master/vtkplotter/examples/other/dolfin/wavy_1d.py -.. |wavy_1d| image:: https://user-images.githubusercontent.com/32848391/57570898-70593b80-7407-11e9-87cf-ce498f499c09.gif - :width: 300 px - :target: wavy_1d.py_ - :alt: wavy_1d.py - -.. |fonts.py| replace:: fonts.py -.. _fonts.py: https://github.com/marcomusy/vtkplotter/blob/master/vtkplotter/examples/pyplot/fonts.py -.. |fonts| image:: https://user-images.githubusercontent.com/32848391/57587416-decff380-7504-11e9-8456-f969672c959e.png - :width: 500 px - :target: fonts.py_ - :alt: fonts.py - -.. |idealpass.link| replace:: idealpass.link -.. _idealpass.link: https://lorensen.github.io/VTKExamples/site/Cxx/ImageProcessing/IdealHighPass -.. |idealpass| image:: https://raw.githubusercontent.com/lorensen/VTKExamples/master/src/Testing/Baseline/Cxx/ImageProcessing/TestIdealHighPass.png - :width: 300 px - :target: idealpass.link_ - -.. |buildmesh.py| replace:: buildmesh.py -.. _buildmesh.py: https://github.com/marcomusy/vtkplotter/blob/master/vtkplotter/examples/basic/buildmesh.py -.. |buildmesh| image:: https://user-images.githubusercontent.com/32848391/57858625-b0e2fb80-77f1-11e9-94f0-1973ed86ae70.png - :width: 300 px - :target: buildmesh.py_ - :alt: buildmesh.py - -.. |customAxes.py| replace:: customAxes.py -.. _customAxes.py: https://github.com/marcomusy/vtkplotter/blob/master/vtkplotter/examples/pyplot/customAxes.py -.. |customAxes| image:: https://user-images.githubusercontent.com/32848391/58181826-c605d180-7cac-11e9-9786-11b5eb278f20.png - :target: customAxes.py_ - :alt: customAxes.py - -.. |awefem.py| replace:: awefem.py -.. _awefem.py: https://github.com/marcomusy/vtkplotter/blob/master/vtkplotter/examples/other/dolfin/awefem.py -.. |awefem| image:: https://user-images.githubusercontent.com/32848391/58368591-8b3fab80-7eef-11e9-882f-8b8eaef43567.gif - :width: 300 px - :target: awefem.py_ - :alt: awefem.py - -.. |fenics_logo| image:: https://user-images.githubusercontent.com/32848391/58764910-3940fa80-856d-11e9-8160-af89a5ab5d02.gif - -.. |thinplate_morphing_2d.py| replace:: thinplate_morphing_2d.py -.. _thinplate_morphing_2d.py: https://github.com/marcomusy/vtkplotter/blob/master/vtkplotter/examples/advanced/thinplate_morphing_2d.py -.. |thinplate_morphing_2d| image:: https://user-images.githubusercontent.com/32848391/59032715-385ae200-8867-11e9-9b07-7f4f8fbfa5bd.png - :width: 300 px - :target: thinplate_morphing_2d.py_ - :alt: thinplate_morphing_2d.py - -.. |interpolateVolume.py| replace:: interpolateVolume.py -.. _interpolateVolume.py: https://github.com/marcomusy/vtkplotter/blob/master/vtkplotter/examples/volumetric/interpolateVolume.py -.. |interpolateVolume| image:: https://user-images.githubusercontent.com/32848391/59095175-1ec5a300-8918-11e9-8bc0-fd35c8981e2b.jpg - :width: 300 px - :target: interpolateVolume.py_ - :alt: interpolateVolume.py - -.. |deleteMeshPoints.py| replace:: deleteMeshPoints.py -.. _deleteMeshPoints.py: https://github.com/marcomusy/vtkplotter/blob/master/vtkplotter/examples/basic/deleteMeshPoints.py -.. |deleteMeshPoints| image:: https://user-images.githubusercontent.com/32848391/59768041-e9b83980-92a3-11e9-94f4-ca1f92540e9f.png - :width: 300 px - :target: deleteMeshPoints.py_ - :alt: deleteMeshPoints.py - -.. |gray_scott.ipynb| replace:: gray_scott.ipynb -.. _gray_scott.ipynb: https://github.com/marcomusy/vtkplotter/blob/master/vtkplotter/examples/simulations/gray_scott.ipynb -.. |gray_scott| image:: https://user-images.githubusercontent.com/32848391/59788744-aaeaa980-92cc-11e9-825d-58da26ca21ff.gif - :width: 300 px - :target: gray_scott.ipynb_ - :alt: gray_scott.ipynb - -.. |volterra.py| replace:: volterra.py -.. _volterra.py: https://github.com/marcomusy/vtkplotter/blob/master/vtkplotter/examples/simulations/volterra.py -.. |volterra| image:: https://user-images.githubusercontent.com/32848391/59788745-aaeaa980-92cc-11e9-93d5-f6a577ba5e4d.png - :width: 300 px - :target: volterra.py_ - :alt: volterra.py - -.. |tensors.py| replace:: tensors.py -.. _tensors.py: https://github.com/marcomusy/vtkplotter/blob/master/vtkplotter/examples/volumetric/tensors.py -.. |tensors| image:: https://user-images.githubusercontent.com/32848391/59944747-e2d92480-9465-11e9-8012-1fc34a2e30c6.png - :width: 300 px - :target: tensors.py_ - :alt: tensors.py - -.. |tensor_grid.py| replace:: tensor_grid.py -.. _tensor_grid.py: https://github.com/marcomusy/vtkplotter/blob/master/vtkplotter/examples/volumetric/tensor_grid.py - -.. |scalarbars.py| replace:: scalarbars.py -.. _scalarbars.py: https://github.com/marcomusy/vtkplotter/blob/master/vtkplotter/examples/basic/scalarbars.py -.. |scalarbars| image:: https://user-images.githubusercontent.com/32848391/62940174-4bdc7900-bdd3-11e9-9713-e4f3e2fdab63.png - :width: 300 px - :target: scalarbars.py_ - :alt: scalarbars.py - -.. |erode_dilate.py| replace:: erode_dilate.py -.. _erode_dilate.py: https://github.com/marcomusy/vtkplotter/blob/master/vtkplotter/examples/volumetric/erode_dilate.py - -.. |vol2points.py| replace:: vol2points.py -.. _vol2points.py: https://github.com/marcomusy/vtkplotter/blob/master/vtkplotter/examples/volumetric/vol2points.py - -.. |euclDist.py| replace:: euclDist.py -.. _euclDist.py: https://github.com/marcomusy/vtkplotter/blob/master/vtkplotter/examples/volumetric/euclDist.py - -.. |pointDensity.py| replace:: pointDensity.py -.. _pointDensity.py: https://github.com/marcomusy/vtkplotter/blob/master/vtkplotter/examples/volumetric/pointDensity.py - -.. |volumeFromMesh.py| replace:: volumeFromMesh.py -.. _volumeFromMesh.py: https://github.com/marcomusy/vtkplotter/blob/master/vtkplotter/examples/volumetric/volumeFromMesh.py - -.. |numpy2volume.py| replace:: numpy2volume.py -.. _numpy2volume.py: https://github.com/marcomusy/vtkplotter/blob/master/vtkplotter/examples/volumetric/numpy2volume.py - -.. |G_Of_Omega| image:: https://wikimedia.org/api/rest_v1/media/math/render/svg/9c4d02a66b6ff279aae0c4bf07c25e5727d192e4 - -.. |wikiphong| image:: https://upload.wikimedia.org/wikipedia/commons/6/6b/Phong_components_version_4.png - -.. |animation1.py| replace:: animation1.py -.. _animation1.py: https://github.com/marcomusy/vtkplotter/blob/master/vtkplotter/examples/other/animation1.py -.. |animation1| image:: https://user-images.githubusercontent.com/32848391/64273764-4b528080-cf42-11e9-90aa-2d88df239871.gif - :width: 300 px - :target: animation1.py_ - :alt: animation1.py - -.. |animation2.py| replace:: animation2.py -.. _animation2.py: https://github.com/marcomusy/vtkplotter/blob/master/vtkplotter/examples/other/animation2.py -.. |animation2| image:: https://user-images.githubusercontent.com/32848391/64273191-1a258080-cf41-11e9-8a18-f192f05f11a9.gif - :width: 300 px - :target: animation2.py_ - :alt: animation2.py - -.. |polarHisto.py| replace:: polarHisto.py -.. _polarHisto.py: https://github.com/marcomusy/vtkplotter/blob/master/vtkplotter/examples/pyplot/polarHisto.py -.. |polarHisto| image:: https://user-images.githubusercontent.com/32848391/64912717-5754f400-d733-11e9-8a1f-612165955f23.png - :width: 300 px - :target: polarHisto.py_ - :alt: polarHisto.py - -.. |histo_polar.py| replace:: histo_polar.py -.. _histo_polar.py: https://github.com/marcomusy/vtkplotter/blob/master/vtkplotter/examples/pyplot/histo_polar.py -.. |histo_polar| image:: https://user-images.githubusercontent.com/32848391/64992590-7fc82400-d8d4-11e9-9c10-795f4756a73f.png - :width: 300 px - :target: histo_polar.py_ - :alt: histo_polar.py - -.. |donut.py| replace:: donut.py -.. _donut.py: https://github.com/marcomusy/vtkplotter/blob/master/vtkplotter/examples/pyplot/donut.py -.. |donut| image:: https://user-images.githubusercontent.com/32848391/64998178-6f6b7580-d8e3-11e9-9bd8-8dfb9ccd90e4.png - :width: 300 px - :target: donut.py_ - :alt: donut.py - -.. |extrude.py| replace:: extrude.py -.. _extrude.py: https://github.com/marcomusy/vtkplotter/blob/master/vtkplotter/examples/basic/extrude.py -.. |extrude| image:: https://user-images.githubusercontent.com/32848391/65963682-971e1a00-e45b-11e9-9f29-05522ae4a800.png - :width: 300 px - :target: extrude.py_ - :alt: extrude.py - -.. |kspline.py| replace:: kspline.py -.. _kspline.py: https://github.com/marcomusy/vtkplotter/blob/master/vtkplotter/examples/basic/kspline.py -.. |kspline| image:: https://user-images.githubusercontent.com/32848391/65975805-73fd6580-e46f-11e9-8957-75eddb28fa72.png - :width: 300 px - :target: kspline.py_ - :alt: kspline.py - -.. |mesh_lut.py| replace:: mesh_lut.py -.. _mesh_lut.py: https://github.com/marcomusy/vtkplotter/blob/master/vtkplotter/examples/basic/mesh_lut.py - -.. |elevation| image:: https://user-images.githubusercontent.com/32848391/68478872-3986a580-0231-11ea-8245-b68a683aa295.png - :width: 300 px - -.. |paramshapes| image:: https://user-images.githubusercontent.com/32848391/69181075-bb6aae80-0b0e-11ea-92f7-d0cd3b9087bf.png - :width: 300 px - -.. |warpto| image:: https://user-images.githubusercontent.com/32848391/69259878-3c817e80-0bbf-11ea-9025-03b9f6affccc.png - :width: 300 px - -.. |linInterpolate.py| replace:: linInterpolate.py -.. _linInterpolate.py: https://github.com/marcomusy/vtkplotter/blob/master/vtkplotter/examples/basic/linInterpolate.py -.. |linInterpolate| image:: https://user-images.githubusercontent.com/32848391/70559826-a621f680-1b87-11ea-89f3-e6b74d8953d9.png - :width: 300 px - :target: linInterpolate.py_ - :alt: linInterpolate.py - -.. |plot1_errbars.py| replace:: plot1_errbars.py -.. _plot1_errbars.py: https://github.com/marcomusy/vtkplotter/blob/master/vtkplotter/examples/pyplot/plot1_errbars.py -.. |plot1_errbars| image:: https://user-images.githubusercontent.com/32848391/69158509-d6c1c380-0ae6-11ea-9dbf-ff5cd396a9a6.png - :width: 300 px - :target: plot1_errbars.py_ - :alt: plot1_errbars.py - -.. |quiver.py| replace:: quiver.py -.. _quiver.py: https://github.com/marcomusy/vtkplotter/blob/master/vtkplotter/examples/pyplot/quiver.py -.. |quiver| image:: https://user-images.githubusercontent.com/32848391/72261438-199aa600-3615-11ea-870e-e44ca4c4b8d3.png - :width: 300 px - :target: quiver.py_ - :alt: quiver.py - -.. |plot5_spheric.py| replace:: plot5_spheric.py -.. _plot5_spheric.py: https://github.com/marcomusy/vtkplotter/blob/master/vtkplotter/examples/pyplot/plot5_spheric.py -.. |plot5_spheric| image:: https://user-images.githubusercontent.com/32848391/72433091-f0a31e00-3798-11ea-86bd-6c522e23ec61.png - :width: 300 px - :target: plot5_spheric.py_ - :alt: plot5_spheric.py - -.. |fcomplex| image:: https://user-images.githubusercontent.com/32848391/73392962-1709a300-42db-11ea-9278-30c9d6e5eeaa.png - :width: 300 px - -.. |histo_spheric.py| replace:: histo_spheric.py -.. _histo_spheric.py: https://github.com/marcomusy/vtkplotter/blob/master/vtkplotter/examples/pyplot/histo_spheric.py -.. |histo_spheric| image:: https://user-images.githubusercontent.com/32848391/73392901-fccfc500-42da-11ea-828a-9bad6982a823.png - :width: 300 px - :target: histo_spheric.py_ - :alt: histo_spheric.py - -.. |sphericgrid| image:: https://user-images.githubusercontent.com/32848391/72433092-f0a31e00-3798-11ea-85f7-b2f5fcc31568.png - :width: 300 px - -.. |histo_2D.py| replace:: histo_2D.py -.. _histo_2D.py: https://github.com/marcomusy/vtkplotter/blob/master/vtkplotter/examples/pyplot/histo_2D.py -.. |histo_2D| image:: https://user-images.githubusercontent.com/32848391/74361190-c019c880-4dc6-11ea-9c72-0f2a890e6664.png - :width: 300 px - :target: histo_2D.py_ - :alt: histo_2D.py - -.. |plot2_errband.py| replace:: plot2_errband.py -.. _plot2_errband.py: https://github.com/marcomusy/vtkplotter/blob/master/vtkplotter/examples/pyplot/plot2_errband.py -.. |plot2_errband| image:: https://user-images.githubusercontent.com/32848391/73483464-c019d180-439f-11ea-9a8c-59fa49e9ecf4.png - :width: 300 px - :target: plot2_errband.py_ - :alt: plot2_errband.py - -.. |plot3_pip.py| replace:: plot3_pip.py -.. _plot3_pip.py: https://github.com/marcomusy/vtkplotter/blob/master/vtkplotter/examples/pyplot/plot3_pip.py -.. |plot3_pip| image:: https://user-images.githubusercontent.com/32848391/73393632-4ff64780-42dc-11ea-8798-45a81c067f45.png - :width: 300 px - :target: plot3_pip.py_ - :alt: plot3_pip.py - -.. |scatter1.py| replace:: scatter1.py -.. _scatter1.py: https://github.com/marcomusy/vtkplotter/blob/master/vtkplotter/examples/pyplot/scatter1.py -.. |scatter1| image:: https://user-images.githubusercontent.com/32848391/72615028-013bcb80-3934-11ea-8ab8-823f1916bc6c.png - :width: 300 px - :target: scatter1.py_ - :alt: scatter1.py - -.. |scatter2.py| replace:: scatter2.py -.. _scatter2.py: https://github.com/marcomusy/vtkplotter/blob/master/vtkplotter/examples/pyplot/scatter2.py -.. |scatter2| image:: https://user-images.githubusercontent.com/32848391/72446102-2d7c0e80-37b3-11ea-8fe4-b27526af574f.png - :width: 300 px - :target: scatter2.py_ - :alt: scatter2.py - -.. |customIndividualAxes.py| replace:: customIndividualAxes.py -.. _customIndividualAxes.py: https://github.com/marcomusy/vtkplotter/blob/master/vtkplotter/examples/pyplot/customIndividualAxes.py -.. |customIndividualAxes| image:: https://user-images.githubusercontent.com/32848391/72752870-ab7d5280-3bc3-11ea-8911-9ace00211e23.png - :target: customIndividualAxes.py_ - :alt: customIndividualAxes.py - -.. |plot7_stream.py| replace:: plot7_stream.py -.. _plot7_stream.py: https://github.com/marcomusy/vtkplotter/blob/master/vtkplotter/examples/pyplot/plot7_stream.py -.. |plot7_stream| image:: https://user-images.githubusercontent.com/32848391/73614123-93162a80-45fc-11ea-969b-9a3293b26f35.png - :target: plot7_stream.py_ - :alt: plot7_stream.py - -.. |simpleplot| image:: https://user-images.githubusercontent.com/32848391/74363882-c3638300-4dcb-11ea-8a78-eb492ad9711f.png - :width: 300 px - - -.. |warpv| image:: https://user-images.githubusercontent.com/32848391/77864546-7a577900-7229-11ea-84ce-4e8e6eeff27f.png - :width: 300 px - -""" +_defs = "" + +#_defs = """ +# +#.. |tutorial_spline| image:: https://user-images.githubusercontent.com/32848391/35976041-15781de8-0cdf-11e8-997f-aeb725bc33cc.png +# :width: 300 px +# +#.. |tutorial.py| replace:: tutorial.py +#.. _tutorial.py: https://github.com/marcomusy/vtkplotter/blob/master/vtkplotter/examples/tutorial.py +# +# +#.. |thinplate_grid.py| replace:: thinplate_grid.py +#.. _thinplate_grid.py: https://github.com/marcomusy/vtkplotter/blob/master/vtkplotter/examples/advanced/thinplate_grid.py +#.. |thinplate_grid| image:: https://user-images.githubusercontent.com/32848391/51433540-d188b380-1c4c-11e9-81e7-a1cf4642c54b.png +# :width: 300 px +# :target: thinplate_grid.py_ +# :alt: thinplate_grid.py +# +#.. |gyroscope2.py| replace:: gyroscope2.py +#.. _gyroscope2.py: https://github.com/marcomusy/vtkplotter/blob/master/vtkplotter/examples/simulations/gyroscope2.py +#.. |gyroscope2| image:: https://user-images.githubusercontent.com/32848391/50738942-687b5780-11d9-11e9-97f0-72bbd63f7d6e.gif +# :width: 300 px +# :target: gyroscope2.py_ +# :alt: gyroscope2.py +# +#.. |trail.py| replace:: trail.py +#.. _trail.py: https://github.com/marcomusy/vtkplotter/blob/master/vtkplotter/examples/basic/trail.py +#.. |trail| image:: https://user-images.githubusercontent.com/32848391/58370826-4aee2680-7f0b-11e9-91e6-3120770cfede.gif +# :width: 300 px +# :target: trail.py_ +# :alt: trail.py +# +#.. |fillholes.py| replace:: fillholes.py +#.. _fillholes.py: https://github.com/marcomusy/vtkplotter/blob/master/vtkplotter/examples/basic/fillholes.py +# +#.. |quadratic_morphing.py| replace:: quadratic_morphing.py +#.. _quadratic_morphing.py: https://github.com/marcomusy/vtkplotter/blob/master/vtkplotter/examples/advanced/quadratic_morphing.py +#.. |quadratic_morphing| image:: https://user-images.githubusercontent.com/32848391/50738890-db380300-11d8-11e9-9cef-4c1276cca334.jpg +# :width: 300 px +# :target: quadratic_morphing.py_ +# :alt: quadratic_morphing.py +# +#.. |align1.py| replace:: align1.py +#.. _align1.py: https://github.com/marcomusy/vtkplotter/blob/master/vtkplotter/examples/basic/align1.py +#.. |align1| image:: https://user-images.githubusercontent.com/32848391/50738875-c196bb80-11d8-11e9-8bdc-b80fd01a928d.jpg +# :width: 300 px +# :target: align1.py_ +# :alt: align1.py +# +#.. |align2.py| replace:: align2.py +#.. _align2.py: https://github.com/marcomusy/vtkplotter/blob/master/vtkplotter/examples/basic/align2.py +#.. |align2| image:: https://user-images.githubusercontent.com/32848391/50738874-c196bb80-11d8-11e9-9587-2177d1680b70.jpg +# :width: 300 px +# :target: align2.py_ +# :alt: align2.py +# +#.. |mirror.py| replace:: mirror.py +#.. _mirror.py: https://github.com/marcomusy/vtkplotter/blob/master/vtkplotter/examples/basic/mirror.py +#.. |mirror| image:: https://user-images.githubusercontent.com/32848391/50738855-bf346180-11d8-11e9-97a0-c9aaae6ce052.jpg +# :target: mirror.py_ +# :alt: mirror.py +# +#.. |shrink.py| replace:: shrink.py +#.. _shrink.py: https://github.com/marcomusy/vtkplotter/blob/master/vtkplotter/examples/basic/shrink.py +#.. |shrink| image:: https://user-images.githubusercontent.com/32848391/46819143-41042280-cd83-11e8-9492-4f53679887fa.png +# :width: 300 px +# :target: shrink.py_ +# :alt: shrink.py +# +#.. |aspring.py| replace:: aspring.py +#.. _aspring.py: https://github.com/marcomusy/vtkplotter/blob/master/vtkplotter/examples/simulations/aspring.py +#.. |aspring| image:: https://user-images.githubusercontent.com/32848391/36788885-e97e80ae-1c8f-11e8-8b8f-ffc43dad1eb1.gif +# :width: 300 px +# :target: aspring.py_ +# :alt: aspring.py +# +#.. |delaunay2d.py| replace:: delaunay2d.py +#.. _delaunay2d.py: https://github.com/marcomusy/vtkplotter/blob/master/vtkplotter/examples/basic/delaunay2d.py +#.. |delaunay2d| image:: https://user-images.githubusercontent.com/32848391/50738865-c0658e80-11d8-11e9-8616-b77363aa4695.jpg +# :width: 300 px +# :target: delaunay2d.py_ +# :alt: delaunay2d.py +# +#.. |moving_least_squares1D.py| replace:: moving_least_squares1D.py +#.. _moving_least_squares1D.py: https://github.com/marcomusy/vtkplotter/blob/master/vtkplotter/examples/advanced/moving_least_squares1D.py +#.. |moving_least_squares1D| image:: https://user-images.githubusercontent.com/32848391/50738937-61544980-11d9-11e9-8be8-8826032b8baf.jpg +# :width: 300 px +# :target: moving_least_squares1D.py_ +# :alt: moving_least_squares1D.py +# +#.. |recosurface.py| replace:: recosurface.py +#.. _recosurface.py: https://github.com/marcomusy/vtkplotter/blob/master/vtkplotter/examples/advanced/recosurface.py +#.. |recosurface| image:: https://user-images.githubusercontent.com/32848391/46817107-b3263880-cd7e-11e8-985d-f5d158992f0c.png +# :target: recosurface.py_ +# :alt: recosurface.py +# +#.. |fatlimb.py| replace:: fatlimb.py +#.. _fatlimb.py: https://github.com/marcomusy/vtkplotter/blob/master/vtkplotter/examples/advanced/fatlimb.py +#.. |fatlimb| image:: https://user-images.githubusercontent.com/32848391/50738945-7335ec80-11d9-11e9-9d3f-c6c19df8f10d.jpg +# :width: 300 px +# :target: fatlimb.py_ +# :alt: fatlimb.py +# +#.. |largestregion.py| replace:: largestregion.py +#.. _largestregion.py: https://github.com/marcomusy/vtkplotter/blob/master/vtkplotter/examples/basic/largestregion.py +# +#.. |fitplanes.py| replace:: fitplanes.py +#.. _fitplanes.py: https://github.com/marcomusy/vtkplotter/blob/master/vtkplotter/examples/advanced/fitplanes.py +# +#.. |mesh_coloring.py| replace:: mesh_coloring.py +#.. _mesh_coloring.py: https://github.com/marcomusy/vtkplotter/blob/master/vtkplotter/examples/basic/mesh_coloring.py +#.. |mesh_coloring| image:: https://user-images.githubusercontent.com/32848391/50738856-bf346180-11d8-11e9-909c-a3f9d32c4e8c.jpg +# :width: 300 px +# :target: mesh_coloring.py_ +# :alt: mesh_coloring.py +# +#.. |mesh_alphas.py| replace:: mesh_alphas.py +#.. _mesh_alphas.py: https://github.com/marcomusy/vtkplotter/blob/master/vtkplotter/examples/basic/mesh_alphas.py +#.. |mesh_alphas| image:: https://user-images.githubusercontent.com/32848391/50738857-bf346180-11d8-11e9-80a1-d283aed0b305.jpg +# :width: 300 px +# :target: mesh_alphas.py_ +# :alt: mesh_alphas.py +# +#.. |mesh_bands.py| replace:: mesh_bands.py +#.. _mesh_bands.py: https://github.com/marcomusy/vtkplotter/blob/master/vtkplotter/examples/basic/mesh_bands.py +#.. |mesh_bands| image:: https://user-images.githubusercontent.com/32848391/51211548-26a78b00-1916-11e9-9306-67b677d1be3a.png +# :width: 300 px +# :target: mesh_bands.py_ +# :alt: mesh_bands.py +# +#.. |mesh_custom.py| replace:: mesh_custom.py +#.. _mesh_custom.py: https://github.com/marcomusy/vtkplotter/blob/master/vtkplotter/examples/mesh_custom.py +#.. |mesh_custom| image:: https://user-images.githubusercontent.com/32848391/51390972-20d9c180-1b31-11e9-955d-025f1ef24cb7.png +# :width: 300 px +# :target: mesh_custom.py_ +# :alt: mesh_custom.py +# +#.. |connVtx.py| replace:: connVtx.py +#.. _connVtx.py: https://github.com/marcomusy/vtkplotter/blob/master/vtkplotter/examples/basic/connVtx.py +#.. |connVtx| image:: https://user-images.githubusercontent.com/32848391/51558919-ec436e00-1e80-11e9-91ac-0787c35fc20e.png +# :width: 300 px +# :target: connVtx.py_ +# :alt: connVtx.py +# +#.. |spherical_harmonics1.py| replace:: spherical_harmonics1.py +#.. _spherical_harmonics1.py: https://github.com/marcomusy/vtkplotter/blob/master/vtkplotter/examples/other/spherical_harmonics1.py +# +#.. |spherical_harmonics2.py| replace:: spherical_harmonics2.py +#.. _spherical_harmonics2.py: https://github.com/marcomusy/vtkplotter/blob/master/vtkplotter/examples/other/spherical_harmonics2.py +# +#.. |skeletonize.py| replace:: skeletonize.py +#.. _skeletonize.py: https://github.com/marcomusy/vtkplotter/blob/master/vtkplotter/examples/advanced/skeletonize.py +#.. |skeletonize| image:: https://user-images.githubusercontent.com/32848391/46820954-c5f13b00-cd87-11e8-87aa-286528a09de8.png +# :target: spherical_harmonics2.py_ +# :alt: skeletonize.py +# +#.. |gyroscope1.py| replace:: gyroscope1.py +#.. _gyroscope1.py: https://github.com/marcomusy/vtkplotter/blob/master/vtkplotter/examples/simulations/gyroscope1.py +#.. |gyroscope1| image:: https://user-images.githubusercontent.com/32848391/39766016-85c1c1d6-52e3-11e8-8575-d167b7ce5217.gif +# :width: 300 px +# :target: gyroscope1.py_ +# :alt: gyroscope1.py +# +#.. |icon.py| replace:: icon.py +#.. _icon.py: https://github.com/marcomusy/vtkplotter/blob/master/vtkplotter/examples/basic/icon.py +#.. |icon| image:: https://user-images.githubusercontent.com/32848391/50739009-2bfc2b80-11da-11e9-9e2e-a5e0e987a91a.jpg +# :width: 300 px +# :target: icon.py_ +# +#.. |lights.py| replace:: lights.py +#.. _lights.py: https://github.com/marcomusy/vtkplotter/blob/master/vtkplotter/examples/basic/lights.py +# :width: 300 px +# :target: lights.py_ +# :alt: lights.py +# +#.. |lorenz.py| replace:: lorenz.py +#.. _lorenz.py: https://github.com/marcomusy/vtkplotter/blob/master/vtkplotter/examples/basic/lorenz.py +#.. |lorenz| image:: https://user-images.githubusercontent.com/32848391/46818115-be7a6380-cd80-11e8-8ffb-60af2631bf71.png +# :width: 300 px +# :target: lorenz.py_ +# :alt: lorenz.py +# +#.. |sliders.py| replace:: sliders.py +#.. _sliders.py: https://github.com/marcomusy/vtkplotter/blob/master/vtkplotter/examples/basic/sliders.py +#.. |sliders| image:: https://user-images.githubusercontent.com/32848391/50738848-be033480-11d8-11e9-9b1a-c13105423a79.jpg +# :width: 300 px +# :target: sliders.py_ +# :alt: sliders.py +# +#.. |buttons.py| replace:: buttons.py +#.. _buttons.py: https://github.com/marcomusy/vtkplotter/blob/master/vtkplotter/examples/basic/buttons.py +#.. |buttons| image:: https://user-images.githubusercontent.com/32848391/50738870-c0fe2500-11d8-11e9-9b78-92754f5c5968.jpg +# :width: 300 px +# :target: buttons.py_ +# :alt: buttons.py +# +#.. |cutter.py| replace:: cutter.py +#.. _cutter.py: https://github.com/marcomusy/vtkplotter/blob/master/vtkplotter/examples/basic/cutter.py +#.. |cutter| image:: https://user-images.githubusercontent.com/32848391/50738866-c0658e80-11d8-11e9-955b-551d4d8b0db5.jpg +# :width: 300 px +# :target: cutter.py_ +# :alt: cutter.py +# +#.. |makeVideo.py| replace:: makeVideo.py +#.. _makeVideo.py: https://github.com/marcomusy/vtkplotter/blob/master/vtkplotter/examples/other/makeVideo.py +#.. |makeVideo| image:: https://user-images.githubusercontent.com/32848391/50739007-2bfc2b80-11da-11e9-97e6-620a3541a6fa.jpg +# :width: 300 px +# :target: makeVideo.py_ +# :alt: makeVideo.py +# +#.. |fitspheres1.py| replace:: fitspheres1.py +#.. _fitspheres1.py: https://github.com/marcomusy/vtkplotter/blob/master/vtkplotter/examples/advanced/fitspheres1.py +# +#.. |fitspheres2.py| replace:: fitspheres2.py +#.. _fitspheres2.py: https://github.com/marcomusy/vtkplotter/blob/master/vtkplotter/examples/advanced/fitspheres2.py +#.. |fitspheres2| image:: https://user-images.githubusercontent.com/32848391/50738943-687b5780-11d9-11e9-87a6-054e0fe76241.jpg +# :width: 300 px +# :target: fitspheres2.py_ +# :alt: fitspheres2.py +# +#.. |plot4_fxy.py| replace:: plot4_fxy.py +#.. _plot4_fxy.py: https://github.com/marcomusy/vtkplotter/blob/master/vtkplotter/examples/pyplot/plot4_fxy.py +#.. |plot4_fxy| image:: https://user-images.githubusercontent.com/32848391/36611824-fd524fac-18d4-11e8-8c76-d3d1b1bb3954.png +# :width: 300 px +# :target: plot4_fxy.py_ +# :alt: plot4_fxy.py +# +#.. |histo_hexagonal.py| replace:: histo_hexagonal.py +#.. _histo_hexagonal.py: https://github.com/marcomusy/vtkplotter/blob/master/vtkplotter/examples/pyplot/histo_hexagonal.py +#.. |histo_hexagonal| image:: https://user-images.githubusercontent.com/32848391/72434748-b471bc80-379c-11ea-95d7-d70333770582.png +# :width: 300 px +# :target: histo_hexagonal.py_ +# :alt: histo_hexagonal.py +# +#.. |histo_1D.py| replace:: histo_1D.py +#.. _histo_1D.py: https://github.com/marcomusy/vtkplotter/blob/master/vtkplotter/examples/pyplot/histo_1D.py +#.. |histo_1D| image:: https://user-images.githubusercontent.com/32848391/68141260-77cc4e00-ff2d-11e9-9280-0efc5b87314d.png +# :width: 300 px +# :target: histo_1D.py_ +# :alt: histo_1D.py +# +#.. |histo_violin.py| replace:: histo_violin.py +#.. _histo_violin.py: https://github.com/marcomusy/vtkplotter/blob/master/vtkplotter/examples/pyplot/histo_violin.py +#.. |histo_violin| image:: https://user-images.githubusercontent.com/32848391/73481240-b55d3d80-439b-11ea-89a4-6c35ecc84b0d.png +# :width: 300 px +# :target: histo_violin.py_ +# :alt: histo_violin.py +# +# +#.. |align3.py| replace:: align3.py +#.. _align3.py: https://github.com/marcomusy/vtkplotter/blob/master/vtkplotter/examples/basic/align3.py +#.. |align3| image:: https://user-images.githubusercontent.com/32848391/50738873-c196bb80-11d8-11e9-8653-a41108a5f02d.png +# :width: 300 px +# :target: align3.py_ +# :alt: align3.py +# +#.. |pca.py| replace:: pca.py +#.. _pca.py: https://github.com/marcomusy/vtkplotter/blob/master/vtkplotter/examples/basic/pca.py +#.. |pca| image:: https://user-images.githubusercontent.com/32848391/50738852-be9bcb00-11d8-11e9-8ac8-ad9278d9cee0.jpg +# :width: 300 px +# :target: pca.py_ +# :alt: pca.py +# +#.. |cell_colony.py| replace:: cell_colony.py +#.. _cell_colony.py: https://github.com/marcomusy/vtkplotter/blob/master/vtkplotter/examples/simulations/cell_colony.py +#.. |cell_colony| image:: https://user-images.githubusercontent.com/32848391/50738947-7335ec80-11d9-11e9-9a45-6053b4eaf9f9.jpg +# :width: 300 px +# :target: cell_colony.py_ +# :alt: cell_colony.py +# +#.. |mesh_smoothers.py| replace:: mesh_smoothers.py +#.. _mesh_smoothers.py: https://github.com/marcomusy/vtkplotter/blob/master/vtkplotter/examples/advanced/mesh_smoothers.py +#.. |mesh_smoothers| image:: https://user-images.githubusercontent.com/32848391/50738939-67e2c100-11d9-11e9-90cb-716ff3f03f67.jpg +# :width: 300 px +# :target: mesh_smoothers.py_ +# :alt: mesh_smoothers.py +# +#.. |moving_least_squares3D.py| replace:: moving_least_squares3D.py +#.. _moving_least_squares3D.py: https://github.com/marcomusy/vtkplotter/blob/master/vtkplotter/examples/advanced/moving_least_squares3D.py +#.. |moving_least_squares3D| image:: https://user-images.githubusercontent.com/32848391/50738935-61544980-11d9-11e9-9c20-f2ce944d2238.jpg +# :width: 300 px +# :target: moving_least_squares3D.py_ +# :alt: moving_least_squares3D.py +# +#.. |moving_least_squares2D.py| replace:: moving_least_squares2D.py +#.. _moving_least_squares2D.py: https://github.com/marcomusy/vtkplotter/blob/master/vtkplotter/examples/advanced/moving_least_squares2D.py +#.. |moving_least_squares2D| image:: https://user-images.githubusercontent.com/32848391/50738936-61544980-11d9-11e9-9efb-e2a923762b72.jpg +# :width: 300 px +# :target: moving_least_squares2D.py_ +# :alt: moving_least_squares2D.py +# +#.. |boolean.py| replace:: boolean.py +#.. _boolean.py: https://github.com/marcomusy/vtkplotter/blob/master/vtkplotter/examples/basic/boolean.py +#.. |boolean| image:: https://user-images.githubusercontent.com/32848391/50738871-c0fe2500-11d8-11e9-8812-442b69be6db9.png +# :width: 300 px +# :target: boolean.py_ +# :alt: boolean.py +# +#.. |surfIntersect.py| replace:: surfIntersect.py +#.. _surfIntersect.py: https://github.com/marcomusy/vtkplotter/blob/master/vtkplotter/examples/basic/surfIntersect.py +# +#.. |probeLine.py| replace:: probeLine.py +#.. _probeLine.py: https://github.com/marcomusy/vtkplotter/blob/master/vtkplotter/examples/volumetric/probeLine.py +#.. |probeLine| image:: https://user-images.githubusercontent.com/32848391/48198460-3aa0a080-e359-11e8-982d-23fadf4de66f.jpg +# :width: 300 px +# :target: probeLine.py_ +# :alt: probeLine.py +# +#.. |probePlane.py| replace:: probePlane.py +#.. _probePlane.py: https://github.com/marcomusy/vtkplotter/blob/master/vtkplotter/examples/volumetric/probePlane.py +#.. |probePlane| image:: https://user-images.githubusercontent.com/32848391/48198461-3aa0a080-e359-11e8-8c29-18f287f105e6.jpg +# :width: 300 px +# :target: probePlane.py_ +# :alt: probePlane.py +# +#.. |volumeOperations.py| replace:: volumeOperations.py +#.. _volumeOperations.py: https://github.com/marcomusy/vtkplotter/blob/master/vtkplotter/examples/volumetric/volumeOperations.py +#.. |volumeOperations| image:: https://user-images.githubusercontent.com/32848391/48198940-d1ba2800-e35a-11e8-96a7-ffbff797f165.jpg +# :width: 300 px +# :alt: volumeOperations.py +# +#.. |clustering.py| replace:: clustering.py +#.. _clustering.py: https://github.com/marcomusy/vtkplotter/blob/master/vtkplotter/examples/basic/clustering.py +#.. |clustering| image:: https://user-images.githubusercontent.com/32848391/46817286-2039ce00-cd7f-11e8-8b29-42925e03c974.png +# :width: 300 px +# :target: clustering.py_ +# :alt: clustering.py +# +#.. |thinplate_morphing1.py| replace:: thinplate_morphing1.py +#.. _thinplate_morphing1.py: https://github.com/marcomusy/vtkplotter/blob/master/vtkplotter/examples/advanced/thinplate_morphing1.py +#.. |thinplate_morphing1| image:: https://user-images.githubusercontent.com/32848391/51403917-34495480-1b52-11e9-956c-918c7805a9b5.png +# :width: 300 px +# :target: thinplate_morphing1.py_ +# :alt: thinplate_morphing1.py +# +#.. |colorcubes.py| replace:: colorcubes.py +#.. _colorcubes.py: https://github.com/marcomusy/vtkplotter/blob/master/vtkplotter/examples/basic/colorcubes.py +#.. |colorcubes| image:: https://user-images.githubusercontent.com/32848391/50738867-c0658e80-11d8-11e9-9e05-ac69b546b7ec.png +# :width: 300 px +# :target: colorcubes.py_ +# :alt: colorcubes.py +# +#.. |colorpalette.py| replace:: colorpalette.py +#.. _colorpalette.py: https://github.com/marcomusy/vtkplotter/blob/master/vtkplotter/examples/other/colorpalette.py +#.. |colorpalette| image:: https://user-images.githubusercontent.com/32848391/50739011-2c94c200-11da-11e9-8f36-ede1b2a014a8.jpg +# :width: 300 px +# :target: colorpalette.py +# :alt: colorpalette.py +# +#.. |colormaps| image:: https://user-images.githubusercontent.com/32848391/50738804-577e1680-11d8-11e9-929e-fca17a8ac6f3.jpg +# :width: 450 px +# :alt: colormaps +# +#.. |tannerhelland| replace:: tannerhelland +#.. _tannerhelland: http://www.tannerhelland.com/4435/convert-temperature-rgb-algorithm-code +# +#.. |colorprint.py| replace:: printc.py +#.. _colorprint.py: https://github.com/marcomusy/vtkplotter/blob/master/vtkplotter/examples/other/printc.py +#.. |colorprint| image:: https://user-images.githubusercontent.com/32848391/50739010-2bfc2b80-11da-11e9-94de-011e50a86e61.jpg +# :target: colorprint.py_ +# :alt: colorprint.py +# +#.. |ribbon.py| replace:: ribbon.py +#.. _ribbon.py: https://github.com/marcomusy/vtkplotter/blob/master/vtkplotter/examples/basic/ribbon.py +#.. |ribbon| image:: https://user-images.githubusercontent.com/32848391/50738851-be9bcb00-11d8-11e9-80ee-bd73c1c29c06.jpg +# :width: 300 px +# :target: ribbon.py_ +# :alt: ribbon.py +# +#.. |manyspheres.py| replace:: manyspheres.py +#.. _manyspheres.py: https://github.com/marcomusy/vtkplotter/blob/master/vtkplotter/examples/basic/manyspheres.py +#.. |manyspheres| image:: https://user-images.githubusercontent.com/32848391/46818673-1f566b80-cd82-11e8-9a61-be6a56160f1c.png +# :target: manyspheres.py_ +# +#.. |manypoints.py| replace:: manypoints.py +#.. _manypoints.py: https://github.com/marcomusy/vtkplotter/blob/master/vtkplotter/examples/basic/manypoints.py +# +#.. |earth.py| replace:: earth.py +#.. _earth.py: https://github.com/marcomusy/vtkplotter/blob/master/vtkplotter/examples/basic/earth.py +#.. |earth| image:: https://user-images.githubusercontent.com/32848391/51031592-5a448700-159d-11e9-9b66-bee6abb18679.png +# :width: 300 px +# :target: earth.py_ +# :alt: earth.py +# +#.. |brownian2D.py| replace:: brownian2D.py +#.. _brownian2D.py: https://github.com/marcomusy/vtkplotter/blob/master/vtkplotter/examples/simulations/brownian2D.py +#.. |brownian2D| image:: https://user-images.githubusercontent.com/32848391/50738948-73ce8300-11d9-11e9-8ef6-fc4f64c4a9ce.gif +# :width: 300 px +# :target: brownian2D.py_ +# +#.. |gas.py| replace:: gas.py +#.. _gas.py: https://github.com/marcomusy/vtkplotter/blob/master/vtkplotter/examples/simulations/gas.py +#.. |gas| image:: https://user-images.githubusercontent.com/32848391/50738954-7e891800-11d9-11e9-95aa-67c92ca6476b.gif +# :width: 300 px +# :target: gas.py_ +# :alt: gas.py +# +#.. |tube.py| replace:: tube.py +#.. _tube.py: https://github.com/marcomusy/vtkplotter/blob/master/vtkplotter/examples/basic/tube.py +#.. |tube| image:: https://user-images.githubusercontent.com/32848391/51801626-adc30000-2240-11e9-8866-9d9d5d8790ab.png +# :width: 300 px +# :target: tube.py_ +# :alt: tube.py +# +#.. |mesh_threshold.py| replace:: mesh_threshold.py +#.. _mesh_threshold.py: https://github.com/marcomusy/vtkplotter/blob/master/vtkplotter/examples/basic/mesh_threshold.py +#.. |mesh_threshold| image:: https://user-images.githubusercontent.com/32848391/51807663-4762cf80-228a-11e9-9d0c-184bb11a97bf.png +# :width: 300 px +# :target: mesh_threshold.py_ +# :alt: mesh_threshold.py +# +#.. |cutWithMesh.py| replace:: cutWithMesh.py +#.. _cutWithMesh.py: https://github.com/marcomusy/vtkplotter/blob/master/vtkplotter/examples/advanced/cutWithMesh.py +#.. |cutWithMesh| image:: https://user-images.githubusercontent.com/32848391/51808907-e7c0f000-229a-11e9-98a7-fefc7261b3c3.png +# :width: 300 px +# :target: cutWithMesh.py_ +# :alt: cutWithMesh.py +# +#.. |paraboloid| image:: https://user-images.githubusercontent.com/32848391/51211547-260ef480-1916-11e9-95f6-4a677e37e355.png +# :width: 300 px +# :alt: paraboloid +# +#.. |isosurfaces.py| replace:: isosurfaces.py +#.. _isosurfaces.py: https://github.com/marcomusy/vtkplotter/blob/master/vtkplotter/examples/volumetric/isosurfaces.py +#.. |isosurfaces| image:: https://user-images.githubusercontent.com/32848391/51558920-ec436e00-1e80-11e9-9d96-aa9b7c72d58b.png +# :width: 300 px +# :target: isosurfaces.py_ +# :alt: isosurfaces.py +# +#.. |meshquality.py| replace:: meshquality.py +#.. _meshquality.py: https://github.com/marcomusy/vtkplotter/blob/master/vtkplotter/examples/advanced/meshquality.py +#.. |meshquality| image:: https://user-images.githubusercontent.com/32848391/51831269-fb4b7580-22f1-11e9-81ea-13467a5649ca.png +# :width: 300 px +# :target: meshquality.py_ +# :alt: meshquality.py +# +#.. |geodesic.py| replace:: geodesic.py +#.. _geodesic.py: https://github.com/marcomusy/vtkplotter/blob/master/vtkplotter/examples/advanced/geodesic.py +#.. |geodesic| image:: https://user-images.githubusercontent.com/32848391/51855637-015f4780-232e-11e9-92ca-053a558e7f70.png +# :width: 300 px +# :target: geodesic.py_ +# :alt: geodesic.py +# +# +#.. |cutAndCap.py| replace:: cutAndCap.py +#.. _cutAndCap.py: https://github.com/marcomusy/vtkplotter/blob/master/vtkplotter/examples/advanced/cutAndCap.py +#.. |cutAndCap| image:: https://user-images.githubusercontent.com/32848391/51930515-16ee7300-23fb-11e9-91af-2b6b3d626246.png +# :width: 300 px +# :target: cutAndCap.py_ +# :alt: cutAndCap.py +# +# +#.. |convexHull.py| replace:: convexHull.py +#.. _convexHull.py: https://github.com/marcomusy/vtkplotter/blob/master/vtkplotter/examples/advanced/convexHull.py +#.. |convexHull| image:: https://user-images.githubusercontent.com/32848391/51932732-068cc700-2400-11e9-9b68-30294a4fa4e3.png +# :width: 300 px +# :target: convexHull.py_ +# :alt: convexHull.py +# +#.. |curvature| image:: https://user-images.githubusercontent.com/32848391/51934810-c2e88c00-2404-11e9-8e7e-ca0b7984bbb7.png +# :alt: curvature +# +#.. |progbar| image:: https://user-images.githubusercontent.com/32848391/51858823-ed1f4880-2335-11e9-8788-2d102ace2578.png +# :alt: progressbar +# +#.. |multiwindows| image:: https://user-images.githubusercontent.com/32848391/50738853-be9bcb00-11d8-11e9-9c8e-69864ad7c045.jpg +# :alt: multiwindows +# +#.. |annotations.py| replace:: annotations.py +#.. _annotations.py: https://github.com/marcomusy/vtkplotter/blob/master/vtkplotter/examples/pyplot/annotations.py +# +#.. |Cone| image:: https://raw.githubusercontent.com/lorensen/VTKExamples/master/src/Testing/Baseline/Cxx/GeometricObjects/TestCone.png +# :width: 300 px +# +#.. |Cylinder| image:: https://raw.githubusercontent.com/lorensen/VTKExamples/master/src/Testing/Baseline/Cxx/GeometricObjects/TestCylinder.png +# :width: 300 px +# +#.. |Disk| image:: https://raw.githubusercontent.com/lorensen/VTKExamples/master/src/Testing/Baseline/Cxx/GeometricObjects/TestDisk.png +# :width: 300 px +# +#.. |OrientedArrow| image:: https://raw.githubusercontent.com/lorensen/VTKExamples/master/src/Testing/Baseline/Cxx/GeometricObjects/TestOrientedArrow.png +# :width: 300 px +# +#.. |Plane| image:: https://raw.githubusercontent.com/lorensen/VTKExamples/master/src/Testing/Baseline/Cxx/GeometricObjects/TestPlane.png +# :width: 300 px +# +#.. |Polygon| image:: https://raw.githubusercontent.com/lorensen/VTKExamples/master/src/Testing/Baseline/Cxx/GeometricObjects/TestRegularPolygonSource.png +# :width: 300 px +# +#.. |Sphere| image:: https://raw.githubusercontent.com/lorensen/VTKExamples/master/src/Testing/Baseline/Cxx/GeometricObjects/TestSphere.png +# :width: 300 px +# +# +#.. |embryoslider| image:: https://user-images.githubusercontent.com/32848391/52141624-975ce000-2656-11e9-8d31-2a3c92ab79d6.png +# :width: 300 px +# +#.. |isosurfaces1| image:: https://user-images.githubusercontent.com/32848391/52141625-975ce000-2656-11e9-91fc-291e072fc4c1.png +# :width: 300 px +# +#.. |splitmesh.py| replace:: splitmesh.py +#.. _splitmesh.py: https://github.com/marcomusy/vtkplotter/blob/master/vtkplotter/examples/advanced/splitmesh.py +#.. |splitmesh| image:: https://user-images.githubusercontent.com/32848391/52141626-97f57680-2656-11e9-80ea-fcd3571a6422.png +# :width: 300 px +# :target: splitmesh.py_ +# :alt: splitmesh.py +# +#.. |thinplate_morphing2.py| replace:: thinplate_morphing2.py +#.. _thinplate_morphing2.py: https://github.com/marcomusy/vtkplotter/blob/master/vtkplotter/examples/advanced/thinplate_morphing2.py +#.. |thinplate_morphing2| image:: https://user-images.githubusercontent.com/32848391/52142303-9927a300-2658-11e9-98db-ebad4883f99f.png +# :width: 300 px +# :target: thinplate_morphing2.py_ +# :alt: thinplate_morphing2.py +# +#.. |projectsphere.py| replace:: projectsphere.py +#.. _projectsphere.py: https://github.com/marcomusy/vtkplotter/blob/master/vtkplotter/examples/advanced/projectsphere.py +#.. |projectsphere| image:: https://user-images.githubusercontent.com/32848391/52144163-c9be0b80-265d-11e9-9ce6-d6f2b919c214.png +# :width: 300 px +# :target: projectsphere.py_ +# :alt: projectsphere.py +# +# +#.. |mesh2volume.py| replace:: mesh2volume.py +#.. _mesh2volume.py: https://github.com/marcomusy/vtkplotter/blob/master/vtkplotter/examples/volumetric/mesh2volume.py +#.. |mesh2volume| image:: https://user-images.githubusercontent.com/32848391/52168902-5638fe80-2730-11e9-8033-8e470a3d4f0f.jpg +# :width: 300 px +# :target: mesh2volume.py_ +# :alt: mesh2volume.py +# +#.. |markpoint.py| replace:: markpoint.py +#.. _markpoint.py: https://github.com/marcomusy/vtkplotter/blob/master/vtkplotter/examples/pyplot/markpoint.py +#.. |markpoint| image:: https://user-images.githubusercontent.com/32848391/52169969-1fb7af80-2741-11e9-937f-5c331d9a1d11.jpg +# :width: 300 px +# :target: markpoint.py_ +# :alt: markpoint.py +# +#.. |readVolumeAsIsoSurface.py| replace:: readVolumeAsIsoSurface.py +#.. _readVolumeAsIsoSurface.py: https://github.com/marcomusy/vtkplotter/blob/master/vtkplotter/examples/volumetric/readVolumeAsIsoSurface.py +# +#.. |read_vti.py| replace:: read_vti.py +#.. _read_vti.py: https://github.com/marcomusy/vtkplotter/blob/master/vtkplotter/examples/volumetric/read_vti.py +#.. |read_vti| image:: https://user-images.githubusercontent.com/32848391/50739036-6bc31300-11da-11e9-89b3-04a75187f812.jpg +# :width: 300 px +# :target: read_vti.py_ +# :alt: read_vti.py +# +#.. |glyphs.py| replace:: glyphs.py +#.. _glyphs.py: https://github.com/marcomusy/vtkplotter/blob/master/vtkplotter/examples/basic/glyphs.py +#.. |glyphs| image:: https://user-images.githubusercontent.com/32848391/52233403-47cd1d00-28bf-11e9-86b0-cbceebbde0de.jpg +# :width: 300 px +# :target: glyphs.py_ +# :alt: glyphs.py +# +#.. |glyphs_arrows.py| replace:: glyphs_arrows.py +#.. _glyphs_arrows.py: https://github.com/marcomusy/vtkplotter/blob/master/vtkplotter/examples/basic/glyphs_arrows.py +#.. |glyphs_arrows| image:: https://user-images.githubusercontent.com/32848391/55897850-a1a0da80-5bc1-11e9-81e0-004c8f396b43.jpg +# :width: 300 px +# :target: glyphs_arrows.py_ +# :alt: glyphs_arrows.py +# +#.. |interpolateField.py| replace:: interpolateField.py +#.. _interpolateField.py: https://github.com/marcomusy/vtkplotter/blob/master/vtkplotter/examples/advanced/interpolateField.py +#.. |interpolateField| image:: https://user-images.githubusercontent.com/32848391/52416117-25b6e300-2ae9-11e9-8d86-575b97e543c0.png +# :width: 300 px +# :target: interpolateField.py_ +# :alt: interpolateField.py +# +#.. |rotateImage.py| replace:: rotateImage.py +#.. _rotateImage.py: https://github.com/marcomusy/vtkplotter/blob/master/vtkplotter/examples/basic/rotateImage.py +#.. |rotateImage| image:: https://user-images.githubusercontent.com/32848391/52416910-fb662500-2aea-11e9-88ba-9c73128e8666.jpg +# :width: 300 px +# :target: rotateImage.py_ +# :alt: rotateImage.py +# +#.. |basicshapes| image:: https://user-images.githubusercontent.com/32848391/50738811-58af4380-11d8-11e9-9bfb-378c27c9d26f.png +# :alt: basicshapes +# +#.. |lines| image:: https://user-images.githubusercontent.com/32848391/52503049-ac9cb600-2be4-11e9-86af-72a538af14ef.png +# :width: 300 px +# :alt: lines +# +#.. |vlogo_large| image:: https://user-images.githubusercontent.com/32848391/52522716-4fa70b80-2c89-11e9-92a7-0d22cbe34758.png +# :alt: vlogo_large +# +#.. |vlogo_medium| image:: https://user-images.githubusercontent.com/32848391/52522717-503fa200-2c89-11e9-87ab-67eb44652e24.png +# :alt: vlogo_medium +# +#.. |vlogo_small| image:: https://user-images.githubusercontent.com/32848391/52522718-50d83880-2c89-11e9-80ff-df1b5618a84a.png +# :alt: vlogo_small +# +#.. |vlogo_small_dark| image:: https://user-images.githubusercontent.com/32848391/52522719-50d83880-2c89-11e9-8b90-a1c21c27b007.png +# :alt: vlogo_small_dark +# +#.. |vlogo_tube| image:: https://user-images.githubusercontent.com/32848391/52522720-5170cf00-2c89-11e9-8b1d-a7a5cf75e71b.png +# :alt: vlogo_tube +# +#.. |vlogo_tube_dark| image:: https://user-images.githubusercontent.com/32848391/52522721-5170cf00-2c89-11e9-8fbb-6efa13940aa1.png +# :alt: vlogo_tube_dark +# +#.. |fitline.py| replace:: fitline.py +#.. _fitline.py: https://github.com/marcomusy/vtkplotter/blob/master/vtkplotter/examples/basic/fitline.py +#.. |fitline| image:: https://user-images.githubusercontent.com/32848391/50738864-c0658e80-11d8-11e9-8754-c670f1f331d6.jpg +# :width: 300 px +# :target: fitline.py_ +# :alt: fitline.py +# +#.. |sliders3d.py| replace:: sliders3d.py +#.. _sliders3d.py: https://github.com/marcomusy/vtkplotter/blob/master/vtkplotter/examples/basic/sliders3d.py +#.. |sliders3d| image:: https://user-images.githubusercontent.com/32848391/52859555-4efcf200-312d-11e9-9290-6988c8295163.png +# :width: 300 px +# :target: sliders3d.py_ +# :alt: sliders3d.py +# +#.. |ex01_showmesh.py| replace:: ex01_showmesh.py +#.. _ex01_showmesh.py: https://github.com/marcomusy/vtkplotter/blob/master/vtkplotter/examples/other/dolfin/ex01_show-mesh.py +#.. |ex01_showmesh| image:: https://user-images.githubusercontent.com/32848391/53026243-d2d31900-3462-11e9-9dde-518218c241b6.jpg +# :width: 300 px +# :target: ex01_showmesh.py_ +# :alt: ex01_showmesh.py +# +#.. |ex02_tetralize-mesh.py| replace:: ex02_tetralize-mesh.py +#.. _ex02_tetralize-mesh.py: https://github.com/marcomusy/vtkplotter/blob/master/vtkplotter/examples/other/dolfin/ex02_tetralize-mesh.py +#.. |ex02_tetralize-mesh| image:: https://user-images.githubusercontent.com/32848391/53026244-d2d31900-3462-11e9-835a-1fa9d66d3dae.png +# :width: 300 px +# :target: ex02_tetralize-mesh.py_ +# :alt: ex02_tetralize-mesh.py +# +#.. |ex06_elasticity1.py| replace:: ex06_elasticity1.py +#.. _ex06_elasticity1.py: https://github.com/marcomusy/vtkplotter/blob/master/vtkplotter/examples/other/dolfin/ex06_elasticity1.py +#.. |ex06_elasticity1| image:: https://user-images.githubusercontent.com/32848391/53026245-d2d31900-3462-11e9-9db4-96211569d114.jpg +# :width: 300 px +# :target: ex06_elasticity1.py_ +# :alt: ex06_elasticity1.py +# +#.. |ex06_elasticity2.py| replace:: ex06_elasticity2.py +#.. _ex06_elasticity2.py: https://github.com/marcomusy/vtkplotter/blob/master/vtkplotter/examples/other/dolfin/ex06_elasticity2.py +#.. |ex06_elasticity2| image:: https://user-images.githubusercontent.com/32848391/53026246-d36baf80-3462-11e9-96a5-8eaf0bb0f9a4.jpg +# :width: 300 px +# :target: ex06_elasticity2.py_ +# :alt: ex06_elasticity2.py +# +# +#.. |flatarrow.py| replace:: flatarrow.py +#.. _flatarrow.py: https://github.com/marcomusy/vtkplotter/blob/master/vtkplotter/examples/other/basic/flatarrow.py +#.. |flatarrow| image:: https://user-images.githubusercontent.com/32848391/54612632-97c00780-4a59-11e9-8532-940c25a5dfd8.png +# :width: 300 px +# :target: flatarrow.py_ +# :alt: flatarrow.py +# +#.. |printhisto| image:: https://user-images.githubusercontent.com/32848391/55073046-03732780-508d-11e9-9bf9-c5de8631dd73.png +# :width: 300 px +# +#.. |pmatrix| image:: https://user-images.githubusercontent.com/32848391/55098070-6da3c080-50bd-11e9-8f2b-be94a3f01831.png +# :width: 300 px +# +#.. |distance2mesh.py| replace:: distance2mesh.py +#.. _distance2mesh.py: https://github.com/marcomusy/vtkplotter/blob/master/vtkplotter/examples/basic/distance2mesh.py +#.. |distance2mesh| image:: https://user-images.githubusercontent.com/32848391/55965881-b5a71380-5c77-11e9-8680-5bddceab813a.png +# :width: 300 px +# :target: distance2mesh.py_ +# :alt: distance2mesh.py +# +#.. |pendulum.py| replace:: pendulum.py +#.. _pendulum.py: https://github.com/marcomusy/vtkplotter/blob/master/vtkplotter/examples/simulations/pendulum.py +#.. |pendulum| image:: https://user-images.githubusercontent.com/32848391/55420020-51e56200-5576-11e9-8513-4a5d93913b17.png +# :width: 300 px +# :target: pendulum.py_ +# :alt: pendulum.py +# +#.. |latex.py| replace:: latex.py +#.. _latex.py: https://github.com/marcomusy/vtkplotter/blob/master/vtkplotter/examples/pyplot/latex.py +#.. |latex| image:: https://user-images.githubusercontent.com/32848391/55568648-6190b200-5700-11e9-9547-0798c588a7a5.png +# :width: 300 px +# :target: latex.py_ +# :alt: latex.py +# +#.. |ft04_heat_gaussian.py| replace:: ft04_heat_gaussian.py +#.. _ft04_heat_gaussian.py: https://github.com/marcomusy/vtkplotter/blob/master/vtkplotter/examples/other/dolfin/ft04_heat_gaussian.py +#.. |ft04_heat_gaussian| image:: https://user-images.githubusercontent.com/32848391/55578167-88a5ae80-5715-11e9-84ea-bdab54099887.gif +# :width: 300 px +# :target: ft04_heat_gaussian.py_ +# :alt: ft04_heat_gaussian.py +# +#.. |cutcube| image:: https://user-images.githubusercontent.com/32848391/55965516-08cc9680-5c77-11e9-8d23-720f6c088ea2.png +# :width: 200 px +# +#.. |intline| image:: https://user-images.githubusercontent.com/32848391/55967065-eee08300-5c79-11e9-8933-265e1bab9f7e.png +# :width: 300 px +# +#.. |cropped| image:: https://user-images.githubusercontent.com/32848391/57081955-0ef1e800-6cf6-11e9-99de-b45220939bc9.png +# :width: 300 px +# +#.. |dolfinmesh| image:: https://user-images.githubusercontent.com/32848391/53026243-d2d31900-3462-11e9-9dde-518218c241b6.jpg +# :width: 300 px +# +#.. |turing_pattern.py| replace:: turing_pattern.py +#.. _turing_pattern.py: https://github.com/marcomusy/vtkplotter/blob/master/vtkplotter/examples/other/dolfin/turing_pattern.py +#.. |turing_pattern| image:: https://user-images.githubusercontent.com/32848391/56056437-77cfeb00-5d5c-11e9-9887-828e5745d547.gif +# :width: 300 px +# :target: turing_pattern.py_ +# :alt: turing_pattern.py +# +#.. |demo_cahn-hilliard.py| replace:: demo_cahn-hilliard.py +#.. _demo_cahn-hilliard.py: https://github.com/marcomusy/vtkplotter/blob/master/vtkplotter/examples/other/dolfin/demo_cahn-hilliard.py +#.. |demo_cahn-hilliard| image:: https://user-images.githubusercontent.com/32848391/56664730-edb34b00-66a8-11e9-9bf3-73431f2a98ac.gif +# :width: 300 px +# :target: demo_cahn-hilliard.py_ +# :alt: demo_cahn-hilliard.py +# +# +#.. |navier-stokes_lshape.py| replace:: navier-stokes_lshape.py +#.. _navier-stokes_lshape.py: https://github.com/marcomusy/vtkplotter/blob/master/vtkplotter/examples/other/dolfin/navier-stokes_lshape.py +#.. |navier-stokes_lshape| image:: https://user-images.githubusercontent.com/32848391/56671156-6bc91f00-66b4-11e9-8c58-e6b71e2ad1d0.gif +# :width: 300 px +# :target: navier-stokes_lshape.py_ +# :alt: navier-stokes_lshape.py +# +# +#.. |mesh_map2cell.py| replace:: mesh_map2cell.py +#.. _mesh_map2cell.py: https://github.com/marcomusy/vtkplotter/blob/master/vtkplotter/examples/basic/mesh_map2cell.py +#.. |mesh_map2cell| image:: https://user-images.githubusercontent.com/32848391/56600859-0153a880-65fa-11e9-88be-34fd96b18e9a.png +# :width: 300 px +# :target: mesh_map2cell.py_ +# :alt: mesh_map2cell.py +# +# +#.. |ex03_poisson.py| replace:: ex03_poisson.py +#.. _ex03_poisson.py: https://github.com/marcomusy/vtkplotter/blob/master/vtkplotter/examples/other/dolfin/ex03_poisson.py +#.. |ex03_poisson| image:: https://user-images.githubusercontent.com/32848391/54925524-bec18200-4f0e-11e9-9eab-29fd61ef3b8e.png +# :width: 300 px +# :target: ex03_poisson.py_ +# :alt: ex03_poisson.py +# +#.. |elastodynamics.py| replace:: elastodynamics.py +#.. _elastodynamics.py: https://github.com/marcomusy/vtkplotter/blob/master/vtkplotter/examples/other/dolfin/elastodynamics.py +#.. |elastodynamics| image:: https://user-images.githubusercontent.com/32848391/54932788-bd4a8680-4f1b-11e9-9326-33645171a45e.gif +# :width: 300 px +# :target: elastodynamics.py_ +# :alt: elastodynamics.py +# +#.. |ft02_poisson_membrane.py| replace:: ft02_poisson_membrane.py +#.. _ft02_poisson_membrane.py: https://github.com/marcomusy/vtkplotter/blob/master/vtkplotter/examples/other/dolfin/ft02_poisson_membrane.py +#.. |ft02_poisson_membrane| image:: https://user-images.githubusercontent.com/32848391/55499287-ed91d380-5645-11e9-8e9a-e31e2e3b1649.jpg +# :width: 300 px +# :target: ft02_poisson_membrane.py_ +# :alt: ft02_poisson_membrane.py +# +# +#.. |stokes.py| replace:: stokes.py +#.. _stokes.py: https://github.com/marcomusy/vtkplotter/blob/master/vtkplotter/examples/other/dolfin/stokes.py +#.. |stokes| image:: https://user-images.githubusercontent.com/32848391/55098209-aba0e480-50bd-11e9-8842-42d3f0b2d9c8.png +# :width: 300 px +# :target: stokes.py_ +# :alt: stokes.py +# +#.. |stokes1.py| replace:: stokes1.py +#.. _stokes1.py: https://github.com/marcomusy/vtkplotter/blob/master/vtkplotter/examples/other/dolfin/stokes.py +#.. |stokes1| image:: https://user-images.githubusercontent.com/32848391/56986911-6116fa00-6b8c-11e9-83f5-5b4efe430c0c.jpg +# :width: 300 px +# :target: stokes1.py_ +# :alt: stokes1.py +# +#.. |demo_submesh.py| replace:: demo_submesh.py +#.. _demo_submesh.py: https://github.com/marcomusy/vtkplotter/blob/master/vtkplotter/examples/other/dolfin/demo_submesh.py +#.. |demo_submesh| image:: https://user-images.githubusercontent.com/32848391/56675428-4e984e80-66bc-11e9-90b0-43dde7e4cc29.png +# :width: 300 px +# :target: demo_submesh.py_ +# :alt: demo_submesh.py +# +#.. |pi_estimate.py| replace:: pi_estimate.py +#.. _pi_estimate.py: https://github.com/marcomusy/vtkplotter/blob/master/vtkplotter/examples/other/dolfin/pi_estimate.py +#.. |pi_estimate| image:: https://user-images.githubusercontent.com/32848391/56675429-4e984e80-66bc-11e9-9217-a0652a8e74fe.png +# :width: 300 px +# :target: pi_estimate.py_ +# :alt: pi_estimate.py +# +#.. |isolines.py| replace:: isolines.py +#.. _isolines.py: https://github.com/marcomusy/vtkplotter/blob/master/vtkplotter/examples/basic/isolines.py +#.. |isolines| image:: https://user-images.githubusercontent.com/32848391/72433087-f00a8780-3798-11ea-9778-991f0abeca70.png +# :width: 300 px +# :target: isolines.py_ +# :alt: isolines.py +# +#.. |inset.py| replace:: inset.py +#.. _inset.py: https://github.com/marcomusy/vtkplotter/blob/master/vtkplotter/examples/other/inset.py +#.. |inset| image:: https://user-images.githubusercontent.com/32848391/56758560-3c3f1300-6797-11e9-9b33-49f5a4876039.jpg +# :width: 300 px +# :target: inset.py_ +# :alt: inset.py +# +#.. |legosurface.py| replace:: legosurface.py +#.. _legosurface.py: https://github.com/marcomusy/vtkplotter/blob/master/vtkplotter/examples/volumetric/legosurface.py +#.. |legosurface| image:: https://user-images.githubusercontent.com/32848391/56820682-da40e500-684c-11e9-8ea3-91cbcba24b3a.png +# :width: 300 px +# :target: legosurface.py_ +# :alt: legosurface.py +# +# +#.. |streamribbons.py| replace:: streamribbons.py +#.. _streamribbons.py: https://github.com/marcomusy/vtkplotter/blob/master/vtkplotter/examples/volumetric/streamribbons.py +#.. |streamribbons| image:: https://user-images.githubusercontent.com/32848391/56963999-9145a500-6b5a-11e9-9461-0037c471faab.png +# :width: 300 px +# :target: streamribbons.py_ +# :alt: streamribbons.py +# +# +#.. |streamlines1.py| replace:: streamlines1.py +#.. _streamlines1.py: https://github.com/marcomusy/vtkplotter/blob/master/vtkplotter/examples/volumetric/streamlines1.py +#.. |streamlines1| image:: https://user-images.githubusercontent.com/32848391/56964002-9145a500-6b5a-11e9-9e3f-da712609d896.png +# :width: 300 px +# :target: streamlines1.py_ +# :alt: streamlines1.py +# +#.. |streamlines2.py| replace:: streamlines2.py +#.. _streamlines2.py: https://github.com/marcomusy/vtkplotter/blob/master/vtkplotter/examples/volumetric/streamlines2.py +#.. |streamlines2| image:: https://user-images.githubusercontent.com/32848391/56964001-9145a500-6b5a-11e9-935b-1b2425bd7dd2.png +# :width: 300 px +# :target: streamlines2.py_ +# :alt: streamlines2.py +# +#.. |office.py| replace:: office.py +#.. _office.py: https://github.com/marcomusy/vtkplotter/blob/master/vtkplotter/examples/volumetric/office.py +#.. |office| image:: https://user-images.githubusercontent.com/32848391/56964003-9145a500-6b5a-11e9-9d9e-9736d90e1900.png +# :width: 300 px +# :target: office.py_ +# :alt: office.py +# +#.. |value-iteration.py| replace:: value-iteration.py +#.. _value-iteration.py: https://github.com/marcomusy/vtkplotter/blob/master/vtkplotter/examples/other/value-iteration.py +#.. |value-iteration| image:: https://user-images.githubusercontent.com/32848391/56964055-afaba080-6b5a-11e9-99cf-3fac99df9878.jpg +# :width: 300 px +# :target: value-iteration.py_ +# :alt: value-iteration.py +# +#.. |magnetostatics.py| replace:: magnetostatics.py +#.. _magnetostatics.py: https://github.com/marcomusy/vtkplotter/blob/master/vtkplotter/examples/other/dolfin/magnetostatics.py +#.. |magnetostatics| image:: https://user-images.githubusercontent.com/32848391/56985162-fb287380-6b87-11e9-9cf9-045bd08c3b9b.jpg +# :width: 300 px +# :target: magnetostatics.py_ +# :alt: magnetostatics.py +# +#.. |voronoi3d.py| replace:: voronoi3d.py +#.. _voronoi3d.py: https://github.com/marcomusy/vtkplotter/blob/master/vtkplotter/examples/other/voronoi3d.py +#.. |voronoi3d| image:: http://math.lbl.gov/voro++/obliquevoro.png +# :width: 300 px +# :target: voronoi3d.py_ +# :alt: voronoi3d.py +# +#.. |export_x3d.py| replace:: export_x3d.py +#.. _export_x3d.py: https://github.com/marcomusy/vtkplotter/blob/master/vtkplotter/examples/other/export_x3d.py +#.. |export_x3d| image:: https://user-images.githubusercontent.com/32848391/57160341-c6ffbd80-6de8-11e9-95ff-7215ce642bc5.jpg +# :width: 300 px +# :target: export_x3d.py_ +# :alt: export_x3d.py +# +# +#.. |silhouette.py| replace:: silhouette.py +#.. _silhouette.py: https://github.com/marcomusy/vtkplotter/blob/master/vtkplotter/examples/basic/silhouette.py +#.. |silhouette| image:: https://user-images.githubusercontent.com/32848391/57179369-8e5df380-6e7d-11e9-99b4-3b1a120dd375.png +# :width: 300 px +# :target: silhouette.py_ +# :alt: silhouette.py +# +#.. |shadow.py| replace:: shadow.py +#.. _shadow.py: https://github.com/marcomusy/vtkplotter/blob/master/vtkplotter/examples/basic/shadow.py +#.. |shadow| image:: https://user-images.githubusercontent.com/32848391/57312574-1d714280-70ee-11e9-8741-04fc5386d692.png +# :width: 300 px +# :target: shadow.py_ +# :alt: shadow.py +# +#.. |airplanes.py| replace:: airplanes.py +#.. _airplanes.py: https://github.com/marcomusy/vtkplotter/blob/master/vtkplotter/examples/simulations/.py +#.. |airplanes| image:: https://user-images.githubusercontent.com/32848391/57341963-b8910900-713c-11e9-898a-84b6d3712bce.gif +# :width: 300 px +# :target: airplanes.py_ +# :alt: airplanes.py +# +# +#.. |heatconv.py| replace:: heatconv.py +#.. _heatconv.py: https://github.com/marcomusy/vtkplotter/blob/master/vtkplotter/examples/other/dolfin/heatconv.py +#.. |heatconv| image:: https://user-images.githubusercontent.com/32848391/57455107-b200af80-726a-11e9-897d-9c7bcb9854ac.gif +# :width: 300 px +# :target: heatconv.py_ +# :alt: heatconv.py +# +#.. |scalemesh.py| replace:: scalemesh.py +#.. _scalemesh.py: https://github.com/marcomusy/vtkplotter/blob/master/vtkplotter/examples/other/dolfin/scalemesh.py +#.. |scalemesh| image:: https://user-images.githubusercontent.com/32848391/57393382-431c4b80-71c3-11e9-9a2c-8abb172f5468.png +# :width: 300 px +# :target: scalemesh.py_ +# :alt: scalemesh.py +# +#.. |elasticbeam.py| replace:: elasticbeam.py +#.. _elasticbeam.py: https://github.com/marcomusy/vtkplotter/blob/master/vtkplotter/examples/other/dolfin/elasticbeam.py +#.. |elasticbeam| image:: https://user-images.githubusercontent.com/32848391/57476429-d7a3ae00-7296-11e9-9f50-8f456823ef3d.png +# :width: 300 px +# :target: elasticbeam.py_ +# :alt: elasticbeam.py +# +#.. |specular.py| replace:: specular.py +#.. _specular.py: https://github.com/marcomusy/vtkplotter/blob/master/vtkplotter/examples/basic/specular.py +#.. |specular| image:: https://user-images.githubusercontent.com/32848391/57543051-8c030a00-7353-11e9-84cd-b01f3449d255.jpg +# :width: 300 px +# :target: specular.py_ +# :alt: specular.py +# +#.. |wavy_1d.py| replace:: wavy_1d.py +#.. _wavy_1d.py: https://github.com/marcomusy/vtkplotter/blob/master/vtkplotter/examples/other/dolfin/wavy_1d.py +#.. |wavy_1d| image:: https://user-images.githubusercontent.com/32848391/57570898-70593b80-7407-11e9-87cf-ce498f499c09.gif +# :width: 300 px +# :target: wavy_1d.py_ +# :alt: wavy_1d.py +# +#.. |fonts.py| replace:: fonts.py +#.. _fonts.py: https://github.com/marcomusy/vtkplotter/blob/master/vtkplotter/examples/pyplot/fonts.py +#.. |fonts| image:: https://user-images.githubusercontent.com/32848391/57587416-decff380-7504-11e9-8456-f969672c959e.png +# :width: 500 px +# :target: fonts.py_ +# :alt: fonts.py +# +#.. |idealpass.link| replace:: idealpass.link +#.. _idealpass.link: https://lorensen.github.io/VTKExamples/site/Cxx/ImageProcessing/IdealHighPass +#.. |idealpass| image:: https://raw.githubusercontent.com/lorensen/VTKExamples/master/src/Testing/Baseline/Cxx/ImageProcessing/TestIdealHighPass.png +# :width: 300 px +# :target: idealpass.link_ +# +#.. |buildmesh.py| replace:: buildmesh.py +#.. _buildmesh.py: https://github.com/marcomusy/vtkplotter/blob/master/vtkplotter/examples/basic/buildmesh.py +#.. |buildmesh| image:: https://user-images.githubusercontent.com/32848391/57858625-b0e2fb80-77f1-11e9-94f0-1973ed86ae70.png +# :width: 300 px +# :target: buildmesh.py_ +# :alt: buildmesh.py +# +#.. |customAxes.py| replace:: customAxes.py +#.. _customAxes.py: https://github.com/marcomusy/vtkplotter/blob/master/vtkplotter/examples/pyplot/customAxes.py +#.. |customAxes| image:: https://user-images.githubusercontent.com/32848391/58181826-c605d180-7cac-11e9-9786-11b5eb278f20.png +# :target: customAxes.py_ +# :alt: customAxes.py +# +#.. |awefem.py| replace:: awefem.py +#.. _awefem.py: https://github.com/marcomusy/vtkplotter/blob/master/vtkplotter/examples/other/dolfin/awefem.py +#.. |awefem| image:: https://user-images.githubusercontent.com/32848391/58368591-8b3fab80-7eef-11e9-882f-8b8eaef43567.gif +# :width: 300 px +# :target: awefem.py_ +# :alt: awefem.py +# +#.. |fenics_logo| image:: https://user-images.githubusercontent.com/32848391/58764910-3940fa80-856d-11e9-8160-af89a5ab5d02.gif +# +#.. |thinplate_morphing_2d.py| replace:: thinplate_morphing_2d.py +#.. _thinplate_morphing_2d.py: https://github.com/marcomusy/vtkplotter/blob/master/vtkplotter/examples/advanced/thinplate_morphing_2d.py +#.. |thinplate_morphing_2d| image:: https://user-images.githubusercontent.com/32848391/59032715-385ae200-8867-11e9-9b07-7f4f8fbfa5bd.png +# :width: 300 px +# :target: thinplate_morphing_2d.py_ +# :alt: thinplate_morphing_2d.py +# +#.. |interpolateVolume.py| replace:: interpolateVolume.py +#.. _interpolateVolume.py: https://github.com/marcomusy/vtkplotter/blob/master/vtkplotter/examples/volumetric/interpolateVolume.py +#.. |interpolateVolume| image:: https://user-images.githubusercontent.com/32848391/59095175-1ec5a300-8918-11e9-8bc0-fd35c8981e2b.jpg +# :width: 300 px +# :target: interpolateVolume.py_ +# :alt: interpolateVolume.py +# +#.. |deleteMeshPoints.py| replace:: deleteMeshPoints.py +#.. _deleteMeshPoints.py: https://github.com/marcomusy/vtkplotter/blob/master/vtkplotter/examples/basic/deleteMeshPoints.py +#.. |deleteMeshPoints| image:: https://user-images.githubusercontent.com/32848391/59768041-e9b83980-92a3-11e9-94f4-ca1f92540e9f.png +# :width: 300 px +# :target: deleteMeshPoints.py_ +# :alt: deleteMeshPoints.py +# +#.. |gray_scott.ipynb| replace:: gray_scott.ipynb +#.. _gray_scott.ipynb: https://github.com/marcomusy/vtkplotter/blob/master/vtkplotter/examples/simulations/gray_scott.ipynb +#.. |gray_scott| image:: https://user-images.githubusercontent.com/32848391/59788744-aaeaa980-92cc-11e9-825d-58da26ca21ff.gif +# :width: 300 px +# :target: gray_scott.ipynb_ +# :alt: gray_scott.ipynb +# +#.. |volterra.py| replace:: volterra.py +#.. _volterra.py: https://github.com/marcomusy/vtkplotter/blob/master/vtkplotter/examples/simulations/volterra.py +#.. |volterra| image:: https://user-images.githubusercontent.com/32848391/59788745-aaeaa980-92cc-11e9-93d5-f6a577ba5e4d.png +# :width: 300 px +# :target: volterra.py_ +# :alt: volterra.py +# +#.. |tensors.py| replace:: tensors.py +#.. _tensors.py: https://github.com/marcomusy/vtkplotter/blob/master/vtkplotter/examples/volumetric/tensors.py +#.. |tensors| image:: https://user-images.githubusercontent.com/32848391/59944747-e2d92480-9465-11e9-8012-1fc34a2e30c6.png +# :width: 300 px +# :target: tensors.py_ +# :alt: tensors.py +# +#.. |tensor_grid.py| replace:: tensor_grid.py +#.. _tensor_grid.py: https://github.com/marcomusy/vtkplotter/blob/master/vtkplotter/examples/volumetric/tensor_grid.py +# +#.. |scalarbars.py| replace:: scalarbars.py +#.. _scalarbars.py: https://github.com/marcomusy/vtkplotter/blob/master/vtkplotter/examples/basic/scalarbars.py +#.. |scalarbars| image:: https://user-images.githubusercontent.com/32848391/62940174-4bdc7900-bdd3-11e9-9713-e4f3e2fdab63.png +# :width: 300 px +# :target: scalarbars.py_ +# :alt: scalarbars.py +# +#.. |erode_dilate.py| replace:: erode_dilate.py +#.. _erode_dilate.py: https://github.com/marcomusy/vtkplotter/blob/master/vtkplotter/examples/volumetric/erode_dilate.py +# +#.. |vol2points.py| replace:: vol2points.py +#.. _vol2points.py: https://github.com/marcomusy/vtkplotter/blob/master/vtkplotter/examples/volumetric/vol2points.py +# +#.. |euclDist.py| replace:: euclDist.py +#.. _euclDist.py: https://github.com/marcomusy/vtkplotter/blob/master/vtkplotter/examples/volumetric/euclDist.py +# +#.. |pointDensity.py| replace:: pointDensity.py +#.. _pointDensity.py: https://github.com/marcomusy/vtkplotter/blob/master/vtkplotter/examples/volumetric/pointDensity.py +# +#.. |volumeFromMesh.py| replace:: volumeFromMesh.py +#.. _volumeFromMesh.py: https://github.com/marcomusy/vtkplotter/blob/master/vtkplotter/examples/volumetric/volumeFromMesh.py +# +#.. |numpy2volume.py| replace:: numpy2volume.py +#.. _numpy2volume.py: https://github.com/marcomusy/vtkplotter/blob/master/vtkplotter/examples/volumetric/numpy2volume.py +# +#.. |G_Of_Omega| image:: https://wikimedia.org/api/rest_v1/media/math/render/svg/9c4d02a66b6ff279aae0c4bf07c25e5727d192e4 +# +#.. |wikiphong| image:: https://upload.wikimedia.org/wikipedia/commons/6/6b/Phong_components_version_4.png +# +#.. |animation1.py| replace:: animation1.py +#.. _animation1.py: https://github.com/marcomusy/vtkplotter/blob/master/vtkplotter/examples/other/animation1.py +#.. |animation1| image:: https://user-images.githubusercontent.com/32848391/64273764-4b528080-cf42-11e9-90aa-2d88df239871.gif +# :width: 300 px +# :target: animation1.py_ +# :alt: animation1.py +# +#.. |animation2.py| replace:: animation2.py +#.. _animation2.py: https://github.com/marcomusy/vtkplotter/blob/master/vtkplotter/examples/other/animation2.py +#.. |animation2| image:: https://user-images.githubusercontent.com/32848391/64273191-1a258080-cf41-11e9-8a18-f192f05f11a9.gif +# :width: 300 px +# :target: animation2.py_ +# :alt: animation2.py +# +#.. |polarHisto.py| replace:: polarHisto.py +#.. _polarHisto.py: https://github.com/marcomusy/vtkplotter/blob/master/vtkplotter/examples/pyplot/polarHisto.py +#.. |polarHisto| image:: https://user-images.githubusercontent.com/32848391/64912717-5754f400-d733-11e9-8a1f-612165955f23.png +# :width: 300 px +# :target: polarHisto.py_ +# :alt: polarHisto.py +# +#.. |histo_polar.py| replace:: histo_polar.py +#.. _histo_polar.py: https://github.com/marcomusy/vtkplotter/blob/master/vtkplotter/examples/pyplot/histo_polar.py +#.. |histo_polar| image:: https://user-images.githubusercontent.com/32848391/64992590-7fc82400-d8d4-11e9-9c10-795f4756a73f.png +# :width: 300 px +# :target: histo_polar.py_ +# :alt: histo_polar.py +# +#.. |donut.py| replace:: donut.py +#.. _donut.py: https://github.com/marcomusy/vtkplotter/blob/master/vtkplotter/examples/pyplot/donut.py +#.. |donut| image:: https://user-images.githubusercontent.com/32848391/64998178-6f6b7580-d8e3-11e9-9bd8-8dfb9ccd90e4.png +# :width: 300 px +# :target: donut.py_ +# :alt: donut.py +# +#.. |extrude.py| replace:: extrude.py +#.. _extrude.py: https://github.com/marcomusy/vtkplotter/blob/master/vtkplotter/examples/basic/extrude.py +#.. |extrude| image:: https://user-images.githubusercontent.com/32848391/65963682-971e1a00-e45b-11e9-9f29-05522ae4a800.png +# :width: 300 px +# :target: extrude.py_ +# :alt: extrude.py +# +#.. |kspline.py| replace:: kspline.py +#.. _kspline.py: https://github.com/marcomusy/vtkplotter/blob/master/vtkplotter/examples/basic/kspline.py +#.. |kspline| image:: https://user-images.githubusercontent.com/32848391/65975805-73fd6580-e46f-11e9-8957-75eddb28fa72.png +# :width: 300 px +# :target: kspline.py_ +# :alt: kspline.py +# +#.. |mesh_lut.py| replace:: mesh_lut.py +#.. _mesh_lut.py: https://github.com/marcomusy/vtkplotter/blob/master/vtkplotter/examples/basic/mesh_lut.py +# +#.. |elevation| image:: https://user-images.githubusercontent.com/32848391/68478872-3986a580-0231-11ea-8245-b68a683aa295.png +# :width: 300 px +# +#.. |paramshapes| image:: https://user-images.githubusercontent.com/32848391/69181075-bb6aae80-0b0e-11ea-92f7-d0cd3b9087bf.png +# :width: 300 px +# +#.. |warpto| image:: https://user-images.githubusercontent.com/32848391/69259878-3c817e80-0bbf-11ea-9025-03b9f6affccc.png +# :width: 300 px +# +#.. |linInterpolate.py| replace:: linInterpolate.py +#.. _linInterpolate.py: https://github.com/marcomusy/vtkplotter/blob/master/vtkplotter/examples/basic/linInterpolate.py +#.. |linInterpolate| image:: https://user-images.githubusercontent.com/32848391/70559826-a621f680-1b87-11ea-89f3-e6b74d8953d9.png +# :width: 300 px +# :target: linInterpolate.py_ +# :alt: linInterpolate.py +# +#.. |plot1_errbars.py| replace:: plot1_errbars.py +#.. _plot1_errbars.py: https://github.com/marcomusy/vtkplotter/blob/master/vtkplotter/examples/pyplot/plot1_errbars.py +#.. |plot1_errbars| image:: https://user-images.githubusercontent.com/32848391/69158509-d6c1c380-0ae6-11ea-9dbf-ff5cd396a9a6.png +# :width: 300 px +# :target: plot1_errbars.py_ +# :alt: plot1_errbars.py +# +#.. |quiver.py| replace:: quiver.py +#.. _quiver.py: https://github.com/marcomusy/vtkplotter/blob/master/vtkplotter/examples/pyplot/quiver.py +#.. |quiver| image:: https://user-images.githubusercontent.com/32848391/72261438-199aa600-3615-11ea-870e-e44ca4c4b8d3.png +# :width: 300 px +# :target: quiver.py_ +# :alt: quiver.py +# +#.. |plot5_spheric.py| replace:: plot5_spheric.py +#.. _plot5_spheric.py: https://github.com/marcomusy/vtkplotter/blob/master/vtkplotter/examples/pyplot/plot5_spheric.py +#.. |plot5_spheric| image:: https://user-images.githubusercontent.com/32848391/72433091-f0a31e00-3798-11ea-86bd-6c522e23ec61.png +# :width: 300 px +# :target: plot5_spheric.py_ +# :alt: plot5_spheric.py +# +#.. |fcomplex| image:: https://user-images.githubusercontent.com/32848391/73392962-1709a300-42db-11ea-9278-30c9d6e5eeaa.png +# :width: 300 px +# +#.. |histo_spheric.py| replace:: histo_spheric.py +#.. _histo_spheric.py: https://github.com/marcomusy/vtkplotter/blob/master/vtkplotter/examples/pyplot/histo_spheric.py +#.. |histo_spheric| image:: https://user-images.githubusercontent.com/32848391/73392901-fccfc500-42da-11ea-828a-9bad6982a823.png +# :width: 300 px +# :target: histo_spheric.py_ +# :alt: histo_spheric.py +# +#.. |sphericgrid| image:: https://user-images.githubusercontent.com/32848391/72433092-f0a31e00-3798-11ea-85f7-b2f5fcc31568.png +# :width: 300 px +# +#.. |histo_2D.py| replace:: histo_2D.py +#.. _histo_2D.py: https://github.com/marcomusy/vtkplotter/blob/master/vtkplotter/examples/pyplot/histo_2D.py +#.. |histo_2D| image:: https://user-images.githubusercontent.com/32848391/74361190-c019c880-4dc6-11ea-9c72-0f2a890e6664.png +# :width: 300 px +# :target: histo_2D.py_ +# :alt: histo_2D.py +# +#.. |plot2_errband.py| replace:: plot2_errband.py +#.. _plot2_errband.py: https://github.com/marcomusy/vtkplotter/blob/master/vtkplotter/examples/pyplot/plot2_errband.py +#.. |plot2_errband| image:: https://user-images.githubusercontent.com/32848391/73483464-c019d180-439f-11ea-9a8c-59fa49e9ecf4.png +# :width: 300 px +# :target: plot2_errband.py_ +# :alt: plot2_errband.py +# +#.. |plot3_pip.py| replace:: plot3_pip.py +#.. _plot3_pip.py: https://github.com/marcomusy/vtkplotter/blob/master/vtkplotter/examples/pyplot/plot3_pip.py +#.. |plot3_pip| image:: https://user-images.githubusercontent.com/32848391/73393632-4ff64780-42dc-11ea-8798-45a81c067f45.png +# :width: 300 px +# :target: plot3_pip.py_ +# :alt: plot3_pip.py +# +#.. |scatter1.py| replace:: scatter1.py +#.. _scatter1.py: https://github.com/marcomusy/vtkplotter/blob/master/vtkplotter/examples/pyplot/scatter1.py +#.. |scatter1| image:: https://user-images.githubusercontent.com/32848391/72615028-013bcb80-3934-11ea-8ab8-823f1916bc6c.png +# :width: 300 px +# :target: scatter1.py_ +# :alt: scatter1.py +# +#.. |scatter2.py| replace:: scatter2.py +#.. _scatter2.py: https://github.com/marcomusy/vtkplotter/blob/master/vtkplotter/examples/pyplot/scatter2.py +#.. |scatter2| image:: https://user-images.githubusercontent.com/32848391/72446102-2d7c0e80-37b3-11ea-8fe4-b27526af574f.png +# :width: 300 px +# :target: scatter2.py_ +# :alt: scatter2.py +# +#.. |customIndividualAxes.py| replace:: customIndividualAxes.py +#.. _customIndividualAxes.py: https://github.com/marcomusy/vtkplotter/blob/master/vtkplotter/examples/pyplot/customIndividualAxes.py +#.. |customIndividualAxes| image:: https://user-images.githubusercontent.com/32848391/72752870-ab7d5280-3bc3-11ea-8911-9ace00211e23.png +# :target: customIndividualAxes.py_ +# :alt: customIndividualAxes.py +# +#.. |plot7_stream.py| replace:: plot7_stream.py +#.. _plot7_stream.py: https://github.com/marcomusy/vtkplotter/blob/master/vtkplotter/examples/pyplot/plot7_stream.py +#.. |plot7_stream| image:: https://user-images.githubusercontent.com/32848391/73614123-93162a80-45fc-11ea-969b-9a3293b26f35.png +# :target: plot7_stream.py_ +# :alt: plot7_stream.py +# +#.. |simpleplot| image:: https://user-images.githubusercontent.com/32848391/74363882-c3638300-4dcb-11ea-8a78-eb492ad9711f.png +# :width: 300 px +# +# +#.. |warpv| image:: https://user-images.githubusercontent.com/32848391/77864546-7a577900-7229-11ea-84ce-4e8e6eeff27f.png +# :width: 300 px +# +#""" diff --git a/vtkplotter/examples/advanced/README.md b/vtkplotter/examples/advanced/README.md index 3202ed70..ec524b73 100644 --- a/vtkplotter/examples/advanced/README.md +++ b/vtkplotter/examples/advanced/README.md @@ -15,6 +15,8 @@ python example.py | | | | [![fatlimb](https://user-images.githubusercontent.com/32848391/50738945-7335ec80-11d9-11e9-9d3f-c6c19df8f10d.jpg)](https://github.com/marcomusy/vtkplotter/blob/master/vtkplotter/examples/advanced/fatlimb.py)
`fatlimb.py` | Modify a mesh by moving the points along the normals to the surface and along the radius of a sphere centered at the center of mass of the mesh. At each step we redefine the actor so that the normals are recalculated for the underlying polydata.| | | | +| [![fitline](https://user-images.githubusercontent.com/32848391/50738864-c0658e80-11d8-11e9-8754-c670f1f331d6.jpg)](https://github.com/marcomusy/vtkplotter/blob/master/vtkplotter/examples/advanced/fitline.py)
`fitline.py` | Draw a line in 3D that fits a cloud of points.
The example also fits a plane to the same points.| +| | | | [![fitspheres1](https://user-images.githubusercontent.com/32848391/50738943-687b5780-11d9-11e9-87a6-054e0fe76241.jpg)](https://github.com/marcomusy/vtkplotter/blob/master/vtkplotter/examples/advanced/fitspheres1.py)
`fitspheres1.py` | Fit spheres to a region of a surface defined by N points that are closest to a given point of the surface. For some of these points we show the fitting sphere.
Red lines join the center of the sphere to the surface point.
Black points are the N points used for fitting. | | | | | [![geodesic](https://user-images.githubusercontent.com/32848391/51855637-015f4780-232e-11e9-92ca-053a558e7f70.png)](https://github.com/marcomusy/vtkplotter/blob/master/vtkplotter/examples/advanced/geodesic.py)
`geodesic.py` | Dijkstra algorithm to compute the mesh geodesic shortest path. | diff --git a/vtkplotter/examples/advanced/centerline1.py b/vtkplotter/examples/advanced/centerline1.py index 43c1139c..02dbda68 100644 --- a/vtkplotter/examples/advanced/centerline1.py +++ b/vtkplotter/examples/advanced/centerline1.py @@ -5,8 +5,7 @@ # parameters to play with: f = 0.3 # moving least squares fraction of neighbours niter = 6 # moving least squares iterations -tol = 0.02 # minimum point distance as fraction -smooth = 0.1 # spline smoothness paramenter +tol = 0.03 # minimum point distance as fraction # built some weird tube for test ln = [[sin(x), cos(x), x / 2] for x in arange(0,9,0.1)] @@ -15,13 +14,10 @@ t = tube for i in range(niter): - t = smoothMLS1D(t, f=f).c('white').pointSize(5) + t = t.clone().smoothMLS1D(f=f).c('white').pointSize(5) show(t, at=i, N=niter, bg='bb') # reduce nr of points by imposing a min distance t.clean(tol) -# spline the resulting set of points -spl = Spline(t, smooth=smooth) - -show(tube, t, spl, Text2D(__doc__), axes=1, bg='bb', newPlotter=True) +show(tube, t, Text2D(__doc__), axes=1, bg='bb', newPlotter=True) diff --git a/vtkplotter/examples/advanced/centerline2.py b/vtkplotter/examples/advanced/centerline2.py index 2a798a58..2c8a48ad 100644 --- a/vtkplotter/examples/advanced/centerline2.py +++ b/vtkplotter/examples/advanced/centerline2.py @@ -21,7 +21,7 @@ t = tube.clone().clean(tol/2) for i in range(niter): - t = smoothMLS1D(t, f=f).c('white').pointSize(10) + t = t.clone().smoothMLS1D(f=f).c('white').pointSize(10) show(t, at=i, N=niter, elevation=-1, bg='bb') t.clean(tol) diff --git a/vtkplotter/examples/basic/fitline.py b/vtkplotter/examples/advanced/fitline.py similarity index 57% rename from vtkplotter/examples/basic/fitline.py rename to vtkplotter/examples/advanced/fitline.py index 78db1a3e..f51836ae 100644 --- a/vtkplotter/examples/basic/fitline.py +++ b/vtkplotter/examples/advanced/fitline.py @@ -1,37 +1,32 @@ -""" -Usage example of fitLine() and fitPlane() +"""Usage example of fitLine() and fitPlane() Draw a line in 3D that fits a cloud of 20 Points, Show the first set of 20 points and fit a plane to them. """ -from __future__ import division, print_function import numpy as np from vtkplotter import * # declare the class instance -vp = Plotter(verbose=0, title="linear fitting") +vp = Plotter() # draw 500 fit lines superimposed and very transparent for i in range(500): - x = np.linspace(-2, 5, 20) # generate each time 20 points + x = np.linspace(-2, 5, 20) # generate every time 20 points y = np.linspace(1, 9, 20) z = np.linspace(-5, 3, 20) data = np.stack((x,y,z), axis=1) - data += np.random.normal(size=data.shape) * 0.8 # add gauss noise - vp += fitLine(data).lw(4).alpha(0.03) # fit a line + vp += fitLine(data).lw(4).alpha(0.04) # fit a line # 'data' still contains the last iteration points vp += Points(data, r=10, c="yellow") -# the first fitted slope direction is stored -# in mesh.info['slope] and mesh.info['normal] -print("Line Fit slope = ", vp.actors[0].info["slope"]) +print("Line 0 Fit slope = ", vp.actors[0].slope) plane = fitPlane(data) # fit a plane -print("Plan Fit normal=", plane.info["normal"]) +print("Plane Fit normal =", plane.normal) vp += [plane, Text2D(__doc__)] diff --git a/vtkplotter/examples/advanced/fitplanes.py b/vtkplotter/examples/advanced/fitplanes.py index 2a8696b9..44effa81 100644 --- a/vtkplotter/examples/advanced/fitplanes.py +++ b/vtkplotter/examples/advanced/fitplanes.py @@ -7,9 +7,10 @@ from vtkplotter import * vp = Plotter() -vp += Text2D(__doc__, pos=1) +vp += Text2D(__doc__) -s = vp.load(datadir+"cow.vtk").alpha(0.3).subdivide().normalize() +s = load(datadir+"cow.vtk").subdivide().normalize().alpha(0.3) +vp += s variances = [] for i, p in enumerate(s.points()): @@ -19,9 +20,8 @@ plane = fitPlane(pts) # find the fitting plane vp += plane vp += Points(pts) # blue points - cn, v = plane.info["center"], plane.info["normal"] - vp += Arrow(cn, cn + v / 15.0, c="g") - variances.append(plane.info["variance"]) + vp += Arrow(plane.center, plane.center+plane.normal/10, c="g") + variances.append(plane.variance) vp += histogram(variances).scale(25).pos(.6,-.3,-.9) diff --git a/vtkplotter/examples/advanced/fitspheres1.py b/vtkplotter/examples/advanced/fitspheres1.py index d1ea0b45..8bf911ac 100644 --- a/vtkplotter/examples/advanced/fitspheres1.py +++ b/vtkplotter/examples/advanced/fitspheres1.py @@ -3,7 +3,6 @@ For some of these point we show the fitting sphere. Red lines join the center of the sphere to the surface point. Blue points are the N points used for fitting. -Fitted radius can be accessed from mesh.info['radius']. """ from __future__ import division, print_function from vtkplotter import * @@ -22,7 +21,7 @@ continue # may fail if all points sit on a plane vp += sph vp += Points(pts) - vp += Line(sph.info["center"], p, lw=2) + vp += Line(sph.center, p, lw=2) vp += Text2D(__doc__) vp.show(viewup="z") diff --git a/vtkplotter/examples/advanced/fitspheres2.py b/vtkplotter/examples/advanced/fitspheres2.py index b8d67685..b2fe5a9a 100644 --- a/vtkplotter/examples/advanced/fitspheres2.py +++ b/vtkplotter/examples/advanced/fitspheres2.py @@ -5,31 +5,30 @@ from __future__ import division, print_function from vtkplotter import * -vp = Plotter(verbose=0, axes=0) +vp = Plotter() -s = vp.load(datadir+"cow.vtk", alpha=0.3) # .subdivide() +s = vp.load(datadir+"cow.vtk", alpha=0.3) pts1, pts2, vals, cols = [], [], [], [] -for i, p in enumerate(s.points()): +for i in range(0, s.N(), 10): + p = s.points(i) pts = s.closestPoint(p, N=12) # find the N closest points to p - sph = fitSphere(pts) # find the fitting sphere + sph = fitSphere(pts) # find the fitting sphere if sph is None: continue - value = sph.info["radius"] * 10 + value = sph.radius * 10 color = colorMap(value, "jet", 0, 1) # map value to a RGB color - n = versor(p - sph.info["center"]) # unit vector from sphere center to p + n = versor(p - sph.center) # unit vector from sphere center to p vals.append(value) cols.append(color) pts1.append(p) pts2.append(p + n / 8) - if not i % 500: - print(i, "/", s.N()) vp += Points(pts1, c=cols) -vp += Lines(pts1, pts2, c="black 0.2") -vp += histogram(vals, bins=20, vrange=[0, 1]).pos(-1,1,-1) +vp += Lines(pts1, pts2, c="black") +vp += histogram(vals, bins=20, xlim=[0,1]).scale(2).pos(-1,0.5,-1) vp += Text2D(__doc__, pos=1) -vp.show(axes=1) +vp.show() diff --git a/vtkplotter/examples/advanced/moving_least_squares1D.py b/vtkplotter/examples/advanced/moving_least_squares1D.py index e8dbb86a..21d767fa 100644 --- a/vtkplotter/examples/advanced/moving_least_squares1D.py +++ b/vtkplotter/examples/advanced/moving_least_squares1D.py @@ -25,7 +25,7 @@ show(a, at=0, N=N, axes=5) for i in range(1, N): - a = smoothMLS1D(a.clone(), f=0.2).color(i).legend("iter #" + str(i)) + a = a.clone().smoothMLS1D(f=0.2).color(i).legend("iter #" + str(i)) # at last iteration make sure points are separated by tol (in % of bbox) if i == N-1: diff --git a/vtkplotter/examples/advanced/moving_least_squares2D.py b/vtkplotter/examples/advanced/moving_least_squares2D.py index b3239c29..1f88d459 100644 --- a/vtkplotter/examples/advanced/moving_least_squares2D.py +++ b/vtkplotter/examples/advanced/moving_least_squares2D.py @@ -20,13 +20,12 @@ vp1.show(s0, at=0) # project s1 points into a smooth surface of points -# return a demo object showing 30 regressions at random points # The parameter f controls the size of the local regression. -mls1 = smoothMLS2D( s0, f=0.5, showNPlanes=30) #first pass +mls1 = s0.clone().smoothMLS2D(f=0.5).legend("first pass") vp1.show(mls1, at=1) # mls1 is an Assembly so unpack it to get the first object it contains -mls2 = smoothMLS2D(mls1.unpack(0), radius=0.1).legend("second pass") +mls2 = mls1.clone().smoothMLS2D(radius=0.1).legend("second pass") vp1.show(mls2, at=2) diff --git a/vtkplotter/examples/advanced/recosurface.py b/vtkplotter/examples/advanced/recosurface.py index 6c476c1f..91a94e68 100644 --- a/vtkplotter/examples/advanced/recosurface.py +++ b/vtkplotter/examples/advanced/recosurface.py @@ -28,16 +28,16 @@ pts0 = Points(mesh.points() + noise, r=3).legend("noisy cloud") vp.show(pts0, at=1) -pts1 = smoothMLS2D(pts0, f=0.8) # smooth cloud, input mesh is modified +pts1 = pts0.clone().smoothMLS2D(f=0.8) # smooth cloud -print("Nr of points before cleaning polydata:", pts1.N()) +print("Nr of points before cleaning nr. points:", pts1.N()) # impose a min distance among mesh points pts1.clean(tol=0.005).legend("smooth cloud") -print(" after cleaning polydata:", pts1.N()) +print(" after cleaning nr. points:", pts1.N()) vp.show(pts1, at=2) # reconstructed surface from point cloud -reco = recoSurface(pts1, bins=100, radius=0.2).legend("surf reco") +reco = recoSurface(pts1, dims=100, radius=0.2).legend("surf. reco") vp.show(reco, at=3, axes=7, zoom=1.2, interactive=1) diff --git a/vtkplotter/examples/advanced/skeletonize.py b/vtkplotter/examples/advanced/skeletonize.py index 90b02ef7..08dd6304 100644 --- a/vtkplotter/examples/advanced/skeletonize.py +++ b/vtkplotter/examples/advanced/skeletonize.py @@ -5,9 +5,9 @@ from vtkplotter import * N = 9 # nr of iterations -f = 0.1 # fraction of neighbours +f = 0.2 # fraction of neighbours -pts = load(datadir+"man.vtk").triangulate().decimate(0.1).points() +pts = load(datadir+"man.vtk").clean(tol=0.02).points() # pts = load(datadir+'spider.ply').points() # pts = load(datadir+'magnolia.vtk').subdivide().points() # pts = load(datadir+'apple.ply').points() @@ -16,8 +16,7 @@ pc = Points(pts) for i in range(N): - pc = pc.clone() - pc = smoothMLS1D(pc, f).color(i) + pc = pc.clone().smoothMLS1D(f=f).color(i) show(pc, at=i, N=N, elevation=-5) interactive() diff --git a/vtkplotter/examples/advanced/thinplate_morphing2.py b/vtkplotter/examples/advanced/thinplate_morphing2.py index f7ca957e..d0e1bce0 100644 --- a/vtkplotter/examples/advanced/thinplate_morphing2.py +++ b/vtkplotter/examples/advanced/thinplate_morphing2.py @@ -1,5 +1,4 @@ -""" -Warp the tip of a mesh using Thin Plate Splines. +"""Warp the tip of a mesh using Thin Plate Splines. Red points stay fixed while a single point in space moves as the arrow shows. """ @@ -9,21 +8,20 @@ mesh = load(datadir+"man.vtk").color('w').lineWidth(0.1) # a heavily decimated copy -meshdec = mesh.clone().triangulate().decimate(N=100) +meshdec = mesh.clone().triangulate().decimate(N=200) sources = [[0.9, 0.0, 0.2]] # this point moves targets = [[1.2, 0.0, 0.4]] # to this. +arrow = Arrow(sources[0], targets[0]) + for pt in meshdec.points(): if pt[0] < 0.3: # these pts don't move sources.append(pt) # source = target targets.append(pt) # -# calculate the warping T on the reduced mesh -T = meshdec.thinPlateSpline(sources, targets).getTransform() -warp = mesh.clone().applyTransform(T).c("blue").alpha(0.4).lineWidth(0) +warp = mesh.clone().thinPlateSpline(sources, targets) +warp.c("blue").alpha(0.4).lineWidth(0) apts = Points(sources).c("red") -arro = Arrow(sources[0], targets[0]) - -show(mesh, arro, warp, apts, Text2D(__doc__), viewup="z", axes=1) +show(mesh, arrow, warp, apts, Text2D(__doc__), viewup="z", axes=1) diff --git a/vtkplotter/examples/basic/README.md b/vtkplotter/examples/basic/README.md index 1707d13a..1c1d1f55 100644 --- a/vtkplotter/examples/basic/README.md +++ b/vtkplotter/examples/basic/README.md @@ -35,8 +35,6 @@ python example.py | | | | [![delaunay2d](https://user-images.githubusercontent.com/32848391/50738865-c0658e80-11d8-11e9-8616-b77363aa4695.jpg)](https://github.com/marcomusy/vtkplotter/blob/master/vtkplotter/examples/basic/delaunay2d.py)
`delaunay2d.py` | Build a mesh starting from points in space using _Delaunay_ triangulation (points must be projectable on the _xy_ plane). | | | | -| [![fitline](https://user-images.githubusercontent.com/32848391/50738864-c0658e80-11d8-11e9-8754-c670f1f331d6.jpg)](https://github.com/marcomusy/vtkplotter/blob/master/vtkplotter/examples/basic/fitline.py)
`fitline.py` | Draw a line in 3D that fits a cloud of points.
The example also fits a plane to the same points.| -| | | | [![keypress](https://user-images.githubusercontent.com/32848391/50738860-bfccf800-11d8-11e9-96ca-dab2bb7adae3.jpg)](https://github.com/marcomusy/vtkplotter/blob/master/vtkplotter/examples/basic/keypress.py)
`keypress.py` | How to implement a custom function that is triggered by pressing a keyboard button when the rendering window is in interactive mode.
In the example, every time a key is pressed the picked point of the mesh is used to add a sphere and some info is printed. | | | | | [![largestregion](https://user-images.githubusercontent.com/32848391/50738859-bfccf800-11d8-11e9-8c59-17c0ca4d8e06.jpg)](https://github.com/marcomusy/vtkplotter/blob/master/vtkplotter/examples/basic/largestregion.py)
`largestregion.py` | Extract the mesh region that has the largest connected surface with method `analysis.extractLargestRegion()`. | diff --git a/vtkplotter/examples/basic/align1.py b/vtkplotter/examples/basic/align1.py index 17a3bd35..6e078e78 100644 --- a/vtkplotter/examples/basic/align1.py +++ b/vtkplotter/examples/basic/align1.py @@ -1,5 +1,4 @@ -""" -Align 2 shapes: +"""Align 2 shapes: the red line to the yellow surface """ from vtkplotter import * @@ -19,4 +18,4 @@ printc("ave. squared distance =", d / arim.N(), c="g") printc("vtkTransform is available with getTransform():") printc([arim.getTransform()]) -show(limb, rim, arim, Text2D(__doc__)) +show(limb, rim, arim, Text2D(__doc__), axes=1) diff --git a/vtkplotter/examples/basic/boolean.py b/vtkplotter/examples/basic/boolean.py index 64398db4..7d85463a 100644 --- a/vtkplotter/examples/basic/boolean.py +++ b/vtkplotter/examples/basic/boolean.py @@ -15,12 +15,12 @@ # make 3 different possible operations: b1 = booleanOperation(s1, "intersect", s2).c('m').legend("intersect") -vp.show(b1, at=1) +vp.show(b1, at=1, resetcam=False) b2 = booleanOperation(s1, "plus", s2).c("b").wireframe(True).legend("plus") -vp.show(b2, at=2) +vp.show(b2, at=2, resetcam=False) b3 = booleanOperation(s1, "minus", s2).legend("minus").addScalarBar(c='w') -vp.show(b3, at=3) +vp.show(b3, at=3, resetcam=False) interactive() \ No newline at end of file diff --git a/vtkplotter/examples/basic/closewindow.py b/vtkplotter/examples/basic/closewindow.py index d578a335..5e03371d 100644 --- a/vtkplotter/examples/basic/closewindow.py +++ b/vtkplotter/examples/basic/closewindow.py @@ -3,7 +3,7 @@ Press q: Control returns to terminal, window will not close but become unresponsive""" -from vtkplotter import Text, Paraboloid, Hyperboloid, Plotter, show +from vtkplotter import Text2D, Paraboloid, Hyperboloid, Plotter, show mesh = Paraboloid() diff --git a/vtkplotter/examples/basic/colorcubes.py b/vtkplotter/examples/basic/colorcubes.py index 515817f5..1173c04c 100644 --- a/vtkplotter/examples/basic/colorcubes.py +++ b/vtkplotter/examples/basic/colorcubes.py @@ -2,8 +2,9 @@ Show a cube for each available color name """ print(__doc__) -from vtkplotter import Plotter, Cube, Text2D +from vtkplotter import Cube, Text2D, show from vtkplotter.colors import colors, getColor + from operator import itemgetter # sorting by hex color code: @@ -11,18 +12,14 @@ # or by name: # sorted_colors = sorted(colors.items(), key=itemgetter(0)) - -vp = Plotter(N=len(sorted_colors), axes=0, size="fullscreen") - +cbs=[] for i, sc in enumerate(sorted_colors): cname = sc[0] rgb = getColor(cname) cb = Cube(c=rgb) tname = Text2D(cname, pos=3) - vp.show(cb, tname, at=i) - -vp.camera.Azimuth(20) -vp.camera.Elevation(20) + cbs.append([tname, cb]) print("click on any cube and press i") -vp.show(interactive=1) +show(cbs, N=len(sorted_colors), azimuth=.2, size='fullscreen') + diff --git a/vtkplotter/examples/basic/lights.py b/vtkplotter/examples/basic/lights.py index ac942c0f..cf562d49 100644 --- a/vtkplotter/examples/basic/lights.py +++ b/vtkplotter/examples/basic/lights.py @@ -2,7 +2,7 @@ vp = Plotter() -cow = vp.load(datadir+"cow.byu", c="grey", alpha=0.7) +cow = vp.load(datadir+"cow.vtk", c="grey").scale(4).rotateX(-90) vp += Plane(pos=[0, -3.6, 0], normal=[0, 1, 0], sx=20).texture("grass") vp.show(viewup='y', interactive=0) diff --git a/vtkplotter/examples/basic/pca.py b/vtkplotter/examples/basic/pca.py index 515528b4..ca7d725d 100644 --- a/vtkplotter/examples/basic/pca.py +++ b/vtkplotter/examples/basic/pca.py @@ -1,30 +1,24 @@ -"""Draw the PCA (Principal Component Analysis) ellipsoid that contains -50% of a cloud of Points, then check if points are inside the surface. -Extra info cab be retrieved with: -mesh.asphericity() -mesh.asphericity_error() +"""Draw the PCA (Principal Component Analysis) +ellipsoid that contains 50% of a cloud of Points, +then check if points are inside the surface. """ -from vtkplotter import Plotter, pcaEllipsoid, Points, Text2D +from vtkplotter import * import numpy as np - -vp = Plotter(axes=1) - -pts = np.random.randn(500, 3)*[3,2,1] # random gaussian point cloud +pts = np.random.randn(10000, 3)/1.5*[3,2,1] # random gaussian point cloud elli = pcaEllipsoid(pts, pvalue=0.5) -ipts = elli.insidePoints(pts) # elli is a vtkAssembly -opts = elli.insidePoints(pts, invert=True) +inpcl = elli.insidePoints(pts).c('green').alpha(0.2) +outpcl = elli.insidePoints(pts, invert=True).c('red').alpha(0.2) -vp += Points(ipts, c="g") -vp += Points(opts, c="r") -vp += [elli, Text2D(__doc__)] - -print("inside points #", len(ipts)) -print("outside points #", len(opts)) -print("asphericity:", elli.asphericity(), '+-', elli.asphericity_error()) +# Extra info can be retrieved with: print("axis 1 size:", elli.va) print("axis 2 size:", elli.vb) print("axis 3 size:", elli.vc) -vp.show() + +print("inside points #", inpcl.NPoints() ) +print("outside points #", outpcl.NPoints() ) +print("asphericity:", elli.asphericity(), '+-', elli.asphericity_error()) + +show(elli, inpcl, outpcl, Text2D(__doc__), axes=1) diff --git a/vtkplotter/examples/basic/run_all.sh b/vtkplotter/examples/basic/run_all.sh index b683cefb..f0524954 100755 --- a/vtkplotter/examples/basic/run_all.sh +++ b/vtkplotter/examples/basic/run_all.sh @@ -6,192 +6,8 @@ echo Press Esc at anytime to skip example echo ############################################# echo -echo Running noname.py -python noname.py - -echo Running buildmesh.py -python buildmesh.py - -echo Running align1.py -python align1.py - -echo Running align2.py -python align2.py - -echo Running align3.py -python align3.py - -echo Running bgImage.py -python bgImage.py - -echo Running boundary.py -python boundary.py - -echo Running boolean.py -python boolean.py - -echo Running colormaps.py -python colormaps.py - -echo Running colorMeshCells.py -python colorMeshCells.py - -echo Running delaunay2d.py -python delaunay2d.py - -echo Running distance2mesh.py -python distance2mesh.py - -echo Running clustering.py -python clustering.py - -echo Running connVtx.py -python connVtx.py - -echo Running deleteMeshPoints.py -python deleteMeshPoints.py - -echo Running extrude.py -python extrude.py - -echo Running cellsWithinBounds.py -python cellsWithinBounds.py - -echo Running fitline.py -python fitline.py - -echo Running keypress.py -python keypress.py - -echo Running mouseclick.py -python mouseclick.py - - -echo Running linInterpolate.py -python linInterpolate.py - -echo Running lorenz.py -python lorenz.py - -echo Running multiwindows.py -python multiwindows.py - -echo Running rotateImage.py -python rotateImage.py - -echo Running shrink.py -python shrink.py - -echo Running manypoints.py -python manypoints.py - -echo Running manyspheres.py -python manyspheres.py - -echo Running mesh_coloring.py -python mesh_coloring.py - -echo Running mesh_custom.py -python mesh_custom.py - -echo Running mesh_bands.py -python mesh_bands.py - -echo Running mesh_lut.py -python mesh_lut.py - -echo Running mesh_alphas.py -python mesh_alphas.py - -echo Running mesh_sharemap.py -python mesh_sharemap.py - -echo Running mesh_threshold.py -python mesh_threshold.py - -echo Running mesh_modify.py -python mesh_modify.py - -echo Running mesh_map2cell.py -python mesh_map2cell.py - -echo Running isolines.py -python isolines.py - -echo Running pca.py -python pca.py - -echo Running silhouette1.py -python silhouette1.py - -echo Running silhouette2.py -python silhouette2.py - -echo Running trail.py -python trail.py - -echo Running colorcubes.py -python colorcubes.py - -echo Running largestregion.py -python largestregion.py - -echo Running mirror.py -python mirror.py - -echo Running scalarbars.py -python scalarbars.py - -echo Running sliders.py -python sliders.py - -echo Running slider_browser.py -python slider_browser.py - -echo Running sliders3d.py -python sliders3d.py - -echo Running buttons.py -python buttons.py - -echo Running cutter.py -python cutter.py - -echo Running texturecubes.py -python texturecubes.py - -echo Running texture_coords.py -python texture_coords.py - -echo Running ribbon.py -python ribbon.py - -echo Running flatarrow.py -python flatarrow.py - -echo Running fillholes.py -python fillholes.py - -echo Running interactionstyle.py -python interactionstyle.py - -echo Running tube.py -python tube.py - -echo Running glyphs.py -python glyphs.py - -echo Running glyphs_arrows.py -python glyphs_arrows.py - -echo Running shadow.py -python shadow.py - -echo Running specular.py -python specular.py - -echo Running lightings.py -python lightings.py - -echo Running surfIntersect.py -python surfIntersect.py +for f in *.py + do + echo "Processing $f script.." + python $f + done diff --git a/vtkplotter/examples/other/dolfin/elastodynamics.py b/vtkplotter/examples/other/dolfin/elastodynamics.py index d5a658e3..6a75d37f 100644 --- a/vtkplotter/examples/other/dolfin/elastodynamics.py +++ b/vtkplotter/examples/other/dolfin/elastodynamics.py @@ -1,5 +1,4 @@ -''' -Time-integration of the +'''Time-integration of the elastodynamics equation ''' from __future__ import division, print_function diff --git a/vtkplotter/examples/other/makeVideo.py b/vtkplotter/examples/other/makeVideo.py index e09d63ca..dd47c722 100644 --- a/vtkplotter/examples/other/makeVideo.py +++ b/vtkplotter/examples/other/makeVideo.py @@ -1,5 +1,5 @@ """ -Make a video (needs ffmpeg) +Make a video (needs ffmpeg or opencv) Set offscreen=True to only produce the video without any graphical window showing """ @@ -7,19 +7,24 @@ from vtkplotter import * # declare the class instance -vp = Plotter(bg='beige', axes=10, interactive=0, offscreen=True) +vp = Plotter(bg='beige', axes=10, offscreen=True) vp.load(datadir+"spider.ply").texture("leather").rotateX(-90) # open a video file and force it to last 3 seconds in total -video = Video(name="spider.mp4", duration=3) +video = Video("spider.mp4", duration=6, backend='ffmpeg') # backend='opencv' -for i in range(80): - vp.show() # render the scene first - vp.camera.Elevation(1) - vp.camera.Azimuth(2) # rotate by 5 deg at each iteration - video.addFrame() +# Any rendering loop goes here, e.g.: +#for i in range(80): +# vp.show(elevation=1, azimuth=2) # render the scene +# video.addFrame() # add individual frame -video.close() # merge all the recorded frames +# OR use the automatic video shooting function: -vp.show(interactive=1) +video.action(zoom=1.1) +#Options are: elevation_range=(0,80), +# azimuth_range=(0,359), +# zoom=None, +# cam1=None, cam2=None # initial and final camera positions + +video.close() # merge all the recorded frames diff --git a/vtkplotter/examples/other/spherical_harmonics1.py b/vtkplotter/examples/other/spherical_harmonics1.py index 8c79a19f..c6d203a1 100644 --- a/vtkplotter/examples/other/spherical_harmonics1.py +++ b/vtkplotter/examples/other/spherical_harmonics1.py @@ -4,38 +4,35 @@ and then truncate the expansion to a specific lmax and reconstruct the projected points in red """ -from __future__ import division, print_function import numpy as np -############################################################ -# Please install pyshtools to continue this example + +# Please install pyshtools to run this example # Follow instructions at https://shtools.oca.eu/shtools -############################################################ -# Please install pyshtools to run this example -# Follow instructions at https://shtools.oca.eu/shtools import pyshtools + from scipy.interpolate import griddata from vtkplotter import Points, load, mag, Text2D, show, spher2cart, datadir print(__doc__) ############################################################# -lmax = 20 # maximum degree of the spherical harm. expansion -N = 30 # number of grid intervals on the unit sphere +lmax = 10 # maximum degree of the spherical harm. expansion +N = 50 # number of grid intervals on the unit sphere rmax = 1.5 # line length x0 = [0, 0, 0] # set object at this position ############################################################# -shape = load(datadir+'apple.ply').normalize().pos(x0).lineWidth(.1) +shape = load(datadir+'apple.ply').normalize().pos(x0).lineWidth(0.1) -show(shape, at=0, N=2, axes={'zxGrid':False}) +show(shape, at=0, N=2, axes=dict(zxGrid=False)) ############################################################ # cast rays from the center and find intersections agrid, pts = [], [] for th in np.linspace(0, np.pi, N, endpoint=False): lats = [] - for ph in np.linspace(0, 2 * np.pi, N, endpoint=False): + for ph in np.linspace(0, 2*np.pi, N, endpoint=False): p = spher2cart(rmax, th, ph) - intersections = shape.intersectWithLine([0, 0, 0], p) # + intersections = shape.intersectWithLine([0, 0, 0], p) if len(intersections): value = mag(intersections[0]) lats.append(value) @@ -55,27 +52,16 @@ # interpolate to a finer grid agrid_reco = grid_reco.to_array() -# adding 1 column -dim = (lmax * 2 + 2) + 1 -gridTmp = np.zeros((dim - 1, dim)) -gridTmp[:, 0:dim - 1] = agrid_reco -col0 = gridTmp[:, 0] -gridTmp[:, -1] = col0 -agrid_reco = gridTmp - -pts1 = [] -pts1colored = [] ll = [] for i, long in enumerate(np.linspace(0, 360, num=agrid_reco.shape[1], endpoint=True)): for j, lat in enumerate(np.linspace(90, -90, num=agrid_reco.shape[0], endpoint=True)): th = np.deg2rad(90 - lat) ph = np.deg2rad(long) p = spher2cart(agrid_reco[j][i], th, ph) - pts1.append(p) ll.append((lat, long)) radii = agrid_reco.T.ravel() -n = 500j +n = 250j lnmin, lnmax = np.array(ll).min(axis=0), np.array(ll).max(axis=0) grid = np.mgrid[lnmax[0]:lnmin[0]:(n), lnmin[1]:lnmax[1]:(n + 1j)] grid_x, grid_y = grid @@ -89,9 +75,7 @@ p = spher2cart(agrid_reco_finer[j][i], th, ph) pts2.append(p) -mesh1 = Points(pts1, r=5, c="b", alpha=1) -mesh1_col = Points(pts1colored, r=8, c="k", alpha=0.5) -mesh2 = Points(pts2, r=3, c="r", alpha=0.5) +mesh2 = Points(pts2, r=2, c="r", alpha=0.5) mesh2.clean(0.01) # impose point separation of 1% of the bounding box size comment = Text2D('spherical harmonics\nexpansion of order '+str(lmax)) diff --git a/vtkplotter/examples/pyplot/covid19.py b/vtkplotter/examples/pyplot/covid19.py index b9edde05..31c5e22a 100644 --- a/vtkplotter/examples/pyplot/covid19.py +++ b/vtkplotter/examples/pyplot/covid19.py @@ -1,7 +1,7 @@ import numpy as np import sys -date = '03-31-2020' +date = '04-14-2020' if len(sys.argv)>1: date = sys.argv[1] # ---------------------------------------------------------------------- @@ -21,6 +21,7 @@ def load_data(): if i<1: continue ln = ln.replace("Korea,", "Korea").split(",") try: + if not ln[5]: continue theta, phi = -float(ln[5])/57.3+np.pi/2, float(ln[6])/57.3+np.pi confirmed, deaths, recos = int(ln[7]), int(ln[8]), int(ln[9]) Admin, Province, Country = ln[1:4] @@ -43,7 +44,7 @@ def load_data(): continue data.append([place, theta, phi, confirmed, deaths, recos]) data.append(['US\n', 0.9, 1.4, conf_us, deat_us, reco_us]) - return data, allconf, allreco, alldeat + return data, allconf, alldeat, allreco # ------------------------------------------------------------------------- @@ -54,13 +55,14 @@ def load_data(): for place, theta, phi, confd, deaths, recos in data: pos = spher2cart(1, theta, phi) fl = place + 'cases: '+str(confd)+'\ndeaths: '+str(deaths) - Sphere(pos, np.power(confd, 1/3)/750, alpha=0.4, res=12).flag(fl) - Sphere(pos, np.power(deaths, 1/3)/750, alpha=0.4, c='k', res=10) + Sphere(pos, np.power(confd, 1/3)/1000, alpha=0.4, res=12).flag(fl) + Sphere(pos, np.power(deaths, 1/3)/1000, alpha=0.4, c='k', res=10) + #Text(place, pos*1.01, s=0.003, c='w', justify='center').orientation(pos) Text2D('COVID-19 spread on '+date +'\n#cases : '+str(allconf) +'\n#deaths: '+str(alldeat) +'\n#recovd: '+str(allreco)) Earth() -show(..., axes=12, bg2='lb', zoom=1.5, elevation=-70) +show(..., axes=12, bg2='lb', zoom=1.7, elevation=-70, size='full') diff --git a/vtkplotter/examples/volumetric/probeLine.py b/vtkplotter/examples/volumetric/probeLine.py index 9f61ae28..106dbd61 100644 --- a/vtkplotter/examples/volumetric/probeLine.py +++ b/vtkplotter/examples/volumetric/probeLine.py @@ -1,8 +1,7 @@ """Probe a Volume (voxel dataset) with lines.""" from vtkplotter import * -fpath = download("https://vtkplotter.embl.es/data/embryo.slc") -vol = load(fpath) +vol = load(datadir+"embryo.slc") pos = vol.imagedata().GetCenter() diff --git a/vtkplotter/examples/volumetric/readVolumeAsIsoSurface.py b/vtkplotter/examples/volumetric/readVolumeAsIsoSurface.py index 99ec4d1e..15bb630b 100644 --- a/vtkplotter/examples/volumetric/readVolumeAsIsoSurface.py +++ b/vtkplotter/examples/volumetric/readVolumeAsIsoSurface.py @@ -6,14 +6,12 @@ comment = Text2D(__doc__) # Read volume data from a tif file: -f = datadir+"embryo.tif" -vol1 = load(f) # load it as Volume -mesh1 = load(f, threshold=80) # isosurfacing happens on the fly +vol1 = load( datadir+"embryo.tif") # load it as Volume +mesh1 = load( datadir+"embryo.tif", threshold=80) # isosurfacing happens on the fly plotter1 = show([(vol1, comment), mesh1], N=2, axes=8, viewup='z') # on a new window -fpath = download("https://vtkplotter.embl.es/data/embryo.slc") -vol2 = load(fpath) # load it as Volume +vol2 = load(datadir+"embryo.slc") # load it as Volume vol2.color(['lb','db','dg','dr']) # color transfer values along range vol2.alpha([0.0, 0.0, 0.2, 0.6, 0.8, 1]) # opacity values along range diff --git a/vtkplotter/mesh.py b/vtkplotter/mesh.py index 5689126a..0c3f5286 100644 --- a/vtkplotter/mesh.py +++ b/vtkplotter/mesh.py @@ -106,10 +106,13 @@ def __init__( pof, pou = settings.polygonOffsetFactor, settings.polygonOffsetUnits self._mapper.SetResolveCoincidentTopologyPolygonOffsetParameters(pof, pou) + self.SetMapper(self._mapper) + inputtype = str(type(inputobj)) if inputobj is None: self._polydata = vtk.vtkPolyData() + elif isinstance(inputobj, Mesh) or isinstance(inputobj, vtk.vtkActor): polyCopy = vtk.vtkPolyData() polyCopy.DeepCopy(inputobj.GetMapper().GetInput()) @@ -119,6 +122,7 @@ def __init__( pr = vtk.vtkProperty() pr.DeepCopy(inputobj.GetProperty()) self.SetProperty(pr) + elif "PolyData" in inputtype: if inputobj.GetNumberOfCells() == 0: carr = vtk.vtkCellArray() @@ -127,6 +131,7 @@ def __init__( carr.InsertCellPoint(i) inputobj.SetVerts(carr) self._polydata = inputobj # cache vtkPolyData and mapper for speed + elif "structured" in inputtype.lower() or "RectilinearGrid" in inputtype: if settings.visibleGridEdges: gf = vtk.vtkExtractEdges() @@ -136,9 +141,11 @@ def __init__( gf.SetInputData(inputobj) gf.Update() self._polydata = gf.GetOutput() + elif "trimesh" in inputtype: tact = utils.trimesh2vtk(inputobj, alphaPerCell=False) self._polydata = tact.polydata() + elif "meshio" in inputtype: if inputobj.cells: # assume [vertices, faces] mcells =[] @@ -155,19 +162,24 @@ def __init__( if inputobj.cell_data: vcldata = numpy_to_vtk(inputobj.cell_data, deep=True) self._polydata.SetPointData(vcldata) + elif utils.isSequence(inputobj): - if len(inputobj) == 2: # assume [vertices, faces] + ninp = len(inputobj) + if ninp == 0: + self._polydata = vtk.vtkPolyData() + elif ninp == 2: # assume [vertices, faces] self._polydata = utils.buildPolyData(inputobj[0], inputobj[1]) - else: + else: # assume [vertices] or vertices self._polydata = utils.buildPolyData(inputobj, None) + elif hasattr(inputobj, "GetOutput"): # passing vtk object if hasattr(inputobj, "Update"): inputobj.Update() self._polydata = inputobj.GetOutput() + else: colors.printc("Error: cannot build mesh from type:\n", inputtype, c=1) raise RuntimeError() - self.SetMapper(self._mapper) if settings.computeNormals is not None: computeNormals = settings.computeNormals @@ -183,12 +195,12 @@ def __init__( pdnorm.Update() self._polydata = pdnorm.GetOutput() - if self._mapper: - self._mapper.SetInputData(self._polydata) + self._mapper.SetInputData(self._polydata) self.point_locator = None self.cell_locator = None self.line_locator = None + self.transform = None self._bfprop = None # backface property holder self._scals_idx = 0 # index of the active scalar changed from CLI self._ligthingnr = 0 @@ -272,10 +284,6 @@ def __add__(self, meshs): return meshs return Assembly([self, meshs]) - #def __str__(self): - # utils.printInfo(self) - # return "" - def _update(self, polydata): """Overwrite the polygonal mesh with a new vtkPolyData.""" self._polydata = polydata @@ -2430,6 +2438,91 @@ def smoothWSinc(self, niter=15, passBand=0.1, edgeAngle=15, featureAngle=60): smoothFilter.Update() return self._update(smoothFilter.GetOutput()) + def smoothMLS1D(self, f=0.2, radius=None): + """ + Smooth mesh or points with a `Moving Least Squares` variant. + The list ``mesh.info['variances']`` contain the residue calculated for each point. + Input mesh's polydata is modified. + + :param float f: smoothing factor - typical range is [0,2]. + :param float radius: radius search in absolute units. If set then ``f`` is ignored. + + .. hint:: |moving_least_squares1D.py|_ |skeletonize.py|_ + + |moving_least_squares1D| |skeletonize| + """ + coords = self.points() + ncoords = len(coords) + + if radius: + Ncp=0 + else: + Ncp = int(ncoords * f / 10) + if Ncp < 5: + colors.printc("Please choose a fraction higher than " + str(f), c=1) + Ncp = 5 + + variances, newline = [], [] + for i, p in enumerate(coords): + + points = self.closestPoint(p, N=Ncp, radius=radius) + if len(points) < 4: + continue + + points = np.array(points) + pointsmean = points.mean(axis=0) # plane center + uu, dd, vv = np.linalg.svd(points - pointsmean) + newp = np.dot(p - pointsmean, vv[0]) * vv[0] + pointsmean + variances.append(dd[1] + dd[2]) + newline.append(newp) + + self.info["variances"] = np.array(variances) + return self.points(newline) + + def smoothMLS2D(self, f=0.2, radius=None): + """ + Smooth mesh or points with a `Moving Least Squares` algorithm variant. + The list ``mesh.info['variances']`` contains the residue calculated for each point. + + :param float f: smoothing factor - typical range is [0,2]. + :param float radius: radius search in absolute units. If set then ``f`` is ignored. + + .. hint:: |moving_least_squares2D.py|_ |recosurface.py|_ + + |moving_least_squares2D| |recosurface| + """ + coords = self.points() + ncoords = len(coords) + + if radius: + Ncp = 0 + else: + Ncp = int(ncoords * f / 100) + if Ncp < 5: + colors.printc("Please choose a fraction higher than " + str(f), c=1) + Ncp = 5 + + variances, newpts = [], [] + #pb = utils.ProgressBar(0, ncoords) + for i, p in enumerate(coords): + #pb.print("smoothing mesh ...") + + pts = self.closestPoint(p, N=Ncp, radius=radius) + if radius and len(pts) < 5: + continue + + ptsmean = pts.mean(axis=0) # plane center + _, dd, vv = np.linalg.svd(pts - ptsmean) + cv = np.cross(vv[0], vv[1]) + t = (np.dot(cv, ptsmean) - np.dot(cv, p)) / np.dot(cv,cv) + newp = p + cv*t + newpts.append(newp) + variances.append(dd[2]) + + self.info["variances"] = np.array(variances) + return self.points(newpts) + + def fillHoles(self, size=None): """Identifies and fills holes in input mesh. Holes are identified by locating boundary edges, linking them together into loops, @@ -2526,9 +2619,10 @@ def isInside(self, point, tol=0.0001): sep.Update() return sep.IsInside(0) - def insidePoints(self, pts, invert=False, tol=1e-05): + + def insidePoints(self, pts, invert=False, tol=1e-05, returnIds=False): """ - Return the sublist of points that are inside a polydata closed surface. + Return the point cloud that is inside mesh surface. |pca| |pca.py|_ """ @@ -2537,7 +2631,8 @@ def insidePoints(self, pts, invert=False, tol=1e-05): pts = pts.points() else: vpoints = vtk.vtkPoints() - vpoints.SetData(numpy_to_vtk(np.ascontiguousarray(pts), deep=True)) + pts = np.ascontiguousarray(pts) + vpoints.SetData(numpy_to_vtk(pts, deep=True)) pointsPolydata = vtk.vtkPolyData() pointsPolydata.SetPoints(vpoints) @@ -2545,18 +2640,19 @@ def insidePoints(self, pts, invert=False, tol=1e-05): sep.SetTolerance(tol) sep.SetInputData(pointsPolydata) sep.SetSurfaceData(self.polydata()) + sep.SetInsideOut(invert) sep.Update() - mask1, mask2 = [], [] - for i, p in enumerate(pts): - if sep.IsInside(i): - mask1.append(p) - else: - mask2.append(p) - if invert: - return mask2 + mask = Mesh(sep.GetOutput()).getPointArray(0).astype(np.bool) + ids = np.array(range(len(pts)))[mask] + + if returnIds: + return ids else: - return mask1 + from vtkplotter.shapes import Points + pcl = Points(pts[ids]) + pcl.name = "insidePoints" + return pcl def boundaries(self, boundaryEdges=True, @@ -3079,7 +3175,7 @@ def thinPlateSpline(self, sourcePts, targetPts, userFunctions=(None,None), sigma transform.SetSigma(sigma) transform.SetSourceLandmarks(ptsou) transform.SetTargetLandmarks(pttar) - self.info["transform"] = transform + self.info["transform"] = transform # to disappear in future - replace by base.transform self.applyTransform(transform) return self diff --git a/vtkplotter/plotter.py b/vtkplotter/plotter.py index bef4bbb2..ab205c67 100644 --- a/vtkplotter/plotter.py +++ b/vtkplotter/plotter.py @@ -1060,9 +1060,9 @@ def moveCamera(self, camstart, camstop, fraction): cam.SetDistance(s2 * fraction + s1 * (1 - fraction)) cam.SetClippingRange(c2 * fraction + c1 * (1 - fraction)) self.camera = cam - save_int = self.interactive - self.show(resetcam=0, interactive=0) - self.interactive = save_int +# save_int = self.interactive +# self.show(resetcam=0, interactive=0) +# self.interactive = save_int return cam ################################################################## diff --git a/vtkplotter/settings.py b/vtkplotter/settings.py index 260a6408..4871b198 100644 --- a/vtkplotter/settings.py +++ b/vtkplotter/settings.py @@ -42,9 +42,9 @@ allowInteraction = True # Flag-style label options - flagDelay = 0.0 # popup delay in milliseconds + flagDelay = 150 # popup delay in milliseconds flagFont = "Courier" # font type ("Arial", "Courier", "Times") - flagFontSize = 14 + flagFontSize = 18 flagAngle = 0 flagBold = False flagItalic = True @@ -155,9 +155,9 @@ allowInteraction = True # Flag-style label options -flagDelay = 0 # popup delay in milliseconds +flagDelay = 150 # popup delay in milliseconds flagFont = "Courier" # font type ("Arial", "Courier", "Times") -flagFontSize = 14 +flagFontSize = 18 flagJustification = 0 flagAngle = 0 flagBold = False diff --git a/vtkplotter/shapes.py b/vtkplotter/shapes.py index 1c41d427..265622f1 100644 --- a/vtkplotter/shapes.py +++ b/vtkplotter/shapes.py @@ -114,13 +114,18 @@ def Marker(symbol, pos=(0, 0, 0), c='lb', alpha=1, s=0.1, filled=True): def Point(pos=(0, 0, 0), r=12, c="red", alpha=1): """Create a simple point.""" - if len(pos) == 2: - pos = (pos[0], pos[1], 0) if isinstance(pos, vtk.vtkActor): pos = pos.GetPosition() - mesh = Points([pos], r, c, alpha) - mesh.name = "Point" - return mesh + pd = utils.buildPolyData([[0,0,0]]) + if len(pos)==2: + pos = (pos[0], pos[1], 0.) + + pt = Mesh(pd, c, alpha) + pt.SetPosition(pos) + pt.GetProperty().SetPointSize(r) + pt.name = "Point" + return pt + class Points(Mesh): """ @@ -139,7 +144,7 @@ class Points(Mesh): |lorenz| """ - def __init__(self, plist, r=5, c=(.3,.3,.3), alpha=1): + def __init__(self, plist, r=5, c=(0.3,0.3,0.3), alpha=1): ################ interpret user input format: if isinstance(plist, Mesh): @@ -147,101 +152,81 @@ def __init__(self, plist, r=5, c=(.3,.3,.3), alpha=1): n = len(plist) - if n == 0: - return None - elif n == 3: # assume plist is in the format [all_x, all_y, all_z] + if n == 3: # assume plist is in the format [all_x, all_y, all_z] if utils.isSequence(plist[0]) and len(plist[0]) > 3: plist = np.stack((plist[0], plist[1], plist[2]), axis=1) elif n == 2: # assume plist is in the format [all_x, all_y, 0] if utils.isSequence(plist[0]) and len(plist[0]) > 3: plist = np.stack((plist[0], plist[1], np.zeros(len(plist[0]))), axis=1) - if len(plist[0]) == 2: # make it 3d + if n and len(plist[0]) == 2: # make it 3d plist = np.c_[np.array(plist), np.zeros(len(plist))] ################ if ((utils.isSequence(c) and (len(c)>3 or (utils.isSequence(c[0]) and len(c[0])==4))) or utils.isSequence(alpha) ): - cols = c + cols = c + + n = len(plist) + if n != len(cols): + printc("Mismatch in Points() colors", n, len(cols), c=1) + raise RuntimeError() + + src = vtk.vtkPointSource() + src.SetNumberOfPoints(n) + src.Update() + + vgf = vtk.vtkVertexGlyphFilter() + vgf.SetInputData(src.GetOutput()) + vgf.Update() + pd = vgf.GetOutput() + + pd.GetPoints().SetData(numpy_to_vtk(np.ascontiguousarray(plist), deep=True)) - n = len(plist) - if n != len(cols): - printc("Mismatch in Points() colors", n, len(cols), c=1) + ucols = vtk.vtkUnsignedCharArray() + ucols.SetNumberOfComponents(4) + ucols.SetName("Points_RGBA") + if utils.isSequence(alpha): + if len(alpha) != n: + printc("Mismatch in Points() alphas", n, len(alpha), c=1) raise RuntimeError() - src = vtk.vtkPointSource() - src.SetNumberOfPoints(n) - src.Update() - vgf = vtk.vtkVertexGlyphFilter() - vgf.SetInputData(src.GetOutput()) - vgf.Update() - pd = vgf.GetOutput() - pd.GetPoints().SetData(numpy_to_vtk(np.ascontiguousarray(plist), deep=True)) - - ucols = vtk.vtkUnsignedCharArray() - ucols.SetNumberOfComponents(4) - ucols.SetName("pointsRGBA") - if utils.isSequence(alpha): - if len(alpha) != n: - printc("Mismatch in Points() alphas", n, len(alpha), c=1) - raise RuntimeError() - alphas = alpha - alpha = 1 - else: - alphas = (alpha,) * n - - if utils.isSequence(cols): - c = None - if len(cols[0]) == 4: - for i in range(n): # FAST - rc,gc,bc,ac = cols[i] - ucols.InsertNextTuple4(rc, gc, bc, ac) - else: - for i in range(n): # SLOW - rc,gc,bc = getColor(cols[i]) - ucols.InsertNextTuple4(rc*255, gc*255, bc*255, alphas[i]*255) + alphas = alpha + alpha = 1 + else: + alphas = (alpha,) * n + + if utils.isSequence(cols): + c = None + if len(cols[0]) == 4: + for i in range(n): # FAST + rc,gc,bc,ac = cols[i] + ucols.InsertNextTuple4(rc, gc, bc, ac) else: - c = cols + for i in range(n): # SLOW + rc,gc,bc = getColor(cols[i]) + ucols.InsertNextTuple4(rc*255, gc*255, bc*255, alphas[i]*255) + else: + c = cols - pd.GetPointData().SetScalars(ucols) - Mesh.__init__(self, pd, c, alpha) - self.flat().pointSize(r) - self.mapper().ScalarVisibilityOn() + pd.GetPointData().SetScalars(ucols) - else: + Mesh.__init__(self, pd, c, alpha) + self.mapper().ScalarVisibilityOn() - n = len(plist) # refresh - sourcePoints = vtk.vtkPoints() - sourceVertices = vtk.vtkCellArray() - is3d = len(plist[0]) > 2 - if is3d: # its faster - for pt in plist: - aid = sourcePoints.InsertNextPoint(pt) - sourceVertices.InsertNextCell(1) - sourceVertices.InsertCellPoint(aid) - else: - for pt in plist: - aid = sourcePoints.InsertNextPoint(pt[0], pt[1], 0) - sourceVertices.InsertNextCell(1) - sourceVertices.InsertCellPoint(aid) + else: - pd = vtk.vtkPolyData() - pd.SetPoints(sourcePoints) - pd.SetVerts(sourceVertices) + pd = utils.buildPolyData(plist) - if n == 1: # passing just one point - pd.GetPoints().SetPoint(0, [0, 0, 0]) - else: - pd.GetPoints().SetData(numpy_to_vtk(np.ascontiguousarray(plist), deep=True)) Mesh.__init__(self, pd, c, alpha) - self.GetProperty().SetPointSize(r) - if n == 1: - self.SetPosition(plist[0]) + + self.GetProperty().SetPointSize(r) settings.collectable_actors.append(self) self.name = "Points" + class Glyph(Mesh): """ At each vertex of a mesh, another mesh - a `'glyph'` - is shown with @@ -283,7 +268,7 @@ def __init__(self, if utils.isSequence(mesh): # create a cloud of points - poly = utils.buildPolyData(mesh) + poly = Points(mesh).polydata() elif isinstance(mesh, vtk.vtkPolyData): poly = mesh else: @@ -355,7 +340,7 @@ def __init__(self, gly.Update() - Mesh.__init__(self, gly.GetOutput(), c=c, alpha=alpha) + Mesh.__init__(self, gly.GetOutput(), c, alpha) self.flat() if cmap: @@ -472,41 +457,45 @@ class Line(Mesh): If `p0` is a list of points returns the line connecting them. A 2D set of coords can also be passed as p0=[x..], p1=[y..]. + :param bool closed: join last to first point :param c: color name, number, or list of [R,G,B] colors. :type c: int, str, list :param float alpha: transparency in range [0,1]. :param lw: line width. - :param bool dotted: draw a dotted line :param int res: number of intermediate points in the segment """ - def __init__(self, p0, p1=None, c="r", alpha=1, lw=1, dotted=False, res=None): + def __init__(self, p0, p1=None, closed=False, c="r", alpha=1, lw=1, res=None): if isinstance(p0, vtk.vtkActor): p0 = p0.GetPosition() if isinstance(p1, vtk.vtkActor): p1 = p1.GetPosition() + self.slope = [] # used by analysis.fitLine + self.center = [] + self.variances = [] + # detect if user is passing a 2D list of points as p0=xlist, p1=ylist: if len(p0) > 3: if not utils.isSequence(p0[0]) and not utils.isSequence(p1[0]) and len(p0)==len(p1): # assume input is 2D xlist, ylist p0 = np.stack((p0, p1), axis=1) p1 = None + if len(p0[0]) == 2: # make it 3d + p0 = np.c_[np.array(p0), np.zeros(len(p0))] + self.base = p0[0] + if closed: + p0 = np.append(p0, [p0[0]], axis=0) + self.top = p0[-2] + else: + self.top = p0[-1] # detect if user is passing a list of points: if utils.isSequence(p0[0]): ppoints = vtk.vtkPoints() # Generate the polyline - dim = len((p0[0])) - if dim == 2: - firstpt = np.array([p0[0][0], p0[0][1], 0]) - lastpt = np.array([p0[-1][0], p0[-1][0], 0]) - for i, p in enumerate(p0): - ppoints.InsertPoint(i, p[0], p[1], 0) - else: - firstpt = np.array(p0[0]) - lastpt = np.array(p0[-1]) - ppoints.SetData(numpy_to_vtk(np.ascontiguousarray(p0), deep=True)) - lines = vtk.vtkCellArray() # Create the polyline. - lines.InsertNextCell(len(p0)) - for i in range(len(p0)): + ppoints.SetData(numpy_to_vtk(np.ascontiguousarray(p0), deep=True)) + lines = vtk.vtkCellArray() # Create the polyline + npt = len(p0) + lines.InsertNextCell(npt) + for i in range(npt): lines.InsertCellPoint(i) poly = vtk.vtkPolyData() poly.SetPoints(ppoints) @@ -519,17 +508,15 @@ def __init__(self, p0, p1=None, c="r", alpha=1, lw=1, dotted=False, res=None): lineSource.SetResolution(res) lineSource.Update() poly = lineSource.GetOutput() - firstpt = np.array(p0) - lastpt = np.array(p1) + self.top = np.array(p1) + self.base = np.array(p0) Mesh.__init__(self, poly, c, alpha) self.lw(lw) - if dotted: - self.GetProperty().SetLineStipplePattern(0xF0F0) - self.GetProperty().SetLineStippleRepeatFactor(1) - self.base = firstpt - self.top = lastpt - #self.SetOrigin((firstpt+lastpt)/2) + #if dotted: # not functional + # self.GetProperty().SetLineStipplePattern(0xF0F0) + # self.GetProperty().SetLineStippleRepeatFactor(1) + #self.SetOrigin((self.base+self.top)/2) settings.collectable_actors.append(self) self.name = "Line" @@ -537,24 +524,25 @@ def length(self): """Calculate length of line.""" distance = 0. pts = self.points() - for i in range(1,len(pts)): + for i in range(1, len(pts)): distance += np.linalg.norm(pts[i]-pts[i-1]) return distance -class DashedLine(Mesh): +class DashedLine(Line): """ Build a dashed line segment between points `p0` and `p1`. If `p0` is a list of points returns the line connecting them. A 2D set of coords can also be passed as p0=[x..], p1=[y..]. + :param bool closed: join last to first point :param float spacing: relative size of the dash. :param c: color name, number, or list of [R,G,B] colors. :type c: int, str, list :param float alpha: transparency in range [0,1]. :param lw: line width. """ - def __init__(self, p0, p1=None, spacing=0.1, c="red", alpha=1, lw=2): + def __init__(self, p0, p1=None, spacing=0.1, closed=False, c="red", alpha=1, lw=2): if isinstance(p0, vtk.vtkActor): p0 = p0.GetPosition() if isinstance(p1, vtk.vtkActor): p1 = p1.GetPosition() @@ -565,6 +553,10 @@ def __init__(self, p0, p1=None, spacing=0.1, c="red", alpha=1, lw=2): # assume input is 2D xlist, ylist p0 = np.stack((p0, p1), axis=1) p1 = None + if len(p0[0]) == 2: # make it 3d + p0 = np.c_[np.array(p0), np.zeros(len(p0))] + if closed: + p0 = np.append(p0, [p0[0]], axis=0) if p1 is not None: # assume passing p0=[x,y] if len(p0) == 2 and not utils.isSequence(p0[0]): @@ -626,11 +618,15 @@ def __init__(self, p0, p1=None, spacing=0.1, c="red", alpha=1, lw=2): Mesh.__init__(self, poly, c, alpha) self.lw(lw) self.base = listp[0] - self.top = listp[-1] + if closed: + self.top = listp[-2] + else: + self.top = listp[-1] settings.collectable_actors.append(self) self.name = "DashedLine" + class Lines(Mesh): """ Build the line segments between two lists of points `startPoints` and `endPoints`. @@ -673,7 +669,7 @@ def __init__(self, startPoints, endPoints=None, self.name = "Lines" -class Spline(Mesh): +class Spline(Line): """ Return an ``Mesh`` for a spline which does not necessarly passing exactly through all the input points. @@ -689,9 +685,16 @@ class Spline(Mesh): |tutorial_spline| |tutorial.py|_ """ - def __init__(self, points, smooth=0.5, degree=2, s=2, res=None): + def __init__(self, points, smooth=0.5, degree=2, closed=False, s=2, res=None): - if isinstance(points, Mesh): points = points.points() + if isinstance(points, Mesh): + points = points.points() + + if len(points[0]) == 2: # make it 3d + points = np.c_[np.array(points), np.zeros(len(points))] + + if closed: + points = np.append(points, [points[0]], axis=0) from scipy.interpolate import splprep, splev if res is None: @@ -708,34 +711,13 @@ def __init__(self, points, smooth=0.5, degree=2, s=2, res=None): # evaluate spLine, including interpolated points: xnew, ynew, znew = splev(np.linspace(0, 1, res), tckp) - ppoints = vtk.vtkPoints() # Generate the polyline for the spline - profileData = vtk.vtkPolyData() - ppoints.SetData(numpy_to_vtk(np.c_[xnew, ynew, znew], deep=True)) - lines = vtk.vtkCellArray() # Create the polyline - lines.InsertNextCell(res) - for i in range(res): - lines.InsertCellPoint(i) - profileData.SetPoints(ppoints) - profileData.SetLines(lines) - Mesh.__init__(self, profileData, c='k') - self.GetProperty().SetLineWidth(s) - self.base = np.array(points[0]) - self.top = np.array(points[-1]) + Line.__init__(self, np.c_[xnew, ynew, znew], lw=2) + settings.collectable_actors.pop() settings.collectable_actors.append(self) self.name = "Spline" - def length(self): - """Calculate length of line.""" - distance = 0. - pts = self.points() - for i in range(1,len(pts)): - distance += np.linalg.norm(pts[i]-pts[i-1]) - return distance - -def KSpline(points, - continuity=0, tension=0, bias=0, - closed=False, res=None): +class KSpline(Line): """ Return a Kochanek-Bartel spline which runs exactly through all the input points. @@ -750,38 +732,48 @@ def KSpline(points, |kspline| |kspline.py|_ """ - if not res: res = len(points)*20 - - xspline = vtk.vtkKochanekSpline() - yspline = vtk.vtkKochanekSpline() - zspline = vtk.vtkKochanekSpline() - for s in [xspline, yspline, zspline]: - if bias: s.SetDefaultBias(bias) - if tension: s.SetDefaultTension(tension) - if continuity: s.SetDefaultContinuity(continuity) - s.SetClosed(closed) - - for i,p in enumerate(points): - xspline.AddPoint(i, p[0]) - yspline.AddPoint(i, p[1]) - if len(p)>2: - zspline.AddPoint(i, p[2]) - - ln = [] - for pos in np.linspace(0, len(points), res): - x = xspline.Evaluate(pos) - y = yspline.Evaluate(pos) - z=0 - if len(p)>2: - z = zspline.Evaluate(pos) - ln.append((x,y,z)) - - mesh = Line(ln, c='gray') - mesh.base = np.array(points[0]) - mesh.top = np.array(points[-1]) - settings.collectable_actors.append(mesh) - mesh.name = "KSpline" - return mesh + def __init__(self, points, + continuity=0, tension=0, bias=0, + closed=False, res=None): + + if isinstance(points, Mesh): + points = points.points() + + if not res: res = len(points)*20 + + if len(points[0]) == 2: # make it 3d + points = np.c_[np.array(points), np.zeros(len(points))] + + xspline = vtk.vtkKochanekSpline() + yspline = vtk.vtkKochanekSpline() + zspline = vtk.vtkKochanekSpline() + for s in [xspline, yspline, zspline]: + if bias: s.SetDefaultBias(bias) + if tension: s.SetDefaultTension(tension) + if continuity: s.SetDefaultContinuity(continuity) + s.SetClosed(closed) + + for i,p in enumerate(points): + xspline.AddPoint(i, p[0]) + yspline.AddPoint(i, p[1]) + if len(p)>2: + zspline.AddPoint(i, p[2]) + + ln = [] + for pos in np.linspace(0, len(points), res): + x = xspline.Evaluate(pos) + y = yspline.Evaluate(pos) + z=0 + if len(p)>2: + z = zspline.Evaluate(pos) + ln.append((x,y,z)) + + Line.__init__(self, ln, lw=2, c='gray') + settings.collectable_actors.pop() + self.base = np.array(points[0]) + self.top = np.array(points[-1]) + settings.collectable_actors.append(self) + self.name = "KSpline" class Tube(Mesh): @@ -1344,6 +1336,7 @@ def __init__(self, point1 = (point1[0], point1[1], 0) if point2 is not None and len(point2): point2 = (point2[0], point2[1], 0) + ar = vtk.vtkArcSource() if point2 is not None: ar.UseNormalAndAngleOff() @@ -1386,6 +1379,10 @@ class Sphere(Mesh): """ def __init__(self, pos=(0, 0, 0), r=1, c="r", alpha=1, res=24, quads=False): + self.radius = r # used by fitSphere + self.center = pos + self.residue = 0 + if quads: if res<4: res=4 img = vtk.vtkImageData() @@ -1605,7 +1602,13 @@ def asphericity(self): return asp def asphericity_error(self): - """Calculate statistical error on the asphericity value.""" + """Calculate statistical error on the asphericity value. + + Errors on the main axes are stored in + `Ellipsoid.va_error` + `Ellipsoid.vb_error` + `Ellipsoid.vc_error` + """ a,b,c = self.va, self.vb, self.vc sqrtn = np.sqrt(self.nr_of_points) ea, eb, ec = a/2/sqrtn, b/2/sqrtn, b/2/sqrtn @@ -1647,11 +1650,9 @@ def asphericity_error(self): self.va_error = ea self.vb_error = eb self.vc_error = ec - self.info["va_error"] = ea - self.info["vb_error"] = eb - self.info["vc_error"] = ec return err + class Grid(Mesh): """Return an even or uneven 2D grid at `z=0`. @@ -1739,6 +1740,10 @@ def __init__(self, pos=(0, 0, 0), normal=(0, 0, 1), sx=1, sy=None, c="g", alpha= if len(pos) == 2: pos = (pos[0], pos[1], 0) + self.normal = np.array(normal) + self.center = np.array(pos) + self.variance = 0 + if sy is None: sy = sx ps = vtk.vtkPlaneSource() @@ -2339,7 +2344,7 @@ class Latex(Picture): :param bool usetex: use latex compiler of matplotlib :param fromweb: retrieve the latex image from online server (codecogs) - You can access the latex formula from the `Mesh` object with `mesh.info['formula']`. + You can access the latex formula in `Latex.formula'`. |latex| |latex.py|_ """ @@ -2354,6 +2359,8 @@ def __init__(self, usetex=False, fromweb=False, ): + self.formula = formula + if len(pos) == 2: pos = (pos[0], pos[1], 0) try: @@ -2402,7 +2409,6 @@ def build_img_plt(formula, tfile): build_img_plt(formula, '_lateximg.png') Picture.__init__(self, '_lateximg.png') - self.info['formula'] = formula self.alpha(alpha) b = self.GetBounds() xm, ym = (b[1]+b[0])/200*s, (b[3]+b[2])/200*s diff --git a/vtkplotter/utils.py b/vtkplotter/utils.py index 2d00eb01..bf6fa375 100644 --- a/vtkplotter/utils.py +++ b/vtkplotter/utils.py @@ -217,13 +217,19 @@ def buildPolyData(vertices, faces=None, lines=None, indexOffset=0, fast=True, te If tetras=True, interpret 4-point faces as tetrahedrons instead of surface quads. """ + poly = vtk.vtkPolyData() + + if len(vertices) == 0: + return poly + + if not isSequence(vertices[0]): + return poly + if len(vertices[0]) < 3: # make sure it is 3d vertices = np.c_[np.array(vertices), np.zeros(len(vertices))] if len(vertices[0]) == 2: vertices = np.c_[np.array(vertices), np.zeros(len(vertices))] - poly = vtk.vtkPolyData() - sourcePoints = vtk.vtkPoints() sourcePoints.SetData(numpy_to_vtk(np.ascontiguousarray(vertices), deep=True)) poly.SetPoints(sourcePoints) diff --git a/vtkplotter/version.py b/vtkplotter/version.py index ea3865ff..4de9ebce 100644 --- a/vtkplotter/version.py +++ b/vtkplotter/version.py @@ -1 +1 @@ -_version='2020.2.3' +_version='2020.2.4' diff --git a/vtkplotter/volume.py b/vtkplotter/volume.py index 9af201bd..f7e99839 100644 --- a/vtkplotter/volume.py +++ b/vtkplotter/volume.py @@ -236,6 +236,7 @@ def getDataArray(self): from vtk.util.numpy_support import vtk_to_numpy narray_shape = tuple(reversed(self._imagedata.GetDimensions())) narray = vtk_to_numpy(self._imagedata.GetPointData().GetScalars()).reshape(narray_shape) + narray = np.transpose(narray, axes=[2, 1, 0]) return narray def dimensions(self): diff --git a/vtkplotter/vtkio.py b/vtkplotter/vtkio.py index 6c654383..7c01ad43 100644 --- a/vtkplotter/vtkio.py +++ b/vtkplotter/vtkio.py @@ -234,14 +234,14 @@ def _load_file(filename, c, alpha, threshold, spacing, unpack): return Assembly(acts) return acts - elif fl.endswith(".geojson") or fl.endswith(".geojson.gz"): - return loadGeoJSON(fl) + elif fl.endswith(".geojson"): + return loadGeoJSON(filename) elif fl.endswith(".pvd"): - return loadPVD(fl) + return loadPVD(filename) elif fl.endswith(".pdb"): - return loadPDB(fl) + return loadPDB(filename) ################################################################# polygonal mesh: else: @@ -1412,18 +1412,25 @@ class Video: |makeVideo| |makeVideo.py|_ """ - def __init__(self, name="movie.avi", **kwargs): + def __init__(self, + name="movie.mp4", + duration=None, + fps=24, + backend='ffmpeg', + ): from tempfile import TemporaryDirectory self.name = name - self.duration = kwargs.pop('duration', None) - self.fps = float(kwargs.pop('fps', 12)) - self.ffmpeg = kwargs.pop('ffmpeg', 'ffmpeg') + self.duration = duration + self.backend = backend + self.fps = float(fps) + self.command = "ffmpeg -loglevel panic -y -r" + self.frames = [] self.tmp_dir = TemporaryDirectory() self.get_filename = lambda x: os.path.join(self.tmp_dir.name, x) - colors.printc("~video Video", name, "is open...", c="m") + colors.printc("~video Video", self.name, "is open...", c="m") def addFrame(self): """Add frame to current video.""" @@ -1440,19 +1447,117 @@ def pause(self, pause=0): self.frames.append(fr2) os.system("cp -f %s %s" % (fr, fr2)) + + def action(self, elevation_range=(0,80), + azimuth_range=(0,359), + zoom=None, + cam1=None, cam2=None): + """Automatic shooting of the video with rotation and elevation ranges. + + :param list elevation_range: initial and final elevation angles + :param list azimuth_range: initial and final azimuth angles + :param float zoom: initial zooming + :param cam12: initial and final camera position, can be dictionary or a vtkCamera + """ + if not self.duration: + self.duration = 5 + + def buildcam(cm): + cm_pos = cm.pop("pos", None) + cm_focalPoint = cm.pop("focalPoint", None) + cm_viewup = cm.pop("viewup", None) + cm_distance = cm.pop("distance", None) + cm_clippingRange = cm.pop("clippingRange", None) + cm_parallelScale = cm.pop("parallelScale", None) + cm_thickness = cm.pop("thickness", None) + cm_viewAngle = cm.pop("viewAngle", None) + cm = vtk.vtkCamera() + if cm_pos is not None: cm.SetPosition(cm_pos) + if cm_focalPoint is not None: cm.SetFocalPoint(cm_focalPoint) + if cm_viewup is not None: cm.SetViewUp(cm_viewup) + if cm_distance is not None: cm.SetDistance(cm_distance) + if cm_clippingRange is not None: cm.SetClippingRange(cm_clippingRange) + if cm_parallelScale is not None: cm.SetParallelScale(cm_parallelScale) + if cm_thickness is not None: cm.SetThickness(cm_thickness) + if cm_viewAngle is not None: cm.SetViewAngle(cm_viewAngle) + return cm + + vp = settings.plotter_instance + + if zoom: + vp.camera.Zoom(zoom) + + if isinstance(cam1, dict): + cam1 = buildcam(cam1) + if isinstance(cam2, dict): + cam2 = buildcam(cam2) + + if len(elevation_range)==2: + vp.camera.Elevation(elevation_range[0]) + if len(azimuth_range)==2: + vp.camera.Azimuth(azimuth_range[0]) + + vp.show(resetcam=False, interactive=False) + + n = self.fps * self.duration + for i in range(int(n)): + if cam1 and cam2: + vp.moveCamera(cam1, cam2, i/n) + else: + if len(elevation_range)==2: + vp.camera.Elevation((elevation_range[1]-elevation_range[0])/n) + if len(azimuth_range)==2: + vp.camera.Azimuth((azimuth_range[1]-azimuth_range[0])/n) + vp.show() + self.addFrame() + def close(self): """Render the video and write to file.""" + if self.duration: self.fps = len(self.frames) / float(self.duration) colors.printc("Recalculated video FPS to", round(self.fps, 3), c="m") else: self.fps = int(self.fps) + self.name = self.name.split('.')[0]+'.mp4' - out = os.system(self.ffmpeg + " -loglevel panic -y -r " + str(self.fps) - + " -i " + self.tmp_dir.name + os.sep + "%01d.png " + self.name) - if out: - colors.printc("ffmpeg returning error", c=1) - colors.printc("~save Video saved as", self.name, c="m") + + ######################################## + if self.backend == 'ffmpeg': + out = os.system(self.command + " " + str(self.fps) + + " -i " + self.tmp_dir.name + os.sep + "%01d.png " + self.name) + if out: + colors.printc("ffmpeg returning error", c=1) + else: + colors.printc("~save Video saved as", self.name, c="m") + + ######################################## + elif 'cv' in self.backend: + try: + import cv2 + except: + colors.printc("Error in Video backend: opencv not installed!", c=1) + return + + cap = cv2.VideoCapture(os.path.join(self.tmp_dir.name, "%1d.png")) + fourcc = cv2.VideoWriter_fourcc(*"mp4v") + w,h = settings.plotter_instance.window.GetSize() + writer = cv2.VideoWriter(self.name, fourcc, self.fps, (w, h), True) + + found = False + while True: + ret, frame = cap.read() + if not ret: break + writer.write(frame) + found = True + + cap.release() + writer.release() + if found: + colors.printc("~save Video saved as", self.name, c="m") + else: + colors.printc("could not find snapshots", c=1) + self.tmp_dir.cleanup() return