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

    Class ElementSelection

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

    Methods

    FloodSelection(ProBuilderMesh, IList<Face>, Single)

    Recursively add all faces touching any of the selected faces.

    Declaration
    public static HashSet<Face> FloodSelection(ProBuilderMesh mesh, IList<Face> faces, float maxAngleDiff)
    Parameters
    Type Name Description
    ProBuilderMesh mesh

    The source mesh.

    IList<Face> faces

    The starting faces.

    Single maxAngleDiff

    Faces must have a normal that is within maxAngleDiff (in degrees) difference of the perimeter face to be added to the collection.

    Returns
    Type Description
    HashSet<Face>

    A collection of faces that are connected by shared edges to the original faces.

    GetFaceLoop(ProBuilderMesh, Face[], Boolean)

    Fetch a face loop.

    Declaration
    public static HashSet<Face> GetFaceLoop(ProBuilderMesh mesh, Face[] faces, bool ring = false)
    Parameters
    Type Name Description
    ProBuilderMesh mesh

    The source mesh.

    Face[] faces

    The faces to scan for loops.

    Boolean ring

    Toggles between loop and ring. Ring and loop are arbritary with faces, so this parameter just toggles between which gets scanned first.

    Returns
    Type Description
    HashSet<Face>

    A collection of faces gathered by extending a ring or loop,

    GetFaceRingAndLoop(ProBuilderMesh, Face[])

    Get both a face ring and loop from the selected faces.

    Declaration
    public static HashSet<Face> GetFaceRingAndLoop(ProBuilderMesh mesh, Face[] faces)
    Parameters
    Type Name Description
    ProBuilderMesh mesh

    The source mesh.

    Face[] faces

    The faces to scan for ring and loops.

    Returns
    Type Description
    HashSet<Face>

    A collection of faces gathered by extending in a ring and loop,

    GetPerimeterEdges(ProBuilderMesh, IEnumerable<Face>)

    Get all edges that are on the perimeter of this face group selection.

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

    The faces to search for perimeter edge path.

    Returns
    Type Description
    IEnumerable<Edge>

    A list of the edges on the perimeter of each group of adjacent faces.

    GrowSelection(ProBuilderMesh, IEnumerable<Face>, Single)

    Grow faces to include any face touching the perimeter edges.

    Declaration
    public static HashSet<Face> GrowSelection(ProBuilderMesh mesh, IEnumerable<Face> faces, float maxAngleDiff = -1F)
    Parameters
    Type Name Description
    ProBuilderMesh mesh

    The source mesh.

    IEnumerable<Face> faces

    The faces to grow out from.

    Single maxAngleDiff

    If provided, adjacent faces must have a normal that is within maxAngleDiff (in degrees) difference of the perimeter face.

    Returns
    Type Description
    HashSet<Face>

    The original faces selection, plus any new faces added as a result the grow operation.

    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