Class RnWayEx
Inheritance
System.Object
RnWayEx
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()
Assembly: cs.temp.dll.dll
Syntax
public static class RnWayEx
Methods
AppendBack2LineString(RnWay, RnWay)
selfの内部のLineStringにbackのLineStringを追加する
self.Points ... back.Pointsの順になるようにIsReverseを考慮して追加する
Declaration
public static void AppendBack2LineString(this RnWay self, RnWay back)
Parameters
AppendFront2LineString(RnWay, RnWay)
selfの内部のLineStringにfrontのLineStringを追加する
back.Points... self.Pointsの順になるようにIsReverseを考慮して追加する
Declaration
public static void AppendFront2LineString(this RnWay self, RnWay front)
Parameters
CalcLength(RnWay)
Declaration
public static float CalcLength(this RnWay self)
Parameters
| Type |
Name |
Description |
| RnWay |
self |
|
Returns
| Type |
Description |
| System.Single |
|
CalcLength(RnWay, Single, Single)
Declaration
public static float CalcLength(this RnWay self, float startIndex, float endIndex)
Parameters
| Type |
Name |
Description |
| RnWay |
self |
|
| System.Single |
startIndex |
|
| System.Single |
endIndex |
|
Returns
| Type |
Description |
| System.Single |
|
CreateMergedWay(RnWay, RnWay, Boolean)
a,bのPointsを結合した新しいWayを作成する(a, bは非破壊)
Declaration
public static RnWay CreateMergedWay(RnWay a, RnWay b, bool removeDuplicate = true)
Parameters
| Type |
Name |
Description |
| RnWay |
a |
|
| RnWay |
b |
|
| System.Boolean |
removeDuplicate |
|
Returns
FindPoint(RnWay, RnPoint)
Declaration
public static int FindPoint(this RnWay self, RnPoint point)
Parameters
Returns
| Type |
Description |
| System.Int32 |
|
FindPointIndex(RnWay, RnPoint)
self.GetPoint(index) == pointとなるindexを返す. 見つからない場合は-1が返る.
Declaration
public static int FindPointIndex(this RnWay self, RnPoint point)
Parameters
Returns
| Type |
Description |
| System.Int32 |
|
GetAdvancedPoint(RnWay, Single, Boolean)
selfの開始点(reverse=trueの時は終了点)から線分に沿ってoffsetだけ進んだ点を返す.
線分の長さがoffsetより短い場合は終端点を返す
Declaration
public static Vector3 GetAdvancedPoint(this RnWay self, float offset, bool reverse)
Parameters
| Type |
Name |
Description |
| RnWay |
self |
|
| System.Single |
offset |
|
| System.Boolean |
reverse |
|
Returns
GetAdvancedPoint(RnWay, Single, Boolean, out Int32, out Int32)
selfの開始点(reverse=trueの時は終了点)から線分に沿ってoffsetだけ進んだ点を返す.
線分の長さがoffsetより短い場合は終端点を返す
startIndex/endIndexはoffsetの点が所属する線分のインデックス
Declaration
public static Vector3 GetAdvancedPoint(this RnWay self, float offset, bool reverse, out int startIndex, out int endIndex)
Parameters
| Type |
Name |
Description |
| RnWay |
self |
|
| System.Single |
offset |
|
| System.Boolean |
reverse |
|
| System.Int32 |
startIndex |
|
| System.Int32 |
endIndex |
|
Returns
GetAdvancedPointFromBack(RnWay, Single, out Int32, out Int32)
selfの最後から線分に沿ってoffsetだけ進んだ点を返す.
線分の長さがoffsetより短い場合は先頭の点を返す
Declaration
public static Vector3 GetAdvancedPointFromBack(this RnWay self, float offset, out int startIndex, out int endIndex)
Parameters
| Type |
Name |
Description |
| RnWay |
self |
|
| System.Single |
offset |
|
| System.Int32 |
startIndex |
|
| System.Int32 |
endIndex |
|
Returns
GetAdvancedPointFromFront(RnWay, Single, out Int32, out Int32)
selfの先頭から線分に沿ってoffsetだけ進んだ点を返す.
線分の長さがoffsetより短い場合は最後の点を返す
Declaration
public static Vector3 GetAdvancedPointFromFront(this RnWay self, float offset, out int startIndex, out int endIndex)
Parameters
| Type |
Name |
Description |
| RnWay |
self |
|
| System.Single |
offset |
|
| System.Int32 |
startIndex |
|
| System.Int32 |
endIndex |
|
Returns
GetDistance2D(RnWay, RnWay, AxisPlane)
Declaration
public static float GetDistance2D(this RnWay self, RnWay other, AxisPlane plane = null)
Parameters
| Type |
Name |
Description |
| RnWay |
self |
|
| RnWay |
other |
|
| AxisPlane |
plane |
|
Returns
| Type |
Description |
| System.Single |
|
GetEdges2D(RnWay)
Declaration
public static IEnumerable<LineSegment2D> GetEdges2D(this RnWay self)
Parameters
| Type |
Name |
Description |
| RnWay |
self |
|
Returns
| Type |
Description |
| IEnumerable<LineSegment2D> |
|
GetNearestPoint(RnWay, Vector3, out Vector3, out Single, out Single)
Declaration
public static void GetNearestPoint(this RnWay self, Vector3 pos, out Vector3 nearest, out float pointIndex, out float distance)
Parameters
| Type |
Name |
Description |
| RnWay |
self |
|
| Vector3 |
pos |
|
| Vector3 |
nearest |
|
| System.Single |
pointIndex |
|
| System.Single |
distance |
|
IsOutSide(RnWay, Vector3, out Vector3, out Single)
selfの方向に対してvが外側(法線と同じ側)かどうか
Declaration
public static bool IsOutSide(this RnWay self, Vector3 v, out Vector3 nearest, out float distance)
Parameters
| Type |
Name |
Description |
| RnWay |
self |
|
| Vector3 |
v |
|
| Vector3 |
nearest |
|
| System.Single |
distance |
|
Returns
| Type |
Description |
| System.Boolean |
|
IsSequentialEqual(RnWay, RnWay, out Boolean)
内部のポイントが同じかどうか.
ただし、リストが逆順でもtrueとなる(その時はisReverseSequenceはtrue)
Declaration
public static bool IsSequentialEqual(RnWay a, RnWay b, out bool isReverseSequence)
Parameters
| Type |
Name |
Description |
| RnWay |
a |
|
| RnWay |
b |
|
| System.Boolean |
isReverseSequence |
|
Returns
| Type |
Description |
| System.Boolean |
|
IsValidOrDefault(RnWay)
Declaration
public static bool IsValidOrDefault(this RnWay self)
Parameters
| Type |
Name |
Description |
| RnWay |
self |
|
Returns
| Type |
Description |
| System.Boolean |
|
MoveLerpAlongNormal(RnWay, Vector3, Vector3)
Wayを法線方向に沿って各頂点を補間しながら移動させる。
最初の頂点はstartOffset分だけ、最後の頂点はendOffset分だけ移動され、
間の頂点は線形補間されたオフセットとWayの頂点法線をつかってなるべく元の形状を維持するように移動される。
Declaration
public static void MoveLerpAlongNormal(this RnWay self, Vector3 startOffset, Vector3 endOffset)
Parameters
| Type |
Name |
Description |
| RnWay |
self |
|
| Vector3 |
startOffset |
|
| Vector3 |
endOffset |
|
PositionAtDistance(RnWay, Single, Boolean)
線の端からdistanceメートル辿ったときの位置を返します。
endSideがtrueの場合、線を逆(配列のend側)から辿ります。
Declaration
public static Vector3 PositionAtDistance(this RnWay way, float distance, bool endSide)
Parameters
| Type |
Name |
Description |
| RnWay |
way |
|
| System.Single |
distance |
|
| System.Boolean |
endSide |
|
Returns
TryMergePointsToLineString(RnWay, RnWay, Single)
selfにsrcを結合しようとする(内部のLineStringに結合しようとする).結合できない場合はfalseを返す
self (v0, v1, v2, v3...vn) src(v0', v1', v2', v3'...vm')の場合
v0 == v0'だと, srcを逆順にselfの先頭に追加 (vm'... v3', v2', v1', v0'(v0), v1, v2, v3...vn)となる
vn == vm'だと, srcを逆順にselfの末尾に追加 (v0, v1, v2, v3...vn(vm')... v3', v2', v1', v0')となる
v0 == vm'だと, srcをそのままselfの先頭に追加 (v0', v1', v2', v3'...vm'(v0), v1, v2, v3...vn)となる
vn == v0'だと, srcをそのままselfの末尾に追加 (v0, v1, v2, v3...vn(v0'), v1', v2', v3'...vm')となる
selfとsrcの最初と最後のポイントを見て, どっちの方向に結合するかを決める
Declaration
public static bool TryMergePointsToLineString(this RnWay self, RnWay src, float pointDistanceTolerance)
Parameters
| Type |
Name |
Description |
| RnWay |
self |
|
| RnWay |
src |
|
| System.Single |
pointDistanceTolerance |
|
Returns
| Type |
Description |
| System.Boolean |
|