Class ExtrudeElements
Face and edge extrusion.
Namespace: UnityEngine.ProBuilder.MeshOperations
Syntax
public static class ExtrudeElements
Methods
DetachFaces(ProBuilderMesh, IEnumerable<Face>)
Split any shared vertices so that this face may be moved independently of the main object.
Declaration
public static List<Face> DetachFaces(this ProBuilderMesh mesh, IEnumerable<Face> faces)
Parameters
Type | Name | Description |
---|---|---|
ProBuilderMesh | mesh | The source mesh. |
IEnumerable<Face> | faces | The faces to split from the mesh. |
Returns
Type | Description |
---|---|
List<Face> | The faces created forming the detached face group. |
DetachFaces(ProBuilderMesh, IEnumerable<Face>, Boolean)
Split any shared vertices so that this face may be moved independently of the main object.
Declaration
public static List<Face> DetachFaces(this ProBuilderMesh mesh, IEnumerable<Face> faces, bool deleteSourceFaces)
Parameters
Type | Name | Description |
---|---|---|
ProBuilderMesh | mesh | The source mesh. |
IEnumerable<Face> | faces | The faces to split from the mesh. |
Boolean | deleteSourceFaces | Whether or not to delete the faces on the source geometry which were detached. |
Returns
Type | Description |
---|---|
List<Face> | The faces created forming the detached face group. |
Extrude(ProBuilderMesh, IEnumerable<Edge>, Single, Boolean, Boolean)
Extrude a collection of edges.
Declaration
public static Edge[] Extrude(this ProBuilderMesh mesh, IEnumerable<Edge> edges, float distance, bool extrudeAsGroup, bool enableManifoldExtrude)
Parameters
Type | Name | Description |
---|---|---|
ProBuilderMesh | mesh | The source mesh. |
IEnumerable<Edge> | edges | The edges to extrude. |
Single | distance | The distance to extrude. |
Boolean | extrudeAsGroup | If true adjacent edges will be extruded retaining a shared vertex, if false the shared vertex will be split. |
Boolean | enableManifoldExtrude | Pass true to allow this function to extrude manifold edges, false to disallow. |
Returns
Type | Description |
---|---|
Edge[] | The extruded edges, or null if the action failed due to manifold check or an empty edges parameter. |
Extrude(ProBuilderMesh, IEnumerable<Face>, ExtrudeMethod, Single)
Extrude a collection of faces.
Declaration
public static Face[] Extrude(this ProBuilderMesh mesh, IEnumerable<Face> faces, ExtrudeMethod method, float distance)
Parameters
Type | Name | Description |
---|---|---|
ProBuilderMesh | mesh | The source mesh. |
IEnumerable<Face> | faces | The faces to extrude. |
ExtrudeMethod | method | Describes how faces are extruded. |
Single | distance | The distance to extrude faces. |
Returns
Type | Description |
---|---|
Face[] | An array of the faces created as a result of the extrusion. Null if the faces paramater is null or empty. |