Cluster.Elements operator

Description

Returns a ClusterElementCollection which provides access to the mapping between the indices of the Cluster and the associated indices on the Geometry. This is important for clusters which contain only a subset of the components. For example the point at index 10 in the cluster might be point 456 on the geometry.

Examples

VBScript Example

' This example demonstrates how Cluster indices are mapped to indices of the points
' on the Geometry via the Cluster.Elements property
NewScene ,false
set oSphere = ActiveSceneRoot.AddGeometry( "Sphere", "MeshSurface" )
' Create a cluster that only contains some of the points.
set oCluster = oSphere.ActivePrimitive.Geometry.AddCluster( _
                                siVertexCluster, "MyFrontPoints", Array( 5,10,12 ) ) 
set oClusterElements = oCluster.Elements
aElements  = oClusterElements.Array
for iElement=lbound(aElements,1) to ubound(aElements,1)
        logmessage "Cluster item " & iElement & _ 
                     " refers to point " & aElements(iElement) & " on the Geometry"                                                          
next
'Output of this script is:
'INFO : "Cluster item 0 refers to point 5 on the Geometry"
'INFO : "Cluster item 1 refers to point 10 on the Geometry"
'INFO : "Cluster item 2 refers to point 12 on the Geometry"//

See Also

Cluster.CreateSubComponent