//
// This example shows how to retrieve the control points returned by
// PolygonMesh.Get2
//
var oRoot = Application.ActiveProject.ActiveScene.Root;
var oCube = oRoot.AddGeometry( "Cube","MeshSurface" );
// convert VB array to JScript array
var vbArgs = new VBArray(oCube.ActivePrimitive.Geometry.Get2());
var args = vbArgs.toArray();
// get the vertices
var vbArg0 = new VBArray(args[0]);
var vertices = vbArg0.toArray();
LogMessage("vertices: " + vertices.length );
for (i = 0; i < vertices.length/3; i++) {
LogMessage("vertices[" + i + "]: " + vertices[i*3] + "," + vertices[i*3+1] + "," + vertices[i*3+2]);
} |