cyclecad 2.0.0 → 2.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (33) hide show
  1. package/IMPLEMENTATION_GUIDE.md +502 -0
  2. package/INTEGRATION-GUIDE.md +377 -0
  3. package/MODULES_PHASES_6_7.md +780 -0
  4. package/app/index.html +106 -2
  5. package/app/js/brep-kernel.js +1353 -455
  6. package/app/js/help-module.js +1437 -0
  7. package/app/js/kernel.js +364 -40
  8. package/app/js/modules/animation-module.js +967 -0
  9. package/app/js/modules/assembly-module.js +47 -3
  10. package/app/js/modules/cam-module.js +1067 -0
  11. package/app/js/modules/collaboration-module.js +1102 -0
  12. package/app/js/modules/data-module.js +1656 -0
  13. package/app/js/modules/drawing-module.js +54 -8
  14. package/app/js/modules/formats-module.js +1173 -0
  15. package/app/js/modules/inspection-module.js +937 -0
  16. package/app/js/modules/mesh-module.js +968 -0
  17. package/app/js/modules/operations-module.js +40 -7
  18. package/app/js/modules/plugin-module.js +957 -0
  19. package/app/js/modules/rendering-module.js +1306 -0
  20. package/app/js/modules/scripting-module.js +955 -0
  21. package/app/js/modules/simulation-module.js +60 -3
  22. package/app/js/modules/sketch-module.js +1032 -90
  23. package/app/js/modules/step-module.js +47 -6
  24. package/app/js/modules/surface-module.js +728 -0
  25. package/app/js/modules/version-module.js +1410 -0
  26. package/app/js/modules/viewport-module.js +95 -8
  27. package/app/test-agent-v2.html +881 -1316
  28. package/docs/ARCHITECTURE.html +838 -1408
  29. package/docs/DEVELOPER-GUIDE.md +1504 -0
  30. package/docs/TUTORIAL.md +740 -0
  31. package/package.json +1 -1
  32. package/.github/scripts/cad-diff.js +0 -590
  33. package/.github/workflows/cad-diff.yml +0 -117
@@ -1,11 +1,52 @@
1
1
  /**
2
- * STEP Module - Import/Export AP203/AP214 STEP files
3
- * Microkernel LEGO block for cycleCAD
2
+ * @file step-module.js
3
+ * @description STEPModule STEP File Import/Export (AP203/AP214)
4
+ * Handles STEP file I/O with intelligent routing:
5
+ * - Small files (<50MB) → browser WASM (occt-import-js)
6
+ * - Large files (>=50MB) → server-side Python converter
7
+ * - B-Rep kernel (when available) → native STEP I/O with full fidelity
4
8
  *
5
- * Dual-path architecture:
6
- * 1. Browser WASM (occt-import-js) for files < 50MB
7
- * 2. Server-side converter (Python/CadQuery) for files >= 50MB
8
- * 3. B-Rep kernel (if available) for native STEP I/O
9
+ * @version 1.0.0
10
+ * @author cycleCAD Team
11
+ * @license MIT
12
+ * @see {@link https://github.com/vvlars-cmd/cyclecad}
13
+ *
14
+ * @module step-module
15
+ * @requires viewport (3D scene)
16
+ *
17
+ * Architecture (3-tier routing):
18
+ * STEP file
19
+ * ├─ <50MB: Browser WASM (fast, non-blocking for small files)
20
+ * │ └─ occt-import-js Worker → mesh extraction → Three.js geometry
21
+ * ├─ >=50MB: Server converter (Python FastAPI)
22
+ * │ └─ Server /convert endpoint → GLB response → Three.js GLTFLoader
23
+ * └─ B-Rep kernel available: Native STEP via OpenCascade.js
24
+ * └─ Full B-Rep fidelity for further modeling
25
+ *
26
+ * Import Pipeline:
27
+ * 1. User selects STEP file (or imports from URL)
28
+ * 2. Module checks file size and WASM readiness
29
+ * 3. Routes to appropriate parser (WASM, server, or B-Rep)
30
+ * 4. Parser returns mesh data (position, normal, index, color)
31
+ * 5. Three.js geometry created and added to scene
32
+ * 6. Event emitted: 'step:importComplete' with part count
33
+ *
34
+ * Worker Heartbeat:
35
+ * - Worker sends heartbeat every 5 seconds
36
+ * - Main thread monitors for 90s timeout
37
+ * - If Worker unresponsive: terminate and show user-friendly error
38
+ * - Suggests solutions: split file, use server, reduce complexity
39
+ *
40
+ * Server Conversion:
41
+ * - Configurable endpoint (default: http://localhost:8787/convert)
42
+ * - Supports Docker deployment (see converter.py, Dockerfile)
43
+ * - Adaptive deflection for large files (coarser mesh)
44
+ * - Returns GLB (glTF binary) format for easy loading
45
+ *
46
+ * Metadata Extraction:
47
+ * - Quick ASCII header parse (first 100KB)
48
+ * - Part count estimation
49
+ * - No full parse needed for metadata
9
50
  */
10
51
 
11
52
  const StepModule = {