API Reference — dna/layers/Twist
TwistAxis
Select the axis along which a twist deformation is applied.
Why this exists
A raw integer or string axis specifier would allow out-of-range values that are only caught at runtime. TwistAxis restricts callers to exactly three valid choices — X, Y, or Z — enforcing correctness at compile time. As a scoped enum class, it prevents silent implicit conversion to int, making axis-passing code self-documenting and type-safe.
Fields
| Name | Type | Description |
|---|---|---|
X |
enumerator | The X axis. |
Y |
enumerator | The Y axis. |
Z |
enumerator | The Z axis. |
Construction
// Apply twist along the Y axis
dna::TwistAxis axis = dna::TwistAxis::Y;
Constraints
- Exactly three valid values:
X,Y,Z. - Scoped
enum class— implicit conversion tointis not allowed; usestatic_cast<int>if an integer representation is required.