Class WingedEdge | ProBuilder | 4.3.1
docs.unity3d.com
    Show / Hide Table of Contents

    Class WingedEdge

    A winged-edge data structure holds references to an edge, the previous and next edge in it's triangle, it's connected face, and the opposite edge (common).

    Inheritance
    Object
    WingedEdge
    Namespace: UnityEngine.ProBuilder
    Syntax
    public sealed class WingedEdge : IEquatable<WingedEdge>
    Examples
    .       /   (face)    /
    . prev /             / next
    .     /    edge     /
    .    /_ _ _ _ _ _ _/
    .    |- - - - - - -|
    .    |  opposite   |
    .    |             |
    .    |             |
    .    |             |
    

    Properties

    edge

    Declaration
    public EdgeLookup edge { get; }
    Property Value
    Type Description
    EdgeLookup

    The local and shared edge that this edge belongs to.

    face

    Declaration
    public Face face { get; }
    Property Value
    Type Description
    Face

    The connected face that this wing belongs to.

    next

    Declaration
    public WingedEdge next { get; }
    Property Value
    Type Description
    WingedEdge

    The WingedEdge that is connected to the edge.y vertex.

    opposite

    Declaration
    public WingedEdge opposite { get; }
    Property Value
    Type Description
    WingedEdge

    The WingedEdge that is on the opposite side of this edge.

    previous

    Declaration
    public WingedEdge previous { get; }
    Property Value
    Type Description
    WingedEdge

    The WingedEdge that is connected to the edge.x vertex.

    Methods

    Count()

    How many edges are in this sequence.

    Declaration
    public int Count()
    Returns
    Type Description
    Int32

    The number of WingedEdges that are connected by walking the @"UnityEngine.ProBuilder.WingedEdge.next" property.

    Equals(Object)

    Equality comparision tests for local edge equality, disregarding other values.

    Declaration
    public override bool Equals(object obj)
    Parameters
    Type Name Description
    Object obj

    The WingedEdge to compare against.

    Returns
    Type Description
    Boolean

    True if the local edges are equal, false if not.

    Overrides
    Object.Equals(Object)

    Equals(WingedEdge)

    Equality comparision tests for local edge equality, disregarding other values.

    Declaration
    public bool Equals(WingedEdge other)
    Parameters
    Type Name Description
    WingedEdge other

    The WingedEdge to compare against.

    Returns
    Type Description
    Boolean

    True if the local edges are equal, false if not.

    GetAdjacentEdgeWithCommonIndex(Int32)

    Return the @"UnityEngine.ProBuilder.WingedEdge.previous" or @"UnityEngine.ProBuilder.WingedEdge.next" WingedEdge if it contains the passed common (shared) index.

    Declaration
    public WingedEdge GetAdjacentEdgeWithCommonIndex(int common)
    Parameters
    Type Name Description
    Int32 common

    The common index to search next and previous for.

    Returns
    Type Description
    WingedEdge

    The next or previous WingedEdge that contains common, or null if not found.

    GetHashCode()

    Get a hash code for this edge.

    Declaration
    public override int GetHashCode()
    Returns
    Type Description
    Int32

    WingedEdge comparison only considers the local edge. As such, this returns the local edge hashcode.

    Overrides
    Object.GetHashCode()

    GetSpokes(List<WingedEdge>)

    Get a dictionary of common indexes and all WingedEdge values touching the index.

    Declaration
    public static Dictionary<int, List<WingedEdge>> GetSpokes(List<WingedEdge> wings)
    Parameters
    Type Name Description
    List<WingedEdge> wings

    The wings to search for spokes.

    Returns
    Type Description
    Dictionary<Int32, List<WingedEdge>>

    A dictionary where each key is a common index with a list of each winged edge touching it.

    GetWingedEdges(ProBuilderMesh, Boolean)

    Create a new list of WingedEdge values for a ProBuilder mesh.

    Declaration
    public static List<WingedEdge> GetWingedEdges(ProBuilderMesh mesh, bool oneWingPerFace = false)
    Parameters
    Type Name Description
    ProBuilderMesh mesh

    The mesh from which faces will read.

    Boolean oneWingPerFace

    Optionally restrict the list to only include one WingedEdge per-face.

    Returns
    Type Description
    List<WingedEdge>

    A new list of WingedEdge values gathered from @"UnityEngine.ProBuilder.ProBuilderMesh.faces".

    GetWingedEdges(ProBuilderMesh, IEnumerable<Face>, Boolean)

    Create a new list of WingedEdge values for a ProBuilder mesh.

    Declaration
    public static List<WingedEdge> GetWingedEdges(ProBuilderMesh mesh, IEnumerable<Face> faces, bool oneWingPerFace = false)
    Parameters
    Type Name Description
    ProBuilderMesh mesh

    Target ProBuilderMesh.

    IEnumerable<Face> faces

    Which faces to include in the WingedEdge list.

    Boolean oneWingPerFace

    If oneWingPerFace is true the returned list will contain a single winged edge per-face (but still point to all edges).

    Returns
    Type Description
    List<WingedEdge>

    A new list of WingedEdge values gathered from faces.

    SortEdgesByAdjacency(List<Edge>)

    Sort edges list by adjacency, such that each edge's common y value matches the next edge's common x.

    Declaration
    public static void SortEdgesByAdjacency(List<Edge> edges)
    Parameters
    Type Name Description
    List<Edge> edges

    The edges to sort in-place.

    SortEdgesByAdjacency(Face)

    Order a face's edges in sequence. The first edge is used as a starting point.

    Declaration
    public static List<Edge> SortEdgesByAdjacency(Face face)
    Parameters
    Type Name Description
    Face face

    The source face.

    Returns
    Type Description
    List<Edge>

    A new set of edges where each edge y value matches the next edge x.

    ToString()

    Declaration
    public override string ToString()
    Returns
    Type Description
    String

    A string representation of the properties contained within this object.

    Overrides
    Object.ToString()
    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