pub struct CantPiece {
pub length: Scalar,
pub form: CantForm,
}Expand description
One piece of a CantLaw: a form over a plan length.
Fields§
§length: ScalarPlan length the piece covers. Positive and finite when well formed.
form: CantFormThe law over the piece’s own xi = s / length.
Implementations§
Source§impl CantPiece
impl CantPiece
Sourcepub fn linear(length: Scalar, start: Scalar, end: Scalar) -> Self
pub fn linear(length: Scalar, start: Scalar, end: Scalar) -> Self
A linear transition from start to end.
Sourcepub fn bloss(length: Scalar, start: Scalar, end: Scalar) -> Self
pub fn bloss(length: Scalar, start: Scalar, end: Scalar) -> Self
A Bloss transition: start + (end - start) (3 - 2 xi) xi^2.
Sourcepub fn helmert(length: Scalar, start: Scalar, end: Scalar) -> [Self; 2]
pub fn helmert(length: Scalar, start: Scalar, end: Scalar) -> [Self; 2]
A Helmert (two-parabola) transition from start to end over
length, as its two halves.
Over the whole transition, with x = s / length, the cant is
start + 2 dD x^2 up to x = 1/2 and end - 2 dD (1 - x)^2 after.
Each half is written in its own xi:
start + dD/2 xi^2, then start + dD/2 + dD xi - dD/2 xi^2.
Sourcepub fn cosine(length: Scalar, start: Scalar, end: Scalar) -> Self
pub fn cosine(length: Scalar, start: Scalar, end: Scalar) -> Self
A half-cosine transition from start to end.
Sourcepub fn sine(length: Scalar, start: Scalar, end: Scalar) -> Self
pub fn sine(length: Scalar, start: Scalar, end: Scalar) -> Self
A sine transition from start to end.
Sourcepub fn viennese_bend(length: Scalar, start: Scalar, end: Scalar) -> Self
pub fn viennese_bend(length: Scalar, start: Scalar, end: Scalar) -> Self
A Viennese bend from bank angle start to end, radians.
Sourcepub const fn about_rail(
length: Scalar,
rail: RailSide,
elevation: Scalar,
) -> Self
pub const fn about_rail( length: Scalar, rail: RailSide, elevation: Scalar, ) -> Self
A pivot piece rotating about the held rail, whose head stands
elevation above the profile (CantForm::AboutRail).