viral-viewer-2 2.8.9 → 2.9.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.
|
@@ -33001,7 +33001,17 @@ function workerFunction() {
|
|
|
33001
33001
|
//if number of polygon smaller than expect, generate edges
|
|
33002
33002
|
if (dummyGeometry.attributes.position.count < maxPolygonForEdge) {
|
|
33003
33003
|
const edges = new EdgesGeometry(dummyGeometry, 90);
|
|
33004
|
-
const
|
|
33004
|
+
const positions = edges.attributes.position.array;
|
|
33005
|
+
const indices = [];
|
|
33006
|
+
for (let i = 0; i < positions.length / 3; i += 2) {
|
|
33007
|
+
indices.push(i, i + 1);
|
|
33008
|
+
}
|
|
33009
|
+
const bufferGeometry = new BufferGeometry();
|
|
33010
|
+
// Set the position attribute
|
|
33011
|
+
bufferGeometry.setAttribute("position", new BufferAttribute(new Float32Array(positions), 3));
|
|
33012
|
+
// Set the index attribute
|
|
33013
|
+
bufferGeometry.setIndex(indices);
|
|
33014
|
+
const line = new LineSegments(bufferGeometry, new LineBasicMaterial({ color: "#666", linewidth: 0.5 }));
|
|
33005
33015
|
line.applyMatrix4(matrix4);
|
|
33006
33016
|
childMesh.add(line);
|
|
33007
33017
|
}
|
|
@@ -33011,7 +33021,17 @@ function workerFunction() {
|
|
|
33011
33021
|
}
|
|
33012
33022
|
else {
|
|
33013
33023
|
const edges = new EdgesGeometry(dummyGeometry, 90);
|
|
33014
|
-
const
|
|
33024
|
+
const positions = edges.attributes.position.array;
|
|
33025
|
+
const indices = [];
|
|
33026
|
+
for (let i = 0; i < positions.length / 3; i += 2) {
|
|
33027
|
+
indices.push(i, i + 1);
|
|
33028
|
+
}
|
|
33029
|
+
const bufferGeometry = new BufferGeometry();
|
|
33030
|
+
// Set the position attribute
|
|
33031
|
+
bufferGeometry.setAttribute("position", new BufferAttribute(new Float32Array(positions), 3));
|
|
33032
|
+
// Set the index attribute
|
|
33033
|
+
bufferGeometry.setIndex(indices);
|
|
33034
|
+
const line = new LineSegments(bufferGeometry, new LineBasicMaterial({ color: "#202020", linewidth: 0.5 }));
|
|
33015
33035
|
const childMesh = new Mesh(dummyGeometry);
|
|
33016
33036
|
childMesh.add(line);
|
|
33017
33037
|
childMesh.castShadow = true;
|