Skip to main content

indicatrix_editor/
lib.rs

1//! GUI-free faceting-design editor logic shared by the desktop editor
2//! (`apps/indicatrix-cut`) and the wasm web app (`apps/indicatrix-web`), so both
3//! edit, validate, format and export a design identically -- see this crate's
4//! README for the full picture.
5//!
6//! - [`session`]: [`EditorSession`] -- the design, its undo/redo history (nudge
7//!   coalescing on caller-supplied timestamps), the multi-selection and the
8//!   generation/saved-generation pair behind "unsaved changes".
9//! - [`loading`]: the tier, index-shorthand, preform, New Design and material-form
10//!   parsers, and a design from bare `.asc` text.
11//! - [`material`] / [`material_lookup`]: the material combo, RI-source text, gear
12//!   presets and remap preview; the custom-over-built-in material lookup and the
13//!   nearest-built-in search.
14//! - [`view_model`]: plain-struct tier rows, index chips, cut-order rows,
15//!   yield/proportion texts and verdicts, and the validation banner.
16//! - [`optimize_view`]: Optimize's hint, result tables, preview design and weight
17//!   parser.
18//! - [`retarget`]: "Retarget for material" proposals and their view model.
19//! - [`cut_sheet`]: the printable cutting-sheet HTML and diagram PNG bytes.
20//! - [`guide`]: the guided walkthrough's steps and completion predicates.
21//! - [`solve_policy`]: when to solve synchronously, auto-solve eligibility, banner
22//!   texts, the cancellable solve and the plane-cap diagnosis.
23//! - [`scratch`], [`stale`], [`edit_intent`], [`templates`]: form re-seed change
24//!   detection, result staleness stamps, UI-intent coalescing, gallery cards.
25//! - [`manipulate`]: mouse-driven direct manipulation -- the pick-frame projection, the
26//!   angle/depth/index drag handles of the selected facet, the Slice tool's plane
27//!   snapping, the tiers a drag drags along, and the hint and toast wording.
28//! - [`files`]: file kinds by name and content (`.isdd` and the earlier `.indicatrix` are
29//!   design files), `.gem`/`.gcs` conversion to `.asc` text, and the desktop's default save
30//!   names.
31//! - [`tier_save`]: which `Edit` a parsed tier form becomes (insert after the selection,
32//!   modify in place, the depth / girdle-thickness / table-width target batch).
33//! - [`printed_proportions`]: the design settings' five printed figures (Vol/W^3, L/W,
34//!   C/W, P/W, H/W) from their text fields.
35//! - [`snapshot`]: "Compare to snapshot"'s rows -- the tier-by-tier diff of a remembered
36//!   design against the design now.
37//! - [`raw_text`]: the design's cutting instructions as editable `.asc` text -- generating
38//!   it, reading an edited copy back with line-numbered problems, merging it into the design
39//!   as one undoable edit with a summary of what is lost, and a plain line diff.
40//! - [`sweep`]: "Angle Sweep" -- one tier's angle over a range, every angle solved and
41//!   scored, as rows, a chart and CSV text.
42//! - [`cutting_mode`]: the cutting instructions as one page per step -- the steps in sheet
43//!   order with a stable key and a values fingerprint each, the done marks and index ticks
44//!   (a mark whose step changed since reads "changed", not "done"), the page texts and the
45//!   index wheel with a step's indices marked.
46//! - [`slider_ranges`]: the sliders beside the main number fields -- the angle ranges per side
47//!   and material, the marked pavilion band over the critical angle, the "Typical" presets
48//!   with their reasons, the Preform ranges, and the text a slider writes and reads back.
49//! - [`metric_deltas`]: the compare window's optical figures of two stones, the table rows
50//!   beside them and a few plain sentences about what changed, with named noise thresholds
51//!   so a change lost in the measurement noise reads "about the same".
52//! - [`verdict`]: the overall Good / Check / Problem verdict for the open design -- the
53//!   reasons behind it with named thresholds, and a validated one-edit "Fix" for each
54//!   reason where a safe tool exists (snap to the gear, remove cut-away facets, move a tier
55//!   behind the one it meets, steepen a windowing pavilion about its girdle edge, add a
56//!   table).
57//!
58//! No GUI toolkit types, no clock and no filesystem anywhere in this crate, and no
59//! threads except the angle sweep's worker threads, which are compiled out of a
60//! `wasm32-unknown-unknown` build (it runs the same loop inline there), so it links
61//! unchanged into that build. Each UI maps
62//! the plain structs to its own row types, and supplies its own clock and threads
63//! (or Workers).
64
65pub mod cut_sheet;
66pub mod cutting_mode;
67pub mod deep_solve;
68pub mod edit_intent;
69pub mod files;
70pub mod guide;
71pub mod lch_color;
72pub mod loading;
73pub mod manipulate;
74pub mod material;
75pub mod material_lookup;
76pub mod metric_deltas;
77pub mod optimize_view;
78pub mod printed_proportions;
79pub mod raw_text;
80pub mod retarget;
81pub mod scratch;
82pub mod session;
83pub mod slider_ranges;
84pub mod snapshot;
85pub mod solve_policy;
86pub mod stale;
87pub mod sweep;
88pub mod templates;
89pub mod tier_save;
90pub mod variants;
91pub mod verdict;
92pub mod view_model;
93
94pub use manipulate::{
95    DragStart, DragValue, FacetFrame, HandleKind, HandleLayout, ScreenPoint, ScreenSize, SliceSide,
96    SnapMode, SnappedFacet,
97};
98pub use session::{
99    EditChange, EditorSession, HistorySnapshot, JumpFailure, JumpOutcome, NudgeOutcome, PinOutcome,
100};