How xiangechen/chili3d works
Main System Components
A. Frontend Layer (UI/Presentation)
• chili-ui package with components like:
• Ribbon interface
• Property panels
• Viewport
• Project tree
• Status bar
• Dialog system
B. Core Application Layer
• Center around chili-core package showing:
• Application management
• Document handling
• Command system
• Selection management
• Property system
• Event handling
C. Geometry Processing Layer
• Feature the chili-wasm package interfacing with OpenCascade:
• Geometric operations
• Meshing capabilities
D. Rendering Layer
• chili-three package showing:
• Three.js integration
• Visual representation
• Camera control
• Scene management
Key Relationships to Highlight
UI Layer → Core Layer: User commands, events
Geometry Layer → Rendering Layer: Mesh data
Rendering Layer → UI Layer: Visual feedback
Important Subsystems to Detail
A. Command System (chili/src/commands)
• Command hierarchy
• Command execution flow
• Undo/Redo system
B. Snap System (chili/src/snap)
• Snap handlers
• Tracking system
• Point/angle/length snapping
C. Data Management
• Document structure
• Node hierarchy
External Dependencies
• OpenCascade (via WebAssembly)
• Three.js
• Browser storage (IndexedDB)
• File system (import/export)