docs.unity3d.com
    Show / Hide Table of Contents

    Class DeleteElements

    Functions for removing vertices and triangles from a mesh.

    Inheritance
    Object
    DeleteElements
    Namespace: UnityEngine.ProBuilder.MeshOperations
    Syntax
    public static class DeleteElements

    Methods

    DeleteFace(ProBuilderMesh, Face)

    Removes a face from a mesh.

    Declaration
    public static int[] DeleteFace(this ProBuilderMesh mesh, Face face)
    Parameters
    Type Name Description
    ProBuilderMesh mesh

    The source mesh.

    Face face

    The face to remove.

    Returns
    Type Description
    Int32[]

    An array of vertex indexes that were deleted as a result of face deletion.

    DeleteFaces(ProBuilderMesh, IEnumerable<Face>)

    Delete a collection of faces from a mesh.

    Declaration
    public static int[] DeleteFaces(this ProBuilderMesh mesh, IEnumerable<Face> faces)
    Parameters
    Type Name Description
    ProBuilderMesh mesh

    The source mesh.

    IEnumerable<Face> faces

    The faces to remove.

    Returns
    Type Description
    Int32[]

    An array of vertex indexes that were deleted as a result of deletion.

    DeleteFaces(ProBuilderMesh, IList<Int32>)

    Delete a collection of faces from a mesh.

    Declaration
    public static int[] DeleteFaces(this ProBuilderMesh mesh, IList<int> faceIndexes)
    Parameters
    Type Name Description
    ProBuilderMesh mesh

    The source mesh.

    IList<Int32> faceIndexes

    The indexes of faces to remove (corresponding to the @"UnityEngine.ProBuilder.ProBuilderMesh.faces" collection.

    Returns
    Type Description
    Int32[]

    An array of vertex indexes that were deleted as a result of deletion.

    DeleteVertices(ProBuilderMesh, IEnumerable<Int32>)

    Deletes the vertices from the passed index array, and handles rebuilding the sharedIndexes array.

    Declaration
    public static void DeleteVertices(this ProBuilderMesh mesh, IEnumerable<int> distinctIndexes)
    Parameters
    Type Name Description
    ProBuilderMesh mesh

    The source mesh.

    IEnumerable<Int32> distinctIndexes

    A list of vertices to delete. Note that this must not contain duplicates.

    Remarks

    This function does not retriangulate the mesh. Ie, you are responsible for ensuring that indexes deleted by this function are not referenced by any triangles.

    RemoveDegenerateTriangles(ProBuilderMesh)

    Declaration
    [Obsolete("Use MeshValidation.RemoveDegenerateTriangles")]
    public static int[] RemoveDegenerateTriangles(this ProBuilderMesh mesh)
    Parameters
    Type Name Description
    ProBuilderMesh mesh
    Returns
    Type Description
    Int32[]

    RemoveUnusedVertices(ProBuilderMesh)

    Declaration
    [Obsolete("Use MeshValidation.RemoveUnusedVertices")]
    public static int[] RemoveUnusedVertices(this ProBuilderMesh mesh)
    Parameters
    Type Name Description
    ProBuilderMesh mesh
    Returns
    Type Description
    Int32[]
    In This Article
    • Methods
      • DeleteFace(ProBuilderMesh, Face)
      • DeleteFaces(ProBuilderMesh, IEnumerable<Face>)
      • DeleteFaces(ProBuilderMesh, IList<Int32>)
      • DeleteVertices(ProBuilderMesh, IEnumerable<Int32>)
      • RemoveDegenerateTriangles(ProBuilderMesh)
      • RemoveUnusedVertices(ProBuilderMesh)
    Back to top
    Copyright © 2023 Unity Technologies — Terms of use
    • Legal
    • Privacy Policy
    • Cookies
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)
    "Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
    Generated by DocFX on 18 October 2023