diff options
author | FormerLurker <hochgebe@gmail.com> | 2020-05-17 01:17:15 +0300 |
---|---|---|
committer | FormerLurker <hochgebe@gmail.com> | 2020-05-17 01:17:15 +0300 |
commit | d201085f565ed498d218ece1783a5c76bcfdb25d (patch) | |
tree | aaa7304ecb0c89c0fdb5e4930e7db7a5897d907e /ArcWelder/segmented_arc.h | |
parent | f98db3c33c4199eb966c45c9ab2e914b3a689ae1 (diff) |
Add max_radius_mm and switch to polar coordinates for arc generation.
Diffstat (limited to 'ArcWelder/segmented_arc.h')
-rw-r--r-- | ArcWelder/segmented_arc.h | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/ArcWelder/segmented_arc.h b/ArcWelder/segmented_arc.h index 416fd3e..4a19b5c 100644 --- a/ArcWelder/segmented_arc.h +++ b/ArcWelder/segmented_arc.h @@ -29,12 +29,13 @@ #include <sstream> #define GCODE_CHAR_BUFFER_SIZE 100 +#define DEFAULT_MAX_RADIUS_MM 1000000.0 // 1km class segmented_arc : public segmented_shape { public: segmented_arc(); - segmented_arc(int max_segments, double resolution_mm); + segmented_arc(int min_segments, int max_segments, double resolution_mm, double max_radius); virtual ~segmented_arc(); virtual bool try_add_point(point p, double e_relative); std::string get_shape_gcode_absolute(double e, double f); @@ -47,14 +48,13 @@ public: // static gcode buffer private: - char gcode_buffer_[GCODE_CHAR_BUFFER_SIZE]; + char gcode_buffer_[GCODE_CHAR_BUFFER_SIZE + 1]; bool try_add_point_internal_(point p, double pd); - bool does_circle_fit_points_(circle c, point p, double additional_distance); - bool try_get_arc_(circle& c, point endpoint, double additional_distance, arc & target_arc); + bool does_circle_fit_points_(const circle& c); + bool try_get_arc_(const circle& c, arc& target_arc); std::string get_shape_gcode_(bool has_e, double e, double f); - int min_segments_; circle arc_circle_; int test_count_ = 0; - std::ostringstream s_stream_; + double max_radius_mm_; }; |