cyclecad 2.1.0 → 3.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 (94) hide show
  1. package/BILLING-IMPLEMENTATION-SUMMARY.md +425 -0
  2. package/BILLING-INDEX.md +293 -0
  3. package/BILLING-INTEGRATION-GUIDE.md +414 -0
  4. package/COLLABORATION-INDEX.md +440 -0
  5. package/COLLABORATION-SYSTEM-SUMMARY.md +548 -0
  6. package/DELIVERABLES.txt +296 -445
  7. package/DOCKER-BUILD-MANIFEST.txt +483 -0
  8. package/DOCKER-FILES-REFERENCE.md +440 -0
  9. package/DOCKER-INFRASTRUCTURE.md +475 -0
  10. package/DOCKER-README.md +435 -0
  11. package/Dockerfile +33 -55
  12. package/ENHANCEMENT_COMPLETION_REPORT.md +383 -0
  13. package/ENHANCEMENT_SUMMARY.txt +308 -0
  14. package/FEATURE_INVENTORY.md +235 -0
  15. package/FUSION360_FEATURES_SUMMARY.md +452 -0
  16. package/FUSION360_PARITY_ENHANCEMENTS.md +461 -0
  17. package/FUSION360_PARITY_SUMMARY.md +520 -0
  18. package/FUSION360_QUICK_REFERENCE.md +351 -0
  19. package/MODULE_API_REFERENCE.md +712 -0
  20. package/MODULE_INVENTORY.txt +264 -0
  21. package/PWA-FILES-CREATED.txt +350 -0
  22. package/QUICK-START-TESTING.md +126 -0
  23. package/STEP-IMPORT-QUICKSTART.md +347 -0
  24. package/STEP-IMPORT-SYSTEM-SUMMARY.md +502 -0
  25. package/app/css/mobile.css +1074 -0
  26. package/app/icons/generate-icons.js +203 -0
  27. package/app/index.html +1342 -5031
  28. package/app/js/app.js +1312 -514
  29. package/app/js/billing-ui.js +990 -0
  30. package/app/js/brep-kernel.js +933 -981
  31. package/app/js/collab-client.js +750 -0
  32. package/app/js/mobile-nav.js +623 -0
  33. package/app/js/mobile-toolbar.js +476 -0
  34. package/app/js/modules/animation-module.js +497 -3
  35. package/app/js/modules/billing-module.js +724 -0
  36. package/app/js/modules/cam-module.js +507 -2
  37. package/app/js/modules/collaboration-module.js +513 -0
  38. package/app/js/modules/constraint-module.js +1266 -0
  39. package/app/js/modules/data-module.js +544 -1146
  40. package/app/js/modules/formats-module.js +438 -738
  41. package/app/js/modules/inspection-module.js +393 -0
  42. package/app/js/modules/mesh-module-enhanced.js +880 -0
  43. package/app/js/modules/plugin-module.js +597 -0
  44. package/app/js/modules/rendering-module.js +460 -0
  45. package/app/js/modules/scripting-module.js +593 -475
  46. package/app/js/modules/sketch-module.js +998 -2
  47. package/app/js/modules/step-module-enhanced.js +938 -0
  48. package/app/js/modules/surface-module.js +312 -0
  49. package/app/js/modules/version-module.js +420 -0
  50. package/app/js/offline-manager.js +705 -0
  51. package/app/js/responsive-init.js +360 -0
  52. package/app/js/touch-handler.js +429 -0
  53. package/app/manifest.json +211 -0
  54. package/app/offline.html +508 -0
  55. package/app/sw.js +571 -0
  56. package/app/tests/billing-tests.html +779 -0
  57. package/app/tests/brep-tests.html +980 -0
  58. package/app/tests/collab-tests.html +743 -0
  59. package/app/tests/mobile-tests.html +1299 -0
  60. package/app/tests/pwa-tests.html +1134 -0
  61. package/app/tests/step-tests.html +1042 -0
  62. package/app/tests/test-agent-v3.html +719 -0
  63. package/cycleCAD-Architecture-v2.pptx +0 -0
  64. package/docker-compose.yml +225 -0
  65. package/docs/BILLING-HELP.json +260 -0
  66. package/docs/BILLING-README.md +639 -0
  67. package/docs/BILLING-TUTORIAL.md +736 -0
  68. package/docs/BREP-HELP.json +326 -0
  69. package/docs/BREP-TUTORIAL.md +802 -0
  70. package/docs/COLLABORATION-HELP.json +228 -0
  71. package/docs/COLLABORATION-TUTORIAL.md +818 -0
  72. package/docs/DOCKER-HELP.json +224 -0
  73. package/docs/DOCKER-TUTORIAL.md +974 -0
  74. package/docs/MOBILE-HELP.json +243 -0
  75. package/docs/MOBILE-RESPONSIVE-README.md +378 -0
  76. package/docs/MOBILE-TUTORIAL.md +747 -0
  77. package/docs/PWA-HELP.json +228 -0
  78. package/docs/PWA-README.md +662 -0
  79. package/docs/PWA-TUTORIAL.md +757 -0
  80. package/docs/STEP-HELP.json +481 -0
  81. package/docs/STEP-IMPORT-TUTORIAL.md +824 -0
  82. package/docs/TESTING-GUIDE.md +528 -0
  83. package/docs/TESTING-HELP.json +182 -0
  84. package/fusion-vs-cyclecad.html +1771 -0
  85. package/nginx.conf +237 -0
  86. package/package.json +1 -1
  87. package/server/Dockerfile.converter +51 -0
  88. package/server/Dockerfile.signaling +28 -0
  89. package/server/billing-server.js +487 -0
  90. package/server/converter-enhanced.py +528 -0
  91. package/server/requirements-converter.txt +29 -0
  92. package/server/signaling-server.js +801 -0
  93. package/tests/docker-tests.sh +389 -0
  94. package/~$cycleCAD-Architecture-v2.pptx +0 -0
