docs.unity3d.com
    Show / Hide Table of Contents

    Class ConnectElements

    Utility class for connecting edges, faces, and vertices.

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

    Methods

    Connect(ProBuilderMesh, IEnumerable<Edge>)

    Insert new edges connecting a set of edges. If a face contains more than 2 edges to be connected, a new vertex is inserted at the center of the face and each edge is connected to the center point.

    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>)

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

    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 poke.

    Returns
    Type Description
    Face[]

    The faces created as a result of inserting new edges.

    Connect(ProBuilderMesh, IList<Int32>)

    Inserts edges connecting a list of indexes.

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

    The target mesh.

    IList<Int32> indexes

    A list of indexes (corresponding to the @"UnityEngine.ProBuilder.ProBuilderMesh.positions" array) to connect with new edges.

    Returns
    Type Description
    Int32[]

    Because this function may modify the ordering of the positions array, a new array containing the equivalent values of the passed connected indexes is returned.

    Back to top
    Copyright © 2023 Unity Technologies — 商標と利用規約
    • 法律関連
    • プライバシーポリシー
    • クッキー
    • 私の個人情報を販売または共有しない
    • Your Privacy Choices (Cookie Settings)