var obj = ActiveSceneRoot.AddGeometry( "Cube", "MeshSurface" );
var samplelist = obj.ActivePrimitive.Geometry.Facets(2).Samples;
var results = "";
var fs = new Enumerator( samplelist.Navigate(siFirstComponent) );
for ( ; ! fs.atEnd(); fs.moveNext() ) {
var firstsample = fs.item();
results += firstsample.Index + " ";
}
LogMessage( "The associated first samples are " + results );
results = "";
var ls = new Enumerator( samplelist.Navigate(siLastComponent) );
for ( ; ! ls.atEnd(); ls.moveNext() ) {
var lastsample = ls.item();
results += lastsample.Index + " ";
}
LogMessage( "The associated last samples are " + results );
results = "";
var ns = new Enumerator( samplelist.Navigate(siNextComponent) );
for ( ; ! ns.atEnd(); ns.moveNext() ) {
var nextsample = ns.item();
results += nextsample.Index + " ";
}
LogMessage( "The associated next samples are " + results );
results = "";
var ps = new Enumerator( samplelist.Navigate(siPreviousComponent) );
for ( ; ! ps.atEnd(); ps.moveNext() ) {
var prevsample = ps.item();
results += prevsample.Index + " ";
}
LogMessage( "The associated previous samples are " + results );
// Expected results:
//INFO : The associated first samples are 0 0 0 0
//INFO : The associated last samples are 23 23 23 23
//INFO : The associated next samples are 9 10 11 12
//INFO : The associated previous samples are 7 8 9 10 |