axiolid_curve/seam.rs
1//! Which side of a seam a position on it is read from (#263).
2//!
3//! A composite curve -- a polyline, an arc-length chain, an elevated curve
4//! whose profile is piecewise, a banked curve whose cant law is -- is made
5//! of pieces laid end to end. Where two pieces meet, the position is shared
6//! but the tangent, or the roll of a banked section, may jump: the curve
7//! has two frames there. Every evaluator in this workspace that picks a
8//! piece by a distance or a parameter takes the piece that STARTS at the
9//! seam ([`ElevationLaw::piece_at`](crate::ElevationLaw::piece_at),
10//! [`Chain2::piece_at`](crate::Chain2::piece_at),
11//! [`CantLaw`](crate::CantLaw), a polyline's spans): that is
12//! [`SeamSide::Outgoing`], the default. [`SeamSide::Incoming`] reads the
13//! piece that ENDS there instead, as some authoring rules require (the
14//! previous segment's tangent governs at a seam).
15//!
16//! At the curve's own start and end only one piece exists, and both sides
17//! read it.
18
19/// The piece a position exactly on a seam is read from.
20#[non_exhaustive]
21#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Default)]
22#[cfg_attr(
23 feature = "serde",
24 derive(serde::Serialize, serde::Deserialize),
25 serde(deny_unknown_fields)
26)]
27pub enum SeamSide {
28 /// The piece that starts at the seam: the frame the curve is about to
29 /// take. What every evaluator reads by default.
30 #[default]
31 Outgoing,
32 /// The piece that ends at the seam: the frame the curve arrived with.
33 Incoming,
34}