How yaoaoin/easyopticsim works
EasyOpticSim is a local optical-design desktop studio built around a React/Tauri interface and a Rust sequential-ray-tracing engine. The main workflow is to create or open a lens project, edit its prescription and design settings, run optical analysis or generate autofocus/optimization candidates, inspect coverage and image-quality results, then save or export reports and technical drawings. The graph preserves the documented specialist tools and Y1.1 health-check workflow. Some subsystem links rely on README capability descriptions because their implementation files were not sampled.
Main entry points: App.tsx Workspace UI · engine.ts Engine bridge · project.ts Project data · analysis.rs Optical analysis
Components 24
Workspace
- Workspace UI
src/App.tsx - Project data
src/project.ts - Engine bridge
src/engine.ts - Tauri commands
src-tauri/src/main.rs
Lens design
- Prescription editor
src/LensEditor.tsx - Materials library
src/MaterialLibrary.tsx - Design settings
src/design.ts - Lens motion
src/motion.ts
Optical engine
- Ray tracing
crates/optics/src/trace.rs - Ray aiming
crates/optics/src/aiming.rs - Field planning
crates/optics/src/fields.rs - Geometry checks
crates/optics/src/geometry.rs
Analysis and inspection
- Optical analysis
crates/optics/src/analysis.rs - Diffraction analysis
crates/optics/src/wave.rs - Constraint optimization
crates/optics/src/optimize.rs - Lens health check
src/health.ts - Coverage report
src/Coverage.tsx - Plots and diagnostics
src/Plots.tsx - Test-image preview
crates/optics/src/preview.rs
Project outputs
- Native documents
src-tauri/src/documents.rs - Version comparison
src/versions.ts - Technical drawings
src/drawingPdf.ts - Saved projects and exports
src/engine.ts
Other components
- Designer
Connections 31
- Designer → Workspace UI: edits projects
README.md - Workspace UI → Engine bridge: requests computations
src/App.tsx - Workspace UI → Project data: loads and saves
src/App.tsx - Workspace UI → Prescription editor: hosts editor
src/App.tsx - Workspace UI → Materials library: opens tools
src/App.tsx - Workspace UI → Lens motion: opens motion tools
src/App.tsx - Workspace UI → Plots and diagnostics: renders workspace
src/App.tsx - Workspace UI → Constraint optimization: requests candidates
README.md - Workspace UI → Lens health check: runs health check
README.md - Engine bridge → Project data: parses projects
src/engine.ts - Engine bridge → Tauri commands: invokes commands
README.md - Tauri commands → Native documents: delegates documents
src-tauri/src/main.rs - Tauri commands → Ray tracing: dispatches engine work
- Prescription editor → Project data: updates prescription
- Materials library → Project data: sets materials
- Design settings → Project data: validates settings
src/project.ts - Lens motion → Project data: validates motion data
src/project.ts - Optical analysis → Field planning: uses field plan
crates/optics/src/analysis.rs - Optical analysis → Diffraction analysis: uses diffraction
crates/optics/src/analysis.rs - Optical analysis → Ray aiming: aims rays
crates/optics/src/analysis.rs - Geometry checks → Field planning: uses field data
crates/optics/src/model.rs - Constraint optimization → Optical analysis: evaluates candidates
crates/optics/src/optimize.rs - Constraint optimization → Field planning: checks coverage
crates/optics/src/optimize.rs - Engine bridge → Test-image preview: requests preview
- Engine bridge → Coverage report: returns coverage
src/PreviewPanel.tsx - Plots and diagnostics → Project data: renders lens geometry
src/Plots.tsx - Workspace UI → Version comparison: compares versions
- Workspace UI → Technical drawings: exports drawings
- Engine bridge → Saved projects and exports: saves and exports
src/engine.ts - Saved projects and exports → Tauri commands: saves native files
src/engine.ts - Technical drawings → Saved projects and exports: produces PDF
src/drawingPdf.ts