Minor code and comment polishing

master
fsantini 11 years ago
parent cc2925b705
commit 5bde7fcb28

@ -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]);
}

@ -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;

Loading…
Cancel
Save