@ifc-lite/wasm 10.2.0 → 10.3.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.
- package/README.md +31 -0
- package/package.json +1 -1
- package/pkg/ifc-lite.d.ts +30 -0
- package/pkg/ifc-lite.js +155 -0
- package/pkg/ifc-lite_bg.wasm +0 -0
package/README.md
CHANGED
|
@@ -236,3 +236,34 @@ the versioned behavior.
|
|
|
236
236
|
Combined fill and dashed-stroke paints can still refuse atomically when
|
|
237
237
|
multiple run boundaries produce crossings outside the current fill-region
|
|
238
238
|
qualifier.
|
|
239
|
+
|
|
240
|
+
## Retained alignment station frames
|
|
241
|
+
|
|
242
|
+
`AlignmentAxisJs` evaluates one `IfcAlignment` through the canonical Rust
|
|
243
|
+
evaluator. Its `GlobalId` and `Name` properties use exact IFC EXPRESS names;
|
|
244
|
+
`expressId`, `geometricHorizontalLengthMeters` and `approximate` are derived
|
|
245
|
+
metadata. The caller owns the handle and must call `free()` in `finally`.
|
|
246
|
+
|
|
247
|
+
```ts
|
|
248
|
+
import init, { AlignmentAxisJs } from '@ifc-lite/wasm';
|
|
249
|
+
|
|
250
|
+
await init();
|
|
251
|
+
const content = await (await fetch('alignment.ifc')).text();
|
|
252
|
+
const axis = new AlignmentAxisJs(content, 39);
|
|
253
|
+
try {
|
|
254
|
+
const sample = axis.evaluate(10);
|
|
255
|
+
console.log(axis.GlobalId, axis.Name, sample);
|
|
256
|
+
} finally {
|
|
257
|
+
axis.free();
|
|
258
|
+
}
|
|
259
|
+
```
|
|
260
|
+
|
|
261
|
+
`evaluate(distanceMeters)` returns a `Float64Array` containing horizontal
|
|
262
|
+
distance, absolute IFC Z-up point X/Y/Z in metres, and normalized world tangent
|
|
263
|
+
X/Y/Z. Distance is alignment-local geometric horizontal length from the physical
|
|
264
|
+
start, independent of authored chainage and different from 3D arc length. No
|
|
265
|
+
renderer origin or axis conversion is applied. Nonfinite or out-of-range
|
|
266
|
+
distances and unresolved units, curves or placements fail explicitly. The
|
|
267
|
+
`approximate` flag identifies supported approximation paths; it must be exposed
|
|
268
|
+
to precision-sensitive consumers. Whole-source parsing belongs in a disposable
|
|
269
|
+
worker when used by the viewer, so releasing the tool also releases WASM pages.
|
package/package.json
CHANGED
package/pkg/ifc-lite.d.ts
CHANGED
|
@@ -182,6 +182,22 @@ export interface ExtrusionDefinitionsJs {
|
|
|
182
182
|
|
|
183
183
|
|
|
184
184
|
|
|
185
|
+
export class AlignmentAxisJs {
|
|
186
|
+
free(): void;
|
|
187
|
+
[Symbol.dispose](): void;
|
|
188
|
+
/**
|
|
189
|
+
* [horizontal distance, IFC Z-up point XYZ, normalized world tangent XYZ].
|
|
190
|
+
* Coordinates remain f64 absolute metres; no renderer origin is applied.
|
|
191
|
+
*/
|
|
192
|
+
evaluate(distance_m: number): Float64Array;
|
|
193
|
+
constructor(content: string, express_id: number);
|
|
194
|
+
readonly GlobalId: string | undefined;
|
|
195
|
+
readonly Name: string | undefined;
|
|
196
|
+
readonly approximate: boolean;
|
|
197
|
+
readonly expressId: number;
|
|
198
|
+
readonly geometricHorizontalLengthMeters: number;
|
|
199
|
+
}
|
|
200
|
+
|
|
185
201
|
/**
|
|
186
202
|
* The overlap solid of one clashing pair, or the reason there is none.
|
|
187
203
|
*/
|
|
@@ -937,6 +953,11 @@ export class IfcAPI {
|
|
|
937
953
|
* Does not mutate the IFC snapshot or decode the host-owned image.
|
|
938
954
|
*/
|
|
939
955
|
planCapturedMesh(content: Uint8Array, request_json: string): Uint8Array;
|
|
956
|
+
/**
|
|
957
|
+
* Plan opt-in map similarity normalization on a completed STEP export.
|
|
958
|
+
* Returns entity patches, allocated IDs and atomic refusal warnings as JSON.
|
|
959
|
+
*/
|
|
960
|
+
planMapConversionNormalization(content: Uint8Array): string;
|
|
940
961
|
/**
|
|
941
962
|
* Registered mesh observations over canonical target albedo. Host verifies
|
|
942
963
|
* original GLB identity against decoded source mesh/image and freezes frames.
|
|
@@ -2402,6 +2423,7 @@ export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembl
|
|
|
2402
2423
|
|
|
2403
2424
|
export interface InitOutput {
|
|
2404
2425
|
readonly memory: WebAssembly.Memory;
|
|
2426
|
+
readonly __wbg_alignmentaxisjs_free: (a: number, b: number) => void;
|
|
2405
2427
|
readonly __wbg_clashintersectionsolidjs_free: (a: number, b: number) => void;
|
|
2406
2428
|
readonly __wbg_clashrunresult_free: (a: number, b: number) => void;
|
|
2407
2429
|
readonly __wbg_clashsession_free: (a: number, b: number) => void;
|
|
@@ -2425,6 +2447,13 @@ export interface InitOutput {
|
|
|
2425
2447
|
readonly __wbg_symbolictext_free: (a: number, b: number) => void;
|
|
2426
2448
|
readonly __wbg_zonepiecejs_free: (a: number, b: number) => void;
|
|
2427
2449
|
readonly __wbg_zonesplitjs_free: (a: number, b: number) => void;
|
|
2450
|
+
readonly alignmentaxisjs_GlobalId: (a: number, b: number) => void;
|
|
2451
|
+
readonly alignmentaxisjs_Name: (a: number, b: number) => void;
|
|
2452
|
+
readonly alignmentaxisjs_approximate: (a: number) => number;
|
|
2453
|
+
readonly alignmentaxisjs_evaluate: (a: number, b: number, c: number) => void;
|
|
2454
|
+
readonly alignmentaxisjs_expressId: (a: number) => number;
|
|
2455
|
+
readonly alignmentaxisjs_geometricHorizontalLengthMeters: (a: number) => number;
|
|
2456
|
+
readonly alignmentaxisjs_new: (a: number, b: number, c: number, d: number) => void;
|
|
2428
2457
|
readonly clashIntersectionSolid: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => number;
|
|
2429
2458
|
readonly clashintersectionsolidjs_degenerateReason: (a: number, b: number) => void;
|
|
2430
2459
|
readonly clashintersectionsolidjs_indices: (a: number, b: number) => void;
|
|
@@ -2512,6 +2541,7 @@ export interface InitOutput {
|
|
|
2512
2541
|
readonly ifcapi_planAnnotationPlane: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
|
|
2513
2542
|
readonly ifcapi_planAppearance: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
|
|
2514
2543
|
readonly ifcapi_planCapturedMesh: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
|
|
2544
|
+
readonly ifcapi_planMapConversionNormalization: (a: number, b: number, c: number, d: number) => void;
|
|
2515
2545
|
readonly ifcapi_planMeshTransfer: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => void;
|
|
2516
2546
|
readonly ifcapi_planPageAppearance: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => void;
|
|
2517
2547
|
readonly ifcapi_planPdfFillAnnotation: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
|
package/pkg/ifc-lite.js
CHANGED
|
@@ -1,5 +1,125 @@
|
|
|
1
1
|
/* @ts-self-types="./ifc-lite.d.ts" */
|
|
2
2
|
|
|
3
|
+
export class AlignmentAxisJs {
|
|
4
|
+
__destroy_into_raw() {
|
|
5
|
+
const ptr = this.__wbg_ptr;
|
|
6
|
+
this.__wbg_ptr = 0;
|
|
7
|
+
AlignmentAxisJsFinalization.unregister(this);
|
|
8
|
+
return ptr;
|
|
9
|
+
}
|
|
10
|
+
free() {
|
|
11
|
+
const ptr = this.__destroy_into_raw();
|
|
12
|
+
wasm.__wbg_alignmentaxisjs_free(ptr, 0);
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* @returns {string | undefined}
|
|
16
|
+
*/
|
|
17
|
+
get GlobalId() {
|
|
18
|
+
try {
|
|
19
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
20
|
+
wasm.alignmentaxisjs_GlobalId(retptr, this.__wbg_ptr);
|
|
21
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
22
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
23
|
+
let v1;
|
|
24
|
+
if (r0 !== 0) {
|
|
25
|
+
v1 = getStringFromWasm0(r0, r1).slice();
|
|
26
|
+
wasm.__wbindgen_export4(r0, r1 * 1, 1);
|
|
27
|
+
}
|
|
28
|
+
return v1;
|
|
29
|
+
} finally {
|
|
30
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* @returns {string | undefined}
|
|
35
|
+
*/
|
|
36
|
+
get Name() {
|
|
37
|
+
try {
|
|
38
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
39
|
+
wasm.alignmentaxisjs_Name(retptr, this.__wbg_ptr);
|
|
40
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
41
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
42
|
+
let v1;
|
|
43
|
+
if (r0 !== 0) {
|
|
44
|
+
v1 = getStringFromWasm0(r0, r1).slice();
|
|
45
|
+
wasm.__wbindgen_export4(r0, r1 * 1, 1);
|
|
46
|
+
}
|
|
47
|
+
return v1;
|
|
48
|
+
} finally {
|
|
49
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* @returns {boolean}
|
|
54
|
+
*/
|
|
55
|
+
get approximate() {
|
|
56
|
+
const ret = wasm.alignmentaxisjs_approximate(this.__wbg_ptr);
|
|
57
|
+
return ret !== 0;
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* [horizontal distance, IFC Z-up point XYZ, normalized world tangent XYZ].
|
|
61
|
+
* Coordinates remain f64 absolute metres; no renderer origin is applied.
|
|
62
|
+
* @param {number} distance_m
|
|
63
|
+
* @returns {Float64Array}
|
|
64
|
+
*/
|
|
65
|
+
evaluate(distance_m) {
|
|
66
|
+
try {
|
|
67
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
68
|
+
wasm.alignmentaxisjs_evaluate(retptr, this.__wbg_ptr, distance_m);
|
|
69
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
70
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
71
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
72
|
+
var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
|
|
73
|
+
if (r3) {
|
|
74
|
+
throw takeObject(r2);
|
|
75
|
+
}
|
|
76
|
+
var v1 = getArrayF64FromWasm0(r0, r1).slice();
|
|
77
|
+
wasm.__wbindgen_export4(r0, r1 * 8, 8);
|
|
78
|
+
return v1;
|
|
79
|
+
} finally {
|
|
80
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* @returns {number}
|
|
85
|
+
*/
|
|
86
|
+
get expressId() {
|
|
87
|
+
const ret = wasm.alignmentaxisjs_expressId(this.__wbg_ptr);
|
|
88
|
+
return ret >>> 0;
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* @returns {number}
|
|
92
|
+
*/
|
|
93
|
+
get geometricHorizontalLengthMeters() {
|
|
94
|
+
const ret = wasm.alignmentaxisjs_geometricHorizontalLengthMeters(this.__wbg_ptr);
|
|
95
|
+
return ret;
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* @param {string} content
|
|
99
|
+
* @param {number} express_id
|
|
100
|
+
*/
|
|
101
|
+
constructor(content, express_id) {
|
|
102
|
+
try {
|
|
103
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
104
|
+
const ptr0 = passStringToWasm0(content, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
105
|
+
const len0 = WASM_VECTOR_LEN;
|
|
106
|
+
wasm.alignmentaxisjs_new(retptr, ptr0, len0, express_id);
|
|
107
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
108
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
109
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
110
|
+
if (r2) {
|
|
111
|
+
throw takeObject(r1);
|
|
112
|
+
}
|
|
113
|
+
this.__wbg_ptr = r0;
|
|
114
|
+
AlignmentAxisJsFinalization.register(this, this.__wbg_ptr, this);
|
|
115
|
+
return this;
|
|
116
|
+
} finally {
|
|
117
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
if (Symbol.dispose) AlignmentAxisJs.prototype[Symbol.dispose] = AlignmentAxisJs.prototype.free;
|
|
122
|
+
|
|
3
123
|
/**
|
|
4
124
|
* The overlap solid of one clashing pair, or the reason there is none.
|
|
5
125
|
*/
|
|
@@ -2143,6 +2263,38 @@ export class IfcAPI {
|
|
|
2143
2263
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
2144
2264
|
}
|
|
2145
2265
|
}
|
|
2266
|
+
/**
|
|
2267
|
+
* Plan opt-in map similarity normalization on a completed STEP export.
|
|
2268
|
+
* Returns entity patches, allocated IDs and atomic refusal warnings as JSON.
|
|
2269
|
+
* @param {Uint8Array} content
|
|
2270
|
+
* @returns {string}
|
|
2271
|
+
*/
|
|
2272
|
+
planMapConversionNormalization(content) {
|
|
2273
|
+
let deferred3_0;
|
|
2274
|
+
let deferred3_1;
|
|
2275
|
+
try {
|
|
2276
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
2277
|
+
const ptr0 = passArray8ToWasm0(content, wasm.__wbindgen_export);
|
|
2278
|
+
const len0 = WASM_VECTOR_LEN;
|
|
2279
|
+
wasm.ifcapi_planMapConversionNormalization(retptr, this.__wbg_ptr, ptr0, len0);
|
|
2280
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
2281
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
2282
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
2283
|
+
var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
|
|
2284
|
+
var ptr2 = r0;
|
|
2285
|
+
var len2 = r1;
|
|
2286
|
+
if (r3) {
|
|
2287
|
+
ptr2 = 0; len2 = 0;
|
|
2288
|
+
throw takeObject(r2);
|
|
2289
|
+
}
|
|
2290
|
+
deferred3_0 = ptr2;
|
|
2291
|
+
deferred3_1 = len2;
|
|
2292
|
+
return getStringFromWasm0(ptr2, len2);
|
|
2293
|
+
} finally {
|
|
2294
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
2295
|
+
wasm.__wbindgen_export4(deferred3_0, deferred3_1, 1);
|
|
2296
|
+
}
|
|
2297
|
+
}
|
|
2146
2298
|
/**
|
|
2147
2299
|
* Registered mesh observations over canonical target albedo. Host verifies
|
|
2148
2300
|
* original GLB identity against decoded source mesh/image and freezes frames.
|
|
@@ -6368,6 +6520,9 @@ function __wbg_get_imports() {
|
|
|
6368
6520
|
};
|
|
6369
6521
|
}
|
|
6370
6522
|
|
|
6523
|
+
const AlignmentAxisJsFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
6524
|
+
? { register: () => {}, unregister: () => {} }
|
|
6525
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_alignmentaxisjs_free(ptr, 1));
|
|
6371
6526
|
const ClashIntersectionSolidJsFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
6372
6527
|
? { register: () => {}, unregister: () => {} }
|
|
6373
6528
|
: new FinalizationRegistry(ptr => wasm.__wbg_clashintersectionsolidjs_free(ptr, 1));
|
package/pkg/ifc-lite_bg.wasm
CHANGED
|
Binary file
|