How toubkalcad/toubkalcad works
ToubkalCAD is a browser-based parametric CAD application. Users create constrained sketches, turn profiles into solid or surface features, and edit the feature history to recompute downstream geometry; they can also assemble parts and exchange STEP/IGES files. The graph follows the documented React UI, interaction hooks, OpenCascade services, feature recomputation, and Zustand state architecture. Several capabilities are documented but their implementation was not sampled, so those subsystems use supported directory paths and unverified links are omitted.
Main entry points: cadStore.ts CAD scene and history · useCADSketchTool.ts Sketch tools · RecomputeEngine.live.ts Live recompute host · CADGeometryRegistry.ts Shape registry
Components 22
CAD interface
- App bootstrap
src/index.tsx - CAD workspace
src/components/CADLayout.tsx - Tool ribbon
src/components/Ribbon.tsx - Feature panels
src/components/Op3DPanel.tsx - 3D viewport
src/components/Viewport3D.tsx
Sketching
- Sketch tools
src/hooks/useCADSketchTool.ts - Sketch geometry
src/services/OccSketchService.ts - Sketch editing
src/services/SketchEdit2D.ts - Constraint solving
src/services/SketchConstraintSolver.ts - Profile regions
src/services/SketchRegions.ts - Profile resolution
src/utils/sketchProfile.ts
Modeling and history
- Modeling operations
src/services/OccExtrusionService.ts - Feature dependencies
src/services/FeatureGraph.ts - Feature recomputation
src/services/RecomputeEngine.ts - Live recompute host
src/services/RecomputeEngine.live.ts
Assemblies and exchange
- Assembly services
src/assembly - Assembly references
src/assembly/AssemblyReferenceService.ts - STEP and IGES exchange
src/services/OccExchangeService.ts
Runtime state and geometry
- CAD scene and history
src/store/cadStore.ts - Shape registry
src/services/CADGeometryRegistry.ts - Solver adapters
src/services/solver
Other components
- CAD user
Connections 25
- CAD user → App bootstrap: opens app
README.md - App bootstrap → CAD workspace: mounts workspace
src/index.tsx - Tool ribbon → CAD scene and history: updates state
src/components/Ribbon.tsx - Tool ribbon → Modeling operations: invokes operations
src/components/Ribbon.tsx - Feature panels → CAD scene and history: reads and updates
src/components/Op3DPanel.tsx - Feature panels → Modeling operations: invokes operations
src/components/Op3DPanel.tsx - Sketch tools → CAD scene and history: updates sketch state
src/hooks/useCADSketchTool.ts - Sketch tools → Sketch geometry: creates geometry
src/hooks/useCADSketchTool.ts - Sketch tools → Sketch editing: edits geometry
- Constraint solving → Solver adapters: uses adapters
src/services/SketchDragController.ts - Sketch tools → Profile regions: finds profile regions
- Profile resolution → Profile regions: builds profiles
src/utils/sketchProfile.ts - Feature dependencies → CAD scene and history: reads feature nodes
src/services/FeatureGraph.ts - Live recompute host → Feature dependencies: builds dependency graph
src/services/RecomputeEngine.live.ts - Live recompute host → Feature recomputation: runs recomputation
src/services/RecomputeEngine.live.ts - Feature recomputation → Feature dependencies: evaluates graph order
src/services/RecomputeEngine.ts - Live recompute host → Shape registry: registers shapes
src/services/RecomputeEngine.live.ts - Live recompute host → CAD scene and history: reads and writes state
src/services/RecomputeEngine.live.ts - CAD scene and history → Shape registry: tracks shape lifetime
src/services/CADGeometryRegistry.ts - CAD scene and history → Assembly services: uses assembly services
src/store/cadStore.ts - Assembly references → Shape registry: reads component shapes
src/assembly/AssemblyReferenceService.ts - Assembly references → CAD scene and history: reads scene nodes
src/assembly/AssemblyReferenceService.ts - CAD scene and history → STEP and IGES exchange: exports geometry
src/store/cadStore.ts - App bootstrap → Shape registry: initializes registry
src/index.tsx - CAD workspace → 3D viewport: hosts viewport