Class DeleteElements
Functions for removing vertices and triangles from a mesh.
Namespace: UnityEngine.ProBuilder.MeshOperations
Syntax
public static class DeleteElements
Methods
DeleteFace(ProBuilderMesh, Face)
Removes a face from a mesh.
Declaration
public static int[] DeleteFace(this ProBuilderMesh mesh, Face face)
Parameters
Type | Name | Description |
---|---|---|
ProBuilderMesh | mesh | The source mesh. |
Face | face | The face to remove. |
Returns
Type | Description |
---|---|
Int32[] | An array of vertex indexes that were deleted as a result of face deletion. |
DeleteFaces(ProBuilderMesh, IEnumerable<Face>)
Delete a collection of faces from a mesh.
Declaration
public static int[] DeleteFaces(this ProBuilderMesh mesh, IEnumerable<Face> faces)
Parameters
Type | Name | Description |
---|---|---|
ProBuilderMesh | mesh | The source mesh. |
IEnumerable<Face> | faces | The faces to remove. |
Returns
Type | Description |
---|---|
Int32[] | An array of vertex indexes that were deleted as a result of deletion. |
DeleteFaces(ProBuilderMesh, IList<Int32>)
Delete a collection of faces from a mesh.
Declaration
public static int[] DeleteFaces(this ProBuilderMesh mesh, IList<int> faceIndexes)
Parameters
Type | Name | Description |
---|---|---|
ProBuilderMesh | mesh | The source mesh. |
IList<Int32> | faceIndexes | The indexes of faces to remove (corresponding to the @"UnityEngine.ProBuilder.ProBuilderMesh.faces" collection. |
Returns
Type | Description |
---|---|
Int32[] | An array of vertex indexes that were deleted as a result of deletion. |
DeleteVertices(ProBuilderMesh, IEnumerable<Int32>)
Deletes the vertices from the passed index array, and handles rebuilding the sharedIndexes array.
Declaration
public static void DeleteVertices(this ProBuilderMesh mesh, IEnumerable<int> distinctIndexes)
Parameters
Type | Name | Description |
---|---|---|
ProBuilderMesh | mesh | The source mesh. |
IEnumerable<Int32> | distinctIndexes | A list of vertices to delete. Note that this must not contain duplicates. |
Remarks
This function does not retriangulate the mesh. Ie, you are responsible for ensuring that indexes deleted by this function are not referenced by any triangles.
RemoveDegenerateTriangles(ProBuilderMesh)
Declaration
[Obsolete("Use MeshValidation.RemoveDegenerateTriangles")]
public static int[] RemoveDegenerateTriangles(this ProBuilderMesh mesh)
Parameters
Type | Name | Description |
---|---|---|
ProBuilderMesh | mesh |
Returns
Type | Description |
---|---|
Int32[] |
RemoveUnusedVertices(ProBuilderMesh)
Declaration
[Obsolete("Use MeshValidation.RemoveUnusedVertices")]
public static int[] RemoveUnusedVertices(this ProBuilderMesh mesh)
Parameters
Type | Name | Description |
---|---|---|
ProBuilderMesh | mesh |
Returns
Type | Description |
---|---|
Int32[] |