Main Content

isEdgeManifold

Check if surface mesh is edge-manifold

Since R2022b

    Description

    TF = isEdgeManifold(mesh,allowBoundaryEdges) checks if the surface mesh is edge-manifold. A mesh is edge-manifold if every edge of the mesh bounds either one or two faces.

    example

    Examples

    collapse all

    Define mesh vertices for a surface mesh.

    vertices = [1 -1  1; 1 1 1; -1 1 1; -1 -1 1; ...
                1 -1 -1; 1 1 -1; -1 1 -1; -1 -1 -1];

    Define the mesh faces using the vertices.

    faces = [6 2 1; 1 5 6; 8 4 3; 3 7 8; 6 7 3; 3 2 6; ...
             5 1 4; 4 8 5; 4 1 2; 2 3 4; 7 6 5; 5 8 7];

    Create and display the surface mesh.

    mesh = surfaceMesh(vertices,faces);
    surfaceMeshShow(mesh,Title="Input Mesh")

    Check if the mesh is edge-manifold.

    allowBoundaryEdges = false;
    TF = isEdgeManifold(mesh,allowBoundaryEdges);
    disp(TF)
       1
    

    Input Arguments

    collapse all

    Surface mesh, specified as a surfaceMesh object.

    Allow boundary edges, specified as a logical true or false. When this value is specified as true, the function ignores boundary edges while checking if the mesh is edge-manifold.

    Data Types: logical

    Output Arguments

    collapse all

    Surface mesh is edge-manifold, returned as a logical 0 (false) or 1 (true). The function returns true when the mesh is edge-manifold. Otherwise, it returns false.

    The function also returns false when a mesh has boundary edges and allowBoundaryEdges is specified as false.

    Version History

    Introduced in R2022b