wolfhece.pyvertexvectors._triangulation ======================================= .. py:module:: wolfhece.pyvertexvectors._triangulation .. autoapi-nested-parse:: Triangulation GUI class with OpenGL and matplotlib rendering. Module Contents --------------- .. py:class:: Triangulation(fn='', pts=None, tri=None, idx: str = '', plotted: bool = True, mapviewer=None, need_for_wx: bool = False) Bases: :py:obj:`wolfhece.pyvertexvectors._models.TriangulationModel`, :py:obj:`wolfhece.drawing_obj.Element_To_Draw` .. autoapi-inheritance-diagram:: wolfhece.pyvertexvectors._triangulation.Triangulation :parts: 1 :private-bases: Triangulation with OpenGL rendering and matplotlib plotting. Inherits all data operations from :class:`TriangulationModel` and adds ``Element_To_Draw`` integration, OpenGL display-list rendering, and matplotlib visualisation helpers. .. py:attribute:: idgllist :value: -99999 .. py:method:: _make_triangulation(**kwargs) -> Triangulation Factory: create a GUI-enabled triangulation. .. py:property:: id_list Backward-compatible alias for the OpenGL display-list id. .. py:method:: read(fn: str) Read a file, then reset the GL display list. :param fn: File path to read. .. py:method:: import_from_gltf(fn='') Import a GLTF/GLB file, with optional wx file dialog. :param fn: File path (empty to show a file dialog). .. py:method:: export_to_gltf(fn='') Export to GLTF/GLB, with optional wx file dialog. :param fn: File path (empty to show a file dialog). .. py:method:: copy() -> Triangulation Return a GUI-enabled copy of the triangulation. .. py:method:: reset_listogl() Reset the OpenGL display list for the triangulation. .. py:method:: reset_plot() Backward-compatible alias used by the viewer to invalidate the GL plot. .. py:method:: plot(sx=None, sy=None, xmin=None, ymin=None, xmax=None, ymax=None, size=None) Plot the triangulation using OpenGL. :param sx: Scale factor along X. :param sy: Scale factor along Y. :param xmin: Minimum X of the viewport. :param ymin: Minimum Y of the viewport. :param xmax: Maximum X of the viewport. :param ymax: Maximum Y of the viewport. :param size: Reference size for rendering. .. py:method:: plot_matplotlib(ax: matplotlib.axes.Axes | tuple[matplotlib.figure.Figure, matplotlib.axes.Axes] = None, color='black', alpha=1.0, lw=1.5, **kwargs) Plot the triangulation using Matplotlib. :param ax: Axes, (Figure, Axes) tuple, or None to create a new figure. :param color: Line colour. :param alpha: Opacity (0–1). :param lw: Line width. :param kwargs: Extra keyword arguments forwarded to ``ax.plot``. :return: ``(fig, ax)`` tuple. .. py:property:: mpl_triangulation :type: matplotlib.tri.Triangulation Return the triangulation as a Matplotlib Triangulation object. :return: ``matplotlib.tri.Triangulation`` or *None* if empty. .. py:method:: plot_matplotlib_3D(ax: matplotlib.axes.Axes | tuple[matplotlib.figure.Figure, matplotlib.axes.Axes] = None, color='black', alpha=0.2, lw=1.5, edgecolor='k', shade=True, **kwargs) Plot the triangulation as a 3-D surface using Matplotlib. :param ax: 3-D Axes, (Figure, Axes) tuple, or None to create one. :param color: Surface colour. :param alpha: Surface opacity. :param lw: Line width of triangle edges. :param edgecolor: Edge colour. :param shade: Whether to shade the surface. :param kwargs: Extra keyword arguments forwarded to ``plot_trisurf``. :return: ``(fig, ax)`` tuple, or ``(None, None)`` if empty.