ifc-reader-2 1.3.4 → 1.3.6
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/base-types.d.ts +51 -0
- package/dist/index.cjs +25 -25
- package/dist/index.d.ts +2 -0
- package/dist/index.js +12322 -11923
- package/dist/models/ifc-fragment-settings.d.ts +8 -0
- package/dist/models/information-v3/information-v3-builder.d.ts +28 -0
- package/dist/models/property-resolver/property-resolver-v3.d.ts +13 -0
- package/dist/models/property-resolver/property-resolver.d.ts +8 -0
- package/package.json +40 -40
|
@@ -3,6 +3,14 @@ import * as WEBIFC from "web-ifc";
|
|
|
3
3
|
export declare class IfcFragmentSettings {
|
|
4
4
|
/** Whether to extract the IFC properties into a JSON. */
|
|
5
5
|
includeProperties: boolean;
|
|
6
|
+
/**
|
|
7
|
+
* Whether to also populate the legacy raw property dump
|
|
8
|
+
* (`ViralutionIFCModel.Data`) next to the deduplicated v3 information
|
|
9
|
+
* (`ViralutionIFCModel.DataV3`). The raw dump contains every IFC entity
|
|
10
|
+
* line and can be 10-100x larger than v3 on repetitive models —
|
|
11
|
+
* disable it when all consumers read `DataV3`.
|
|
12
|
+
*/
|
|
13
|
+
includeRawData: boolean;
|
|
6
14
|
/**
|
|
7
15
|
* Generate the geometry for categories that are not included by default,
|
|
8
16
|
* like IFCSPACE.
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { IfcProperties, ViralutionInformationV3, ViralutionRelationship } from '../../base-types';
|
|
2
|
+
/**
|
|
3
|
+
* Builds the deduplicated v3 information structure from the raw IFC
|
|
4
|
+
* property dump.
|
|
5
|
+
*
|
|
6
|
+
* Compared to shipping the raw dump this:
|
|
7
|
+
* - only includes real elements (geometry elements, spatial structure,
|
|
8
|
+
* relationship targets) — pset/quantity/relationship entity lines are
|
|
9
|
+
* folded into the elements that use them instead of shipped verbatim;
|
|
10
|
+
* - collapses identical property sets, identity attributes and type
|
|
11
|
+
* properties into shared templates referenced by index;
|
|
12
|
+
* - keeps genuinely per-element values (GlobalId, Tag) on the element.
|
|
13
|
+
*/
|
|
14
|
+
export declare class InformationV3Builder {
|
|
15
|
+
build(properties: IfcProperties, loadedElementIds: Set<number>, relationships: ViralutionRelationship[]): ViralutionInformationV3;
|
|
16
|
+
/**
|
|
17
|
+
* Elements worth shipping: geometry elements, spatial structure,
|
|
18
|
+
* and anything referenced by a relationship (types, materials,
|
|
19
|
+
* levels, openings) — but not psets/properties/rel entities.
|
|
20
|
+
*/
|
|
21
|
+
private _collectIncludedIds;
|
|
22
|
+
/** Convert one IfcPropertySet / IfcElementQuantity into a template. */
|
|
23
|
+
private _psetToTemplate;
|
|
24
|
+
/** Resolve TypeName + the type's property sets into templates. */
|
|
25
|
+
private _resolveTypeTemplates;
|
|
26
|
+
private _buildPsetIndex;
|
|
27
|
+
private _buildTypeIndex;
|
|
28
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { ViralutionInformationV3 } from '../../base-types';
|
|
2
|
+
import { ElementProperties } from './property-resolver';
|
|
3
|
+
/**
|
|
4
|
+
* Resolves display-ready element properties from the deduplicated v3
|
|
5
|
+
* information format. Drop-in equivalent of PropertyResolver but reads
|
|
6
|
+
* from the template tables instead of the raw IFC entity dump —
|
|
7
|
+
* resolution is a handful of array index lookups per element.
|
|
8
|
+
*/
|
|
9
|
+
export declare class PropertyResolverV3 {
|
|
10
|
+
private _info;
|
|
11
|
+
constructor(_info: ViralutionInformationV3);
|
|
12
|
+
getElementProperties(expressId: number): ElementProperties | null;
|
|
13
|
+
}
|
|
@@ -14,6 +14,10 @@ export interface ElementProperties {
|
|
|
14
14
|
description: string;
|
|
15
15
|
groups: PropertyGroup[];
|
|
16
16
|
}
|
|
17
|
+
export declare const IFC_REL_DEFINES_BY_PROPERTIES = 4186316022;
|
|
18
|
+
export declare const IFC_REL_DEFINES_BY_TYPE = 781010003;
|
|
19
|
+
export declare const IFC_PROPERTY_SET = 1451395588;
|
|
20
|
+
export declare const IFC_ELEMENT_QUANTITY = 1883228015;
|
|
17
21
|
export declare class PropertyResolver {
|
|
18
22
|
private _psetIndex;
|
|
19
23
|
private _typeIndex;
|
|
@@ -25,3 +29,7 @@ export declare class PropertyResolver {
|
|
|
25
29
|
private resolvePropertyDefinitions;
|
|
26
30
|
private resolveTypeProperties;
|
|
27
31
|
}
|
|
32
|
+
export declare function val(raw: unknown): string;
|
|
33
|
+
export declare function resolveRef(ref: unknown): number;
|
|
34
|
+
export declare function readPropertyValue(prop: Record<string, unknown>): string;
|
|
35
|
+
export declare function readQuantityValue(qty: Record<string, unknown>): string;
|
package/package.json
CHANGED
|
@@ -1,40 +1,40 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "ifc-reader-2",
|
|
3
|
-
"version": "1.3.
|
|
4
|
-
"description": "",
|
|
5
|
-
"main": "dist/index.cjs",
|
|
6
|
-
"module": "dist/index.js",
|
|
7
|
-
"types": "dist/index.d.ts",
|
|
8
|
-
"files": [
|
|
9
|
-
"dist",
|
|
10
|
-
"LICENSE",
|
|
11
|
-
"THIRD-PARTY-LICENSES.md"
|
|
12
|
-
],
|
|
13
|
-
"scripts": {
|
|
14
|
-
"dev": "cd examples && npx vite",
|
|
15
|
-
"test": "echo \"Error: no test specified\" && exit 1",
|
|
16
|
-
"build": "npx tsc",
|
|
17
|
-
"bundle-vite": "npx vite build",
|
|
18
|
-
"deploy": "npm run bundle-vite && npm publish",
|
|
19
|
-
"lint": "biome check .",
|
|
20
|
-
"lint:fix": "biome check --write .",
|
|
21
|
-
"format": "biome format .",
|
|
22
|
-
"format:fix": "biome format . --write",
|
|
23
|
-
"check": "biome check .",
|
|
24
|
-
"check:fix": "biome check . --write"
|
|
25
|
-
},
|
|
26
|
-
"author": "",
|
|
27
|
-
"license": "ISC",
|
|
28
|
-
"devDependencies": {
|
|
29
|
-
"@types/three": "^0.162.0",
|
|
30
|
-
"typescript": "^5.9.2",
|
|
31
|
-
"viral-viewer-2": "^6.6.3",
|
|
32
|
-
"vite": "^7.1.3",
|
|
33
|
-
"vite-plugin-dts": "^4.5.4",
|
|
34
|
-
"@biomejs/biome": "2.3.15"
|
|
35
|
-
},
|
|
36
|
-
"dependencies": {
|
|
37
|
-
"three": "^0.162.0",
|
|
38
|
-
"web-ifc": "^0.0.75"
|
|
39
|
-
}
|
|
40
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "ifc-reader-2",
|
|
3
|
+
"version": "1.3.6",
|
|
4
|
+
"description": "",
|
|
5
|
+
"main": "dist/index.cjs",
|
|
6
|
+
"module": "dist/index.js",
|
|
7
|
+
"types": "dist/index.d.ts",
|
|
8
|
+
"files": [
|
|
9
|
+
"dist",
|
|
10
|
+
"LICENSE",
|
|
11
|
+
"THIRD-PARTY-LICENSES.md"
|
|
12
|
+
],
|
|
13
|
+
"scripts": {
|
|
14
|
+
"dev": "cd examples && npx vite",
|
|
15
|
+
"test": "echo \"Error: no test specified\" && exit 1",
|
|
16
|
+
"build": "npx tsc",
|
|
17
|
+
"bundle-vite": "npx vite build",
|
|
18
|
+
"deploy": "npm run bundle-vite && npm publish",
|
|
19
|
+
"lint": "biome check .",
|
|
20
|
+
"lint:fix": "biome check --write .",
|
|
21
|
+
"format": "biome format .",
|
|
22
|
+
"format:fix": "biome format . --write",
|
|
23
|
+
"check": "biome check .",
|
|
24
|
+
"check:fix": "biome check . --write"
|
|
25
|
+
},
|
|
26
|
+
"author": "",
|
|
27
|
+
"license": "ISC",
|
|
28
|
+
"devDependencies": {
|
|
29
|
+
"@types/three": "^0.162.0",
|
|
30
|
+
"typescript": "^5.9.2",
|
|
31
|
+
"viral-viewer-2": "^6.6.3",
|
|
32
|
+
"vite": "^7.1.3",
|
|
33
|
+
"vite-plugin-dts": "^4.5.4",
|
|
34
|
+
"@biomejs/biome": "2.3.15"
|
|
35
|
+
},
|
|
36
|
+
"dependencies": {
|
|
37
|
+
"three": "^0.162.0",
|
|
38
|
+
"web-ifc": "^0.0.75"
|
|
39
|
+
}
|
|
40
|
+
}
|