NewScene( "", false );
// Get a nurbs curve object
var obj = ActiveSceneRoot.AddGeometry( "Arc", "NurbsCurve" );
FreezeObj( obj );
var crvlist = obj.ActivePrimitive.Geometry;
var crv = crvlist.Curves(0);
// Get a complete data description of the arc
var VBdata = crv.Get2( siSiNurbs ); // returns a safearray
var data = VBdata.toArray(); // convert the safearray to a JS array
// For clarity, extract and store the data in separate variables
var crtlvertices = data[0];
var knots = data[1];
var isclosed = data[2];
var degree = data[3];
var parameterization = data[4];
// Translate every controlvertex of the new curve from 5 in x
for ( var i=0; i<crtlvertices.length; i=i+3 ) {
crtlvertices[i] = crtlvertices[i] + 5;
}
// Add a new nurbs curve using the modified data description
var newcrv = crvlist.AddCurve( crtlvertices, knots, isclosed, degree, parameterization );
// Check to see if the new curve is the last curve in the list
var prevcrv = newcrv.Navigate( siLastComponent );
LogMessage( prevcrv.IsEqualTo(newcrv) );
// Expected result:
//INFO : True |