pysdic.Mesh.quick_visualize#
- Mesh.quick_visualize(*, warp_by=None, vertex_color=None, vertex_size=None, vertex_opacity=None, vertex_mask=None, show_vertices=True, edge_color=None, edge_width=None, edge_opacity=None, show_edges=True, face_color=None, face_opacity=None, face_mask=None, show_faces=True, vertex_property=None, element_property=None, property_axis=None, property_clim=None, property_cmap=None, property_below_color=None, property_above_color=None, texture=None, texture_rgb=True, title=None, show_bar=True, show_bounds=True, show_vertices_index=False, show_elements_index=False, index_font_size=10, screenshot=None)[source]#
Visualize the mesh with PyVista (only for \(E \leq 3\)).
Only the finite vertices are displayed.
See also
pysdic.Plotter3Dfor more control over the visualization.
- Parameters:
warp_by (Optional[Union[str, ArrayLike]], optional) – The vertex property used to warp the mesh: the name of a vertex property, or an array of shape \((N_v,)\) or \((N_v, A)\).
vertex_color (Union[str, Tuple[Real, Real, Real]], optional) – The color of the vertices: a color name (e.g.
"red"), an RGB tuple or a hex string. Ignored ifvertex_propertyis given.vertex_size (Real, optional) – The size of the vertices (positive). PyVista default:
5.0.vertex_opacity (Real, optional) – The opacity of the vertices, between
0.0and1.0. PyVista default:1.0.vertex_mask (Optional[ArrayLike], optional) – A boolean array of shape \((N_v,)\), True for the vertices to display. By default, all the finite vertices are displayed.
show_vertices (bool, optional (default:
True)) – Whether to show the vertices.edge_color (Union[str, Tuple[Real, Real, Real]], optional) – The color of the edges.
edge_width (Real, optional) – The width of the edges (positive). PyVista default:
1.0.edge_opacity (Real, optional) – The opacity of the edges, between
0.0and1.0. PyVista default:1.0.show_edges (bool, optional (default:
True)) – Whether to show the edges.face_color (Union[str, Tuple[Real, Real, Real]], optional) – The color of the faces (elements). Ignored if
element_propertyis given.face_opacity (Real, optional) – The opacity of the faces, between
0.0and1.0. PyVista default:1.0.face_mask (Optional[ArrayLike], optional) – A boolean array of shape \((N_e,)\), True for the faces to display. By default, all the faces are displayed.
show_faces (bool, optional (default:
True)) – Whether to show the faces.vertex_property (Union[str, ArrayLike], optional) – The property used to color the vertices: the name of a vertex property, or an array of shape \((N_v,)\) or \((N_v, A)\).
element_property (Union[str, ArrayLike], optional) – The property used to color the faces: the name of an element property, or an array of shape \((N_e,)\) or \((N_e, A)\).
property_axis (Optional[Integral], optional) – The component used for coloring when the property has \(A > 1\) components. By default, the norm of the property vector is used.
property_clim (Optional[Tuple[Real, Real]], optional) – The color limits (min, max). By default, they are set automatically.
property_cmap (Union[str,
matplotlib.colors.Colormap], optional) – The colormap (name or object). Matplotlib default:"viridis".property_below_color (Union[str, Tuple[Real, Real, Real]], optional) – The color of the values below
property_clim. By default, the first color of the colormap.property_above_color (Union[str, Tuple[Real, Real, Real]], optional) – The color of the values above
property_clim. By default, the last color of the colormap.texture (Optional[ArrayLike], optional) – An image used as texture, of shape \((H, W, 3)\) (RGB) or \((H, W)\) (gray levels). Only for surface meshes with a UV map (see
uvmap).texture_rgb (bool, optional (default:
True)) – True iftextureis an RGB image, False if it is a gray level image mapped withproperty_cmap.title (Optional[str], optional) – The title of the window.
show_bar (bool, optional (default:
True)) – Whether to show the color bar when a property is displayed.show_bounds (bool, optional (default:
True)) – Whether to show the axes bounds.show_vertices_index (bool, optional (default:
False)) – Whether to write the index of each displayed vertex next to it.show_elements_index (bool, optional (default:
False)) – Whether to write the index of each displayed element at its center.index_font_size (Real, optional (default:
10)) – The font size of the indices, in pixels of the screen (constant when zooming).screenshot (Optional[str], optional) – The path of a screenshot to save. By default, no screenshot is saved.
- Return type:
None
Examples
1import numpy 2from pysdic import Mesh 3 4points = numpy.array([[0, 0, 0], [1, 0, 0], [0, 1, 0], [0, 0, 1]]) 5elements = numpy.array([[0, 1, 2], [0, 1, 3], [0, 2, 3], [1, 2, 3]]) 6mesh = Mesh(points, elements, element_type="triangle_3") 7 8mesh.quick_visualize(face_color="lightgray", edge_color="black") 9mesh.quick_visualize(show_vertices_index=True, show_elements_index=True) # Numbering