Class SurfaceTopology
Utilities for working with triangle and quad primitives.
Inherited Members
Namespace: UnityEngine.ProBuilder.MeshOperations
Syntax
public static class SurfaceTopology
Methods
ConformNormals(ProBuilderMesh, IEnumerable<Face>)
Ensures that all adjacent face normals are pointing in a uniform direction. This function supports multiple islands of connected faces, but it may not unify each island the same way.
This is equivalent to the Conform Normals (Faces) action.
Declaration
public static ActionResult ConformNormals(this ProBuilderMesh mesh, IEnumerable<Face> faces)
Parameters
Type | Name | Description |
---|---|---|
ProBuilderMesh | mesh | The mesh that the faces belong to. |
IEnumerable<Face> | faces | The faces to make uniform. |
Returns
Type | Description |
---|---|
ActionResult | The result of the action. |
FlipEdge(ProBuilderMesh, Face)
Reverses the orientation of the middle edge in a quad.
. _____ _____
. |\ | | /|
. | \ | => | / |
. |____\| |/____|
This is the equivalent to the Flip Face Edge action.
Declaration
public static bool FlipEdge(this ProBuilderMesh mesh, Face face)
Parameters
Type | Name | Description |
---|---|---|
ProBuilderMesh | mesh | The mesh that face belongs to. |
Face | face | The target face. |
Returns
Type | Description |
---|---|
Boolean | True if successful; false if not. This operation will fail if the face does not contain two triangles with exactly two shared vertices. |
GetWindingOrder(IList<Vector2>)
Returns the winding order for a set of ordered points.
Declaration
public static WindingOrder GetWindingOrder(IList<Vector2> points)
Parameters
Type | Name | Description |
---|---|---|
IList<Vector2> | points | A path of points in 2D space. |
Returns
Type | Description |
---|---|
WindingOrder | The winding order if found; Unknown if not. |
Remarks
GetWindingOrder(ProBuilderMesh, Face)
Returns the winding order for a face.
Declaration
public static WindingOrder GetWindingOrder(this ProBuilderMesh mesh, Face face)
Parameters
Type | Name | Description |
---|---|---|
ProBuilderMesh | mesh | The source mesh. |
Face | face | The face to test. |
Returns
Type | Description |
---|---|
WindingOrder | The winding order if successful; Unknown if not. |
ToTriangles(ProBuilderMesh, IList<Face>)
Converts a selection of faces from n-gons to triangles.
When this method successfully converts a face to triangles, it creates each new triangle as a separate face and deletes the original face.
Declaration
public static Face[] ToTriangles(this ProBuilderMesh mesh, IList<Face> faces)
Parameters
Type | Name | Description |
---|---|---|
ProBuilderMesh | mesh | The target mesh. |
IList<Face> | faces | The faces to convert from quads to triangles. |
Returns
Type | Description |
---|---|
Face[] | Any new triangle faces created by breaking faces into individual triangles. |