Arrays of Points

Many RhinoScript methods either require as an argument or return as a result an array of 3-D points.  Arrays of 3-D points are zero-based, one-dimensional arrays of 3-D points (which in turn are zero-based, one-dimensional arrays of X, Y, and Z coordinate values).  Arrays of 3-D points can be constructed in a number of ways.  For example,

Dim arrPointCloud(4)

arrPointCloud(0) = Array(0.0, 0.0, 0.0)

arrPointCloud(1) = Array(1.0, 2.0, 3.0)

arrPointCloud(2) = Array(5.0, 8.0, 9.0)

arrPointCloud(3) = Array(4.0, 7.0, 2.0)

arrPointCloud(4) = Array(8.0, 5.0, 6.0)

Also, representing arrays of 3-D points as a one-dimensional array instead of a multi-dimensional array, makes it easy to repeat a group of statements for each element in the array .  For example,

Dim arrPoint

For Each arrPoint in arrPointCloud

' Do something with arrPoint