@ifc-lite/ifcx 1.2.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.
@@ -0,0 +1,190 @@
1
+ /* This Source Code Form is subject to the terms of the Mozilla Public
2
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
3
+ * file, You can obtain one at https://mozilla.org/MPL/2.0/. */
4
+ import { ATTR } from './types.js';
5
+ import { PropertyTableBuilder, PropertyValueType, } from '@ifc-lite/data';
6
+ // Attributes to skip (not properties)
7
+ const SKIP_ATTRIBUTES = new Set([
8
+ ATTR.CLASS,
9
+ ATTR.MESH,
10
+ ATTR.TRANSFORM,
11
+ ATTR.VISIBILITY,
12
+ ATTR.DIFFUSE_COLOR,
13
+ ATTR.OPACITY,
14
+ ATTR.MATERIAL,
15
+ ]);
16
+ /**
17
+ * Extract properties from composed IFCX nodes.
18
+ *
19
+ * IFCX properties are flat attributes with namespace prefixes:
20
+ * - bsi::ifc::prop::IsExternal -> PropertySingleValue
21
+ * - bsi::ifc::prop::Volume -> QuantitySingleValue
22
+ *
23
+ * We group properties by namespace prefix for PropertySet-like grouping.
24
+ */
25
+ export function extractProperties(composed, pathToId, strings) {
26
+ const builder = new PropertyTableBuilder(strings);
27
+ for (const node of composed.values()) {
28
+ const expressId = pathToId.get(node.path);
29
+ if (expressId === undefined)
30
+ continue;
31
+ // Group attributes by namespace
32
+ const grouped = groupAttributesByNamespace(node.attributes);
33
+ for (const [psetName, props] of grouped) {
34
+ for (const [propName, value] of props) {
35
+ const { propType, propValue } = convertPropertyValue(value);
36
+ builder.add({
37
+ entityId: expressId,
38
+ psetName,
39
+ psetGlobalId: '',
40
+ propName,
41
+ propType,
42
+ value: propValue,
43
+ });
44
+ }
45
+ }
46
+ }
47
+ return builder.build();
48
+ }
49
+ /**
50
+ * Group attributes by their namespace prefix.
51
+ * Excludes quantity-like properties (they go to QuantityTable instead).
52
+ */
53
+ function groupAttributesByNamespace(attributes) {
54
+ const grouped = new Map();
55
+ for (const [key, value] of attributes) {
56
+ // Skip non-property attributes
57
+ if (SKIP_ATTRIBUTES.has(key)) {
58
+ continue;
59
+ }
60
+ // Parse namespace::name pattern
61
+ const lastColon = key.lastIndexOf('::');
62
+ if (lastColon === -1)
63
+ continue;
64
+ const namespace = key.slice(0, lastColon);
65
+ const propName = key.slice(lastColon + 2);
66
+ // Skip quantity-like properties - they go to QuantityTable
67
+ if (typeof value === 'number' && isQuantityProperty(propName)) {
68
+ continue;
69
+ }
70
+ // Use namespace as pset name, format for display
71
+ const psetName = formatNamespace(namespace);
72
+ if (!grouped.has(psetName)) {
73
+ grouped.set(psetName, new Map());
74
+ }
75
+ grouped.get(psetName).set(propName, value);
76
+ }
77
+ return grouped;
78
+ }
79
+ /**
80
+ * Format namespace for display as PropertySet name.
81
+ * Maps technical namespaces to user-friendly names.
82
+ */
83
+ function formatNamespace(namespace) {
84
+ // Map common IFC5 namespaces to user-friendly names
85
+ const namespaceMap = {
86
+ 'bsi::ifc::prop': 'IFC Properties',
87
+ 'bsi::ifc::presentation': 'Presentation',
88
+ 'bsi::ifc::material': 'Material',
89
+ 'bsi::ifc::spaceBoundary': 'Space Boundary',
90
+ 'bsi::ifc': 'IFC',
91
+ 'usd::usdgeom': 'Geometry',
92
+ 'usd': 'USD',
93
+ };
94
+ // Check for exact match first
95
+ if (namespaceMap[namespace]) {
96
+ return namespaceMap[namespace];
97
+ }
98
+ // Check for prefix match (e.g., custom extensions)
99
+ for (const [prefix, name] of Object.entries(namespaceMap)) {
100
+ if (namespace.startsWith(prefix + '::')) {
101
+ const suffix = namespace.slice(prefix.length + 2);
102
+ return `${name} - ${suffix}`;
103
+ }
104
+ }
105
+ // Fallback: make it readable
106
+ // e.g., "vendor::custom::prop" -> "Vendor Custom Prop"
107
+ return namespace
108
+ .split('::')
109
+ .map(part => part.charAt(0).toUpperCase() + part.slice(1))
110
+ .join(' ');
111
+ }
112
+ /**
113
+ * Convert IFCX attribute value to PropertyTable format.
114
+ */
115
+ function convertPropertyValue(value) {
116
+ if (typeof value === 'string') {
117
+ return {
118
+ propType: PropertyValueType.String,
119
+ propValue: value,
120
+ };
121
+ }
122
+ if (typeof value === 'number') {
123
+ if (Number.isInteger(value)) {
124
+ return {
125
+ propType: PropertyValueType.Integer,
126
+ propValue: value,
127
+ };
128
+ }
129
+ return {
130
+ propType: PropertyValueType.Real,
131
+ propValue: value,
132
+ };
133
+ }
134
+ if (typeof value === 'boolean') {
135
+ return {
136
+ propType: PropertyValueType.Boolean,
137
+ propValue: value,
138
+ };
139
+ }
140
+ // Arrays and objects - serialize to JSON string
141
+ if (Array.isArray(value) || (typeof value === 'object' && value !== null)) {
142
+ return {
143
+ propType: PropertyValueType.String,
144
+ propValue: JSON.stringify(value),
145
+ };
146
+ }
147
+ // Null or undefined
148
+ return {
149
+ propType: PropertyValueType.String,
150
+ propValue: '',
151
+ };
152
+ }
153
+ /**
154
+ * Extract quantity-like properties (Volume, Area, Length, etc.)
155
+ * These are identified by their names matching quantity patterns.
156
+ */
157
+ export function isQuantityProperty(propName) {
158
+ // Exact matches for common quantity names
159
+ const exactQuantityNames = new Set([
160
+ 'Volume',
161
+ 'Area',
162
+ 'Length',
163
+ 'Width',
164
+ 'Height',
165
+ 'Depth',
166
+ 'Thickness',
167
+ 'Weight',
168
+ 'Mass',
169
+ 'Count',
170
+ 'Perimeter',
171
+ 'CrossSectionArea',
172
+ ]);
173
+ // Suffix patterns for compound quantity names
174
+ const suffixPatterns = [
175
+ 'Volume',
176
+ 'Area',
177
+ 'Length',
178
+ 'Weight',
179
+ 'Mass',
180
+ 'Count',
181
+ 'Perimeter',
182
+ ];
183
+ // Check exact match
184
+ if (exactQuantityNames.has(propName)) {
185
+ return true;
186
+ }
187
+ // Check suffix patterns (e.g., GrossArea, NetVolume, SideArea)
188
+ return suffixPatterns.some(pattern => propName.endsWith(pattern) && propName !== pattern);
189
+ }
190
+ //# sourceMappingURL=property-extractor.js.map
@@ -0,0 +1 @@
1
+ {"version":3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AAI,CAAC;IACd,CAAC;IAED,+DAA+D;IAC/D,OAAO,cAAc,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,CACnC,QAAQ,CAAC,QAAQ,CAAC,OAAO,CAAC,IAAI,QAAQ,KAAK,OAAO,CACnD,CAAC;AACJ,CAAC"}
@@ -0,0 +1,89 @@
1
+ /**
2
+ * IFC5 (IFCX) type definitions
3
+ * Based on buildingSMART IFC5-development schema
4
+ */
5
+ export interface IfcxFile {
6
+ header: IfcxHeader;
7
+ imports: ImportNode[];
8
+ schemas: Record<string, IfcxSchema>;
9
+ data: IfcxNode[];
10
+ }
11
+ export interface IfcxHeader {
12
+ id: string;
13
+ ifcxVersion: string;
14
+ dataVersion: string;
15
+ author: string;
16
+ timestamp: string;
17
+ }
18
+ export interface ImportNode {
19
+ uri: string;
20
+ integrity?: string;
21
+ }
22
+ export interface IfcxNode {
23
+ path: string;
24
+ children?: Record<string, string | null>;
25
+ inherits?: Record<string, string | null>;
26
+ attributes?: Record<string, unknown>;
27
+ }
28
+ export type DataType = 'Real' | 'Boolean' | 'Integer' | 'String' | 'DateTime' | 'Enum' | 'Array' | 'Object' | 'Reference' | 'Blob';
29
+ export interface EnumRestrictions {
30
+ options: string[];
31
+ }
32
+ export interface ArrayRestrictions {
33
+ min?: number;
34
+ max?: number;
35
+ value: IfcxValueDescription;
36
+ }
37
+ export interface ObjectRestrictions {
38
+ values: Record<string, IfcxValueDescription>;
39
+ }
40
+ export interface IfcxValueDescription {
41
+ dataType: DataType;
42
+ optional?: boolean;
43
+ inherits?: string[];
44
+ quantityKind?: string;
45
+ enumRestrictions?: EnumRestrictions;
46
+ arrayRestrictions?: ArrayRestrictions;
47
+ objectRestrictions?: ObjectRestrictions;
48
+ }
49
+ export interface IfcxSchema {
50
+ uri?: string;
51
+ value: IfcxValueDescription;
52
+ }
53
+ export interface ComposedNode {
54
+ path: string;
55
+ attributes: Map<string, unknown>;
56
+ children: Map<string, ComposedNode>;
57
+ parent?: ComposedNode;
58
+ }
59
+ /**
60
+ * Well-known attribute namespaces used in IFCX files.
61
+ * These are considered stable and safe to implement.
62
+ */
63
+ export declare const ATTR: {
64
+ readonly CLASS: "bsi::ifc::class";
65
+ readonly MESH: "usd::usdgeom::mesh";
66
+ readonly TRANSFORM: "usd::xformop";
67
+ readonly VISIBILITY: "usd::usdgeom::visibility";
68
+ readonly DIFFUSE_COLOR: "bsi::ifc::presentation::diffuseColor";
69
+ readonly OPACITY: "bsi::ifc::presentation::opacity";
70
+ readonly MATERIAL: "bsi::ifc::material";
71
+ readonly PROP_PREFIX: "bsi::ifc::prop::";
72
+ readonly SPACE_BOUNDARY: "bsi::ifc::spaceBoundary";
73
+ };
74
+ export interface UsdMesh {
75
+ points: number[][];
76
+ faceVertexIndices: number[];
77
+ faceVertexCounts?: number[];
78
+ normals?: number[][];
79
+ }
80
+ export interface UsdTransform {
81
+ transform: number[][];
82
+ }
83
+ export interface IfcClass {
84
+ code: string;
85
+ uri?: string;
86
+ }
87
+ export declare const SPATIAL_TYPES: Set<string>;
88
+ export declare const BUILDING_ELEMENT_TYPES: Set<string>;
89
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAIA;;;GAGG;AAMH,MAAM,WAAW,QAAQ;IACvB,MAAM,EAAE,UAAU,CAAC;IACnB,OAAO,EAAE,UAAU,EAAE,CAAC;IACtB,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC;IACpC,IAAI,EAAE,QAAQ,EAAE,CAAC;CAClB;AAED,MAAM,WAAW,UAAU;IACzB,EAAE,EAAE,MAAM,CAAC;IACX,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,UAAU;IACzB,GAAG,EAAE,MAAM,CAAC;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AU,EAAE,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACjC,QAAQ,EAAE,GAAG,CAAC,MAAM,EAAE,YAAY,CAAC,CAAC;IACpC,MAAM,CAAC,EAAE,YAAY,CAAC;CACvB;AAMD;;;GAGG;AACH,eAAO,MAAM,IAAI;;;;;;;;;;CAqBP,CAAC;AAMX,MAAM,WAAW,OAAO;IACtB,MAAM,EAAE,MAAM,EAAE,EAAE,CAAC;IACnB,iBAAiB,EAAE,MAAM,EAAE,CAAC;IAC5B,gBAAgB,CAAC,EAAE,MAAM,EAAE,CAAC;IAC5B,OAAO,CAAC,EAAE,MAAM,EAAE,EAAE,CAAC;CACtB;AAED,MAAM,WAAW,YAAY;IAC3B,SAAS,EAAE,MAAM,EAAE,EAAE,CAAC;CACvB;AAMD,MAAM,WAAW,QAAQ;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,MAAM,CAAC;CACd;AAMD,eAAO,MAAM,aAAa,aAMxB,CAAC;AAEH,eAAO,MAAM,sBAAsB,aAgBjC,CAAC"}
package/dist/types.js ADDED
@@ -0,0 +1,55 @@
1
+ /* This Source Code Form is subject to the terms of the Mozilla Public
2
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
3
+ * file, You can obtain one at https://mozilla.org/MPL/2.0/. */
4
+ // ============================================================================
5
+ // Attribute Namespace Constants
6
+ // ============================================================================
7
+ /**
8
+ * Well-known attribute namespaces used in IFCX files.
9
+ * These are considered stable and safe to implement.
10
+ */
11
+ export const ATTR = {
12
+ // IFC Classification (stable)
13
+ CLASS: 'bsi::ifc::class',
14
+ // USD Geometry (stable - from OpenUSD standard)
15
+ MESH: 'usd::usdgeom::mesh',
16
+ TRANSFORM: 'usd::xformop',
17
+ VISIBILITY: 'usd::usdgeom::visibility',
18
+ // IFC Presentation (stable)
19
+ DIFFUSE_COLOR: 'bsi::ifc::presentation::diffuseColor',
20
+ OPACITY: 'bsi::ifc::presentation::opacity',
21
+ // IFC Materials (likely stable)
22
+ MATERIAL: 'bsi::ifc::material',
23
+ // IFC Properties (stable pattern, specific props may vary)
24
+ PROP_PREFIX: 'bsi::ifc::prop::',
25
+ // IFC Relationships (evolving)
26
+ SPACE_BOUNDARY: 'bsi::ifc::spaceBoundary',
27
+ };
28
+ // ============================================================================
29
+ // Spatial Types
30
+ // ============================================================================
31
+ export const SPATIAL_TYPES = new Set([
32
+ 'IfcProject',
33
+ 'IfcSite',
34
+ 'IfcBuilding',
35
+ 'IfcBuildingStorey',
36
+ 'IfcSpace',
37
+ ]);
38
+ export const BUILDING_ELEMENT_TYPES = new Set([
39
+ 'IfcWall',
40
+ 'IfcWallStandardCase',
41
+ 'IfcDoor',
42
+ 'IfcWindow',
43
+ 'IfcSlab',
44
+ 'IfcColumn',
45
+ 'IfcBeam',
46
+ 'IfcStair',
47
+ 'IfcRamp',
48
+ 'IfcRoof',
49
+ 'IfcCovering',
50
+ 'IfcCurtainWall',
51
+ 'IfcRailing',
52
+ 'IfcOpeningElement',
53
+ 'IfcBuildingElementProxy',
54
+ ]);
55
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;+DAE+D;AA8F/D,+EAA+E;AAC/E,gCAAgC;AAChC,+EAA+E;AAE/E;;;GAGG;AACH,MAAM,CAAC,MAAM,IAAI,GAAG;IAClB,8BAA8B;IAC9B,KAAK,EAAE,iBAAiB;IAExB,gDAAgD;IAChD,IAAI,EAAE,oBAAoB;IAC1B,SAAS,EAAE,cAAc;IACzB,UAAU,EAAE,0BAA0B;IAEtC,4BAA4B;IAC5B,aAAa,EAAE,sCAAsC;IACrD,OAAO,EAAE,iCAAiC;IAE1C,gCAAgC;IAChC,QAAQ,EAAE,oBAAoB;IAE9B,2DAA2D;IAC3D,WAAW,EAAE,kBAAkB;IAE/B,+BAA+B;IAC/B,cAAc,EAAE,yBAAyB;CACjC,CAAC;AA0BX,+EAA+E;AAC/E,gBAAgB;AAChB,+EAA+E;AAE/E,MAAM,CAAC,MAAM,aAAa,GAAG,IAAI,GAAG,CAAC;IACnC,YAAY;IACZ,SAAS;IACT,aAAa;IACb,mBAAmB;IACnB,UAAU;CACX,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,sBAAsB,GAAG,IAAI,GAAG,CAAC;IAC5C,SAAS;IACT,qBAAqB;IACrB,SAAS;IACT,WAAW;IACX,SAAS;IACT,WAAW;IACX,SAAS;IACT,UAAU;IACV,SAAS;IACT,SAAS;IACT,aAAa;IACb,gBAAgB;IAChB,YAAY;IACZ,mBAAmB;IACnB,yBAAyB;CAC1B,CAAC,CAAC"}
package/package.json ADDED
@@ -0,0 +1,48 @@
1
+ {
2
+ "name": "@ifc-lite/ifcx",
3
+ "version": "1.2.0",
4
+ "description": "IFC5 (IFCX) parser for IFC-Lite",
5
+ "type": "module",
6
+ "main": "./dist/index.js",
7
+ "types": "./dist/index.d.ts",
8
+ "exports": {
9
+ ".": {
10
+ "import": "./dist/index.js",
11
+ "types": "./dist/index.d.ts"
12
+ }
13
+ },
14
+ "dependencies": {
15
+ "@ifc-lite/data": "^1.1.7"
16
+ },
17
+ "devDependencies": {
18
+ "typescript": "^5.3.0"
19
+ },
20
+ "license": "MPL-2.0",
21
+ "author": "Louis True",
22
+ "repository": {
23
+ "type": "git",
24
+ "url": "https://github.com/louistrue/ifc-lite.git",
25
+ "directory": "packages/ifcx"
26
+ },
27
+ "homepage": "https://louistrue.github.io/ifc-lite/",
28
+ "bugs": "https://github.com/louistrue/ifc-lite/issues",
29
+ "keywords": [
30
+ "ifc",
31
+ "ifc5",
32
+ "ifcx",
33
+ "bim",
34
+ "parser",
35
+ "aec"
36
+ ],
37
+ "publishConfig": {
38
+ "access": "public"
39
+ },
40
+ "files": [
41
+ "dist",
42
+ "README.md"
43
+ ],
44
+ "scripts": {
45
+ "build": "tsc",
46
+ "dev": "tsc --watch"
47
+ }
48
+ }