Skip to main content

indicatrix_formats/
lib.rs

1//! Readers and writers for gemstone faceting design file formats.
2//!
3//! `indicatrix-formats` is an independent, unaffiliated implementation of file formats originating with `GemCAD` (Robert
4//! Strickland's faceting-design software) and Gem Cut Studio. It is not
5//! produced or endorsed by either. Each format lives in its own module so that
6//! reading (or writing) a design never requires pulling in a particular renderer,
7//! database, or GUI toolkit:
8//!
9//! - [`asc`]: `GemCAD`'s `.asc` cutting-instructions text format. Read and write support,
10//!   verified against a real-world corpus of 5,759 files.
11//! - [`native`]: `apps/indicatrix-cut`'s own self-contained `.isdd` design file
12//!   ([`native::design`]; files saved as `.indicatrix` before are read the same way) --
13//!   the on-disk schema, TOML encode/decode and path rules for a text file that carries
14//!   a whole design, including state `.asc` itself has no field for. Converting to and from the actual
15//!   in-memory editor design is `indicatrix-cut-core`'s job, not this module's -- see
16//!   its own module doc comment for the split.
17//! - [`gcs`]: Gem Cut Studio's `.gcs` XML design format, per the format published in
18//!   the Gem Cut Studio User's Manual v1.1.0 (pp. 58-61). Read support (all 59 corpus
19//!   files), conversion to `.asc` cutting instructions, and an experimental writer.
20//! - [`gem`]: `GemCAD`'s native `.gem` binary save format. A structural decoder
21//!   (facet planes, tiers, labels, polygons, trailer, preform section) that frames
22//!   all 254 corpus files byte-exactly, plus conversion to `.asc` cutting
23//!   instructions that reproduces exact `.asc` exports to 6 decimals.
24//!
25//! Each format module pulls in only what it needs: [`asc`], [`gcs`], and [`gem`] have
26//! zero runtime dependencies, while [`native`] depends on `serde`/`toml` (its on-disk
27//! encoding) and `sha2` (its attachment hashes) -- see that module's own doc comment.
28//! Anything shared across more than one format's module belongs at this crate root
29//! rather than inside a single format module: the Windows-1252 text decoding the
30//! `.gem` and `.gcs` readers share lives in a private `encoding` module.
31
32/// `GemCAD`'s `.asc` cutting-instructions text format -- read and write.
33///
34/// See the module's own doc comment for the corpus this was verified against.
35pub mod asc;
36mod encoding;
37/// Gem Cut Studio's `.gcs` XML design format -- read, convert, experimental write.
38///
39/// See the module's own doc comment for the published format and the measured
40/// conventions.
41pub mod gcs;
42/// `GemCAD`'s native `.gem` binary save format -- structural decoder.
43///
44/// See the module's own doc comment for the layout and what is still open.
45pub mod gem;
46/// `apps/indicatrix-cut`'s own `.isdd` design file format (the earlier `.indicatrix`
47/// extension is still read).
48///
49/// Schemas, TOML encode/decode and path rules -- see the module's own doc comment for
50/// the format choice and its conventions.
51pub mod native;