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
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
//! [`Scene`] — the convenience navigation layer over the raw [`StepModel`].
//!
//! The generated model is faithful but tedious to walk by hand (arenas and
//! reference enums); [`model.scene()`](StepModel::scene) wraps it in
//! lightweight `Copy` handles where forward *and* backward moves are plain
//! `handle.method()` calls. The backward index ([`RefGraph`]) is built
//! lazily on the first backward move — a forward-only import never pays
//! for it.
//!
//! The core is enumeration plus scoped navigation. Model-level
//! `all_<type>()` iterators ([`all_solids`](Scene::all_solids),
//! [`all_products`](Scene::all_products), …) enumerate one type across the
//! whole file; each handle then navigates its own neighbourhood
//! (`solid.faces()`, `face.surface()`, `occurrence.definition()`, …).
//! Coverage spans b-rep geometry ([`geometry`]), the product/assembly tree
//! and PLM metadata ([`product`]), display meshes ([`mesh`]), PMI ([`pmi`]),
//! presentation ([`presentation`]), units ([`units`]), and the NURBS views
//! ([`nurbs`]).
//!
//! Kinds outside the handled set come back as `*Kind::Other`; what a handle
//! cannot resolve into the shape it exposes lands in [`Scene::warnings`],
//! never silently skipped.
//!
//! Anything beyond the handles is reached through the raw model via
//! [`Scene::model`].
//!
//! ```no_run
//! let source = std::fs::read("part.step").unwrap();
//! let (model, _report) = step_io::read(&source).unwrap();
//! let scene = model.scene();
//!
//! // Assembly: definitions and their placed occurrences, top-down. Keep the
//! // placement on the instance — do not bake it into shared geometry.
//! for def in scene.root_definitions() {
//! for occ in def.occurrences() {
//! let _child = occ.definition(); // recurse from here
//! let _matrix = occ.transform().and_then(|t| t.matrix());
//! }
//! }
//!
//! // Geometry: solid → face → surface, bound → edge → curve → vertex.
//! // Presentation (colour / layer / visibility) rides on the same handles.
//! for solid in scene.all_solids() {
//! let _colour = solid.color();
//! for face in solid.faces() {
//! let _surface = face.surface().kind(); // analytic form; `Other` beyond the set
//! let _patch = face.to_nurbs(); // the NURBS view, on demand
//! for bound in face.bounds() {
//! for (edge, _forward) in bound.oriented_edges() {
//! let _curve = edge.curve().kind();
//! let _ends = (edge.start(), edge.end());
//! }
//! }
//! }
//! }
//!
//! // Display meshes, linked back to the b-rep solid they render.
//! for group in scene.all_mesh_groups() {
//! let _brep = group.solid();
//! for mesh in group.meshes() {
//! let (_pts, _tris) = (mesh.points(), mesh.triangles());
//! }
//! }
//!
//! // PMI: dimensions, tolerances, and the annotated features.
//! for dim in scene.dimensions() {
//! let (_kind, _value) = (dim.kind(), dim.value());
//! }
//! for tol in scene.tolerances() {
//! let (_kind, _datums) = (tol.kind(), tol.datums());
//! }
//! for feat in scene.features() {
//! let _geometry = feat.geometry(); // the faces/edges it annotates
//! }
//!
//! // Product metadata: versions, approvals, documents, people.
//! for product in scene.all_products() {
//! let _versions = product.versions();
//! let _approvals = product.approvals();
//! let _documents = product.documents();
//! let _people = product.contributors();
//! }
//!
//! // Coordinates come in the file's units — scaling is the consumer's job.
//! let _to_si = scene.units().length.map(|u| u.to_si);
//! for w in scene.warnings() {
//! eprintln!("step-io: {w}");
//! }
//! ```
use ;
use crateRefGraph;
use crateStepModel;
pub use ;
pub use ;
pub use ;
pub use Rgb;
pub use ;
pub use ;
/// A `Copy` reference bundle handed to every handle: the model, the lazy reverse
/// index, and the scene's warning log. All borrows share one lifetime (the scene
/// borrow), so handles stay single-lifetime.
pub
/// The read API entry point: a [`StepModel`] paired with its (lazy) [`RefGraph`]
/// and a log of navigation warnings.