| 19 | namespace LNLib |
| 20 | { |
| 21 | void InsertMidKnotCore(std::vector<double>& unqiueKnotVector, std::vector<double>& insert, int limitNumber) |
| 22 | { |
| 23 | if (insert.size() == limitNumber) |
| 24 | { |
| 25 | return; |
| 26 | } |
| 27 | else |
| 28 | { |
| 29 | double standard = Constants::DoubleEpsilon; |
| 30 | int index = -1; |
| 31 | for (int i = 0; i < unqiueKnotVector.size() - 1; i++) |
| 32 | { |
| 33 | double delta = unqiueKnotVector[i + 1] - unqiueKnotVector[i]; |
| 34 | if (MathUtils::IsGreaterThan(delta, standard)) |
| 35 | { |
| 36 | standard = delta; |
| 37 | index = i; |
| 38 | } |
| 39 | } |
| 40 | double current = unqiueKnotVector[index] + standard / 2.0; |
| 41 | unqiueKnotVector.emplace_back(current); |
| 42 | std::sort(unqiueKnotVector.begin(), unqiueKnotVector.end()); |
| 43 | insert.emplace_back(current); |
| 44 | |
| 45 | InsertMidKnotCore(unqiueKnotVector, insert, limitNumber); |
| 46 | } |
| 47 | } |
| 48 | } |
| 49 | |
| 50 | int LNLib::KnotVectorUtils::GetContinuity(int degree, const std::vector<double>& knotVector, double knot) |
no outgoing calls
no test coverage detected