Search Results for

    Show / Hide Table of Contents

    Class RnLineStringEx

    Inheritance
    System.Object
    RnLineStringEx
    Inherited Members
    System.Object.ToString()
    System.Object.Equals(System.Object)
    System.Object.Equals(System.Object, System.Object)
    System.Object.ReferenceEquals(System.Object, System.Object)
    System.Object.GetHashCode()
    System.Object.GetType()
    System.Object.MemberwiseClone()
    Namespace: PLATEAU.RoadNetwork.Structure
    Assembly: cs.temp.dll.dll
    Syntax
    public static class RnLineStringEx

    Methods

    CalcProximityScore(RnLineString, RnLineString)

    selfのotherに対する距離スコアを返す(線分同士の距離ではない).低いほど近い selfの各点に対して, otherとの距離を出して, その平均をスコアとする

    Declaration
    public static float? CalcProximityScore(this RnLineString self, RnLineString other)
    Parameters
    Type Name Description
    RnLineString self
    RnLineString other
    Returns
    Type Description
    System.Nullable<System.Single>

    CalcTotalAngle2D(RnLineString)

    LineStringの線分群が成す角度の合計を返す

    Declaration
    public static float CalcTotalAngle2D(this RnLineString self)
    Parameters
    Type Name Description
    RnLineString self
    Returns
    Type Description
    System.Single

    GetAdvancedPoint(RnLineString, Single, Boolean, out Int32, out Int32)

    selfの最初(reverse=trueの時は最後)から線分に沿ってoffsetだけ進んだ点を返す. 線分の長さがoffsetより短い場合は終端点を返す startIndex/endIndexはoffsetの点が所属する線分のインデックス

    Declaration
    public static Vector3 GetAdvancedPoint(this RnLineString self, float offset, bool reverse, out int startIndex, out int endIndex)
    Parameters
    Type Name Description
    RnLineString self
    System.Single offset
    System.Boolean reverse
    System.Int32 startIndex
    System.Int32 endIndex
    Returns
    Type Description
    Vector3

    GetAdvancedPointFromBack(RnLineString, Single, out Int32, out Int32)

    selfの最後から線分に沿ってoffsetだけ進んだ点を返す. 線分の長さがoffsetより短い場合は先頭の点を返す startIndex/endIndexはoffsetの点が所属する線分のインデックス

    Declaration
    public static Vector3 GetAdvancedPointFromBack(this RnLineString self, float offset, out int startIndex, out int endIndex)
    Parameters
    Type Name Description
    RnLineString self
    System.Single offset
    System.Int32 startIndex
    System.Int32 endIndex
    Returns
    Type Description
    Vector3

    GetAdvancedPointFromFront(RnLineString, Single, out Int32, out Int32)

    selfの先頭から線分に沿ってoffsetだけ進んだ点を返す. 線分の長さがoffsetより短い場合は最後の点を返す startIndex/endIndexはoffsetの点が所属する線分のインデックス

    Declaration
    public static Vector3 GetAdvancedPointFromFront(this RnLineString self, float offset, out int startIndex, out int endIndex)
    Parameters
    Type Name Description
    RnLineString self
    System.Single offset
    System.Int32 startIndex
    System.Int32 endIndex
    Returns
    Type Description
    Vector3

    GetDistance2D(RnLineString, RnLineString, AxisPlane)

    2D平面におけるLineString同士の距離を返す

    Declaration
    public static float GetDistance2D(this RnLineString self, RnLineString other, AxisPlane plane = null)
    Parameters
    Type Name Description
    RnLineString self
    RnLineString other
    AxisPlane plane
    Returns
    Type Description
    System.Single

    GetEdges(RnLineString)

    線分をLineSegment3Dにして返す

    Declaration
    public static IEnumerable<LineSegment3D> GetEdges(this RnLineString self)
    Parameters
    Type Name Description
    RnLineString self
    Returns
    Type Description
    IEnumerable<LineSegment3D>

    GetEdges2D(RnLineString, AxisPlane)

    Declaration
    public static IEnumerable<LineSegment2D> GetEdges2D(this RnLineString self, AxisPlane axis = null)
    Parameters
    Type Name Description
    RnLineString self
    AxisPlane axis
    Returns
    Type Description
    IEnumerable<LineSegment2D>

    GetIntersectionBy2D(RnLineString, LineSegment3D, AxisPlane)

    selfとlineの交点をすべて返す. ただしaxis辺面に射影↓状態で交差判定を行う. 実際に返る交点はself上の点とその時のインデックス(float)

    Declaration
    public static IEnumerable<(Vector3 v, float index)> GetIntersectionBy2D(this RnLineString self, LineSegment3D line, AxisPlane axis = null)
    Parameters
    Type Name Description
    RnLineString self
    LineSegment3D line
    AxisPlane axis
    Returns
    Type Description
    IEnumerable<System.ValueTuple<Vector3, System.Single>>

    GetIntersectionBy2D(RnLineString, Ray, AxisPlane)

    selfと直線の交点をすべて返す. ただしaxis辺面に射影↓状態で交差判定を行う. 実際に返る交点はself上の点とその時のインデックス(float)

    Declaration
    public static IEnumerable<(Vector3 v, float index)> GetIntersectionBy2D(this RnLineString self, Ray ray, AxisPlane axis = null)
    Parameters
    Type Name Description
    RnLineString self
    Ray ray
    AxisPlane axis
    Returns
    Type Description
    IEnumerable<System.ValueTuple<Vector3, System.Single>>

    GetNearestPoint(RnLineString, Vector3, out Vector3, out Single, out Single)

    点vに最も近いself上の点を返す

    Declaration
    public static void GetNearestPoint(this RnLineString self, Vector3 v, out Vector3 nearest, out float pointIndex, out float distance)
    Parameters
    Type Name Description
    RnLineString self
    Vector3 v
    Vector3 nearest
    System.Single pointIndex
    System.Single distance

    GetVertexByFloatIndex(RnLineString, Single)

    floatのindexを指定して線分上の点を取得する

    Declaration
    public static Vector3 GetVertexByFloatIndex(this RnLineString self, float index)
    Parameters
    Type Name Description
    RnLineString self
    System.Single index
    Returns
    Type Description
    Vector3

    IsPointShared(RnLineString, RnLineString)

    aとbが同じRnPointを共有しているかを返す

    Declaration
    public static bool IsPointShared(RnLineString a, RnLineString b)
    Parameters
    Type Name Description
    RnLineString a
    RnLineString b
    Returns
    Type Description
    System.Boolean

    IsSequenceEqual(RnLineString, RnLineString, out Boolean)

    a,bが同じ線分かどうかを返す. ただし、順番が逆でも同じとみなす(逆の時はisReverseSequenceがtrueになる) RnPointは参照一致で比較する

    Declaration
    public static bool IsSequenceEqual(RnLineString a, RnLineString b, out bool isReverseSequence)
    Parameters
    Type Name Description
    RnLineString a
    RnLineString b
    System.Boolean isReverseSequence
    Returns
    Type Description
    System.Boolean

    Refine(RnLineString, Single)

    selfの各線分がintervalより長い場合に間に点を置いていく

    Declaration
    public static void Refine(this RnLineString self, float interval)
    Parameters
    Type Name Description
    RnLineString self
    System.Single interval

    Refined(RnLineString, Single)

    selfの各線分がintervalより長い場合に間に点を置いて細分化したものを返す.非破壊

    Declaration
    public static RnLineString Refined(this RnLineString self, float interval)
    Parameters
    Type Name Description
    RnLineString self
    System.Single interval
    Returns
    Type Description
    RnLineString

    TryGetNearestIntersectionBy2D(RnLineString, Ray, out (Vector3 v, Single index), AxisPlane)

    selfと直線rayの最も近い交点を返す. axisで指定した平面に射影した結果で交点を考える

    Declaration
    public static bool TryGetNearestIntersectionBy2D(this RnLineString self, Ray ray, out (Vector3 v, float index) res, AxisPlane axis = null)
    Parameters
    Type Name Description
    RnLineString self
    Ray ray
    System.ValueTuple<Vector3, System.Single> res
    AxisPlane axis
    Returns
    Type Description
    System.Boolean
    In This Article
    Back to top PLATEAU SDK for Unity