Main Content

isSelfIntersecting

Check if surface mesh is self-intersecting

Since R2022b

    Description

    TF = isSelfIntersecting(mesh) checks if the surface mesh is self-intersecting. A mesh is self-intersecting if at least one of its face intersects another face.

    example

    Examples

    collapse all

    Define mesh vertices and faces for the mesh.

    vertices =[0 0 0; 0 1 0; 1 0 0; 1 1 0; ...
                0.5 0.5 -1; 0 1 1; 1 0 1];
    faces = [1 2 3; 2 3 4; 5 6 7];

    Create and display the surface mesh.

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

    Check if the mesh is self-intersecting.

    TF = isSelfIntersecting(mesh)
    TF = logical
       1
    
    

    Input Arguments

    collapse all

    Surface mesh, specified as a surfaceMesh object.

    Output Arguments

    collapse all

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

    Version History

    Introduced in R2022b