docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class SurfaceTopology

    Utilities for working with triangle and quad primitives.

    Inheritance
    object
    SurfaceTopology
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: UnityEngine.ProBuilder.MeshOperations
    Assembly: Unity.ProBuilder.dll
    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
    bool

    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

    http://stackoverflow.com/questions/1165647/how-to-determine-if-a-list-of-polygon-points-are-in-clockwise-order

    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.

    In This Article
    Back to top
    Copyright © 2024 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)