Home | History | Annotate | Download | only in math

Lines Matching defs:knots

33 		List<Float> knots = nurbSpline.getKnots();

39 float val = weights[i] * CurveAndSurfaceMath.computeBaseFunctionValue(i, nurbSpline.getBasisFunctionDegree(), u, knots);
56 * @param knots
57 * the nurbs' knots
65 public static void interpolate(float u, float v, List<List<Vector4f>> controlPoints, List<Float>[] knots,
75 * CurveAndSurfaceMath.computeBaseFunctionValue(i, basisVFunctionDegree, v, knots[1])
76 * CurveAndSurfaceMath.computeBaseFunctionValue(j, basisUFunctionDegree, u, knots[0]);
85 * This method prepares the knots to be used. If the knots represent non-uniform B-splines (first and last knot values are being
86 * repeated) it leads to NaN results during calculations. This method adds a small number to each of such knots to avoid NaN's.
87 * @param knots
88 * the knots to be prepared to use
94 public static void prepareNurbsKnots(List<Float> knots, int basisFunctionDegree) {
96 float prevValue = knots.get(0).floatValue();
97 for(int i=1;i<knots.size();++i) {
98 float value = knots.get(i).floatValue();
101 knots.set(i, Float.valueOf(value));
119 * @param knots
120 * the knots' values
123 private static float computeBaseFunctionValue(int i, int k, float t, List<Float> knots) {
125 return knots.get(i) <= t && t < knots.get(i + 1) ? 1.0f : 0.0f;
127 return (t - knots.get(i)) / (knots.get(i + k - 1) - knots.get(i)) *
128 CurveAndSurfaceMath.computeBaseFunctionValue(i, k - 1, t, knots)
129 + (knots.get(i + k) - t) / (knots.get(i + k) - knots.get(i + 1)) *
130 CurveAndSurfaceMath.computeBaseFunctionValue(i + 1, k - 1, t, knots);