@ifc-lite/sdk 4.0.2 → 5.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/dist/backend-extension-types.d.ts +16 -0
- package/dist/backend-extension-types.d.ts.map +1 -0
- package/dist/backend-extension-types.js +5 -0
- package/dist/backend-extension-types.js.map +1 -0
- package/dist/context.d.ts +2 -0
- package/dist/context.d.ts.map +1 -1
- package/dist/context.js +3 -0
- package/dist/context.js.map +1 -1
- package/dist/index.d.ts +4 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -1
- package/dist/index.js.map +1 -1
- package/dist/namespaces/bcf-guid-color.d.ts +16 -0
- package/dist/namespaces/bcf-guid-color.d.ts.map +1 -0
- package/dist/namespaces/bcf-guid-color.js +49 -0
- package/dist/namespaces/bcf-guid-color.js.map +1 -0
- package/dist/namespaces/bcf-load.d.ts +10 -0
- package/dist/namespaces/bcf-load.d.ts.map +1 -0
- package/dist/namespaces/bcf-load.js +15 -0
- package/dist/namespaces/bcf-load.js.map +1 -0
- package/dist/namespaces/bcf-viewpoint.d.ts +212 -0
- package/dist/namespaces/bcf-viewpoint.d.ts.map +1 -0
- package/dist/namespaces/bcf-viewpoint.js +94 -0
- package/dist/namespaces/bcf-viewpoint.js.map +1 -0
- package/dist/namespaces/bcf.d.ts +43 -66
- package/dist/namespaces/bcf.d.ts.map +1 -1
- package/dist/namespaces/bcf.js +110 -81
- package/dist/namespaces/bcf.js.map +1 -1
- package/dist/namespaces/structural.d.ts +45 -0
- package/dist/namespaces/structural.d.ts.map +1 -0
- package/dist/namespaces/structural.js +44 -0
- package/dist/namespaces/structural.js.map +1 -0
- package/dist/structural-types.d.ts +128 -0
- package/dist/structural-types.d.ts.map +1 -0
- package/dist/structural-types.js +5 -0
- package/dist/structural-types.js.map +1 -0
- package/dist/transport/remote-backend.d.ts +2 -1
- package/dist/transport/remote-backend.d.ts.map +1 -1
- package/dist/transport/remote-backend.js +1 -0
- package/dist/transport/remote-backend.js.map +1 -1
- package/dist/types.d.ts +8 -40
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +13 -0
- package/dist/types.js.map +1 -1
- package/package.json +13 -13
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bcf-viewpoint.js","sourceRoot":"","sources":["../../src/namespaces/bcf-viewpoint.ts"],"names":[],"mappings":"AAAA;;+DAE+D;AA6H/D,+EAA+E;AAC/E,kDAAkD;AAClD,+EAA+E;AAE/E;;;;;;GAMG;AACH,MAAM,OAAO,0BAA2B,SAAQ,KAAK;IACnD,YAAY,OAAiB;QAC3B,KAAK,CACH,gDAAgD,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI;YACpE,sEAAsE;YACtE,sEAAsE;YACtE,yBAAyB,CAC5B,CAAC;QACF,IAAI,CAAC,IAAI,GAAG,4BAA4B,CAAC;IAC3C,CAAC;CACF;AAED;;;;;;;GAOG;AACH,MAAM,OAAO,yBAA0B,SAAQ,KAAK;IAClD;QACE,KAAK,CACH,sEAAsE;YACpE,oEAAoE;YACpE,qCAAqC,CACxC,CAAC;QACF,IAAI,CAAC,IAAI,GAAG,2BAA2B,CAAC;IAC1C,CAAC;CACF;AAED,+EAA+E;AAC/E,qBAAqB;AACrB,+EAA+E;AAE/E;;mEAEmE;AACnE,MAAM,CAAC,MAAM,qBAAqB,GAAG,IAAI,CAAC,EAAE,GAAG,CAAC,CAAC;AAEjD,MAAM,UAAU,MAAM,CAAC,CAA2B;IAChD,OAAO,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;AACvC,CAAC;AAED,MAAM,UAAU,OAAO,CAAC,CAAsC;IAC5D,OAAO,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;AACzB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BCF topics.
|
|
7
7
|
*/
|
|
8
|
+
import type { AABB } from '../types.js';
|
|
9
|
+
import { type ViewpointOptions, type ExtractedViewpointState, IncompleteCameraStateError, MissingSectionBoundsError, type BcfViewerBounds } from './bcf-viewpoint.js';
|
|
10
|
+
import { BCFGuidColorBase } from './bcf-guid-color.js';
|
|
11
|
+
export type { ViewpointOptions, ExtractedViewpointState };
|
|
12
|
+
export { IncompleteCameraStateError, MissingSectionBoundsError };
|
|
8
13
|
export interface TopicOptions {
|
|
9
14
|
title: string;
|
|
10
15
|
description?: string;
|
|
@@ -21,40 +26,6 @@ export interface CommentOptions {
|
|
|
21
26
|
comment: string;
|
|
22
27
|
viewpointGuid?: string;
|
|
23
28
|
}
|
|
24
|
-
export interface ViewpointOptions {
|
|
25
|
-
/** Camera state from bim.viewer.getCamera() */
|
|
26
|
-
camera?: {
|
|
27
|
-
mode: 'perspective' | 'orthographic';
|
|
28
|
-
position?: [number, number, number];
|
|
29
|
-
target?: [number, number, number];
|
|
30
|
-
up?: [number, number, number];
|
|
31
|
-
};
|
|
32
|
-
/** Section plane from bim.viewer.getSection() */
|
|
33
|
-
sectionPlane?: {
|
|
34
|
-
axis: 'x' | 'y' | 'z';
|
|
35
|
-
position: number;
|
|
36
|
-
enabled: boolean;
|
|
37
|
-
flipped: boolean;
|
|
38
|
-
};
|
|
39
|
-
/** Component selection/visibility */
|
|
40
|
-
components?: {
|
|
41
|
-
selection?: Array<{
|
|
42
|
-
GlobalId: string;
|
|
43
|
-
}>;
|
|
44
|
-
visibility?: {
|
|
45
|
-
defaultVisibility: boolean;
|
|
46
|
-
exceptions?: Array<{
|
|
47
|
-
GlobalId: string;
|
|
48
|
-
}>;
|
|
49
|
-
};
|
|
50
|
-
coloring?: Array<{
|
|
51
|
-
color: string;
|
|
52
|
-
components: Array<{
|
|
53
|
-
GlobalId: string;
|
|
54
|
-
}>;
|
|
55
|
-
}>;
|
|
56
|
-
};
|
|
57
|
-
}
|
|
58
29
|
export interface IDSBCFOptions {
|
|
59
30
|
/** BCF project name */
|
|
60
31
|
projectName?: string;
|
|
@@ -68,8 +39,10 @@ export interface IDSBCFOptions {
|
|
|
68
39
|
max: [number, number, number];
|
|
69
40
|
}>;
|
|
70
41
|
}
|
|
71
|
-
/** bim.bcf — BIM Collaboration Format (topics, viewpoints, comments, I/O)
|
|
72
|
-
|
|
42
|
+
/** bim.bcf — BIM Collaboration Format (topics, viewpoints, comments, I/O).
|
|
43
|
+
* The GUID and color utility methods live in `bcf-guid-color.ts`'s base
|
|
44
|
+
* class (module-size split, #4294). */
|
|
45
|
+
export declare class BCFNamespace extends BCFGuidColorBase {
|
|
73
46
|
/** Create a new BCF project. */
|
|
74
47
|
createProject(options?: {
|
|
75
48
|
name?: string;
|
|
@@ -85,50 +58,54 @@ export declare class BCFNamespace {
|
|
|
85
58
|
createComment(options: CommentOptions): Promise<unknown>;
|
|
86
59
|
/** Add a comment to a topic. */
|
|
87
60
|
addComment(topic: unknown, comment: unknown): Promise<void>;
|
|
88
|
-
/**
|
|
61
|
+
/**
|
|
62
|
+
* Create a BCF viewpoint from viewer camera/section state.
|
|
63
|
+
*
|
|
64
|
+
* Converts the SDK's tuple-based `camera`/x-y-z `sectionPlane` shapes
|
|
65
|
+
* (`bim.viewer.getCamera()`/`getSection()`) into `@ifc-lite/bcf`'s
|
|
66
|
+
* object-based `ViewerCameraState`/`ViewerSectionPlane` shapes. Throws
|
|
67
|
+
* `IncompleteCameraStateError` for a camera missing position/target/up,
|
|
68
|
+
* and `MissingSectionBoundsError` for an enabled section plane with no
|
|
69
|
+
* `bounds` — see #4251.
|
|
70
|
+
*/
|
|
89
71
|
createViewpoint(options?: ViewpointOptions): Promise<unknown>;
|
|
90
72
|
/** Add a viewpoint to a topic. */
|
|
91
73
|
addViewpoint(topic: unknown, viewpoint: unknown): Promise<void>;
|
|
92
|
-
/**
|
|
93
|
-
|
|
74
|
+
/**
|
|
75
|
+
* Extract viewer state from a BCF viewpoint.
|
|
76
|
+
*
|
|
77
|
+
* Converts `@ifc-lite/bcf`'s object-based `camera`/`sectionPlane`
|
|
78
|
+
* (`down`/`front`/`side` axis) back into the SDK's tuple `camera` /
|
|
79
|
+
* `x`/`y`/`z` `sectionPlane` shapes, so the result round-trips straight
|
|
80
|
+
* into `bim.viewer.setCamera()`/`setSection()` — the same conversion
|
|
81
|
+
* `createViewpoint()` performs in reverse (#4251). Pass `bounds` (the
|
|
82
|
+
* model's AABB) to also recover `sectionPlane`; without it
|
|
83
|
+
* `@ifc-lite/bcf` cannot place a clipping plane and `sectionPlane` is
|
|
84
|
+
* omitted, matching `createViewpoint()`'s own bounds requirement.
|
|
85
|
+
*/
|
|
86
|
+
extractViewpointState(viewpoint: unknown, bounds?: AABB): Promise<ExtractedViewpointState>;
|
|
94
87
|
/** Convert viewer camera state to BCF perspective camera. */
|
|
95
88
|
cameraToPerspective(camera: unknown): Promise<unknown>;
|
|
96
|
-
/** Convert viewer camera state to BCF orthogonal camera.
|
|
97
|
-
|
|
89
|
+
/** Convert viewer camera state to BCF orthogonal camera. `viewToWorldScale`
|
|
90
|
+
* is required — it is the view extent the library returns verbatim (#4294). */
|
|
91
|
+
cameraToOrthogonal(camera: unknown, viewToWorldScale: unknown): Promise<unknown>;
|
|
98
92
|
/** Convert BCF perspective camera to viewer camera state. */
|
|
99
93
|
perspectiveToCamera(perspective: unknown): Promise<unknown>;
|
|
100
94
|
/** Convert BCF orthogonal camera to viewer camera state. */
|
|
101
95
|
orthogonalToCamera(orthogonal: unknown): Promise<unknown>;
|
|
102
|
-
/** Convert viewer section plane to BCF clipping plane.
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
96
|
+
/** Convert viewer section plane to BCF clipping plane. `bounds` is required
|
|
97
|
+
* — the library needs it to place an absolute location (#4265). Accepts the
|
|
98
|
+
* SDK's tuple `AABB` or the library's object-shaped bounds. */
|
|
99
|
+
sectionPlaneToClippingPlane(section: unknown, bounds: AABB | BcfViewerBounds): Promise<unknown>;
|
|
100
|
+
/** Convert BCF clipping plane to viewer section plane. `bounds` is required
|
|
101
|
+
* — the library needs it to compute a percentage position (#4265). Accepts
|
|
102
|
+
* the SDK's tuple `AABB` or the library's object-shaped bounds. */
|
|
103
|
+
clippingPlaneToSectionPlane(clippingPlane: unknown, bounds: AABB | BcfViewerBounds): Promise<unknown>;
|
|
106
104
|
/** Read a BCF file (ZIP archive) into a BCF project structure. */
|
|
107
105
|
read(data: Blob | ArrayBuffer): Promise<unknown>;
|
|
108
106
|
/** Write a BCF project to a downloadable Blob (ZIP archive). */
|
|
109
107
|
write(project: unknown): Promise<Blob>;
|
|
110
108
|
/** Convert an IDS validation report into BCF topics (one topic per failed spec). */
|
|
111
109
|
createFromIDSReport(report: unknown, options?: IDSBCFOptions): Promise<unknown>;
|
|
112
|
-
/** Generate a new IFC GUID (22-char base64). */
|
|
113
|
-
generateIfcGuid(): Promise<string>;
|
|
114
|
-
/** Generate a new UUID (36-char). */
|
|
115
|
-
generateUuid(): Promise<string>;
|
|
116
|
-
/** Convert UUID to IFC GUID. */
|
|
117
|
-
uuidToIfcGuid(uuid: string): Promise<string>;
|
|
118
|
-
/** Convert IFC GUID to UUID. */
|
|
119
|
-
ifcGuidToUuid(guid: string): Promise<string>;
|
|
120
|
-
/** Validate whether a string is a valid IFC GUID. */
|
|
121
|
-
isValidIfcGuid(guid: string): Promise<boolean>;
|
|
122
|
-
/** Validate whether a string is a valid UUID. */
|
|
123
|
-
isValidUuid(uuid: string): Promise<boolean>;
|
|
124
|
-
/** Parse ARGB hex color string (BCF format) to RGBA values. */
|
|
125
|
-
parseARGBColor(argb: string): Promise<{
|
|
126
|
-
r: number;
|
|
127
|
-
g: number;
|
|
128
|
-
b: number;
|
|
129
|
-
a: number;
|
|
130
|
-
}>;
|
|
131
|
-
/** Create ARGB hex color string (BCF format) from RGBA values. */
|
|
132
|
-
toARGBColor(r: number, g: number, b: number, a?: number): Promise<string>;
|
|
133
110
|
}
|
|
134
111
|
//# sourceMappingURL=bcf.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bcf.d.ts","sourceRoot":"","sources":["../../src/namespaces/bcf.ts"],"names":[],"mappings":"AAIA;;;;;;GAMG;
|
|
1
|
+
{"version":3,"file":"bcf.d.ts","sourceRoot":"","sources":["../../src/namespaces/bcf.ts"],"names":[],"mappings":"AAIA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EACL,KAAK,gBAAgB,EACrB,KAAK,uBAAuB,EAG5B,0BAA0B,EAC1B,yBAAyB,EAKzB,KAAK,eAAe,EAIrB,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAEvD,YAAY,EAAE,gBAAgB,EAAE,uBAAuB,EAAE,CAAC;AAC1D,OAAO,EAAE,0BAA0B,EAAE,yBAAyB,EAAE,CAAC;AAMjE,MAAM,WAAW,YAAY;IAC3B,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;CACnB;AAED,MAAM,WAAW,cAAc;IAC7B,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;IAChB,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,MAAM,WAAW,aAAa;IAC5B,uBAAuB;IACvB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,kCAAkC;IAClC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,kBAAkB;IAClB,OAAO,CAAC,EAAE,KAAK,GAAG,KA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AAE,MAAM,CAAC,EAAE,IAAI,GAAG,OAAO,CAAC,uBAAuB,CAAC;IA0ChG,6DAA6D;IACvD,mBAAmB,CAAC,MAAM,EAAE,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC;IAK5D;mFAC+E;IACzE,kBAAkB,CAAC,MAAM,EAAE,OAAO,EAAE,gBAAgB,EAAE,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC;IAKtF,6DAA6D;IACvD,mBAAmB,CAAC,WAAW,EAAE,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC;IAKjE,4DAA4D;IACtD,kBAAkB,CAAC,UAAU,EAAE,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC;IAS/D;;mEAE+D;IACzD,2BAA2B,CAAC,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,IAAI,GAAG,eAAe,GAAG,OAAO,CAAC,OAAO,CAAC;IAKrG;;uEAEmE;IAC7D,2BAA2B,CAAC,aAAa,EAAE,OAAO,EAAE,MAAM,EAAE,IAAI,GAAG,eAAe,GAAG,OAAO,CAAC,OAAO,CAAC;IAS3G,kEAAkE;IAC5D,IAAI,CAAC,IAAI,EAAE,IAAI,GAAG,WAAW,GAAG,OAAO,CAAC,OAAO,CAAC;IAKtD,gEAAgE;IAC1D,KAAK,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC;IAS5C,oFAAoF;IAC9E,mBAAmB,CAAC,MAAM,EAAE,OAAO,EAAE,OAAO,CAAC,EAAE,aAAa,GAAG,OAAO,CAAC,OAAO,CAAC;CAKtF"}
|
package/dist/namespaces/bcf.js
CHANGED
|
@@ -1,18 +1,17 @@
|
|
|
1
1
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
2
2
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
3
3
|
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
const name = '@ifc-lite/bcf';
|
|
9
|
-
return import(/* webpackIgnore: true */ name);
|
|
10
|
-
}
|
|
4
|
+
import { IncompleteCameraStateError, MissingSectionBoundsError, DEFAULT_VIEWPOINT_FOV, toVec3, toTuple, toLibraryBounds, collectMissingCameraFields, SDK_AXIS_TO_BCF_AXIS, BCF_AXIS_TO_SDK_AXIS, } from './bcf-viewpoint.js';
|
|
5
|
+
import { loadBCF } from './bcf-load.js';
|
|
6
|
+
import { BCFGuidColorBase } from './bcf-guid-color.js';
|
|
7
|
+
export { IncompleteCameraStateError, MissingSectionBoundsError };
|
|
11
8
|
// ============================================================================
|
|
12
9
|
// BCFNamespace
|
|
13
10
|
// ============================================================================
|
|
14
|
-
/** bim.bcf — BIM Collaboration Format (topics, viewpoints, comments, I/O)
|
|
15
|
-
|
|
11
|
+
/** bim.bcf — BIM Collaboration Format (topics, viewpoints, comments, I/O).
|
|
12
|
+
* The GUID and color utility methods live in `bcf-guid-color.ts`'s base
|
|
13
|
+
* class (module-size split, #4294). */
|
|
14
|
+
export class BCFNamespace extends BCFGuidColorBase {
|
|
16
15
|
// --------------------------------------------------------------------------
|
|
17
16
|
// Project management
|
|
18
17
|
// --------------------------------------------------------------------------
|
|
@@ -65,29 +64,64 @@ export class BCFNamespace {
|
|
|
65
64
|
// --------------------------------------------------------------------------
|
|
66
65
|
// Viewpoints
|
|
67
66
|
// --------------------------------------------------------------------------
|
|
68
|
-
/**
|
|
67
|
+
/**
|
|
68
|
+
* Create a BCF viewpoint from viewer camera/section state.
|
|
69
|
+
*
|
|
70
|
+
* Converts the SDK's tuple-based `camera`/x-y-z `sectionPlane` shapes
|
|
71
|
+
* (`bim.viewer.getCamera()`/`getSection()`) into `@ifc-lite/bcf`'s
|
|
72
|
+
* object-based `ViewerCameraState`/`ViewerSectionPlane` shapes. Throws
|
|
73
|
+
* `IncompleteCameraStateError` for a camera missing position/target/up,
|
|
74
|
+
* and `MissingSectionBoundsError` for an enabled section plane with no
|
|
75
|
+
* `bounds` — see #4251.
|
|
76
|
+
*/
|
|
69
77
|
async createViewpoint(options) {
|
|
70
78
|
const mod = await loadBCF();
|
|
71
|
-
|
|
72
|
-
|
|
79
|
+
const missingCamera = collectMissingCameraFields(options?.camera);
|
|
80
|
+
if (missingCamera.length > 0) {
|
|
81
|
+
throw new IncompleteCameraStateError(missingCamera);
|
|
82
|
+
}
|
|
83
|
+
const camera = options.camera;
|
|
73
84
|
// Map SDK's GlobalId (IFC convention) to BCF library's guid-based lists
|
|
74
|
-
const comps = options
|
|
75
|
-
const bcfOptions = {
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
85
|
+
const comps = options?.components;
|
|
86
|
+
const bcfOptions = {
|
|
87
|
+
camera: {
|
|
88
|
+
position: toVec3(camera.position),
|
|
89
|
+
target: toVec3(camera.target),
|
|
90
|
+
up: toVec3(camera.up),
|
|
91
|
+
fov: DEFAULT_VIEWPOINT_FOV,
|
|
92
|
+
isOrthographic: camera.mode === 'orthographic',
|
|
93
|
+
},
|
|
94
|
+
};
|
|
95
|
+
if (options?.sectionPlane) {
|
|
96
|
+
const sp = options.sectionPlane;
|
|
97
|
+
if (sp.enabled && !options.bounds) {
|
|
98
|
+
throw new MissingSectionBoundsError();
|
|
99
|
+
}
|
|
100
|
+
bcfOptions.sectionPlane = {
|
|
101
|
+
axis: SDK_AXIS_TO_BCF_AXIS[sp.axis],
|
|
102
|
+
position: sp.position,
|
|
103
|
+
enabled: sp.enabled,
|
|
104
|
+
flipped: sp.flipped,
|
|
105
|
+
};
|
|
106
|
+
}
|
|
107
|
+
if (options?.bounds) {
|
|
108
|
+
bcfOptions.bounds = {
|
|
109
|
+
min: toVec3(options.bounds.min),
|
|
110
|
+
max: toVec3(options.bounds.max),
|
|
111
|
+
};
|
|
112
|
+
}
|
|
80
113
|
if (comps?.selection) {
|
|
81
114
|
bcfOptions.selectedGuids = comps.selection.map(c => c.GlobalId);
|
|
82
115
|
}
|
|
83
116
|
if (comps?.visibility) {
|
|
84
|
-
|
|
85
|
-
|
|
117
|
+
// Both halves are spelled out on `ViewpointOptions.components
|
|
118
|
+
// .visibility`: `DefaultVisibility` is optional and TRUE by default, and
|
|
119
|
+
// `?? []` (not `?.map`) preserves an isolation that matches nothing.
|
|
120
|
+
if (comps.visibility.defaultVisibility ?? true) {
|
|
86
121
|
bcfOptions.hiddenGuids = comps.visibility.exceptions?.map(c => c.GlobalId);
|
|
87
122
|
}
|
|
88
123
|
else {
|
|
89
|
-
|
|
90
|
-
bcfOptions.visibleGuids = comps.visibility.exceptions?.map(c => c.GlobalId);
|
|
124
|
+
bcfOptions.visibleGuids = comps.visibility.exceptions?.map(c => c.GlobalId) ?? [];
|
|
91
125
|
}
|
|
92
126
|
}
|
|
93
127
|
if (comps?.coloring) {
|
|
@@ -103,10 +137,46 @@ export class BCFNamespace {
|
|
|
103
137
|
const mod = await loadBCF();
|
|
104
138
|
mod.addViewpointToTopic(topic, viewpoint);
|
|
105
139
|
}
|
|
106
|
-
/**
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
140
|
+
/**
|
|
141
|
+
* Extract viewer state from a BCF viewpoint.
|
|
142
|
+
*
|
|
143
|
+
* Converts `@ifc-lite/bcf`'s object-based `camera`/`sectionPlane`
|
|
144
|
+
* (`down`/`front`/`side` axis) back into the SDK's tuple `camera` /
|
|
145
|
+
* `x`/`y`/`z` `sectionPlane` shapes, so the result round-trips straight
|
|
146
|
+
* into `bim.viewer.setCamera()`/`setSection()` — the same conversion
|
|
147
|
+
* `createViewpoint()` performs in reverse (#4251). Pass `bounds` (the
|
|
148
|
+
* model's AABB) to also recover `sectionPlane`; without it
|
|
149
|
+
* `@ifc-lite/bcf` cannot place a clipping plane and `sectionPlane` is
|
|
150
|
+
* omitted, matching `createViewpoint()`'s own bounds requirement.
|
|
151
|
+
*/
|
|
152
|
+
async extractViewpointState(viewpoint, bounds) {
|
|
153
|
+
const mod = await loadBCF();
|
|
154
|
+
const bcfBounds = bounds
|
|
155
|
+
? { min: toVec3(bounds.min), max: toVec3(bounds.max) }
|
|
156
|
+
: undefined;
|
|
157
|
+
const raw = mod.extractViewpointState(viewpoint, bcfBounds);
|
|
158
|
+
return {
|
|
159
|
+
camera: raw.camera
|
|
160
|
+
? {
|
|
161
|
+
mode: raw.camera.isOrthographic ? 'orthographic' : 'perspective',
|
|
162
|
+
position: toTuple(raw.camera.position),
|
|
163
|
+
target: toTuple(raw.camera.target),
|
|
164
|
+
up: toTuple(raw.camera.up),
|
|
165
|
+
}
|
|
166
|
+
: undefined,
|
|
167
|
+
sectionPlane: raw.sectionPlane
|
|
168
|
+
? {
|
|
169
|
+
axis: BCF_AXIS_TO_SDK_AXIS[raw.sectionPlane.axis],
|
|
170
|
+
position: raw.sectionPlane.position,
|
|
171
|
+
enabled: raw.sectionPlane.enabled,
|
|
172
|
+
flipped: raw.sectionPlane.flipped,
|
|
173
|
+
}
|
|
174
|
+
: undefined,
|
|
175
|
+
selectedGuids: raw.selectedGuids,
|
|
176
|
+
hiddenGuids: raw.hiddenGuids,
|
|
177
|
+
visibleGuids: raw.visibleGuids,
|
|
178
|
+
coloredGuids: raw.coloredGuids,
|
|
179
|
+
};
|
|
110
180
|
}
|
|
111
181
|
// --------------------------------------------------------------------------
|
|
112
182
|
// Camera conversion helpers
|
|
@@ -116,10 +186,11 @@ export class BCFNamespace {
|
|
|
116
186
|
const mod = await loadBCF();
|
|
117
187
|
return mod.cameraToPerspective(camera);
|
|
118
188
|
}
|
|
119
|
-
/** Convert viewer camera state to BCF orthogonal camera.
|
|
120
|
-
|
|
189
|
+
/** Convert viewer camera state to BCF orthogonal camera. `viewToWorldScale`
|
|
190
|
+
* is required — it is the view extent the library returns verbatim (#4294). */
|
|
191
|
+
async cameraToOrthogonal(camera, viewToWorldScale) {
|
|
121
192
|
const mod = await loadBCF();
|
|
122
|
-
return mod.cameraToOrthogonal(camera);
|
|
193
|
+
return mod.cameraToOrthogonal(camera, viewToWorldScale);
|
|
123
194
|
}
|
|
124
195
|
/** Convert BCF perspective camera to viewer camera state. */
|
|
125
196
|
async perspectiveToCamera(perspective) {
|
|
@@ -134,15 +205,19 @@ export class BCFNamespace {
|
|
|
134
205
|
// --------------------------------------------------------------------------
|
|
135
206
|
// Section plane conversion
|
|
136
207
|
// --------------------------------------------------------------------------
|
|
137
|
-
/** Convert viewer section plane to BCF clipping plane.
|
|
138
|
-
|
|
208
|
+
/** Convert viewer section plane to BCF clipping plane. `bounds` is required
|
|
209
|
+
* — the library needs it to place an absolute location (#4265). Accepts the
|
|
210
|
+
* SDK's tuple `AABB` or the library's object-shaped bounds. */
|
|
211
|
+
async sectionPlaneToClippingPlane(section, bounds) {
|
|
139
212
|
const mod = await loadBCF();
|
|
140
|
-
return mod.sectionPlaneToClippingPlane(section);
|
|
213
|
+
return mod.sectionPlaneToClippingPlane(section, toLibraryBounds(bounds));
|
|
141
214
|
}
|
|
142
|
-
/** Convert BCF clipping plane to viewer section plane.
|
|
143
|
-
|
|
215
|
+
/** Convert BCF clipping plane to viewer section plane. `bounds` is required
|
|
216
|
+
* — the library needs it to compute a percentage position (#4265). Accepts
|
|
217
|
+
* the SDK's tuple `AABB` or the library's object-shaped bounds. */
|
|
218
|
+
async clippingPlaneToSectionPlane(clippingPlane, bounds) {
|
|
144
219
|
const mod = await loadBCF();
|
|
145
|
-
return mod.clippingPlaneToSectionPlane(clippingPlane);
|
|
220
|
+
return mod.clippingPlaneToSectionPlane(clippingPlane, toLibraryBounds(bounds));
|
|
146
221
|
}
|
|
147
222
|
// --------------------------------------------------------------------------
|
|
148
223
|
// I/O — Read / Write BCF files
|
|
@@ -165,51 +240,5 @@ export class BCFNamespace {
|
|
|
165
240
|
const mod = await loadBCF();
|
|
166
241
|
return mod.createBCFFromIDSReport(report, options);
|
|
167
242
|
}
|
|
168
|
-
// --------------------------------------------------------------------------
|
|
169
|
-
// GUID utilities
|
|
170
|
-
// --------------------------------------------------------------------------
|
|
171
|
-
/** Generate a new IFC GUID (22-char base64). */
|
|
172
|
-
async generateIfcGuid() {
|
|
173
|
-
const mod = await loadBCF();
|
|
174
|
-
return mod.generateIfcGuid();
|
|
175
|
-
}
|
|
176
|
-
/** Generate a new UUID (36-char). */
|
|
177
|
-
async generateUuid() {
|
|
178
|
-
const mod = await loadBCF();
|
|
179
|
-
return mod.generateUuid();
|
|
180
|
-
}
|
|
181
|
-
/** Convert UUID to IFC GUID. */
|
|
182
|
-
async uuidToIfcGuid(uuid) {
|
|
183
|
-
const mod = await loadBCF();
|
|
184
|
-
return mod.uuidToIfcGuid(uuid);
|
|
185
|
-
}
|
|
186
|
-
/** Convert IFC GUID to UUID. */
|
|
187
|
-
async ifcGuidToUuid(guid) {
|
|
188
|
-
const mod = await loadBCF();
|
|
189
|
-
return mod.ifcGuidToUuid(guid);
|
|
190
|
-
}
|
|
191
|
-
/** Validate whether a string is a valid IFC GUID. */
|
|
192
|
-
async isValidIfcGuid(guid) {
|
|
193
|
-
const mod = await loadBCF();
|
|
194
|
-
return mod.isValidIfcGuid(guid);
|
|
195
|
-
}
|
|
196
|
-
/** Validate whether a string is a valid UUID. */
|
|
197
|
-
async isValidUuid(uuid) {
|
|
198
|
-
const mod = await loadBCF();
|
|
199
|
-
return mod.isValidUuid(uuid);
|
|
200
|
-
}
|
|
201
|
-
// --------------------------------------------------------------------------
|
|
202
|
-
// Color utilities
|
|
203
|
-
// --------------------------------------------------------------------------
|
|
204
|
-
/** Parse ARGB hex color string (BCF format) to RGBA values. */
|
|
205
|
-
async parseARGBColor(argb) {
|
|
206
|
-
const mod = await loadBCF();
|
|
207
|
-
return mod.parseARGBColor(argb);
|
|
208
|
-
}
|
|
209
|
-
/** Create ARGB hex color string (BCF format) from RGBA values. */
|
|
210
|
-
async toARGBColor(r, g, b, a) {
|
|
211
|
-
const mod = await loadBCF();
|
|
212
|
-
return mod.toARGBColor(r, g, b, a);
|
|
213
|
-
}
|
|
214
243
|
}
|
|
215
244
|
//# sourceMappingURL=bcf.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bcf.js","sourceRoot":"","sources":["../../src/namespaces/bcf.ts"],"names":[],"mappings":"AAAA;;+DAE+D;
|
|
1
|
+
{"version":3,"file":"bcf.js","sourceRoot":"","sources":["../../src/namespaces/bcf.ts"],"names":[],"mappings":"AAAA;;+DAE+D;AAW/D,OAAO,EAKL,0BAA0B,EAC1B,yBAAyB,EACzB,qBAAqB,EACrB,MAAM,EACN,OAAO,EACP,eAAe,EAEf,0BAA0B,EAC1B,oBAAoB,EACpB,oBAAoB,GACrB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,OAAO,EAAc,MAAM,eAAe,CAAC;AACpD,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAGvD,OAAO,EAAE,0BAA0B,EAAE,yBAAyB,EAAE,CAAC;AAmCjE,+EAA+E;AAC/E,eAAe;AACf,+EAA+E;AAE/E;;uCAEuC;AACvC,MAAM,OAAO,YAAa,SAAQ,gBAAgB;IAEhD,6EAA6E;IAC7E,qBAAqB;IACrB,6EAA6E;IAE7E,gCAAgC;IAChC,KAAK,CAAC,aAAa,CAAC,OAAoD;QACtE,MAAM,GAAG,GAAG,MAAM,OAAO,EAAE,CAAC;QAC5B,OAAQ,GAAG,CAAC,gBAA0B,CAAC,OAAO,CAAC,CAAC;IAClD,CAAC;IAED,6EAA6E;IAC7E,mBAAmB;IACnB,6EAA6E;IAE7E,0BAA0B;IAC1B,KAAK,CAAC,WAAW,CAAC,OAAqB;QACrC,MAAM,GAAG,GAAG,MAAM,OAAO,EAAE,CAAC;QAC5B,OAAQ,GAAG,CAAC,cAAwB,CAAC;YACnC,KAAK,EAAE,OAAO,CAAC,KAAK;YACpB,WAAW,EAAE,OAAO,CAAC,WAAW;YAChC,MAAM,EAAE,OAAO,CAAC,MAAM;YACtB,SAAS,EAAE,OAAO,CAAC,SAAS;YAC5B,WAAW,EAAE,OAAO,CAAC,MAAM;YAC3B,QAAQ,EAAE,OAAO,CAAC,QAAQ;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A6E;IAE7E,kEAAkE;IAClE,KAAK,CAAC,IAAI,CAAC,IAAwB;QACjC,MAAM,GAAG,GAAG,MAAM,OAAO,EAAE,CAAC;QAC5B,OAAQ,GAAG,CAAC,OAAiB,CAAC,IAAI,CAAC,CAAC;IACtC,CAAC;IAED,gEAAgE;IAChE,KAAK,CAAC,KAAK,CAAC,OAAgB;QAC1B,MAAM,GAAG,GAAG,MAAM,OAAO,EAAE,CAAC;QAC5B,OAAQ,GAAG,CAAC,QAAkB,CAAC,OAAO,CAAkB,CAAC;IAC3D,CAAC;IAED,6EAA6E;IAC7E,uBAAuB;IACvB,6EAA6E;IAE7E,oFAAoF;IACpF,KAAK,CAAC,mBAAmB,CAAC,MAAe,EAAE,OAAuB;QAChE,MAAM,GAAG,GAAG,MAAM,OAAO,EAAE,CAAC;QAC5B,OAAQ,GAAG,CAAC,sBAAgC,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAChE,CAAC;CAEF"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* bim.structural — read-only access to IFC structural analysis data.
|
|
3
|
+
*
|
|
4
|
+
* Mirrors the data the parser's `extractStructuralOnDemand` produces:
|
|
5
|
+
* • `data()` — the full extraction (analysis models, members,
|
|
6
|
+
* connections, activities, load groups, result
|
|
7
|
+
* groups) plus `loadsTruncated`
|
|
8
|
+
* • `analysisModels()` — IfcStructuralAnalysisModel containers
|
|
9
|
+
* • `members()` — IfcStructuralMember subtype occurrences
|
|
10
|
+
* • `connections()` — IfcStructuralConnection subtype occurrences
|
|
11
|
+
* • `activities()` — IfcStructuralActivity subtype occurrences (actions + reactions)
|
|
12
|
+
* • `loadGroups()` — IfcStructuralLoadGroup / IfcStructuralLoadCase
|
|
13
|
+
* • `resultGroups()` — IfcStructuralResultGroup
|
|
14
|
+
*
|
|
15
|
+
* `data().loadsTruncated` must be read by any caller that reports a load
|
|
16
|
+
* count or tree as complete: it is true when reading an activity's applied
|
|
17
|
+
* load hit a reader bound (nesting depth, node budget, or a cycle guard)
|
|
18
|
+
* rather than running out of data the file actually holds. This namespace
|
|
19
|
+
* does not compute that flag — it forwards exactly what the backend
|
|
20
|
+
* extraction reports, so the bound is visible at this layer too, not
|
|
21
|
+
* silently dropped between the extractor and the caller.
|
|
22
|
+
*
|
|
23
|
+
* The `modelId` argument is optional. When omitted, the active model is used.
|
|
24
|
+
*/
|
|
25
|
+
import type { BimBackend, StructuralExtractionData, StructuralAnalysisModelData, StructuralMemberData, StructuralConnectionData, StructuralActivityData, StructuralLoadGroupData, StructuralResultGroupData } from '../types.js';
|
|
26
|
+
export declare class StructuralNamespace {
|
|
27
|
+
private backend;
|
|
28
|
+
constructor(backend: BimBackend);
|
|
29
|
+
private methods;
|
|
30
|
+
/** Full structural extraction for the active (or specified) model. */
|
|
31
|
+
data(modelId?: string): StructuralExtractionData;
|
|
32
|
+
/** All IfcStructuralAnalysisModel containers. */
|
|
33
|
+
analysisModels(modelId?: string): StructuralAnalysisModelData[];
|
|
34
|
+
/** All IfcStructuralMember subtype occurrences. */
|
|
35
|
+
members(modelId?: string): StructuralMemberData[];
|
|
36
|
+
/** All IfcStructuralConnection subtype occurrences. */
|
|
37
|
+
connections(modelId?: string): StructuralConnectionData[];
|
|
38
|
+
/** All IfcStructuralActivity subtype occurrences (actions and reactions). */
|
|
39
|
+
activities(modelId?: string): StructuralActivityData[];
|
|
40
|
+
/** All IfcStructuralLoadGroup / IfcStructuralLoadCase entities. */
|
|
41
|
+
loadGroups(modelId?: string): StructuralLoadGroupData[];
|
|
42
|
+
/** All IfcStructuralResultGroup entities. */
|
|
43
|
+
resultGroups(modelId?: string): StructuralResultGroupData[];
|
|
44
|
+
}
|
|
45
|
+
//# sourceMappingURL=structural.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"structural.d.ts","sourceRoot":"","sources":["../../src/namespaces/structural.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH,OAAO,KAAK,EACV,UAAU,EACV,wBAAwB,EACxB,2BAA2B,EAC3B,oBAAoB,EACpB,wBAAwB,EACxB,sBAAsB,EACtB,uBAAuB,EACvB,yBAAyB,EAC1B,MAAM,aAAa,CAAC;AAErB,qBAAa,mBAAmB;IAClB,OAAO,CAAC,OAAO;gBAAP,OAAO,EAAE,UAAU;IAEvC,OAAO,CAAC,OAAO;IAMf,sEAAsE;IACtE,IAAI,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,wBAAwB;IAIhD,iDAAiD;IACjD,cAAc,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,2BAA2B,EAAE;IAI/D,mDAAmD;IACnD,OAAO,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,oBAAoB,EAAE;IAIjD,uDAAuD;IACvD,WAAW,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,wBAAwB,EAAE;IAIzD,6EAA6E;IAC7E,UAAU,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,sBAAsB,EAAE;IAItD,mEAAmE;IACnE,UAAU,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,uBAAuB,EAAE;IAIvD,6CAA6C;IAC7C,YAAY,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,yBAAyB,EAAE;CAG5D"}
|
|
@@ -0,0 +1,44 @@
|
|
|
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 class StructuralNamespace {
|
|
5
|
+
backend;
|
|
6
|
+
constructor(backend) {
|
|
7
|
+
this.backend = backend;
|
|
8
|
+
}
|
|
9
|
+
methods() {
|
|
10
|
+
const methods = this.backend.structural;
|
|
11
|
+
if (!methods)
|
|
12
|
+
throw new Error('bim.structural is not supported by this backend');
|
|
13
|
+
return methods;
|
|
14
|
+
}
|
|
15
|
+
/** Full structural extraction for the active (or specified) model. */
|
|
16
|
+
data(modelId) {
|
|
17
|
+
return this.methods().data(modelId);
|
|
18
|
+
}
|
|
19
|
+
/** All IfcStructuralAnalysisModel containers. */
|
|
20
|
+
analysisModels(modelId) {
|
|
21
|
+
return this.methods().analysisModels(modelId);
|
|
22
|
+
}
|
|
23
|
+
/** All IfcStructuralMember subtype occurrences. */
|
|
24
|
+
members(modelId) {
|
|
25
|
+
return this.methods().members(modelId);
|
|
26
|
+
}
|
|
27
|
+
/** All IfcStructuralConnection subtype occurrences. */
|
|
28
|
+
connections(modelId) {
|
|
29
|
+
return this.methods().connections(modelId);
|
|
30
|
+
}
|
|
31
|
+
/** All IfcStructuralActivity subtype occurrences (actions and reactions). */
|
|
32
|
+
activities(modelId) {
|
|
33
|
+
return this.methods().activities(modelId);
|
|
34
|
+
}
|
|
35
|
+
/** All IfcStructuralLoadGroup / IfcStructuralLoadCase entities. */
|
|
36
|
+
loadGroups(modelId) {
|
|
37
|
+
return this.methods().loadGroups(modelId);
|
|
38
|
+
}
|
|
39
|
+
/** All IfcStructuralResultGroup entities. */
|
|
40
|
+
resultGroups(modelId) {
|
|
41
|
+
return this.methods().resultGroups(modelId);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
//# sourceMappingURL=structural.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"structural.js","sourceRoot":"","sources":["../../src/namespaces/structural.ts"],"names":[],"mappings":"AAAA;;+DAE+D;AAsC/D,MAAM,OAAO,mBAAmB;IACV;IAApB,YAAoB,OAAmB;QAAnB,YAAO,GAAP,OAAO,CAAY;IAAG,CAAC;IAEnC,OAAO;QACb,MAAM,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC;QACxC,IAAI,CAAC,OAAO;YAAE,MAAM,IAAI,KAAK,CAAC,iDAAiD,CAAC,CAAC;QACjF,OAAO,OAAO,CAAC;IACjB,CAAC;IAED,sEAAsE;IACtE,IAAI,CAAC,OAAgB;QACnB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