| 93 | } |
| 94 | |
| 95 | double LNLib::Interpolation::GetCentripetalLength(const std::vector<XYZ>& throughPoints) |
| 96 | { |
| 97 | if (throughPoints.size() < 2) |
| 98 | return 0.0; |
| 99 | |
| 100 | double length = 0.0; |
| 101 | for (size_t i = 1; i < throughPoints.size(); ++i) { |
| 102 | double dist = throughPoints[i].Distance(throughPoints[i - 1]); |
| 103 | length += std::sqrt(dist); |
| 104 | } |
| 105 | return length; |
| 106 | } |
| 107 | |
| 108 | std::vector<double> LNLib::Interpolation::GetCentripetalParameterization(const std::vector<XYZ>& throughPoints) |
| 109 | { |