Commit ef3311f5 authored by Valentin Platzgummer's avatar Valentin Platzgummer

circular survey node distribiution for transects optimized (delta alpha ...)

parent be94fe7e
......@@ -107,7 +107,7 @@ QList<QPointF> Circle::approximate(double angleDiscretisation) const
QList<QPointF> Circle::approximateSektor(int numberOfCorners, double alpha1, double alpha2) const
{
if ( numberOfCorners < 3)
if ( numberOfCorners < 2)
return QList<QPointF>();
return approximateSektor((alpha2-alpha1)/double(numberOfCorners-1), alpha1, alpha2);
}
......
......@@ -481,15 +481,18 @@ void CircularSurveyComplexItem::_rebuildTransectsPhase1()
for (int k = 0; k < entryPoints.size(); k++) {
double alpha1 = angle(entryPoints[k]);
double alpha2 = angle(exitPoints[(k+offset) % entryPoints.size()]);
double dAlpha = alpha2-alpha1;
int numNodes = int(ceil(dAlpha/dalpha)) + 1;
QList<QPointF> sectorPath = circle.approximateSektor(double(dalpha), alpha1, alpha2);
QList<QPointF> sectorPath = circle.approximateSektor(numNodes, alpha1, alpha2);
// use shortestPath() here if necessary, could be a problem if dr >>
if (sectorPath.size() > 0)
transectPath.append(sectorPath);
}
} else if (originInside) {
// circle fully inside polygon
QList<QPointF> sectorPath = circle.approximateSektor(double(dalpha), 0, 2*M_PI);
// circle fully inside polygon
int numNodes = int(ceil(2*M_PI/dalpha)) + 1;
QList<QPointF> sectorPath = circle.approximateSektor(numNodes, 0, 2*M_PI);
// use shortestPath() here if necessary, could be a problem if dr >>
transectPath.append(sectorPath);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment