Geometry2D.AveragePosition

説明

指定された2Dジオメトリの平均位置を取得します。

スクリプト 構文

Geometry2D.AveragePosition( compIdxArray, compPos );

パラメータ

パラメータ タイプ 詳細
compIdxArray Integer値のArray 2Dコンポーネントのインデックスの配列

指定可能な値:

説明:

0 <= compIdxArray(i) < 2D コンポーネントの数 配列内の各インデックスは有効である必要があります。
compPos SIVector3 戻されるときに、指定された2Dジオメトリの平均位置が含まれます。

VBScript の例

'Create a cube
CreatePrim "Cube", "MeshSurface"
set oSelList = GetValue("SelectionList")
set oItem = oSelList(0)
set oGeometry = oItem.obj
oNb2D = oGeometry.Nb2D
set o2DComponent = oGeometry.Geometry2D
set oPos = XSIMath.CreateVector3()
' Construct an array containing the indices 0,1,2,3
dim oIndicesArray
oIndicesArray = Array( 0, 1, 2, 3 )
o2DComponent.AveragePosition oIndicesArray, oPos
LogMessage "Average position of Component (0, 1, 2, 3) : " & oPos.x & " | " & oPos.y & " | " & oPos.z

関連項目

Geometry2D.CenterPosition Geometry2D SIVector3