to_transforms ?mode ?scale_ez ?twist_ez ?scale ?twist t
Generate list of transformations that can be applied to three-dimensional vectors (V3.t via Affine3.transform) or shapes, to move them along the path t (intended to be applied to the vector/shape from its original position each time). Note that the transforms are generated assuming the shape is centred on the origin, and for the purposes of alignment to the beginning of the path and scaling/twisting, laying flat on the XY plane.
When mode is `Auto | `Align _ | `NoAlign (default it `Auto), tangents are used to estimate appropriate rotations for each translation, using quaternion alignment from tangent to tangent, accumulating rotation along the way. In the case of `Auto, some effort is made to automatically apply an alignment rotation towards the first tangent of the path before each transformation such that the orientation of the shape being swept will be consistent and sensible, though some manual rotation of the shape before sweeping along the generated transforms may be necessary to get the desired result.
`Align v and `NoAlign follow the same quaternion accumulation strategy along the path t, however they differ from `Auto in their handling of pre-alignment transformations. With `Align v, the vector v will be used to align the assumed shape normal of (v3 0. 0. 1.) to, while `NoAlign will skip the alignment step entirely (likely desirable if the intention is to sweep a shape not laying on the XY plane).
Setting mode = `Euler will use euler rotations instead, which can have results more in line with expectations in some scenarios (helical-like paths for example, though Mesh.helix_extrude may be a better fit in that case), but fail in others. For instance, `Euler can generate an abrupt when the path tangent is exactly vertical.
If provided, scale and twist, specify scaling and rotation to be applied along the path increasing up to the provided value by the end. Scaling/twisting proceeds linearly by default, unless the corresponding _ez parameters are provided to describe the desired eased transition (see scaler and twister).