Expand description
indicatrix-cut-core is the editor-core library for a faceting-design editor: it owns the
preform, the editable cutting instructions, undo/redo, and live-solid validation –
everything a UI needs to answer “what does this schedule look like right now,
and is it a real stone” without itself touching a window, a database, or a
renderer.
§Why this is a separate crate from the GUI
Undo/redo is business logic, not view logic: it has to be correct independent of
whatever widget toolkit drives it, and testable without a window (see edit’s
module doc comment). Two dependencies only – indicatrix for geometry and
[indicatrix-formats] for .asc read/write and the .isdd design file’s own
on-disk format – so apps/indicatrix-cut can wire a UI on top of it without this
crate ever needing to know Slint, wgpu, or SQLite exist.
§The pieces
preform: the physical rough a design’s facets are cut from – always a closed plane set, so a brand-new design already renders as a real solid.design:design::Designpairs apreform::PreformSpecwithdesign::ConstraintTiers – authored meet constraints, not recorded masts.Design::solvederives masts on demand and builds the full plane arrangement feedingindicatrix::geometry::stone_metrics::build_solid_mesh.edit:edit::Edit(add/remove/modify a tier or its constraint, or replace the preform) andedit::History, a command/inverse-pair undo/redo stack over aDesign.resolve:resolve::resolve_after_editre-solves only the tiers an edit could actually change, instead ofDesign::solve’s whole-design re-solve.orbit:orbit::orbit_unitsderives a tier’s symmetry-generated facet groups from schedule metadata (never stored, always recomputed), and theDesign::*_orbit_memberhelpers keep membership changes orbit-consistent by construction.manufacturability: four checks (vanishing facets, undersized facets, gear-quantization error, out-of-order meets) over an already-solveddesign::Design– warnings only, never silently corrected.material:material::MaterialSelectionand a specific-gravity lookup table;material::MaterialSelection::resolveanddesign::Design::effective_refractive_indexgive a design one real refractive index every consumer can derive from.optics_hints: pure critical-angle math shared by the material-retarget path and the solid preview’s risk overlay.yield_metrics: the real-unit binding (yield_metrics::mm_per_unit) and the figures built on it – exact volumetric yield, an estimated carat weight, and the design-bigger-than-its-rough check.native: converts aDesignto and from the self-contained.isdddesign file (design state.aschas no field for at all; files saved as.indicatrixbefore are read the same way), and builds the catalogue.asctext a save stores next to it (native::catalogue_asc). The on-disk document itself – schema, TOML encode/decode, path rules – lives inindicatrix_formats::native; this module owns only the conversions to and fromDesign.optimize: the objective (optimize::evaluate_objective) andoptimize::optimize_design, a deterministic coordinate search over a design’s free facet angles that never moves a pinned tier, never proposes geometry that fails to close, and never regresses a manufacturability warning.cutting_sheet:design::Design::cutting_sheetbuilds acutting_sheet::CuttingSheet(every tier in cutting order, with angle, indices, solved mast and a printable meet instruction) from a design and its already-solved masts;design::Design::facet_meetsandcutting_sheet::diff_tiersare the companion per-facet and before/after reads built alongside it.
§Determinism
Every public operation here is a plain, total-order computation over the
caller-supplied schedule/preform – no HashMap/HashSet in any decision path, no
wall-clock or thread-count dependence: two runs over identical input produce
byte-identical output. optimize::optimize_design is the one place this crate
takes a seed at all – identical seed, identical result, always caller-supplied,
never derived from wall-clock time.
Re-exports§
pub use cutting_sheet::ConcaveRowInfo;pub use cutting_sheet::ConcaveTierDelta;pub use cutting_sheet::CutSheetRow;pub use cutting_sheet::CuttingSheet;pub use cutting_sheet::SHEET_NAME_WIDTH;pub use cutting_sheet::TierDelta;pub use cutting_sheet::diff_concave_tiers;pub use cutting_sheet::diff_tiers;pub use cutting_sheet::format_sheet_index;pub use cutting_sheet::format_sheet_indices;pub use design::ConstraintTier;pub use design::Design;pub use design::DesignSolveError;pub use design::DesignTierCodes;pub use design::FreshDesignSpec;pub use design::MissingAnchor;pub use design::ScheduleMeta;pub use design::SolveMismatch;pub use design::StoneRenderEffects;pub use design::TargetResolveError;pub use design::TierFrosting;pub use design::TierId;pub use design::TierLabelInfo;pub use design::TierTarget;pub use design::compute_tier_labels;pub use design::convert_legacy_facet_name;pub use design::is_legacy_123_abc;pub use design::name_indicates_pavilion;pub use edit::Edit;pub use edit::EditError;pub use edit::History;pub use edit::HistoryEntry;pub use edit::JumpError;pub use edit::RemapRounding;pub use edit::ScheduleState;pub use edit::remap_ratio;pub use manufacturability::DEFAULT_MIN_FACET_AREA_FRACTION_OF_W2;pub use manufacturability::ManufacturabilityWarning;pub use manufacturability::check_manufacturability;pub use manufacturability::degenerate_suspects;pub use material::BuiltinMaterials;pub use material::MaterialCatalogue;pub use material::MaterialEntry;pub use material::MaterialKind;pub use material::MaterialLookup;pub use material::MaterialSelection;pub use material::ResolvedMaterial;pub use material::SpecificGravity;pub use material::built_in_refractive_index;pub use material::built_in_specific_gravity;pub use native::CatalogueAsc;pub use native::SaveError;pub use native::catalogue_asc;pub use optics_hints::Risk;pub use optics_hints::critical_angle_deg;pub use optics_hints::crown_window_margin_deg;pub use optics_hints::crown_windowing_risk;pub use optics_hints::retarget_angle_deg;pub use optics_hints::tier_margin_deg;pub use optics_hints::windowing_risk;pub use optimize::AngleChange;pub use optimize::CANONICAL_LIGHTING_PRESET;pub use optimize::MastChange;pub use optimize::ObjectiveComponents;pub use optimize::ObjectiveFidelity;pub use optimize::ObjectivePreset;pub use optimize::ObjectiveWeights;pub use optimize::OptimizeCandidate;pub use optimize::OptimizeConfig;pub use optimize::OptimizeOptions;pub use optimize::OptimizeOutcome;pub use optimize::OptimizeResult;pub use optimize::SearchHooks;pub use optimize::ShapeTarget;pub use optimize::ToneGoal;pub use optimize::apply_optimize_candidate;pub use optimize::apply_optimize_outcome;pub use optimize::apply_optimize_result;pub use optimize::evaluate_objective;pub use optimize::evaluate_objective_geom_under;pub use optimize::evaluate_objective_geom_under_threaded;pub use optimize::evaluate_objective_threaded;pub use optimize::evaluate_objective_under;pub use optimize::evaluate_objective_under_threaded;pub use optimize::evaluate_objective_with_tone;pub use optimize::evaluate_objective_with_tone_geom_under_threaded;pub use optimize::evaluate_objective_with_tone_under;pub use optimize::evaluate_objective_with_tone_under_threaded;pub use optimize::free_tier_indices;pub use optimize::free_tier_indices_with;pub use optimize::optimize_design;pub use optimize::optimize_design_with;pub use orbit::OrbitUnit;pub use orbit::expected_orbit;pub use orbit::mirror_indices;pub use orbit::orbit_units;pub use orbit::rotate_indices;pub use preform::PlaneSet;pub use preform::PreformShape;pub use preform::PreformSpec;pub use proportions_windows::MaterialClass;pub use proportions_windows::Metric as ProportionMetric;pub use proportions_windows::ShapeClass;pub use proportions_windows::Verdict;pub use resolve::resolve_after_edit;pub use yield_metrics::PreformFit;pub use yield_metrics::YieldReport;pub use yield_metrics::carat_weight;pub use yield_metrics::exceeds_preform;pub use yield_metrics::mm_per_unit;pub use yield_metrics::volume_mm3;pub use yield_metrics::volumetric_yield;
Modules§
- cutting_
sheet design::Design::cutting_sheet’s own output type.- design
- A design’s preform plus editable cutting instructions.
- edit
- Reversible edits over a
design::Design. - manufacturability
- Warnings-only checks over an already-solved
design::Design. - material
- A design’s material choice and the specific-gravity lookup table.
- meet_
preservation - Shared hard preservation gate for planar optimization and material Retarget.
- native
- The
.isdddesign file’s conversions, plus the catalogue.asctext a save stores next to it. - optics_
hints - Pure critical-angle math shared by several consumers.
- optimize
- A deterministic coordinate search over a design’s free facet angles.
- orbit
- Derives a tier’s symmetry-generated facet groups from schedule metadata.
- preform
- The physical rough a design’s facets are cut from.
- proportions_
windows - Shape/material classification for the proportion-verdict windows.
- resolve
- Re-solves only the tiers an edit could actually change.
- rough_
plan - Plans how many stones of which designs fit one rough block.
- templates
- The built-in “New Design” template gallery.
- yield_
metrics - The real-unit binding and the figures built on it.
Structs§
- Face
UpTone - The face-up colour of the light a stone returns to the eye at one pose.
- Stone
Proportions - A design’s proportion readouts the way a cutter quotes them off a finished stone.