Spaces:
Running
Running
Update js_scripts/galerie_double_v/script_double_v.js
Browse files
js_scripts/galerie_double_v/script_double_v.js
CHANGED
|
@@ -305,9 +305,15 @@
|
|
| 305 |
|
| 306 |
// --- Helper Function to Load a PLY Model ---
|
| 307 |
async function loadModel(url) {
|
| 308 |
-
//
|
| 309 |
-
if (scene
|
| 310 |
-
scene.clear
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 311 |
}
|
| 312 |
progressDialog.style.display = 'block';
|
| 313 |
progressIndicator.value = 0;
|
|
|
|
| 305 |
|
| 306 |
// --- Helper Function to Load a PLY Model ---
|
| 307 |
async function loadModel(url) {
|
| 308 |
+
// Ensure only one PLY is displayed at a time by clearing the scene.
|
| 309 |
+
if (scene) {
|
| 310 |
+
if (typeof scene.clear === 'function') {
|
| 311 |
+
scene.clear();
|
| 312 |
+
} else if (scene.children && scene.children.length) {
|
| 313 |
+
while (scene.children.length > 0) {
|
| 314 |
+
scene.remove(scene.children[0]);
|
| 315 |
+
}
|
| 316 |
+
}
|
| 317 |
}
|
| 318 |
progressDialog.style.display = 'block';
|
| 319 |
progressIndicator.value = 0;
|