Geometry0D.AveragePosition

説明

指定された0Dコンポーネントの平均位置を取得します。

スクリプト 構文

Geometry0D.AveragePosition( compIdxArray, compPos );

パラメータ

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

指定可能な値:

説明:

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

VBScript の例

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

関連項目

Geometry0D.Position Geometry0D SIVector3