Speedup for flatcurves and NURBS curves getval() functions

This commit is contained in:
heckflosse
2016-05-15 16:07:23 +02:00
parent 56804fca69
commit b23778eebc
4 changed files with 30 additions and 35 deletions

View File

@@ -70,6 +70,18 @@ void Curve::AddPolygons ()
poly_y.push_back(y3);
}
void Curve::fillDyByDx ()
{
dyByDx.resize(poly_x.size() - 1);
for(unsigned int i = 0; i < poly_x.size() - 1; i++) {
double dx = poly_x[i + 1] - poly_x[i];
double dy = poly_y[i + 1] - poly_y[i];
dyByDx[i] = dy / dx;
}
}
void Curve::fillHash()
{
hash.resize(hashSize + 2);