mymesh.mesh.mesh.Contour#

mesh.Contour(scalars, threshold, threshold_direction=1, mixed_elements=True, Type=None, interpolation='linear')[source]#

Contour the mesh to extract an isosurface/isoline based on nodal scalar values.

Parameters:
  • scalars (str or array_like) – Values to be used for thresholding, either a string indicating an entry in NodeData or ElemData, or an array_like of values.

  • threshold (int, float) – Isosurface level that defines the boundary

  • threshold_direction (signed int) – If threshold_direction is negative (default), values less than or equal to the threshold will be considered “inside” the mesh and the opposite if threshold_direction is positive, by default 1.

  • mixed_elements (bool, optional) – If True, the generated mesh will have mixed element types (triangles/quadrilaterals, tetrahedra/wedges), otherwise a single element type (triangles, tetrahedra), by default False.

  • Type (str, optional) – Specfies the mesh type (‘vol’, ‘surf’, or ‘line’) to produce by contouring. If None is provided, the output Type will be the same as the input Type, by default None. A volumetric mesh can be contoured to create a volumetric mesh or a surface mesh, and a surface mesh can be contoured to create a surface mesh or a line mesh. Contouring of line meshes isn’t currently supported.

Returns:

M – Contoured mesh

Return type:

mymesh.mesh