docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class MeshValidation

    Methods for validating and fixing mesh topology.

    Inheritance
    object
    MeshValidation
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: UnityEngine.ProBuilder.MeshOperations
    Assembly: Unity.ProBuilder.dll
    Syntax
    public static class MeshValidation

    Methods

    ContainsDegenerateTriangles(ProBuilderMesh)

    Returns whether any face on a mesh contains degenerate triangles.

    Declaration
    public static bool ContainsDegenerateTriangles(this ProBuilderMesh mesh)
    Parameters
    Type Name Description
    ProBuilderMesh mesh

    The mesh to test for degenerate triangles.

    Returns
    Type Description
    bool

    True if any face contains a degenerate triangle, false if no degenerate triangles are found.

    See Also
    RemoveDegenerateTriangles(ProBuilderMesh, List<int>)

    ContainsDegenerateTriangles(ProBuilderMesh, IList<Face>)

    Returns whether any of the specified faces contains degenerate triangles.

    Declaration
    public static bool ContainsDegenerateTriangles(this ProBuilderMesh mesh, IList<Face> faces)
    Parameters
    Type Name Description
    ProBuilderMesh mesh

    The mesh to test for degenerate triangles.

    IList<Face> faces

    The faces to test for degenerate triangles.

    Returns
    Type Description
    bool

    True if any face contains a degenerate triangle, false if no degenerate triangles are found.

    See Also
    RemoveDegenerateTriangles(ProBuilderMesh, List<int>)

    ContainsDegenerateTriangles(ProBuilderMesh, Face)

    Returns whether the specified face contains degenerate triangles.

    Declaration
    public static bool ContainsDegenerateTriangles(this ProBuilderMesh mesh, Face face)
    Parameters
    Type Name Description
    ProBuilderMesh mesh

    The mesh to test for degenerate triangles.

    Face face

    The face to test for degenerate triangles.

    Returns
    Type Description
    bool

    True if any triangle within the face contains a degenerate triangle, false if no degenerate triangles are found.

    See Also
    RemoveDegenerateTriangles(ProBuilderMesh, List<int>)

    ContainsNonContiguousTriangles(ProBuilderMesh, Face)

    Checks whether any triangles in a face are disconnected (non-contiguous).

    Declaration
    public static bool ContainsNonContiguousTriangles(this ProBuilderMesh mesh, Face face)
    Parameters
    Type Name Description
    ProBuilderMesh mesh

    The mesh that owns the face to test.

    Face face

    The face to test.

    Returns
    Type Description
    bool

    True if the face contains split triangles; false if the face is contiguous.

    EnsureFacesAreComposedOfContiguousTriangles(ProBuilderMesh, IEnumerable<Face>)

    Ensures that each face in the specified set is composed of contiguous triangle sets. If a face contains any non-contiguous triangles, this method splits them into as many faces as necessary to ensure that each group of adjacent triangles compose a single face.

    Declaration
    public static List<Face> EnsureFacesAreComposedOfContiguousTriangles(this ProBuilderMesh mesh, IEnumerable<Face> faces)
    Parameters
    Type Name Description
    ProBuilderMesh mesh

    The mesh that contains the faces to test.

    IEnumerable<Face> faces

    The faces to test for non-contiguous triangles.

    Returns
    Type Description
    List<Face>

    A list of any newly created faces as a result of splitting non-contiguous triangles. Returns an empty list if no faces required fixing.

    RemoveDegenerateTriangles(ProBuilderMesh, List<int>)

    Iterates through all faces in a mesh and removes any triangles with an area less than float.Epsilon, or with indices that point to the same vertex. This function also enforces the rule that a face must contain no coincident vertices.

    Declaration
    public static bool RemoveDegenerateTriangles(ProBuilderMesh mesh, List<int> removed = null)
    Parameters
    Type Name Description
    ProBuilderMesh mesh

    The source mesh.

    List<int> removed

    An optional list to be populated with the removed indices. If no degenerate triangles are found, this list contains no elements.

    Returns
    Type Description
    bool

    True if degenerate triangles were found and removed; false if no degenerate triangles were found.

    RemoveUnusedVertices(ProBuilderMesh, List<int>)

    Removes vertices that no face references.

    Declaration
    public static bool RemoveUnusedVertices(ProBuilderMesh mesh, List<int> removed = null)
    Parameters
    Type Name Description
    ProBuilderMesh mesh

    The source mesh.

    List<int> removed

    An optional list to be populated with the removed indices. If no vertices are removed, this list contains no elements.

    Returns
    Type Description
    bool

    A list of deleted vertex indices.

    In This Article
    Back to top
    Copyright © 2024 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)