ocjs-fluidcad 1.6.0 → 1.8.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.
@@ -1,7 +1,8 @@
1
1
  // AUTO-GENERATED by scripts/gen-aliases.mjs — DO NOT EDIT.
2
- // Source: ncollection-manifest.json (ncollection-manifest-v2), 80 aliases whose canonical is present in opencascade.fluidcad.multi-threaded.d.ts.
2
+ // Source: ncollection-manifest.json (ncollection-manifest-v2), 83 aliases whose canonical is present in opencascade.fluidcad.multi-threaded.d.ts.
3
3
  // Maps deprecated OCCT type names -> OCCT V8 canonical (mangled) class names.
4
4
  export default {
5
+ "BOPAlgo_ListOfCheckResult": "NCollection_List_BOPAlgo_CheckResult",
5
6
  "BOPDS_ListOfPave": "NCollection_List_BOPDS_Pave",
6
7
  "BOPDS_VectorOfFaceInfo": "NCollection_DynamicArray_BOPDS_FaceInfo",
7
8
  "BOPDS_VectorOfInterfEE": "NCollection_DynamicArray_BOPDS_InterfEE",
@@ -33,6 +34,7 @@ export default {
33
34
  "Poly_HArray1OfTriangle": "NCollection_HArray1_Poly_Triangle",
34
35
  "Poly_ListOfTriangulation": "NCollection_List_handle_Poly_Triangulation",
35
36
  "TColGeom_Array1OfBSplineCurve": "NCollection_Array1_handle_Geom_BSplineCurve",
37
+ "TColGeom_Array2OfBezierSurface": "NCollection_Array2_handle_Geom_BezierSurface",
36
38
  "TColGeom_HArray1OfBSplineCurve": "NCollection_HArray1_handle_Geom_BSplineCurve",
37
39
  "TColGeom_SequenceOfCurve": "NCollection_Sequence_handle_Geom_Curve",
38
40
  "TColStd_Array1OfBoolean": "NCollection_Array1_bool",
@@ -60,6 +62,7 @@ export default {
60
62
  "TColgp_Array2OfPnt": "NCollection_Array2_gp_Pnt",
61
63
  "TColgp_HArray1OfPnt": "NCollection_HArray1_gp_Pnt",
62
64
  "TColgp_HArray1OfPnt2d": "NCollection_HArray1_gp_Pnt2d",
65
+ "TColgp_HArray2OfPnt": "NCollection_HArray2_gp_Pnt",
63
66
  "TColgp_SequenceOfPnt": "NCollection_Sequence_gp_Pnt",
64
67
  "TColgp_SequenceOfPnt2d": "NCollection_Sequence_gp_Pnt2d",
65
68
  "TDF_AttributeDeltaList": "NCollection_List_handle_TDF_AttributeDelta",
@@ -1,4 +1,5 @@
1
1
  {
2
+ "BOPAlgo_ListOfCheckResult": "NCollection_List_BOPAlgo_CheckResult",
2
3
  "BOPDS_ListOfPave": "NCollection_List_BOPDS_Pave",
3
4
  "BOPDS_VectorOfFaceInfo": "NCollection_DynamicArray_BOPDS_FaceInfo",
4
5
  "BOPDS_VectorOfInterfEE": "NCollection_DynamicArray_BOPDS_InterfEE",
@@ -30,6 +31,7 @@
30
31
  "Poly_HArray1OfTriangle": "NCollection_HArray1_Poly_Triangle",
31
32
  "Poly_ListOfTriangulation": "NCollection_List_handle_Poly_Triangulation",
32
33
  "TColGeom_Array1OfBSplineCurve": "NCollection_Array1_handle_Geom_BSplineCurve",
34
+ "TColGeom_Array2OfBezierSurface": "NCollection_Array2_handle_Geom_BezierSurface",
33
35
  "TColGeom_HArray1OfBSplineCurve": "NCollection_HArray1_handle_Geom_BSplineCurve",
34
36
  "TColGeom_SequenceOfCurve": "NCollection_Sequence_handle_Geom_Curve",
35
37
  "TColStd_Array1OfBoolean": "NCollection_Array1_bool",
@@ -57,6 +59,7 @@
57
59
  "TColgp_Array2OfPnt": "NCollection_Array2_gp_Pnt",
58
60
  "TColgp_HArray1OfPnt": "NCollection_HArray1_gp_Pnt",
59
61
  "TColgp_HArray1OfPnt2d": "NCollection_HArray1_gp_Pnt2d",
62
+ "TColgp_HArray2OfPnt": "NCollection_HArray2_gp_Pnt",
60
63
  "TColgp_SequenceOfPnt": "NCollection_Sequence_gp_Pnt",
61
64
  "TColgp_SequenceOfPnt2d": "NCollection_Sequence_gp_Pnt2d",
62
65
  "TDF_AttributeDeltaList": "NCollection_List_handle_TDF_AttributeDelta",
package/dist/index.d.ts CHANGED
@@ -13,9 +13,22 @@ import type { OpenCascadeInstance } from "./opencascade.fluidcad.multi-threaded.
13
13
  // deprecated-name `export type` aliases, FS, OCJS, … (everything but `init`).
14
14
  export * from "./opencascade.fluidcad.multi-threaded.js";
15
15
 
16
+ /** Options for {@link init}: Emscripten Module overrides plus the worker pool size. */
17
+ export interface InitOptions extends Record<string, unknown> {
18
+ /**
19
+ * pthread workers to pre-spawn for OCCT's parallel algorithms (booleans, meshing).
20
+ * Defaults to one per logical CPU. When set (>= 1), OCCT's default thread pool is
21
+ * capped at the same count, so OCCT never asks for more threads than the pool holds.
22
+ * `OSD_ThreadPool.DefaultPool().Init(n)` changes OCCT's count later. The pre-spawned
23
+ * workers stay for the life of the instance; raising the count past them spawns more
24
+ * on demand under Node, but can deadlock a browser.
25
+ */
26
+ pthreadPoolSize?: number;
27
+ }
28
+
16
29
  /**
17
30
  * Initialize the multi-threaded OCCT V8 module. The returned instance exposes the
18
31
  * canonical (mangled) classes AND the restored deprecated OCCT names.
19
- * @param options Emscripten Module overrides (e.g. `locateFile`).
32
+ * @param options Emscripten Module overrides (e.g. `locateFile`) and `pthreadPoolSize`.
20
33
  */
21
- export default function init(options?: Record<string, unknown>): Promise<OpenCascadeInstance>;
34
+ export default function init(options?: InitOptions): Promise<OpenCascadeInstance>;
package/dist/index.js CHANGED
@@ -13,13 +13,20 @@
13
13
  // twice"; see FORK_PLAN.md §5.)
14
14
  //
15
15
  // Consumers who want the un-aliased module can import "<pkg>/raw".
16
+ //
17
+ // `pthreadPoolSize` sizes the pthread worker pool the runtime pre-spawns (default:
18
+ // one per logical CPU). It also caps OCCT's default thread pool at the same count,
19
+ // before any parallel algorithm can run: otherwise OCCT sizes its pool from the CPU
20
+ // count and asks for more threads than were pre-spawned, which Node absorbs by
21
+ // spawning workers on demand but which can deadlock a browser.
16
22
 
17
23
  import rawInit from "./opencascade.fluidcad.multi-threaded.js";
18
24
  import ALIASES from "./aliases.generated.js";
19
25
 
20
26
  /**
21
27
  * Initialize the OCCT V8 WASM module with deprecated OCCT type names restored.
22
- * @param {Record<string, unknown>} [options] Emscripten Module overrides (e.g. `locateFile`).
28
+ * @param {Record<string, unknown> & { pthreadPoolSize?: number }} [options] Emscripten
29
+ * Module overrides (e.g. `locateFile`), plus `pthreadPoolSize`.
23
30
  * @returns {Promise<any>} the initialized instance (canonical + deprecated names).
24
31
  */
25
32
  export default async function init(options) {
@@ -30,5 +37,11 @@ export default async function init(options) {
30
37
  oc[alias] = oc[canonical];
31
38
  }
32
39
  }
40
+ const poolSize = options?.pthreadPoolSize;
41
+ if (Number.isInteger(poolSize) && poolSize >= 1) {
42
+ // The first DefaultPool() call creates the pool at that size; drop the
43
+ // returned handle wrapper, the pool itself lives on as OCCT's static.
44
+ oc.OSD_ThreadPool.DefaultPool(poolSize).delete();
45
+ }
33
46
  return oc;
34
47
  }
@@ -8,12 +8,12 @@
8
8
  "outputs": [
9
9
  {
10
10
  "js_exists": true,
11
- "js_size": 68072,
11
+ "js_size": 68071,
12
12
  "name": "opencascade.fluidcad.multi-threaded.js",
13
13
  "pass": true,
14
14
  "wasm_exists": true,
15
15
  "wasm_file": "opencascade.fluidcad.multi-threaded.wasm",
16
- "wasm_size": 23274877
16
+ "wasm_size": 23369947
17
17
  }
18
18
  ],
19
19
  "runtime_helpers": {
@@ -30,8 +30,8 @@
30
30
  "symbols": {
31
31
  "alias_resolved": [],
32
32
  "builtin": [],
33
- "compiled": 5359,
34
- "extra_compiled": 5029,
33
+ "compiled": 5361,
34
+ "extra_compiled": 5016,
35
35
  "missing": [],
36
36
  "pass": true,
37
37
  "requested": [
@@ -41,10 +41,15 @@
41
41
  "Adaptor3d_Surface",
42
42
  "AppParCurves_Constraint",
43
43
  "BOPAlgo_Algo",
44
+ "BOPAlgo_ArgumentAnalyzer",
45
+ "BOPAlgo_ArgumentAnalyzerExt",
44
46
  "BOPAlgo_Builder",
45
47
  "BOPAlgo_BuilderShape",
46
48
  "BOPAlgo_CellsBuilder",
49
+ "BOPAlgo_CheckResult",
50
+ "BOPAlgo_CheckStatus",
47
51
  "BOPAlgo_GlueEnum",
52
+ "BOPAlgo_Operation",
48
53
  "BOPAlgo_Options",
49
54
  "BOPAlgo_Splitter",
50
55
  "BOPAlgo_ToolsProvider",
@@ -54,6 +59,7 @@
54
59
  "BRepAlgoAPI_Algo",
55
60
  "BRepAlgoAPI_BooleanOperation",
56
61
  "BRepAlgoAPI_BuilderAlgo",
62
+ "BRepAlgoAPI_Check",
57
63
  "BRepAlgoAPI_Common",
58
64
  "BRepAlgoAPI_Cut",
59
65
  "BRepAlgoAPI_Fuse",
@@ -62,6 +68,7 @@
62
68
  "BRepAlgo_NormalProjection",
63
69
  "BRepBndLib",
64
70
  "BRepBuilderAPI_Command",
71
+ "BRepBuilderAPI_Copy",
65
72
  "BRepBuilderAPI_FindPlane",
66
73
  "BRepBuilderAPI_MakeEdge",
67
74
  "BRepBuilderAPI_MakeFace",
@@ -114,6 +121,7 @@
114
121
  "BRepTools",
115
122
  "BRepTools_History",
116
123
  "BRepTools_Modifier",
124
+ "BRepTools_ReShape",
117
125
  "BRepTools_WireExplorer",
118
126
  "BRep_Builder",
119
127
  "BRep_Tool",
@@ -128,6 +136,7 @@
128
136
  "ChFi3d_FilletShape",
129
137
  "Extrema_ExtAlgo",
130
138
  "Extrema_ExtFlag",
139
+ "FluidCAD_Array2Access",
131
140
  "GCPnts_AbscissaPoint",
132
141
  "GC_MakeArcOfCircle",
133
142
  "GC_MakeArcOfEllipse",
@@ -198,12 +207,15 @@
198
207
  "GeomAdaptor_TransformedCurve",
199
208
  "GeomAdaptor_TransformedSurface",
200
209
  "GeomConvert",
210
+ "GeomConvert_BSplineSurfaceToBezierSurface",
211
+ "GeomConvert_CompBezierSurfacesToBSplineSurface",
201
212
  "GeomConvert_ConvType",
202
213
  "GeomConvert_CurveToAnaCurve",
203
214
  "GeomLProp_SLProps",
204
215
  "Geom_BSplineCurve",
205
216
  "Geom_BSplineSurface",
206
217
  "Geom_BezierCurve",
218
+ "Geom_BezierSurface",
207
219
  "Geom_BoundedCurve",
208
220
  "Geom_BoundedSurface",
209
221
  "Geom_Circle",
@@ -276,6 +288,7 @@
276
288
  "STEPControl_Writer",
277
289
  "ShapeAnalysis_FreeBounds",
278
290
  "ShapeAnalysis_WireOrder",
291
+ "ShapeBuild_ReShape",
279
292
  "ShapeCustom",
280
293
  "ShapeCustomExt",
281
294
  "ShapeExtend_WireData",
@@ -283,6 +296,8 @@
283
296
  "ShapeFix_Root",
284
297
  "ShapeFix_Shape",
285
298
  "ShapeFix_Wire",
299
+ "ShapeUpgrade_ShapeDivide",
300
+ "ShapeUpgrade_ShapeDivideContinuity",
286
301
  "ShapeUpgrade_UnifySameDomain",
287
302
  "Standard_Failure",
288
303
  "Standard_GUID",
@@ -370,5 +385,5 @@
370
385
  "timestamp": "2026-07-22T20:05:33Z",
371
386
  "validation_passed": true,
372
387
  "yaml_config": "fluidcad_multi.yml",
373
- "yaml_hash": "162e7437c520"
388
+ "yaml_hash": "8eb2a24b5c4e"
374
389
  }