BlinkenArea - GitList
Repositories
Blog
Wiki
dxfngc
Code
Commits
Branches
Tags
Search
Tree:
b44cc2a
Branches
Tags
master
dxfngc
src
path.h
implement joining and improving paths
Stefan Schuermans
commited
b44cc2a
at 2013-01-26 23:15:34
path.h
Blame
History
Raw
/* drawing (DXF) to G-code (NGC) converter * Copyright 2013 Stefan Schuermans <stefan@schuermans.info> * Copyleft: CC-BY-SA http://creativecommons.org/licenses/by-sa/3.0/ */ #ifndef PATH_H #define PATH_H #include <vector> #include "gcode.h" #include "point.h" #include "settings.h" /// a 2D path, i.e. a number of connected lines in 2D space class Path { public: typedef std::vector<Point> Points; ///< type for points of path /** * @brief add a new point to the end of the path * @param[in] point point to add */ void addPoint(const Point &point); /** * @brief add a new point to the end of the path * @param[in] x x coordinate of point to add * @param[in] y y coordinate of point to add */ void addPoint(double x, double y); /** * @brief prepend other path to this one * @param[in] other other path to prepend */ void prependPath(const Path &other); /** * @brief prepend other path in reverse to this one * @param[in] other other path to prepend */ void prependReversedPath(const Path &other); /** * @brief append other path to this one * @param[in] other other path to appepend */ void appendPath(const Path &other); /** * @brief append other path in reverse to this one * @param[in] other other path to appepend */ void appendReversedPath(const Path &other); /** * @brief remove points too close to each other * @param[in] eqDist maximum distance of two points to be considered equal */ void removeEqPoints(double eqDist); /** * @brief convert path to G-code * @param[in] settings G-code creation settings * @param[in,out] gcode new G-code is appended to existing G-code */ void toGCode(const Settings &settings, GCode &gcode) const; Points mPoints; ///< points of path }; #endif // #ifndef PATH_H