mymesh.utils.DetectFeatures#

mymesh.utils.DetectFeatures(NodeCoords, SurfConn, angle=25)[source]#

Classifies nodes as edges or corners if the angle between adjacent surface elements is less than or equal to angle.

Parameters:
  • NodeCoords (list) – List of nodal coordinates.

  • SurfConn (list) – List of nodal connectivities of a surface mesh.

  • angle (float, optional) – Dihedral angle threshold (in degrees) used to determine whether an edge exists between two adjacent faces, by default 25.

Returns:

  • edges (list) – list of nodes identified to lie on an edge of the geometry.

  • corners (list) – list of nodes identified to lie on a corner of the geometry.

Examples

background = primitives.Grid([0,1,0,1,0,1], .02, ElemType='tet')
S = implicit.TetMesh(implicit.thickenf(implicit.gyroid,1), [0,1,0,1,0,1], .03, background=background)
edges, corners = utils.DetectFeatures(S.NodeCoords, S.SurfConn)
features = np.zeros(S.NNode)
features[edges] = 1
features[corners] = 2
S.plot(scalars=features, color='coolwarm', bgcolor='w')
../../_images/mymesh-utils-DetectFeatures-1.png