docs.unity3d.com
    Show / Hide Table of Contents

    Class DeleteElements

    Provides functions for removing vertices and triangles from a mesh.

    Inheritance
    Object
    DeleteElements
    Inherited Members
    Object.ToString()
    Object.Equals(Object)
    Object.Equals(Object, Object)
    Object.ReferenceEquals(Object, Object)
    Object.GetHashCode()
    Object.GetType()
    Object.MemberwiseClone()
    Namespace: UnityEngine.ProBuilder.MeshOperations
    Syntax
    public static class DeleteElements

    Methods

    DeleteFace(ProBuilderMesh, Face)

    Removes a face from a mesh.

    This is the equivalent of the Delete Faces action.

    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 indices that ProBuilder deleted when it removed the specified face.

    DeleteFaces(ProBuilderMesh, IEnumerable<Face>)

    Deletes a collection of faces from a mesh.

    This is the equivalent of the Delete Faces action.

    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 indices that ProBuilder deleted when it removed the specified faces.

    DeleteFaces(ProBuilderMesh, IList<Int32>)

    Deletes a list of faces from a mesh.

    This is the equivalent of the Delete Faces action.

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

    The source mesh.

    IList<Int32> faceIndexes

    The indices of faces to remove (corresponding to the faces collection.

    Returns
    Type Description
    Int32[]

    An array of vertex indices that ProBuilder deleted when it removed the specified faces.

    DeleteVertices(ProBuilderMesh, IEnumerable<Int32>)

    Deletes the vertices from the specified index array and rebuilds the sharedVertices 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. This means that you are responsible for ensuring that the indexes deleted by this function are not referenced by any triangles.

    Back to top
    Terms of use
    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