Returns an Array of control
points for this NURBS component. Depending on the geometry type of
the 3D object, the returned array will be either 2- or
3-dimensional:
If the component is a NurbsCurve, a
2D array of [X,Y,Z,W] values is returned. If the component is a
NurbsSurface, a 3D array is
returned.
Note: The indexing to access an array element is different
depending on the language you use due to the fact that C++ arrays
are arranged in memory differently than safearrays.
- C++: [U] [V] [X,Y,Z,W]
- Scripting: [X,Y,Z,W] [V] [U]
In order for the memory mapping to be consistent between C++ and
scripting, the safearray indexing is always the reverse of the C++
indexing, as shown above.
// get accessor Object rtn = ControlPointCollection.Array; // set accessor ControlPointCollection.Array = Object; |
set oObject = ActiveSceneRoot.AddGeometry("Sphere","NurbsSurface") set oNurbsSurfaceMesh = oObject.ActivePrimitive.Geometry set oControlPoints = oNurbsSurfaceMesh.Surfaces(0).ControlPoints aControlPoints = oControlPoints.Array for i = lbound( aControlPoints, 1 ) to ubound( aControlPoints, 1 ) for j = lbound( aControlPoints, 2 ) to ubound( aControlPoints, 2 ) LogMessage aControlPoints(i,j,0) LogMessage aControlPoints(i,j,1) LogMessage aControlPoints(i,j,2) LogMessage aControlPoints(i,j,3) next next |