@inweb/viewer-three 26.10.6 → 26.11.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.
Files changed (143) hide show
  1. package/README.md +7 -4
  2. package/dist/{plugins → extensions}/components/AxesHelperComponent.js +23 -1
  3. package/dist/extensions/components/AxesHelperComponent.js.map +1 -0
  4. package/dist/extensions/components/AxesHelperComponent.min.js +24 -0
  5. package/dist/{plugins → extensions}/components/AxesHelperComponent.module.js +24 -2
  6. package/dist/extensions/components/AxesHelperComponent.module.js.map +1 -0
  7. package/dist/{plugins → extensions}/components/ExtentsHelperComponent.js +18 -0
  8. package/dist/extensions/components/ExtentsHelperComponent.js.map +1 -0
  9. package/dist/{plugins/components/AxesHelperComponent.min.js → extensions/components/ExtentsHelperComponent.min.js} +1 -1
  10. package/dist/{plugins → extensions}/components/ExtentsHelperComponent.module.js +19 -1
  11. package/dist/extensions/components/ExtentsHelperComponent.module.js.map +1 -0
  12. package/dist/extensions/components/GridHelperComponent.js.map +1 -0
  13. package/dist/extensions/components/GridHelperComponent.module.js.map +1 -0
  14. package/dist/extensions/components/LightHelperComponent.js.map +1 -0
  15. package/dist/extensions/components/LightHelperComponent.module.js.map +1 -0
  16. package/dist/extensions/components/RoomEnvironmentComponent.js.map +1 -0
  17. package/dist/extensions/components/RoomEnvironmentComponent.module.js.map +1 -0
  18. package/dist/extensions/components/StatsPanelComponent.js.map +1 -0
  19. package/dist/extensions/components/StatsPanelComponent.module.js.map +1 -0
  20. package/dist/{plugins → extensions}/loaders/GLTFCloudLoader.js +2 -3
  21. package/dist/extensions/loaders/GLTFCloudLoader.js.map +1 -0
  22. package/dist/{plugins → extensions}/loaders/GLTFCloudLoader.min.js +1 -1
  23. package/dist/{plugins → extensions}/loaders/GLTFCloudLoader.module.js +2 -3
  24. package/dist/extensions/loaders/GLTFCloudLoader.module.js.map +1 -0
  25. package/dist/extensions/loaders/GLTFFileLoader.js +2499 -0
  26. package/dist/extensions/loaders/GLTFFileLoader.js.map +1 -0
  27. package/dist/extensions/loaders/GLTFFileLoader.min.js +24 -0
  28. package/dist/extensions/loaders/GLTFFileLoader.module.js +74 -0
  29. package/dist/extensions/loaders/GLTFFileLoader.module.js.map +1 -0
  30. package/dist/{plugins → extensions}/loaders/IFCXLoader.js +5 -7
  31. package/dist/extensions/loaders/IFCXLoader.js.map +1 -0
  32. package/dist/{plugins → extensions}/loaders/IFCXLoader.min.js +1 -1
  33. package/dist/{plugins → extensions}/loaders/IFCXLoader.module.js +5 -7
  34. package/dist/extensions/loaders/IFCXLoader.module.js.map +1 -0
  35. package/dist/{plugins → extensions}/loaders/PotreeLoader.js +1 -2
  36. package/dist/extensions/loaders/PotreeLoader.js.map +1 -0
  37. package/dist/{plugins → extensions}/loaders/PotreeLoader.min.js +1 -1
  38. package/dist/{plugins → extensions}/loaders/PotreeLoader.module.js +1 -2
  39. package/dist/extensions/loaders/PotreeLoader.module.js.map +1 -0
  40. package/dist/viewer-three.js +1015 -2926
  41. package/dist/viewer-three.js.map +1 -1
  42. package/dist/viewer-three.min.js +3 -3
  43. package/dist/viewer-three.module.js +847 -356
  44. package/dist/viewer-three.module.js.map +1 -1
  45. package/{plugins → extensions}/components/AxesHelperComponent.ts +31 -2
  46. package/{plugins → extensions}/components/ExtentsHelperComponent.ts +25 -0
  47. package/{plugins → extensions}/loaders/GLTFCloudLoader.ts +2 -3
  48. package/{src/Viewer → extensions}/loaders/GLTFFileLoader.ts +21 -12
  49. package/{plugins → extensions}/loaders/IFCX/IFCXCloudLoader.ts +5 -5
  50. package/{plugins → extensions}/loaders/IFCX/IFCXFileLoader.ts +3 -4
  51. package/{plugins → extensions}/loaders/Potree/PotreeFileLoader.ts +3 -4
  52. package/lib/Viewer/Viewer.d.ts +27 -20
  53. package/lib/Viewer/commands/GetSelected2.d.ts +2 -0
  54. package/lib/Viewer/commands/SelectModel.d.ts +1 -1
  55. package/lib/Viewer/commands/SetSelected2.d.ts +2 -0
  56. package/lib/Viewer/components/SelectionComponent.d.ts +1 -3
  57. package/lib/Viewer/components/index.d.ts +6 -6
  58. package/lib/Viewer/draggers/MeasureLineDragger.d.ts +7 -1
  59. package/lib/Viewer/loaders/DynamicGltfLoader/DynamicModelImpl.d.ts +0 -1
  60. package/lib/Viewer/loaders/GLTFBinaryExtension.d.ts +5 -0
  61. package/lib/Viewer/loaders/GLTFCloudDynamicLoader.d.ts +2 -2
  62. package/lib/Viewer/loaders/{GLTFFileLoader.d.ts → GLTFFileDynamicLoader.d.ts} +7 -1
  63. package/lib/Viewer/loaders/GLTFLoadingManager.d.ts +4 -3
  64. package/lib/Viewer/loaders/RangesLoader.d.ts +15 -0
  65. package/lib/Viewer/loaders/index.d.ts +22 -14
  66. package/lib/Viewer/measurement/Snapper.d.ts +15 -0
  67. package/lib/Viewer/measurement/UnitConverter.d.ts +63 -0
  68. package/lib/Viewer/measurement/UnitFormatter.d.ts +4 -0
  69. package/lib/Viewer/models/IModelImpl.d.ts +10 -8
  70. package/lib/Viewer/models/ModelImpl.d.ts +7 -5
  71. package/package.json +11 -11
  72. package/src/Viewer/Viewer.ts +120 -88
  73. package/src/Viewer/commands/ClearSelected.ts +3 -1
  74. package/src/Viewer/commands/GetModels.ts +1 -1
  75. package/src/Viewer/commands/GetSelected.ts +2 -2
  76. package/src/Viewer/commands/GetSelected2.ts +34 -0
  77. package/src/Viewer/commands/HideSelected.ts +3 -1
  78. package/src/Viewer/commands/SelectModel.ts +5 -5
  79. package/src/Viewer/commands/SetSelected.ts +9 -10
  80. package/src/Viewer/commands/SetSelected2.ts +42 -0
  81. package/src/Viewer/commands/ZoomToObjects.ts +5 -6
  82. package/src/Viewer/commands/ZoomToSelected.ts +3 -1
  83. package/src/Viewer/commands/index.ts +4 -0
  84. package/src/Viewer/components/CameraComponent.ts +6 -1
  85. package/src/Viewer/components/ExtentsComponent.ts +4 -1
  86. package/src/Viewer/components/SelectionComponent.ts +7 -30
  87. package/src/Viewer/components/index.ts +6 -6
  88. package/src/Viewer/draggers/MeasureLineDragger.ts +84 -226
  89. package/src/Viewer/loaders/DynamicGltfLoader/DynamicGltfLoader.js +263 -34
  90. package/src/Viewer/loaders/DynamicGltfLoader/DynamicModelImpl.ts +20 -10
  91. package/src/Viewer/loaders/DynamicGltfLoader/GltfStructure.js +4 -1
  92. package/src/Viewer/loaders/GLTFBinaryExtension.ts +91 -0
  93. package/src/Viewer/loaders/GLTFCloudDynamicLoader.ts +13 -19
  94. package/src/Viewer/loaders/GLTFFileDynamicLoader.ts +145 -0
  95. package/src/Viewer/loaders/GLTFLoadingManager.ts +5 -4
  96. package/src/Viewer/loaders/RangesLoader.ts +95 -0
  97. package/src/Viewer/loaders/index.ts +24 -16
  98. package/src/Viewer/measurement/Snapper.ts +208 -0
  99. package/src/Viewer/measurement/UnitConverter.ts +47 -0
  100. package/src/Viewer/measurement/UnitFormatter.ts +95 -0
  101. package/src/Viewer/models/IModelImpl.ts +15 -8
  102. package/src/Viewer/models/ModelImpl.ts +48 -17
  103. package/src/index-umd.ts +1 -1
  104. package/dist/plugins/components/AxesHelperComponent.js.map +0 -1
  105. package/dist/plugins/components/AxesHelperComponent.module.js.map +0 -1
  106. package/dist/plugins/components/ExtentsHelperComponent.js.map +0 -1
  107. package/dist/plugins/components/ExtentsHelperComponent.min.js +0 -24
  108. package/dist/plugins/components/ExtentsHelperComponent.module.js.map +0 -1
  109. package/dist/plugins/components/GridHelperComponent.js.map +0 -1
  110. package/dist/plugins/components/GridHelperComponent.module.js.map +0 -1
  111. package/dist/plugins/components/LightHelperComponent.js.map +0 -1
  112. package/dist/plugins/components/LightHelperComponent.module.js.map +0 -1
  113. package/dist/plugins/components/RoomEnvironmentComponent.js.map +0 -1
  114. package/dist/plugins/components/RoomEnvironmentComponent.module.js.map +0 -1
  115. package/dist/plugins/components/StatsPanelComponent.js.map +0 -1
  116. package/dist/plugins/components/StatsPanelComponent.module.js.map +0 -1
  117. package/dist/plugins/loaders/GLTFCloudLoader.js.map +0 -1
  118. package/dist/plugins/loaders/GLTFCloudLoader.module.js.map +0 -1
  119. package/dist/plugins/loaders/IFCXLoader.js.map +0 -1
  120. package/dist/plugins/loaders/IFCXLoader.module.js.map +0 -1
  121. package/dist/plugins/loaders/PotreeLoader.js.map +0 -1
  122. package/dist/plugins/loaders/PotreeLoader.module.js.map +0 -1
  123. /package/dist/{plugins → extensions}/components/GridHelperComponent.js +0 -0
  124. /package/dist/{plugins → extensions}/components/GridHelperComponent.min.js +0 -0
  125. /package/dist/{plugins → extensions}/components/GridHelperComponent.module.js +0 -0
  126. /package/dist/{plugins → extensions}/components/LightHelperComponent.js +0 -0
  127. /package/dist/{plugins → extensions}/components/LightHelperComponent.min.js +0 -0
  128. /package/dist/{plugins → extensions}/components/LightHelperComponent.module.js +0 -0
  129. /package/dist/{plugins → extensions}/components/RoomEnvironmentComponent.js +0 -0
  130. /package/dist/{plugins → extensions}/components/RoomEnvironmentComponent.min.js +0 -0
  131. /package/dist/{plugins → extensions}/components/RoomEnvironmentComponent.module.js +0 -0
  132. /package/dist/{plugins → extensions}/components/StatsPanelComponent.js +0 -0
  133. /package/dist/{plugins → extensions}/components/StatsPanelComponent.min.js +0 -0
  134. /package/dist/{plugins → extensions}/components/StatsPanelComponent.module.js +0 -0
  135. /package/{plugins → extensions}/components/GridHelperComponent.ts +0 -0
  136. /package/{plugins → extensions}/components/LightHelperComponent.ts +0 -0
  137. /package/{plugins → extensions}/components/RoomEnvironmentComponent.ts +0 -0
  138. /package/{plugins → extensions}/components/StatsPanelComponent.ts +0 -0
  139. /package/{plugins → extensions}/loaders/IFCX/IFCXLoader.ts +0 -0
  140. /package/{plugins → extensions}/loaders/IFCX/index.ts +0 -0
  141. /package/{plugins → extensions}/loaders/IFCX/render.js +0 -0
  142. /package/{plugins → extensions}/loaders/Potree/PotreeModelImpl.ts +0 -0
  143. /package/{plugins → extensions}/loaders/Potree/index.ts +0 -0
package/README.md CHANGED
@@ -4,10 +4,13 @@
4
4
 
5
5
  Core capabilities:
6
6
 
