viral-viewer-2 3.1.0 → 3.1.2

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.
@@ -33772,18 +33772,18 @@ function workerFunction() {
33772
33772
  computeEdgeCostAtVertex(vertices[i]);
33773
33773
  }
33774
33774
  let nextVertex;
33775
- // number of polygon to remove
33776
- let z = 0;
33777
- if (count > vertices.length) {
33778
- z = count - vertices.length;
33779
- }
33780
- while (z--) {
33781
- nextVertex = minimumCostEdge(vertices);
33782
- if (!nextVertex) {
33783
- console.log("THREE.SimplifyModifier: No next vertex");
33784
- break;
33775
+ // incase max polygons allows larger than reality
33776
+ if (vertices.length > count) {
33777
+ // number of polygon to remove
33778
+ let z = vertices.length - count;
33779
+ while (z--) {
33780
+ nextVertex = minimumCostEdge(vertices);
33781
+ if (!nextVertex) {
33782
+ console.log("THREE.SimplifyModifier: No next vertex");
33783
+ break;
33784
+ }
33785
+ collapse(vertices, faces, nextVertex, nextVertex.collapseNeighbor);
33785
33786
  }
33786
- collapse(vertices, faces, nextVertex, nextVertex.collapseNeighbor);
33787
33787
  }
33788
33788
  //
33789
33789
  const simplifiedGeometry = new BufferGeometry();
@@ -34143,23 +34143,29 @@ function workerFunction() {
34143
34143
  matrix4.fromArray(numbers);
34144
34144
  childMesh.setMatrixAt(index, matrix4);
34145
34145
  //if number of polygon smaller than expect, generate edges
34146
- if (geometry.attributes.position.count < maxPolygonForEdge) {
34147
- const edges = new EdgesGeometry(geometry, 90);
34148
- const positions = edges.attributes.position.array;
34149
- const indices = [];
34150
- for (let i = 0; i < positions.length / 3; i += 2) {
34151
- indices.push(i, i + 1);
34152
- }
34153
- const bufferGeometry = new BufferGeometry();
34154
- // Set the position attribute
34155
- bufferGeometry.setAttribute("position", new BufferAttribute(new Float32Array(positions), 3));
34156
- // Set the index attribute
34157
- bufferGeometry.setIndex(indices);
34158
- const line = new LineSegments(bufferGeometry, new LineBasicMaterial({ color: "#666", linewidth: 0.5 }));
34159
- line.applyMatrix4(matrix4);
34160
- line.updateMatrix();
34161
- childMesh.add(line);
34162
- }
34146
+ // if (geometry.attributes.position.count < maxPolygonForEdge) {
34147
+ // const edges = new EdgesGeometry(geometry, 90);
34148
+ // const positions = edges.attributes.position.array;
34149
+ // const indices = [];
34150
+ // for (let i = 0; i < positions.length / 3; i += 2) {
34151
+ // indices.push(i, i + 1);
34152
+ // }
34153
+ // const bufferGeometry = new BufferGeometry();
34154
+ // // Set the position attribute
34155
+ // bufferGeometry.setAttribute(
34156
+ // "position",
34157
+ // new BufferAttribute(new Float32Array(positions), 3)
34158
+ // );
34159
+ // // Set the index attribute
34160
+ // bufferGeometry.setIndex(indices);
34161
+ // const line = new LineSegments(
34162
+ // bufferGeometry,
34163
+ // new LineBasicMaterial({ color: "#666", linewidth: 0.5 })
34164
+ // );
34165
+ // line.applyMatrix4(matrix4);
34166
+ // line.updateMatrix();
34167
+ // childMesh.add(line);
34168
+ // }
34163
34169
  }
34164
34170
  // childMesh.instanceMatrix.needsUpdate = true;
34165
34171
  childMesh.updateMatrix();