grasshopper2 Rhinorhino3d.com
TopicType Reference
X → Boolean Conversions

This topic provides a reference table for all automatic type conversions to boolean, sorted by merit.

Fair Conversions

This section lists all fair Fair conversions to the boolean 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
angle Returns true for all angles except those near zero.
integer Returns true for all integers except zero.
integer (big) Returns true for all integers except zero.
number Returns true for all numbers except those near zero.

Plausible Conversions

This section lists all plausible Plausible conversions to the boolean 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
complex number Returns true for all complex numbers except those near zero.
interval Returns true for all intervals except near-empty ones.

Strange Conversions

This section lists all strange Strange conversions to the boolean 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
arc Returns true for closed curves, false for open curves.
box Solid shapes become 'true', open shapes become 'false'.
brep Returns true for closed breps, false for open breps.
circle Returns true for closed curves, false for open curves.
colour Returns true for all colors except black.
Colour (RGB) Returns true for all colors except black.
curve Returns true for closed curves, false for open curves.
line Returns true for closed curves, false for open curves.
mesh Returns true for closed meshes, false for open meshes.
polyline Returns true for closed curves, false for open curves.
rectangle Returns true for closed curves, false for open curves.
sphere Solid shapes become 'true', open shapes become 'false'.
SubD Returns true for closed SubDs, false for open SubDs.
surface Returns true for closed surfaces, false for open surfaces..
triangle Returns true for closed curves, false for open curves.
tube Solid shapes become 'true', open shapes become 'false'.
vector Returns true for all vectors except those with near-zero length.