Class ConnectElements
Utility class for connecting edges, faces, and vertices.
Inherited Members
Namespace: UnityEngine.ProBuilder.MeshOperations
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<Int32>)
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<Int32> | indexes | A list of indices (corresponding to the positions array) to connect to the new edges. |
Returns
Type | Description |
---|---|
Int32[] | A new array containing the indices of the newly connected positions. This method rebuilds the |