fedoo.mesh.extract_surface

extract_surface(mesh: Mesh, reduce_order: bool = False, quad2tri: bool | None = None, check_normals: bool = True, node_set: str | _Buffer | _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | bool | int | float | complex | bytes | _NestedSequence[bool | int | float | complex | str | bytes] | None = None, element_set: str | _Buffer | _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | bool | int | float | complex | bytes | _NestedSequence[bool | int | float | complex | str | bytes] | None = None)

Build a mesh of the surface from a given 2D or 3D mesh.

By default, this function ensure that the normal of the surface elements are oriented outside the volume.

Parameters:
  • mesh (fd.Mesh) – Mesh from which we want to extract the surface

  • reduce_order (bool, default = False) – If True, the surface mesh will use linear interpolation (‘lin2’, ‘tri3’ or ‘quad4’ if quad2tri is set to False)

  • quad2tri (bool, optional) – Define if a ‘quad4’ surface should be splitted in tri3 elements. If non specified, quad element are splitted only if reduce_order is True.

  • check_normals (bool, default = True) – If True, the elements are ordered so that the normals are oriented outside the volume.

  • node_set (str | array_like, optional) – if node_set is defined (array of node indices or node_set name), the surface mesh will include only face whose corner nodes are all in the given node_set.

  • element_set (str | array_like, optional) – if element_set is defined (array of node indices or node_set name), the surface mesh will include only face that belong to elements in the given element_set.

Note

This operation can be also done using the pyvista library:

>>> Mesh.from_pyvista(mesh.to_pyvista().extract_surface())

but the pyvista function doesn’t seem to ensure that the normal is well oriented.

Returns:

Surface Mesh

Return type:

Mesh