Skip to main content

Crate indicatrix_cut_core

Crate indicatrix_cut_core 

Source
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

§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 .isdd design file’s conversions, plus the catalogue .asc text 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§

FaceUpTone
The face-up colour of the light a stone returns to the eye at one pose.
StoneProportions
A design’s proportion readouts the way a cutter quotes them off a finished stone.