This topic provides a reference table for all automatic type conversions to vector, sorted by merit.
Direct Conversions
This section lists all direct
conversions to the vector type. A 'Direct' conversion indicates a relation between very related types, such as integers and numbers, or 2D and 3D points. Though note that even these conversions can fail due to out-of-bounds issues, or be narrowing due to reduction.
| From | Explanation |
|---|---|
| plane | Extracts the Z-axis direction vector of the plane. |
| point2 | Converts the point coordinates into vector components. |
| point3 | Converts the point coordinates into vector components. |
Fair Conversions
This section lists all fair
conversions to the vector type. A 'Fair' conversion indicates the types involved are closesly related in a data layout sense, though not necessarily in a conceptual sense. For example booleans and integers, or points and vectors. Although these conversions may fail or narrow, it is nevertheless considered decent practice to rely upon them in algorithms.
| From | Explanation |
|---|---|
| arc | Extracts the normal vector of the arc plane. |
| circle | Extracts the normal vector of the circle plane. |
| complex number | Maps real and imaginary components to X and Y vector components. |
| curve | Extracts tangent vector for linear curves, normal vector for planar curves. |
| ITuple | Convert coordinate tuples to vectors. |
| line | Creates a vector from the line's direction and length. |
| polyline | Linear polylines yield tangent vectors, planar polylines yield normal vectors. |
| rectangle | Extracts the normal vector of the rectangle plane. |
| triangle | Extracts the normal vector of the triangle plane. |
| view | Get the camera direction of the view. |
Plausible Conversions
This section lists all plausible
conversions to the vector type. A 'Plausible' conversion indicates a non-straightforward, but a still reasonable conversion between two types that share a salient quality, or where one is an obvious sub-type of the other. For example curves and intervals, or points and planes. Any plausible conversion can also be achieved through the explicit use of standard components.
| From | Explanation |
|---|---|
| angle | Creates a counter-clockwise vector in XY plane at the specified angle. |
| brep | Extracts the average surface normal vector. |
| colour | Maps (R,G,B) values to (X,Y,Z) vector components. |
| Colour (RGB) | Maps (R,G,B) values to (X,Y,Z) vector components. |
| integer | Creates a vector with the integer as the Z component. |
| integer (big) | Creates a vector with the integer as the Z component. |
| mesh | Computes the average of all vertex normals. |
| number | Creates a vector with the number as the Z component. |
| surface | Extracts the average surface normal vector. |
Strange Conversions
This section lists all strange
conversions to the vector type. A 'Strange' conversion indicates a peculiar, but occasionally sensible, translation between types. However, it is equally likely that the conversion was not intended and thus represents a mistake in the algorithm design, which is why this conversion level is the default for showing conversion warnings in the Grasshopper interface. Examples in this category include the conversion between colours and booleans, or between circles and triangles. Any strange conversion can also be achieved through the explicit use of standard components.
| From | Explanation |
|---|---|
| boolean | Converts false to zero vector, true to unit Z vector. |
| box | Extracts the diagonal vector of the box. |
| interval | Creates a vector with the interval length as Z component. |
| sphere | Extracts the axis direction vector of the sphere. |
| tube | Extracts the axis direction vector of the tube.. |