This topic provides a reference table for all automatic type conversions to number, sorted by merit.
Direct Conversions
This section lists all direct
conversions to the number type. A direct conversion indicates a relation between very related types. Though note that even these conversions can fail due to out-of-bounds issues, or they may narrow due to reduction. Examples in this category include conversions from circles to curves, or from integers to numbers.
| From | Explanation |
|---|---|
| complex number | Extracts the real component of a complex number. |
| integer | Converts the integer to a decimal number. |
| integer (big) | Converts the integer to a decimal number. |
Fair Conversions
This section lists all fair
conversions to the number type. A fair conversion indicates the types involved are closely related in a data layout sense, though not necessarily in a conceptual sense. Although these conversions may fail or narrow, it is nevertheless considered decent practice to rely upon them. Examples in this category include conversions from booleans to integers, or from curves to intervals.
| From | Explanation |
|---|---|
| angle | Converts the angle value into a number of degrees. |
| arc | Measures the length of the arc. |
| B-Rep | Measures the total surface area. |
| boolean | Converts false to zero, true to one. |
| box | Measures the surface area of the box. |
| circle | Measures the circumference of the circle. |
| curve | Measures the length of the curve. |
| interval | Measures the length of the interval. |
| line | Measures the length of the line. |
| mesh | Measures the surface area of the mesh. |
| polyline | Measures the length of the polyline. |
| rectangle | Measures the perimeter of the rectangle. |
| sphere | Measures the surface area of the sphere. |
| SubD | Measures the surface area of the SubD. |
| surface | Measures the surface area of the surface. |
| triangle | Measures the perimeter of the triangle. |
| tube | Measures the surface area of the tube. |
| vector | Measures the length of the vector. |
Plausible Conversions
This section lists all plausible
conversions to the number type. A plausible conversion indicates a non-straightforward, but still a reasonable conversion between two types sharing a salient quality, or where one is an obvious sub-type of the other. Any plausible conversion can also be achieved through the explicit use of standard components. Examples in this category include conversions from points to planes, or from boxes to rectangles.
| From | Explanation |
|---|---|
| colour | Measures the luminance value of the colour. |
| Colour (RGB) | Measures the luminance value of the colour. |
Strange Conversions
This section lists all strange
conversions to the number 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 signals a mistake in the algorithm design, which is why this conversion level is the default for showing conversion warnings. Examples in this category include the conversion from decimal numbers to languages, or from views to meshes. Any strange conversion can also be achieved through the explicit use of standard components.
| From | Explanation |
|---|---|
| point2 | Measures the distance from the origin to the 2D point. |
| point3 | Measures the distance from the origin to the point. |
Weird Conversions
This section lists all weird
conversions to the number type. A weird conversion indicates an exotic relationship between types, which is almost certainly unintended on the part of the user. However, very occasionally these conversions make sense and allow the user to avoid the use of several components to achieve the same result. No standard conversion currently falls into this category.
| From | Explanation |
|---|---|
| plane | Measures the distance from the world origin to the plane origin. |