open_viewmin.filter_tree_plot.filters.isosurfaces#
Utilities for creating single-value contour surfaces filtered from a 3D mesh
Functions#
|
Calculate angles for Pontryagin-Thom construction |
|
Make a callable that applies Pyvista's contour filter to a mesh, |
|
Create, or alter and re-apply, a filter formula for a contour filter. |
Module Contents#
- calculate_pontryagin_thom_surface(mesh, vectors_name, normal_dir=None, theta_key=None, phi_key=None)#
Calculate angles for Pontryagin-Thom construction
For vector array named vectors_name defined on mesh, calculates angle data for the vectors relative to a reference direction normal_dir, for use in making a Pontryagin-Thom surface.
- Parameters:
mesh (pyvista.DataSet) – PyVista mesh containing the orientation field vectors.
vectors_name (str) – Name of vector array in mesh.
normal_dir ([int, int, int], optional) – Normal direction in orientation-space.
theta_key (str, optional) – Name to give calculated array of polar angles between the orientation field and normal_dir.
phi_key (str, optional) – Name to give calculated array of azimuthal angles of the orientation field about the normal_dir axis, with an arbitrary zero.
- Returns:
Keys for scalar arrays containing the calculated polar and azimuthal angles, respectively, of the orientation field relative to the given normal direction.
- Return type:
str, str
- make_smooth_contour_func(mesh, n_iter)#
Make a callable that applies Pyvista’s contour filter to a mesh, and smooths the result with the smooth filter.
- Parameters:
mesh (pyvista.dataset) – Mesh from which to calculate contour.
n_iter (int) – Number of smoothing iterations.
- Return type:
callable()
- update_isosurface(plotter, mesh_name, dataset_name=None, contour_values=None, **contour_kwargs)#
Create, or alter and re-apply, a filter formula for a contour filter.
- Parameters:
plotter (open_viewmin.FilterTreePlot)
mesh_name (str) – Name of isosurface mesh to update.
dataset_name (str or None, optional) – Name of scalar dataset from which to calculate isosurface. Pass None to keep existing dataset name.
contour_values (float, list of floats, or None) – Contour value or values. Pass None to keep existing value (defaults to 0.5 if current value is not defined).
contour_kwargs (dict or None, optional) – Keyword arguments to pyvista.Plotter.add_mesh
- Returns:
Updated filter formula for isosurface
- Return type: