docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Struct ExtrudeSettings<T>

    Contains settings pertaining to the creation of mesh geometry for an extruded shape. Use with SplineMesh.

    Inherited Members
    ValueType.Equals(object)
    ValueType.GetHashCode()
    ValueType.ToString()
    object.Equals(object, object)
    object.GetType()
    object.ReferenceEquals(object, object)
    Namespace: UnityEngine.Splines
    Assembly: Unity.Splines.dll
    Syntax
    public struct ExtrudeSettings<T> where T : IExtrudeShape
    Type Parameters
    Name Description
    T

    A type implementing IExtrudeShape.

    Constructors

    ExtrudeSettings(int, bool, float2, float, T)

    Create a new settings object. This is used by functions in SplineMesh to extrude a shape template along a spline.

    Declaration
    public ExtrudeSettings(int segments, bool capped, float2 range, float radius, T shape)
    Parameters
    Type Name Description
    int segments

    The number of segments to divide the extruded spline into when creating vertex rings.

    bool capped

    Defines whether the ends of the extruded spline mesh should be closed.

    float2 range

    The start and end points as normalized interpolation values.

    float radius

    Defines the size of the extruded mesh.

    T shape

    The IExtrudeShape template to be used as the shape template when extruding.

    ExtrudeSettings(T)

    Create a new settings object with an IExtrudeShape instance. A default set of parameters will be used.

    Declaration
    public ExtrudeSettings(T shape)
    Parameters
    Type Name Description
    T shape

    The IExtrudeShape template to be used as the shape template when extruding.

    Properties

    CapEnds

    Whether the start and end of the mesh is filled. This setting is ignored when the extruded spline is closed. Important note - cap are triangulated using a method that assumes convex geometry. If the input shape is concave, caps may show visual artifacts or overlaps.

    Declaration
    public bool CapEnds { get; set; }
    Property Value
    Type Description
    bool

    FlipNormals

    Set true to reverse the winding order of vertices so that the face normals are inverted. This is useful primarily for SplineShape templates where the input path may not produce a counter-clockwise vertex ring. Counter-clockwise winding equates to triangles facing outwards.

    Declaration
    public bool FlipNormals { get; set; }
    Property Value
    Type Description
    bool

    Radius

    The radius of the extruded mesh. Radius is half of the width of the entire shape. The return value of GetPosition(float, int) is multiplied by this value to determine the size of the resulting shape.

    Declaration
    public float Radius { get; set; }
    Property Value
    Type Description
    float

    Range

    The section of the Spline to extrude. This value expects a normalized interpolation start and end. I.e., [0,1] is the entire Spline, whereas [.5, 1] is the last half of the Spline.

    Declaration
    public float2 Range { get; set; }
    Property Value
    Type Description
    float2

    SegmentCount

    How many sections compose the length of the mesh.

    Declaration
    public int SegmentCount { get; set; }
    Property Value
    Type Description
    int

    Shape

    The IExtrudeShape object defines the outline path of each segment.

    Declaration
    public T Shape { get; set; }
    Property Value
    Type Description
    T
    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)