Upload preprocess_manual.js
Browse files- preprocess_manual.js +34 -0
preprocess_manual.js
CHANGED
|
@@ -1363,6 +1363,40 @@ console.log('[preprocessManual] ===== AUTO-ALIGNMENT COMPLETE =====');
|
|
| 1363 |
z: (maxZ + minZ) / 2
|
| 1364 |
};
|
| 1365 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1366 |
|
| 1367 |
// Display scene info in UI
|
| 1368 |
const sceneSizeEl = document.getElementById('scene-size');
|
|
|
|
| 1363 |
z: (maxZ + minZ) / 2
|
| 1364 |
};
|
| 1365 |
|
| 1366 |
+
/////////////////////add 13:40
|
| 1367 |
+
|
| 1368 |
+
// Initialize box and PLY offset variables
|
| 1369 |
+
let boxSize = {
|
| 1370 |
+
x: sceneSize.x * 1.2,
|
| 1371 |
+
y: sceneSize.y * 1.2,
|
| 1372 |
+
z: sceneSize.z * 1.2
|
| 1373 |
+
};
|
| 1374 |
+
|
| 1375 |
+
let boxPosition = { x: 0, y: 0, z: 0 };
|
| 1376 |
+
let boxRotation = { x: 0, y: 0, z: 0 };
|
| 1377 |
+
let plyOffset = { x: 0, y: 0, z: 0 };
|
| 1378 |
+
|
| 1379 |
+
// Calculate camera position
|
| 1380 |
+
const maxDim = Math.max(sceneSize.x, sceneSize.y, sceneSize.z);
|
| 1381 |
+
const distance = maxDim * 2.0;
|
| 1382 |
+
|
| 1383 |
+
camera.position.set(0, maxDim * 0.3, distance);
|
| 1384 |
+
camera.lookAt(0, 0, 0);
|
| 1385 |
+
camera.updateProjectionMatrix();
|
| 1386 |
+
|
| 1387 |
+
cameraControls.controls.target.set(0, 0, 0);
|
| 1388 |
+
cameraControls.controls.update();
|
| 1389 |
+
|
| 1390 |
+
console.log('[preprocessManual] Camera positioned at:', {
|
| 1391 |
+
x: camera.position.x.toFixed(2),
|
| 1392 |
+
y: camera.position.y.toFixed(2),
|
| 1393 |
+
z: camera.position.z.toFixed(2)
|
| 1394 |
+
});
|
| 1395 |
+
console.log('[preprocessManual] Initial box setup - size:', boxSize);
|
| 1396 |
+
|
| 1397 |
+
|
| 1398 |
+
/////////////////////end of add 13:40
|
| 1399 |
+
|
| 1400 |
|
| 1401 |
// Display scene info in UI
|
| 1402 |
const sceneSizeEl = document.getElementById('scene-size');
|