Jelajahi Sumber

Issue #391: removed console debugs

cycle20 2 tahun lalu
induk
melakukan
4aee2244e1
2 mengubah file dengan 5 tambahan dan 15 penghapusan
  1. 5 1
      src/apps/viewer/index.ts
  2. 0 14
      src/extensions/tmdet/algorithm.ts

+ 5 - 1
src/apps/viewer/index.ts

@@ -208,8 +208,12 @@ export class Viewer {
             return Vec3.add(Vec3(), v, u);
         }
 
+        if (this.plugin.canvas3d === undefined) {
+            console.warn("plugin.canvas3d undefined");
+            return;
+        }
 
-        const cam = this.plugin.canvas3d!.camera;
+        const cam = this.plugin.canvas3d.camera;
         const snapshot = cam.getSnapshot();
         const newSnapshot = {
             ...snapshot,

+ 0 - 14
src/extensions/tmdet/algorithm.ts

@@ -159,17 +159,11 @@ export async function calculate(runtime: RuntimeContext, structure: Structure, p
     const membrane: MembraneOrientation = JSON.parse(
         window.localStorage.getItem(MEMBRANE_STORAGE_KEY)!
     );
-    window.console.debug('membrane object from localStorage:', membrane);
-
-    window.console.debug('normal vector:', membrane.normalVector);
-    window.console.debug('plain point 1:', membrane.planePoint1);
-    window.console.debug('plain point 2:', membrane.planePoint2);
 
     v3sub(normalVector, membrane.planePoint1, membrane.planePoint2);
     v3normalize(normalVector, normalVector);
     v3add(center, membrane.planePoint1, membrane.planePoint2);
     v3scale(center, center, 0.5);
-    window.console.debug('calculated center:', center);
 
     const candidate: MembraneCandidate = {
         normalVector: membrane.normalVector,
@@ -179,14 +173,6 @@ export async function calculate(runtime: RuntimeContext, structure: Structure, p
     };
     const extent = adjustExtent(ctx, candidate, center);
 
-    window.console.debug('result of "tmdet / calculate":', {
-        planePoint1: membrane.planePoint1,
-        planePoint2: membrane.planePoint2,
-        normalVector,
-        centroid: center,
-        radius: extent
-    });
-
     return {
         planePoint1: membrane.planePoint1,
         planePoint2: membrane.planePoint2,