viral-viewer-2 2.9.4 → 2.9.5
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.
|
@@ -34037,7 +34037,7 @@ function workerFunction() {
|
|
|
34037
34037
|
}
|
|
34038
34038
|
}
|
|
34039
34039
|
//#endregion
|
|
34040
|
-
|
|
34040
|
+
//#regionMy code
|
|
34041
34041
|
//////////////////
|
|
34042
34042
|
const maxPolygonPerObject = 1000;
|
|
34043
34043
|
const maxPolygonForEdge = 1000;
|
|
@@ -34109,8 +34109,7 @@ function workerFunction() {
|
|
|
34109
34109
|
// In case number of polygon larger than expect, merge them to reduce polygon first, for optimize purpose
|
|
34110
34110
|
if (dummyGeometry.attributes.position.count > maxPolygonPerObject) {
|
|
34111
34111
|
const modifier = new SimplifyModifier();
|
|
34112
|
-
const ratio = maxPolygonPerObject /
|
|
34113
|
-
dummyGeometry.attributes.position.count;
|
|
34112
|
+
const ratio = maxPolygonPerObject / dummyGeometry.attributes.position.count;
|
|
34114
34113
|
const count = Math.floor(dummyGeometry.attributes.position.count * ratio); // number of polygon to remove
|
|
34115
34114
|
geometry = modifier.modify(dummyGeometry, count);
|
|
34116
34115
|
console.log(dummyGeometry.attributes.position.count, geometry.attributes.position.count);
|
|
@@ -34160,7 +34159,9 @@ function workerFunction() {
|
|
|
34160
34159
|
bufferGeometry.setIndex(indices);
|
|
34161
34160
|
const line = new LineSegments(bufferGeometry, new LineBasicMaterial({ color: "#666", linewidth: 0.5 }));
|
|
34162
34161
|
line.applyMatrix4(matrix4);
|
|
34162
|
+
line.updateMatrix();
|
|
34163
34163
|
childMesh.add(line);
|
|
34164
|
+
childMesh.updateMatrix();
|
|
34164
34165
|
}
|
|
34165
34166
|
}
|
|
34166
34167
|
let jsonData = childMesh.toJSON();
|
|
@@ -34197,6 +34198,7 @@ function workerFunction() {
|
|
|
34197
34198
|
this.Instances = [];
|
|
34198
34199
|
}
|
|
34199
34200
|
}
|
|
34201
|
+
//#endregion
|
|
34200
34202
|
}
|
|
34201
34203
|
exports.workerCode = workerFunction;
|
|
34202
34204
|
//# sourceMappingURL=threejs.types.js.map
|