@ifc-lite/wasm 9.0.0 → 9.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.
- package/README.md +43 -0
- package/package.json +1 -1
- package/pkg/ifc-lite.d.ts +36 -0
- package/pkg/ifc-lite.js +126 -0
- package/pkg/ifc-lite_bg.wasm +0 -0
package/README.md
CHANGED
|
@@ -76,6 +76,49 @@ api.clearPrePassCache();
|
|
|
76
76
|
api.free(); // release the API instance when done
|
|
77
77
|
```
|
|
78
78
|
|
|
79
|
+
### Auxiliary geometry in the mesh frame
|
|
80
|
+
|
|
81
|
+
Grid, alignment, and symbolic parsers accept the mesh pre-pass decision through
|
|
82
|
+
their explicit-frame variants. `RtcFrame` coordinates are IFC Z-up metres:
|
|
83
|
+
|
|
84
|
+
```typescript
|
|
85
|
+
import type { IfcAPI, RtcFrame } from '@ifc-lite/wasm';
|
|
86
|
+
|
|
87
|
+
declare const api: IfcAPI;
|
|
88
|
+
declare const pre: ReturnType<IfcAPI['buildPrePassOnce']>;
|
|
89
|
+
declare const content: string;
|
|
90
|
+
|
|
91
|
+
const frame: RtcFrame = {
|
|
92
|
+
x: pre.rtcOffset?.[0] ?? 0,
|
|
93
|
+
y: pre.rtcOffset?.[1] ?? 0,
|
|
94
|
+
z: pre.rtcOffset?.[2] ?? 0,
|
|
95
|
+
needsShift: pre.needsShift,
|
|
96
|
+
};
|
|
97
|
+
|
|
98
|
+
const grids = api.parseGridLinesInFrame(content, frame);
|
|
99
|
+
const axes = api.parseGridAxesInFrame(content, frame);
|
|
100
|
+
try {
|
|
101
|
+
const alignments = api.parseAlignmentLinesInFrame(content, frame);
|
|
102
|
+
const symbols = api.parseSymbolicRepresentationsInFrame(content, frame);
|
|
103
|
+
try {
|
|
104
|
+
console.log(grids.length, axes.length, alignments.length, symbols.totalCount);
|
|
105
|
+
} finally {
|
|
106
|
+
symbols.free();
|
|
107
|
+
}
|
|
108
|
+
} finally {
|
|
109
|
+
axes.free();
|
|
110
|
+
}
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
`needsShift: false` means no RTC subtraction, even when the inactive coordinates
|
|
114
|
+
are non-zero. “Raw IFC” here describes only that RTC step: each parser still
|
|
115
|
+
applies its documented unit scaling and output-axis conversion. It is distinct
|
|
116
|
+
from having no frame.
|
|
117
|
+
The methods without `InFrame` remain available for standalone parsing and
|
|
118
|
+
detect a frame from the whole source. That standalone choice is not guaranteed
|
|
119
|
+
to match an earlier streaming sample or a federation override; reuse the exact
|
|
120
|
+
pre-pass frame whenever these results accompany already-produced meshes.
|
|
121
|
+
|
|
79
122
|
> Most consumers should use [`@ifc-lite/geometry`](../geometry/README.md)'s
|
|
80
123
|
> `GeometryProcessor` instead — it wraps this pre-pass/job-batch flow with a
|
|
81
124
|
> Web-Worker pool, RTC coordinate handling, and progressive streaming.
|
package/package.json
CHANGED
package/pkg/ifc-lite.d.ts
CHANGED
|
@@ -1,6 +1,16 @@
|
|
|
1
1
|
/* tslint:disable */
|
|
2
2
|
/* eslint-disable */
|
|
3
3
|
|
|
4
|
+
/** Exact browser mesh RTC frame, in IFC Z-up metres. */
|
|
5
|
+
export interface RtcFrame {
|
|
6
|
+
x: number;
|
|
7
|
+
y: number;
|
|
8
|
+
z: number;
|
|
9
|
+
needsShift: boolean;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
4
14
|
/**
|
|
5
15
|
* The overlap solid of one clashing pair, or the reason there is none.
|
|
6
16
|
*/
|
|
@@ -616,12 +626,20 @@ export class IfcAPI {
|
|
|
616
626
|
* resolvable Axis curve), so the caller can clear the overlay cheaply.
|
|
617
627
|
*/
|
|
618
628
|
parseAlignmentLines(content: string): Float32Array;
|
|
629
|
+
/**
|
|
630
|
+
* Parse alignments in the exact RTC frame selected by the mesh pre-pass.
|
|
631
|
+
*/
|
|
632
|
+
parseAlignmentLinesInFrame(content: string, frame: RtcFrame): Float32Array;
|
|
619
633
|
/**
|
|
620
634
|
* Parse the file and return structured per-axis data (tag + endpoints) in
|
|
621
635
|
* the renderer's Y-up world space (RTC-subtracted, metres). Use this when
|
|
622
636
|
* you also need the axis tags (to render grid bubbles / labels).
|
|
623
637
|
*/
|
|
624
638
|
parseGridAxes(content: string): GridAxisCollection;
|
|
639
|
+
/**
|
|
640
|
+
* Parse structured grid axes in the exact frame selected by the mesh pre-pass.
|
|
641
|
+
*/
|
|
642
|
+
parseGridAxesInFrame(content: string, frame: RtcFrame): GridAxisCollection;
|
|
625
643
|
/**
|
|
626
644
|
* Parse the file and return every `IfcGridAxis` as a flat `Float32Array`
|
|
627
645
|
* of 3D line-list vertices `[x0,y0,z0, x1,y1,z1, …]` (one segment per
|
|
@@ -632,11 +650,19 @@ export class IfcAPI {
|
|
|
632
650
|
* clear the overlay cheaply.
|
|
633
651
|
*/
|
|
634
652
|
parseGridLines(content: string): Float32Array;
|
|
653
|
+
/**
|
|
654
|
+
* Parse grid line vertices in the exact frame selected by the mesh pre-pass.
|
|
655
|
+
*/
|
|
656
|
+
parseGridLinesInFrame(content: string, frame: RtcFrame): Float32Array;
|
|
635
657
|
/**
|
|
636
658
|
* Parse IFC file and extract symbolic representations (Plan,
|
|
637
659
|
* Annotation, FootPrint, Axis). These are 2D curves used for
|
|
638
660
|
* architectural drawings instead of sectioning 3D geometry.
|
|
639
661
|
*
|
|
662
|
+
* This standalone entry point detects an RTC frame from the whole source.
|
|
663
|
+
* Use `parseSymbolicRepresentationsInFrame` when the symbols accompany
|
|
664
|
+
* meshes produced by a streaming pre-pass or federation override.
|
|
665
|
+
*
|
|
640
666
|
* Example:
|
|
641
667
|
* ```javascript
|
|
642
668
|
* const api = new IfcAPI();
|
|
@@ -649,6 +675,12 @@ export class IfcAPI {
|
|
|
649
675
|
* ```
|
|
650
676
|
*/
|
|
651
677
|
parseSymbolicRepresentations(content: string): SymbolicRepresentationCollection;
|
|
678
|
+
/**
|
|
679
|
+
* Parse symbolic representations in the exact RTC frame selected by the
|
|
680
|
+
* browser mesh pre-pass rather than detecting a second frame from the
|
|
681
|
+
* whole source.
|
|
682
|
+
*/
|
|
683
|
+
parseSymbolicRepresentationsInFrame(content: string, frame: RtcFrame): SymbolicRepresentationCollection;
|
|
652
684
|
/**
|
|
653
685
|
* Create a calibrated image annotation through canonical native geometry.
|
|
654
686
|
* Input is AnnotationPlaneRequest; output UTF-8 AnnotationPlanePlan JSON.
|
|
@@ -2147,9 +2179,13 @@ export interface InitOutput {
|
|
|
2147
2179
|
readonly ifcapi_is_ready: (a: number) => number;
|
|
2148
2180
|
readonly ifcapi_new: () => number;
|
|
2149
2181
|
readonly ifcapi_parseAlignmentLines: (a: number, b: number, c: number) => number;
|
|
2182
|
+
readonly ifcapi_parseAlignmentLinesInFrame: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
2150
2183
|
readonly ifcapi_parseGridAxes: (a: number, b: number, c: number) => number;
|
|
2184
|
+
readonly ifcapi_parseGridAxesInFrame: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
2151
2185
|
readonly ifcapi_parseGridLines: (a: number, b: number, c: number) => number;
|
|
2186
|
+
readonly ifcapi_parseGridLinesInFrame: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
2152
2187
|
readonly ifcapi_parseSymbolicRepresentations: (a: number, b: number, c: number) => number;
|
|
2188
|
+
readonly ifcapi_parseSymbolicRepresentationsInFrame: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
2153
2189
|
readonly ifcapi_planAnnotationPlane: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
|
|
2154
2190
|
readonly ifcapi_planAppearance: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
|
|
2155
2191
|
readonly ifcapi_planCapturedMesh: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
|
package/pkg/ifc-lite.js
CHANGED
|
@@ -1678,6 +1678,29 @@ export class IfcAPI {
|
|
|
1678
1678
|
const ret = wasm.ifcapi_parseAlignmentLines(this.__wbg_ptr, ptr0, len0);
|
|
1679
1679
|
return takeObject(ret);
|
|
1680
1680
|
}
|
|
1681
|
+
/**
|
|
1682
|
+
* Parse alignments in the exact RTC frame selected by the mesh pre-pass.
|
|
1683
|
+
* @param {string} content
|
|
1684
|
+
* @param {RtcFrame} frame
|
|
1685
|
+
* @returns {Float32Array}
|
|
1686
|
+
*/
|
|
1687
|
+
parseAlignmentLinesInFrame(content, frame) {
|
|
1688
|
+
try {
|
|
1689
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1690
|
+
const ptr0 = passStringToWasm0(content, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
1691
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1692
|
+
wasm.ifcapi_parseAlignmentLinesInFrame(retptr, this.__wbg_ptr, ptr0, len0, addHeapObject(frame));
|
|
1693
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1694
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1695
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
1696
|
+
if (r2) {
|
|
1697
|
+
throw takeObject(r1);
|
|
1698
|
+
}
|
|
1699
|
+
return takeObject(r0);
|
|
1700
|
+
} finally {
|
|
1701
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1702
|
+
}
|
|
1703
|
+
}
|
|
1681
1704
|
/**
|
|
1682
1705
|
* Parse the file and return structured per-axis data (tag + endpoints) in
|
|
1683
1706
|
* the renderer's Y-up world space (RTC-subtracted, metres). Use this when
|
|
@@ -1691,6 +1714,29 @@ export class IfcAPI {
|
|
|
1691
1714
|
const ret = wasm.ifcapi_parseGridAxes(this.__wbg_ptr, ptr0, len0);
|
|
1692
1715
|
return GridAxisCollection.__wrap(ret);
|
|
1693
1716
|
}
|
|
1717
|
+
/**
|
|
1718
|
+
* Parse structured grid axes in the exact frame selected by the mesh pre-pass.
|
|
1719
|
+
* @param {string} content
|
|
1720
|
+
* @param {RtcFrame} frame
|
|
1721
|
+
* @returns {GridAxisCollection}
|
|
1722
|
+
*/
|
|
1723
|
+
parseGridAxesInFrame(content, frame) {
|
|
1724
|
+
try {
|
|
1725
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1726
|
+
const ptr0 = passStringToWasm0(content, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
1727
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1728
|
+
wasm.ifcapi_parseGridAxesInFrame(retptr, this.__wbg_ptr, ptr0, len0, addHeapObject(frame));
|
|
1729
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1730
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1731
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
1732
|
+
if (r2) {
|
|
1733
|
+
throw takeObject(r1);
|
|
1734
|
+
}
|
|
1735
|
+
return GridAxisCollection.__wrap(r0);
|
|
1736
|
+
} finally {
|
|
1737
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1738
|
+
}
|
|
1739
|
+
}
|
|
1694
1740
|
/**
|
|
1695
1741
|
* Parse the file and return every `IfcGridAxis` as a flat `Float32Array`
|
|
1696
1742
|
* of 3D line-list vertices `[x0,y0,z0, x1,y1,z1, …]` (one segment per
|
|
@@ -1708,11 +1754,38 @@ export class IfcAPI {
|
|
|
1708
1754
|
const ret = wasm.ifcapi_parseGridLines(this.__wbg_ptr, ptr0, len0);
|
|
1709
1755
|
return takeObject(ret);
|
|
1710
1756
|
}
|
|
1757
|
+
/**
|
|
1758
|
+
* Parse grid line vertices in the exact frame selected by the mesh pre-pass.
|
|
1759
|
+
* @param {string} content
|
|
1760
|
+
* @param {RtcFrame} frame
|
|
1761
|
+
* @returns {Float32Array}
|
|
1762
|
+
*/
|
|
1763
|
+
parseGridLinesInFrame(content, frame) {
|
|
1764
|
+
try {
|
|
1765
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1766
|
+
const ptr0 = passStringToWasm0(content, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
1767
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1768
|
+
wasm.ifcapi_parseGridLinesInFrame(retptr, this.__wbg_ptr, ptr0, len0, addHeapObject(frame));
|
|
1769
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1770
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1771
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
1772
|
+
if (r2) {
|
|
1773
|
+
throw takeObject(r1);
|
|
1774
|
+
}
|
|
1775
|
+
return takeObject(r0);
|
|
1776
|
+
} finally {
|
|
1777
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1778
|
+
}
|
|
1779
|
+
}
|
|
1711
1780
|
/**
|
|
1712
1781
|
* Parse IFC file and extract symbolic representations (Plan,
|
|
1713
1782
|
* Annotation, FootPrint, Axis). These are 2D curves used for
|
|
1714
1783
|
* architectural drawings instead of sectioning 3D geometry.
|
|
1715
1784
|
*
|
|
1785
|
+
* This standalone entry point detects an RTC frame from the whole source.
|
|
1786
|
+
* Use `parseSymbolicRepresentationsInFrame` when the symbols accompany
|
|
1787
|
+
* meshes produced by a streaming pre-pass or federation override.
|
|
1788
|
+
*
|
|
1716
1789
|
* Example:
|
|
1717
1790
|
* ```javascript
|
|
1718
1791
|
* const api = new IfcAPI();
|
|
@@ -1732,6 +1805,31 @@ export class IfcAPI {
|
|
|
1732
1805
|
const ret = wasm.ifcapi_parseSymbolicRepresentations(this.__wbg_ptr, ptr0, len0);
|
|
1733
1806
|
return SymbolicRepresentationCollection.__wrap(ret);
|
|
1734
1807
|
}
|
|
1808
|
+
/**
|
|
1809
|
+
* Parse symbolic representations in the exact RTC frame selected by the
|
|
1810
|
+
* browser mesh pre-pass rather than detecting a second frame from the
|
|
1811
|
+
* whole source.
|
|
1812
|
+
* @param {string} content
|
|
1813
|
+
* @param {RtcFrame} frame
|
|
1814
|
+
* @returns {SymbolicRepresentationCollection}
|
|
1815
|
+
*/
|
|
1816
|
+
parseSymbolicRepresentationsInFrame(content, frame) {
|
|
1817
|
+
try {
|
|
1818
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1819
|
+
const ptr0 = passStringToWasm0(content, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
1820
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1821
|
+
wasm.ifcapi_parseSymbolicRepresentationsInFrame(retptr, this.__wbg_ptr, ptr0, len0, addHeapObject(frame));
|
|
1822
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1823
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1824
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
1825
|
+
if (r2) {
|
|
1826
|
+
throw takeObject(r1);
|
|
1827
|
+
}
|
|
1828
|
+
return SymbolicRepresentationCollection.__wrap(r0);
|
|
1829
|
+
} finally {
|
|
1830
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1831
|
+
}
|
|
1832
|
+
}
|
|
1735
1833
|
/**
|
|
1736
1834
|
* Create a calibrated image annotation through canonical native geometry.
|
|
1737
1835
|
* Input is AnnotationPlaneRequest; output UTF-8 AnnotationPlanePlan JSON.
|
|
@@ -5514,6 +5612,20 @@ function __wbg_get_imports() {
|
|
|
5514
5612
|
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
5515
5613
|
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
5516
5614
|
},
|
|
5615
|
+
__wbg___wbindgen_boolean_get_fa956cfa2d1bd751: function(arg0) {
|
|
5616
|
+
const v = getObject(arg0);
|
|
5617
|
+
const ret = typeof(v) === 'boolean' ? v : undefined;
|
|
5618
|
+
return isLikeNone(ret) ? 0xFFFFFF : ret ? 1 : 0;
|
|
5619
|
+
},
|
|
5620
|
+
__wbg___wbindgen_is_null_ea9085d691f535d3: function(arg0) {
|
|
5621
|
+
const ret = getObject(arg0) === null;
|
|
5622
|
+
return ret;
|
|
5623
|
+
},
|
|
5624
|
+
__wbg___wbindgen_is_object_a27215656b807791: function(arg0) {
|
|
5625
|
+
const val = getObject(arg0);
|
|
5626
|
+
const ret = typeof(val) === 'object' && val !== null;
|
|
5627
|
+
return ret;
|
|
5628
|
+
},
|
|
5517
5629
|
__wbg___wbindgen_is_undefined_c05833b95a3cf397: function(arg0) {
|
|
5518
5630
|
const ret = getObject(arg0) === undefined;
|
|
5519
5631
|
return ret;
|
|
@@ -5522,6 +5634,12 @@ function __wbg_get_imports() {
|
|
|
5522
5634
|
const ret = wasm.memory;
|
|
5523
5635
|
return addHeapObject(ret);
|
|
5524
5636
|
},
|
|
5637
|
+
__wbg___wbindgen_number_get_394265ed1e1b84ee: function(arg0, arg1) {
|
|
5638
|
+
const obj = getObject(arg1);
|
|
5639
|
+
const ret = typeof(obj) === 'number' ? obj : undefined;
|
|
5640
|
+
getDataViewMemory0().setFloat64(arg0 + 8 * 1, isLikeNone(ret) ? 0 : ret, true);
|
|
5641
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
|
|
5642
|
+
},
|
|
5525
5643
|
__wbg___wbindgen_string_get_b0ca35b86a603356: function(arg0, arg1) {
|
|
5526
5644
|
const obj = getObject(arg1);
|
|
5527
5645
|
const ret = typeof(obj) === 'string' ? obj : undefined;
|
|
@@ -5548,9 +5666,17 @@ function __wbg_get_imports() {
|
|
|
5548
5666
|
wasm.__wbindgen_export4(deferred0_0, deferred0_1, 1);
|
|
5549
5667
|
}
|
|
5550
5668
|
},
|
|
5669
|
+
__wbg_get_78f252d074a84d0b: function() { return handleError(function (arg0, arg1) {
|
|
5670
|
+
const ret = Reflect.get(getObject(arg0), getObject(arg1));
|
|
5671
|
+
return addHeapObject(ret);
|
|
5672
|
+
}, arguments); },
|
|
5551
5673
|
__wbg_info_eadbe775a8e2e9eb: function(arg0) {
|
|
5552
5674
|
console.info(getObject(arg0));
|
|
5553
5675
|
},
|
|
5676
|
+
__wbg_isArray_0677c962b281d01a: function(arg0) {
|
|
5677
|
+
const ret = Array.isArray(getObject(arg0));
|
|
5678
|
+
return ret;
|
|
5679
|
+
},
|
|
5554
5680
|
__wbg_new_227d7c05414eb861: function() {
|
|
5555
5681
|
const ret = new Error();
|
|
5556
5682
|
return addHeapObject(ret);
|
package/pkg/ifc-lite_bg.wasm
CHANGED
|
Binary file
|