Geometry2D.AverageNormal
 
 
 

Geometry2D.AverageNormal

Description

Get the average normal of given 2D geometry

Scripting Syntax

oBoolean = Geometry2D.AverageNormal( compIdxArray, compNor );

Return Value

Boolean. True if the average normal is valid; otherwise False

Parameters

Parameter Type Description
compIdxArray Array of Integer values An array of indices of 2D Component

Possible Values:

Description:

0 <= compIdxArray(i) < Number of 2D Component Each index in the array must be valid
compNor SIVector3 Upon return, contains the average normal of the given 2D geometry

Examples

VBScript Example

'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

See Also

Geometry2D.Normal Geometry2D SIVector3