Class ConnectElements
Utility class for connecting edges, faces, and vertices.
Inheritance
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. |
System.Collections.Generic.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. |
System.Collections.Generic.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. |
System.Collections.Generic.IList<System.Int32> | indexes | A list of indexes (corresponding to the @"UnityEngine.ProBuilder.ProBuilderMesh.positions" array) to connect with new edges. |
Returns
Type | Description |
---|---|
System.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. |