Hello,
This post to share some information about this hidden functionality.
In xGenerative Design every data consumed or produced by operations have types. Most of the operators need to be filled with an expected type. A Circle instead of an Integer will probably produce an error.
That said, xGenerative Design comes with an automatic type conversion mechanism to bring some flexibility. This mechanism is very useful since it allows to connect data that differs from expected type.
Here are the possible conversions:
Example:
Extrude operator expects a Vector as direction. Thanks to conversion it is possible to connect the direction input to a planar surface, it is automatically converted into a Vector for the operation to run.
Usage of Boolean to Integer conversion
This conversion is very useful to add conditional treatments. Boolean are produced by testing a condition (for example, is a number superior to another one) and consumed by Get Item, Select or Dispatch operators.
Get Item:
Dispatch for conditional branching:
A post dedicated to conditional branching using Dispatch and End Dispatch will come.
Conversion from Dimensions to Real and from Real to Dimensions
Currently, applying a numeric operator like + - * / to a Dimension (like a Length) outputs a Real number. In fact these operators only accept Reals as inputs, so a conversion from the original Dimension to a Real is performed. As Dimensions numbers depend on the units (10mm = 0.01m) conversion mechanism must always use the same units. To keep consistency conversion always uses mks units.
It can be surprising to discover that 1mm multiplied by 2 returns 0.002. But don’t worry, conversion from Real to Dimensions also uses mks units so using this 0.002 for an extrusion will produce a 2mm extrusion. The same applies for angles which are displayed as deg while mks is rad.
We know this is not practical to loose the unit for display and we are working on a better solution.
I hope all of this is useful and clear to you. Do not hesitate to ask questions in the comments.
