cyclecad 3.0.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 (66) 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/DOCKER-BUILD-MANIFEST.txt +483 -0
  7. package/DOCKER-FILES-REFERENCE.md +440 -0
  8. package/DOCKER-INFRASTRUCTURE.md +475 -0
  9. package/DOCKER-README.md +435 -0
  10. package/Dockerfile +33 -55
  11. package/PWA-FILES-CREATED.txt +350 -0
  12. package/QUICK-START-TESTING.md +126 -0
  13. package/STEP-IMPORT-QUICKSTART.md +347 -0
  14. package/STEP-IMPORT-SYSTEM-SUMMARY.md +502 -0
  15. package/app/css/mobile.css +1074 -0
  16. package/app/icons/generate-icons.js +203 -0
  17. package/app/js/billing-ui.js +990 -0
  18. package/app/js/brep-kernel.js +933 -981
  19. package/app/js/collab-client.js +750 -0
  20. package/app/js/mobile-nav.js +623 -0
  21. package/app/js/mobile-toolbar.js +476 -0
  22. package/app/js/modules/billing-module.js +724 -0
  23. package/app/js/modules/step-module-enhanced.js +938 -0
  24. package/app/js/offline-manager.js +705 -0
  25. package/app/js/responsive-init.js +360 -0
  26. package/app/js/touch-handler.js +429 -0
  27. package/app/manifest.json +211 -0
  28. package/app/offline.html +508 -0
  29. package/app/sw.js +571 -0
  30. package/app/tests/billing-tests.html +779 -0
  31. package/app/tests/brep-tests.html +980 -0
  32. package/app/tests/collab-tests.html +743 -0
  33. package/app/tests/mobile-tests.html +1299 -0
  34. package/app/tests/pwa-tests.html +1134 -0
  35. package/app/tests/step-tests.html +1042 -0
  36. package/app/tests/test-agent-v3.html +719 -0
  37. package/docker-compose.yml +225 -0
  38. package/docs/BILLING-HELP.json +260 -0
  39. package/docs/BILLING-README.md +639 -0
  40. package/docs/BILLING-TUTORIAL.md +736 -0
  41. package/docs/BREP-HELP.json +326 -0
  42. package/docs/BREP-TUTORIAL.md +802 -0
  43. package/docs/COLLABORATION-HELP.json +228 -0
  44. package/docs/COLLABORATION-TUTORIAL.md +818 -0
  45. package/docs/DOCKER-HELP.json +224 -0
  46. package/docs/DOCKER-TUTORIAL.md +974 -0
  47. package/docs/MOBILE-HELP.json +243 -0
  48. package/docs/MOBILE-RESPONSIVE-README.md +378 -0
  49. package/docs/MOBILE-TUTORIAL.md +747 -0
  50. package/docs/PWA-HELP.json +228 -0
  51. package/docs/PWA-README.md +662 -0
  52. package/docs/PWA-TUTORIAL.md +757 -0
  53. package/docs/STEP-HELP.json +481 -0
  54. package/docs/STEP-IMPORT-TUTORIAL.md +824 -0
  55. package/docs/TESTING-GUIDE.md +528 -0
  56. package/docs/TESTING-HELP.json +182 -0
  57. package/fusion-vs-cyclecad.html +1771 -0
  58. package/nginx.conf +237 -0
  59. package/package.json +1 -1
  60. package/server/Dockerfile.converter +51 -0
  61. package/server/Dockerfile.signaling +28 -0
  62. package/server/billing-server.js +487 -0
  63. package/server/converter-enhanced.py +528 -0
  64. package/server/requirements-converter.txt +29 -0
  65. package/server/signaling-server.js +801 -0
  66. package/tests/docker-tests.sh +389 -0
