Model Expressions
Things change when an expression consists of models instead of just values. We call this a model expression:
std::geo2d::Rect(1cm) - std::geo2d::Circle(radius = 3mm);
In this expression which consists of a subtraction operation of the results of
two calls to Rect and Circle.
Output
:
Building a group (using curly braces) of both operands and applying the
builtin method subtract to it is equivalent to the above code:
use __builtin::ops::subtract;
{
std::geo2d::Rect(1cm);
std::geo2d::Circle(radius = 3mm);
}.subtract();
Output
:
The following operations can be applied to 2D or 3D models:
| Operator | Builtin Operation | Description |
|---|---|---|
- | __builtin::ops::subtract | Geometrical difference |
| | __builtin::ops::union | Geometrical union |
& | __builtin::ops::intersect | Geometrical intersection |