open_viewmin.filter_tree_plot.filters.glyphs ============================================ .. py:module:: open_viewmin.filter_tree_plot.filters.glyphs .. autoapi-nested-parse:: Utilities for creating and analyzing glyphs Functions --------- .. autoapisummary:: open_viewmin.filter_tree_plot.filters.glyphs.add_glyphs_to_mesh open_viewmin.filter_tree_plot.filters.glyphs.add_tensor_ellipsoids open_viewmin.filter_tree_plot.filters.glyphs.calculate_tangent open_viewmin.filter_tree_plot.filters.glyphs.make_geometric_objects_dict Module Contents --------------- .. py:function:: add_glyphs_to_mesh(plotter, actor_name, mesh_name=None, glyph_shape=None, glyph_stride=None, glyph_kwargs=None, orient=None, scale=None, factor=None, random=True, **mesh_kwargs) Create a filter formula to sample an existing mesh, then create a filter formula to add glyphs to the sampled mesh. :param plotter: :type plotter: :class:`~open_viewmin.filter_tree_plot.filter_tree_plot.FilterTreePlot` :param actor_name: name of child (glyphs) actor :type actor_name: str :param mesh_name: name of existing parent mesh :type mesh_name: str, optional :param glyph_shape: Shape of each glyph. If a string is passed, it must be the name of a PyVista named geometric object; see https://docs.pyvista.org/api/utilities/geometric.html. Pass `None` to default to plotter setting. :type glyph_shape: str, `None`, or PyVista named geometric object :param glyph_stride: Spacing between sampled points where glyphs will be placed. For random sampling, the number of sampled points is the total number of points divided by `glyph_stride`. Pass `None` to default to plotter setting. :type glyph_stride: int or `None`, optional :param glyph_kwargs: Keyword arguments accepted by PyVista `glyph` filter. Pass `None` to default to plotter setting. :type glyph_kwargs: dict or `None`, optional :param orient: Name of vector dataset belonging to parent mesh to use as glyph orientations. Pass `None` to omit orientation information. :type orient: str or `None` :param scale: Name of scalar dataset belonging to parent mesh to use for glyph size scale. Pass `None` to omit scale information. :type scale: str or `None` :param factor: Global size rescaling factor for glyphs. Pass `None` to default to the value of `glyph_stride`. :type factor: float or `None` :param random: Whether sampling for glyph locations should be random or evenly spaced. :type random: bool :param \*\*mesh_kwargs: Keyword arguments accepted by `plotter.add_mesh` :type \*\*mesh_kwargs: dict, optional :returns: * * *pyvista.dataset* -- Created mesh .. py:function:: add_tensor_ellipsoids(plotter, ellipsoid_mesh_name, tensor_field_name, parent_mesh_name, stride=None, ellipsoid_kwargs=None, scale=None, factor=None, random=True, eigenvalue_shift=1.0, **mesh_kwargs) Add ellipsoid glyphs visualizing a symmetric tensor array's eigenvectors and eigenvalues. :param plotter: :type plotter: :class:`~open_viewmin.filter_tree_plot.filter_tree_plot.FilterTreePlot` :param ellipsoid_mesh_name: Name of new mesh :type ellipsoid_mesh_name: str :param tensor_field_name: Name of tensor array :type tensor_field_name: str :param parent_mesh_name: Name of parent mesh :type parent_mesh_name: str :param stride: Spacing between ellipsoids :type stride: int or None, optional :param ellipsoid_kwargs: Filter kwargs: keyword arguments to pyvista.parametric_objects.ParametricEllipsoid() :type ellipsoid_kwargs: dict or None, optional :param scale: Scalar array for ellipsoid size :type scale: numpy.ndarray of floats or None, optional :param factor: Global size scale factor :type factor: float or None, optional :param random: Whether glyphs will be placed at a random (as opposed to regularly spaced) subset of points :type random: bool :param eigenvalue_shift: Value added to all eigenvalues before conversion to ellipsoid axes lengths :type eigenvalue_shift: float, optional :param \*\*mesh_kwargs: Keyword arguments accepted by `plotter.add_mesh` :type \*\*mesh_kwargs: dict, optional :returns: Created mesh :rtype: pyvista.DataSet .. py:function:: calculate_tangent(dims, mesh, weights=None, threshold=None, sigma=4, field_name='tangent') Calculate tangent at each point in a mesh, assuming the mesh approximates a curve or is parent to an isosurface tube contouring a value related to "weights". Beware: Will show nonsense for regions excluded by `threshold`, since calculation is omitted there. :param dims: system dimensions :type dims: (int, int, int) :param mesh: PyVista mesh :type mesh: pyvista.dataset :param weights: Tangent is calculated where `weights` is not less than `threshold` :type weights: numpy.ndarray or `None`, optional :param threshold: Threshold value for `weights`. Pass `None` to include all points. :type threshold: float or `None`, optional :param sigma: Falloff distance for a Gaussian weighting function of distance by which each point weighs the direction to each other point. :type sigma: float, optional :param field_name: Name of tangents dataset added to `mesh`, unless `None` is passed. :type field_name: str or `None`, optional :returns: Array of tangent vectors :rtype: numpy.ndarray .. py:function:: make_geometric_objects_dict(settings_dict) Create a dictionary of glyph shapes. :param settings_dict: plotter settings :type settings_dict: dict :returns: Dictionary of glyph shapes :rtype: dict