@@ -0,0 +1,326 @@
1
+ [
2
+ {
3
+ "id": "brep-init",
4
+ "title": "Initialize B-Rep Kernel",
5
+ "category": "Initialization",
6
+ "description": "Load the OpenCascade.js WASM library from CDN. This happens automatically on first geometry operation, but can be called manually to show progress.",
7
+ "shortcut": "",
8
+ "example": "await kernel.init((loaded, total, percent) => console.log(`Loading: ${percent}%`));",
9
+ "notes": "The WASM file is ~50MB and only loads once per browser session. First load takes 10-30 seconds depending on connection speed."
10
+ },
11
+ {
12
+ "id": "brep-makebox",
13
+ "title": "Create Box",
14
+ "category": "Primitives",
15
+ "description": "Create a rectangular box (cuboid) solid. Dimensions define width (X), height (Y), and depth (Z). Optional position offset.",
16
+ "shortcut": "",
17
+ "example": "const box = await kernel.makeBox({width: 100, height: 50, depth: 30});",
18
+ "notes": "Returns {id, shape} where id is the shape identifier for future operations."
19
+ },
20
+ {
21
+ "id": "brep-makecylinder",
22
+ "title": "Create Cylinder",
23
+ "category": "Primitives",
24
+ "description": "Create a circular cylinder or partial wedge. Radius and height define the shape. Optional angle creates partial cylinders (e.g., 90° wedge).",
25
+ "shortcut": "",
26
+ "example": "const cyl = await kernel.makeCylinder({radius: 15, height: 60, angle: 360});",
27
+ "notes": "angle=360 creates full cylinder. angle=90 creates a 90° wedge."
28
+ },
29
+ {
30
+ "id": "brep-makesphere",
31
+ "title": "Create Sphere",
32
+ "category": "Primitives",
33
+ "description": "Create a perfect sphere with given radius. Center is at origin.",
34
+ "shortcut": "",
35
+ "example": "const sphere = await kernel.makeSphere({radius: 25});",
36
+ "notes": "Sphere is created as a real B-Rep solid with accurate geometry."
37
+ },
38
+ {
39
+ "id": "brep-makecone",
40
+ "title": "Create Cone",
41
+ "category": "Primitives",
42
+ "description": "Create a cone or frustum (truncated cone). Specify two radii (for pointed cone, set radius2=0) and height.",
43
+ "shortcut": "",
44
+ "example": "const cone = await kernel.makeCone({radius1: 30, radius2: 0, height: 40});",
45
+ "notes": "radius1=30, radius2=0 creates a pointed cone. radius1=30, radius2=15 creates a frustum (truncated cone)."
46
+ },
47
+ {
48
+ "id": "brep-maketorus",
49
+ "title": "Create Torus",
50
+ "category": "Primitives",
51
+ "description": "Create a torus (donut shape). Major radius is distance from center to tube center. Minor radius is the tube radius.",
52
+ "shortcut": "",
53
+ "example": "const torus = await kernel.makeTorus({majorRadius: 40, minorRadius: 10});",
54
+ "notes": "majorRadius=40, minorRadius=10 creates a classic donut shape."
55
+ },
56
+ {
57
+ "id": "brep-extrude",
58
+ "title": "Extrude Shape",
59
+ "category": "Transformations",
60
+ "description": "Extrude a 2D profile (wire or face) along a vector. Specify direction (X, Y, Z components) and depth distance.",
61
+ "shortcut": "",
62
+ "example": "const extruded = await kernel.extrude({shapeId: wireId, dirX: 0, dirY: 0, dirZ: 1, depth: 50});",
63
+ "notes": "Direction is automatically normalized. Depth must be positive. Extrusion creates a 3D solid from 2D shape."
64
+ },
65
+ {
66
+ "id": "brep-revolve",
67
+ "title": "Revolve Shape",
68
+ "category": "Transformations",
69
+ "description": "Revolve (rotate) a 2D profile around an axis to create a 3D solid of revolution. Specify axis origin, direction, and rotation angle.",
70
+ "shortcut": "",
71
+ "example": "const revolved = await kernel.revolve({shapeId: profileId, axisX: 0, axisY: 0, axisZ: 0, dirX: 0, dirY: 0, dirZ: 1, angle: 360});",
72
+ "notes": "angle=360 creates complete revolution. angle=180 creates half-shape."
73
+ },
74
+ {
75
+ "id": "brep-sweep",
76
+ "title": "Sweep Profile Along Path",
77
+ "category": "Transformations",
78
+ "description": "Sweep a profile (wire) along a path (curve) to create a 3D shape. Like dragging a shape along a trajectory.",
79
+ "shortcut": "",
80
+ "example": "const swept = await kernel.sweep({profileId: circleId, pathId: curveId});",
81
+ "notes": "Creates organic tube-like shapes. Profile is repeated along the path with proper orientation changes."
82
+ },
83
+ {
84
+ "id": "brep-loft",
85
+ "title": "Loft Between Profiles",
86
+ "category": "Transformations",
87
+ "description": "Create a smooth surface flowing between multiple 2D profiles. Like interpolating between cross-sections.",
88
+ "shortcut": "",
89
+ "example": "const lofted = await kernel.loft({profileIds: [baseId, midId, topId], isSolid: true});",
90
+ "notes": "Requires at least 2 profiles. isSolid=true creates solid, isSolid=false creates shell only."
91
+ },
92
+ {
93
+ "id": "brep-unionfuse",
94
+ "title": "Union (Fuse)",
95
+ "category": "Boolean Operations",
96
+ "description": "Combine two solids into one. Merges all volume from both shapes. Uses 3-tier error recovery for robustness.",
97
+ "shortcut": "",
98
+ "example": "const combined = await kernel.booleanUnion({shapeA: box.id, shapeB: cylinder.id});",
99
+ "notes": "Uses standard operation first, then fuzzy tolerance, then shape healing if needed. Very robust."
100
+ },
101
+ {
102
+ "id": "brep-cut",
103
+ "title": "Cut (Boolean Difference)",
104
+ "category": "Boolean Operations",
105
+ "description": "Subtract one solid from another. Removes the volume of shapeB from shapeA. Uses 3-tier error recovery.",
106
+ "shortcut": "",
107
+ "example": "const holed = await kernel.booleanCut({shapeA: boxId, shapeB: holeId});",
108
+ "notes": "Most common operation for creating holes and features. Order matters: A - B is different from B - A."
109
+ },
110
+ {
111
+ "id": "brep-intersect",
112
+ "title": "Intersection (Common)",
113
+ "category": "Boolean Operations",
114
+ "description": "Keep only the overlapping volume of two solids. Creates lens-shaped regions where shapes overlap.",
115
+ "shortcut": "",
116
+ "example": "const intersection = await kernel.booleanIntersect({shapeA: sphere1Id, shapeB: sphere2Id});",
117
+ "notes": "Useful for analyzing overlaps and creating complex shapes from combinations."
118
+ },
119
+ {
120
+ "id": "brep-fillet",
121
+ "title": "Fillet Edges",
122
+ "category": "Modifiers",
123
+ "description": "Round edges with smooth curved surfaces (real B-Rep fillets, not approximations). Specify edge indices and radius.",
124
+ "shortcut": "",
125
+ "example": "const filleted = await kernel.fillet({shapeId: boxId, edgeIndices: [0, 1, 2, 3], radius: 5});",
126
+ "notes": "Real B-Rep operation using OpenCascade's MakeFillet. Much more accurate than mesh approximations. Use getEdges() to find edge indices."
127
+ },
128
+ {
129
+ "id": "brep-chamfer",
130
+ "title": "Chamfer Edges",
131
+ "category": "Modifiers",
132
+ "description": "Bevel edges with sharp 45-degree cuts. Real B-Rep operation. Specify edge indices and chamfer distance.",
133
+ "shortcut": "",
134
+ "example": "const chamfered = await kernel.chamfer({shapeId: boxId, edgeIndices: [4, 5, 6, 7], distance: 2});",
135
+ "notes": "Produces sharp beveled edges unlike soft fillets. Uses OpenCascade's MakeChamfer."
136
+ },
137
+ {
138
+ "id": "brep-shell",
139
+ "title": "Shell (Hollow Out)",
140
+ "category": "Modifiers",
141
+ "description": "Create a hollow shell by removing faces and adding wall thickness. Like creating a cavity or emptying out a solid.",
142
+ "shortcut": "",
143
+ "example": "const hollow = await kernel.shell({shapeId: boxId, removeFaceIndices: [0], thickness: 2});",
144
+ "notes": "Useful for creating hollow containers, molds, and light-weight parts. Face indices identify which faces to remove (openings)."
145
+ },
146
+ {
147
+ "id": "brep-mirror",
148
+ "title": "Mirror Shape",
149
+ "category": "Modifiers",
150
+ "description": "Reflect a shape across a plane. Specify plane origin and normal direction.",
151
+ "shortcut": "",
152
+ "example": "const mirrored = await kernel.mirror({shapeId: boxId, plane: {originX: 0, originY: 0, originZ: 0, normalX: 1, normalY: 0, normalZ: 0}});",
153
+ "notes": "Useful for creating symmetric parts. Normal vector points in the direction perpendicular to the mirror plane."
154
+ },
155
+ {
156
+ "id": "brep-getedges",
157
+ "title": "Get Shape Edges",
158
+ "category": "Topology",
159
+ "description": "Extract all edges from a shape with their indices. Needed to target specific edges for fillet/chamfer operations.",
160
+ "shortcut": "",
161
+ "example": "const edges = await kernel.getEdges(boxId); console.log(`Box has ${edges.length} edges`);",
162
+ "notes": "Returns array of edge objects with index property. Use indices in fillet/chamfer operations."
163
+ },
164
+ {
165
+ "id": "brep-getfaces",
166
+ "title": "Get Shape Faces",
167
+ "category": "Topology",
168
+ "description": "Extract all faces from a shape with their indices. Useful for analyzing structure and targeting faces for operations.",
169
+ "shortcut": "",
170
+ "example": "const faces = await kernel.getFaces(boxId); console.log(`Box has ${faces.length} faces`);",
171
+ "notes": "Returns array of face objects with index property. Helps understand shape topology."
172
+ },
173
+ {
174
+ "id": "brep-shapetomesh",
175
+ "title": "Convert to Three.js Mesh",
176
+ "category": "Visualization",
177
+ "description": "Tessellate a B-Rep shape into THREE.BufferGeometry for WebGL rendering. Configurable deflection for quality/speed tradeoff.",
178
+ "shortcut": "",
179
+ "example": "const geometry = await kernel.shapeToMesh(boxId, 0.1); const mesh = new THREE.Mesh(geometry, material); scene.add(mesh);",
180
+ "notes": "linearDeflection=0.01 for high quality, 0.1 for medium, 1.0 for low quality (faster rendering)."
181
+ },
182
+ {
183
+ "id": "brep-massproperties",
184
+ "title": "Get Mass Properties",
185
+ "category": "Analysis",
186
+ "description": "Compute volume, surface area, mass (with density), center of gravity, and moments of inertia for structural analysis.",
187
+ "shortcut": "",
188
+ "example": "const props = await kernel.getMassProperties({shapeId: boxId, density: 2.7}); console.log(`Weight: ${props.mass} g`);",
189
+ "notes": "Density in g/cm³. Common values: steel 7.85, aluminum 2.7, plastic 1.2. Returns accurate mass properties for engineering."
190
+ },
191
+ {
192
+ "id": "brep-boundingbox",
193
+ "title": "Get Bounding Box",
194
+ "category": "Analysis",
195
+ "description": "Get the extents (min/max coordinates) and dimensions of a shape's bounding box.",
196
+ "shortcut": "",
197
+ "example": "const bbox = await kernel.getBoundingBox(boxId); console.log(`Width: ${bbox.width}, Height: ${bbox.height}, Depth: ${bbox.depth}`);",
198
+ "notes": "Returns minX, minY, minZ, maxX, maxY, maxZ, width, height, depth. Useful for fitting shapes in space or collision detection."
199
+ },
200
+ {
201
+ "id": "brep-exportstep",
202
+ "title": "Export to STEP",
203
+ "category": "File I/O",
204
+ "description": "Export one or more shapes to STEP format (ISO 10303-21) for interchange with other CAD software.",
205
+ "shortcut": "",
206
+ "example": "const stepData = await kernel.exportSTEP([boxId], {fileName: 'mybox.stp', writeAscii: false});",
207
+ "notes": "Binary format is smaller and faster. ASCII format is human-readable. Compatible with all major CAD systems."
208
+ },
209
+ {
210
+ "id": "brep-importstep",
211
+ "title": "Import from STEP",
212
+ "category": "File I/O",
213
+ "description": "Import shapes from STEP format files. Reads AP203 and AP214 STEP variants.",
214
+ "shortcut": "",
215
+ "example": "const imported = await kernel.importSTEP(stepDataBuffer); console.log('Imported shape:', imported.id);",
216
+ "notes": "Accepts ArrayBuffer or Uint8Array. Returns imported shape ID for use in subsequent operations."
217
+ },
218
+ {
219
+ "id": "brep-getshapeinfo",
220
+ "title": "Get Shape Metadata",
221
+ "category": "Utility",
222
+ "description": "Retrieve cached metadata about a shape (name, color, bounding box, etc.)",
223
+ "shortcut": "",
224
+ "example": "const info = kernel.getShapeInfo(boxId); console.log(info.name, info.color);",
225
+ "notes": "Returns null if shape not found. Useful for debugging and tracking shape properties."
226
+ },
227
+ {
228
+ "id": "brep-deleteshape",
229
+ "title": "Delete Shape from Cache",
230
+ "category": "Utility",
231
+ "description": "Remove a shape from memory to free resources. All subsequent operations using this shape ID will fail.",
232
+ "shortcut": "",
233
+ "example": "kernel.deleteShape(boxId);",
234
+ "notes": "Use in long sessions to manage memory. WARNING: invalidates the shape ID permanently."
235
+ },
236
+ {
237
+ "id": "brep-clearcache",
238
+ "title": "Clear All Cached Shapes",
239
+ "category": "Utility",
240
+ "description": "Remove all shapes from memory at once. WARNING: invalidates all shape IDs.",
241
+ "shortcut": "",
242
+ "example": "kernel.clearCache();",
243
+ "notes": "Use only when you're certain you're done with all shapes. Frees all memory but invalidates all shape IDs."
244
+ },
245
+ {
246
+ "id": "brep-cachestats",
247
+ "title": "Get Cache Statistics",
248
+ "category": "Utility",
249
+ "description": "Query the number of cached shapes and approximate memory usage.",
250
+ "shortcut": "",
251
+ "example": "const stats = kernel.getCacheStats(); console.log(`Cached shapes: ${stats.shapeCount}`);",
252
+ "notes": "Useful for monitoring memory usage in long modeling sessions."
253
+ },
254
+ {
255
+ "id": "brep-error-recovery",
256
+ "title": "Boolean Operation Error Recovery",
257
+ "category": "Advanced",
258
+ "description": "Understand how boolean operations handle failures automatically with 3-tier recovery: standard → fuzzy tolerance → shape healing.",
259
+ "shortcut": "",
260
+ "example": "try { const result = await kernel.booleanCut({...}); } catch (err) { console.error(err.diagnostic); }",
261
+ "notes": "Errors include detailed diagnostics showing which recovery tier failed. Most operations succeed without user intervention."
262
+ },
263
+ {
264
+ "id": "brep-deflection-tuning",
265
+ "title": "Mesh Deflection Tuning",
266
+ "category": "Performance",
267
+ "description": "Understand linearDeflection parameter: smaller values = finer mesh (slower), larger values = coarser mesh (faster).",
268
+ "shortcut": "",
269
+ "example": "await kernel.shapeToMesh(shapeId, 0.01); // Fine (0.01mm) await kernel.shapeToMesh(shapeId, 1.0); // Coarse (1.0mm)",
270
+ "notes": "0.01mm for 3D printing, 0.1mm for visualization, 1.0mm for quick preview."
271
+ },
272
+ {
273
+ "id": "brep-materials",
274
+ "title": "Common Material Densities",
275
+ "category": "Reference",
276
+ "description": "Quick reference for material densities (g/cm³) used in mass property calculations.",
277
+ "shortcut": "",
278
+ "example": "// Steel: 7.85, Aluminum: 2.7, Titanium: 4.5, Plastic (ABS): 1.04, Copper: 8.96, Brass: 8.5",
279
+ "notes": "Use these values with getMassProperties(). Densities vary by alloy; these are typical values."
280
+ },
281
+ {
282
+ "id": "brep-edge-indices",
283
+ "title": "Understanding Edge Indices",
284
+ "category": "Reference",
285
+ "description": "Edge indices are returned by getEdges() in order of extraction. For a box, typically: edges 0-3 are top, 4-7 are vertical, 8-11 are bottom.",
286
+ "shortcut": "",
287
+ "example": "const edges = await kernel.getEdges(boxId); // Use edges.map(e => e.index) to get all indices",
288
+ "notes": "Order depends on how OpenCascade extracts edges. Use getEdges() to determine actual indices for your shape."
289
+ },
290
+ {
291
+ "id": "brep-shape-ids",
292
+ "title": "Shape ID Format",
293
+ "category": "Reference",
294
+ "description": "All shapes have IDs in format 'shape_N' where N is auto-incrementing. IDs are returned from every operation.",
295
+ "shortcut": "",
296
+ "example": "shape_0, shape_1, shape_2, ...",
297
+ "notes": "IDs are valid only while shape is cached. After deleteShape() or clearCache(), IDs become invalid."
298
+ },
299
+ {
300
+ "id": "brep-workflow-example",
301
+ "title": "Complete Modeling Workflow",
302
+ "category": "Examples",
303
+ "description": "Example: Create bracket with holes → fillet edges → analyze weight → export to STEP.",
304
+ "shortcut": "",
305
+ "example": "const plate = await kernel.makeBox({width: 100, height: 50, depth: 10}); const hole = await kernel.makeCylinder({radius: 5, height: 15}); let bracket = await kernel.booleanCut({shapeA: plate.id, shapeB: hole.id}); bracket = await kernel.fillet({shapeId: bracket.id, edgeIndices: [0, 1, 2, 3], radius: 2}); const props = await kernel.getMassProperties({shapeId: bracket.id, density: 2.7}); console.log('Weight:', props.mass, 'g'); const stepData = await kernel.exportSTEP([bracket.id]);",
306
+ "notes": "This is a real-world example. Adapt for your specific design."
307
+ },
308
+ {
309
+ "id": "brep-promise-all",
310
+ "title": "Parallel Operations with Promise.all",
311
+ "category": "Performance",
312
+ "description": "Create multiple shapes in parallel instead of sequentially to save time.",
313
+ "shortcut": "",
314
+ "example": "const [box, cyl, sphere] = await Promise.all([ kernel.makeBox({width: 100, height: 50, depth: 30}), kernel.makeCylinder({radius: 15, height: 60}), kernel.makeSphere({radius: 25}) ]);",
315
+ "notes": "Much faster than awaiting each operation sequentially. Recommended for batch operations."
316
+ },
317
+ {
318
+ "id": "brep-wasm-loading",
319
+ "title": "WASM Loading and Caching",
320
+ "category": "Technical",
321
+ "description": "Understand how WASM loads: lazy on first operation, cached in IndexedDB, reused across sessions.",
322
+ "shortcut": "",
323
+ "example": "// First call: downloads and initializes await kernel.init(); // Subsequent calls: instant (cached)",
324
+ "notes": "First load takes 10-30s. Subsequent loads are instant. Uses ~50MB of browser cache."
325
+ }
326
+ ]