@inweb/viewer-three 27.2.3 → 27.2.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/viewer-three.js +319 -652
- package/dist/viewer-three.js.map +1 -1
- package/dist/viewer-three.min.js +3 -3
- package/dist/viewer-three.module.js +321 -654
- package/dist/viewer-three.module.js.map +1 -1
- package/lib/Viewer/controls/WalkControls.d.ts +0 -8
- package/lib/Viewer/draggers/CuttingPlaneDragger.d.ts +5 -23
- package/lib/Viewer/helpers/PlaneHelper2.d.ts +4 -8
- package/lib/Viewer/measurement/Snapper.d.ts +1 -1
- package/package.json +5 -5
- package/src/Viewer/components/SelectionComponent.ts +1 -1
- package/src/Viewer/controls/WalkControls.ts +4 -50
- package/src/Viewer/draggers/CuttingPlaneDragger.ts +31 -191
- package/src/Viewer/draggers/CuttingPlaneXAxis.ts +3 -2
- package/src/Viewer/draggers/CuttingPlaneYAxis.ts +3 -2
- package/src/Viewer/draggers/CuttingPlaneZAxis.ts +3 -2
- package/src/Viewer/draggers/index.ts +0 -2
- package/src/Viewer/helpers/PlaneHelper2.ts +17 -30
- package/src/Viewer/loaders/DynamicGltfLoader/DynamicGltfLoader.js +189 -413
- package/src/Viewer/measurement/Snapper.ts +5 -13
|
@@ -29,67 +29,54 @@ import {
|
|
|
29
29
|
LineBasicMaterial,
|
|
30
30
|
Mesh,
|
|
31
31
|
MeshBasicMaterial,
|
|
32
|
-
Object3D,
|
|
33
|
-
Plane,
|
|
34
32
|
} from "three";
|
|
35
33
|
|
|
36
|
-
export class PlaneHelper2 extends
|
|
37
|
-
public plane: Plane;
|
|
34
|
+
export class PlaneHelper2 extends Line {
|
|
38
35
|
public size: number;
|
|
39
|
-
public
|
|
40
|
-
public mesh: Mesh;
|
|
41
|
-
|
|
42
|
-
constructor(size = 1, color = 0xf0f0f0, opacity = 0.15) {
|
|
43
|
-
super();
|
|
44
|
-
|
|
45
|
-
(this as any).type = "PlaneHelper2";
|
|
46
|
-
this.size = size;
|
|
36
|
+
public helper: Mesh;
|
|
47
37
|
|
|
38
|
+
constructor(size = 1, color = 0xc0c0c0) {
|
|
48
39
|
const positions = [1, 1, 0, -1, 1, 0, -1, -1, 0, 1, -1, 0, 1, 1, 0];
|
|
40
|
+
|
|
49
41
|
const geometry = new BufferGeometry();
|
|
50
42
|
geometry.setAttribute("position", new Float32BufferAttribute(positions, 3));
|
|
51
43
|
geometry.computeBoundingSphere();
|
|
52
44
|
|
|
53
|
-
|
|
45
|
+
super(geometry, new LineBasicMaterial({ color, toneMapped: false }));
|
|
46
|
+
|
|
47
|
+
(this as any).type = "PlaneHelper2";
|
|
48
|
+
|
|
49
|
+
this.size = size;
|
|
54
50
|
|
|
55
51
|
const positions2 = [1, 1, 0, -1, 1, 0, -1, -1, 0, 1, 1, 0, -1, -1, 0, 1, -1, 0];
|
|
52
|
+
|
|
56
53
|
const geometry2 = new BufferGeometry();
|
|
57
54
|
geometry2.setAttribute("position", new Float32BufferAttribute(positions2, 3));
|
|
58
55
|
geometry2.computeBoundingSphere();
|
|
59
56
|
|
|
60
|
-
this.
|
|
57
|
+
this.helper = new Mesh(
|
|
61
58
|
geometry2,
|
|
62
59
|
new MeshBasicMaterial({
|
|
63
60
|
color,
|
|
64
|
-
opacity,
|
|
61
|
+
opacity: 0.2,
|
|
65
62
|
transparent: true,
|
|
66
63
|
depthWrite: false,
|
|
67
64
|
toneMapped: false,
|
|
68
65
|
side: DoubleSide,
|
|
69
66
|
})
|
|
70
67
|
);
|
|
71
|
-
|
|
72
|
-
this.add(this.outline);
|
|
73
|
-
this.add(this.mesh);
|
|
68
|
+
this.add(this.helper);
|
|
74
69
|
}
|
|
75
70
|
|
|
76
71
|
dispose() {
|
|
77
|
-
this.
|
|
78
|
-
(this.
|
|
79
|
-
this.
|
|
80
|
-
(this.
|
|
72
|
+
this.geometry.dispose();
|
|
73
|
+
(this.material as any).dispose();
|
|
74
|
+
(this.helper as any).geometry.dispose();
|
|
75
|
+
(this.helper as any).material.dispose();
|
|
81
76
|
}
|
|
82
77
|
|
|
83
78
|
override updateMatrixWorld(force: boolean) {
|
|
84
79
|
this.scale.set(0.5 * this.size, 0.5 * this.size, 1);
|
|
85
80
|
super.updateMatrixWorld(force);
|
|
86
81
|
}
|
|
87
|
-
|
|
88
|
-
getLineMaterial(): LineBasicMaterial {
|
|
89
|
-
return this.outline.material as LineBasicMaterial;
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
getMeshMaterial(): MeshBasicMaterial {
|
|
93
|
-
return this.mesh.material as MeshBasicMaterial;
|
|
94
|
-
}
|
|
95
82
|
}
|