Class ElementSelection
Inheritance
Namespace: UnityEngine.ProBuilder.MeshOperations
Syntax
public static class ElementSelection
Methods
FloodSelection(ProBuilderMesh, IList<Face>, Single)
Recursively add all faces touching any of the selected faces.
Declaration
public static HashSet<Face> FloodSelection(ProBuilderMesh mesh, IList<Face> faces, float maxAngleDiff)
Parameters
Type | Name | Description |
---|---|---|
ProBuilderMesh | mesh | The source mesh. |
System.Collections.Generic.IList<Face> | faces | The starting faces. |
System.Single | maxAngleDiff | Faces must have a normal that is within maxAngleDiff (in degrees) difference of the perimeter face to be added to the collection. |
Returns
Type | Description |
---|---|
HashSet<Face> | A collection of faces that are connected by shared edges to the original faces. |
GetFaceLoop(ProBuilderMesh, Face[], Boolean)
Fetch a face loop.
Declaration
public static HashSet<Face> GetFaceLoop(ProBuilderMesh mesh, Face[] faces, bool ring = false)
Parameters
Type | Name | Description |
---|---|---|
ProBuilderMesh | mesh | The source mesh. |
Face[] | faces | The faces to scan for loops. |
System.Boolean | ring | Toggles between loop and ring. Ring and loop are arbritary with faces, so this parameter just toggles between which gets scanned first. |
Returns
Type | Description |
---|---|
HashSet<Face> | A collection of faces gathered by extending a ring or loop, |
GetFaceRingAndLoop(ProBuilderMesh, Face[])
Get both a face ring and loop from the selected faces.
Declaration
public static HashSet<Face> GetFaceRingAndLoop(ProBuilderMesh mesh, Face[] faces)
Parameters
Type | Name | Description |
---|---|---|
ProBuilderMesh | mesh | The source mesh. |
Face[] | faces | The faces to scan for ring and loops. |
Returns
Type | Description |
---|---|
HashSet<Face> | A collection of faces gathered by extending in a ring and loop, |
GetPerimeterEdges(ProBuilderMesh, IEnumerable<Face>)
Get all edges that are on the perimeter of this face group selection.
Declaration
public static IEnumerable<Edge> GetPerimeterEdges(this ProBuilderMesh mesh, IEnumerable<Face> faces)
Parameters
Type | Name | Description |
---|---|---|
ProBuilderMesh | mesh | |
System.Collections.Generic.IEnumerable<Face> | faces | The faces to search for perimeter edge path. |
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<Edge> | A list of the edges on the perimeter of each group of adjacent faces. |
GrowSelection(ProBuilderMesh, IEnumerable<Face>, Single)
Grow faces to include any face touching the perimeter edges.
Declaration
public static HashSet<Face> GrowSelection(ProBuilderMesh mesh, IEnumerable<Face> faces, float maxAngleDiff = -1F)
Parameters
Type | Name | Description |
---|---|---|
ProBuilderMesh | mesh | The source mesh. |
System.Collections.Generic.IEnumerable<Face> | faces | The faces to grow out from. |
System.Single | maxAngleDiff | If provided, adjacent faces must have a normal that is within maxAngleDiff (in degrees) difference of the perimeter face. |
Returns
Type | Description |
---|---|
HashSet<Face> | The original faces selection, plus any new faces added as a result the grow operation. |