7
- - Visualize files stored on the [Open Cloud Server](https://cloud.opendesign.com/docs/index.html#/opencloud_server), on the web, or on your local computer.
8
- - Add user interaction with scenes.
9
- - Create markups.
10
- - Save and load viewpoints.
7
+ - Rendering CAD/BIM files from [Open Cloud Server](https://cloud.opendesign.com/docs/index.html#/opencloud_server), web, or local files
8
+ - Interactive scene navigation (Orbit, Pan, Zoom, Walk, Fly modes)
9
+ - Model selection and highlighting
10
+ - Cutting planes and slicing
11
+ - Markups and measurements
12
+ - Viewpoint management
13
+ - Extension system for extending functionality
11
14
 
12
15
  This library is a part of [CDE SDK](https://www.opendesign.com/products/cde) by [Open Design Alliance](https://opendesign.com).
13
16
 
@@ -30,25 +30,47 @@
30
30
  class AxesHelperComponent {
31
31
  constructor(viewer) {
32
32
  this.syncHelper = () => {
33
+ this.modelHelpers.forEach((helper) => {
34
+ helper.removeFromParent();
35
+ helper.dispose();
36
+ });
37
+ this.modelHelpers.length = 0;
33
38
  this.axesHelper1.removeFromParent();
34
39
  this.axesHelper2.removeFromParent();
35
40
  const size = this.viewer.extents.getSize(new three.Vector3()).length();
36
41
  const center = this.viewer.extents.getCenter(new three.Vector3());
37
42
  this.axesHelper1.position.set(0, 0, 0);
38
- this.axesHelper1.scale.setScalar(size);
43
+ this.axesHelper1.scale.setScalar(size * 1.25);
39
44
  this.axesHelper2.position.copy(center);
40
45
  this.axesHelper2.scale.setScalar(size);
41
46
  this.viewer.helpers.add(this.axesHelper1);
42
47
  this.viewer.helpers.add(this.axesHelper2);
48
+ if (this.viewer.models.length < 2)
49
+ return;
50
+ this.viewer.models.forEach((model) => {
51
+ const extents = model.getExtents(new three.Box3());
52
+ const size = extents.getSize(new three.Vector3()).length();
53
+ const center = extents.getCenter(new three.Vector3());
54
+ const helper = new three.AxesHelper(size);
55
+ helper.position.copy(center);
56
+ this.modelHelpers.push(helper);
57
+ this.viewer.helpers.add(helper);
58
+ });
43
59
  };
44
60
  this.axesHelper1 = new three.AxesHelper(1);
45
61
  this.axesHelper2 = new three.AxesHelper(1);
62
+ this.modelHelpers = [];
63
+ this.axesHelper1.setColors("#ccc", "#ccc", "#cccb");
46
64
  this.viewer = viewer;
47
65
  this.viewer.addEventListener("initialize", this.syncHelper);
48
66
  this.viewer.addEventListener("geometryend", this.syncHelper);
49
67
  this.viewer.addEventListener("clear", this.syncHelper);
50
68
  }
51
69
  dispose() {
70
+ this.modelHelpers.forEach((helper) => {
71
+ helper.removeFromParent();
72
+ helper.dispose();
73
+ });
52
74
  this.axesHelper1.removeFromParent();
53
75
  this.axesHelper1.dispose();
54
76
  this.axesHelper2.removeFromParent();
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AxesHelperComponent.js","sources":["../../../extensions/components/AxesHelperComponent.ts"],"sourcesContent":["///////////////////////////////////////////////////////////////////////////////\n// Copyright (C) 2002-2025, Open Design Alliance (the \"Alliance\").\n// All rights reserved.\n//\n// This software and its documentation and related materials are owned by\n// the Alliance. The software may only be incorporated into application\n// programs owned by members of the Alliance, subject to a signed\n// Membership Agreement and Supplemental Software License Agreement with the\n// Alliance. The structure and organization of this software are the valuable\n// trade secrets of the Alliance and its suppliers. The software is also\n// protected by copyright law and international treaty provisions. Application\n// programs incorporating this software must include the following statement\n// with their copyright notices:\n//\n// This application incorporates Open Design Alliance software pursuant to a\n// license agreement with Open Design Alliance.\n// Open Design Alliance Copyright (C) 2002-2025 by Open Design Alliance.\n// All rights reserved.\n//\n// By use of this software, its documentation or related materials, you\n// acknowledge and accept the above terms.\n///////////////////////////////////////////////////////////////////////////////\n\nimport { AxesHelper, Box3, Vector3 } from \"three\";\nimport { IComponent, components, Viewer } from \"@inweb/viewer-three\";\n\nclass AxesHelperComponent implements IComponent {\n private viewer: Viewer;\n private axesHelper1: AxesHelper;\n private axesHelper2: AxesHelper;\n private modelHelpers: AxesHelper[];\n\n constructor(viewer: Viewer) {\n this.axesHelper1 = new AxesHelper(1);\n this.axesHelper2 = new AxesHelper(1);\n this.modelHelpers = [];\n\n this.axesHelper1.setColors(\"#ccc\", \"#ccc\", \"#cccb\");\n\n this.viewer = viewer;\n this.viewer.addEventListener(\"initialize\", this.syncHelper);\n this.viewer.addEventListener(\"geometryend\", this.syncHelper);\n this.viewer.addEventListener(\"clear\", this.syncHelper);\n }\n\n dispose() {\n this.modelHelpers.forEach((helper) => {\n helper.removeFromParent();\n helper.dispose();\n });\n\n this.axesHelper1.removeFromParent();\n this.axesHelper1.dispose();\n\n this.axesHelper2.removeFromParent();\n this.axesHelper2.dispose();\n\n this.viewer.removeEventListener(\"initialize\", this.syncHelper);\n this.viewer.removeEventListener(\"geometryend\", this.syncHelper);\n this.viewer.removeEventListener(\"clear\", this.syncHelper);\n }\n\n syncHelper = () => {\n this.modelHelpers.forEach((helper) => {\n helper.removeFromParent();\n helper.dispose();\n });\n this.modelHelpers.length = 0;\n\n this.axesHelper1.removeFromParent();\n this.axesHelper2.removeFromParent();\n\n const size = this.viewer.extents.getSize(new Vector3()).length();\n const center = this.viewer.extents.getCenter(new Vector3());\n\n this.axesHelper1.position.set(0, 0, 0);\n this.axesHelper1.scale.setScalar(size * 1.25);\n\n this.axesHelper2.position.copy(center);\n this.axesHelper2.scale.setScalar(size);\n\n this.viewer.helpers.add(this.axesHelper1);\n this.viewer.helpers.add(this.axesHelper2);\n\n if (this.viewer.models.length < 2) return;\n\n this.viewer.models.forEach((model) => {\n const extents = model.getExtents(new Box3());\n const size = extents.getSize(new Vector3()).length();\n const center = extents.getCenter(new Vector3());\n\n const helper = new AxesHelper(size);\n helper.position.copy(center);\n\n this.modelHelpers.push(helper);\n this.viewer.helpers.add(helper);\n });\n };\n}\n\ncomponents.registerComponent(\"AxesHelperComponent\", (viewer) => new AxesHelperComponent(viewer));\n"],"names":["Vector3","Box3","AxesHelper","components"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;IA0BA,MAAM,mBAAmB,CAAA;IAMvB,IAAA,WAAA,CAAY,MAAc,EAAA;YA8B1B,IAAA,CAAA,UAAU,GAAG,MAAK;gBA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C,QAAA,IAAI,CAAC,WAAW,CAAC,OAAO,EAAE;IAE1B,QAAA,IAAI,CAAC,WAAW,CAAC,gBAAgB,EAAE;IACnC,QAAA,IAAI,CAAC,WAAW,CAAC,OAAO,EAAE;YAE1B,IAAI,CAAC,MAAM,CAAC,mBAAmB,CAAC,YAAY,EAAE,IAAI,CAAC,UAAU,CAAC;YAC9D,IAAI,CAAC,MAAM,CAAC,mBAAmB,CAAC,aAAa,EAAE,IAAI,CAAC,UAAU,CAAC;YAC/D,IAAI,CAAC,MAAM,CAAC,mBAAmB,CAAC,OAAO,EAAE,IAAI,CAAC,UAAU,CAAC;QAC3D;IAsCD;AAEDC,0BAAU,CAAC,iBAAiB,CAAC,qBAAqB,EAAE,CAAC,MAAM,KAAK,IAAI,mBAAmB,CAAC,MAAM,CAAC,CAAC;;;;;;"}
@@ -0,0 +1,24 @@
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
+ !function(e,s){"object"==typeof exports&&"undefined"!=typeof module?s(require("three"),require("@inweb/viewer-three")):"function"==typeof define&&define.amd?define(["three","@inweb/viewer-three"],s):s((e="undefined"!=typeof globalThis?globalThis:e||self).THREE,e.ODA.Three)}(this,function(e,s){"use strict";class t{constructor(s){this.syncHelper=()=>{this.modelHelpers.forEach(e=>{e.removeFromParent(),e.dispose()}),this.modelHelpers.length=0,this.axesHelper1.removeFromParent(),this.axesHelper2.removeFromParent();const s=this.viewer.extents.getSize(new e.Vector3).length(),t=this.viewer.extents.getCenter(new e.Vector3);this.axesHelper1.position.set(0,0,0),this.axesHelper1.scale.setScalar(1.25*s),this.axesHelper2.position.copy(t),this.axesHelper2.scale.setScalar(s),this.viewer.helpers.add(this.axesHelper1),this.viewer.helpers.add(this.axesHelper2),this.viewer.models.length<2||this.viewer.models.forEach(s=>{const t=s.getExtents(new e.Box3),r=t.getSize(new e.Vector3).length(),i=t.getCenter(new e.Vector3),n=new e.AxesHelper(r);n.position.copy(i),this.modelHelpers.push(n),this.viewer.helpers.add(n)})},this.axesHelper1=new e.AxesHelper(1),this.axesHelper2=new e.AxesHelper(1),this.modelHelpers=[],this.axesHelper1.setColors("#ccc","#ccc","#cccb"),this.viewer=s,this.viewer.addEventListener("initialize",this.syncHelper),this.viewer.addEventListener("geometryend",this.syncHelper),this.viewer.addEventListener("clear",this.syncHelper)}dispose(){this.modelHelpers.forEach(e=>{e.removeFromParent(),e.dispose()}),this.axesHelper1.removeFromParent(),this.axesHelper1.dispose(),this.axesHelper2.removeFromParent(),this.axesHelper2.dispose(),this.viewer.removeEventListener("initialize",this.syncHelper),this.viewer.removeEventListener("geometryend",this.syncHelper),this.viewer.removeEventListener("clear",this.syncHelper)}}s.components.registerComponent("AxesHelperComponent",e=>new t(e))});
@@ -21,31 +21,53 @@
21
21
  // acknowledge and accept the above terms.
22
22
  ///////////////////////////////////////////////////////////////////////////////
23
23
 
24
- import { Vector3, AxesHelper } from 'three';
24
+ import { Vector3, Box3, AxesHelper } from 'three';
25
25
  import { components } from '@inweb/viewer-three';
26
26
 
27
27
  class AxesHelperComponent {
28
28
  constructor(viewer) {
29
29
  this.syncHelper = () => {
30
+ this.modelHelpers.forEach((helper) => {
31
+ helper.removeFromParent();
32
+ helper.dispose();
33
+ });
34
+ this.modelHelpers.length = 0;
30
35
  this.axesHelper1.removeFromParent();
31
36
  this.axesHelper2.removeFromParent();
32
37
  const size = this.viewer.extents.getSize(new Vector3()).length();
33
38
  const center = this.viewer.extents.getCenter(new Vector3());
34
39
  this.axesHelper1.position.set(0, 0, 0);
35
- this.axesHelper1.scale.setScalar(size);
40
+ this.axesHelper1.scale.setScalar(size * 1.25);
36
41
  this.axesHelper2.position.copy(center);
37
42
  this.axesHelper2.scale.setScalar(size);
38
43
  this.viewer.helpers.add(this.axesHelper1);
39
44
  this.viewer.helpers.add(this.axesHelper2);
45
+ if (this.viewer.models.length < 2)
46
+ return;
47
+ this.viewer.models.forEach((model) => {
48
+ const extents = model.getExtents(new Box3());
49
+ const size = extents.getSize(new Vector3()).length();
50
+ const center = extents.getCenter(new Vector3());
51
+ const helper = new AxesHelper(size);
52
+ helper.position.copy(center);
53
+ this.modelHelpers.push(helper);
54
+ this.viewer.helpers.add(helper);
55
+ });
40
56
  };
41
57
  this.axesHelper1 = new AxesHelper(1);
42
58
  this.axesHelper2 = new AxesHelper(1);
59
+ this.modelHelpers = [];
60
+ this.axesHelper1.setColors("#ccc", "#ccc", "#cccb");
43
61
  this.viewer = viewer;
44
62
  this.viewer.addEventListener("initialize", this.syncHelper);
45
63
  this.viewer.addEventListener("geometryend", this.syncHelper);
46
64
  this.viewer.addEventListener("clear", this.syncHelper);
47
65
  }
48
66
  dispose() {
67
+ this.modelHelpers.forEach((helper) => {
68
+ helper.removeFromParent();
69
+ helper.dispose();
70
+ });
49
71
  this.axesHelper1.removeFromParent();
50
72
  this.axesHelper1.dispose();
51
73
  this.axesHelper2.removeFromParent();
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AxesHelperComponent.module.js","sources":["../../../extensions/components/AxesHelperComponent.ts"],"sourcesContent":["///////////////////////////////////////////////////////////////////////////////\n// Copyright (C) 2002-2025, Open Design Alliance (the \"Alliance\").\n// All rights reserved.\n//\n// This software and its documentation and related materials are owned by\n// the Alliance. The software may only be incorporated into application\n// programs owned by members of the Alliance, subject to a signed\n// Membership Agreement and Supplemental Software License Agreement with the\n// Alliance. The structure and organization of this software are the valuable\n// trade secrets of the Alliance and its suppliers. The software is also\n// protected by copyright law and international treaty provisions. Application\n// programs incorporating this software must include the following statement\n// with their copyright notices:\n//\n// This application incorporates Open Design Alliance software pursuant to a\n// license agreement with Open Design Alliance.\n// Open Design Alliance Copyright (C) 2002-2025 by Open Design Alliance.\n// All rights reserved.\n//\n// By use of this software, its documentation or related materials, you\n// acknowledge and accept the above terms.\n///////////////////////////////////////////////////////////////////////////////\n\nimport { AxesHelper, Box3, Vector3 } from \"three\";\nimport { IComponent, components, Viewer } from \"@inweb/viewer-three\";\n\nclass AxesHelperComponent implements IComponent {\n private viewer: Viewer;\n private axesHelper1: AxesHelper;\n private axesHelper2: AxesHelper;\n private modelHelpers: AxesHelper[];\n\n constructor(viewer: Viewer) {\n this.axesHelper1 = new AxesHelper(1);\n this.axesHelper2 = new AxesHelper(1);\n this.modelHelpers = [];\n\n this.axesHelper1.setColors(\"#ccc\", \"#ccc\", \"#cccb\");\n\n this.viewer = viewer;\n this.viewer.addEventListener(\"initialize\", this.syncHelper);\n this.viewer.addEventListener(\"geometryend\", this.syncHelper);\n this.viewer.addEventListener(\"clear\", this.syncHelper);\n }\n\n dispose() {\n this.modelHelpers.forEach((helper) => {\n helper.removeFromParent();\n helper.dispose();\n });\n\n this.axesHelper1.removeFromParent();\n this.axesHelper1.dispose();\n\n this.axesHelper2.removeFromParent();\n this.axesHelper2.dispose();\n\n this.viewer.removeEventListener(\"initialize\", this.syncHelper);\n this.viewer.removeEventListener(\"geometryend\", this.syncHelper);\n this.viewer.removeEventListener(\"clear\", this.syncHelper);\n }\n\n syncHelper = () => {\n this.modelHelpers.forEach((helper) => {\n helper.removeFromParent();\n helper.dispose();\n });\n this.modelHelpers.length = 0;\n\n this.axesHelper1.removeFromParent();\n this.axesHelper2.removeFromParent();\n\n const size = this.viewer.extents.getSize(new Vector3()).length();\n const center = this.viewer.extents.getCenter(new Vector3());\n\n this.axesHelper1.position.set(0, 0, 0);\n this.axesHelper1.scale.setScalar(size * 1.25);\n\n this.axesHelper2.position.copy(center);\n this.axesHelper2.scale.setScalar(size);\n\n this.viewer.helpers.add(this.axesHelper1);\n this.viewer.helpers.add(this.axesHelper2);\n\n if (this.viewer.models.length < 2) return;\n\n this.viewer.models.forEach((model) => {\n const extents = model.getExtents(new Box3());\n const size = extents.getSize(new Vector3()).length();\n const center = extents.getCenter(new Vector3());\n\n const helper = new AxesHelper(size);\n helper.position.copy(center);\n\n this.modelHelpers.push(helper);\n this.viewer.helpers.add(helper);\n });\n };\n}\n\ncomponents.registerComponent(\"AxesHelperComponent\", (viewer) => new AxesHelperComponent(viewer));\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AA0BA,MAAM,mBAAmB,CAAA;AAMvB,IAAA,WAAA,CAAY,MAAc,EAAA;QA8B1B,IAAA,CAAA,UAAU,GAAG,MAAK;YAChB,IAAI,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC,MAAM,KAAI;gBACnC,MAAM,CAAC,gBAAgB,EAAE;gBACzB,MAAM,CAAC,OAAO,EAAE;AAClB,YAAA,CAAC,CAAC;AACF,YAAA,IAAI,CAAC,YAAY,CAAC,MAAM,GAAG,CAAC;AAE5B,YAAA,IAAI,CAAC,WAAW,CAAC,gBAAgB,EAAE;AACnC,YAAA,IAAI,CAAC,WAAW,CAAC,gBAAgB,EAAE;AAEnC,YAAA,MAAM,IAAI,GAAG,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,IAAI,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE;AAChE,YAAA,MAAM,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,IAAI,OAAO,EAAE,CAAC;AAE3D,YAAA,IAAI,CAAC,WA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.syncHelper = () => {
33
+ this.modelHelpers.forEach((helper) => {
34
+ helper.removeFromParent();
35
+ helper.dispose();
36
+ });
37
+ this.modelHelpers.length = 0;
33
38
  this.boxHelper.removeFromParent();
34
39
  if (this.viewer.extents.isEmpty())
35
40
  return;
36
41
  this.boxHelper.box = this.viewer.extents.clone();
37
42
  this.viewer.helpers.add(this.boxHelper);
43
+ if (this.viewer.models.length < 2)
44
+ return;
45
+ this.viewer.models.forEach((model) => {
46
+ const extents = model.getExtents(new three.Box3());
47
+ const helper = new three.Box3Helper(extents, "#ff0000");
48
+ this.modelHelpers.push(helper);
49
+ this.viewer.helpers.add(helper);
50
+ });
38
51
  };
39
52
  this.boxHelper = new three.Box3Helper(new three.Box3(), "#ff0000");
53
+ this.modelHelpers = [];
40
54
  this.viewer = viewer;
41
55
  this.viewer.on("geometryend", this.syncHelper);
42
56
  this.viewer.on("clear", this.syncHelper);
@@ -47,6 +61,10 @@
47
61
  this.viewer.on("showall", this.syncHelper);
48
62
  }
49
63
  dispose() {
64
+ this.modelHelpers.forEach((helper) => {
65
+ helper.removeFromParent();
66
+ helper.dispose();
67
+ });
50
68
  this.boxHelper.removeFromParent();
51
69
  this.boxHelper.dispose();
52
70
  this.viewer.off("geometryend", this.syncHelper);
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ExtentsHelperComponent.js","sources":["../../../extensions/components/ExtentsHelperComponent.ts"],"sourcesContent":["///////////////////////////////////////////////////////////////////////////////\n// Copyright (C) 2002-2025, Open Design Alliance (the \"Alliance\").\n// All rights reserved.\n//\n// This software and its documentation and related materials are owned by\n// the Alliance. The software may only be incorporated into application\n// programs owned by members of the Alliance, subject to a signed\n// Membership Agreement and Supplemental Software License Agreement with the\n// Alliance. The structure and organization of this software are the valuable\n// trade secrets of the Alliance and its suppliers. The software is also\n// protected by copyright law and international treaty provisions. Application\n// programs incorporating this software must include the following statement\n// with their copyright notices:\n//\n// This application incorporates Open Design Alliance software pursuant to a\n// license agreement with Open Design Alliance.\n// Open Design Alliance Copyright (C) 2002-2025 by Open Design Alliance.\n// All rights reserved.\n//\n// By use of this software, its documentation or related materials, you\n// acknowledge and accept the above terms.\n///////////////////////////////////////////////////////////////////////////////\n\nimport { Box3, Box3Helper } from \"three\";\nimport { IComponent, components, Viewer } from \"@inweb/viewer-three\";\n\nclass ExtentsHelperComponent implements IComponent {\n private viewer: Viewer;\n private boxHelper: Box3Helper;\n private modelHelpers: Box3Helper[];\n\n constructor(viewer: Viewer) {\n this.boxHelper = new Box3Helper(new Box3(), \"#ff0000\");\n this.modelHelpers = [];\n\n this.viewer = viewer;\n this.viewer.on(\"geometryend\", this.syncHelper);\n this.viewer.on(\"clear\", this.syncHelper);\n this.viewer.on(\"explode\", this.syncHelper);\n this.viewer.on(\"hide\", this.syncHelper);\n this.viewer.on(\"isolate\", this.syncHelper);\n this.viewer.on(\"show\", this.syncHelper);\n this.viewer.on(\"showall\", this.syncHelper);\n }\n\n dispose() {\n this.modelHelpers.forEach((helper) => {\n helper.removeFromParent();\n helper.dispose();\n });\n\n this.boxHelper.removeFromParent();\n this.boxHelper.dispose();\n\n this.viewer.off(\"geometryend\", this.syncHelper);\n this.viewer.off(\"clear\", this.syncHelper);\n this.viewer.off(\"explode\", this.syncHelper);\n this.viewer.off(\"hide\", this.syncHelper);\n this.viewer.off(\"isolate\", this.syncHelper);\n this.viewer.off(\"show\", this.syncHelper);\n this.viewer.off(\"showall\", this.syncHelper);\n }\n\n syncHelper = () => {\n this.modelHelpers.forEach((helper) => {\n helper.removeFromParent();\n helper.dispose();\n });\n this.modelHelpers.length = 0;\n\n this.boxHelper.removeFromParent();\n\n if (this.viewer.extents.isEmpty()) return;\n\n this.boxHelper.box = this.viewer.extents.clone();\n this.viewer.helpers.add(this.boxHelper);\n\n if (this.viewer.models.length < 2) return;\n\n this.viewer.models.forEach((model) => {\n const extents = model.getExtents(new Box3());\n\n const helper = new Box3Helper(extents, \"#ff0000\");\n\n this.modelHelpers.push(helper);\n this.viewer.helpers.add(helper);\n });\n };\n}\n\ncomponents.registerComponent(\"ExtentsHelperComponent\", (viewer) => new ExtentsHelperComponent(viewer));\n"],"names":["Box3","Box3Helper","components"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;IA0BA,MAAM,sBAAsB,CAAA;IAK1B,IAAA,WAAA,CAAY,MAAc,EAAA;YAgC1B,IAAA,CAAA,UAAU,GAAG,MAAK;gBAChB,IAAI,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC,MAAM,KAAI;oBACnC,MAAM,CAAC,gBAAgB,EAAE;oBACzB,MAAM,CAAC,OAAO,EAAE;IAClB,YAAA,CAAC,CAAC;IACF,YAAA,IAAI,CAAC,YAAY,CAAC,MAAM,GAAG,CAAC;IAE5B,YAAA,IAAI,CAAC,SAAS,CAAC,gBAAgB,EAAE;IAEjC,YAAA,IAAI,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,OAAO,EAAE;oBAAE;IAEnC,YAAA,IAAI,CAAC,SAAS,CAAC,GAAG,GAAG,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,KAAK,EAAE;gBAChD,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,SAAS,CAAC;gBAEvC,IAAI,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC;oBAAE;gBAEnC,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,KAAK,KAAI;oBACnC,MAAM,OAAO,GAAG,KAAK,CAAC,UAAU,CAAC,IAAIA,UAAI,EAAE,CAAC;oBAE5C,MAAM,MAAM,GAAG,IAAIC,gBAAU,CAAC,OAAO,EAAE,SAAS,CAAC;IAEjD,gBAAA,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,MAAM,CAAC;oBAC9B,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC;IACjC,YAAA,CAAC,CAAC;IACJ,QAAA,CAAC;IAvDC,Q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C3C,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,MAAM,EAAE,IAAI,CAAC,UAAU,CAAC;YACxC,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,SAAS,EAAE,IAAI,CAAC,UAAU,CAAC;YAC3C,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,MAAM,EAAE,IAAI,CAAC,UAAU,CAAC;YACxC,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,SAAS,EAAE,IAAI,CAAC,UAAU,CAAC;QAC7C;IA2BD;AAEDE,0BAAU,CAAC,iBAAiB,CAAC,wBAAwB,EAAE,CAAC,MAAM,KAAK,IAAI,sBAAsB,CAAC,MAAM,CAAC,CAAC;;;;;;"}
@@ -21,4 +21,4 @@
21
21
  // acknowledge and accept the above terms.
22
22
  ///////////////////////////////////////////////////////////////////////////////
23
23
 
24
- !function(e,s){"object"==typeof exports&&"undefined"!=typeof module?s(require("three"),require("@inweb/viewer-three")):"function"==typeof define&&define.amd?define(["three","@inweb/viewer-three"],s):s((e="undefined"!=typeof globalThis?globalThis:e||self).THREE,e.ODA.Three)}(this,function(e,s){"use strict";class t{constructor(s){this.syncHelper=()=>{this.axesHelper1.removeFromParent(),this.axesHelper2.removeFromParent();const s=this.viewer.extents.getSize(new e.Vector3).length(),t=this.viewer.extents.getCenter(new e.Vector3);this.axesHelper1.position.set(0,0,0),this.axesHelper1.scale.setScalar(s),this.axesHelper2.position.copy(t),this.axesHelper2.scale.setScalar(s),this.viewer.helpers.add(this.axesHelper1),this.viewer.helpers.add(this.axesHelper2)},this.axesHelper1=new e.AxesHelper(1),this.axesHelper2=new e.AxesHelper(1),this.viewer=s,this.viewer.addEventListener("initialize",this.syncHelper),this.viewer.addEventListener("geometryend",this.syncHelper),this.viewer.addEventListener("clear",this.syncHelper)}dispose(){this.axesHelper1.removeFromParent(),this.axesHelper1.dispose(),this.axesHelper2.removeFromParent(),this.axesHelper2.dispose(),this.viewer.removeEventListener("initialize",this.syncHelper),this.viewer.removeEventListener("geometryend",this.syncHelper),this.viewer.removeEventListener("clear",this.syncHelper)}}s.components.registerComponent("AxesHelperComponent",e=>new t(e))});
24
+ !function(e,s){"object"==typeof exports&&"undefined"!=typeof module?s(require("three"),require("@inweb/viewer-three")):"function"==typeof define&&define.amd?define(["three","@inweb/viewer-three"],s):s((e="undefined"!=typeof globalThis?globalThis:e||self).THREE,e.ODA.Three)}(this,function(e,s){"use strict";class i{constructor(s){this.syncHelper=()=>{this.modelHelpers.forEach(e=>{e.removeFromParent(),e.dispose()}),this.modelHelpers.length=0,this.boxHelper.removeFromParent(),this.viewer.extents.isEmpty()||(this.boxHelper.box=this.viewer.extents.clone(),this.viewer.helpers.add(this.boxHelper),this.viewer.models.length<2||this.viewer.models.forEach(s=>{const i=s.getExtents(new e.Box3),t=new e.Box3Helper(i,"#ff0000");this.modelHelpers.push(t),this.viewer.helpers.add(t)}))},this.boxHelper=new e.Box3Helper(new e.Box3,"#ff0000"),this.modelHelpers=[],this.viewer=s,this.viewer.on("geometryend",this.syncHelper),this.viewer.on("clear",this.syncHelper),this.viewer.on("explode",this.syncHelper),this.viewer.on("hide",this.syncHelper),this.viewer.on("isolate",this.syncHelper),this.viewer.on("show",this.syncHelper),this.viewer.on("showall",this.syncHelper)}dispose(){this.modelHelpers.forEach(e=>{e.removeFromParent(),e.dispose()}),this.boxHelper.removeFromParent(),this.boxHelper.dispose(),this.viewer.off("geometryend",this.syncHelper),this.viewer.off("clear",this.syncHelper),this.viewer.off("explode",this.syncHelper),this.viewer.off("hide",this.syncHelper),this.viewer.off("isolate",this.syncHelper),this.viewer.off("show",this.syncHelper),this.viewer.off("showall",this.syncHelper)}}s.components.registerComponent("ExtentsHelperComponent",e=>new i(e))});
@@ -21,19 +21,33 @@
21
21
  // acknowledge and accept the above terms.
22
22
  ///////////////////////////////////////////////////////////////////////////////
23
23
 
24
- import { Box3Helper, Box3 } from 'three';
24
+ import { Box3, Box3Helper } from 'three';
25
25
  import { components } from '@inweb/viewer-three';
26
26
 
27
27
  class ExtentsHelperComponent {
28
28
  constructor(viewer) {
29
29
  this.syncHelper = () => {
30
+ this.modelHelpers.forEach((helper) => {
31
+ helper.removeFromParent();
32
+ helper.dispose();
33
+ });
34
+ this.modelHelpers.length = 0;
30
35
  this.boxHelper.removeFromParent();
31
36
  if (this.viewer.extents.isEmpty())
32
37
  return;
33
38
  this.boxHelper.box = this.viewer.extents.clone();
34
39
  this.viewer.helpers.add(this.boxHelper);
40
+ if (this.viewer.models.length < 2)
41
+ return;
42
+ this.viewer.models.forEach((model) => {
43
+ const extents = model.getExtents(new Box3());
44
+ const helper = new Box3Helper(extents, "#ff0000");
45
+ this.modelHelpers.push(helper);
46
+ this.viewer.helpers.add(helper);
47
+ });
35
48
  };
36
49
  this.boxHelper = new Box3Helper(new Box3(), "#ff0000");
50
+ this.modelHelpers = [];
37
51
  this.viewer = viewer;
38
52
  this.viewer.on("geometryend", this.syncHelper);
39
53
  this.viewer.on("clear", this.syncHelper);
@@ -44,6 +58,10 @@ class ExtentsHelperComponent {
44
58
  this.viewer.on("showall", this.syncHelper);
45
59
  }
46
60
  dispose() {
61
+ this.modelHelpers.forEach((helper) => {
62
+ helper.removeFromParent();
63
+ helper.dispose();
64
+ });
47
65
  this.boxHelper.removeFromParent();
48
66
  this.boxHelper.dispose();
49
67
  this.viewer.off("geometryend", this.syncHelper);
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ExtentsHelperComponent.module.js","sources":["../../../extensions/components/ExtentsHelperComponent.ts"],"sourcesContent":["///////////////////////////////////////////////////////////////////////////////\n// Copyright (C) 2002-2025, Open Design Alliance (the \"Alliance\").\n// All rights reserved.\n//\n// This software and its documentation and related materials are owned by\n// the Alliance. The software may only be incorporated into application\n// programs owned by members of the Alliance, subject to a signed\n// Membership Agreement and Supplemental Software License Agreement with the\n// Alliance. The structure and organization of this software are the valuable\n// trade secrets of the Alliance and its suppliers. The software is also\n// protected by copyright law and international treaty provisions. Application\n// programs incorporating this software must include the following statement\n// with their copyright notices:\n//\n// This application incorporates Open Design Alliance software pursuant to a\n// license agreement with Open Design Alliance.\n// Open Design Alliance Copyright (C) 2002-2025 by Open Design Alliance.\n// All rights reserved.\n//\n// By use of this software, its documentation or related materials, you\n// acknowledge and accept the above terms.\n///////////////////////////////////////////////////////////////////////////////\n\nimport { Box3, Box3Helper } from \"three\";\nimport { IComponent, components, Viewer } from \"@inweb/viewer-three\";\n\nclass ExtentsHelperComponent implements IComponent {\n private viewer: Viewer;\n private boxHelper: Box3Helper;\n private modelHelpers: Box3Helper[];\n\n constructor(viewer: Viewer) {\n this.boxHelper = new Box3Helper(new Box3(), \"#ff0000\");\n this.modelHelpers = [];\n\n this.viewer = viewer;\n this.viewer.on(\"geometryend\", this.syncHelper);\n this.viewer.on(\"clear\", this.syncHelper);\n this.viewer.on(\"explode\", this.syncHelper);\n this.viewer.on(\"hide\", this.syncHelper);\n this.viewer.on(\"isolate\", this.syncHelper);\n this.viewer.on(\"show\", this.syncHelper);\n this.viewer.on(\"showall\", this.syncHelper);\n }\n\n dispose() {\n this.modelHelpers.forEach((helper) => {\n helper.removeFromParent();\n helper.dispose();\n });\n\n this.boxHelper.removeFromParent();\n this.boxHelper.dispose();\n\n this.viewer.off(\"geometryend\", this.syncHelper);\n this.viewer.off(\"clear\", this.syncHelper);\n this.viewer.off(\"explode\", this.syncHelper);\n this.viewer.off(\"hide\", this.syncHelper);\n this.viewer.off(\"isolate\", this.syncHelper);\n this.viewer.off(\"show\", this.syncHelper);\n this.viewer.off(\"showall\", this.syncHelper);\n }\n\n syncHelper = () => {\n this.modelHelpers.forEach((helper) => {\n helper.removeFromParent();\n helper.dispose();\n });\n this.modelHelpers.length = 0;\n\n this.boxHelper.removeFromParent();\n\n if (this.viewer.extents.isEmpty()) return;\n\n this.boxHelper.box = this.viewer.extents.clone();\n this.viewer.helpers.add(this.boxHelper);\n\n if (this.viewer.models.length < 2) return;\n\n this.viewer.models.forEach((model) => {\n const extents = model.getExtents(new Box3());\n\n const helper = new Box3Helper(extents, \"#ff0000\");\n\n this.modelHelpers.push(helper);\n this.viewer.helpers.add(helper);\n });\n };\n}\n\ncomponents.registerComponent(\"ExtentsHelperComponent\", (viewer) => new ExtentsHelperComponent(viewer));\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AA0BA,MAAM,sBAAsB,CAAA;AAK1B,IAAA,WAAA,CAAY,MAAc,EAAA;QAgC1B,IAAA,CAAA,UAAU,GAAG,MAAK;YAChB,IAAI,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC,MAAM,KAAI;gBACnC,MAAM,CAAC,gBAAgB,EAAE;gBACzB,MAAM,CAAC,OAAO,EAAE;AAClB,YAAA,CAAC,CAAC;AACF,YAAA,IAAI,CAAC,YAAY,CAAC,MAAM,GAAG,CAAC;AAE5B,YAAA,IAAI,CAAC,SAAS,CAAC,gBAAgB,EAAE;AAEjC,YAAA,IAAI,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,OAAO,EAAE;gBAAE;AAEnC,YAAA,IAAI,CAAC,SAAS,CAAC,GAAG,GAAG,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,KAAK,EAAE;YAChD,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,SAAS,CAAC;YAEvC,IAAI,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC;gBAAE;YAEnC,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,KAAK,KAAI;gBACnC,MAAM,OAAO,GAAG,KAAK,CAAC,UAAU,CAAC,IAAI,IAAI,EAAE,CAAC;gBAE5C,MAAM,MAAM,GAAG,IAAI,UAAU,CAAC,OAAO,EAAE,SAAS,CAAC;AAEjD,gBAAA,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,MAAM,CAAC;gBAC9B,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC;AACjC,YAAA,CA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AAE,IAAI,CAAC,UAAU,CAAC;QAC3C,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,MAAM,EAAE,IAAI,CAAC,UAAU,CAAC;QACxC,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,SAAS,EAAE,IAAI,CAAC,UAAU,CAAC;QAC3C,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,MAAM,EAAE,IAAI,CAAC,UAAU,CAAC;QACxC,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,SAAS,EAAE,IAAI,CAAC,UAAU,CAAC;IAC7C;AA2BD;AAED,UAAU,CAAC,iBAAiB,CAAC,wBAAwB,EAAE,CAAC,MAAM,KAAK,IAAI,sBAAsB,CAAC,MAAM,CAAC,CAAC"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GridHelperComponent.js","sources":["../../../extensions/components/GridHelperComponent.ts"],"sourcesContent":["///////////////////////////////////////////////////////////////////////////////\n// Copyright (C) 2002-2025, Open Design Alliance (the \"Alliance\").\n// All rights reserved.\n//\n// This software and its documentation and related materials are owned by\n// the Alliance. The software may only be incorporated into application\n// programs owned by members of the Alliance, subject to a signed\n// Membership Agreement and Supplemental Software License Agreement with the\n// Alliance. The structure and organization of this software are the valuable\n// trade secrets of the Alliance and its suppliers. The software is also\n// protected by copyright law and international treaty provisions. Application\n// programs incorporating this software must include the following statement\n// with their copyright notices:\n//\n// This application incorporates Open Design Alliance software pursuant to a\n// license agreement with Open Design Alliance.\n// Open Design Alliance Copyright (C) 2002-2025 by Open Design Alliance.\n// All rights reserved.\n//\n// By use of this software, its documentation or related materials, you\n// acknowledge and accept the above terms.\n///////////////////////////////////////////////////////////////////////////////\n\nimport { GridHelper, Vector3 } from \"three\";\nimport { IComponent, components, Viewer } from \"@inweb/viewer-three\";\n\nclass GridHelperComponent implements IComponent {\n private viewer: Viewer;\n private gridHelper: GridHelper;\n\n constructor(viewer: Viewer) {\n this.gridHelper = new GridHelper(10, 20, 0x444444, 0xaaaaaa);\n this.viewer = viewer;\n this.viewer.on(\"initialize\", this.syncHelper);\n this.viewer.on(\"geometryend\", this.syncHelper);\n this.viewer.on(\"clear\", this.syncHelper);\n }\n\n dispose() {\n this.gridHelper.removeFromParent();\n this.gridHelper.dispose();\n\n this.viewer.off(\"initialize\", this.syncHelper);\n this.viewer.off(\"geometryend\", this.syncHelper);\n this.viewer.off(\"clear\", this.syncHelper);\n }\n\n syncHelper = () => {\n this.gridHelper.removeFromParent();\n\n if (this.viewer.extents.isEmpty()) return;\n\n const size = this.viewer.extents.getSize(new Vector3()).multiply(this.viewer.camera.up).length();\n const center = this.viewer.extents.getCenter(new Vector3());\n\n const upY = new Vector3(0, 1, 0);\n const up = new Vector3().copy(this.viewer.camera.up);\n\n this.gridHelper.scale.setScalar(size);\n this.gridHelper.position.copy(center);\n this.gridHelper.quaternion.setFromUnitVectors(upY, up);\n\n this.viewer.helpers.add(this.gridHelper);\n };\n}\n\ncomponents.registerComponent(\"GridHelperComponent\", (viewer) => new GridHelperComponent(viewer));\n"],"names":["Vector3","GridHelper","components"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;IA0BA,MAAM,mBAAmB,CAAA;IAIvB,IAAA,WAAA,CAAY,MAAc,EAAA;YAiB1B,IAAA,CAAA,UAAU,GAAG,MAAK;IAChB,YAAA,IAAI,CAAC,UAAU,CAAC,gBAAgB,EAAE;IAElC,YAAA,IAAI,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,OAAO,EAAE;oBAAE;IAEnC,YAAA,MAAM,IAAI,GAAG,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,IAAIA,aAAO,EAAE,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,MAAM,EAAE;IAChG,YAAA,MAAM,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,IAAIA,aAAO,EAAE,CAAC;gBAE3D,MAAM,GAA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AC,UAAU,CAAC;QAC3C;IAmBD;AAEDC,0BAAU,CAAC,iBAAiB,CAAC,qBAAqB,EAAE,CAAC,MAAM,KAAK,IAAI,mBAAmB,CAAC,MAAM,CAAC,CAAC;;;;;;"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GridHelperComponent.module.js","sources":["../../../extensions/components/GridHelperComponent.ts"],"sourcesContent":["///////////////////////////////////////////////////////////////////////////////\n// Copyright (C) 2002-2025, Open Design Alliance (the \"Alliance\").\n// All rights reserved.\n//\n// This software and its documentation and related materials are owned by\n// the Alliance. The software may only be incorporated into application\n// programs owned by members of the Alliance, subject to a signed\n// Membership Agreement and Supplemental Software License Agreement with the\n// Alliance. The structure and organization of this software are the valuable\n// trade secrets of the Alliance and its suppliers. The software is also\n// protected by copyright law and international treaty provisions. Application\n// programs incorporating this software must include the following statement\n// with their copyright notices:\n//\n// This application incorporates Open Design Alliance software pursuant to a\n// license agreement with Open Design Alliance.\n// Open Design Alliance Copyright (C) 2002-2025 by Open Design Alliance.\n// All rights reserved.\n//\n// By use of this software, its documentation or related materials, you\n// acknowledge and accept the above terms.\n///////////////////////////////////////////////////////////////////////////////\n\nimport { GridHelper, Vector3 } from \"three\";\nimport { IComponent, components, Viewer } from \"@inweb/viewer-three\";\n\nclass GridHelperComponent implements IComponent {\n private viewer: Viewer;\n private gridHelper: GridHelper;\n\n constructor(viewer: Viewer) {\n this.gridHelper = new GridHelper(10, 20, 0x444444, 0xaaaaaa);\n this.viewer = viewer;\n this.viewer.on(\"initialize\", this.syncHelper);\n this.viewer.on(\"geometryend\", this.syncHelper);\n this.viewer.on(\"clear\", this.syncHelper);\n }\n\n dispose() {\n this.gridHelper.removeFromParent();\n this.gridHelper.dispose();\n\n this.viewer.off(\"initialize\", this.syncHelper);\n this.viewer.off(\"geometryend\", this.syncHelper);\n this.viewer.off(\"clear\", this.syncHelper);\n }\n\n syncHelper = () => {\n this.gridHelper.removeFromParent();\n\n if (this.viewer.extents.isEmpty()) return;\n\n const size = this.viewer.extents.getSize(new Vector3()).multiply(this.viewer.camera.up).length();\n const center = this.viewer.extents.getCenter(new Vector3());\n\n const upY = new Vector3(0, 1, 0);\n const up = new Vector3().copy(this.viewer.camera.up);\n\n this.gridHelper.scale.setScalar(size);\n this.gridHelper.position.copy(center);\n this.gridHelper.quaternion.setFromUnitVectors(upY, up);\n\n this.viewer.helpers.add(this.gridHelper);\n };\n}\n\ncomponents.registerComponent(\"GridHelperComponent\", (viewer) => new GridHelperComponent(viewer));\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AA0BA,MAAM,mBAAmB,CAAA;AAIvB,IAAA,WAAA,CAAY,MAAc,EAAA;QAiB1B,IAAA,CAAA,UAAU,GAAG,MAAK;AAChB,YAAA,IAAI,CAAC,UAAU,CAAC,gBAAgB,EAAE;AAElC,YAAA,IAAI,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,OAAO,EAAE;gBAAE;AAEnC,YAAA,MAAM,IAAI,GAAG,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,IAAI,OAAO,EAAE,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,MAAM,EAAE;AAChG,YAAA,MAAM,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,IAAI,OAAO,EAAE,CAAC;YAE3D,MAAM,GAAG,GAAG,IAAI,OAAO,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC;AAChC,YAAA,MAAM,EAAE,GAAG,IAAI,OAAO,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC;YAEpD,IAAI,CAAC,UAAU,CAAC,KAAK,CAAC,SAAS,CAAC,IAAI,CAAC;YACrC,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC;YACrC,IAAI,CAAC,UAAU,CAAC,UAAU,CAAC,kBAAkB,CAAC,GAAG,EAAE,EAAE,CAAC;YAEtD,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,UAAU,CAAC;AAC1C,QAAA,CAAC;AAhCC,QAAA,IAAI,CAAC,UAAU,GAAG,IAAI,UAAU,CAAC,EAAE,EAAE,EAAE,EAAE,QAAQ,EAAE,QAAQ,CAAC;AAC5D,QAAA,IAAI,CAAC,MAAM,GAAG,MAAM;QACpB,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC,YAAY,EAAE,IAAI,CAAC,UAAU,CAAC;QAC7C,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC,aAAa,EAAE,IAAI,CAAC,UAAU,CAAC;QAC9C,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC,OAAO,EAAE,IAAI,CAAC,UAAU,CAAC;IAC1C;IAEA,OAAO,GAAA;AACL,QAAA,IAAI,CAAC,UAAU,CAAC,gBAAgB,EAAE;AAClC,QAAA,IAAI,CAAC,UAAU,CAAC,OAAO,EAAE;QAEzB,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,YAAY,EAAE,IAAI,CAAC,UAAU,CAAC;QAC9C,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,aAAa,EAAE,IAAI,CAAC,UAAU,CAAC;QAC/C,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,OAAO,EAAE,IAAI,CAAC,UAAU,CAAC;IAC3C;AAmBD;AAED,UAAU,CAAC,iBAAiB,CAAC,qBAAqB,EAAE,CAAC,MAAM,KAAK,IAAI,mBAAmB,CAAC,MAAM,CAAC,CAAC"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"LightHelperComponent.js","sources":["../../../extensions/components/LightHelperComponent.ts"],"sourcesContent":["///////////////////////////////////////////////////////////////////////////////\n// Copyright (C) 2002-2025, Open Design Alliance (the \"Alliance\").\n// All rights reserved.\n//\n// This software and its documentation and related materials are owned by\n// the Alliance. The software may only be incorporated into application\n// programs owned by members of the Alliance, subject to a signed\n// Membership Agreement and Supplemental Software License Agreement with the\n// Alliance. The structure and organization of this software are the valuable\n// trade secrets of the Alliance and its suppliers. The software is also\n// protected by copyright law and international treaty provisions. Application\n// programs incorporating this software must include the following statement\n// with their copyright notices:\n//\n// This application incorporates Open Design Alliance software pursuant to a\n// license agreement with Open Design Alliance.\n// Open Design Alliance Copyright (C) 2002-2025 by Open Design Alliance.\n// All rights reserved.\n//\n// By use of this software, its documentation or related materials, you\n// acknowledge and accept the above terms.\n///////////////////////////////////////////////////////////////////////////////\n\nimport { DirectionalLightHelper, HemisphereLightHelper, PointLightHelper, Sphere } from \"three\";\nimport { IComponent, components, Viewer } from \"@inweb/viewer-three\";\n\nclass LightHelperComponent implements IComponent {\n private viewer: Viewer;\n private lightHelpers: (DirectionalLightHelper | HemisphereLightHelper | PointLightHelper)[];\n\n constructor(viewer: Viewer) {\n this.lightHelpers = [];\n this.viewer = viewer;\n this.viewer.addEventListener(\"geometryend\", this.syncHelper);\n this.viewer.addEventListener(\"clear\", this.syncHelper);\n }\n\n dispose() {\n this.lightHelpers.forEach((helper) => {\n helper.removeFromParent();\n helper.dispose();\n });\n this.lightHelpers.length = 0;\n\n this.viewer.removeEventListener(\"geometryend\", this.syncHelper);\n this.viewer.removeEventListener(\"clear\", this.syncHelper);\n }\n\n syncHelper = () => {\n this.lightHelpers.forEach((helper) => {\n helper.removeFromParent();\n helper.dispose();\n });\n this.lightHelpers.length = 0;\n\n const extentsSize = this.viewer.extents.getBoundingSphere(new Sphere()).radius * 2;\n const size = extentsSize / 20;\n\n this.viewer.scene.traverse((object: any) => {\n let helper: DirectionalLightHelper | HemisphereLightHelper | PointLightHelper;\n\n if (object.isDirectionalLight) helper = new DirectionalLightHelper(object, size, \"#aa0000\");\n else if (object.isHemisphereLight) helper = new HemisphereLightHelper(object, size, \"#ff9800\");\n else if (object.isPointLight) helper = new PointLightHelper(object, size, \"#ff9800\");\n\n if (helper) {\n this.lightHelpers.push(helper);\n this.viewer.helpers.add(helper);\n }\n });\n };\n}\n\ncomponents.registerComponent(\"LightHelperComponent\", (viewer) => new LightHelperComponent(viewer));\n"],"names":["Sphere","DirectionalLightHelper","HemisphereLightHelper","PointLightHelper","components"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;IA0BA,MAAM,oBAAoB,CAAA;IAIxB,IAAA,WAAA,CAAY,MAAc,EAAA;YAkB1B,IAAA,CAAA,UAAU,GAAG,MAAK;gBAChB,IAAI,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC,MAAM,KAAI;oBACnC,MAAM,CAAC,gBAAgB,EAAE;oBACzB,MAAM,CAAC,OAAO,EAAE;IAClB,YAAA,CAAC,CAAC;IACF,YAAA,IAAI,CAAC,YAAY,CAAC,MAAM,GAAG,CAAC;IAE5B,YAAA,MAAM,WAAW,GAAG,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,iBAAiB,CAAC,IAAIA,YAAM,EAAE,CAAC,CAAC,MAAM,GAAG,CAAC;IAClF,YAAA,MAAM,IAAI,GAAG,WAAW,GAAG,EAAE;gBAE7B,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,MAAW,KAAI;IACzC,gBAAA,IAAI,MAAyE;oBAE7E,IAAI,MAAM,CAAC,kBAAkB;wBAAE,MAAM,GAAG,IAAIC,4BAAsB,CAAC,MAAM,EAAE,IAAI,EAAE,SAAS,CAAC;yBACtF,IAAI,MAAM,CAAC,iBAAiB;wBAAE,MAAM,GAAG,IAAIC,2BAAqB,CAAC,MAAM,EAAE,IAAI,EAAE,SAAS,CAAC;yBACzF,IAAI,MAAM,CAAC,YAAY;wBAAE,MAAM,GAAG,IAAIC,sBAAgB,CAAC,MAAM,EAAE,IAAI,EAAE,SAAS,CAAC;oBAEpF,IAAI,MAAM,EAAE;IACV,oBAAA,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,MAAM,CAAC;wBAC9B,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC;oBACjC;IACF,YAAA,CAAC,CAAC;IACJ,QAAA,CAAC;IAvCC,QAAA,IAAI,CAAC,YAAY,GAAG,EAAE;IACtB,QAAA,IAAI,CAAC,MAAM,GAAG,MAAM;YACpB,IAAI,CAAC,MAAM,CAAC,gBAAgB,CAAC,aAAa,EAAE,IAAI,CAAC,UAAU,CAAC;YAC5D,IAAI,CAAC,MAAM,CAAC,gBAAgB,CAAC,OAAO,EAAE,IAAI,CAAC,UAAU,CAAC;QACxD;QAEA,OAAO,GAAA;YACL,IAAI,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC,MAAM,KAAI;gBACnC,MAAM,CAAC,gBAAgB,EAAE;gBACzB,MAAM,CAAC,OAAO,EAAE;IAClB,QAAA,CAAC,CAAC;IACF,QAAA,IAAI,CAAC,YAAY,CAAC,MAAM,GAAG,CAAC;YAE5B,IAAI,CAAC,MAAM,CAAC,mBAAmB,CAAC,aAAa,EAAE,IAAI,CAAC,UAAU,CAAC;YAC/D,IAAI,CAAC,MAAM,CAAC,mBAAmB,CAAC,OAAO,EAAE,IAAI,CAAC,UAAU,CAAC;QAC3D;IAyBD;AAEDC,0BAAU,CAAC,iBAAiB,CAAC,sBAAsB,EAAE,CAAC,MAAM,KAAK,IAAI,oBAAoB,CAAC,MAAM,CAAC,CAAC;;;;;;"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"LightHelperComponent.module.js","sources":["../../../extensions/components/LightHelperComponent.ts"],"sourcesContent":["///////////////////////////////////////////////////////////////////////////////\n// Copyright (C) 2002-2025, Open Design Alliance (the \"Alliance\").\n// All rights reserved.\n//\n// This software and its documentation and related materials are owned by\n// the Alliance. The software may only be incorporated into application\n// programs owned by members of the Alliance, subject to a signed\n// Membership Agreement and Supplemental Software License Agreement with the\n// Alliance. The structure and organization of this software are the valuable\n// trade secrets of the Alliance and its suppliers. The software is also\n// protected by copyright law and international treaty provisions. Application\n// programs incorporating this software must include the following statement\n// with their copyright notices:\n//\n// This application incorporates Open Design Alliance software pursuant to a\n// license agreement with Open Design Alliance.\n// Open Design Alliance Copyright (C) 2002-2025 by Open Design Alliance.\n// All rights reserved.\n//\n// By use of this software, its documentation or related materials, you\n// acknowledge and accept the above terms.\n///////////////////////////////////////////////////////////////////////////////\n\nimport { DirectionalLightHelper, HemisphereLightHelper, PointLightHelper, Sphere } from \"three\";\nimport { IComponent, components, Viewer } from \"@inweb/viewer-three\";\n\nclass LightHelperComponent implements IComponent {\n private viewer: Viewer;\n private lightHelpers: (DirectionalLightHelper | HemisphereLightHelper | PointLightHelper)[];\n\n constructor(viewer: Viewer) {\n this.lightHelpers = [];\n this.viewer = viewer;\n this.viewer.addEventListener(\"geometryend\", this.syncHelper);\n this.viewer.addEventListener(\"clear\", this.syncHelper);\n }\n\n dispose() {\n this.lightHelpers.forEach((helper) => {\n helper.removeFromParent();\n helper.dispose();\n });\n this.lightHelpers.length = 0;\n\n this.viewer.removeEventListener(\"geometryend\", this.syncHelper);\n this.viewer.removeEventListener(\"clear\", this.syncHelper);\n }\n\n syncHelper = () => {\n this.lightHelpers.forEach((helper) => {\n helper.removeFromParent();\n helper.dispose();\n });\n this.lightHelpers.length = 0;\n\n const extentsSize = this.viewer.extents.getBoundingSphere(new Sphere()).radius * 2;\n const size = extentsSize / 20;\n\n this.viewer.scene.traverse((object: any) => {\n let helper: DirectionalLightHelper | HemisphereLightHelper | PointLightHelper;\n\n if (object.isDirectionalLight) helper = new DirectionalLightHelper(object, size, \"#aa0000\");\n else if (object.isHemisphereLight) helper = new HemisphereLightHelper(object, size, \"#ff9800\");\n else if (object.isPointLight) helper = new PointLightHelper(object, size, \"#ff9800\");\n\n if (helper) {\n this.lightHelpers.push(helper);\n this.viewer.helpers.add(helper);\n }\n });\n };\n}\n\ncomponents.registerComponent(\"LightHelperComponent\", (viewer) => new LightHelperComponent(viewer));\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AA0BA,MAAM,oBAA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,EAAE,IAAI,CAAC,UAAU,CAAC;QAC5D,IAAI,CAAC,MAAM,CAAC,gBAAgB,CAAC,OAAO,EAAE,IAAI,CAAC,UAAU,CAAC;IACxD;IAEA,OAAO,GAAA;QACL,IAAI,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC,MAAM,KAAI;YACnC,MAAM,CAAC,gBAAgB,EAAE;YACzB,MAAM,CAAC,OAAO,EAAE;AAClB,QAAA,CAAC,CAAC;AACF,QAAA,IAAI,CAAC,YAAY,CAAC,MAAM,GAAG,CAAC;QAE5B,IAAI,CAAC,MAAM,CAAC,mBAAmB,CAAC,aAAa,EAAE,IAAI,CAAC,UAAU,CAAC;QAC/D,IAAI,CAAC,MAAM,CAAC,mBAAmB,CAAC,OAAO,EAAE,IAAI,CAAC,UAAU,CAAC;IAC3D;AAyBD;AAED,UAAU,CAAC,iBAAiB,CAAC,sBAAsB,EAAE,CAAC,MAAM,KAAK,IAAI,oBAAoB,CAAC,MAAM,CAAC,CAAC"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"RoomEnvironmentComponent.js","sources":["../../../../../node_modules/three/examples/jsm/environments/RoomEnvironment.js","../../../extensions/components/RoomEnvironmentComponent.ts"],"sourcesContent":["import {\n \tBackSide,\n \tBoxGeometry,\n \tInstancedMesh,\n \tMesh,\n\tMeshLambertMaterial,\n \tMeshStandardMaterial,\n \tPointLight,\n \tScene,\n \tObject3D,\n} from 'three';\n\n/**\n * This class represents a scene with a basic room setup that can be used as\n * input for {@link PMREMGenerator#fromScene}. The resulting PMREM represents the room's\n * lighting and can be used for Image Based Lighting by assigning it to {@link Scene#environment}\n * or directly as an environment map to PBR materials.\n *\n * The implementation is based on the [EnvironmentScene](https://github.com/google/model-viewer/blob/master/packages/model-viewer/src/three-components/EnvironmentScene.ts)\n * component from the `model-viewer` project.\n *\n * ```js\n * const environment = new RoomEnvironment();\n * const pmremGenerator = new THREE.PMREMGenerator( renderer );\n *\n * const envMap = pmremGenerator.fromScene( environment ).texture;\n * scene.environment = envMap;\n * ```\n *\n * @augments Scene\n * @three_import import { RoomEnvironment } from 'three/addons/environments/RoomEnvironment.js';\n */\nclass RoomEnvironment extends Scene {\n\n\tconstructor() {\n\n\t\tsuper();\n\n\t\tconst geometry = new BoxGeometry();\n\t\tgeometry.deleteAttribute( 'uv' );\n\n\t\tconst roomMaterial = new MeshStandardMaterial( { side: BackSide } );\n\t\tconst boxMaterial = new MeshStandardMaterial();\n\n\t\tconst mainLight = new PointLight( 0xffffff, 900, 28, 2 );\n\t\tmainLight.position.set( 0.418, 16.199, 0.300 );\n\t\tthis.add( mainLight );\n\n\t\tconst room = new Mesh( geometry, roomMaterial );\n\t\troom.position.set( - 0.757, 13.219, 0.717 );\n\t\troom.scale.set( 31.713, 28.305, 28.591 );\n\t\tthis.add( room );\n\n\t\tconst boxes = new InstancedMesh( geometry, boxMaterial, 6 );\n\t\tconst transform = new Object3D();\n\n\t\t// box1\n\t\ttransform.position.set( - 10.906, 2.009, 1.846 );\n\t\ttransform.rotation.set( 0, - 0.195, 0 );\n\t\ttransform.scale.set( 2.328, 7.905, 4.651 );\n\t\ttransform.updateMatrix();\n\t\tboxes.setMatrixAt( 0, transform.matrix );\n\n\t\t// box2\n\t\ttransform.position.set( - 5.607, - 0.754, - 0.758 );\n\t\ttransform.rotation.set( 0, 0.994, 0 );\n\t\ttransform.scale.set( 1.970, 1.534, 3.955 );\n\t\ttransform.updateMatrix();\n\t\tboxes.setMatrixAt( 1, transform.matrix );\n\n\t\t// box3\n\t\ttransform.position.set( 6.167, 0.857, 7.803 );\n\t\ttransform.rotation.set( 0, 0.561, 0 );\n\t\ttransform.scale.set( 3.927, 6.285, 3.687 );\n\t\ttransform.updateMatrix();\n\t\tboxes.setMatrixAt( 2, transform.matrix );\n\n\t\t// box4\n\t\ttransform.position.set( - 2.017, 0.018, 6.124 );\n\t\ttransform.rotation.set( 0, 0.333, 0 );\n\t\ttransform.scale.set( 2.002, 4.566, 2.064 );\n\t\ttransform.updateMatrix();\n\t\tboxes.setMatrixAt( 3, transform.matrix );\n\n\t\t// box5\n\t\ttransform.position.set( 2.291, - 0.756, - 2.621 );\n\t\ttransform.rotation.set( 0, - 0.286, 0 );\n\t\ttransform.scale.set( 1.546, 1.552, 1.496 );\n\t\ttransform.updateMatrix();\n\t\tboxes.setMatrixAt( 4, transform.matrix );\n\n\t\t// box6\n\t\ttransform.position.set( - 2.193, - 0.369, - 5.547 );\n\t\ttransform.rotation.set( 0, 0.516, 0 );\n\t\ttransform.scale.set( 3.875, 3.487, 2.986 );\n\t\ttransform.updateMatrix();\n\t\tboxes.setMatrixAt( 5, transform.matrix );\n\n\t\tthis.add( boxes );\n\n\n\t\t// -x right\n\t\tconst light1 = new Mesh( geometry, createAreaLightMaterial( 50 ) );\n\t\tlight1.position.set( - 16.116, 14.37, 8.208 );\n\t\tlight1.scale.set( 0.1, 2.428, 2.739 );\n\t\tthis.add( light1 );\n\n\t\t// -x left\n\t\tconst light2 = new Mesh( geometry, createAreaLightMaterial( 50 ) );\n\t\tlight2.position.set( - 16.109, 18.021, - 8.207 );\n\t\tlight2.scale.set( 0.1, 2.425, 2.751 );\n\t\tthis.add( light2 );\n\n\t\t// +x\n\t\tconst light3 = new Mesh( geometry, createAreaLightMaterial( 17 ) );\n\t\tlight3.position.set( 14.904, 12.198, - 1.832 );\n\t\tlight3.scale.set( 0.15, 4.265, 6.331 );\n\t\tthis.add( light3 );\n\n\t\t// +z\n\t\tconst light4 = new Mesh( geometry, createAreaLightMaterial( 43 ) );\n\t\tlight4.position.set( - 0.462, 8.89, 14.520 );\n\t\tlight4.scale.set( 4.38, 5.441, 0.088 );\n\t\tthis.add( light4 );\n\n\t\t// -z\n\t\tconst light5 = new Mesh( geometry, createAreaLightMaterial( 20 ) );\n\t\tlight5.position.set( 3.235, 11.486, - 12.541 );\n\t\tlight5.scale.set( 2.5, 2.0, 0.1 );\n\t\tthis.add( light5 );\n\n\t\t// +y\n\t\tconst light6 = new Mesh( geometry, createAreaLightMaterial( 100 ) );\n\t\tlight6.position.set( 0.0, 20.0, 0.0 );\n\t\tlight6.scale.set( 1.0, 0.1, 1.0 );\n\t\tthis.add( light6 );\n\n\t}\n\n\t/**\n\t * Frees internal resources. This method should be called\n\t * when the environment is no longer required.\n\t */\n\tdispose() {\n\n\t\tconst resources = new Set();\n\n\t\tthis.traverse( ( object ) => {\n\n\t\t\tif ( object.isMesh ) {\n\n\t\t\t\tresources.add( object.geometry );\n\t\t\t\tresources.add( object.material );\n\n\t\t\t}\n\n\t\t} );\n\n\t\tfor ( const resource of resources ) {\n\n\t\t\tresource.dispose();\n\n\t\t}\n\n\t}\n\n}\n\nfunction createAreaLightMaterial( intensity ) {\n\n\t// create an emissive-only material. see #31348\n\tconst material = new MeshLambertMaterial( {\n\t\tcolor: 0x000000,\n\t\temissive: 0xffffff,\n\t\temissiveIntensity: intensity\n\t} );\n\n\treturn material;\n\n}\n\nexport { RoomEnvironment };\n","///////////////////////////////////////////////////////////////////////////////\n// Copyright (C) 2002-2025, Open Design Alliance (the \"Alliance\").\n// All rights reserved.\n//\n// This software and its documentation and related materials are owned by\n// the Alliance. The software may only be incorporated into application\n// programs owned by members of the Alliance, subject to a signed\n// Membership Agreement and Supplemental Software License Agreement with the\n// Alliance. The structure and organization of this software are the valuable\n// trade secrets of the Alliance and its suppliers. The software is also\n// protected by copyright law and international treaty provisions. Application\n// programs incorporating this software must include the following statement\n// with their copyright notices:\n//\n// This application incorporates Open Design Alliance software pursuant to a\n// license agreement with Open Design Alliance.\n// Open Design Alliance Copyright (C) 2002-2025 by Open Design Alliance.\n// All rights reserved.\n//\n// By use of this software, its documentation or related materials, you\n// acknowledge and accept the above terms.\n///////////////////////////////////////////////////////////////////////////////\n\nimport { PMREMGenerator } from \"three\";\nimport { RoomEnvironment } from \"three/examples/jsm/environments/RoomEnvironment.js\";\nimport { IComponent, components, Viewer } from \"@inweb/viewer-three\";\n\nclass RoomEnvironmentComponent implements IComponent {\n protected viewer: Viewer;\n\n constructor(viewer: Viewer) {\n this.viewer = viewer;\n\n const environment = new RoomEnvironment();\n const pmremGenerator = new PMREMGenerator(this.viewer.renderer);\n\n this.viewer.scene.environment = pmremGenerator.fromScene(environment).texture;\n\n environment.dispose();\n }\n\n dispose() {\n this.viewer.scene.environment = undefined;\n }\n}\n\ncomponents.registerComponent(\"LightComponent\", (viewer) => new RoomEnvironmentComponent(viewer));\n"],"names":["Scene","BoxGeometry","MeshStandardMaterial","BackSide","PointLight","Mesh","InstancedMesh","Object3D","MeshLambertMaterial","PMREMGenerator","components"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAgCA,MAAM,eAAe,SAASA,WAAK,CAAC;CAEpC,CAAC,WAAW,GAAG;CAEf,EAAE,KAAK,EAAE;CAET,EAAE,MAAM,QAAQ,GAAG,IAAIC,iBAAW,EAAE;CACpC,EAAE,QAAQ,CAAC,eAAe,EAAE,IAAI,EAAE;CAElC,EAAE,MAAM,YAAY,GAAG,IAAIC,0BAAoB,EAAE,EAAE,IAAI,EAAEC,cAAQ,EAAE,EAAE;CACrE,EAAE,MAAM,WAAW,GAAG,IAAID,0BAAoB,EAAE;CAEhD,EAAE,MAAM,SAAS,GAAG,IAAIE,gBAAU,EAAE,QAAQ,EAAE,GAAG,EAAE,EAAE,EAAE,CAAC,EAAE;CAC1D,EAAE,SAAS,CAAC,QAAQ,CAAC,GAAG,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE;CAChD,EAAE,IAAI,CAAC,GAAG,EAAE,SAAS,EAAE;CAEvB,EAAE,MAAM,IAAI,GAAG,IAAIC,UAAI,EAAE,QAAQ,EAAE,YAAY,EAAE;CACjD,EAAE,IAAI,CAAC,QAAQ,CAAC,GAAG,EAAE,MAAO,EAAE,MAAM,EAAE,KAAK,EAAE;CAC7C,EAAE,IAAI,CAAC,KAAK,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE;CAC1C,EAAE,IAAI,CAAC,GAAG,EAAE,IAAI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,EAAE;CACrB,EAAE,EAAE;CAEJ,CAAC,OAAO,QAAQ;CAEhB;;CCxJA,MAAM,wBAAwB,CAAA;CAG5B,IAAA,WAAA,CAAY,MAAc,EAAA;CACxB,QAAA,IAAI,CAAC,MAAM,GAAG,MAAM;CAEpB,QAAA,MAAM,WAAW,GAAG,IAAI,eAAe,EAAE;SACzC,MAAM,cAAc,GAAG,IAAIC,oBAAc,CAAC,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC;CAE/D,QAAA,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,WAAW,GAAG,cAAc,CAAC,SAAS,CAAC,WAAW,CAAC,CAAC,OAAO;SAE7E,WAAW,CAAC,OAAO,EAAE;KACvB;KAEA,OAAO,GAAA;SACL,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,WAAW,GAAG,SAAS;KAC3C;CACD;AAEDC,uBAAU,CAAC,iBAAiB,CAAC,gBAAgB,EAAE,CAAC,MAAM,KAAK,IAAI,wBAAwB,CAAC,MAAM,CAAC,CAAC;;;;;;","x_google_ignoreList":[0]}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"RoomEnvironmentComponent.module.js","sources":["../../../extensions/components/RoomEnvironmentComponent.ts"],"sourcesContent":["///////////////////////////////////////////////////////////////////////////////\n// Copyright (C) 2002-2025, Open Design Alliance (the \"Alliance\").\n// All rights reserved.\n//\n// This software and its documentation and related materials are owned by\n// the Alliance. The software may only be incorporated into application\n// programs owned by members of the Alliance, subject to a signed\n// Membership Agreement and Supplemental Software License Agreement with the\n// Alliance. The structure and organization of this software are the valuable\n// trade secrets of the Alliance and its suppliers. The software is also\n// protected by copyright law and international treaty provisions. Application\n// programs incorporating this software must include the following statement\n// with their copyright notices:\n//\n// This application incorporates Open Design Alliance software pursuant to a\n// license agreement with Open Design Alliance.\n// Open Design Alliance Copyright (C) 2002-2025 by Open Design Alliance.\n// All rights reserved.\n//\n// By use of this software, its documentation or related materials, you\n// acknowledge and accept the above terms.\n///////////////////////////////////////////////////////////////////////////////\n\nimport { PMREMGenerator } from \"three\";\nimport { RoomEnvironment } from \"three/examples/jsm/environments/RoomEnvironment.js\";\nimport { IComponent, components, Viewer } from \"@inweb/viewer-three\";\n\nclass RoomEnvironmentComponent implements IComponent {\n protected viewer: Viewer;\n\n constructor(viewer: Viewer) {\n this.viewer = viewer;\n\n const environment = new RoomEnvironment();\n const pmremGenerator = new PMREMGenerator(this.viewer.renderer);\n\n this.viewer.scene.environment = pmremGenerator.fromScene(environment).texture;\n\n environment.dispose();\n }\n\n dispose() {\n this.viewer.scene.environment = undefined;\n }\n}\n\ncomponents.registerComponent(\"LightComponent\", (viewer) => new RoomEnvironmentComponent(viewer));\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AA2BA,MAAM,wBAAwB,CAAA;AAG5B,IAAA,WAAA,CAAY,MAAc,EAAA;AACxB,QAAA,IAAI,CAAC,MAAM,GAAG,MAAM;AAEpB,QAAA,MAAM,WAAW,GAAG,IAAI,eAAe,EAAE;QACzC,MAAM,cAAc,GAAG,IAAI,cAAc,CAAC,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC;AAE/D,QAAA,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,WAAW,GAAG,cAAc,CAAC,SAAS,CAAC,WAAW,CAAC,CAAC,OAAO;QAE7E,WAAW,CAAC,OAAO,EAAE;IACvB;IAEA,OAAO,GAAA;QACL,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,WAAW,GAAG,SAAS;IAC3C;AACD;AAED,UAAU,CAAC,iBAAiB,CAAC,gBAAgB,EAAE,CAAC,MAAM,KAAK,IAAI,wBAAwB,CAAC,MAAM,CAAC,CAAC"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"StatsPanelComponent.js","sources":["../../../../../node_modules/three/examples/jsm/libs/stats.module.js","../../../extensions/components/StatsPanelComponent.ts"],"sourcesContent":["var Stats = function () {\n\n\tvar mode = 0;\n\n\tvar container = document.createElement( 'div' );\n\tcontainer.style.cssText = 'position:fixed;top:0;left:0;cursor:pointer;opacity:0.9;z-index:10000';\n\tcontainer.addEventListener( 'click', function ( event ) {\n\n\t\tevent.preventDefault();\n\t\tshowPanel( ++ mode % container.children.length );\n\n\t}, false );\n\n\t//\n\n\tfunction addPanel( panel ) {\n\n\t\tcontainer.appendChild( panel.dom );\n\t\treturn panel;\n\n\t}\n\n\tfunction showPanel( id ) {\n\n\t\tfor ( var i = 0; i < container.children.length; i ++ ) {\n\n\t\t\tcontainer.children[ i ].style.display = i === id ? 'block' : 'none';\n\n\t\t}\n\n\t\tmode = id;\n\n\t}\n\n\t//\n\n\tvar beginTime = ( performance || Date ).now(), prevTime = beginTime, frames = 0;\n\n\tvar fpsPanel = addPanel( new Stats.Panel( 'FPS', '#0ff', '#002' ) );\n\tvar msPanel = addPanel( new Stats.Panel( 'MS', '#0f0', '#020' ) );\n\n\tif ( self.performance && self.performance.memory ) {\n\n\t\tvar memPanel = addPanel( new Stats.Panel( 'MB', '#f08', '#201' ) );\n\n\t}\n\n\tshowPanel( 0 );\n\n\treturn {\n\n\t\tREVISION: 16,\n\n\t\tdom: container,\n\n\t\taddPanel: addPanel,\n\t\tshowPanel: showPanel,\n\n\t\tbegin: function () {\n\n\t\t\tbeginTime = ( performance || Date ).now();\n\n\t\t},\n\n\t\tend: function () {\n\n\t\t\tframes ++;\n\n\t\t\tvar time = ( performance || Date ).now();\n\n\t\t\tmsPanel.update( time - beginTime, 200 );\n\n\t\t\tif ( time >= prevTime + 1000 ) {\n\n\t\t\t\tfpsPanel.update( ( frames * 1000 ) / ( time - prevTime ), 100 );\n\n\t\t\t\tprevTime = time;\n\t\t\t\tframes = 0;\n\n\t\t\t\tif ( memPanel ) {\n\n\t\t\t\t\tvar memory = performance.memory;\n\t\t\t\t\tmemPanel.update( memory.usedJSHeapSize / 1048576, memory.jsHeapSizeLimit / 1048576 );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\treturn time;\n\n\t\t},\n\n\t\tupdate: function () {\n\n\t\t\tbeginTime = this.end();\n\n\t\t},\n\n\t\t// Backwards Compatibility\n\n\t\tdomElement: container,\n\t\tsetMode: showPanel\n\n\t};\n\n};\n\nStats.Panel = function ( name, fg, bg ) {\n\n\tvar min = Infinity, max = 0, round = Math.round;\n\tvar PR = round( window.devicePixelRatio || 1 );\n\n\tvar WIDTH = 80 * PR, HEIGHT = 48 * PR,\n\t\tTEXT_X = 3 * PR, TEXT_Y = 2 * PR,\n\t\tGRAPH_X = 3 * PR, GRAPH_Y = 15 * PR,\n\t\tGRAPH_WIDTH = 74 * PR, GRAPH_HEIGHT = 30 * PR;\n\n\tvar canvas = document.createElement( 'canvas' );\n\tcanvas.width = WIDTH;\n\tcanvas.height = HEIGHT;\n\tcanvas.style.cssText = 'width:80px;height:48px';\n\n\tvar context = canvas.getContext( '2d' );\n\tcontext.font = 'bold ' + ( 9 * PR ) + 'px Helvetica,Arial,sans-serif';\n\tcontext.textBaseline = 'top';\n\n\tcontext.fillStyle = bg;\n\tcontext.fillRect( 0, 0, WIDTH, HEIGHT );\n\n\tcontext.fillStyle = fg;\n\tcontext.fillText( name, TEXT_X, TEXT_Y );\n\tcontext.fillRect( GRAPH_X, GRAPH_Y, GRAPH_WIDTH, GRAPH_HEIGHT );\n\n\tcontext.fillStyle = bg;\n\tcontext.globalAlpha = 0.9;\n\tcontext.fillRect( GRAPH_X, GRAPH_Y, GRAPH_WIDTH, GRAPH_HEIGHT );\n\n\treturn {\n\n\t\tdom: canvas,\n\n\t\tupdate: function ( value, maxValue ) {\n\n\t\t\tmin = Math.min( min, value );\n\t\t\tmax = Math.max( max, value );\n\n\t\t\tcontext.fillStyle = bg;\n\t\t\tcontext.globalAlpha = 1;\n\t\t\tcontext.fillRect( 0, 0, WIDTH, GRAPH_Y );\n\t\t\tcontext.fillStyle = fg;\n\t\t\tcontext.fillText( round( value ) + ' ' + name + ' (' + round( min ) + '-' + round( max ) + ')', TEXT_X, TEXT_Y );\n\n\t\t\tcontext.drawImage( canvas, GRAPH_X + PR, GRAPH_Y, GRAPH_WIDTH - PR, GRAPH_HEIGHT, GRAPH_X, GRAPH_Y, GRAPH_WIDTH - PR, GRAPH_HEIGHT );\n\n\t\t\tcontext.fillRect( GRAPH_X + GRAPH_WIDTH - PR, GRAPH_Y, PR, GRAPH_HEIGHT );\n\n\t\t\tcontext.fillStyle = bg;\n\t\t\tcontext.globalAlpha = 0.9;\n\t\t\tcontext.fillRect( GRAPH_X + GRAPH_WIDTH - PR, GRAPH_Y, PR, round( ( 1 - ( value / maxValue ) ) * GRAPH_HEIGHT ) );\n\n\t\t}\n\n\t};\n\n};\n\nexport default Stats;\n","///////////////////////////////////////////////////////////////////////////////\n// Copyright (C) 2002-2025, Open Design Alliance (the \"Alliance\").\n// All rights reserved.\n//\n// This software and its documentation and related materials are owned by\n// the Alliance. The software may only be incorporated into application\n// programs owned by members of the Alliance, subject to a signed\n// Membership Agreement and Supplemental Software License Agreement with the\n// Alliance. The structure and organization of this software are the valuable\n// trade secrets of the Alliance and its suppliers. The software is also\n// protected by copyright law and international treaty provisions. Application\n// programs incorporating this software must include the following statement\n// with their copyright notices:\n//\n// This application incorporates Open Design Alliance software pursuant to a\n// license agreement with Open Design Alliance.\n// Open Design Alliance Copyright (C) 2002-2025 by Open Design Alliance.\n// All rights reserved.\n//\n// By use of this software, its documentation or related materials, you\n// acknowledge and accept the above terms.\n///////////////////////////////////////////////////////////////////////////////\n\nimport Stats from \"three/examples/jsm/libs/stats.module.js\";\nimport { IComponent, components, Viewer } from \"@inweb/viewer-three\";\n\nclass StatsPanelComponent implements IComponent {\n protected viewer: Viewer;\n protected stats: Stats;\n\n constructor(viewer: Viewer) {\n this.stats = new Stats();\n this.stats.dom.style.position = \"absolute\";\n viewer.canvas.parentElement.appendChild(this.stats.dom);\n\n this.viewer = viewer;\n this.viewer.on(\"animate\", this.updateStats);\n }\n\n dispose() {\n this.viewer.off(\"animate\", this.updateStats);\n\n this.stats.dom.remove();\n this.stats = undefined;\n }\n\n updateStats = () => {\n this.viewer.render(null, true);\n this.stats.update();\n };\n}\n\ncomponents.registerComponent(\"StatsPanelComponent\", (viewer) => new StatsPanelComponent(viewer));\n"],"names":["components"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAAA,IAAI,KAAK,GAAG,YAAY;CAExB,CAAC,IAAI,IAAI,GAAG,CAAC;CAEb,CAAC,IAAI,SAAS,GAAG,QAAQ,CAAC,aAAa,EAAE,KAAK,EAAE;CAChD,CAAC,SAAS,CAAC,KAAK,CAAC,OAAO,GAAG,sEAAsE;CACjG,CAAC,SAAS,CAAC,gBAAgB,EAAE,OAAO,EAAE,WAAW,KAAK,GAAG;CAEzD,EAAE,KAAK,CAAC,cAAc,EAAE;CACxB,EAAE,SAAS,EAAE,GAAG,IAAI,GAAG,SAAS,CAAC,QAAQ,CAAC,MAAM,EAAE;CAElD,CAAC,CAAC,EAAE,KAAK,EAAE;CAIX,CAAC,SAAS,QAAQ,EAAE,KAAK,GAAG;CAE5B,EAAE,SAAS,CAAC,WAAW,EAAE,KAAK,CAAC,GAAG,EAAE;CACpC,EAAE,OAAO,KAAK;CAEd,CAAC;CAED,CAAC,SAAS,SAAS,EAAE,EAAE,GAAG;CAE1B,EAAE,MAAM,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,SAAS,CAAC,QAAQ,CAAC,MAAM,EAAE,CAAC,GAAG,GAAG;CAEzD,GAAG,SAAS,CAAC,QAAQ,EAAE,CAAC,EAAE,CAAC,KAAK,CAAC,OAAO,GAAG,CAAC,KAAK,EAAE,GAAG,OAAO,GAAG,MAAM;CAEtE,EAAE;CAEF,EAAE,IAAI,GAAG,EAAE;CAEX,CAAC;CAID,CAAC,IAAI,SAAS,GAAG,EAAE,WAAW,IAAI,IAAI,GAAG,GAAG,EAAE,EAAE,QAAQ,GAAG,SAAS,EAAE,MAAM,GAAG,CAAC;CAEhF,CAAC,IAAI,QAAQ,GAAG,QAAQ,EAAE,IAAI,KAAK,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CAAC,GAAG,CAAC,SAAS,EAAE,IAAI,CAAC,WAAW,CAAC;CAE5C,QAAA,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,MAAM,EAAE;CACvB,QAAA,IAAI,CAAC,KAAK,GAAG,SAAS;KACxB;CAMD;AAEDA,uBAAU,CAAC,iBAAiB,CAAC,qBAAqB,EAAE,CAAC,MAAM,KAAK,IAAI,mBAAmB,CAAC,MAAM,CAAC,CAAC;;;;;;","x_google_ignoreList":[0]}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"StatsPanelComponent.module.js","sources":["../../../extensions/components/StatsPanelComponent.ts"],"sourcesContent":["///////////////////////////////////////////////////////////////////////////////\n// Copyright (C) 2002-2025, Open Design Alliance (the \"Alliance\").\n// All rights reserved.\n//\n// This software and its documentation and related materials are owned by\n// the Alliance. The software may only be incorporated into application\n// programs owned by members of the Alliance, subject to a signed\n// Membership Agreement and Supplemental Software License Agreement with the\n// Alliance. The structure and organization of this software are the valuable\n// trade secrets of the Alliance and its suppliers. The software is also\n// protected by copyright law and international treaty provisions. Application\n// programs incorporating this software must include the following statement\n// with their copyright notices:\n//\n// This application incorporates Open Design Alliance software pursuant to a\n// license agreement with Open Design Alliance.\n// Open Design Alliance Copyright (C) 2002-2025 by Open Design Alliance.\n// All rights reserved.\n//\n// By use of this software, its documentation or related materials, you\n// acknowledge and accept the above terms.\n///////////////////////////////////////////////////////////////////////////////\n\nimport Stats from \"three/examples/jsm/libs/stats.module.js\";\nimport { IComponent, components, Viewer } from \"@inweb/viewer-three\";\n\nclass StatsPanelComponent implements IComponent {\n protected viewer: Viewer;\n protected stats: Stats;\n\n constructor(viewer: Viewer) {\n this.stats = new Stats();\n this.stats.dom.style.position = \"absolute\";\n viewer.canvas.parentElement.appendChild(this.stats.dom);\n\n this.viewer = viewer;\n this.viewer.on(\"animate\", this.updateStats);\n }\n\n dispose() {\n this.viewer.off(\"animate\", this.updateStats);\n\n this.stats.dom.remove();\n this.stats = undefined;\n }\n\n updateStats = () => {\n this.viewer.render(null, true);\n this.stats.update();\n };\n}\n\ncomponents.registerComponent(\"StatsPanelComponent\", (viewer) => new StatsPanelComponent(viewer));\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AA0BA,MAAM,mBAAmB,CAAA;AAIvB,IAAA,WAAA,CAAY,MAAc,EAAA;QAgB1B,IAAA,CAAA,WAAW,GAAG,MAAK;YACjB,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,IAAI,CAAC;AAC9B,YAAA,IAAI,CAAC,KAAK,CAAC,MAAM,EAAE;AACrB,QAAA,CAAC;AAlBC,QAAA,IAAI,CAAC,KAAK,GAAG,IAAI,KAAK,EAAE;QACxB,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,KAAK,CAAC,QAAQ,GAAG,UAAU;AAC1C,QAAA,MAAM,CAAC,MAAM,CAAC,aAAa,CAAC,WAAW,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC;AAEvD,QAAA,IAAI,CAAC,MAAM,GAAG,MAAM;QACpB,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC,SAAS,EAAE,IAAI,CAAC,WAAW,CAAC;IAC7C;IAEA,OAAO,GAAA;QACL,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,SAAS,EAAE,IAAI,CAAC,WAAW,CAAC;AAE5C,QAAA,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,MAAM,EAAE;AACvB,QAAA,IAAI,CAAC,KAAK,GAAG,SAAS;IACxB;AAMD;AAED,UAAU,CAAC,iBAAiB,CAAC,qBAAqB,EAAE,CAAC,MAAM,KAAK,IAAI,mBAAmB,CAAC,MAAM,CAAC,CAAC"}
@@ -2472,9 +2472,8 @@
2472
2472
  if (!this.viewer.scene)
2473
2473
  return this;
2474
2474
  const modelImpl = new viewerThree.ModelImpl(gltf.scene);
2475
- modelImpl.loader = this;
2476
- modelImpl.viewer = this.viewer;
2477
- this.viewer.scene.add(modelImpl.scene);
2475
+ modelImpl.id = model.file.id;
2476
+ this.viewer.scene.add(gltf.scene);
2478
2477
  this.viewer.models.push(modelImpl);
2479
2478
  this.viewer.syncOptions();
2480
2479
  this.viewer.syncOverlay();