3-D points are represented as zero-based, one-dimensional arrays that contain three numbers. These three number represent to the X, Y and Z coordinate values of the point. A 3-D point can be constructed in a number of different ways. For example,
Dim arrPoint1, arrPoint2(2)
arrPoint1 = Array(1.0, 2.0, 3.0)
arrPoint2(0) = 1.0
arrPoint2(1) = 2.0
arrPoint2(2) = 3.0
Like 3-D points, RhinoScript represents a single 2-D point as zero-based, one-dimensional array. The difference being that 2-D points contain only X and Y coordinate values.
RhinoScript contains a number of methods to manipulate points. See Points and Vectors for details.
Like 3-D points, 3-D vectors are also represented as zero-based, one-dimensional array that contain three numbers. These three number represent to the X, Y and Z coordinate values of the vector. Note, unlike points, vectors define magnitude (length) and direction, not position. A 3-D vector can be constructed in a number of different ways. For example,
Dim arrVector1, arrVector(2)
arrPoint1 = Array(1.0, 0.0, 0.0) ' Unit world x-axis vector
' Unit world y-axis vector
arrPoint2(0) = 0.0
arrPoint2(1) = 1.0
arrPoint2(2) = 0.0
Vectors can also be created from two 3-D points using the VectorCreate method.
RhinoScript contains a number of methods to manipulate vectors. See Points and Vectors for details.
Several 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
Next
3-D lines, or chords, are represented as zero-based, one-dimensional arrays that contain two elements: the starting 3-D point and the ending 3-D point. A 3-D line can be constructed in a number of different ways. For example,
Dim arrStartPoint, arrEndPoint, arrLine
arrStartPoint = Array(1.0, 2.0, 3.0)
arrEndPoint = Array(4.0, 5.0, 6.0)
arrLine = Array(arrStartPoint, arrEndPoint)
RhinoScript contains a number of methods to manipulate lines. See Lines and Planes for details.
Several RhinoScript methods either require as an argument or return as a result a plane. Planes are represented as zero-based, one-dimensional array containing four elements: the plane's origin (3-D point), the plane's X axis direction (3-D vector), the plane's Y axis direction (3-D vector), and the plane's Z axis direction (3-D vector).
Planes can be constructed in a number of ways. For example,
Dim arrPlane(3)
arrPlane(0) = Array(0.0, 0.0, 0.0) ' origin point
arrPlane(1) = Array(1.0, 0.0, 0.0) ' x-axis vector
arrPlane(2) = Array(0.0, 1.0, 0.0) ' y-axis vector
arrPlane(3) = Array(0.0, 0.0, 1.0) ' z-axis vector
Planes can also be created using the PlaneFromFrame, PlaneFromNormal, and PlaneFromPoints methods.
RhinoScript contains a number of methods to manipulate planes. See Lines and Planes for details.
Rhino can create and manipulate a number of geometric objects, including points, point clouds, curves, surfaces, b-reps, meshes, lights, annotations, and references. Each object in the Rhino document is identified by a globally unique identifier, or GUID, that is generated and assigned to objects when they are created. Because identifiers are saved in the 3DM file, an object's identifier will be the same between editing sessions.
To view an object's unique identifier, use Rhino's Properties command.
For convenience, RhinoScript returns object identifiers in the form of a string. For example, an object's identifier will look something like the following:
F6E01514-3264-4598-8A07-A58BFE739C38
The majority of RhinoScript's object manipulation methods require one or more object identifiers to be acquired before the method can be executed.