Commit 3153ae1c by Andrew Maclean Committed by Michael Fogleman

### SgnPower(x,n) returns 0 if abs(x) <= 1.0e-6.

parent 21e91b6c
 ... ... @@ -67,7 +67,7 @@ void vtkParametricConicSpiral::Evaluate(double uvw[3], double Pt[3], Pt[1] = this->A * (1 - v * inv2pi) * snv * (1 + cu) + this->C * snv; Pt[2] = this->B * v * inv2pi + this->A * (1 - v * inv2pi) * su; //The derivatives are: // The derivatives are: Du[0] = -this->A * (1 - v * inv2pi) * cnv * su; Dv[0] = -this->A * inv2pi * cnv * (1 + cu) - this->A * (1 - v * inv2pi) * snv * this->N * (1 + cu) - this->C * snv * N; ... ...
 ... ... @@ -26,6 +26,7 @@ namespace */ double SgnPower(double x, double n) { const double eps = 1.0e-06; if (x == 0) { return 0; ... ... @@ -35,7 +36,11 @@ namespace return 1; } double sgn = (x < 0) ? -1 : 1; return sgn * std::pow(std::abs(x), n); if (std::abs(x) > eps) { return sgn * std::pow(std::abs(x), n); } return 0; } } // anonymous namespace ... ... @@ -85,13 +90,13 @@ void vtkParametricSuperEllipsoid::Evaluate(double uvw[3], double Pt[3], double cv = cos(v); double sv = sin(v); //double tmp = this->Power(sv, N1); double tmp = SgnPower(cv, N1); double tmp = SgnPower(cv, this->N1); // The point Pt[0] = this->YRadius * tmp * SgnPower(su, this->N2); Pt[1] = this->XRadius * tmp * SgnPower(cu, this->N2); Pt[2] = this->ZRadius * SgnPower(sv, this->N1); } //---------------------------------------------------------------------------- ... ...
 ... ... @@ -87,7 +87,8 @@ namespace *(idPtr++) = id3; } } } } // anonymous namespace //---------------------------------------------------------------------------- void vtkParametricFunctionSource::MakeTriangles(vtkCellArray * cells, ... ...
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!