docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class ConnectElements

    Utility class for connecting edges, faces, and vertices.

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

    Methods

    Connect(ProBuilderMesh, IEnumerable<Edge>)

    Inserts new edges in order to connect a set of edges. If a face contains more than two edges to connect, this method inserts a new vertex at the center of the face and connects each edge to the center point.

    This is the equivalent of the Connect Edges action.

    Declaration
    public static SimpleTuple<Face[], Edge[]> Connect(this ProBuilderMesh mesh, IEnumerable<Edge> edges)
    Parameters
    Type Name Description
    ProBuilderMesh mesh

    The target mesh.

    IEnumerable<Edge> edges

    A list of edges to connect.

    Returns
    Type Description
    SimpleTuple<Face[], Edge[]>

    The faces and edges created as a result of inserting new edges.

    Connect(ProBuilderMesh, IEnumerable<Face>)

    Inserts new edges on a face starting from the center of each edge to a new vertex in the center of the face.

    This is the equivalent of the Connect Edges action.

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

    Target mesh.

    IEnumerable<Face> faces

    The faces to affect.

    Returns
    Type Description
    Face[]

    The faces created as a result of inserting new edges.

    Connect(ProBuilderMesh, IList<int>)

    Inserts edges connecting a list of indices.

    This is the equivalent of the Connect Edges action.

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

    The target mesh.

    IList<int> indexes

    A list of indices (corresponding to the positions array) to connect to the new edges.

    Returns
    Type Description
    int[]

    A new array containing the indices of the newly connected positions. This method rebuilds the indexes array because it might modify the ordering of the original array.

    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)