mymesh.contour.MarchingElements#
- mymesh.contour.MarchingElements(NodeCoords, NodeConn, NodeValues, threshold=0, interpolation='linear', Type=None, mixed_elements=True, flip=False)[source]#
Generic wrapper class for
MarchingSquares(), :func:’MarchingTriangles’,MarchingCubes(), andMarchingTetrahedra(). Mixed element meshes will be split up and processed by the appropriate method. Only options that are available for all other methods are available, more advanced options (like higher order interpolation) must be accessed directly through the more specific functions.- Parameters:
NodeCoords (array_like) – Node coordinates for the input mesh
NodeConn (array_like) – Node connectivity for the input mesh. All elements must be tetrahedra.
NodeValues (array_like) – Values at each node in the mesh that are used to extract the isosurface
threshold (int, optional) – Isosurface level, by default 0
interpolation (str, optional) –
Interpolation to interpolate the position of the new nodes along the edges of the input mesh, by default ‘linear’.
’midpoint’ - No interpolation is performed, new nodes are placed at the midpoint of edges
’linear’ - Linear interpolation is performed between adjacent nodes on the input mesh.
Type (str, optional) – Determines whether to generate a surface mesh (‘surf’) or volume mesh (‘vol’), by default None. If None is provided, the output type will be the same as the input type
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.
flip (bool, optional) – Flip the interior/exterior of the mesh, by default False. By default, values less than the threshold are assumed to be the “inside” of the mesh. If the inside is denoted by values greater than the threshold, set flip=True.
- Returns:
NodeCoords (np.ndarray) – Node coordinates of the generated mesh
NodeConn (list) – Node connetivity for the generated mesh