diff options
author | FormerLurker <hochgebe@gmail.com> | 2020-11-24 03:18:31 +0300 |
---|---|---|
committer | FormerLurker <hochgebe@gmail.com> | 2020-11-24 03:18:31 +0300 |
commit | 359b6e92bf252a9ab6485179aee7f3148108aa86 (patch) | |
tree | 59d9c44a29177b08e249e88e04ed65621693d378 | |
parent | f2b52d935ebc81a2eb12cfd7a1c4b924cfc5ea68 (diff) |
Rename allow_z_axis_changes to allow_3d_arcs.
-rw-r--r-- | ArcWelder/arc_welder.cpp | 16 | ||||
-rw-r--r-- | ArcWelder/arc_welder.h | 4 | ||||
-rw-r--r-- | ArcWelder/segmented_arc.cpp | 16 | ||||
-rw-r--r-- | ArcWelder/segmented_arc.h | 4 | ||||
-rw-r--r-- | ArcWelder/segmented_shape.cpp | 28 | ||||
-rw-r--r-- | ArcWelder/segmented_shape.h | 12 | ||||
-rw-r--r-- | ArcWelderConsole/ArcWelderConsole.cpp | 18 | ||||
-rw-r--r-- | PyArcWelder/py_arc_welder.h | 4 | ||||
-rw-r--r-- | PyArcWelder/py_arc_welder_extension.cpp | 12 | ||||
-rw-r--r-- | PyArcWelder/py_arc_welder_extension.h | 8 |
10 files changed, 61 insertions, 61 deletions
diff --git a/ArcWelder/arc_welder.cpp b/ArcWelder/arc_welder.cpp index 5fb9c82..981eeec 100644 --- a/ArcWelder/arc_welder.cpp +++ b/ArcWelder/arc_welder.cpp @@ -45,7 +45,7 @@ arc_welder::arc_welder( int min_arc_segments, double mm_per_arc_segment, bool g90_g91_influences_extruder, - bool allow_z_axis_changes, + bool allow_3d_arcs, int buffer_size, progress_callback callback) : current_arc_( DEFAULT_MIN_SEGMENTS, @@ -55,7 +55,7 @@ arc_welder::arc_welder( max_radius, min_arc_segments, mm_per_arc_segment, - allow_z_axis_changes + allow_3d_arcs ), segment_statistics_( segment_statistic_lengths, @@ -76,7 +76,7 @@ arc_welder::arc_welder( source_path_ = source_path; target_path_ = target_path; gcode_position_args_ = get_args_(g90_g91_influences_extruder, buffer_size); - allow_z_axis_changes_ = allow_z_axis_changes; + allow_3d_arcs_ = allow_3d_arcs; notification_period_seconds = 1; lines_processed_ = 0; gcodes_processed_ = 0; @@ -195,7 +195,7 @@ arc_welder_results results; << ", min_arc_segments:" << std::setprecision(0) <<current_arc_.get_min_arc_segments() << ", mm_per_arc_segment:" << std::setprecision(0) << current_arc_.get_mm_per_arc_segment() << ", g90_91_influences_extruder: " << (p_source_position_->get_g90_91_influences_extruder() ? "True" : "False") - << ", allow_z_axis_changes: " << (allow_z_axis_changes_ ? "True" : "False"); + << ", allow_3d_arcs: " << (allow_3d_arcs_ ? "True" : "False"); p_logger_->log(logger_type_, INFO, stream.str()); @@ -389,7 +389,7 @@ int arc_welder::process_gcode(parsed_command cmd, bool is_end, bool is_reprocess { double movement_length_mm; - if (allow_z_axis_changes_) { + if (allow_3d_arcs_) { movement_length_mm = utilities::get_cartesian_distance(p_pre_pos->x, p_pre_pos->y, p_pre_pos->z, p_cur_pos->x, p_cur_pos->y, p_cur_pos->z); } else { @@ -423,7 +423,7 @@ int arc_welder::process_gcode(parsed_command cmd, bool is_end, bool is_reprocess } } - bool z_axis_ok = allow_z_axis_changes_ || + bool z_axis_ok = allow_3d_arcs_ || utilities::is_equal(p_cur_pos->z, p_pre_pos->z); if ( @@ -500,7 +500,7 @@ int arc_welder::process_gcode(parsed_command cmd, bool is_end, bool is_reprocess { p_logger_->log(logger_type_, DEBUG, "Command '"+ cmd.command + "' is not G0/G1, skipping. Gcode:" + cmd.gcode); } - else if (!allow_z_axis_changes_ && !utilities::is_equal(p_cur_pos->z, p_pre_pos->z)) + else if (!allow_3d_arcs_ && !utilities::is_equal(p_cur_pos->z, p_pre_pos->z)) { p_logger_->log(logger_type_, DEBUG, "Z axis position changed, cannot convert:" + cmd.gcode); } @@ -695,7 +695,7 @@ int arc_welder::process_gcode(parsed_command cmd, bool is_end, bool is_reprocess { position* prev_pos = p_source_position_->get_previous_position_ptr(); length = 0; - if (allow_z_axis_changes_) + if (allow_3d_arcs_) { length = utilities::get_cartesian_distance(cur_pos->x, cur_pos->y, cur_pos->z, prev_pos->x, prev_pos->y, prev_pos->z); } diff --git a/ArcWelder/arc_welder.h b/ArcWelder/arc_welder.h index 79b7712..22cf4b6 100644 --- a/ArcWelder/arc_welder.h +++ b/ArcWelder/arc_welder.h @@ -422,7 +422,7 @@ public: int min_arc_segments, double mm_per_arc_segment, bool g90_g91_influences_extruder = DEFAULT_G90_G91_INFLUENCES_EXTRUDER, - bool allow_z_axis_changes = DEFAULT_ALLOW_Z_AXIS_CHANGES, + bool allow_3d_arcs = DEFAULT_allow_3d_arcs, int buffer_size = DEFAULT_GCODE_BUFFER_SIZE, progress_callback callback = NULL); void set_logger_type(int logger_type); @@ -448,7 +448,7 @@ private: std::string target_path_; double resolution_mm_; gcode_position_args gcode_position_args_; - bool allow_z_axis_changes_; + bool allow_3d_arcs_; long file_size_; int lines_processed_; int gcodes_processed_; diff --git a/ArcWelder/segmented_arc.cpp b/ArcWelder/segmented_arc.cpp index 8ee8adb..bd4b964 100644 --- a/ArcWelder/segmented_arc.cpp +++ b/ArcWelder/segmented_arc.cpp @@ -35,7 +35,7 @@ segmented_arc::segmented_arc() : segmented_shape(DEFAULT_MIN_SEGMENTS, DEFAULT_M { max_radius_mm_ = DEFAULT_MAX_RADIUS_MM; min_arc_segments_ = DEFAULT_MIN_ARC_SEGMENTS, - allow_z_axis_changes_ = DEFAULT_ALLOW_Z_AXIS_CHANGES; + allow_3d_arcs_ = DEFAULT_allow_3d_arcs; } segmented_arc::segmented_arc( @@ -46,7 +46,7 @@ segmented_arc::segmented_arc( double max_radius_mm, int min_arc_segments, double mm_per_arc_segment, - bool allow_z_axis_changes + bool allow_3d_arcs ) : segmented_shape(min_segments, max_segments, resolution_mm, path_tolerance_percent) { max_radius_mm_ = max_radius_mm; @@ -63,7 +63,7 @@ segmented_arc::segmented_arc( { min_arc_segments_ = 0; } - allow_z_axis_changes_ = allow_z_axis_changes; + allow_3d_arcs_ = allow_3d_arcs; } segmented_arc::~segmented_arc() @@ -122,7 +122,7 @@ bool segmented_arc::try_add_point(point p, double e_relative) if (points_.count() > 0) { point p1 = points_[points_.count() - 1]; - if (allow_z_axis_changes_) { + if (allow_3d_arcs_) { // If we can draw arcs in 3 space, add in the distance of the z axis changes distance = utilities::get_cartesian_distance(p1.x, p1.y, p1.z, p.x, p.y, p.z); } @@ -151,7 +151,7 @@ bool segmented_arc::try_add_point(point p, double e_relative) original_shape_length_ += distance; if (points_.count() == get_min_segments()) { - if (!arc::try_create_arc(points_, current_arc_, original_shape_length_, max_radius_mm_, resolution_mm_, path_tolerance_percent_, min_arc_segments_, mm_per_arc_segment_, xyz_precision_, allow_z_axis_changes_)) + if (!arc::try_create_arc(points_, current_arc_, original_shape_length_, max_radius_mm_, resolution_mm_, path_tolerance_percent_, min_arc_segments_, mm_per_arc_segment_, xyz_precision_, allow_3d_arcs_)) { point_added = false; points_.pop_back(); @@ -183,7 +183,7 @@ bool segmented_arc::try_add_point(point p, double e_relative) // We have to remove the distance and e relative value // accumulated between the old arc start point and the new point new_initial_point = points_[0]; - if (allow_z_axis_changes_) { + if (allow_3d_arcs_) { original_shape_length_ -= utilities::get_cartesian_distance(old_initial_point.x, old_initial_point.y, old_initial_point.z, new_initial_point.x, new_initial_point.y, new_initial_point.z); } else { @@ -212,7 +212,7 @@ bool segmented_arc::try_add_point_internal_(point p, double pd) double previous_shape_length = original_shape_length_; original_shape_length_ += pd; - if (arc::try_create_arc(points_, current_arc_, original_shape_length_, max_radius_mm_, resolution_mm_, path_tolerance_percent_, min_arc_segments_, mm_per_arc_segment_, xyz_precision_, allow_z_axis_changes_)) + if (arc::try_create_arc(points_, current_arc_, original_shape_length_, max_radius_mm_, resolution_mm_, path_tolerance_percent_, min_arc_segments_, mm_per_arc_segment_, xyz_precision_, allow_3d_arcs_)) { if (!is_shape()) { @@ -266,7 +266,7 @@ std::string segmented_arc::get_shape_gcode_(bool has_e, double e, double f) cons gcode += " Y"; gcode += utilities::to_string(current_arc_.end_point.y, xyz_precision_, buf, false); - if (allow_z_axis_changes_) + if (allow_3d_arcs_) { // We may need to add a z coordinate double z_initial = current_arc_.start_point.z; diff --git a/ArcWelder/segmented_arc.h b/ArcWelder/segmented_arc.h index 6705e2e..10ad7f0 100644 --- a/ArcWelder/segmented_arc.h +++ b/ArcWelder/segmented_arc.h @@ -43,7 +43,7 @@ public: double max_radius_mm = DEFAULT_MAX_RADIUS_MM, int min_arc_segments = DEFAULT_MIN_ARC_SEGMENTS, double mm_per_arc_segment = DEFAULT_MM_PER_ARC_SEGMENT, - bool allow_z_axis_changes = DEFAULT_ALLOW_Z_AXIS_CHANGES + bool allow_3d_arcs = DEFAULT_allow_3d_arcs ); virtual ~segmented_arc(); virtual bool try_add_point(point p, double e_relative); @@ -67,6 +67,6 @@ private: double max_radius_mm_; int min_arc_segments_; double mm_per_arc_segment_; - bool allow_z_axis_changes_; + bool allow_3d_arcs_; }; diff --git a/ArcWelder/segmented_shape.cpp b/ArcWelder/segmented_shape.cpp index 7a7f8c2..945c912 100644 --- a/ArcWelder/segmented_shape.cpp +++ b/ArcWelder/segmented_shape.cpp @@ -198,7 +198,7 @@ bool circle::try_create_circle(const point& p1, const point& p2, const point& p3 return true; } -bool circle::try_create_circle(const array_list<point>& points, const double max_radius, const double resolution_mm, const int xyz_precision, bool allow_z_axis_changes, bool check_middle_only, circle& new_circle) +bool circle::try_create_circle(const array_list<point>& points, const double max_radius, const double resolution_mm, const int xyz_precision, bool allow_3d_arcs, bool check_middle_only, circle& new_circle) { int middle_index = points.count() / 2; int check_index; @@ -210,7 +210,7 @@ bool circle::try_create_circle(const array_list<point>& points, const double max // Check the index if (circle::try_create_circle(points[0], points[check_index], points[points.count() - 1], max_radius, new_circle)) { - if (!new_circle.is_over_deviation(points, resolution_mm, xyz_precision, allow_z_axis_changes)) + if (!new_circle.is_over_deviation(points, resolution_mm, xyz_precision, allow_3d_arcs)) { return true; } @@ -269,19 +269,19 @@ point circle::get_closest_point(const point& p) const return point(px, py, pz, 0); } -bool circle::is_over_deviation(const array_list<point>& points, const double resolution_mm, const int xyz_precision, const bool allow_z_axis_changes) +bool circle::is_over_deviation(const array_list<point>& points, const double resolution_mm, const int xyz_precision, const bool allow_3d_arcs) { // We need to ensure that the Z steps are constand per linear travel unit double z_step_per_distance = 0; // Skip the first and last points since they will fit perfectly. // UNLESS allow z changes is set to true, then we need to do some different stuff - int final_index = points.count() - 1 + (allow_z_axis_changes ? 1 : 0); + int final_index = points.count() - 1 + (allow_3d_arcs ? 1 : 0); for (int index = 1; index < points.count() - 1; index++) { // Make sure the length from the center of our circle to the test point is // at or below our max distance. double distance = distance = utilities::get_cartesian_distance(points[index].x, points[index].y, center.x, center.y); - if (allow_z_axis_changes) { + if (allow_3d_arcs) { double z1 = points[index - 1].z; double z2 = points[index].z; @@ -334,7 +334,7 @@ bool arc::try_create_arc( double path_tolerance_percent, int min_arc_segments, double mm_per_arc_segment, - bool allow_z_axis_changes) + bool allow_3d_arcs) { double polar_start_theta = c.get_polar_radians(start_point); double polar_mid_theta = c.get_polar_radians(mid_point); @@ -385,7 +385,7 @@ bool arc::try_create_arc( // got the direction wrong double arc_length = c.radius * angle_radians; - if (allow_z_axis_changes) + if (allow_3d_arcs) { // We may be traveling in 3 space, calculate the arc_length of the spiral if (start_point.z != end_point.z) @@ -407,7 +407,7 @@ bool arc::try_create_arc( double test_radians = std::abs(angle_radians - 2 * PI_DOUBLE); // Calculate the length of that arc double test_arc_length = c.radius * test_radians; - if (allow_z_axis_changes) + if (allow_3d_arcs) { // We may be traveling in 3 space, calculate the arc_length of the spiral if (start_point.z != end_point.z) @@ -425,7 +425,7 @@ bool arc::try_create_arc( direction = direction == 1 ? 2 : 1; } - if (allow_z_axis_changes) + if (allow_3d_arcs) { // Ensure the perimeter of the arc is less than that of a full circle double perimeter = utilities::hypot(c.radius * 2.0 * PI_DOUBLE, end_point.z - start_point.z); @@ -477,10 +477,10 @@ bool arc::try_create_arc( double path_tolerance_percent, int min_arc_segments, double mm_per_arc_segment, - bool allow_z_axis_changes) + bool allow_3d_arcs) { int mid_point_index = ((points.count() - 2) / 2) + 1; - return arc::try_create_arc(c, points[0], points[mid_point_index], points[points.count() - 1], target_arc, approximate_length, resolution, path_tolerance_percent, min_arc_segments, mm_per_arc_segment, allow_z_axis_changes); + return arc::try_create_arc(c, points[0], points[mid_point_index], points[points.count() - 1], target_arc, approximate_length, resolution, path_tolerance_percent, min_arc_segments, mm_per_arc_segment, allow_3d_arcs); } bool arc::try_create_arc( const array_list<point>& points, @@ -492,13 +492,13 @@ bool arc::try_create_arc( int min_arc_segments, double mm_per_arc_segment, int xyz_precision, - bool allow_z_axis_changes) + bool allow_3d_arcs) { circle test_circle; - if (circle::try_create_circle(points, max_radius_mm, resolution_mm, xyz_precision, allow_z_axis_changes, false, test_circle)) + if (circle::try_create_circle(points, max_radius_mm, resolution_mm, xyz_precision, allow_3d_arcs, false, test_circle)) { int mid_point_index = ((points.count() - 2) / 2) + 1; - return arc::try_create_arc(test_circle, points[0], points[mid_point_index], points[points.count() - 1], target_arc, approximate_length, resolution_mm, path_tolerance_percent, min_arc_segments, mm_per_arc_segment, allow_z_axis_changes); + return arc::try_create_arc(test_circle, points[0], points[mid_point_index], points[points.count() - 1], target_arc, approximate_length, resolution_mm, path_tolerance_percent, min_arc_segments, mm_per_arc_segment, allow_3d_arcs); } return false; } diff --git a/ArcWelder/segmented_shape.h b/ArcWelder/segmented_shape.h index af7d8be..7e57c54 100644 --- a/ArcWelder/segmented_shape.h +++ b/ArcWelder/segmented_shape.h @@ -109,7 +109,7 @@ struct circle { static bool try_create_circle(const point &p1, const point &p2, const point &p3, const double max_radius, circle& new_circle); - static bool try_create_circle(const array_list<point>& points, const double max_radius, const double resolutino_mm, const int xyz_precision, bool allow_z_axis_changes, bool check_middle_only, circle& new_circle); + static bool try_create_circle(const array_list<point>& points, const double max_radius, const double resolutino_mm, const int xyz_precision, bool allow_3d_arcs, bool check_middle_only, circle& new_circle); double get_radians(const point& p1, const point& p2) const; @@ -117,11 +117,11 @@ struct circle { point get_closest_point(const point& p) const; - bool is_over_deviation(const array_list<point>& points, const double resolution_mm, const int xyz_precision, const bool allow_z_axis_changes); + bool is_over_deviation(const array_list<point>& points, const double resolution_mm, const int xyz_precision, const bool allow_3d_arcs); }; #define DEFAULT_RESOLUTION_MM 0.05 -#define DEFAULT_ALLOW_Z_AXIS_CHANGES false +#define DEFAULT_allow_3d_arcs false #define DEFAULT_MIN_ARC_SEGMENTS 0 #define DEFAULT_MM_PER_ARC_SEGMENT 0 struct arc : circle @@ -165,7 +165,7 @@ struct arc : circle double path_tolerance_percent = ARC_LENGTH_PERCENT_TOLERANCE_DEFAULT, int min_arc_segments = DEFAULT_MIN_ARC_SEGMENTS, double mm_per_arc_segment = DEFAULT_MM_PER_ARC_SEGMENT, - bool allow_z_axis_changes = DEFAULT_ALLOW_Z_AXIS_CHANGES); + bool allow_3d_arcs = DEFAULT_allow_3d_arcs); static bool try_create_arc( const circle& c, const array_list<point>& points, @@ -175,7 +175,7 @@ struct arc : circle double path_tolerance_percent = ARC_LENGTH_PERCENT_TOLERANCE_DEFAULT, int min_arc_segments = DEFAULT_MIN_ARC_SEGMENTS, double mm_per_arc_segment = DEFAULT_MM_PER_ARC_SEGMENT, - bool allow_z_axis_changes = DEFAULT_ALLOW_Z_AXIS_CHANGES); + bool allow_3d_arcs = DEFAULT_allow_3d_arcs); static bool try_create_arc( const array_list<point>& points, arc& target_arc, @@ -186,7 +186,7 @@ struct arc : circle int min_arc_segments = DEFAULT_MIN_ARC_SEGMENTS, double mm_per_arc_segment = DEFAULT_MM_PER_ARC_SEGMENT, int xyz_precision = DEFAULT_XYZ_PRECISION, - bool allow_z_axis_changes = DEFAULT_ALLOW_Z_AXIS_CHANGES); + bool allow_3d_arcs = DEFAULT_allow_3d_arcs); }; double distance_from_segment(segment s, point p); diff --git a/ArcWelderConsole/ArcWelderConsole.cpp b/ArcWelderConsole/ArcWelderConsole.cpp index f9c22d4..bf7c63f 100644 --- a/ArcWelderConsole/ArcWelderConsole.cpp +++ b/ArcWelderConsole/ArcWelderConsole.cpp @@ -46,7 +46,7 @@ int main(int argc, char* argv[]) bool g90_g91_influences_extruder; bool hide_progress; bool overwrite_source_file = false; - bool allow_z_axis_changes = false; + bool allow_3d_arcs = false; std::string log_level_string; std::string log_level_string_default = "INFO"; int log_level_value; @@ -111,11 +111,11 @@ int main(int argc, char* argv[]) arg_description_stream << "If supplied, G90/G91 influences the extruder axis. Default Value: " << DEFAULT_G90_G91_INFLUENCES_EXTRUDER; TCLAP::SwitchArg g90_arg("g", "g90-influences-extruder", arg_description_stream.str(), DEFAULT_G90_G91_INFLUENCES_EXTRUDER); - // -z --allow-z-axis-changes + // -z --allow-3d-arcs arg_description_stream.clear(); arg_description_stream.str(""); - arg_description_stream << "(experimental) - If supplied, z-axis changes will be allowed within arcs (supports spiral vase mode). Default Value: " << DEFAULT_ALLOW_Z_AXIS_CHANGES; - TCLAP::SwitchArg allow_z_axis_changes_arg("z", "allow-z-axis-changes", arg_description_stream.str(), DEFAULT_ALLOW_Z_AXIS_CHANGES); + arg_description_stream << "(experimental) - If supplied, 3D arcs will be allowed (supports spiral vase mode). Not all firmware supports this. Default Value: " << DEFAULT_allow_3d_arcs; + TCLAP::SwitchArg allow_3d_arcs_arg("z", "allow-3d-arcs", arg_description_stream.str(), DEFAULT_allow_3d_arcs); // -g --hide-progress TCLAP::SwitchArg hide_progress_arg("p", "hide-progress", "If supplied, prevents progress updates from being displayed.", false); @@ -144,7 +144,7 @@ int main(int argc, char* argv[]) cmd.add(max_radius_arg); cmd.add(min_arc_segments_arg); cmd.add(mm_per_arc_segment_arg); - cmd.add(allow_z_axis_changes_arg); + cmd.add(allow_3d_arcs_arg); cmd.add(g90_arg); cmd.add(hide_progress_arg); cmd.add(log_level_arg); @@ -166,7 +166,7 @@ int main(int argc, char* argv[]) min_arc_segments = min_arc_segments_arg.getValue(); mm_per_arc_segment = mm_per_arc_segment_arg.getValue(); path_tolerance_percent = path_tolerance_percent_arg.getValue(); - allow_z_axis_changes = allow_z_axis_changes_arg.getValue(); + allow_3d_arcs = allow_3d_arcs_arg.getValue(); g90_g91_influences_extruder = g90_arg.getValue(); hide_progress = hide_progress_arg.getValue(); @@ -292,7 +292,7 @@ int main(int argc, char* argv[]) log_messages << "\tMaximum Arc Radius : " << std::setprecision(0) << max_radius_mm << "mm\n"; log_messages << "\tMin Arc Segments : " << std::setprecision(0) << min_arc_segments << "\n"; log_messages << "\tMM Per Arc Segment : " << std::setprecision(3) << mm_per_arc_segment << "\n"; - log_messages << "\tAllow Z-Axis Changes : " << (allow_z_axis_changes ? "True" : "False") << "\n"; + log_messages << "\tAllow Z-Axis Changes : " << (allow_3d_arcs ? "True" : "False") << "\n"; log_messages << "\tG90/G91 Influences Extruder : " << (g90_g91_influences_extruder ? "True" : "False") << "\n"; log_messages << "\tLog Level : " << log_level_string << "\n"; log_messages << "\tHide Progress Updates : " << (hide_progress ? "True" : "False"); @@ -304,9 +304,9 @@ int main(int argc, char* argv[]) target_file_path = temp_file_path; } if (!hide_progress) - p_arc_welder = new arc_welder(source_file_path, target_file_path, p_logger, resolution_mm, path_tolerance_percent, max_radius_mm, min_arc_segments, mm_per_arc_segment, g90_g91_influences_extruder, allow_z_axis_changes, DEFAULT_GCODE_BUFFER_SIZE, on_progress); + p_arc_welder = new arc_welder(source_file_path, target_file_path, p_logger, resolution_mm, path_tolerance_percent, max_radius_mm, min_arc_segments, mm_per_arc_segment, g90_g91_influences_extruder, allow_3d_arcs, DEFAULT_GCODE_BUFFER_SIZE, on_progress); else - p_arc_welder = new arc_welder(source_file_path, target_file_path, p_logger, resolution_mm, path_tolerance_percent, max_radius_mm, min_arc_segments, mm_per_arc_segment, g90_g91_influences_extruder, allow_z_axis_changes, DEFAULT_GCODE_BUFFER_SIZE, suppress_progress); + p_arc_welder = new arc_welder(source_file_path, target_file_path, p_logger, resolution_mm, path_tolerance_percent, max_radius_mm, min_arc_segments, mm_per_arc_segment, g90_g91_influences_extruder, allow_3d_arcs, DEFAULT_GCODE_BUFFER_SIZE, suppress_progress); arc_welder_results results = p_arc_welder->process(); if (results.success) diff --git a/PyArcWelder/py_arc_welder.h b/PyArcWelder/py_arc_welder.h index 979c3d0..14d5760 100644 --- a/PyArcWelder/py_arc_welder.h +++ b/PyArcWelder/py_arc_welder.h @@ -45,7 +45,7 @@ public: int min_arc_segments, double mm_per_arc_segment, bool g90_g91_influences_extruder, - bool allow_z_axis_changes, + bool allow_3d_arcs, int buffer_size, PyObject* py_progress_callback ): arc_welder( @@ -58,7 +58,7 @@ public: min_arc_segments, mm_per_arc_segment, g90_g91_influences_extruder, - allow_z_axis_changes, + allow_3d_arcs, buffer_size ){ guid_ = guid; diff --git a/PyArcWelder/py_arc_welder_extension.cpp b/PyArcWelder/py_arc_welder_extension.cpp index 4796230..5f7553c 100644 --- a/PyArcWelder/py_arc_welder_extension.cpp +++ b/PyArcWelder/py_arc_welder_extension.cpp @@ -196,7 +196,7 @@ extern "C" std::string message = "py_gcode_arc_converter.ConvertFile - Beginning Arc Conversion."; p_py_logger->log(GCODE_CONVERSION, INFO, message); - py_arc_welder arc_welder_obj(args.guid, args.source_path, args.target_path, p_py_logger, args.resolution_mm, args.path_tolerance_percent, args.max_radius_mm, args.min_arc_segments, args.mm_per_arc_segment, args.g90_g91_influences_extruder, args.allow_z_axis_changes, DEFAULT_GCODE_BUFFER_SIZE, py_progress_callback); + py_arc_welder arc_welder_obj(args.guid, args.source_path, args.target_path, p_py_logger, args.resolution_mm, args.path_tolerance_percent, args.max_radius_mm, args.min_arc_segments, args.mm_per_arc_segment, args.g90_g91_influences_extruder, args.allow_3d_arcs, DEFAULT_GCODE_BUFFER_SIZE, py_progress_callback); arc_welder_results results = arc_welder_obj.process(); message = "py_gcode_arc_converter.ConvertFile - Arc Conversion Complete."; p_py_logger->log(GCODE_CONVERSION, INFO, message); @@ -329,15 +329,15 @@ static bool ParseArgs(PyObject* py_args, py_gcode_arc_args& args, PyObject** py_ } // Extract Allow Z Axis Changes - // allow_z_axis_changes - PyObject* py_allow_z_axis_changes = PyDict_GetItemString(py_args, "allow_z_axis_changes"); - if (py_allow_z_axis_changes == NULL) + // allow_3d_arcs + PyObject* py_allow_3d_arcs = PyDict_GetItemString(py_args, "allow_3d_arcs"); + if (py_allow_3d_arcs == NULL) { - std::string message = "ParseArgs - Unable to retrieve allow_z_axis_changes from the args."; + std::string message = "ParseArgs - Unable to retrieve allow_3d_arcs from the args."; p_py_logger->log_exception(GCODE_CONVERSION, message); return false; } - args.allow_z_axis_changes = PyLong_AsLong(py_allow_z_axis_changes) > 0; + args.allow_3d_arcs = PyLong_AsLong(py_allow_3d_arcs) > 0; // Extract G90/G91 influences extruder // g90_influences_extruder diff --git a/PyArcWelder/py_arc_welder_extension.h b/PyArcWelder/py_arc_welder_extension.h index bcd368b..46944a1 100644 --- a/PyArcWelder/py_arc_welder_extension.h +++ b/PyArcWelder/py_arc_welder_extension.h @@ -52,7 +52,7 @@ struct py_gcode_arc_args { min_arc_segments = DEFAULT_MIN_ARC_SEGMENTS; mm_per_arc_segment = DEFAULT_MM_PER_ARC_SEGMENT; g90_g91_influences_extruder = DEFAULT_G90_G91_INFLUENCES_EXTREUDER; - allow_z_axis_changes = DEFAULT_ALLOW_Z_AXIS_CHANGES; + allow_3d_arcs = DEFAULT_allow_3d_arcs; log_level = 0; } py_gcode_arc_args( @@ -65,7 +65,7 @@ struct py_gcode_arc_args { int min_arc_segments_, double mm_per_arc_segment_, bool g90_g91_influences_extruder_, - bool allow_z_axis_changes_, + bool allow_3d_arcs_, int log_level_ ) { guid = guid_; @@ -76,7 +76,7 @@ struct py_gcode_arc_args { max_radius_mm = max_radius_mm_; min_arc_segments = min_arc_segments_; mm_per_arc_segment = mm_per_arc_segment_; - allow_z_axis_changes = allow_z_axis_changes_; + allow_3d_arcs = allow_3d_arcs_; g90_g91_influences_extruder = g90_g91_influences_extruder_; log_level = log_level_; } @@ -85,7 +85,7 @@ struct py_gcode_arc_args { std::string target_path; double resolution_mm; double path_tolerance_percent; - bool allow_z_axis_changes; + bool allow_3d_arcs; bool g90_g91_influences_extruder; double max_radius_mm; int min_arc_segments; |