Skip to main content

cadmpeg_codec_step/
lib.rs

1// SPDX-License-Identifier: Apache-2.0
2#![cfg_attr(test, allow(clippy::unwrap_used))]
3//! Reads and writes [`cadmpeg_ir::CadIr`] documents as ISO 10303-21 STEP Part
4//! 21 exchange structures for AP203, AP214, and AP242.
5//!
6//! <!-- generated: capability step -->
7//! Support: L9 ([ladder](https://github.com/cadmpeg/cadmpeg/blob/main/docs/format-support.md#step-part-21)).
8//! <!-- /generated: capability step -->
9//!
10//! [`StepCodec`] emits the application protocol selected through
11//! [`cadmpeg_ir::codec::write::Encoder::plan`]. It writes product and representation context,
12//! connected exact shape, product occurrences, tessellation, presentation,
13//! and PMI when the target schema carries those domains.
14//!
15//! # Export workflow
16//!
17//! Construct or decode a [`cadmpeg_ir::CadIr`], configure [`StepCodec`], and
18//! select a target from the codec's encoder catalog. Planning validates the
19//! request and returns the bytes with the export report.
20//!
21//! Review [`cadmpeg_ir::report::export::ExportReport::losses`] before retaining output. Opaque
22//! records, source attributes, unsupported
23//! procedural definitions, and target-schema incompatibilities are reported or
24//! rejected rather than silently discarded. Body and face colors become
25//! per-face `STYLED_ITEM` presentation; direct geometry and tessellation
26//! bindings retain their native presentation targets.
27//!
28//! Coordinates are emitted unchanged under a millimetre length-unit context.
29//! Callers must convert non-millimetre geometry before export. Analytic curves
30//! and surfaces map to their corresponding STEP carriers. Rational and
31//! non-rational NURBS use the `*_WITH_KNOTS` entities.
32
33mod archive;
34mod codec;
35mod dialect;
36mod export;
37mod geometry;
38mod ids;
39mod lex;
40mod loss;
41mod options;
42mod parse;
43mod reader;
44mod signature;
45mod strings;
46mod writer;
47
48#[doc(hidden)]
49pub mod fuzz;
50
51pub use codec::StepCodec;
52pub use options::{StepSchema, StepWriteOptions};
53
54#[cfg(test)]
55mod golden_tests;
56#[cfg(test)]
57mod integration_tests;
58#[cfg(test)]
59mod test_support;