|
| | smoothstep (float x) |
| Segment | Straight (float length) |
| Segment | Twist (float angle_deg, float length, float ramp=0.0) |
| Segment | Bend (float angle_deg, float radius, float ramp=0.0, bool hard=False) |
| Segment | Release (float length, float kappa_n=0.0, float kappa_g=0.0, float tau=0.0) |
| np.ndarray | _rhs (np.ndarray y, np.ndarray omega) |
| np.ndarray | _orthonormalize (np.ndarray y) |
| np.ndarray | _rk4 (np.ndarray y, Segment seg, float x0, float h) |
| np.ndarray | _exact (np.ndarray y, np.ndarray omega, float h) |
Lead (terminal) sections defined intrinsically by their strip curvatures.
A lead is a chain of segments. Each segment prescribes the three curvature
parameters of the strip along its arc length x in [0, L]
omega(x) = ( tau(x), kappa_g(x), kappa_n(x) )
and the space curve together with its frame follows by integrating the
generalized Frenet-Serret equations for strips (Russenschuck Eq. (19.9))
r' = T, T' = kappa_n n - kappa_g b, n' = -kappa_n T + tau b, b' = kappa_g T - tau n
from the state at the end of the winding. Because the frame is *integrated*
rather than derived from v x a, it is defined and continuous on straight
sections, through inflection points and across the transition into the bend.
The derivatives v, a, b of the position are then exact expressions in the
frame and the curvature functions:
v = T
a = T' = kappa_n n - kappa_g b
b = T'' = kappa_n' n + kappa_n n' - kappa_g' b - kappa_g b'
Sign conventions (positive amplitudes):
kappa_n turns the tangent towards +n ("easy way" bend about b)
kappa_g turns the tangent towards -b ("hard way" bend about n)
tau rotates n towards +b (right-handed twist about T)
Each amplitude is multiplied by a profile P(x):
shape = "plateau": rises smoothly from 0 to 1 over the first `ramp` length
units and falls back to 0 over the last `ramp`
(ramp = 0: constant curvature -> circular arc / helix / plain twist)
shape = "fade": 1 -> 0 over the whole segment (used to release the winding curvature)
shape = "rise": 0 -> 1 over the whole segment
The quintic smoothstep makes the curvatures C^2, so frame, curvature and jerk
are continuous everywhere. On intervals with constant curvature the frame and
position are advanced with the closed-form matrix exponential (exact to
round-off); on ramps a fourth-order Runge-Kutta scheme with a small step is
used.
| np.ndarray _exact |
( |
np.ndarray | y, |
|
|
np.ndarray | omega, |
|
|
float | h ) |
|
protected |
Closed-form step for constant body-frame Darboux vector omega = (tau, kappa_g, kappa_n).
F(h) = F0 exp(h K), r(h) = r0 + F0 ( int_0^h exp(x K) dx ) e_1, K = [omega]_x,
with exp(x K) = I + sin(w x) K^ + (1 - cos(w x)) K^^2 (Rodrigues), w = |omega|.