1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
//! Canonical frame readers for analytic surface carriers.
//!
//! The little-endian analytic surfaces (`e5` and `zero_entity`) stamp out the
//! same cylinder/cone/torus field sequences at different base offsets. Each
//! family positions a [`Cursor`] over its record payload and calls one of the
//! readers here; the reader decodes the canonical field sequence, builds the
//! [`SurfaceGeometry`] variant, and returns the magnitude-bearing scalars so
//! the caller can apply its own validation guard (the guards differ per
//! family and must stay at the call site).
//!
//! These readers are little-endian. The big-endian inline analytic block
//! decoded by `crate::families::standard::records::decode_curved` has a different layout, endianness,
//! and axis reconstruction, and keeps its own reader.
use SurfaceGeometry;
use Point3;
use crateCursor;
/// Cylinder from an already-decoded `origin` plus a direction frame.
///
/// Reads two direction rows `u`, `v` then the radius from `c`, which must be
/// positioned at the first row (the row block is contiguous in every family,
/// but its offset relative to `origin` is not, so the caller reads `origin`
/// and positions `c` itself). The axis is `u × v` normalised and the
/// zero-azimuth reference is `u` normalised; both fail on a degenerate frame.
///
/// The returned radius is finite but otherwise unvalidated: callers apply
/// their own magnitude guard.
pub
/// Cone from origin, reference direction, axis, a stored polar angle, and a
/// radius, in that canonical order.
///
/// `c` is positioned at the origin. The reference direction immediately
/// follows the origin; a 24-byte block separates it from the axis. The stored
/// angle is the complement of the half-angle: `half_angle = π/2 − stored`.
///
/// Returns the built [`SurfaceGeometry::Cone`] together with the radius and
/// derived half-angle so callers can apply their own guard. Both are finite.
pub
/// Torus from center, reference direction, axis, major radius, and minor
/// radius, in that canonical order.
///
/// `c` is positioned at the center. The field layout matches [`cone_ozra`]:
/// the reference direction follows the center, a 24-byte block separates it
/// from the axis, and the two radii follow the axis.
///
/// Returns the built [`SurfaceGeometry::Torus`] together with the major and
/// minor radii so callers can apply their own guard. Both are finite.
pub