@inweb/viewer-three 26.11.0 → 26.11.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -7
- package/dist/plugins/components/AxesHelperComponent.js.map +1 -0
- package/dist/plugins/components/AxesHelperComponent.module.js.map +1 -0
- package/dist/plugins/components/ExtentsHelperComponent.js.map +1 -0
- package/dist/plugins/components/ExtentsHelperComponent.module.js.map +1 -0
- package/dist/plugins/components/GridHelperComponent.js.map +1 -0
- package/dist/plugins/components/GridHelperComponent.module.js.map +1 -0
- package/dist/plugins/components/LightHelperComponent.js.map +1 -0
- package/dist/plugins/components/LightHelperComponent.module.js.map +1 -0
- package/dist/plugins/components/RoomEnvironmentComponent.js.map +1 -0
- package/dist/plugins/components/RoomEnvironmentComponent.module.js.map +1 -0
- package/dist/plugins/components/StatsPanelComponent.js.map +1 -0
- package/dist/plugins/components/StatsPanelComponent.module.js.map +1 -0
- package/dist/plugins/loaders/GLTFCloudLoader.js.map +1 -0
- package/dist/plugins/loaders/GLTFCloudLoader.module.js.map +1 -0
- package/dist/{extensions → plugins}/loaders/GLTFFileLoader.js +1 -1
- package/dist/plugins/loaders/GLTFFileLoader.js.map +1 -0
- package/dist/plugins/loaders/GLTFFileLoader.min.js +24 -0
- package/dist/plugins/loaders/GLTFFileLoader.module.js.map +1 -0
- package/dist/plugins/loaders/IFCXLoader.js.map +1 -0
- package/dist/plugins/loaders/IFCXLoader.module.js.map +1 -0
- package/dist/plugins/loaders/PotreeLoader.js.map +1 -0
- package/dist/plugins/loaders/PotreeLoader.module.js.map +1 -0
- package/dist/viewer-three.js +153 -249
- package/dist/viewer-three.js.map +1 -1
- package/dist/viewer-three.min.js +3 -3
- package/dist/viewer-three.module.js +155 -243
- package/dist/viewer-three.module.js.map +1 -1
- package/lib/Viewer/Viewer.d.ts +1 -1
- package/lib/Viewer/components/SelectionComponent.d.ts +3 -1
- package/lib/Viewer/draggers/MeasureLineDragger.d.ts +1 -7
- package/lib/Viewer/models/IModelImpl.d.ts +0 -4
- package/lib/Viewer/models/ModelImpl.d.ts +0 -4
- package/package.json +11 -11
- package/src/Viewer/Viewer.ts +1 -1
- package/src/Viewer/components/SelectionComponent.ts +30 -5
- package/src/Viewer/draggers/MeasureLineDragger.ts +226 -84
- package/src/Viewer/loaders/DynamicGltfLoader/DynamicGltfLoader.js +16 -14
- package/src/Viewer/loaders/DynamicGltfLoader/GltfStructure.js +0 -1
- package/src/Viewer/models/IModelImpl.ts +0 -8
- package/src/Viewer/models/ModelImpl.ts +0 -18
- package/src/index-umd.ts +1 -1
- package/dist/extensions/components/AxesHelperComponent.js.map +0 -1
- package/dist/extensions/components/AxesHelperComponent.module.js.map +0 -1
- package/dist/extensions/components/ExtentsHelperComponent.js.map +0 -1
- package/dist/extensions/components/ExtentsHelperComponent.module.js.map +0 -1
- package/dist/extensions/components/GridHelperComponent.js.map +0 -1
- package/dist/extensions/components/GridHelperComponent.module.js.map +0 -1
- package/dist/extensions/components/LightHelperComponent.js.map +0 -1
- package/dist/extensions/components/LightHelperComponent.module.js.map +0 -1
- package/dist/extensions/components/RoomEnvironmentComponent.js.map +0 -1
- package/dist/extensions/components/RoomEnvironmentComponent.module.js.map +0 -1
- package/dist/extensions/components/StatsPanelComponent.js.map +0 -1
- package/dist/extensions/components/StatsPanelComponent.module.js.map +0 -1
- package/dist/extensions/loaders/GLTFCloudLoader.js.map +0 -1
- package/dist/extensions/loaders/GLTFCloudLoader.module.js.map +0 -1
- package/dist/extensions/loaders/GLTFFileLoader.js.map +0 -1
- package/dist/extensions/loaders/GLTFFileLoader.min.js +0 -24
- package/dist/extensions/loaders/GLTFFileLoader.module.js.map +0 -1
- package/dist/extensions/loaders/IFCXLoader.js.map +0 -1
- package/dist/extensions/loaders/IFCXLoader.module.js.map +0 -1
- package/dist/extensions/loaders/PotreeLoader.js.map +0 -1
- package/dist/extensions/loaders/PotreeLoader.module.js.map +0 -1
- package/lib/Viewer/measurement/Snapper.d.ts +0 -15
- package/lib/Viewer/measurement/UnitConverter.d.ts +0 -63
- package/lib/Viewer/measurement/UnitFormatter.d.ts +0 -4
- package/src/Viewer/measurement/Snapper.ts +0 -208
- package/src/Viewer/measurement/UnitConverter.ts +0 -47
- package/src/Viewer/measurement/UnitFormatter.ts +0 -95
- /package/dist/{extensions → plugins}/components/AxesHelperComponent.js +0 -0
- /package/dist/{extensions → plugins}/components/AxesHelperComponent.min.js +0 -0
- /package/dist/{extensions → plugins}/components/AxesHelperComponent.module.js +0 -0
- /package/dist/{extensions → plugins}/components/ExtentsHelperComponent.js +0 -0
- /package/dist/{extensions → plugins}/components/ExtentsHelperComponent.min.js +0 -0
- /package/dist/{extensions → plugins}/components/ExtentsHelperComponent.module.js +0 -0
- /package/dist/{extensions → plugins}/components/GridHelperComponent.js +0 -0
- /package/dist/{extensions → plugins}/components/GridHelperComponent.min.js +0 -0
- /package/dist/{extensions → plugins}/components/GridHelperComponent.module.js +0 -0
- /package/dist/{extensions → plugins}/components/LightHelperComponent.js +0 -0
- /package/dist/{extensions → plugins}/components/LightHelperComponent.min.js +0 -0
- /package/dist/{extensions → plugins}/components/LightHelperComponent.module.js +0 -0
- /package/dist/{extensions → plugins}/components/RoomEnvironmentComponent.js +0 -0
- /package/dist/{extensions → plugins}/components/RoomEnvironmentComponent.min.js +0 -0
- /package/dist/{extensions → plugins}/components/RoomEnvironmentComponent.module.js +0 -0
- /package/dist/{extensions → plugins}/components/StatsPanelComponent.js +0 -0
- /package/dist/{extensions → plugins}/components/StatsPanelComponent.min.js +0 -0
- /package/dist/{extensions → plugins}/components/StatsPanelComponent.module.js +0 -0
- /package/dist/{extensions → plugins}/loaders/GLTFCloudLoader.js +0 -0
- /package/dist/{extensions → plugins}/loaders/GLTFCloudLoader.min.js +0 -0
- /package/dist/{extensions → plugins}/loaders/GLTFCloudLoader.module.js +0 -0
- /package/dist/{extensions → plugins}/loaders/GLTFFileLoader.module.js +0 -0
- /package/dist/{extensions → plugins}/loaders/IFCXLoader.js +0 -0
- /package/dist/{extensions → plugins}/loaders/IFCXLoader.min.js +0 -0
- /package/dist/{extensions → plugins}/loaders/IFCXLoader.module.js +0 -0
- /package/dist/{extensions → plugins}/loaders/PotreeLoader.js +0 -0
- /package/dist/{extensions → plugins}/loaders/PotreeLoader.min.js +0 -0
- /package/dist/{extensions → plugins}/loaders/PotreeLoader.module.js +0 -0
- /package/{extensions → plugins}/components/AxesHelperComponent.ts +0 -0
- /package/{extensions → plugins}/components/ExtentsHelperComponent.ts +0 -0
- /package/{extensions → plugins}/components/GridHelperComponent.ts +0 -0
- /package/{extensions → plugins}/components/LightHelperComponent.ts +0 -0
- /package/{extensions → plugins}/components/RoomEnvironmentComponent.ts +0 -0
- /package/{extensions → plugins}/components/StatsPanelComponent.ts +0 -0
- /package/{extensions → plugins}/loaders/GLTFCloudLoader.ts +0 -0
- /package/{extensions → plugins}/loaders/GLTFFileLoader.ts +0 -0
- /package/{extensions → plugins}/loaders/IFCX/IFCXCloudLoader.ts +0 -0
- /package/{extensions → plugins}/loaders/IFCX/IFCXFileLoader.ts +0 -0
- /package/{extensions → plugins}/loaders/IFCX/IFCXLoader.ts +0 -0
- /package/{extensions → plugins}/loaders/IFCX/index.ts +0 -0
- /package/{extensions → plugins}/loaders/IFCX/render.js +0 -0
- /package/{extensions → plugins}/loaders/Potree/PotreeFileLoader.ts +0 -0
- /package/{extensions → plugins}/loaders/Potree/PotreeModelImpl.ts +0 -0
- /package/{extensions → plugins}/loaders/Potree/index.ts +0 -0
|
@@ -554,7 +554,6 @@ export class DynamicGltfLoader {
|
|
|
554
554
|
} else if (primitive.mode === GL_CONSTANTS.LINE_LOOP) {
|
|
555
555
|
mesh = new LineLoop(geometry, material);
|
|
556
556
|
}
|
|
557
|
-
|
|
558
557
|
if (node.extras) {
|
|
559
558
|
mesh.userData = { ...mesh.userData, ...node.extras };
|
|
560
559
|
}
|
|
@@ -564,21 +563,17 @@ export class DynamicGltfLoader {
|
|
|
564
563
|
if (primitive.extras) {
|
|
565
564
|
mesh.userData = { ...mesh.userData, ...primitive.extras };
|
|
566
565
|
}
|
|
567
|
-
|
|
568
566
|
if (node.handle) {
|
|
569
567
|
mesh.userData.handle = node.handle;
|
|
570
568
|
} else {
|
|
571
|
-
mesh.userData.handle =
|
|
569
|
+
mesh.userData.handle = `${node.structure.id}${STRUCTURE_ID_SEPARATOR}${mesh.userData.handle}`;
|
|
572
570
|
}
|
|
573
|
-
|
|
574
571
|
if (mesh.material.name === "edges") {
|
|
575
572
|
mesh.userData.isEdge = true;
|
|
576
573
|
} else {
|
|
577
574
|
mesh.userData.isEdge = false;
|
|
578
575
|
}
|
|
579
|
-
|
|
580
576
|
this.registerObjectWithHandle(mesh, mesh.userData.handle);
|
|
581
|
-
|
|
582
577
|
mesh.position.copy(node.position);
|
|
583
578
|
if (!geometry.attributes.normal) {
|
|
584
579
|
geometry.computeVertexNormals();
|
|
@@ -741,17 +736,13 @@ export class DynamicGltfLoader {
|
|
|
741
736
|
});
|
|
742
737
|
}
|
|
743
738
|
|
|
744
|
-
getFullHandle(structureId, originalHandle) {
|
|
745
|
-
return `${structureId}${STRUCTURE_ID_SEPARATOR}${originalHandle}`;
|
|
746
|
-
}
|
|
747
|
-
|
|
748
739
|
async processNodeHierarchy(structure, nodeId, parentGroup) {
|
|
749
740
|
const nodeDef = structure.json.nodes[nodeId];
|
|
750
741
|
let nodeGroup = null;
|
|
751
742
|
|
|
752
743
|
let handle = null;
|
|
753
744
|
if (nodeDef.extras?.handle) {
|
|
754
|
-
handle =
|
|
745
|
+
handle = `${structure.id}${STRUCTURE_ID_SEPARATOR}${nodeDef.extras.handle}`;
|
|
755
746
|
}
|
|
756
747
|
|
|
757
748
|
if (nodeDef.camera !== undefined) {
|
|
@@ -772,7 +763,7 @@ export class DynamicGltfLoader {
|
|
|
772
763
|
if (nodeDef.extras) {
|
|
773
764
|
nodeGroup.userData = { ...nodeDef.extras };
|
|
774
765
|
if (nodeGroup.userData.handle) {
|
|
775
|
-
nodeGroup.userData.handle =
|
|
766
|
+
nodeGroup.userData.handle = `${structure.id}${STRUCTURE_ID_SEPARATOR}${nodeGroup.userData.handle}`;
|
|
776
767
|
}
|
|
777
768
|
}
|
|
778
769
|
|
|
@@ -824,7 +815,7 @@ export class DynamicGltfLoader {
|
|
|
824
815
|
}
|
|
825
816
|
|
|
826
817
|
if (meshDef.extras && meshDef.extras.handle) {
|
|
827
|
-
handle =
|
|
818
|
+
handle = `${structure.id}${STRUCTURE_ID_SEPARATOR}${meshDef.extras.handle}`;
|
|
828
819
|
}
|
|
829
820
|
|
|
830
821
|
this.nodes.set(uniqueNodeId, {
|
|
@@ -838,7 +829,7 @@ export class DynamicGltfLoader {
|
|
|
838
829
|
structure,
|
|
839
830
|
extras: nodeDef.extras,
|
|
840
831
|
geometryExtents,
|
|
841
|
-
handle
|
|
832
|
+
handle,
|
|
842
833
|
});
|
|
843
834
|
}
|
|
844
835
|
|
|
@@ -1526,6 +1517,8 @@ export class DynamicGltfLoader {
|
|
|
1526
1517
|
|
|
1527
1518
|
for (const mesh of group.objects) {
|
|
1528
1519
|
const geometry = mesh.geometry.clone();
|
|
1520
|
+
mesh.updateWorldMatrix(true, false);
|
|
1521
|
+
geometry.applyMatrix4(mesh.matrixWorld);
|
|
1529
1522
|
|
|
1530
1523
|
const handle = mesh.userData.handle;
|
|
1531
1524
|
if (!this.objectIdToIndex.has(handle)) {
|
|
@@ -1665,10 +1658,14 @@ export class DynamicGltfLoader {
|
|
|
1665
1658
|
vertexCount,
|
|
1666
1659
|
});
|
|
1667
1660
|
currentVertexOffset += vertexCount;
|
|
1661
|
+
|
|
1662
|
+
line.updateWorldMatrix(true, false);
|
|
1663
|
+
const matrix = line.matrixWorld;
|
|
1668
1664
|
const vector = new Vector3();
|
|
1669
1665
|
|
|
1670
1666
|
for (let i = 0; i < vertexCount; i++) {
|
|
1671
1667
|
vector.fromBufferAttribute(positionAttr, i);
|
|
1668
|
+
vector.applyMatrix4(matrix);
|
|
1672
1669
|
positions[posOffset++] = vector.x;
|
|
1673
1670
|
positions[posOffset++] = vector.y;
|
|
1674
1671
|
positions[posOffset++] = vector.z;
|
|
@@ -1763,6 +1760,8 @@ export class DynamicGltfLoader {
|
|
|
1763
1760
|
for (const line of group.objects) {
|
|
1764
1761
|
isEdge = line.userData.isEdge;
|
|
1765
1762
|
const geometry = line.geometry.clone();
|
|
1763
|
+
line.updateWorldMatrix(true, false);
|
|
1764
|
+
geometry.applyMatrix4(line.matrixWorld);
|
|
1766
1765
|
|
|
1767
1766
|
const handle = line.userData.handle;
|
|
1768
1767
|
if (!this.objectIdToIndex.has(handle)) {
|
|
@@ -1868,6 +1867,8 @@ export class DynamicGltfLoader {
|
|
|
1868
1867
|
|
|
1869
1868
|
for (const points of group.objects) {
|
|
1870
1869
|
const geometry = points.geometry.clone();
|
|
1870
|
+
points.updateWorldMatrix(true, false);
|
|
1871
|
+
geometry.applyMatrix4(points.matrixWorld);
|
|
1871
1872
|
geometries.push(geometry);
|
|
1872
1873
|
optimizedObjects.push(points);
|
|
1873
1874
|
handles.add(points.userData.handle);
|
|
@@ -1930,6 +1931,7 @@ export class DynamicGltfLoader {
|
|
|
1930
1931
|
|
|
1931
1932
|
lineSegmentsArray.forEach((segment) => {
|
|
1932
1933
|
const clonedGeometry = segment.geometry.clone();
|
|
1934
|
+
segment.updateWorldMatrix(true, false);
|
|
1933
1935
|
clonedGeometry.applyMatrix4(segment.matrixWorld);
|
|
1934
1936
|
|
|
1935
1937
|
if (hasNormals && !clonedGeometry.attributes.normal) {
|
|
@@ -30,14 +30,6 @@ import { IModel } from "@inweb/viewer-core";
|
|
|
30
30
|
export interface IModelImpl extends IModel {
|
|
31
31
|
scene: Object3D;
|
|
32
32
|
|
|
33
|
-
getUnits(): string;
|
|
34
|
-
|
|
35
|
-
getUnitScale(): number;
|
|
36
|
-
|
|
37
|
-
getUnitString(): string;
|
|
38
|
-
|
|
39
|
-
getPrecision(): number;
|
|
40
|
-
|
|
41
33
|
getExtents(target: Box3): Box3;
|
|
42
34
|
|
|
43
35
|
getObjects(): Object3D[];
|
|
@@ -23,8 +23,6 @@
|
|
|
23
23
|
|
|
24
24
|
import { Box3, Object3D, Vector3 } from "three";
|
|
25
25
|
import { IModelImpl } from "./IModelImpl";
|
|
26
|
-
import { convertUnits } from "../measurement/UnitConverter";
|
|
27
|
-
import { getDisplayUnit } from "../measurement/UnitFormatter";
|
|
28
26
|
|
|
29
27
|
export class ModelImpl implements IModelImpl {
|
|
30
28
|
public id: string;
|
|
@@ -75,22 +73,6 @@ export class ModelImpl implements IModelImpl {
|
|
|
75
73
|
this.scene.clear();
|
|
76
74
|
}
|
|
77
75
|
|
|
78
|
-
getUnits(): string {
|
|
79
|
-
return "Meters";
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
getUnitScale(): number {
|
|
83
|
-
return convertUnits(this.getUnits(), "Meters", 1);
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
getUnitString(): string {
|
|
87
|
-
return getDisplayUnit(this.getUnits());
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
getPrecision(): number {
|
|
91
|
-
return 2;
|
|
92
|
-
}
|
|
93
|
-
|
|
94
76
|
getExtents(target: Box3): Box3 {
|
|
95
77
|
this.scene.traverseVisible((object) => !object.children.length && target.expandByObject(object));
|
|
96
78
|
return target;
|
package/src/index-umd.ts
CHANGED
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
|
|
24
24
|
export * from "./index";
|
|
25
25
|
|
|
26
|
-
// add the global exports (was removed in 0.160.0) to expose the
|
|
26
|
+
// add the global exports (was removed in 0.160.0) to expose the plugins to Three.js code
|
|
27
27
|
|
|
28
28
|
import * as THREE from "three";
|
|
29
29
|
|
|
@@ -1 +0,0 @@
|
|
|
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;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,WAAW,CAAC,gBAAgB,EAAE;IACnC,YAAA,IAAI,CAAC,WAAW,CAAC,gBAAgB,EAAE;IAEnC,YAAA,MAAM,IAAI,GAAG,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,IAAIA,aAAO,EAAE,CAAC,CAAC,MAAM,EAAE;IAChE,YAAA,MAAM,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,IAAIA,aAAO,EAAE,CAAC;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-1 +0,0 @@
|
|
|
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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CAAC,iBAAiB,CAAC,qBAAqB,EAAE,CAAC,MAAM,KAAK,IAAI,mBAAmB,CAAC,MAAM,CAAC,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
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,EA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C,EAAE,CAAC,SAAS,EAAE,IAAI,CAAC,UAAU,CAAC;QAC5C;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;IAEF,QAAA,IAAI,CAAC,SAAS,CAAC,gBAAgB,EAAE;IACjC,QAAA,IAAI,CAAC,SAAS,CAAC,OAAO,EAAE;YAExB,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,aAAa,EAAE,IAAI,CAAC,UAAU,CAAC;YAC/C,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,OAAO,EAAE,IAAI,CAAC,UAAU,CAAC;YACzC,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;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;;;;;;"}
|
|
@@ -1 +0,0 @@
|
|
|
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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GAAG,CAAC,aAAa,EAAE,IAAI,CAAC,UAAU,CAAC;QAC/C,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,OAAO,EAAE,IAAI,CAAC,UAAU,CAAC;QACzC,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;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"}
|
|
@@ -1 +0,0 @@
|
|
|
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,CA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GAAG,CAAC,YAAY,EAAE,IAAI,CAAC,UAAU,CAAC;YAC9C,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,aAAa,EAAE,IAAI,CAAC,UAAU,CAAC;YAC/C,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,OAAO,EAAE,IAAI,CAAC,UAAU,CAAC;QAC3C;IAmBD;AAEDC,0BAAU,CAAC,iBAAiB,CAAC,qBAAqB,EAAE,CAAC,MAAM,KAAK,IAAI,mBAAmB,CAAC,MAAM,CAAC,CAAC;;;;;;"}
|
|
@@ -1 +0,0 @@
|
|
|
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,IAA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 -1 +0,0 @@
|
|
|
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;;;;;;"}
|
|
@@ -1 +0,0 @@
|
|
|
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,oBAAoB,CAAA;AAIxB,IAAA,WAAA,CAAY,MAAc,EAAA;QAkB1B,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,MAAM,WAAW,GAAG,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,iBAAiB,CAAC,IAAI,MAAM,EAAE,CAAC,CAAC,MAAM,GAAG,CAAC;AAClF,YAAA,MAAM,IAAI,GAAG,WAAW,GAAG,EAAE;YAE7B,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,MAAW,KAAI;AACzC,gBAAA,IAAI,MAAyE;gBAE7E,IAAI,MAAM,CAAC,kBAAkB;oBAAE,MAAM,GAAG,IAAI,sBAAsB,CAAC,MAAM,EAAE,IAAI,EAAE,SAAS,CAAC;qBACtF,IAAI,MAAM,CAAC,iBAAiB;oBAAE,MAAM,GAAG,IAAI,qBAAqB,CAAC,MAAM,EAAE,IAAI,EAAE,SAAS,CAAC;qBACzF,IAAI,MAAM,CAAC,YAAY;oBAAE,MAAM,GAAG,IAAI,gBAAgB,CAAC,MAAM,EAAE,IAAI,EAAE,SAAS,CAAC;gBAEpF,IAAI,MAAM,EAAE;AACV,oBAAA,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,MAAM,CAAC;oBAC9B,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC;gBACjC;AACF,YAAA,CAAC,CAAC;AACJ,QAAA,CAAC;AAvCC,QAAA,IAAI,CAAC,YAAY,GAAG,EAAE;AACtB,QAAA,IAAI,CAAC,MAAM,GAAG,MAAM;QACpB,IAAI,CAAC,MAAM,CAAC,gBAAgB,CAAC,aAAa,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"}
|
|
@@ -1 +0,0 @@
|
|
|
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,U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AAG;CAEtC,GAAG,QAAQ,CAAC,OAAO,EAAE;CAErB,EAAE;CAEF,CAAC;CAED;CAEA,SAAS,uBAAuB,EAAE,SAAS,GAAG;CAG9C,CAAC,MAAM,QAAQ,GAAG,IAAIG,yBAAmB,EAAE;CAC3C,EAAE,KAAK,EAAE,QAAQ;CACjB,EAAE,QAAQ,EAAE,QAAQ;CACpB,EAAE,iBAAiB,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]}
|
|
@@ -1 +0,0 @@
|
|
|
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"}
|
|
@@ -1 +0,0 @@
|
|
|
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,GAA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AAG,UAAU;CAC1C,QAAA,MAAM,CAAC,MAAM,CAAC,aAAa,CAAC,WAAW,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC;CAEvD,QAAA,IAAI,CAAC,MAAM,GAAG,MAAM;SACpB,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC,SAAS,EAAE,IAAI,CAAC,WAAW,CAAC;KAC7C;KAEA,OAAO,GAAA;SACL,IAAI,CAAC,MAAM,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]}
|
|
@@ -1 +0,0 @@
|
|
|
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"}
|