@margoengine/ifc 0.0.0-stage → 0.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/LICENSE +201 -0
- package/NOTICE +4 -0
- package/NOTICE.md +16 -0
- package/README.md +366 -3
- package/dist/bcf-wKfMzfyy.js +871 -0
- package/dist/bcf.d.ts +274 -0
- package/dist/bcf.js +1 -0
- package/dist/data-CuTaQPFm.js +534 -0
- package/dist/data.d.ts +205 -0
- package/dist/data.js +1 -0
- package/dist/ids.d.ts +199 -0
- package/dist/ids.js +759 -0
- package/dist/ifc-stream.worker.d.ts +1 -0
- package/dist/ifc.worker.d.ts +1 -0
- package/dist/index.d.ts +50 -0
- package/dist/index.js +116 -0
- package/dist/meshes.d.ts +75 -0
- package/dist/open-D1NQyRTk.js +181 -0
- package/dist/open.d.ts +39 -0
- package/dist/predefined-enums.d.ts +2 -0
- package/dist/query.d.ts +62 -0
- package/dist/query.js +92 -0
- package/dist/raw.d.ts +7 -0
- package/dist/scene.d.ts +187 -0
- package/dist/scene.js +642 -0
- package/dist/schema-B_VBQpdF.js +51 -0
- package/dist/schema-tree.d.ts +2 -0
- package/dist/schema.d.ts +16 -0
- package/dist/section.d.ts +95 -0
- package/dist/section.js +380 -0
- package/dist/step.d.ts +1 -0
- package/dist/tolerance-CAOnp3Mo.js +7 -0
- package/dist/tolerance.d.ts +2 -0
- package/dist/units-B32iYdmV.js +134 -0
- package/dist/units.d.ts +33 -0
- package/dist/worker.d.ts +38 -0
- package/dist/worker.js +108 -0
- package/dist/workers/ifc-stream.js +1 -0
- package/dist/workers/ifc.js +1 -0
- package/dist/write.d.ts +113 -0
- package/dist/write.js +546 -0
- package/package.json +102 -6
package/dist/data.d.ts
ADDED
|
@@ -0,0 +1,205 @@
|
|
|
1
|
+
import { type IFCModel } from './open.js';
|
|
2
|
+
import { type IFCUnits } from './units.js';
|
|
3
|
+
export type { IFCUnit, IFCUnits } from './units.js';
|
|
4
|
+
/** A decoded IFC value: text, number, boolean (null for LOGICAL UNKNOWN), or a list of them. */
|
|
5
|
+
export type IFCValue = string | number | boolean | null | IFCValue[];
|
|
6
|
+
/** One property or quantity. `value` is in SI (m, m2, m3, kg, s, rad, K, ...); `raw` is as the file wrote it. */
|
|
7
|
+
export interface IFCProperty {
|
|
8
|
+
name: string;
|
|
9
|
+
value: IFCValue;
|
|
10
|
+
raw: IFCValue;
|
|
11
|
+
/** How IFC stores it: IfcPropertySingleValue is `single`, IfcQuantityArea is `quantity`, and so on. */
|
|
12
|
+
kind: 'single' | 'enumerated' | 'list' | 'bounded' | 'table' | 'reference' | 'complex' | 'quantity';
|
|
13
|
+
/** The IFC measure or quantity type in upper case, such as `IFCLENGTHMEASURE`, `IFCLABEL` or `IFCQUANTITYAREA`. */
|
|
14
|
+
dataType?: string;
|
|
15
|
+
/** SI symbol of `value` when it has a unit, such as `m2`. */
|
|
16
|
+
unit?: string;
|
|
17
|
+
/** IfcPropertyBoundedValue limits, in SI. */
|
|
18
|
+
lower?: number | null;
|
|
19
|
+
upper?: number | null;
|
|
20
|
+
/** IfcPropertyTableValue: the defining values (the table's first column), in SI, and their data type. */
|
|
21
|
+
defining?: IFCValue[];
|
|
22
|
+
definingDataType?: string;
|
|
23
|
+
/** IfcComplexProperty parts. */
|
|
24
|
+
properties?: Record<string, IFCProperty>;
|
|
25
|
+
}
|
|
26
|
+
/** An IfcPropertySet or IfcElementQuantity. */
|
|
27
|
+
export interface IFCPropertySet {
|
|
28
|
+
id: number;
|
|
29
|
+
name: string;
|
|
30
|
+
globalId?: string;
|
|
31
|
+
/** True for an IfcElementQuantity (Qto_ sets). */
|
|
32
|
+
quantities: boolean;
|
|
33
|
+
/**
|
|
34
|
+
* For an IfcPreDefinedPropertySet (IfcDoorPanelProperties, IfcWindowLiningProperties, ...): its class. Its direct
|
|
35
|
+
* attributes are the properties, and `name` is its Name, or the class when it has none.
|
|
36
|
+
*/
|
|
37
|
+
predefined?: string;
|
|
38
|
+
properties: Record<string, IFCProperty>;
|
|
39
|
+
}
|
|
40
|
+
/** A material an element uses: the material itself or a layer, profile or constituent of a set. */
|
|
41
|
+
export interface IFCMaterial {
|
|
42
|
+
name: string;
|
|
43
|
+
category?: string;
|
|
44
|
+
/** `material` for a single IfcMaterial (or a list member), else the set part it came from. */
|
|
45
|
+
kind: 'material' | 'layer' | 'profile' | 'constituent';
|
|
46
|
+
/** The layer, profile or constituent name. */
|
|
47
|
+
part?: string;
|
|
48
|
+
/** The layer set, profile set or constituent set name. */
|
|
49
|
+
set?: string;
|
|
50
|
+
/** Layer thickness in meters. */
|
|
51
|
+
thickness?: number;
|
|
52
|
+
/** Constituent fraction. */
|
|
53
|
+
fraction?: number;
|
|
54
|
+
}
|
|
55
|
+
/** An IfcClassificationReference (or IfcClassification) an element is associated with. */
|
|
56
|
+
export interface IFCClassification {
|
|
57
|
+
/** IfcClassification.Name: the system, such as `Uniclass 2015`. */
|
|
58
|
+
system?: string;
|
|
59
|
+
/** Identification (IFC4) or ItemReference (IFC2x3), such as `EF_25_10`. */
|
|
60
|
+
code?: string;
|
|
61
|
+
name?: string;
|
|
62
|
+
uri?: string;
|
|
63
|
+
/** Codes of the parent references, outermost first. */
|
|
64
|
+
parents?: string[];
|
|
65
|
+
}
|
|
66
|
+
/** One IFC object definition: a product, spatial element, type object, group, system or the project. */
|
|
67
|
+
export interface IFCElement {
|
|
68
|
+
id: number;
|
|
69
|
+
/** IFC class name as the schema spells it, such as `IfcWall`. */
|
|
70
|
+
type: string;
|
|
71
|
+
globalId?: string;
|
|
72
|
+
name?: string;
|
|
73
|
+
description?: string;
|
|
74
|
+
objectType?: string;
|
|
75
|
+
tag?: string;
|
|
76
|
+
/** PredefinedType as written (`USERDEFINED` included); see `effectivePredefinedType` in `/query`. */
|
|
77
|
+
predefinedType?: string;
|
|
78
|
+
/** For type objects: ElementType, or ProcessType (process types) or ResourceType (resource types). */
|
|
79
|
+
elementType?: string;
|
|
80
|
+
/** Every direct attribute decoded (references are left out). */
|
|
81
|
+
attributes: Record<string, IFCValue>;
|
|
82
|
+
/** The IfcTypeObject assigned through IfcRelDefinesByType. */
|
|
83
|
+
typeId?: number;
|
|
84
|
+
/** Occurrence property sets and quantity sets (for a type object, its own sets). */
|
|
85
|
+
psets: IFCPropertySet[];
|
|
86
|
+
materials: IFCMaterial[];
|
|
87
|
+
classifications: IFCClassification[];
|
|
88
|
+
/** Whole this element is part of (IfcRelAggregates). */
|
|
89
|
+
aggregate?: number;
|
|
90
|
+
/** Whole this element is nested in (IfcRelNests). */
|
|
91
|
+
nest?: number;
|
|
92
|
+
/** Spatial element containing it (IfcRelContainedInSpatialStructure). */
|
|
93
|
+
container?: number;
|
|
94
|
+
/** Spatial elements that also reference it (IfcRelReferencedInSpatialStructure). */
|
|
95
|
+
references?: number[];
|
|
96
|
+
/** For an opening: the element it voids (IfcRelVoidsElement). */
|
|
97
|
+
voids?: number;
|
|
98
|
+
/** For a door or window: the opening it fills (IfcRelFillsElement). */
|
|
99
|
+
fills?: number;
|
|
100
|
+
/** Groups, systems and zones it is assigned to (IfcRelAssignsToGroup). */
|
|
101
|
+
groups?: number[];
|
|
102
|
+
/** The IfcBuildingStorey above it in the spatial structure, if any. */
|
|
103
|
+
storey?: number;
|
|
104
|
+
}
|
|
105
|
+
/** A node of the spatial tree: the project, a site, building, storey, space, facility or part, or an element. */
|
|
106
|
+
export interface IFCSpatialNode {
|
|
107
|
+
id: number;
|
|
108
|
+
type: string;
|
|
109
|
+
name?: string;
|
|
110
|
+
longName?: string;
|
|
111
|
+
/** IfcBuildingStorey.Elevation in meters. */
|
|
112
|
+
elevation?: number;
|
|
113
|
+
/** Aggregated or nested parts (spatial children, or the parts of an element assembly). */
|
|
114
|
+
children: IFCSpatialNode[];
|
|
115
|
+
/** IDs of the elements contained in this spatial element. */
|
|
116
|
+
elements: number[];
|
|
117
|
+
}
|
|
118
|
+
/** The model's georeference: IfcMapConversion (IFC4+), ePSet_MapConversion (IFC2x3) and IfcSite's location. */
|
|
119
|
+
export interface IFCGeoreference {
|
|
120
|
+
source: 'IfcMapConversion' | 'IfcMapConversionScaled' | 'ePSet_MapConversion' | 'IfcSite';
|
|
121
|
+
/** Target CRS (IfcProjectedCRS or ePSet_ProjectedCRS): Name is usually an EPSG code such as `EPSG:28356`. */
|
|
122
|
+
crs?: {
|
|
123
|
+
name?: string;
|
|
124
|
+
description?: string;
|
|
125
|
+
geodeticDatum?: string;
|
|
126
|
+
verticalDatum?: string;
|
|
127
|
+
mapProjection?: string;
|
|
128
|
+
mapZone?: string;
|
|
129
|
+
/** Meters per map unit (1 when MapUnit is metre or unset). */
|
|
130
|
+
mapUnit: number;
|
|
131
|
+
};
|
|
132
|
+
/** In map units. */
|
|
133
|
+
eastings: number;
|
|
134
|
+
northings: number;
|
|
135
|
+
orthogonalHeight: number;
|
|
136
|
+
xAxisAbscissa: number;
|
|
137
|
+
xAxisOrdinate: number;
|
|
138
|
+
/** Anticlockwise angle of the local x axis from map east, radians: atan2(XAxisOrdinate, XAxisAbscissa). */
|
|
139
|
+
rotation: number;
|
|
140
|
+
/** Engineering units to map units (default 1, as IfcMapConversion defines it). */
|
|
141
|
+
scale: number;
|
|
142
|
+
/** IfcMapConversionScaled FactorX, FactorY, FactorZ (IFC 4.3). */
|
|
143
|
+
factors?: [number, number, number];
|
|
144
|
+
/** Meters per engineering (project length) unit. */
|
|
145
|
+
lengthUnit: number;
|
|
146
|
+
/** IfcSite.RefLatitude, RefLongitude in decimal degrees and RefElevation in meters. */
|
|
147
|
+
latitude?: number;
|
|
148
|
+
longitude?: number;
|
|
149
|
+
elevation?: number;
|
|
150
|
+
/** IfcGeometricRepresentationContext.TrueNorth as an angle from the local y axis, radians anticlockwise. */
|
|
151
|
+
trueNorth?: number;
|
|
152
|
+
}
|
|
153
|
+
/** Everything readIFCData returns. Elements and types share one map keyed by expressID. */
|
|
154
|
+
export interface IFCData {
|
|
155
|
+
schema: string;
|
|
156
|
+
units: IFCUnits;
|
|
157
|
+
elements: Map<number, IFCElement>;
|
|
158
|
+
/** GlobalId to expressID. */
|
|
159
|
+
byGlobalId: Map<string, number>;
|
|
160
|
+
/**
|
|
161
|
+
* Property sets of materials, by the IfcMaterial's expressID: IfcMaterialProperties (IFC4, IFC4X3) and
|
|
162
|
+
* IfcExtendedMaterialProperties (IFC2X3), values in SI as for elements.
|
|
163
|
+
*/
|
|
164
|
+
materialProperties: Map<number, IFCPropertySet[]>;
|
|
165
|
+
/** The spatial tree from the IfcProject, or null when the file has none. */
|
|
166
|
+
spatial: IFCSpatialNode | null;
|
|
167
|
+
georeference: IFCGeoreference | null;
|
|
168
|
+
/**
|
|
169
|
+
* IFC2X3 models only (no IFC2X3 schema data ships, see isSubtypeOf): for each class of the model's schema whose
|
|
170
|
+
* instances include object definitions, keyed in upper case, the classes present in the model that the open web-ifc
|
|
171
|
+
* runtime's inherited lookup returns for it (the class itself and its subtypes), in schema spelling. Class filters
|
|
172
|
+
* and isSubtypeOf(data, ...) follow it, so IFC2X3-only classes match their subtypes too.
|
|
173
|
+
*/
|
|
174
|
+
inheritance?: Map<string, string[]>;
|
|
175
|
+
}
|
|
176
|
+
/** Options of readIFCData. */
|
|
177
|
+
export interface IFCDataOptions {
|
|
178
|
+
signal?: AbortSignal;
|
|
179
|
+
/** Read property sets and quantities. Default true. */
|
|
180
|
+
properties?: boolean;
|
|
181
|
+
}
|
|
182
|
+
/** Reads the BIM data of an open model. The model stays open. */
|
|
183
|
+
export declare function readIFCData(model: IFCModel, options?: IFCDataOptions): IFCData;
|
|
184
|
+
/**
|
|
185
|
+
* Converts a point in the model's IFC coordinates (meters, Z up) to map coordinates (map units) by the
|
|
186
|
+
* IfcMapConversion transform: scale, rotate anticlockwise by `rotation` about Z, translate.
|
|
187
|
+
*/
|
|
188
|
+
export declare function modelToMap(geo: IFCGeoreference, [x, y, z]: readonly [number, number, number]): [number, number, number];
|
|
189
|
+
/** The inverse of modelToMap: map coordinates (map units) to the model's IFC coordinates (meters, Z up). */
|
|
190
|
+
export declare function mapToModel(geo: IFCGeoreference, [e, n, h]: readonly [number, number, number]): [number, number, number];
|
|
191
|
+
/** Engine axes (Y up, as readIFCGeometry writes vertices) to IFC axes (Z up), adding back a rebased origin. */
|
|
192
|
+
export declare function engineToIFC([x, y, z]: readonly number[], origin?: readonly number[]): [number, number, number];
|
|
193
|
+
/** IFC axes (Z up, meters) to engine axes (Y up), subtracting a rebased origin. */
|
|
194
|
+
export declare function ifcToEngine([x, y, z]: readonly number[], origin?: readonly number[]): [number, number, number];
|
|
195
|
+
/**
|
|
196
|
+
* An element's properties merged with its type's: the type's sets first, then the occurrence's, so an occurrence
|
|
197
|
+
* property overrides the type property of the same set and name (IFC4 IfcRelDefinesByType). Values are SI.
|
|
198
|
+
*/
|
|
199
|
+
export declare function propertiesOf(data: IFCData, id: number): Record<string, Record<string, IFCProperty>>;
|
|
200
|
+
/** One property of an element (type properties included, occurrence first), or undefined. */
|
|
201
|
+
export declare function propertyOf(data: IFCData, id: number, set: string, name: string): IFCProperty | undefined;
|
|
202
|
+
/** An element's materials, falling back to its type's when the occurrence has none. */
|
|
203
|
+
export declare function materialsOf(data: IFCData, id: number): IFCMaterial[];
|
|
204
|
+
/** An element's classifications together with its type's. */
|
|
205
|
+
export declare function classificationsOf(data: IFCData, id: number): IFCClassification[];
|
package/dist/data.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { t as classificationsOf, n as engineToIFC, r as ifcToEngine, i as mapToModel, a as materialsOf, o as modelToMap, s as propertiesOf, c as propertyOf, l as readIFCData } from "./data-CuTaQPFm.js";
|
package/dist/ids.d.ts
ADDED
|
@@ -0,0 +1,199 @@
|
|
|
1
|
+
/// <reference lib="esnext.disposable" preserve="true" />
|
|
2
|
+
import { type BCFCamera, type BCFTopic } from './bcf.js';
|
|
3
|
+
import { type IFCData } from './data.js';
|
|
4
|
+
import { type IFCModel } from './open.js';
|
|
5
|
+
/** An `xs:restriction`: one or more of an enumeration, patterns, bounds and lengths over a base type. */
|
|
6
|
+
export interface IDSRestriction {
|
|
7
|
+
/** The XML base type, such as `xs:string`, `xs:double` or `xs:integer`. */
|
|
8
|
+
base: string;
|
|
9
|
+
enumeration?: string[];
|
|
10
|
+
/** XML Schema regular expressions; a value matches when it matches any of them. */
|
|
11
|
+
pattern?: string[];
|
|
12
|
+
minInclusive?: string;
|
|
13
|
+
maxInclusive?: string;
|
|
14
|
+
minExclusive?: string;
|
|
15
|
+
maxExclusive?: string;
|
|
16
|
+
length?: number;
|
|
17
|
+
minLength?: number;
|
|
18
|
+
maxLength?: number;
|
|
19
|
+
}
|
|
20
|
+
/** A facet parameter: a simple value or a restriction. */
|
|
21
|
+
export type IDSValue = {
|
|
22
|
+
simpleValue: string;
|
|
23
|
+
} | {
|
|
24
|
+
restriction: IDSRestriction;
|
|
25
|
+
};
|
|
26
|
+
/** How a requirement applies: present and matching, absent or not matching, or matching when present. */
|
|
27
|
+
export type IDSCardinality = 'required' | 'optional' | 'prohibited';
|
|
28
|
+
/** Entity facet: the IFC class (exact, upper case) and optionally its predefined type. */
|
|
29
|
+
export interface IDSEntityFacet {
|
|
30
|
+
facet: 'entity';
|
|
31
|
+
/** The IFC class in upper case, such as `IFCWALL`. */
|
|
32
|
+
name: IDSValue;
|
|
33
|
+
predefinedType?: IDSValue;
|
|
34
|
+
}
|
|
35
|
+
/** Attribute facet: an IFC attribute by name, filled in, optionally with a value. */
|
|
36
|
+
export interface IDSAttributeFacet {
|
|
37
|
+
facet: 'attribute';
|
|
38
|
+
name: IDSValue;
|
|
39
|
+
value?: IDSValue;
|
|
40
|
+
}
|
|
41
|
+
/** Classification facet: a classification system and/or reference code (a code matches its sub-references). */
|
|
42
|
+
export interface IDSClassificationFacet {
|
|
43
|
+
facet: 'classification';
|
|
44
|
+
system?: IDSValue;
|
|
45
|
+
value?: IDSValue;
|
|
46
|
+
uri?: string;
|
|
47
|
+
}
|
|
48
|
+
/** Property facet: a property or quantity by set and name, optionally with its data type and value. */
|
|
49
|
+
export interface IDSPropertyFacet {
|
|
50
|
+
facet: 'property';
|
|
51
|
+
propertySet: IDSValue;
|
|
52
|
+
baseName: IDSValue;
|
|
53
|
+
/** IFC data type in upper case, such as `IFCLABEL` or `IFCLENGTHMEASURE`. */
|
|
54
|
+
dataType?: string;
|
|
55
|
+
/** In the IDS units table's SI unit for `dataType`. */
|
|
56
|
+
value?: IDSValue;
|
|
57
|
+
uri?: string;
|
|
58
|
+
}
|
|
59
|
+
/** Material facet: any material, or one whose name, category or layer, profile or constituent name matches. */
|
|
60
|
+
export interface IDSMaterialFacet {
|
|
61
|
+
facet: 'material';
|
|
62
|
+
value?: IDSValue;
|
|
63
|
+
uri?: string;
|
|
64
|
+
}
|
|
65
|
+
/** IDS 1.0 partOf relations. */
|
|
66
|
+
export type IDSRelation = 'IFCRELAGGREGATES' | 'IFCRELASSIGNSTOGROUP' | 'IFCRELCONTAINEDINSPATIALSTRUCTURE' | 'IFCRELNESTS' | 'IFCRELVOIDSELEMENT IFCRELFILLSELEMENT';
|
|
67
|
+
/** PartOf facet: a whole (an entity facet) reached by one relation, or any, recursively. */
|
|
68
|
+
export interface IDSPartOfFacet {
|
|
69
|
+
facet: 'partOf';
|
|
70
|
+
entity: IDSEntityFacet;
|
|
71
|
+
relation?: IDSRelation;
|
|
72
|
+
}
|
|
73
|
+
/** Any of the six IDS 1.0 facets. */
|
|
74
|
+
export type IDSFacet = IDSEntityFacet | IDSAttributeFacet | IDSClassificationFacet | IDSPropertyFacet | IDSMaterialFacet | IDSPartOfFacet;
|
|
75
|
+
/** A requirement facet: a facet with its cardinality and the author's instructions. */
|
|
76
|
+
export type IDSRequirement = IDSFacet & {
|
|
77
|
+
cardinality: IDSCardinality;
|
|
78
|
+
instructions?: string;
|
|
79
|
+
};
|
|
80
|
+
/** One specification: which entities it applies to and what they must carry. */
|
|
81
|
+
export interface IDSSpecification {
|
|
82
|
+
name: string;
|
|
83
|
+
/** Schemas the specification applies to: `IFC2X3`, `IFC4`, `IFC4X3_ADD2`. */
|
|
84
|
+
ifcVersion: string[];
|
|
85
|
+
identifier?: string;
|
|
86
|
+
description?: string;
|
|
87
|
+
instructions?: string;
|
|
88
|
+
/**
|
|
89
|
+
* Applicability occurrences, as ids.xsd's defaults read them when absent (1 and 1). `maxOccurs` 0 is prohibited;
|
|
90
|
+
* otherwise `minOccurs` 0 is optional and 1 (or more) required. IDS 1.0 writes required as 1 and `unbounded`; a
|
|
91
|
+
* `maxOccurs` of 1 reads the same.
|
|
92
|
+
*/
|
|
93
|
+
minOccurs: number;
|
|
94
|
+
maxOccurs: number | 'unbounded';
|
|
95
|
+
applicability: IDSFacet[];
|
|
96
|
+
requirements: IDSRequirement[];
|
|
97
|
+
/** The requirements element's description. */
|
|
98
|
+
requirementsDescription?: string;
|
|
99
|
+
}
|
|
100
|
+
/** The IDS document header. */
|
|
101
|
+
export interface IDSInfo {
|
|
102
|
+
title: string;
|
|
103
|
+
copyright?: string;
|
|
104
|
+
version?: string;
|
|
105
|
+
description?: string;
|
|
106
|
+
author?: string;
|
|
107
|
+
/** `YYYY-MM-DD`. */
|
|
108
|
+
date?: string;
|
|
109
|
+
purpose?: string;
|
|
110
|
+
milestone?: string;
|
|
111
|
+
}
|
|
112
|
+
/** A parsed IDS document. */
|
|
113
|
+
export interface IDSDocument {
|
|
114
|
+
info: IDSInfo;
|
|
115
|
+
specifications: IDSSpecification[];
|
|
116
|
+
}
|
|
117
|
+
/** Options of parseIDS. */
|
|
118
|
+
export interface IDSParseOptions {
|
|
119
|
+
/** Most XML elements to read. Default 1,000,000. */
|
|
120
|
+
maxElements?: number;
|
|
121
|
+
}
|
|
122
|
+
/**
|
|
123
|
+
* Reads an IDS 1.0 document (`.ids` XML) into plain objects. Rejects malformed XML and documents that miss what
|
|
124
|
+
* ids.xsd requires with `LoaderError` (format `IDS`, code `syntax`).
|
|
125
|
+
*/
|
|
126
|
+
export declare function parseIDS(source: string | Uint8Array, options?: IDSParseOptions): IDSDocument;
|
|
127
|
+
/** Writes an IDS 1.0 document as XML, facets in the order ids.xsd's sequences require. parseIDS reads it back unchanged. */
|
|
128
|
+
export declare function writeIDS(ids: IDSDocument): string;
|
|
129
|
+
/** One requirement an applicable entity did not meet. */
|
|
130
|
+
export interface IDSFailure {
|
|
131
|
+
/** expressID of the entity. */
|
|
132
|
+
id: number;
|
|
133
|
+
/** IFC class of the entity, such as `IfcWall`. */
|
|
134
|
+
type: string;
|
|
135
|
+
globalId?: string;
|
|
136
|
+
name?: string;
|
|
137
|
+
/** Index of the requirement in the specification's `requirements`. */
|
|
138
|
+
requirement: number;
|
|
139
|
+
/** Why it failed, in words, such as `Pset_WallCommon.FireRating is 1HR, expected 2HR`. */
|
|
140
|
+
reason: string;
|
|
141
|
+
}
|
|
142
|
+
/** The outcome of one specification. */
|
|
143
|
+
export interface IDSSpecificationResult {
|
|
144
|
+
specification: IDSSpecification;
|
|
145
|
+
status: 'pass' | 'fail';
|
|
146
|
+
/** Notes that do not change the status, such as a model schema the specification's ifcVersion does not list. */
|
|
147
|
+
warnings: string[];
|
|
148
|
+
/** expressIDs of the entities the applicability selects, in ascending order. */
|
|
149
|
+
applicable: number[];
|
|
150
|
+
/** Applicable entities that met every requirement. */
|
|
151
|
+
passed: number[];
|
|
152
|
+
/** One entry per unmet requirement of an applicable entity. */
|
|
153
|
+
failures: IDSFailure[];
|
|
154
|
+
/** Why the specification failed as a whole: no applicable entity, a prohibited match, or an invalid IDS. */
|
|
155
|
+
reason?: string;
|
|
156
|
+
}
|
|
157
|
+
/** What checkIDS returns. */
|
|
158
|
+
export interface IDSReport {
|
|
159
|
+
/** True when no specification failed. */
|
|
160
|
+
pass: boolean;
|
|
161
|
+
schema: string;
|
|
162
|
+
title: string;
|
|
163
|
+
specifications: IDSSpecificationResult[];
|
|
164
|
+
}
|
|
165
|
+
/** Options of checkIDS. */
|
|
166
|
+
export interface IDSCheckOptions {
|
|
167
|
+
signal?: AbortSignal;
|
|
168
|
+
/** readIFCData of the same model, when the caller already has it. */
|
|
169
|
+
data?: IFCData;
|
|
170
|
+
}
|
|
171
|
+
/**
|
|
172
|
+
* Checks an open IFC model against an IDS document, as IDS 1.0 defines: each specification's applicability selects
|
|
173
|
+
* entities (any IFC entity, not only products), each applicable entity must meet every requirement, and the
|
|
174
|
+
* specification's minOccurs and maxOccurs say whether applicable entities are required, optional or prohibited. Values
|
|
175
|
+
* compare in SI with the IDS tolerance. The model stays open.
|
|
176
|
+
*/
|
|
177
|
+
export declare function checkIDS(model: IFCModel, ids: IDSDocument, options?: IDSCheckOptions): IDSReport;
|
|
178
|
+
/** Options of bcfTopicsFromIDS. */
|
|
179
|
+
export interface IDSBCFOptions {
|
|
180
|
+
/** The topics' and comments' author, such as an e-mail address. */
|
|
181
|
+
author: string;
|
|
182
|
+
/** ISO 8601 date and time of the topics; default now. */
|
|
183
|
+
date?: string;
|
|
184
|
+
/** Topic type (default `Issue`), status (default `Open`) and labels (default `IDS`). */
|
|
185
|
+
type?: string;
|
|
186
|
+
status?: string;
|
|
187
|
+
labels?: string[];
|
|
188
|
+
/**
|
|
189
|
+
* The viewpoints' camera (IFC world meters, as `bcfFromView` makes it). BCF 3.0 needs one; without it the topics
|
|
190
|
+
* suit BCF 2.1 (`writeBCF({ topics }, { version: '2.1' })`).
|
|
191
|
+
*/
|
|
192
|
+
camera?: BCFCamera;
|
|
193
|
+
}
|
|
194
|
+
/**
|
|
195
|
+
* Turns the failed specifications of an IDS report into BCF topics, as the IDS developer guide recommends for
|
|
196
|
+
* sharing results: one topic per failed specification, its description saying why, a viewpoint selecting the failing
|
|
197
|
+
* elements by GlobalId and one comment per failure. Write them with `writeBCF({ topics })` from `/bcf`.
|
|
198
|
+
*/
|
|
199
|
+
export declare function bcfTopicsFromIDS(report: IDSReport, options: IDSBCFOptions): BCFTopic[];
|