Stefan Schuermans
adaptions for debian jessie
Stefan Schuermans commited 8125c92 at 2016-04-03 13:08:57
/* drawing (DXF) to G-code (NGC) converter
* Copyright 2013 Stefan Schuermans <stefan@schuermans.info>
* Copyleft: GNU public license - http://www.gnu.org/copyleft/gpl.html
*/
#include <list>
#include "gcode.h"
#include "layer.h"
#include "path.h"
#include "settings.h"
/**
* @brief add a new empty path to the layer
* @return reference to new empty path
*/
Path & Layer::addPath()
{
mPaths.push_back(Path());
return mPaths.back();
}
/**
* @brief improve paths
* @param[in] eqDist maximum distance of two points to be considered equal
*/
void Layer::improvePaths(double eqDist)
{
Paths::iterator path, other, best;
bool change;
double smallest, dist;
// remove empty paths
path = mPaths.begin();
while (path != mPaths.end())
if (path->mPoints.empty())
path = mPaths.erase(path);
else
++path;
// join paths with equal begin/end points
do {
change = false;
// process all paths
for (path = mPaths.begin(); path != mPaths.end(); ++path) {
// check all paths following aftet the current one
other = path;
++other;
while (other != mPaths.end()) {
// paths can be joined
if (other->mPoints.front().equals(path->mPoints.back(),
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX