occt-wasm 0.1.7 → 1.0.2
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.
- package/dist/index.d.ts +203 -14
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1035 -70
- package/dist/index.js.map +1 -1
- package/dist/occt-wasm.js +1 -1
- package/dist/occt-wasm.wasm +0 -0
- package/dist/types.d.ts +161 -19
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +5 -1
- package/dist/types.js.map +1 -1
- package/package.json +4 -2
package/dist/occt-wasm.wasm
CHANGED
|
Binary file
|
package/dist/types.d.ts
CHANGED
|
@@ -1,20 +1,29 @@
|
|
|
1
|
-
/**
|
|
1
|
+
/**
|
|
2
|
+
* Branded handle type — prevents passing raw numbers as shape IDs.
|
|
3
|
+
* Obtain handles from kernel methods; release via {@link OcctKernel.release}.
|
|
4
|
+
*/
|
|
2
5
|
declare const ShapeHandleBrand: unique symbol;
|
|
3
6
|
export type ShapeHandle = number & {
|
|
4
7
|
readonly [ShapeHandleBrand]: never;
|
|
5
8
|
};
|
|
6
|
-
/** Triangle mesh data
|
|
9
|
+
/** Triangle mesh data produced by BRepMesh tessellation. */
|
|
7
10
|
export interface Mesh {
|
|
8
11
|
/** XYZ interleaved vertex positions. Length = vertexCount * 3. */
|
|
9
12
|
positions: Float32Array;
|
|
10
13
|
/** XYZ interleaved vertex normals. Length = vertexCount * 3. */
|
|
11
14
|
normals: Float32Array;
|
|
12
|
-
/** Triangle indices into positions/normals arrays. */
|
|
15
|
+
/** Triangle indices into the positions/normals arrays. */
|
|
13
16
|
indices: Uint32Array;
|
|
17
|
+
/** Number of vertices (positions.length / 3). */
|
|
14
18
|
vertexCount: number;
|
|
19
|
+
/** Number of triangles (indices.length / 3). */
|
|
15
20
|
triangleCount: number;
|
|
21
|
+
/** Per-face triangle groups: [triStart, triCount, faceHash] triples. Present when using meshShape(). */
|
|
22
|
+
faceGroups?: Int32Array | undefined;
|
|
23
|
+
/** Number of face groups. Present when using meshShape(). */
|
|
24
|
+
faceCount?: number | undefined;
|
|
16
25
|
}
|
|
17
|
-
/** Axis-aligned bounding box. */
|
|
26
|
+
/** Axis-aligned bounding box (AABB). */
|
|
18
27
|
export interface BoundingBox {
|
|
19
28
|
xmin: number;
|
|
20
29
|
ymin: number;
|
|
@@ -23,68 +32,201 @@ export interface BoundingBox {
|
|
|
23
32
|
ymax: number;
|
|
24
33
|
zmax: number;
|
|
25
34
|
}
|
|
26
|
-
/** 3D vector. */
|
|
35
|
+
/** 3D point or direction vector. */
|
|
27
36
|
export interface Vec3 {
|
|
28
37
|
x: number;
|
|
29
38
|
y: number;
|
|
30
39
|
z: number;
|
|
31
40
|
}
|
|
32
|
-
/** Options
|
|
41
|
+
/** Options controlling BRepMesh tessellation quality. */
|
|
33
42
|
export interface TessellateOptions {
|
|
34
|
-
/**
|
|
43
|
+
/** Maximum chord deviation from the true surface. Default: 0.1 */
|
|
35
44
|
linearDeflection?: number | undefined;
|
|
36
|
-
/**
|
|
45
|
+
/** Maximum angular deviation in radians. Default: 0.5 */
|
|
37
46
|
angularDeflection?: number | undefined;
|
|
38
47
|
}
|
|
39
|
-
/** Options for WASM initialization. */
|
|
48
|
+
/** Options for WASM module initialization. */
|
|
40
49
|
export interface InitOptions {
|
|
41
|
-
/** Browser: URL to .wasm file. */
|
|
50
|
+
/** Browser: URL to the .wasm file (e.g. from a CDN or bundler public path). */
|
|
42
51
|
wasmUrl?: string | undefined;
|
|
43
|
-
/** Node.js: filesystem path to .wasm file. */
|
|
52
|
+
/** Node.js: filesystem path to the .wasm file. */
|
|
44
53
|
wasmPath?: string | undefined;
|
|
45
54
|
}
|
|
46
|
-
/** RGB color
|
|
55
|
+
/** RGB color triple, each channel in the range 0..1. */
|
|
47
56
|
export type Color3 = [number, number, number];
|
|
48
|
-
/**
|
|
57
|
+
/**
|
|
58
|
+
* Branded label ID for type safety within an XCAF document.
|
|
59
|
+
* Obtained from {@link XCAFDocument} methods; not interchangeable across documents.
|
|
60
|
+
*/
|
|
49
61
|
declare const LabelTagBrand: unique symbol;
|
|
50
62
|
export type LabelTag = number & {
|
|
51
63
|
readonly [LabelTagBrand]: never;
|
|
52
64
|
};
|
|
53
|
-
/**
|
|
65
|
+
/** Translation + rotation for positioning an assembly component. */
|
|
54
66
|
export interface Location {
|
|
67
|
+
/** Translation along X. */
|
|
55
68
|
tx?: number | undefined;
|
|
69
|
+
/** Translation along Y. */
|
|
56
70
|
ty?: number | undefined;
|
|
71
|
+
/** Translation along Z. */
|
|
57
72
|
tz?: number | undefined;
|
|
73
|
+
/** Rotation around X in radians. */
|
|
58
74
|
rx?: number | undefined;
|
|
75
|
+
/** Rotation around Y in radians. */
|
|
59
76
|
ry?: number | undefined;
|
|
77
|
+
/** Rotation around Z in radians. */
|
|
60
78
|
rz?: number | undefined;
|
|
61
79
|
}
|
|
62
|
-
/** Options for adding a shape to an XCAF document. */
|
|
80
|
+
/** Options for adding a root shape to an XCAF document. */
|
|
63
81
|
export interface AddShapeOptions {
|
|
82
|
+
/** Display name for the label. */
|
|
64
83
|
name?: string | undefined;
|
|
84
|
+
/** RGB color to assign to the shape label. */
|
|
65
85
|
color?: Color3 | undefined;
|
|
66
86
|
}
|
|
67
|
-
/** Options for adding a child component. */
|
|
87
|
+
/** Options for adding a child component to an assembly label. */
|
|
68
88
|
export interface AddChildOptions extends AddShapeOptions {
|
|
89
|
+
/** Placement transform relative to the parent. */
|
|
69
90
|
location?: Location | undefined;
|
|
70
91
|
}
|
|
71
|
-
/**
|
|
92
|
+
/** Metadata for a label in an XCAF document. */
|
|
72
93
|
export interface LabelInfo {
|
|
94
|
+
/** Numeric label ID within the document. */
|
|
73
95
|
labelId: number;
|
|
96
|
+
/** Display name (empty string if unset). */
|
|
74
97
|
name: string;
|
|
98
|
+
/** Whether a color has been explicitly set on this label. */
|
|
75
99
|
hasColor: boolean;
|
|
100
|
+
/** RGB color (meaningful only when hasColor is true). */
|
|
76
101
|
color: Color3;
|
|
102
|
+
/** True if this label is an assembly (has child components). */
|
|
77
103
|
isAssembly: boolean;
|
|
104
|
+
/** True if this label is a component reference. */
|
|
78
105
|
isComponent: boolean;
|
|
106
|
+
/** Associated shape handle, or null if the label has no shape. */
|
|
79
107
|
shapeHandle: ShapeHandle | null;
|
|
80
108
|
}
|
|
81
|
-
/** Options for glTF export. */
|
|
109
|
+
/** Options for glTF export via XCAF. */
|
|
82
110
|
export interface GLTFExportOptions {
|
|
111
|
+
/** Maximum chord deviation for mesh generation. */
|
|
83
112
|
linearDeflection?: number | undefined;
|
|
113
|
+
/** Maximum angular deviation in radians for mesh generation. */
|
|
84
114
|
angularDeflection?: number | undefined;
|
|
85
115
|
}
|
|
86
|
-
/**
|
|
116
|
+
/** TopAbs_ShapeEnum value returned by getShapeType. */
|
|
117
|
+
export type ShapeType = "compound" | "compsolid" | "solid" | "shell" | "face" | "wire" | "edge" | "vertex" | "shape";
|
|
118
|
+
/** TopAbs_Orientation value returned by shapeOrientation. */
|
|
119
|
+
export type ShapeOrientation = "forward" | "reversed" | "internal" | "external";
|
|
120
|
+
/** BRepClass_FaceClassifier result for a UV point relative to a face boundary. */
|
|
121
|
+
export type PointClassification = "in" | "on" | "out";
|
|
122
|
+
/** Geom_Surface subclass identifier returned by surfaceType. */
|
|
123
|
+
export type SurfaceKind = "plane" | "cylinder" | "cone" | "sphere" | "torus" | "bspline" | "bezier" | "offset" | "revolution" | "extrusion" | (string & {});
|
|
124
|
+
/** Geom_Curve subclass identifier returned by curveType. */
|
|
125
|
+
export type CurveKind = "line" | "circle" | "ellipse" | "hyperbola" | "parabola" | "bspline" | "bezier" | "offset" | (string & {});
|
|
126
|
+
/** Transition mode for BRepBuilderAPI_MakeSweep. 0=transformed, 1=right-corner, 2=round-corner. */
|
|
127
|
+
export type TransitionMode = 0 | 1 | 2;
|
|
128
|
+
/** Join type for BRepOffsetAPI_MakeOffset. 0=arc, 1=tangent, 2=intersection. */
|
|
129
|
+
export type JoinType = 0 | 1 | 2;
|
|
130
|
+
/** Boolean operation code for booleanPipeline. 0=fuse, 1=cut, 2=common. */
|
|
131
|
+
export type BooleanOp = 0 | 1 | 2;
|
|
132
|
+
/** UV parameter bounds of a face surface. */
|
|
133
|
+
export interface UVBounds {
|
|
134
|
+
uMin: number;
|
|
135
|
+
uMax: number;
|
|
136
|
+
vMin: number;
|
|
137
|
+
vMax: number;
|
|
138
|
+
}
|
|
139
|
+
/** Principal curvatures at a UV point on a face surface. */
|
|
140
|
+
export interface CurvatureData {
|
|
141
|
+
/** Minimum principal curvature. */
|
|
142
|
+
min: number;
|
|
143
|
+
/** Maximum principal curvature. */
|
|
144
|
+
max: number;
|
|
145
|
+
/** Gaussian curvature (min * max). */
|
|
146
|
+
gaussian: number;
|
|
147
|
+
/** Mean curvature ((min + max) / 2). */
|
|
148
|
+
mean: number;
|
|
149
|
+
}
|
|
150
|
+
/** Polyline edge data from wireframe tessellation. */
|
|
151
|
+
export interface EdgeData {
|
|
152
|
+
/** XYZ interleaved edge sample points. Length = pointCount. */
|
|
153
|
+
points: Float32Array;
|
|
154
|
+
/** Per-edge groups: [pointStart, pointCount, edgeHash] triples. */
|
|
155
|
+
edgeGroups: Int32Array;
|
|
156
|
+
/** Total number of floats in points (= number of XYZ coords). */
|
|
157
|
+
pointCount: number;
|
|
158
|
+
/** Number of distinct edges. */
|
|
159
|
+
edgeCount: number;
|
|
160
|
+
}
|
|
161
|
+
/**
|
|
162
|
+
* Shape history data from an operation that tracks face evolution.
|
|
163
|
+
* Maps input face hashes to their modified/generated/deleted status.
|
|
164
|
+
*/
|
|
165
|
+
export interface EvolutionData {
|
|
166
|
+
/** Result shape handle. */
|
|
167
|
+
result: ShapeHandle;
|
|
168
|
+
/** Face hashes from the input that were modified in the result. */
|
|
169
|
+
modified: number[];
|
|
170
|
+
/** New face hashes generated by the operation. */
|
|
171
|
+
generated: number[];
|
|
172
|
+
/** Face hashes from the input that no longer exist in the result. */
|
|
173
|
+
deleted: number[];
|
|
174
|
+
}
|
|
175
|
+
/** HLR (hidden line removal) projection result, split by visibility and edge category. */
|
|
176
|
+
export interface ProjectionData {
|
|
177
|
+
/** Visible silhouette/outline edges. */
|
|
178
|
+
visibleOutline: ShapeHandle;
|
|
179
|
+
/** Visible smooth (tangent-continuous) edges. */
|
|
180
|
+
visibleSmooth: ShapeHandle;
|
|
181
|
+
/** Visible sharp (G1-discontinuous) edges. */
|
|
182
|
+
visibleSharp: ShapeHandle;
|
|
183
|
+
/** Hidden silhouette/outline edges. */
|
|
184
|
+
hiddenOutline: ShapeHandle;
|
|
185
|
+
/** Hidden smooth edges. */
|
|
186
|
+
hiddenSmooth: ShapeHandle;
|
|
187
|
+
/** Hidden sharp edges. */
|
|
188
|
+
hiddenSharp: ShapeHandle;
|
|
189
|
+
}
|
|
190
|
+
/** NURBS/BSpline curve data extracted from an edge via Geom_BSplineCurve. */
|
|
191
|
+
export interface NurbsCurveData {
|
|
192
|
+
/** Polynomial degree of the BSpline. */
|
|
193
|
+
degree: number;
|
|
194
|
+
/** True if the curve uses rational weights. */
|
|
195
|
+
rational: boolean;
|
|
196
|
+
/** True if the curve is periodic. */
|
|
197
|
+
periodic: boolean;
|
|
198
|
+
/** Knot values. */
|
|
199
|
+
knots: number[];
|
|
200
|
+
/** Knot multiplicities (same length as knots). */
|
|
201
|
+
multiplicities: number[];
|
|
202
|
+
/** Flat [x,y,z, x,y,z, ...] control point coordinates. */
|
|
203
|
+
poles: number[];
|
|
204
|
+
/** Control point weights (same count as poles/3). */
|
|
205
|
+
weights: number[];
|
|
206
|
+
}
|
|
207
|
+
/** Concatenated mesh data for multiple shapes, produced by meshBatch. */
|
|
208
|
+
export interface MeshBatchData {
|
|
209
|
+
/** Interleaved XYZ positions for all shapes. */
|
|
210
|
+
positions: Float32Array;
|
|
211
|
+
/** Interleaved XYZ normals for all shapes. */
|
|
212
|
+
normals: Float32Array;
|
|
213
|
+
/** Triangle indices for all shapes. */
|
|
214
|
+
indices: Uint32Array;
|
|
215
|
+
/** Per-shape offsets: [posStart, posCount, idxStart, idxCount] quads. */
|
|
216
|
+
shapeOffsets: Int32Array;
|
|
217
|
+
/** Number of shapes in the batch. */
|
|
218
|
+
shapeCount: number;
|
|
219
|
+
/** Total vertex count across all shapes. */
|
|
220
|
+
vertexCount: number;
|
|
221
|
+
/** Total triangle count across all shapes. */
|
|
222
|
+
triangleCount: number;
|
|
223
|
+
}
|
|
224
|
+
/**
|
|
225
|
+
* Typed error thrown when an OCCT operation fails.
|
|
226
|
+
* The `operation` field identifies which kernel method raised the error.
|
|
227
|
+
*/
|
|
87
228
|
export declare class OcctError extends Error {
|
|
229
|
+
/** Name of the kernel method that failed. */
|
|
88
230
|
readonly operation: string;
|
|
89
231
|
constructor(operation: string, message: string);
|
|
90
232
|
}
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,CAAC,MAAM,gBAAgB,EAAE,OAAO,MAAM,CAAC;AAC9C,MAAM,MAAM,WAAW,GAAG,MAAM,GAAG;IAAE,QAAQ,CAAC,CAAC,gBAAgB,CAAC,EAAE,KAAK,CAAA;CAAE,CAAC;AAE1E,4DAA4D;AAC5D,MAAM,WAAW,IAAI;IACjB,kEAAkE;IAClE,SAAS,EAAE,YAAY,CAAC;IACxB,gEAAgE;IAChE,OAAO,EAAE,YAAY,CAAC;IACtB,0DAA0D;IAC1D,OAAO,EAAE,WAAW,CAAC;IACrB,iDAAiD;IACjD,WAAW,EAAE,MAAM,CAAC;IACpB,gDAAgD;IAChD,aAAa,EAAE,MAAM,CAAC;IACtB,wGAAwG;IACxG,UAAU,CAAC,EAAE,UAAU,GAAG,SAAS,CAAC;IACpC,6DAA6D;IAC7D,SAAS,CAAC,EAAE,MAAM,GA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tB,uCAAuC;IACvC,OAAO,EAAE,WAAW,CAAC;IACrB,yEAAyE;IACzE,YAAY,EAAE,UAAU,CAAC;IACzB,qCAAqC;IACrC,UAAU,EAAE,MAAM,CAAC;IACnB,4CAA4C;IAC5C,WAAW,EAAE,MAAM,CAAC;IACpB,8CAA8C;IAC9C,aAAa,EAAE,MAAM,CAAC;CACzB;AAED;;;GAGG;AACH,qBAAa,SAAU,SAAQ,KAAK;IAChC,6CAA6C;IAC7C,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;gBAEf,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM;CAKjD"}
|
package/dist/types.js
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
|
-
/**
|
|
1
|
+
/**
|
|
2
|
+
* Typed error thrown when an OCCT operation fails.
|
|
3
|
+
* The `operation` field identifies which kernel method raised the error.
|
|
4
|
+
*/
|
|
2
5
|
export class OcctError extends Error {
|
|
6
|
+
/** Name of the kernel method that failed. */
|
|
3
7
|
operation;
|
|
4
8
|
constructor(operation, message) {
|
|
5
9
|
super(`${operation}: ${message}`);
|
package/dist/types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAyPA;;;GAGG;AACH,MAAM,OAAO,SAAU,SAAQ,KAAK;IAChC,6CAA6C;IACpC,SAAS,CAAS;IAE3B,YAAY,SAAiB,EAAE,OAAe;QAC1C,KAAK,CAAC,GAAG,SAAS,KAAK,OAAO,EAAE,CAAC,CAAC;QAClC,IAAI,CAAC,IAAI,GAAG,WAAW,CAAC;QACxB,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;IAC/B,CAAC;CACJ"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "occt-wasm",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "1.0.2",
|
|
4
4
|
"description": "OpenCascade (OCCT) compiled to WebAssembly with a clean TypeScript API",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -17,7 +17,8 @@
|
|
|
17
17
|
"prebuild": "cp ../dist/occt-wasm.js ../dist/occt-wasm.wasm dist/ 2>/dev/null || true",
|
|
18
18
|
"lint": "eslint src/",
|
|
19
19
|
"typecheck": "tsc --noEmit",
|
|
20
|
-
"test": "vitest run"
|
|
20
|
+
"test": "vitest run",
|
|
21
|
+
"docs": "typedoc"
|
|
21
22
|
},
|
|
22
23
|
"keywords": [
|
|
23
24
|
"opencascade",
|
|
@@ -40,6 +41,7 @@
|
|
|
40
41
|
"@typescript-eslint/eslint-plugin": "^8",
|
|
41
42
|
"@typescript-eslint/parser": "^8",
|
|
42
43
|
"eslint": "^9",
|
|
44
|
+
"typedoc": "^0.28.18",
|
|
43
45
|
"typescript": "^5.7",
|
|
44
46
|
"vitest": "^3"
|
|
45
47
|
}
|