Geometry2D.AverageNormal

説明

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

スクリプト構文

oBoolean = Geometry2D.AverageNormal( compIdxArray, compNor );

戻り値

Boolean. 平均法線が有効の場合は True、無効の場合は false

パラメータ

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

指定可能な値:

説明:

0 <= compIdxArray(i) < 2D コンポーネントの数 配列内の各インデックスは有効である必要があります。
compNor 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 oNor = XSIMath.CreateVector3()

' Construct an array containing the indices 0,1,2,3

dim oIndicesArray

oIndicesArray = Array( 0, 1, 2, 3 )

if o2DComponent.AverageNormal( oIndicesArray, oNor ) then

LogMessage "Average normal of Component (0, 1, 2, 3) : " & oNor.x & " | " & oNor.y & " | " & oNor.z 

end if

関連項目

Geometry2D.Normal Geometry2D SIVector3