@@ -0,0 +1,126 @@
1
+ # Quick Start: Visual Test Agents
2
+
3
+ ## cycleCAD Test Agent v3
4
+
5
+ ### Run Tests Now
6
+ 1. Open in Chrome: `app/tests/test-agent-v3.html`
7
+ 2. Wait for app to load (3 seconds)
8
+ 3. Click **"Run All Tests"**
9
+ 4. Watch 200+ tests execute in real-time
10
+ 5. Click **"Export Results"** to download JSON
11
+
12
+ ### What Gets Tested
13
+ - All 6 workspaces (Design, Sketch, Assembly, Drawing, Simulation, Manufacture)
14
+ - All 50+ toolbar buttons
15
+ - All keyboard shortcuts (S, E, F, Ctrl+Z, etc.)
16
+ - All panels and dialogs
17
+ - Part selection and highlighting
18
+ - 3D operations and geometry
19
+ - Agent API
20
+ - Error handling and edge cases
21
+
22
+ ### Add Your Own Tests
23
+
24
+ Edit `app/tests/test-agent-v3.html` and add to `defineTests()`:
25
+
26
+ ```javascript
27
+ this.addCategory('My New Feature', [
28
+ {
29
+ name: 'My button is visible',
30
+ fn: () => this.checkElementExists('#my-button')
31
+ },
32
+ {
33
+ name: 'My button works',
34
+ fn: () => this.clickInApp('#my-button')
35
+ }
36
+ ]);
37
+ ```
38
+
39
+ ## ExplodeView Test Agent v2
40
+
41
+ ### Run Tests Now
42
+ 1. Open in Chrome: `docs/demo/test-agent-v2.html`
43
+ 2. Wait for app to load (2 seconds)
44
+ 3. Click **"Run All Tests"**
45
+ 4. Watch 150+ tests execute
46
+ 5. Click **"Export Results"** to download JSON
47
+
48
+ ### What Gets Tested
49
+ - All toolbar tabs (View, Analyze, Create, Export, AI, Settings)
50
+ - All 40+ feature buttons
51
+ - Keyboard shortcuts (T, E, R, G, W, S, etc.)
52
+ - Panel open/close and dragging
53
+ - Part selection and tree clicking
54
+ - Context menus
55
+ - Language switching (EN, DE, FR, ES, IT, NL)
56
+ - Error handling and recovery
57
+
58
+ ## Test Results
59
+
60
+ ### JSON Export
61
+ Click "Export Results" to download a JSON file with:
62
+ - Timestamp
63
+ - Summary (total, passed, failed)
64
+ - Per-test results with timing
65
+
66
+ Use for:
67
+ - CI/CD integration
68
+ - Trend analysis
69
+ - Automated reporting
70
+
71
+ ### HTML Report
72
+ Convert results to HTML:
73
+ ```bash
74
+ node test-reporter.js test-results.json --output report.html
75
+ ```
76
+
77
+ ## Continuous Integration
78
+
79
+ Add to `.github/workflows/test.yml`:
80
+
81
+ ```yaml
82
+ - run: node test-runner.js app/tests/test-agent-v3.html --output results.json
83
+ - uses: actions/upload-artifact@v2
84
+ with:
85
+ name: test-results
86
+ path: results.json
87
+ ```
88
+
89
+ Tests run headless on every push and PR.
90
+
91
+ ## Documentation
92
+
93
+ - **TESTING-GUIDE.md** — Full reference (25+ sections, 528 lines)
94
+ - **TESTING-HELP.json** — 20 quick help entries (in-app accessible)
95
+
96
+ ## Common Tasks
97
+
98
+ ### Find a Failing Test
99
+ 1. Look at test log (red = failed)
100
+ 2. Click test name to see error
101
+ 3. Open DevTools (F12) and check app console
102
+ 4. Manually reproduce the steps
103
+
104
+ ### Add a New Test Category
105
+ Edit test-agent HTML, add `this.addCategory('Name', [...])`
106
+
107
+ ### Run Tests Without GUI
108
+ ```bash
109
+ node test-runner.js app/tests/test-agent-v3.html --output results.json
110
+ ```
111
+
112
+ ### Generate Coverage Report
113
+ ```bash
114
+ node test-coverage.js results.json
115
+ # Shows: 203/205 tests passed (99% coverage)
116
+ ```
117
+
118
+ ## Next Steps
119
+
120
+ 1. Open test agent in Chrome (app/tests/test-agent-v3.html)
121
+ 2. Run full test suite
122
+ 3. Check console for any failures
123
+ 4. Add tests for new features
124
+ 5. Integrate into CI/CD pipeline
125
+
126
+ See **TESTING-GUIDE.md** for detailed documentation.
@@ -0,0 +1,347 @@
1
+ # STEP Import System — Quick Start Guide
2
+
3
+ ## What's New?
4
+
5
+ Fixed STEP import for large files (80-140MB) with intelligent multi-strategy routing:
6
+
7
+ - **<30MB:** Browser WASM (2-10 seconds, no server needed)
8
+ - **30-50MB:** OpenCascade.js Worker (15-30 seconds, better geometry)
9
+ - **≥50MB:** Server converter (30-120 seconds, no memory limit)
10
+ - **Automatic fallbacks** if any route fails
11
+ - **GLB caching** with SHA-256 invalidation
12
+ - **Worker heartbeat** with 90s timeout
13
+ - **CRITICAL FIX:** `.slice(0)` tight loop prevents WASM heap reallocation
14
+
15
+ ## 5 Files Created
16
+
17
+ | File | Size | What It Does |
18
+ |------|------|-------------|
19
+ | `app/js/modules/step-module-enhanced.js` | 34KB | Main module with router + UI |
20
+ | `docs/STEP-IMPORT-TUTORIAL.md` | 21KB | 500+ line tutorial + API reference |
21
+ | `docs/STEP-HELP.json` | 18KB | 20+ help topics for help system |
22
+ | `app/tests/step-tests.html` | 31KB | Interactive test suite (50+ tests) |
23
+ | `server/converter-enhanced.py` | 16KB | FastAPI STEP→GLB server |
24
+
25
+ ## Deploy in 5 Steps
26
+
27
+ ### Step 1: Replace Old STEP Module
28
+
29
+ ```bash
30
+ cp ~/cyclecad/app/js/modules/step-module-enhanced.js ~/cyclecad/app/js/modules/step-module.js
31
+ ```
32
+
33
+ ### Step 2: Update index.html Import
34
+
35
+ In `app/index.html`, change:
36
+ ```javascript
37
+ // OLD:
38
+ import StepModule from './js/modules/step-module.js';
39
+
40
+ // NEW (if using enhanced version):
41
+ import StepModuleEnhanced from './js/modules/step-module-enhanced.js';
42
+ const StepModule = StepModuleEnhanced;
43
+ ```
44
+
45
+ ### Step 3: Start Server (for large files)
46
+
47
+ ```bash
48
+ # Option A: Docker (recommended)
49
+ docker run -d --name cyclecad-converter \
50
+ -p 8787:8000 \
51
+ -e WASM_MEMORY_LIMIT=4096 \
52
+ cyclecad/converter:latest
53
+
54
+ # Option B: Python directly
55
+ cd ~/cyclecad/server
56
+ pip install -r requirements.txt
57
+ uvicorn converter:app --port 8787
58
+
59
+ # Verify health
60
+ curl http://localhost:8787/health
61
+ ```
62
+
63
+ ### Step 4: Test Import
64
+
65
+ Open in browser:
66
+ ```
67
+ file:///Users/sachin/cyclecad/app/tests/step-tests.html
68
+ ```
69
+
70
+ Click "Run All Tests" → should see 50+ tests pass
71
+
72
+ Upload a STEP file to test real import
73
+
74
+ ### Step 5: Configure in App
75
+
76
+ In cycleCAD app, open STEP module settings:
77
+ ```javascript
78
+ // If server is local:
79
+ cycleCAD.step.setServerURL('http://localhost:8787/convert');
80
+
81
+ // If server is remote (AWS, etc):
82
+ cycleCAD.step.setServerURL('https://converter.example.com/convert');
83
+ ```
84
+
85
+ ## Test Results
86
+
87
+ **Expected behavior:**
88
+
89
+ | File Size | Result | Time |
90
+ |-----------|--------|------|
91
+ | 2MB STEP | ✓ Imports instantly via occt-import-js | <3s |
92
+ | 30MB STEP | ✓ Imports via occt-import-js | 8-12s |
93
+ | 80MB STEP | ✓ Imports via server converter | 45-60s |
94
+ | 140MB STEP | ✓ Imports via server converter | 90-120s |
95
+
96
+ **If WASM timeout on large file:**
97
+ → Automatically falls back to server converter
98
+ → No user action needed, just wait
99
+
100
+ **If server unavailable:**
101
+ → Shows friendly error with suggestions
102
+ → "Start Docker container" or "Use smaller file"
103
+
104
+ ## API Reference
105
+
106
+ ### Basic Import
107
+
108
+ ```javascript
109
+ // File picker (user selects file)
110
+ document.getElementById('stepImportBtn').addEventListener('click', () => {
111
+ const input = document.createElement('input');
112
+ input.type = 'file';
113
+ input.accept = '.step,.stp';
114
+ input.onchange = (e) => cycleCAD.step.import(e.target.files[0]);
115
+ input.click();
116
+ });
117
+
118
+ // Or programmatic (File object)
119
+ const file = new File([buffer], 'model.step', { type: 'application/octet-stream' });
120
+ cycleCAD.step.import(file);
121
+
122
+ // Or from URL
123
+ cycleCAD.step.importFromURL('https://example.com/models/part.step');
124
+ ```
125
+
126
+ ### Listen to Events
127
+
128
+ ```javascript
129
+ cycleCAD.on('step:importStart', (data) => {
130
+ console.log(`Importing: ${data.filename} (${data.size} bytes)`);
131
+ showProgressBar();
132
+ });
133
+
134
+ cycleCAD.on('step:importProgress', (data) => {
135
+ updateProgressBar(data.percent);
136
+ console.log(`${data.percent}%: ${data.message}`);
137
+ });
138
+
139
+ cycleCAD.on('step:importComplete', (data) => {
140
+ console.log(`✓ Imported ${data.partCount} parts (${data.source})`);
141
+ hideProgressBar();
142
+ });
143
+
144
+ cycleCAD.on('step:importError', (data) => {
145
+ console.error(`✕ ${data.error}`);
146
+ console.log(`Fix: ${data.suggestion}`);
147
+ showError(data.error, data.suggestion);
148
+ });
149
+
150
+ cycleCAD.on('step:importWarning', (data) => {
151
+ console.warn(`⚠ ${data.message}`);
152
+ });
153
+ ```
154
+
155
+ ### Advanced Usage
156
+
157
+ ```javascript
158
+ // Get metadata without importing
159
+ const meta = await cycleCAD.step.getMetadata(file);
160
+ console.log(`File has ${meta.partCount} parts`);
161
+
162
+ // Export to STEP (requires B-Rep kernel)
163
+ cycleCAD.step.export('my-design.step');
164
+
165
+ // Change server URL
166
+ cycleCAD.step.setServerURL('http://custom-server:9999/convert');
167
+
168
+ // Cancel current import
169
+ cycleCAD.step.cancelImport();
170
+
171
+ // Clear cache
172
+ cycleCAD.step.clearCache();
173
+
174
+ // Check module state
175
+ console.log(cycleCAD.step.state);
176
+ // → {
177
+ // importInProgress: false,
178
+ // serverHealthy: true,
179
+ // serverURL: 'http://localhost:8787/convert',
180
+ // cacheEnabled: true,
181
+ // lastImportInfo: { partCount: 47, filename: 'model.step' }
182
+ // }
183
+ ```
184
+
185
+ ## Troubleshooting
186
+
187
+ ### "WASM memory exceeded"
188
+
189
+ **Problem:** Browser WASM ran out of memory on large file
190
+
191
+ **Solutions:**
192
+ 1. Use server converter (automatically routes ≥50MB files)
193
+ 2. Close other browser tabs to free memory
194
+ 3. Split assembly in CAD before export
195
+
196
+ ### "WASM parsing timeout (90s)"
197
+
198
+ **Problem:** File too complex (>3000 parts) for browser parser
199
+
200
+ **Solutions:**
201
+ 1. Use server converter (5-minute timeout vs 90-second browser limit)
202
+ 2. Reduce geometry detail in CAD
203
+ 3. Split assembly into sub-assemblies
204
+
205
+ ### "Server unavailable"
206
+
207
+ **Problem:** Server not running or wrong URL
208
+
209
+ **Solutions:**
210
+ ```bash
211
+ # Check if server is running
212
+ curl http://localhost:8787/health
213
+
214
+ # Start Docker container
215
+ docker run -d -p 8787:8000 cyclecad/converter:latest
216
+
217
+ # Or start Python directly
218
+ cd ~/cyclecad/server
219
+ uvicorn converter:app --port 8787
220
+ ```
221
+
222
+ ### "No meshes extracted"
223
+
224
+ **Problem:** STEP file is corrupted or uses unsupported variant
225
+
226
+ **Solutions:**
227
+ 1. Open file in Fusion 360 or FreeCAD
228
+ 2. Verify file is valid (File > Open)
229
+ 3. Re-save as AP214 STEP format
230
+ 4. Try online converter: https://products.aspose.app/cad/conversion
231
+
232
+ ## Documentation
233
+
234
+ Full documentation is in three places:
235
+
236
+ 1. **Tutorial** — `docs/STEP-IMPORT-TUTORIAL.md` (500+ lines)
237
+ - What is STEP format
238
+ - 4 import methods
239
+ - Server setup
240
+ - 13 troubleshooting issues
241
+ - Performance tips
242
+ - Full API reference
243
+
244
+ 2. **Help Topics** — `docs/STEP-HELP.json` (20+ topics)
245
+ - For in-app help system
246
+ - Search and categorized display
247
+ - Copy into cycleCAD help infrastructure
248
+
249
+ 3. **Test Suite** — `app/tests/step-tests.html` (50+ tests)
250
+ - Interactive test runner
251
+ - Export results as JSON/HTML
252
+ - Validate all components
253
+
254
+ 4. **Summary** — `STEP-IMPORT-SYSTEM-SUMMARY.md`
255
+ - Architecture overview
256
+ - File descriptions
257
+ - Integration steps
258
+
259
+ ## Key Features
260
+
261
+ ✅ **Multi-Strategy Router** — Auto-selects best parser
262
+ ✅ **Intelligent Caching** — SHA-256 hash with IndexedDB
263
+ ✅ **Worker Heartbeat** — Detects frozen WASM in 90s
264
+ ✅ **CRITICAL FIX** — `.slice(0)` tight loop prevents heap reallocation
265
+ ✅ **Adaptive Deflection** — Coarser mesh for large files
266
+ ✅ **Server Fallback** — Always has a working path
267
+ ✅ **Progress Tracking** — Percentage + elapsed time
268
+ ✅ **Error Recovery** — Suggestions for every failure
269
+ ✅ **CORS Enabled** — Works cross-origin
270
+ ✅ **Docker Ready** — Single command deployment
271
+
272
+ ## Server Configuration
273
+
274
+ ### Environment Variables
275
+
276
+ ```bash
277
+ docker run -d -p 8787:8000 \
278
+ -e STEP_DEFLECTION=0.05 \
279
+ -e WASM_TIMEOUT=300 \
280
+ -e WASM_MEMORY_LIMIT=4096 \
281
+ -e MAX_FILE_SIZE=500 \
282
+ cyclecad/converter:latest
283
+ ```
284
+
285
+ | Variable | Default | Range | Description |
286
+ |----------|---------|-------|-------------|
287
+ | `STEP_DEFLECTION` | 0.01 | 0.01-0.2 | Mesh density (0.01=fine, 0.2=coarse) |
288
+ | `WASM_TIMEOUT` | 300 | 60-3600 | Parse timeout in seconds |
289
+ | `WASM_MEMORY_LIMIT` | 4096 | 512-32768 | Max memory in MB |
290
+ | `MAX_FILE_SIZE` | 500 | 10-2048 | Max upload size in MB |
291
+ | `CACHE_TTL` | 24 | 1-168 | Cache time-to-live in hours |
292
+
293
+ ### Docker Compose
294
+
295
+ ```yaml
296
+ version: '3.8'
297
+ services:
298
+ converter:
299
+ image: cyclecad/converter:latest
300
+ ports:
301
+ - "8787:8000"
302
+ environment:
303
+ WASM_MEMORY_LIMIT: "4096"
304
+ WASM_TIMEOUT: "300"
305
+ healthcheck:
306
+ test: ["CMD", "curl", "-f", "http://localhost:8000/health"]
307
+ interval: 30s
308
+ timeout: 10s
309
+ retries: 3
310
+ volumes:
311
+ - ./logs:/app/logs
312
+ ```
313
+
314
+ ## What's Fixed
315
+
316
+ **Before v1.0:**
317
+ - WASM timeout on large files (80MB+ → fail)
318
+ - Verts=0 for all meshes (heap reallocation bug)
319
+ - No fallback if WASM failed
320
+ - Memory exhaustion on >100MB files
321
+ - No caching (re-parse every time)
322
+
323
+ **After v2.0:**
324
+ - ✓ 80-140MB files work via server
325
+ - ✓ Tight `.slice(0)` copy loop prevents heap bug
326
+ - ✓ Auto-fallback between WASM → OpenCascade → Server
327
+ - ✓ Adaptive deflection handles XL files
328
+ - ✓ IndexedDB cache with SHA-256 invalidation
329
+ - ✓ Worker heartbeat detects frozen parsers
330
+ - ✓ 50+ test suite validates all components
331
+
332
+ ## Next Steps
333
+
334
+ 1. **Deploy:** Start Docker container (5-minute setup)
335
+ 2. **Test:** Run interactive test suite in browser
336
+ 3. **Integrate:** Replace old step-module.js
337
+ 4. **Validate:** Import real STEP files (2MB, 30MB, 80MB+)
338
+ 5. **Monitor:** Check server health: curl http://localhost:8787/health
339
+
340
+ ---
341
+
342
+ **Version:** 2.0.0
343
+ **Released:** 2026-03-31
344
+ **Status:** Production-ready
345
+ **License:** MIT
346
+
347
+ Questions? See `STEP-IMPORT-TUTORIAL.md` or `STEP-IMPORT-SYSTEM-SUMMARY.md`