@ifc-lite/wasm 1.0.0 → 1.1.1
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/README.md +175 -332
- package/package.json +17 -25
- package/pkg/ifc-lite.d.ts +592 -0
- package/{ifc_lite_wasm.js → pkg/ifc-lite.js} +777 -12
- package/pkg/ifc-lite_bg.wasm +0 -0
- package/ifc_lite_wasm.d.ts +0 -296
- package/ifc_lite_wasm_bg.wasm +0 -0
|
Binary file
|
package/ifc_lite_wasm.d.ts
DELETED
|
@@ -1,296 +0,0 @@
|
|
|
1
|
-
/* tslint:disable */
|
|
2
|
-
/* eslint-disable */
|
|
3
|
-
|
|
4
|
-
export class IfcAPI {
|
|
5
|
-
free(): void;
|
|
6
|
-
[Symbol.dispose](): void;
|
|
7
|
-
/**
|
|
8
|
-
* Get WASM memory for zero-copy access
|
|
9
|
-
*/
|
|
10
|
-
getMemory(): any;
|
|
11
|
-
/**
|
|
12
|
-
* Parse IFC file and return individual meshes with express IDs and colors
|
|
13
|
-
* This matches the MeshData[] format expected by the viewer
|
|
14
|
-
*
|
|
15
|
-
* Example:
|
|
16
|
-
* ```javascript
|
|
17
|
-
* const api = new IfcAPI();
|
|
18
|
-
* const collection = api.parseMeshes(ifcData);
|
|
19
|
-
* for (let i = 0; i < collection.length; i++) {
|
|
20
|
-
* const mesh = collection.get(i);
|
|
21
|
-
* console.log('Express ID:', mesh.expressId);
|
|
22
|
-
* console.log('Positions:', mesh.positions);
|
|
23
|
-
* console.log('Color:', mesh.color);
|
|
24
|
-
* }
|
|
25
|
-
* ```
|
|
26
|
-
*/
|
|
27
|
-
parseMeshes(content: string): MeshCollection;
|
|
28
|
-
/**
|
|
29
|
-
* Parse IFC file with streaming events
|
|
30
|
-
* Calls the callback function for each parse event
|
|
31
|
-
*
|
|
32
|
-
* Example:
|
|
33
|
-
* ```javascript
|
|
34
|
-
* const api = new IfcAPI();
|
|
35
|
-
* await api.parseStreaming(ifcData, (event) => {
|
|
36
|
-
* console.log('Event:', event);
|
|
37
|
-
* });
|
|
38
|
-
* ```
|
|
39
|
-
*/
|
|
40
|
-
parseStreaming(content: string, callback: Function): Promise<any>;
|
|
41
|
-
/**
|
|
42
|
-
* Parse IFC file with zero-copy mesh data
|
|
43
|
-
* Maximum performance - returns mesh with direct memory access
|
|
44
|
-
*
|
|
45
|
-
* Example:
|
|
46
|
-
* ```javascript
|
|
47
|
-
* const api = new IfcAPI();
|
|
48
|
-
* const mesh = await api.parseZeroCopy(ifcData);
|
|
49
|
-
*
|
|
50
|
-
* // Create TypedArray views (NO COPYING!)
|
|
51
|
-
* const memory = await api.getMemory();
|
|
52
|
-
* const positions = new Float32Array(
|
|
53
|
-
* memory.buffer,
|
|
54
|
-
* mesh.positions_ptr,
|
|
55
|
-
* mesh.positions_len
|
|
56
|
-
* );
|
|
57
|
-
*
|
|
58
|
-
* // Upload directly to GPU
|
|
59
|
-
* gl.bufferData(gl.ARRAY_BUFFER, positions, gl.STATIC_DRAW);
|
|
60
|
-
* ```
|
|
61
|
-
*/
|
|
62
|
-
parseZeroCopy(content: string): ZeroCopyMesh;
|
|
63
|
-
/**
|
|
64
|
-
* Debug: Test processing entity #953 (FacetedBrep wall)
|
|
65
|
-
*/
|
|
66
|
-
debugProcessEntity953(content: string): string;
|
|
67
|
-
/**
|
|
68
|
-
* Debug: Test processing a single wall
|
|
69
|
-
*/
|
|
70
|
-
debugProcessFirstWall(content: string): string;
|
|
71
|
-
/**
|
|
72
|
-
* Create and initialize the IFC API
|
|
73
|
-
*/
|
|
74
|
-
constructor();
|
|
75
|
-
/**
|
|
76
|
-
* Parse IFC file (traditional - waits for completion)
|
|
77
|
-
*
|
|
78
|
-
* Example:
|
|
79
|
-
* ```javascript
|
|
80
|
-
* const api = new IfcAPI();
|
|
81
|
-
* const result = await api.parse(ifcData);
|
|
82
|
-
* console.log('Entities:', result.entityCount);
|
|
83
|
-
* ```
|
|
84
|
-
*/
|
|
85
|
-
parse(content: string): Promise<any>;
|
|
86
|
-
/**
|
|
87
|
-
* Get version string
|
|
88
|
-
*/
|
|
89
|
-
readonly version: string;
|
|
90
|
-
/**
|
|
91
|
-
* Check if API is initialized
|
|
92
|
-
*/
|
|
93
|
-
readonly is_ready: boolean;
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
export class MeshCollection {
|
|
97
|
-
private constructor();
|
|
98
|
-
free(): void;
|
|
99
|
-
[Symbol.dispose](): void;
|
|
100
|
-
/**
|
|
101
|
-
* Get mesh at index
|
|
102
|
-
*/
|
|
103
|
-
get(index: number): MeshDataJs | undefined;
|
|
104
|
-
/**
|
|
105
|
-
* Get total vertex count across all meshes
|
|
106
|
-
*/
|
|
107
|
-
readonly totalVertices: number;
|
|
108
|
-
/**
|
|
109
|
-
* Get total triangle count across all meshes
|
|
110
|
-
*/
|
|
111
|
-
readonly totalTriangles: number;
|
|
112
|
-
/**
|
|
113
|
-
* Get number of meshes
|
|
114
|
-
*/
|
|
115
|
-
readonly length: number;
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
export class MeshDataJs {
|
|
119
|
-
private constructor();
|
|
120
|
-
free(): void;
|
|
121
|
-
[Symbol.dispose](): void;
|
|
122
|
-
/**
|
|
123
|
-
* Get express ID
|
|
124
|
-
*/
|
|
125
|
-
readonly expressId: number;
|
|
126
|
-
/**
|
|
127
|
-
* Get vertex count
|
|
128
|
-
*/
|
|
129
|
-
readonly vertexCount: number;
|
|
130
|
-
/**
|
|
131
|
-
* Get triangle count
|
|
132
|
-
*/
|
|
133
|
-
readonly triangleCount: number;
|
|
134
|
-
/**
|
|
135
|
-
* Get color as [r, g, b, a] array
|
|
136
|
-
*/
|
|
137
|
-
readonly color: Float32Array;
|
|
138
|
-
/**
|
|
139
|
-
* Get indices as Uint32Array (copy to JS)
|
|
140
|
-
*/
|
|
141
|
-
readonly indices: Uint32Array;
|
|
142
|
-
/**
|
|
143
|
-
* Get normals as Float32Array (copy to JS)
|
|
144
|
-
*/
|
|
145
|
-
readonly normals: Float32Array;
|
|
146
|
-
/**
|
|
147
|
-
* Get positions as Float32Array (copy to JS)
|
|
148
|
-
*/
|
|
149
|
-
readonly positions: Float32Array;
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
export class ZeroCopyMesh {
|
|
153
|
-
free(): void;
|
|
154
|
-
[Symbol.dispose](): void;
|
|
155
|
-
/**
|
|
156
|
-
* Get bounding box maximum point
|
|
157
|
-
*/
|
|
158
|
-
bounds_max(): Float32Array;
|
|
159
|
-
/**
|
|
160
|
-
* Get bounding box minimum point
|
|
161
|
-
*/
|
|
162
|
-
bounds_min(): Float32Array;
|
|
163
|
-
/**
|
|
164
|
-
* Create a new zero-copy mesh from a Mesh
|
|
165
|
-
*/
|
|
166
|
-
constructor();
|
|
167
|
-
/**
|
|
168
|
-
* Get length of indices array
|
|
169
|
-
*/
|
|
170
|
-
readonly indices_len: number;
|
|
171
|
-
/**
|
|
172
|
-
* Get pointer to indices array
|
|
173
|
-
*/
|
|
174
|
-
readonly indices_ptr: number;
|
|
175
|
-
/**
|
|
176
|
-
* Get length of normals array
|
|
177
|
-
*/
|
|
178
|
-
readonly normals_len: number;
|
|
179
|
-
/**
|
|
180
|
-
* Get pointer to normals array
|
|
181
|
-
*/
|
|
182
|
-
readonly normals_ptr: number;
|
|
183
|
-
/**
|
|
184
|
-
* Get vertex count
|
|
185
|
-
*/
|
|
186
|
-
readonly vertex_count: number;
|
|
187
|
-
/**
|
|
188
|
-
* Get length of positions array (in f32 elements, not bytes)
|
|
189
|
-
*/
|
|
190
|
-
readonly positions_len: number;
|
|
191
|
-
/**
|
|
192
|
-
* Get pointer to positions array
|
|
193
|
-
* JavaScript can create Float32Array view: new Float32Array(memory.buffer, ptr, length)
|
|
194
|
-
*/
|
|
195
|
-
readonly positions_ptr: number;
|
|
196
|
-
/**
|
|
197
|
-
* Get triangle count
|
|
198
|
-
*/
|
|
199
|
-
readonly triangle_count: number;
|
|
200
|
-
/**
|
|
201
|
-
* Check if mesh is empty
|
|
202
|
-
*/
|
|
203
|
-
readonly is_empty: boolean;
|
|
204
|
-
}
|
|
205
|
-
|
|
206
|
-
/**
|
|
207
|
-
* Get WASM memory to allow JavaScript to create TypedArray views
|
|
208
|
-
*/
|
|
209
|
-
export function get_memory(): any;
|
|
210
|
-
|
|
211
|
-
/**
|
|
212
|
-
* Initialize the WASM module
|
|
213
|
-
*/
|
|
214
|
-
export function init(): void;
|
|
215
|
-
|
|
216
|
-
/**
|
|
217
|
-
* Get the version of IFC-Lite
|
|
218
|
-
*/
|
|
219
|
-
export function version(): string;
|
|
220
|
-
|
|
221
|
-
export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembly.Module;
|
|
222
|
-
|
|
223
|
-
export interface InitOutput {
|
|
224
|
-
readonly memory: WebAssembly.Memory;
|
|
225
|
-
readonly __wbg_ifcapi_free: (a: number, b: number) => void;
|
|
226
|
-
readonly __wbg_meshcollection_free: (a: number, b: number) => void;
|
|
227
|
-
readonly __wbg_meshdatajs_free: (a: number, b: number) => void;
|
|
228
|
-
readonly __wbg_zerocopymesh_free: (a: number, b: number) => void;
|
|
229
|
-
readonly ifcapi_debugProcessEntity953: (a: number, b: number, c: number, d: number) => void;
|
|
230
|
-
readonly ifcapi_debugProcessFirstWall: (a: number, b: number, c: number, d: number) => void;
|
|
231
|
-
readonly ifcapi_getMemory: (a: number) => number;
|
|
232
|
-
readonly ifcapi_is_ready: (a: number) => number;
|
|
233
|
-
readonly ifcapi_new: () => number;
|
|
234
|
-
readonly ifcapi_parse: (a: number, b: number, c: number) => number;
|
|
235
|
-
readonly ifcapi_parseMeshes: (a: number, b: number, c: number) => number;
|
|
236
|
-
readonly ifcapi_parseStreaming: (a: number, b: number, c: number, d: number) => number;
|
|
237
|
-
readonly ifcapi_parseZeroCopy: (a: number, b: number, c: number) => number;
|
|
238
|
-
readonly ifcapi_version: (a: number, b: number) => void;
|
|
239
|
-
readonly meshcollection_get: (a: number, b: number) => number;
|
|
240
|
-
readonly meshcollection_length: (a: number) => number;
|
|
241
|
-
readonly meshcollection_totalTriangles: (a: number) => number;
|
|
242
|
-
readonly meshcollection_totalVertices: (a: number) => number;
|
|
243
|
-
readonly meshdatajs_color: (a: number, b: number) => void;
|
|
244
|
-
readonly meshdatajs_expressId: (a: number) => number;
|
|
245
|
-
readonly meshdatajs_indices: (a: number) => number;
|
|
246
|
-
readonly meshdatajs_normals: (a: number) => number;
|
|
247
|
-
readonly meshdatajs_positions: (a: number) => number;
|
|
248
|
-
readonly meshdatajs_triangleCount: (a: number) => number;
|
|
249
|
-
readonly meshdatajs_vertexCount: (a: number) => number;
|
|
250
|
-
readonly version: (a: number) => void;
|
|
251
|
-
readonly zerocopymesh_bounds_max: (a: number, b: number) => void;
|
|
252
|
-
readonly zerocopymesh_bounds_min: (a: number, b: number) => void;
|
|
253
|
-
readonly zerocopymesh_indices_len: (a: number) => number;
|
|
254
|
-
readonly zerocopymesh_indices_ptr: (a: number) => number;
|
|
255
|
-
readonly zerocopymesh_is_empty: (a: number) => number;
|
|
256
|
-
readonly zerocopymesh_new: () => number;
|
|
257
|
-
readonly zerocopymesh_normals_len: (a: number) => number;
|
|
258
|
-
readonly zerocopymesh_normals_ptr: (a: number) => number;
|
|
259
|
-
readonly zerocopymesh_positions_len: (a: number) => number;
|
|
260
|
-
readonly zerocopymesh_positions_ptr: (a: number) => number;
|
|
261
|
-
readonly init: () => void;
|
|
262
|
-
readonly zerocopymesh_triangle_count: (a: number) => number;
|
|
263
|
-
readonly zerocopymesh_vertex_count: (a: number) => number;
|
|
264
|
-
readonly get_memory: () => number;
|
|
265
|
-
readonly __wasm_bindgen_func_elem_160: (a: number, b: number, c: number) => void;
|
|
266
|
-
readonly __wasm_bindgen_func_elem_159: (a: number, b: number) => void;
|
|
267
|
-
readonly __wasm_bindgen_func_elem_198: (a: number, b: number, c: number, d: number) => void;
|
|
268
|
-
readonly __wbindgen_export: (a: number, b: number) => number;
|
|
269
|
-
readonly __wbindgen_export2: (a: number, b: number, c: number, d: number) => number;
|
|
270
|
-
readonly __wbindgen_export3: (a: number) => void;
|
|
271
|
-
readonly __wbindgen_export4: (a: number, b: number, c: number) => void;
|
|
272
|
-
readonly __wbindgen_add_to_stack_pointer: (a: number) => number;
|
|
273
|
-
readonly __wbindgen_start: () => void;
|
|
274
|
-
}
|
|
275
|
-
|
|
276
|
-
export type SyncInitInput = BufferSource | WebAssembly.Module;
|
|
277
|
-
|
|
278
|
-
/**
|
|
279
|
-
* Instantiates the given `module`, which can either be bytes or
|
|
280
|
-
* a precompiled `WebAssembly.Module`.
|
|
281
|
-
*
|
|
282
|
-
* @param {{ module: SyncInitInput }} module - Passing `SyncInitInput` directly is deprecated.
|
|
283
|
-
*
|
|
284
|
-
* @returns {InitOutput}
|
|
285
|
-
*/
|
|
286
|
-
export function initSync(module: { module: SyncInitInput } | SyncInitInput): InitOutput;
|
|
287
|
-
|
|
288
|
-
/**
|
|
289
|
-
* If `module_or_path` is {RequestInfo} or {URL}, makes a request and
|
|
290
|
-
* for everything else, calls `WebAssembly.instantiate` directly.
|
|
291
|
-
*
|
|
292
|
-
* @param {{ module_or_path: InitInput | Promise<InitInput> }} module_or_path - Passing `InitInput` directly is deprecated.
|
|
293
|
-
*
|
|
294
|
-
* @returns {Promise<InitOutput>}
|
|
295
|
-
*/
|
|
296
|
-
export default function __wbg_init (module_or_path?: { module_or_path: InitInput | Promise<InitInput> } | InitInput | Promise<InitInput>): Promise<InitOutput>;
|
package/ifc_lite_wasm_bg.wasm
DELETED
|
Binary file
|