docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class MergeElements

    Provides methods for merging multiple faces of a ProBuilderMesh to a single face.

    Inheritance
    object
    MergeElements
    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 MergeElements

    Methods

    Merge(ProBuilderMesh, IEnumerable<Face>)

    Merges a collection of faces into a single face. This function does not perform any sanity checks: it just merges faces, so the caller must make sure that the input is valid. This method also removes duplicate vertices created as a result of merging previously common vertices.

    This is the equivalent of the Merge Faces action.

    Declaration
    public static Face Merge(ProBuilderMesh target, IEnumerable<Face> faces)
    Parameters
    Type Name Description
    ProBuilderMesh target

    The source mesh.

    IEnumerable<Face> faces

    The collection of faces to move.

    Returns
    Type Description
    Face

    The single merged Face.

    MergePairs(ProBuilderMesh, IEnumerable<SimpleTuple<Face, Face>>, bool)

    Merges each pair of faces into a single face. Indexes are combined, but otherwise the properties of the first face in the pair take precedence.

    This is the equivalent of the Merge Faces action.

    Declaration
    public static List<Face> MergePairs(ProBuilderMesh target, IEnumerable<SimpleTuple<Face, Face>> pairs, bool collapseCoincidentVertices = true)
    Parameters
    Type Name Description
    ProBuilderMesh target

    The source mesh.

    IEnumerable<SimpleTuple<Face, Face>> pairs

    The list of face pairs to merge.

    bool collapseCoincidentVertices

    True to condense coincident vertex positions on each face.

    Returns
    Type Description
    List<Face>

    A list of the new faces created.

    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)