Class SurfaceTopology | Package Manager UI website
docs.unity3d.com
    Show / Hide Table of Contents

    Class SurfaceTopology

    Utilities for working with triangle and quad primitives.

    Inheritance
    System.Object
    SurfaceTopology
    Namespace: UnityEngine.ProBuilder.MeshOperations
    Syntax
    public static class SurfaceTopology

    Methods

    ConformNormals(ProBuilderMesh, IEnumerable<Face>)

    Ensure 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.

    Declaration
    public static ActionResult ConformNormals(this ProBuilderMesh mesh, IEnumerable<Face> faces)
    Parameters
    Type Name Description
    ProBuilderMesh mesh

    The mesh that the faces belong to.

    System.Collections.Generic.IEnumerable<Face> faces

    The faces to make uniform.

    Returns
    Type Description
    ActionResult

    The state of the action.

    FlipEdge(ProBuilderMesh, Face)

    Reverses the orientation of the middle edge in a quad.

    .  _____        _____
    . |\    |      |    /|
    . |  \  |  =>  |  /  |
    . |____\|      |/____|
    
    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
    System.Boolean

    True if successful, false if not. Operation will fail if face does not contain two triangles with exactly 2 shared vertices.

    GetWindingOrder(IList<Vector2>)

    Return the winding order of a set of ordered points.

    Declaration
    public static WindingOrder GetWindingOrder(IList<Vector2> points)
    Parameters
    Type Name Description
    System.Collections.Generic.IList<Vector2> points

    A path of points in 2d space.

    Returns
    Type Description
    WindingOrder

    The winding order if found, WindingOrder.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)

    Attempt to extract 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 successfull, unknown if not.

    ToTriangles(ProBuilderMesh, IList<Face>)

    Convert a selection of faces from n-gons to triangles.
    If a face is successfully converted to triangles, each new triangle is created as a separate face and the original face is deleted.

    Declaration
    public static Face[] ToTriangles(this ProBuilderMesh mesh, IList<Face> faces)
    Parameters
    Type Name Description
    ProBuilderMesh mesh

    The target mesh.

    System.Collections.Generic.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.

    Back to top
    Copyright © 2023 Unity Technologies — Terms of use
    • Legal
    • Privacy Policy
    • Cookies
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)
    "Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
    Generated by DocFX on 18 October 2023