MCPcopy Create free account
hub / github.com/bgrimstad/splinter / computeKnotVector

Method computeKnotVector

src/bsplinebuilder.cpp:336–351  ·  view source on GitHub ↗

Compute a single knot vector from sample grid and degree

Source from the content-addressed store, hash-verified

334
335// Compute a single knot vector from sample grid and degree
336std::vector<double> BSpline::Builder::computeKnotVector(const std::vector<double> &values,
337 unsigned int degree,
338 unsigned int numBasisFunctions) const
339{
340 switch (_knotSpacing)
341 {
342 case KnotSpacing::AS_SAMPLED:
343 return knotVectorMovingAverage(values, degree);
344 case KnotSpacing::EQUIDISTANT:
345 return knotVectorEquidistant(values, degree, numBasisFunctions);
346 case KnotSpacing::EXPERIMENTAL:
347 return knotVectorBuckets(values, degree);
348 default:
349 return knotVectorMovingAverage(values, degree);
350 }
351}
352
353/*
354* Automatic construction of (p+1)-regular knot vector

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected