@inweb/viewer-three 26.8.1 → 26.8.3

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.
Files changed (49) hide show
  1. package/dist/plugins/components/RoomEnvironmentComponent.js +75 -40
  2. package/dist/plugins/components/RoomEnvironmentComponent.js.map +1 -1
  3. package/dist/plugins/components/RoomEnvironmentComponent.min.js +1 -1
  4. package/dist/plugins/components/StatsPanelComponent.js +1 -1
  5. package/dist/plugins/components/StatsPanelComponent.js.map +1 -1
  6. package/dist/plugins/components/StatsPanelComponent.min.js +1 -1
  7. package/dist/plugins/components/StatsPanelComponent.module.js +1 -1
  8. package/dist/plugins/components/StatsPanelComponent.module.js.map +1 -1
  9. package/dist/plugins/loaders/GLTFCloudLoader.js +225 -94
  10. package/dist/plugins/loaders/GLTFCloudLoader.js.map +1 -1
  11. package/dist/plugins/loaders/GLTFCloudLoader.min.js +1 -1
  12. package/dist/plugins/loaders/IFCXLoader.js +169 -19
  13. package/dist/plugins/loaders/IFCXLoader.js.map +1 -1
  14. package/dist/plugins/loaders/IFCXLoader.min.js +1 -1
  15. package/dist/viewer-three.js +31141 -5500
  16. package/dist/viewer-three.js.map +1 -1
  17. package/dist/viewer-three.min.js +3 -3
  18. package/dist/viewer-three.module.js +402 -295
  19. package/dist/viewer-three.module.js.map +1 -1
  20. package/lib/Viewer/Viewer.d.ts +17 -3
  21. package/lib/Viewer/commands/SetDefaultViewPosition.d.ts +6 -6
  22. package/lib/Viewer/components/HighlighterComponent.d.ts +5 -4
  23. package/lib/Viewer/components/SelectionComponent.d.ts +1 -1
  24. package/lib/Viewer/loaders/DynamicGltfLoader/DynamicModelImpl.d.ts +3 -1
  25. package/lib/Viewer/models/IModelImpl.d.ts +27 -0
  26. package/lib/Viewer/models/ModelImpl.d.ts +27 -0
  27. package/lib/Viewer/scenes/Helpers.d.ts +7 -0
  28. package/lib/index.d.ts +2 -1
  29. package/package.json +9 -9
  30. package/plugins/components/StatsPanelComponent.ts +1 -1
  31. package/src/Viewer/Viewer.ts +124 -48
  32. package/src/Viewer/commands/SetDefaultViewPosition.ts +8 -8
  33. package/src/Viewer/components/CameraComponent.ts +20 -16
  34. package/src/Viewer/components/ExtentsComponent.ts +1 -0
  35. package/src/Viewer/components/HighlighterComponent.ts +78 -80
  36. package/src/Viewer/components/LightComponent.ts +1 -1
  37. package/src/Viewer/components/ResizeCanvasComponent.ts +1 -0
  38. package/src/Viewer/components/SelectionComponent.ts +1 -1
  39. package/src/Viewer/helpers/WCSHelper.ts +8 -5
  40. package/src/Viewer/loaders/DynamicGltfLoader/DynamicGltfLoader.js +33 -16
  41. package/src/Viewer/loaders/DynamicGltfLoader/DynamicModelImpl.ts +12 -5
  42. package/src/Viewer/loaders/DynamicGltfLoader/GltfStructure.js +100 -20
  43. package/src/Viewer/loaders/GLTFCloudDynamicLoader.ts +4 -2
  44. package/src/Viewer/loaders/GLTFFileLoader.ts +1 -1
  45. package/src/Viewer/models/IModelImpl.ts +67 -0
  46. package/src/Viewer/models/ModelImpl.ts +214 -0
  47. package/src/Viewer/postprocessing/SSAARenderPass.js +245 -0
  48. package/src/Viewer/scenes/Helpers.ts +42 -0
  49. package/src/index.ts +2 -1
@@ -0,0 +1,67 @@
1
+ ///////////////////////////////////////////////////////////////////////////////
2
+ // Copyright (C) 2002-2025, Open Design Alliance (the "Alliance").
3
+ // All rights reserved.
4
+ //
5
+ // This software and its documentation and related materials are owned by
6
+ // the Alliance. The software may only be incorporated into application
7
+ // programs owned by members of the Alliance, subject to a signed
8
+ // Membership Agreement and Supplemental Software License Agreement with the
9
+ // Alliance. The structure and organization of this software are the valuable
10
+ // trade secrets of the Alliance and its suppliers. The software is also
11
+ // protected by copyright law and international treaty provisions. Application
12
+ // programs incorporating this software must include the following statement
13
+ // with their copyright notices:
14
+ //
15
+ // This application incorporates Open Design Alliance software pursuant to a
16
+ // license agreement with Open Design Alliance.
17
+ // Open Design Alliance Copyright (C) 2002-2025 by Open Design Alliance.
18
+ // All rights reserved.
19
+ //
20
+ // By use of this software, its documentation or related materials, you
21
+ // acknowledge and accept the above terms.
22
+ ///////////////////////////////////////////////////////////////////////////////
23
+
24
+ import { Box3, Object3D } from "three";
25
+ import { ILoader, IViewer } from "@inweb/viewer-core";
26
+
27
+ /**
28
+ * Model interface.
29
+ */
30
+ export interface IModelImpl {
31
+ handle: string;
32
+ scene: Object3D;
33
+ loader: ILoader;
34
+ viewer: IViewer;
35
+
36
+ dispose(): void;
37
+
38
+ getExtents(target: Box3): Box3;
39
+
40
+ getObjects(): Object3D[];
41
+
42
+ getVisibleObjects(): Object3D[];
43
+
44
+ hasObject(objects: Object3D): boolean;
45
+
46
+ getOwnObjects(objects: Object3D | Object3D[]): Object3D[];
47
+
48
+ getObjectsByHandles(handles: string | string[]): Object3D[];
49
+
50
+ getHandlesByObjects(objects: Object3D | Object3D[]): string[];
51
+
52
+ hideObjects(objects: Object3D | Object3D[]): this;
53
+
54
+ hideAllObjects(): this;
55
+
56
+ isolateObjects(objects: Object3D | Object3D[]): this;
57
+
58
+ showObjects(objects: Object3D | Object3D[]): this;
59
+
60
+ showAllObjects(): this;
61
+
62
+ showOriginalObjects(objects: Object3D | Object3D[]): this;
63
+
64
+ hideOriginalObjects(objects: Object3D | Object3D[]): this;
65
+
66
+ explode(scale: number, coeff?: number): this;
67
+ }
@@ -0,0 +1,214 @@
1
+ ///////////////////////////////////////////////////////////////////////////////
2
+ // Copyright (C) 2002-2025, Open Design Alliance (the "Alliance").
3
+ // All rights reserved.
4
+ //
5
+ // This software and its documentation and related materials are owned by
6
+ // the Alliance. The software may only be incorporated into application
7
+ // programs owned by members of the Alliance, subject to a signed
8
+ // Membership Agreement and Supplemental Software License Agreement with the
9
+ // Alliance. The structure and organization of this software are the valuable
10
+ // trade secrets of the Alliance and its suppliers. The software is also
11
+ // protected by copyright law and international treaty provisions. Application
12
+ // programs incorporating this software must include the following statement
13
+ // with their copyright notices:
14
+ //
15
+ // This application incorporates Open Design Alliance software pursuant to a
16
+ // license agreement with Open Design Alliance.
17
+ // Open Design Alliance Copyright (C) 2002-2025 by Open Design Alliance.
18
+ // All rights reserved.
19
+ //
20
+ // By use of this software, its documentation or related materials, you
21
+ // acknowledge and accept the above terms.
22
+ ///////////////////////////////////////////////////////////////////////////////
23
+
24
+ import { Box3, Object3D, Vector3 } from "three";
25
+ import { ILoader } from "@inweb/viewer-core";
26
+
27
+ import { IModelImpl } from "./IModelImpl";
28
+ import { Viewer } from "../Viewer";
29
+
30
+ // Basic model implementation.
31
+
32
+ export class ModelImpl implements IModelImpl {
33
+ public handle: string;
34
+ public scene: Object3D;
35
+ public loader: ILoader;
36
+ public viewer: Viewer;
37
+
38
+ constructor(scene: Object3D) {
39
+ this.handle = "1";
40
+ this.scene = scene;
41
+ }
42
+
43
+ dispose() {
44
+ function disposeMaterial(material: any) {
45
+ // if (material.alphaMap) material.alphaMap.dispose();
46
+ // if (material.anisotropyMap) material.anisotropyMap.dispose();
47
+ // if (material.aoMap) material.aoMap.dispose();
48
+ // if (material.bumpMap) material.bumpMap.dispose();
49
+ // if (material.clearcoatMap) material.clearcoatMap.dispose();
50
+ // if (material.clearcoatNormalMap) material.clearcoatNormalMap.dispose();
51
+ // if (material.clearcoatRoughnessMap) material.clearcoatRoughnessMap.dispose();
52
+ // if (material.displacementMap) material.displacementMap.dispose();
53
+ // if (material.emissiveMap) material.emissiveMap.dispose();
54
+ // if (material.gradientMap) material.gradientMap.dispose();
55
+ // if (material.envMap) material.envMap.dispose();
56
+ // if (material.iridescenceMap) material.iridescenceMap.dispose();
57
+ // if (material.lightMap) material.lightMap.dispose();
58
+ // if (material.map) material.map.dispose();
59
+ // if (material.metalnessMap) material.metalnessMap.dispose();
60
+ // if (material.normalMap) material.normalMap.dispose();
61
+ // if (material.roughnessMap) material.roughnessMap.dispose();
62
+ // if (material.sheenColorMap) material.sheenColorMap.dispose();
63
+ // if (material.sheenRoughnessMap) material.sheenRoughnessMap.dispose();
64
+ // if (material.specularMap) material.specularMap.dispose();
65
+ // if (material.thicknessMap) material.thicknessMap.dispose();
66
+ // if (material.transmissionMap) material.transmissionMap.dispose();
67
+ material.dispose();
68
+ }
69
+
70
+ function disposeMaterials(material: any) {
71
+ const materials = Array.isArray(material) ? material : [material];
72
+ materials.forEach((material: any) => disposeMaterial(material));
73
+ }
74
+
75
+ function disposeObject(object: any) {
76
+ if (object.geometry) object.geometry.dispose();
77
+ if (object.material) disposeMaterials(object.material);
78
+ }
79
+
80
+ this.scene.traverse(disposeObject);
81
+ this.scene.clear();
82
+ }
83
+
84
+ getExtents(target: Box3): Box3 {
85
+ this.scene.traverseVisible((object) => !object.children.length && target.expandByObject(object));
86
+ return target;
87
+ }
88
+
89
+ getObjects(): Object3D[] {
90
+ const objects = [];
91
+ this.scene.traverse((object) => objects.push(object));
92
+ return objects;
93
+ }
94
+
95
+ getVisibleObjects(): Object3D[] {
96
+ const objects = [];
97
+ this.scene.traverseVisible((object) => objects.push(object));
98
+ return objects;
99
+ }
100
+
101
+ hasObject(object: Object3D): boolean {
102
+ while (object) {
103
+ if (object === this.scene) return true;
104
+ object = object.parent;
105
+ }
106
+ return false;
107
+ }
108
+
109
+ getOwnObjects(objects: Object3D | Object3D[]): Object3D[] {
110
+ if (!Array.isArray(objects)) objects = [objects];
111
+ return objects.filter((object) => this.hasObject(object));
112
+ }
113
+
114
+ getObjectsByHandles(handles: string | string[]): Object3D[] {
115
+ const handleSet = new Set(handles);
116
+ const objects = [];
117
+ this.scene.traverse((object) => handleSet.has(object.userData.handle) && objects.push(object));
118
+ return objects;
119
+ }
120
+
121
+ getHandlesByObjects(objects: Object3D | Object3D[]): string[] {
122
+ if (!Array.isArray(objects)) objects = [objects];
123
+ const handlesSet = new Set<string>();
124
+ this.getOwnObjects(objects).forEach((object) => handlesSet.add(object.userData.handle));
125
+ return Array.from(handlesSet);
126
+ }
127
+
128
+ hideObjects(objects: Object3D | Object3D[]): this {
129
+ if (!Array.isArray(objects)) objects = [objects];
130
+ this.getOwnObjects(objects).forEach((object) => (object.visible = false));
131
+ return this;
132
+ }
133
+
134
+ hideAllObjects(): this {
135
+ return this.isolateObjects([]);
136
+ }
137
+
138
+ isolateObjects(objects: Object3D | Object3D[]): this {
139
+ if (!Array.isArray(objects)) objects = [objects];
140
+ const visibleSet = new Set(objects);
141
+ this.getOwnObjects(objects).forEach((object) => object.traverseAncestors((parent) => visibleSet.add(parent)));
142
+ this.scene.traverse((object) => (object.visible = visibleSet.has(object)));
143
+ return this;
144
+ }
145
+
146
+ showObjects(objects: Object3D | Object3D[]): this {
147
+ if (!Array.isArray(objects)) objects = [objects];
148
+ this.getOwnObjects(objects).forEach((object) => {
149
+ object.visible = true;
150
+ object.traverseAncestors((parent) => (parent.visible = true));
151
+ });
152
+ return this;
153
+ }
154
+
155
+ showAllObjects(): this {
156
+ this.scene.traverse((object) => (object.visible = true));
157
+ return this;
158
+ }
159
+
160
+ showOriginalObjects(objects: Object3D | Object3D[]): this {
161
+ return this;
162
+ }
163
+
164
+ hideOriginalObjects(objects: Object3D | Object3D[]): this {
165
+ return this;
166
+ }
167
+
168
+ explode(scale = 0, coeff = 4): this {
169
+ function calcExplodeDepth(object: Object3D, depth: number): number {
170
+ let res = depth;
171
+ object.children.forEach((x: Object3D) => {
172
+ const objectDepth = calcExplodeDepth(x, depth + 1);
173
+ if (res < objectDepth) res = objectDepth;
174
+ });
175
+
176
+ object.userData.originalPosition = object.position.clone();
177
+ object.userData.originalCenter = new Box3().setFromObject(object).getCenter(new Vector3());
178
+ object.userData.isExplodeLocked = depth > 2 && object.children.length === 0;
179
+
180
+ return res;
181
+ }
182
+
183
+ scale /= 100;
184
+
185
+ if (!this.scene.userData.explodeDepth) this.scene.userData.explodeDepth = calcExplodeDepth(this.scene, 1);
186
+ const maxDepth = this.scene.userData.explodeDepth;
187
+
188
+ const scaledExplodeDepth = scale * maxDepth + 1;
189
+ const explodeDepth = 0 | scaledExplodeDepth;
190
+ const currentSegmentFraction = scaledExplodeDepth - explodeDepth;
191
+
192
+ function explodeObject(object: Object3D, depth: number) {
193
+ object.position.copy(object.userData.originalPosition);
194
+
195
+ if (depth > 0 && depth <= explodeDepth && !object.userData.isExplodeLocked) {
196
+ let objectScale = scale * coeff;
197
+ if (depth === explodeDepth) objectScale *= currentSegmentFraction;
198
+
199
+ const parentCenter = object.parent.userData.originalCenter;
200
+ const objectCenter = object.userData.originalCenter;
201
+ const objectOffset = objectCenter.clone().sub(parentCenter).multiplyScalar(objectScale);
202
+
203
+ object.position.add(objectOffset);
204
+ }
205
+
206
+ object.children.forEach((x) => explodeObject(x, depth + 1));
207
+ }
208
+
209
+ explodeObject(this.scene, 0);
210
+ this.scene.updateMatrixWorld();
211
+
212
+ return this;
213
+ }
214
+ }
@@ -0,0 +1,245 @@
1
+ ///////////////////////////////////////////////////////////////////////////////
2
+ // Copyright (C) 2002-2025, Open Design Alliance (the "Alliance").
3
+ // All rights reserved.
4
+ //
5
+ // This software and its documentation and related materials are owned by
6
+ // the Alliance. The software may only be incorporated into application
7
+ // programs owned by members of the Alliance, subject to a signed
8
+ // Membership Agreement and Supplemental Software License Agreement with the
9
+ // Alliance. The structure and organization of this software are the valuable
10
+ // trade secrets of the Alliance and its suppliers. The software is also
11
+ // protected by copyright law and international treaty provisions. Application
12
+ // programs incorporating this software must include the following statement
13
+ // with their copyright notices:
14
+ //
15
+ // This application incorporates Open Design Alliance software pursuant to a
16
+ // license agreement with Open Design Alliance.
17
+ // Open Design Alliance Copyright (C) 2002-2025 by Open Design Alliance.
18
+ // All rights reserved.
19
+ //
20
+ // By use of this software, its documentation or related materials, you
21
+ // acknowledge and accept the above terms.
22
+ ///////////////////////////////////////////////////////////////////////////////
23
+
24
+ import { AdditiveBlending, Color, HalfFloatType, ShaderMaterial, UniformsUtils, WebGLRenderTarget } from "three";
25
+ import { Pass, FullScreenQuad } from "three/examples/jsm/postprocessing/Pass.js";
26
+ import { CopyShader } from "three/examples/jsm/shaders/CopyShader.js";
27
+
28
+ export class SSAARenderPass extends Pass {
29
+ constructor(scenes, camera, clearColor = 0x000000, clearAlpha = 0) {
30
+ super();
31
+ this.scenes = Array.isArray(scenes) ? scenes : [scenes];
32
+ this.camera = camera;
33
+ this.sampleLevel = 2;
34
+ this.unbiased = true;
35
+ this.stencilBuffer = false;
36
+ this.clearColor = clearColor;
37
+ this.clearAlpha = clearAlpha;
38
+
39
+ this._sampleRenderTarget = null;
40
+ this._oldClearColor = new Color();
41
+ this._copyUniforms = UniformsUtils.clone(CopyShader.uniforms);
42
+
43
+ this._copyMaterial = new ShaderMaterial({
44
+ uniforms: this._copyUniforms,
45
+ vertexShader: CopyShader.vertexShader,
46
+ fragmentShader: CopyShader.fragmentShader,
47
+ transparent: true,
48
+ depthTest: false,
49
+ depthWrite: false,
50
+ premultipliedAlpha: true,
51
+ blending: AdditiveBlending,
52
+ });
53
+
54
+ this._fsQuad = new FullScreenQuad(this._copyMaterial);
55
+ }
56
+
57
+ dispose() {
58
+ if (this._sampleRenderTarget) {
59
+ this._sampleRenderTarget.dispose();
60
+ this._sampleRenderTarget = null;
61
+ }
62
+
63
+ this._copyMaterial.dispose();
64
+
65
+ this._fsQuad.dispose();
66
+ }
67
+
68
+ setSize(width, height) {
69
+ if (this._sampleRenderTarget) this._sampleRenderTarget.setSize(width, height);
70
+ }
71
+
72
+ render(renderer, writeBuffer, readBuffer, deltaTime, maskActive) {
73
+ if (!this._sampleRenderTarget) {
74
+ this._sampleRenderTarget = new WebGLRenderTarget(readBuffer.width, readBuffer.height, {
75
+ type: HalfFloatType,
76
+ stencilBuffer: this.stencilBuffer,
77
+ });
78
+ this._sampleRenderTarget.texture.name = "SSAAMultiRenderPass.sample";
79
+ }
80
+
81
+ const jitterOffsets = _JitterVectors[Math.max(0, Math.min(this.sampleLevel, 5))];
82
+
83
+ const autoClear = renderer.autoClear;
84
+ renderer.autoClear = false;
85
+
86
+ renderer.getClearColor(this._oldClearColor);
87
+ const oldClearAlpha = renderer.getClearAlpha();
88
+
89
+ const baseSampleWeight = 1.0 / jitterOffsets.length;
90
+ const roundingRange = 1 / 32;
91
+ this._copyUniforms["tDiffuse"].value = this._sampleRenderTarget.texture;
92
+
93
+ const viewOffset = {
94
+ fullWidth: readBuffer.width,
95
+ fullHeight: readBuffer.height,
96
+ offsetX: 0,
97
+ offsetY: 0,
98
+ width: readBuffer.width,
99
+ height: readBuffer.height,
100
+ };
101
+
102
+ const originalViewOffset = Object.assign({}, this.camera.view);
103
+
104
+ if (originalViewOffset.enabled) Object.assign(viewOffset, originalViewOffset);
105
+
106
+ for (let i = 0; i < jitterOffsets.length; i++) {
107
+ const jitterOffset = jitterOffsets[i];
108
+
109
+ if (this.camera.setViewOffset) {
110
+ this.camera.setViewOffset(
111
+ viewOffset.fullWidth,
112
+ viewOffset.fullHeight,
113
+
114
+ viewOffset.offsetX + jitterOffset[0] * 0.0625,
115
+ viewOffset.offsetY + jitterOffset[1] * 0.0625, // 0.0625 = 1 / 16
116
+
117
+ viewOffset.width,
118
+ viewOffset.height
119
+ );
120
+ }
121
+
122
+ let sampleWeight = baseSampleWeight;
123
+
124
+ if (this.unbiased) {
125
+ const uniformCenteredDistribution = -0.5 + (i + 0.5) / jitterOffsets.length;
126
+ sampleWeight += roundingRange * uniformCenteredDistribution;
127
+ }
128
+
129
+ this._copyUniforms["opacity"].value = sampleWeight;
130
+ renderer.setClearColor(this.clearColor, this.clearAlpha);
131
+ renderer.setRenderTarget(this._sampleRenderTarget);
132
+ renderer.clear();
133
+
134
+ this.scenes.forEach((scene) => renderer.render(scene, this.camera));
135
+
136
+ renderer.setRenderTarget(this.renderToScreen ? null : writeBuffer);
137
+
138
+ if (i === 0) {
139
+ renderer.setClearColor(0x000000, 0.0);
140
+ renderer.clear();
141
+ }
142
+
143
+ this._fsQuad.render(renderer);
144
+ }
145
+
146
+ if (this.camera.setViewOffset && originalViewOffset.enabled) {
147
+ this.camera.setViewOffset(
148
+ originalViewOffset.fullWidth,
149
+ originalViewOffset.fullHeight,
150
+
151
+ originalViewOffset.offsetX,
152
+ originalViewOffset.offsetY,
153
+
154
+ originalViewOffset.width,
155
+ originalViewOffset.height
156
+ );
157
+ } else if (this.camera.clearViewOffset) {
158
+ this.camera.clearViewOffset();
159
+ }
160
+
161
+ renderer.autoClear = autoClear;
162
+ renderer.setClearColor(this._oldClearColor, oldClearAlpha);
163
+ }
164
+ }
165
+
166
+ // These jitter vectors are specified in integers because it is easier.
167
+ // I am assuming a [-8,8) integer grid, but it needs to be mapped onto [-0.5,0.5)
168
+ // before being used, thus these integers need to be scaled by 1/16.
169
+ //
170
+ // Sample patterns reference: https://msdn.microsoft.com/en-us/library/windows/desktop/ff476218%28v=vs.85%29.aspx?f=255&MSPPError=-2147217396
171
+ const _JitterVectors = [
172
+ [[0, 0]],
173
+ [
174
+ [4, 4],
175
+ [-4, -4],
176
+ ],
177
+ [
178
+ [-2, -6],
179
+ [6, -2],
180
+ [-6, 2],
181
+ [2, 6],
182
+ ],
183
+ [
184
+ [1, -3],
185
+ [-1, 3],
186
+ [5, 1],
187
+ [-3, -5],
188
+ [-5, 5],
189
+ [-7, -1],
190
+ [3, 7],
191
+ [7, -7],
192
+ ],
193
+ [
194
+ [1, 1],
195
+ [-1, -3],
196
+ [-3, 2],
197
+ [4, -1],
198
+ [-5, -2],
199
+ [2, 5],
200
+ [5, 3],
201
+ [3, -5],
202
+ [-2, 6],
203
+ [0, -7],
204
+ [-4, -6],
205
+ [-6, 4],
206
+ [-8, 0],
207
+ [7, -4],
208
+ [6, 7],
209
+ [-7, -8],
210
+ ],
211
+ [
212
+ [-4, -7],
213
+ [-7, -5],
214
+ [-3, -5],
215
+ [-5, -4],
216
+ [-1, -4],
217
+ [-2, -2],
218
+ [-6, -1],
219
+ [-4, 0],
220
+ [-7, 1],
221
+ [-1, 2],
222
+ [-6, 3],
223
+ [-3, 3],
224
+ [-7, 6],
225
+ [-3, 6],
226
+ [-5, 7],
227
+ [-1, 7],
228
+ [5, -7],
229
+ [1, -6],
230
+ [6, -5],
231
+ [4, -4],
232
+ [2, -3],
233
+ [7, -2],
234
+ [1, -1],
235
+ [4, -1],
236
+ [2, 1],
237
+ [6, 2],
238
+ [0, 4],
239
+ [4, 4],
240
+ [2, 5],
241
+ [7, 5],
242
+ [5, 6],
243
+ [3, 7],
244
+ ],
245
+ ];
@@ -0,0 +1,42 @@
1
+ ///////////////////////////////////////////////////////////////////////////////
2
+ // Copyright (C) 2002-2025, Open Design Alliance (the "Alliance").
3
+ // All rights reserved.
4
+ //
5
+ // This software and its documentation and related materials are owned by
6
+ // the Alliance. The software may only be incorporated into application
7
+ // programs owned by members of the Alliance, subject to a signed
8
+ // Membership Agreement and Supplemental Software License Agreement with the
9
+ // Alliance. The structure and organization of this software are the valuable
10
+ // trade secrets of the Alliance and its suppliers. The software is also
11
+ // protected by copyright law and international treaty provisions. Application
12
+ // programs incorporating this software must include the following statement
13
+ // with their copyright notices:
14
+ //
15
+ // This application incorporates Open Design Alliance software pursuant to a
16
+ // license agreement with Open Design Alliance.
17
+ // Open Design Alliance Copyright (C) 2002-2025 by Open Design Alliance.
18
+ // All rights reserved.
19
+ //
20
+ // By use of this software, its documentation or related materials, you
21
+ // acknowledge and accept the above terms.
22
+ ///////////////////////////////////////////////////////////////////////////////
23
+
24
+ import { Scene, WebGLRenderer } from "three";
25
+
26
+ export class Helpers extends Scene {
27
+ private oldAutoClear = false;
28
+ private oldClippingPlanes = [];
29
+
30
+ override onBeforeRender(renderer: WebGLRenderer): void {
31
+ this.oldAutoClear = renderer.autoClear;
32
+ this.oldClippingPlanes = renderer.clippingPlanes;
33
+
34
+ renderer.autoClear = false;
35
+ renderer.clippingPlanes = [];
36
+ }
37
+
38
+ override onAfterRender(renderer: WebGLRenderer): void {
39
+ renderer.clippingPlanes = this.oldClippingPlanes;
40
+ renderer.autoClear = this.oldAutoClear;
41
+ }
42
+ }
package/src/index.ts CHANGED
@@ -26,7 +26,8 @@ export * from "./Viewer/commands";
26
26
  export * from "./Viewer/components";
27
27
  export * from "./Viewer/loaders";
28
28
  export * from "./Viewer/loaders/GLTFLoadingManager";
29
- export * from "./Viewer/model";
29
+ export * from "./Viewer/models/IModelImpl";
30
+ export * from "./Viewer/models/ModelImpl";
30
31
  export * from "./Viewer/Viewer";
31
32
 
32
33
  // the lines below are required for typedoc to include the viewer core and markups documentation