Browse Source

Minor code and comment polishing

fsantini 11 years ago
parent
commit
5bde7fcb28
2 changed files with 4 additions and 10 deletions
  1. 2
    6
      Marlin/Marlin_main.cpp
  2. 2
    4
      Marlin/vector_3.cpp

+ 2
- 6
Marlin/Marlin_main.cpp View File

@@ -809,14 +809,10 @@ static void set_bed_level_equation_lsq(double *plane_equation_coefficients)
809 809
     plan_bed_level_matrix = matrix_3x3::create_look_at(planeNormal);
810 810
     //bedLevel.debug("bedLevel");
811 811
 
812
-    plan_bed_level_matrix.debug("bed level before");
812
+    //plan_bed_level_matrix.debug("bed level before");
813 813
     //vector_3 uncorrected_position = plan_get_position_mm();
814 814
     //uncorrected_position.debug("position before");
815 815
 
816
-    // and set our bed level equation to do the right thing
817
-//    plan_bed_level_matrix = matrix_3x3::create_inverse(bedLevel);
818
-//    plan_bed_level_matrix.debug("bed level after");
819
-
820 816
     vector_3 corrected_position = plan_get_position();
821 817
 //    corrected_position.debug("position after");
822 818
     current_position[X_AXIS] = corrected_position.x;
@@ -824,7 +820,7 @@ static void set_bed_level_equation_lsq(double *plane_equation_coefficients)
824 820
     current_position[Z_AXIS] = corrected_position.z;
825 821
 
826 822
     // but the bed at 0 so we don't go below it.
827
-    current_position[Z_AXIS] = -Z_PROBE_OFFSET_FROM_EXTRUDER; // in the lsq we reach here after raising the extruder due to the loop structure
823
+    current_position[Z_AXIS] = -Z_PROBE_OFFSET_FROM_EXTRUDER;
828 824
 
829 825
     plan_set_position(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]);
830 826
 }

+ 2
- 4
Marlin/vector_3.cpp View File

@@ -129,7 +129,7 @@ void matrix_3x3::set_to_identity()
129 129
 
130 130
 matrix_3x3 matrix_3x3::create_look_at(vector_3 target)
131 131
 {
132
-    vector_3 z_row = vector_3(target.x, target.y, target.z).get_normal();
132
+    vector_3 z_row = target.get_normal();
133 133
     vector_3 x_row = vector_3(1, 0, -target.x/target.z).get_normal();
134 134
     vector_3 y_row = vector_3(0, 1, -target.y/target.z).get_normal();
135 135
 
@@ -139,9 +139,7 @@ matrix_3x3 matrix_3x3::create_look_at(vector_3 target)
139 139
 
140 140
  
141 141
      // create the matrix already correctly transposed
142
-    matrix_3x3 rot = matrix_3x3::create_from_rows(vector_3(x_row.x, x_row.y, x_row.z),
143
-                                vector_3(y_row.x, y_row.y, y_row.z),
144
-                                vector_3(z_row.x, z_row.y, z_row.z));
142
+    matrix_3x3 rot = matrix_3x3::create_from_rows(x_row, y_row, z_row);
145 143
 
146 144
  //   rot.debug("rot");
147 145
     return rot;

Loading…
Cancel
Save