Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FormerLurker/ArcWelderLib.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFormerLurker <hochgebe@gmail.com>2021-11-13 22:37:28 +0300
committerFormerLurker <hochgebe@gmail.com>2021-11-13 22:37:28 +0300
commit4c193828056771381f7bfc6f04133bd1a45447ac (patch)
tree02cbbdbe89bfb4e7f886212fd70494912d4b0a00
parent32708379fe8fe91e4e21b6928d6384162abcd091 (diff)
Encode more points when moving to/from extruding/retracting/travel.
-rw-r--r--ArcWelder/arc_welder.cpp8
-rw-r--r--ArcWelder/segmented_arc.cpp8
-rw-r--r--ArcWelderTest/ArcWelderTest.cpp3
3 files changed, 12 insertions, 7 deletions
diff --git a/ArcWelder/arc_welder.cpp b/ArcWelder/arc_welder.cpp
index fe129b4..ab2f6ef 100644
--- a/ArcWelder/arc_welder.cpp
+++ b/ArcWelder/arc_welder.cpp
@@ -582,11 +582,13 @@ int arc_welder::process_gcode(parsed_command cmd, bool is_end, bool is_reprocess
(
!waiting_for_arc_ ||
extruder_current.is_extruding ||
+ extruder_current.is_retracting ||
// Test for travel conversion
- (allow_travel_arcs_ && p_cur_pos->is_travel()) ||
- //(previous_extruder.is_extruding && extruder_current.is_extruding) || // Test to see if
+ (allow_travel_arcs_ && p_cur_pos->is_travel())
+ //|| (previous_extruder.is_extruding && extruder_current.is_extruding) // Test to see if
+ // we can get more arcs.
+ // || (previous_extruder.is_retracting && extruder_current.is_retracting) // Test to see if
// we can get more arcs.
- (previous_extruder.is_retracting && extruder_current.is_retracting)
) &&
p_cur_pos->is_extruder_relative == is_previous_extruder_relative &&
(!waiting_for_arc_ || p_pre_pos->f == p_cur_pos->f) && // might need to skip the waiting for arc check...
diff --git a/ArcWelder/segmented_arc.cpp b/ArcWelder/segmented_arc.cpp
index 527ad3a..f6cfff1 100644
--- a/ArcWelder/segmented_arc.cpp
+++ b/ArcWelder/segmented_arc.cpp
@@ -155,13 +155,15 @@ bool segmented_arc::try_add_point(printer_point p)
return false;
}
- // Need to separate travel moves from moves with extrusion
- if (points_.count() > 1)
+ // If we have more than 2 points, we need to make sure the current and previous moves are all of the same type.
+ if (points_.count() > 2)
{
+ // TODO: Do we need this?
// We already have at least an initial point and a second point. Make cure the current point and the previous are either both
// travel moves, or both extrusion
if (!(
- (p1.e_relative != 0 && p.e_relative != 0) // Extrusions
+ (p1.e_relative > 0 && p.e_relative > 0) // Extrusions
+ || (p1.e_relative < 0 && p.e_relative < 0) // Retractions
|| (p1.e_relative == 0 && p.e_relative == 0) // Travel
)
)
diff --git a/ArcWelderTest/ArcWelderTest.cpp b/ArcWelderTest/ArcWelderTest.cpp
index 31ca28f..2aaa8e4 100644
--- a/ArcWelderTest/ArcWelderTest.cpp
+++ b/ArcWelderTest/ArcWelderTest.cpp
@@ -306,7 +306,7 @@ static void TestAntiStutter(std::string filePath)
// BENCHY_L1_DIFFICULT
// SPIRAL_TEST
// SPIRAL_VASE_TEST_FUNNEL
- std::string source_path = TravelWipeTest;
+ std::string source_path = BENCHY_DIFFICULT;
std::string target_path = "C:\\Users\\Brad\\Documents\\3DPrinter\\AntiStutter\\test_output.gcode";
arc_welder_args args(source_path, target_path, p_logger);
args.callback = on_progress;
@@ -315,6 +315,7 @@ static void TestAntiStutter(std::string filePath)
args.allow_3d_arcs = true;
args.max_radius_mm = 9999;
args.resolution_mm = 0.05;
+ args.extrusion_rate_variance_percent = 1000;
arc_welder arc_welder_obj(args);
arc_welder_results results = arc_welder_obj.process();