From 91633ba765214d1c6eece514e2dd2d0e898be8b4 Mon Sep 17 00:00:00 2001 From: FormerLurker Date: Fri, 6 Nov 2020 10:43:13 -0600 Subject: Implementations for #8, #9, #10, #11. --- ArcWelder/segmented_arc.h | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'ArcWelder/segmented_arc.h') diff --git a/ArcWelder/segmented_arc.h b/ArcWelder/segmented_arc.h index 352deab..179d7af 100644 --- a/ArcWelder/segmented_arc.h +++ b/ArcWelder/segmented_arc.h @@ -30,12 +30,19 @@ #define GCODE_CHAR_BUFFER_SIZE 100 #define DEFAULT_MAX_RADIUS_MM 1000000.0 // 1km +//#define DEFAULT_MAX_RADIUS_MM 10000.0 // 10M class segmented_arc : public segmented_shape { public: segmented_arc(); - segmented_arc(int min_segments = DEFAULT_MIN_SEGMENTS, int max_segments = DEFAULT_MAX_SEGMENTS, double resolution_mm = DEFAULT_RESOLUTION_MM, double max_radius_mm = DEFAULT_MAX_RADIUS_MM); + segmented_arc( + int min_segments = DEFAULT_MIN_SEGMENTS, + int max_segments = DEFAULT_MAX_SEGMENTS, + double resolution_mm = DEFAULT_RESOLUTION_MM, + double path_tolerance_percnet = ARC_LENGTH_PERCENT_TOLERANCE_DEFAULT, + double max_radius_mm = DEFAULT_MAX_RADIUS_MM + ); virtual ~segmented_arc(); virtual bool try_add_point(point p, double e_relative); std::string get_shape_gcode_absolute(double e, double f); @@ -51,9 +58,11 @@ public: private: bool try_add_point_internal_(point p, double pd); bool does_circle_fit_points_(circle& c) const; + bool does_arc_fit_points(circle& c) const; bool try_get_arc_(const circle& c, arc& target_arc); + bool is_point_on_arc(const arc& a, const point & p) const; std::string get_shape_gcode_(bool has_e, double e, double f) const; circle arc_circle_; double max_radius_mm_; -}; +}; -- cgit v1.2.3