@ifc-lite/bcf 1.4.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,229 @@
1
+ /**
2
+ * BCF (BIM Collaboration Format) TypeScript types
3
+ * Based on BCF 2.1 and 3.0 specifications by buildingSMART
4
+ * https://github.com/buildingSMART/BCF-XML
5
+ */
6
+ export interface BCFProject {
7
+ /** BCF version (2.1 or 3.0) */
8
+ version: '2.1' | '3.0';
9
+ /** Project ID (GUID) */
10
+ projectId?: string;
11
+ /** Project name */
12
+ name?: string;
13
+ /** Map of topic GUIDs to topics */
14
+ topics: Map<string, BCFTopic>;
15
+ /** Extensions schema (allowed topic types, statuses, etc.) */
16
+ extensions?: BCFExtensions;
17
+ }
18
+ export interface BCFExtensions {
19
+ topicTypes?: string[];
20
+ topicStatuses?: string[];
21
+ priorities?: string[];
22
+ topicLabels?: string[];
23
+ users?: string[];
24
+ stages?: string[];
25
+ }
26
+ export interface BCFTopic {
27
+ /** Unique identifier (22-char GUID) */
28
+ guid: string;
29
+ /** Topic title (required) */
30
+ title: string;
31
+ /** Detailed description */
32
+ description?: string;
33
+ /** Topic type (e.g., 'Error', 'Warning', 'Info', 'Request') */
34
+ topicType?: string;
35
+ /** Status (e.g., 'Open', 'In Progress', 'Closed', 'Resolved') */
36
+ topicStatus?: string;
37
+ /** Priority (e.g., 'High', 'Medium', 'Low') */
38
+ priority?: string;
39
+ /** Index for ordering topics */
40
+ index?: number;
41
+ /** Creation date (ISO 8601) */
42
+ creationDate: string;
43
+ /** Author email */
44
+ creationAuthor: string;
45
+ /** Modification date (ISO 8601) */
46
+ modifiedDate?: string;
47
+ /** Modifier email */
48
+ modifiedAuthor?: string;
49
+ /** Due date (ISO 8601) */
50
+ dueDate?: string;
51
+ /** Assigned user email */
52
+ assignedTo?: string;
53
+ /** Stage/phase */
54
+ stage?: string;
55
+ /** Labels for categorization */
56
+ labels?: string[];
57
+ /** Referenced BIM snippet */
58
+ bimSnippet?: BCFBimSnippet;
59
+ /** Document references */
60
+ documentReferences?: BCFDocumentReference[];
61
+ /** Related topics */
62
+ relatedTopics?: string[];
63
+ /** Comments on the topic */
64
+ comments: BCFComment[];
65
+ /** Viewpoints associated with the topic */
66
+ viewpoints: BCFViewpoint[];
67
+ }
68
+ export interface BCFBimSnippet {
69
+ snippetType: string;
70
+ isExternal: boolean;
71
+ reference: string;
72
+ referenceSchema?: string;
73
+ }
74
+ export interface BCFDocumentReference {
75
+ guid?: string;
76
+ isExternal: boolean;
77
+ referencedDocument: string;
78
+ description?: string;
79
+ }
80
+ export interface BCFComment {
81
+ /** Unique identifier */
82
+ guid: string;
83
+ /** Comment creation date (ISO 8601) */
84
+ date: string;
85
+ /** Author email */
86
+ author: string;
87
+ /** Comment text */
88
+ comment: string;
89
+ /** Reference to a viewpoint GUID */
90
+ viewpointGuid?: string;
91
+ /** Modification date */
92
+ modifiedDate?: string;
93
+ /** Modifier email */
94
+ modifiedAuthor?: string;
95
+ }
96
+ export interface BCFViewpoint {
97
+ /** Unique identifier */
98
+ guid: string;
99
+ /** Perspective camera settings */
100
+ perspectiveCamera?: BCFPerspectiveCamera;
101
+ /** Orthographic camera settings */
102
+ orthogonalCamera?: BCFOrthogonalCamera;
103
+ /** Lines markup (3D annotations) */
104
+ lines?: BCFLine[];
105
+ /** Clipping planes (section cuts) */
106
+ clippingPlanes?: BCFClippingPlane[];
107
+ /** Bitmaps (image annotations) */
108
+ bitmaps?: BCFBitmap[];
109
+ /** Snapshot image (PNG or JPG) as data URL or filename */
110
+ snapshot?: string;
111
+ /** Snapshot data as Uint8Array for export */
112
+ snapshotData?: Uint8Array;
113
+ /** Component visibility and selection */
114
+ components?: BCFComponents;
115
+ }
116
+ export interface BCFPoint {
117
+ x: number;
118
+ y: number;
119
+ z: number;
120
+ }
121
+ export interface BCFDirection {
122
+ x: number;
123
+ y: number;
124
+ z: number;
125
+ }
126
+ export interface BCFPerspectiveCamera {
127
+ /** Camera position in world coordinates */
128
+ cameraViewPoint: BCFPoint;
129
+ /** Camera viewing direction (normalized) */
130
+ cameraDirection: BCFDirection;
131
+ /** Camera up vector (normalized) */
132
+ cameraUpVector: BCFDirection;
133
+ /** Vertical field of view in degrees (typically 45-60) */
134
+ fieldOfView: number;
135
+ /** Aspect ratio (optional, BCF 3.0) */
136
+ aspectRatio?: number;
137
+ }
138
+ export interface BCFOrthogonalCamera {
139
+ /** Camera position in world coordinates */
140
+ cameraViewPoint: BCFPoint;
141
+ /** Camera viewing direction (normalized) */
142
+ cameraDirection: BCFDirection;
143
+ /** Camera up vector (normalized) */
144
+ cameraUpVector: BCFDirection;
145
+ /** View-to-world scale factor */
146
+ viewToWorldScale: number;
147
+ /** Aspect ratio (optional, BCF 3.0) */
148
+ aspectRatio?: number;
149
+ }
150
+ export interface BCFLine {
151
+ /** Start point in 3D world coordinates */
152
+ startPoint: BCFPoint;
153
+ /** End point in 3D world coordinates */
154
+ endPoint: BCFPoint;
155
+ }
156
+ export interface BCFClippingPlane {
157
+ /** Point on the clipping plane */
158
+ location: BCFPoint;
159
+ /** Normal direction of the clipping plane */
160
+ direction: BCFDirection;
161
+ }
162
+ export interface BCFBitmap {
163
+ /** Bitmap format (PNG or JPG) */
164
+ format: 'PNG' | 'JPG';
165
+ /** Reference to the bitmap file in the BCF archive */
166
+ reference: string;
167
+ /** Center location in world coordinates */
168
+ location: BCFPoint;
169
+ /** Normal vector of the bitmap plane */
170
+ normal: BCFDirection;
171
+ /** Up vector of the bitmap */
172
+ up: BCFDirection;
173
+ /** Height of the bitmap in world units */
174
+ height: number;
175
+ }
176
+ export interface BCFComponents {
177
+ /** Components to select/highlight */
178
+ selection?: BCFComponent[];
179
+ /** Visibility settings */
180
+ visibility?: BCFVisibility;
181
+ /** Coloring settings */
182
+ coloring?: BCFColoring[];
183
+ }
184
+ export interface BCFComponent {
185
+ /** IFC GlobalId (22-character base64 encoded GUID) */
186
+ ifcGuid?: string;
187
+ /** Fallback: authoring tool's internal ID */
188
+ authoringToolId?: string;
189
+ /** Originating system identifier */
190
+ originatingSystem?: string;
191
+ }
192
+ export interface BCFVisibility {
193
+ /** Default visibility for all components */
194
+ defaultVisibility: boolean;
195
+ /** Components that are exceptions to the default visibility */
196
+ exceptions?: BCFComponent[];
197
+ /** View setup hints for the viewer */
198
+ viewSetupHints?: BCFViewSetupHints;
199
+ }
200
+ export interface BCFViewSetupHints {
201
+ spacesVisible?: boolean;
202
+ spaceBoundariesVisible?: boolean;
203
+ openingsVisible?: boolean;
204
+ }
205
+ export interface BCFColoring {
206
+ /** ARGB color in hex format (e.g., 'FFFF0000' for red) */
207
+ color: string;
208
+ /** Components to apply this color to */
209
+ components: BCFComponent[];
210
+ }
211
+ export interface BCFVersion {
212
+ versionId: '2.1' | '3.0';
213
+ detailedVersion?: string;
214
+ }
215
+ export interface BCFHeaderFile {
216
+ /** IFC project GUID */
217
+ ifcProject?: string;
218
+ /** IFC spatial structure element GUID */
219
+ ifcSpatialStructureElement?: string;
220
+ /** Is the file reference external? */
221
+ isExternal?: boolean;
222
+ /** Filename or URL */
223
+ filename?: string;
224
+ /** Date the file was created */
225
+ date?: string;
226
+ /** Reference to the IFC file */
227
+ reference?: string;
228
+ }
229
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAIA;;;;GAIG;AAMH,MAAM,WAAW,UAAU;IACzB,+BAA+B;IAC/B,OAAO,EAAE,KAAK,GAAG,KAAK,CAAC;IACvB,wBAAwB;IACxB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,mBAAmB;IACnB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,mCAAmC;IACnC,MAAM,EAAE,GAAG,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;IAC9B,8DAA8D;IAC9D,UAAU,CAAC,EAAE,aAAa,CAAC;CAC5B;AAED,MAAM,WAAW,aAAa;IAC5B,UAAU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AAsC;IACtC,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,sBAAsB;IACtB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,gCAAgC;IAChC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,gCAAgC;IAChC,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB"}
package/dist/types.js ADDED
@@ -0,0 +1,5 @@
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
+ export {};
5
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;+DAE+D"}
@@ -0,0 +1,138 @@
1
+ /**
2
+ * Viewpoint conversion utilities
3
+ *
4
+ * Converts between viewer camera state and BCF viewpoint format.
5
+ * Handles coordinate system transformations and camera parameter mapping.
6
+ */
7
+ import type { BCFViewpoint, BCFPerspectiveCamera, BCFOrthogonalCamera, BCFClippingPlane } from './types.js';
8
+ export interface ViewerCameraState {
9
+ /** Camera position in world coordinates */
10
+ position: {
11
+ x: number;
12
+ y: number;
13
+ z: number;
14
+ };
15
+ /** Camera look-at target in world coordinates */
16
+ target: {
17
+ x: number;
18
+ y: number;
19
+ z: number;
20
+ };
21
+ /** Camera up vector */
22
+ up: {
23
+ x: number;
24
+ y: number;
25
+ z: number;
26
+ };
27
+ /** Field of view in radians */
28
+ fov: number;
29
+ /** Is orthographic projection */
30
+ isOrthographic?: boolean;
31
+ /** Orthographic scale (view-to-world) */
32
+ orthoScale?: number;
33
+ }
34
+ export interface ViewerSectionPlane {
35
+ /** Axis: 'down' (Y), 'front' (Z), 'side' (X) */
36
+ axis: 'down' | 'front' | 'side';
37
+ /** Position as percentage (0-100) of model bounds */
38
+ position: number;
39
+ /** Is the section plane enabled */
40
+ enabled: boolean;
41
+ /** Is the plane flipped */
42
+ flipped: boolean;
43
+ }
44
+ export interface ViewerBounds {
45
+ min: {
46
+ x: number;
47
+ y: number;
48
+ z: number;
49
+ };
50
+ max: {
51
+ x: number;
52
+ y: number;
53
+ z: number;
54
+ };
55
+ }
56
+ /**
57
+ * Convert viewer camera state to BCF perspective camera
58
+ *
59
+ * BCF uses direction vector instead of look-at point.
60
+ * Direction = normalize(target - position)
61
+ *
62
+ * Also converts from viewer's Y-up to BCF's Z-up coordinate system.
63
+ */
64
+ export declare function cameraToPerspective(camera: ViewerCameraState): BCFPerspectiveCamera;
65
+ /**
66
+ * Convert viewer camera state to BCF orthogonal camera
67
+ *
68
+ * Also converts from viewer's Y-up to BCF's Z-up coordinate system.
69
+ */
70
+ export declare function cameraToOrthogonal(camera: ViewerCameraState, viewToWorldScale: number): BCFOrthogonalCamera;
71
+ /**
72
+ * Convert BCF perspective camera to viewer camera state
73
+ *
74
+ * BCF stores direction, but viewers need a look-at point.
75
+ * We compute target = position + direction * distance
76
+ *
77
+ * Also converts from BCF's Z-up to viewer's Y-up coordinate system.
78
+ *
79
+ * @param camera - BCF perspective camera
80
+ * @param targetDistance - Distance from eye to target (default: 10)
81
+ */
82
+ export declare function perspectiveToCamera(camera: BCFPerspectiveCamera, targetDistance?: number): ViewerCameraState;
83
+ /**
84
+ * Convert BCF orthogonal camera to viewer camera state
85
+ *
86
+ * Also converts from BCF's Z-up to viewer's Y-up coordinate system.
87
+ */
88
+ export declare function orthogonalToCamera(camera: BCFOrthogonalCamera, targetDistance?: number): ViewerCameraState;
89
+ /**
90
+ * Convert viewer section plane to BCF clipping plane
91
+ *
92
+ * ifc-lite uses percentage position (0-100) along an axis.
93
+ * BCF uses absolute location and direction in world coordinates (Z-up).
94
+ */
95
+ export declare function sectionPlaneToClippingPlane(sectionPlane: ViewerSectionPlane, bounds: ViewerBounds): BCFClippingPlane | null;
96
+ /**
97
+ * Convert BCF clipping plane to viewer section plane
98
+ *
99
+ * Determines the closest axis and calculates percentage position.
100
+ * Converts from BCF coordinates (Z-up) to viewer coordinates (Y-up).
101
+ */
102
+ export declare function clippingPlaneToSectionPlane(plane: BCFClippingPlane, bounds: ViewerBounds): ViewerSectionPlane;
103
+ /**
104
+ * Create a BCF viewpoint from viewer state
105
+ *
106
+ * For visibility:
107
+ * - Use `hiddenGuids` when most entities are visible (defaultVisibility=true, exceptions=hidden)
108
+ * - Use `visibleGuids` when most entities are hidden/isolated (defaultVisibility=false, exceptions=visible)
109
+ */
110
+ export declare function createViewpoint(options: {
111
+ camera: ViewerCameraState;
112
+ sectionPlane?: ViewerSectionPlane;
113
+ bounds?: ViewerBounds;
114
+ snapshot?: string;
115
+ snapshotData?: Uint8Array;
116
+ selectedGuids?: string[];
117
+ hiddenGuids?: string[];
118
+ visibleGuids?: string[];
119
+ coloredGuids?: {
120
+ color: string;
121
+ guids: string[];
122
+ }[];
123
+ }): BCFViewpoint;
124
+ /**
125
+ * Extract viewer state from a BCF viewpoint
126
+ */
127
+ export declare function extractViewpointState(viewpoint: BCFViewpoint, bounds?: ViewerBounds, targetDistance?: number): {
128
+ camera?: ViewerCameraState;
129
+ sectionPlane?: ViewerSectionPlane;
130
+ selectedGuids: string[];
131
+ hiddenGuids: string[];
132
+ visibleGuids: string[];
133
+ coloredGuids: {
134
+ color: string;
135
+ guids: string[];
136
+ }[];
137
+ };
138
+ //# sourceMappingURL=viewpoint.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"viewpoint.d.ts","sourceRoot":"","sources":["../src/viewpoint.ts"],"names":[],"mappings":"AAIA;;;;;GAKG;AAEH,OAAO,KAAK,EACV,YAAY,EACZ,oBAAoB,EACpB,mBAAmB,EACnB,gBAAgB,EAGjB,MAAM,YAAY,CAAC;AAOpB,MAAM,WAAW,iBAAiB;IAChC,2CAA2C;IAC3C,QAAQ,EAAE;QAAE,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IAC9C,iDAAiD;I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