def get_contour(self, level: float) -> LineString:
    'Extract contour lines at the specified `level` from mesh values\n\n        Parameters\n        ----------\n        level : float\n            The level at which contour lines must be extracted.\n\n        Returns\n        -------\n        LineString\n            Extracted and merged contour lines.\n\n        Raises\n        ------\n        ValueError\n            If mesh has nodes that have null value `np.nan`.\n        '
    for attr in ['quad4', 'hexa8']:
        if (len(getattr(self.msh_t, attr)) > 0):
            warnings.warn('Mesh contour extraction only supports triangles')
    coords = self.msh_t.vert2['coord']
    values = self.msh_t.value
    trias = self.msh_t.tria3['index']
    if np.any(np.isnan(values)):
        raise ValueError('Mesh contains invalid values. Raster values mustbe interpolated to the mesh before generating boundaries.')
    (x, y) = (coords[:, 0], coords[:, 1])
    features = []
    with warnings.catch_warnings():
        warnings.simplefilter('ignore', UserWarning)
        _logger.debug('Computing contours...')
        (fig, ax) = plt.subplots()
        ax.tricontour(x, y, trias, values.ravel(), levels=[level])
        plt.close(fig)
    for path_collection in ax.collections:
        for path in path_collection.get_paths():
            try:
                features.append(LineString(path.vertices))
            except ValueError:
                pass
    return linemerge(features)
Extract contour lines at the specified `level` from mesh values

Parameters
----------
level : float
    The level at which contour lines must be extracted.

Returns
-------
LineString
    Extracted and merged contour lines.

Raises
------
ValueError
    If mesh has nodes that have null value `np.nan`.
def get_contour(self, level: float) -> LineString:
    'Extract contour lines at the specified `level` from mesh values\n\n        Parameters\n        ----------\n        level : float\n            The level at which contour lines must be extracted.\n\n        Returns\n        -------\n        LineString\n            Extracted and merged contour lines.\n\n        Raises\n        ------\n        ValueError\n            If mesh has nodes that have null value `np.nan`.\n        '
    for attr in ['quad4', 'hexa8']:
        if (len(getattr(self.msh_t, attr)) > 0):
            warnings.warn('Mesh contour extraction only supports triangles')
    coords = self.msh_t.vert2['coord']
    values = self.msh_t.value
    trias = self.msh_t.tria3['index']
    if np.any(np.isnan(values)):
        raise ValueError('Mesh contains invalid values. Raster values mustbe interpolated to the mesh before generating boundaries.')
    (x, y) = (coords[:, 0], coords[:, 1])
    features = []
    with warnings.catch_warnings():
        warnings.simplefilter('ignore', UserWarning)
        _logger.debug('Computing contours...')
        (fig, ax) = plt.subplots()
        ax.tricontour(x, y, trias, values.ravel(), levels=[level])
        plt.close(fig)
    for path_collection in ax.collections:
        for path in path_collection.get_paths():
            try:
                features.append(LineString(path.vertices))
            except ValueError:
                pass
    return linemerge(features)