stpete2 commited on
Commit
e64d8cb
·
verified ·
1 Parent(s): 3ba8f33

Upload preprocess_manual.js

Browse files
Files changed (1) hide show
  1. preprocess_manual.js +30 -0
preprocess_manual.js CHANGED
@@ -1207,7 +1207,37 @@ if (Math.abs(avgX) > 1e-6 || Math.abs(avgY) > 1e-6 || Math.abs(avgZ) > 1e-6) {
1207
 
1208
  console.log('[DEBUG] ✓ Centering SUCCESS! Average is effectively zero');
1209
  console.log('[preprocessManual] ✓ PLY centered at origin');
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1210
 
 
1211
  console.log('[preprocessManual] ===== AUTO-ALIGNMENT COMPLETE =====');
1212
 
1213
 
 
1207
 
1208
  console.log('[DEBUG] ✓ Centering SUCCESS! Average is effectively zero');
1209
  console.log('[preprocessManual] ✓ PLY centered at origin');
1210
+ /////////////////
1211
+
1212
+ // ========================================
1213
+ // Step 4: Calculate bounding box for later use
1214
+ // ========================================
1215
+ console.log('[preprocessManual] Step 4: Calculating bounding box...');
1216
+
1217
+ let minX = Infinity, minY = Infinity, minZ = Infinity;
1218
+ let maxX = -Infinity, maxY = -Infinity, maxZ = -Infinity;
1219
+
1220
+ for (let i = 0; i < plyData.vertices.length; i++) {
1221
+ const v = plyData.vertices[i];
1222
+ minX = Math.min(minX, v.x);
1223
+ minY = Math.min(minY, v.y);
1224
+ minZ = Math.min(minZ, v.z);
1225
+ maxX = Math.max(maxX, v.x);
1226
+ maxY = Math.max(maxY, v.y);
1227
+ maxZ = Math.max(maxZ, v.z);
1228
+ }
1229
+
1230
+ console.log('[preprocessManual] Bounding box calculated:', {
1231
+ min: { x: minX.toFixed(3), y: minY.toFixed(3), z: minZ.toFixed(3) },
1232
+ max: { x: maxX.toFixed(3), y: maxY.toFixed(3), z: maxZ.toFixed(3) },
1233
+ size: {
1234
+ x: (maxX - minX).toFixed(3),
1235
+ y: (maxY - minY).toFixed(3),
1236
+ z: (maxZ - minZ).toFixed(3)
1237
+ }
1238
+ });
1239
 
1240
+ ////////////////
1241
  console.log('[preprocessManual] ===== AUTO-ALIGNMENT COMPLETE =====');
1242
 
1243