Browse Source

Apply prior nozzle clean update

Scott Lahteine 7 years ago
parent
commit
b2270b3f3e
1 changed files with 6 additions and 6 deletions
  1. 6
    6
      Marlin/nozzle.cpp

+ 6
- 6
Marlin/nozzle.cpp View File

62
   __attribute__((unused)) uint8_t const &objects
62
   __attribute__((unused)) uint8_t const &objects
63
 ) {
63
 ) {
64
   #if ENABLED(NOZZLE_CLEAN_FEATURE)
64
   #if ENABLED(NOZZLE_CLEAN_FEATURE)
65
-    float A = fabs(end.y - start.y); // [twice the] Amplitude
66
-    float P = fabs(end.x - start.x) / (objects << 1); // Period
65
+    const float A = nozzle_clean_horizontal ? nozzle_clean_height : nozzle_clean_length, // [twice the] Amplitude
66
+                P = (nozzle_clean_horizontal ? nozzle_clean_length : nozzle_clean_height) / (objects << 1); // Period
67
 
67
 
68
     // Don't allow impossible triangles
68
     // Don't allow impossible triangles
69
     if (A <= 0.0f || P <= 0.0f ) return;
69
     if (A <= 0.0f || P <= 0.0f ) return;
80
 
80
 
81
     for (uint8_t j = 0; j < strokes; j++) {
81
     for (uint8_t j = 0; j < strokes; j++) {
82
       for (uint8_t i = 0; i < (objects << 1); i++) {
82
       for (uint8_t i = 0; i < (objects << 1); i++) {
83
-        float const x = start.x + i * P;
84
-        float const y = start.y + (A/P) * (P - fabs(fmod((i*P), (2*P)) - P));
83
+        float const x = start.x + ( nozzle_clean_horizontal ? i * P : (A/P) * (P - fabs(fmod((i*P), (2*P)) - P)) );
84
+        float const y = start.y + (!nozzle_clean_horizontal ? i * P : (A/P) * (P - fabs(fmod((i*P), (2*P)) - P)) );
85
 
85
 
86
         do_blocking_move_to_xy(x, y);
86
         do_blocking_move_to_xy(x, y);
87
         if (i == 0) do_blocking_move_to_z(start.z);
87
         if (i == 0) do_blocking_move_to_z(start.z);
88
       }
88
       }
89
 
89
 
90
       for (int i = (objects << 1); i > -1; i--) {
90
       for (int i = (objects << 1); i > -1; i--) {
91
-        float const x = start.x + i * P;
92
-        float const y = start.y + (A/P) * (P - fabs(fmod((i*P), (2*P)) - P));
91
+        float const x = start.x + ( nozzle_clean_horizontal ? i * P : (A/P) * (P - fabs(fmod((i*P), (2*P)) - P)) );
92
+        float const y = start.y + (!nozzle_clean_horizontal ? i * P : (A/P) * (P - fabs(fmod((i*P), (2*P)) - P)) );
93
 
93
 
94
         do_blocking_move_to_xy(x, y);
94
         do_blocking_move_to_xy(x, y);
95
       }
95
       }

Loading…
Cancel
Save