From 5bde7fcb28601eda609611f2590f3f056c8e4b34 Mon Sep 17 00:00:00 2001 From: fsantini Date: Wed, 11 Dec 2013 21:27:43 +0100 Subject: [PATCH] Minor code and comment polishing --- Marlin/Marlin_main.cpp | 8 ++------ Marlin/vector_3.cpp | 6 ++---- 2 files changed, 4 insertions(+), 10 deletions(-) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index db9686f3e..daeb65ffa 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -809,14 +809,10 @@ static void set_bed_level_equation_lsq(double *plane_equation_coefficients) plan_bed_level_matrix = matrix_3x3::create_look_at(planeNormal); //bedLevel.debug("bedLevel"); - plan_bed_level_matrix.debug("bed level before"); + //plan_bed_level_matrix.debug("bed level before"); //vector_3 uncorrected_position = plan_get_position_mm(); //uncorrected_position.debug("position before"); - // and set our bed level equation to do the right thing -// plan_bed_level_matrix = matrix_3x3::create_inverse(bedLevel); -// plan_bed_level_matrix.debug("bed level after"); - vector_3 corrected_position = plan_get_position(); // corrected_position.debug("position after"); current_position[X_AXIS] = corrected_position.x; @@ -824,7 +820,7 @@ static void set_bed_level_equation_lsq(double *plane_equation_coefficients) current_position[Z_AXIS] = corrected_position.z; // but the bed at 0 so we don't go below it. - current_position[Z_AXIS] = -Z_PROBE_OFFSET_FROM_EXTRUDER; // in the lsq we reach here after raising the extruder due to the loop structure + current_position[Z_AXIS] = -Z_PROBE_OFFSET_FROM_EXTRUDER; plan_set_position(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]); } diff --git a/Marlin/vector_3.cpp b/Marlin/vector_3.cpp index c9f480323..c143e012e 100644 --- a/Marlin/vector_3.cpp +++ b/Marlin/vector_3.cpp @@ -129,7 +129,7 @@ void matrix_3x3::set_to_identity() matrix_3x3 matrix_3x3::create_look_at(vector_3 target) { - vector_3 z_row = vector_3(target.x, target.y, target.z).get_normal(); + vector_3 z_row = target.get_normal(); vector_3 x_row = vector_3(1, 0, -target.x/target.z).get_normal(); vector_3 y_row = vector_3(0, 1, -target.y/target.z).get_normal(); @@ -139,9 +139,7 @@ matrix_3x3 matrix_3x3::create_look_at(vector_3 target) // create the matrix already correctly transposed - matrix_3x3 rot = matrix_3x3::create_from_rows(vector_3(x_row.x, x_row.y, x_row.z), - vector_3(y_row.x, y_row.y, y_row.z), - vector_3(z_row.x, z_row.y, z_row.z)); + matrix_3x3 rot = matrix_3x3::create_from_rows(x_row, y_row, z_row); // rot.debug("rot"); return rot;