Module math

Class BSpline

java.lang.Object
de.grogra.math.BSpline

public final class BSpline extends Object
  • Field Details

    • SPLINE_PLANE_TYPE

      public static final EnumerationType SPLINE_PLANE_TYPE
  • Method Details

    • isValid

      public static boolean isValid(BSplineCurve curve, GraphState gs)
    • isValid

      public static boolean isValid(BSplineSurface surface, GraphState gs)
    • getDefaultKnot

      public static float getDefaultKnot(int size, int degree, boolean periodic, boolean bezier, int index)
    • makeDefaultKnotVector

      public static void makeDefaultKnotVector(float[] knots, int offset, int size, int degree, boolean periodic)
    • findSpan

      public static int findSpan(int n, int p, float u, KnotVector knots, int kd, GraphState gs)
      Determines the knot span index i for B-Spline basis functions. It is determined such that ti <= u < ti+1, where t is the knot vector.
      Parameters:
      n - the number of control points minus one
      p - the degree of the basis functions.
      u - the parameter
      knots - the knot vector
      kd - the dimension-argument for the knot vector
      gs - the GraphState context
      Returns:
      the span index i`
    • calculateBasisFunctions

      public static void calculateBasisFunctions(float[] out, int p, KnotVector knots, int kd, int span, float u, GraphState gs, float[] left, float[] right)
    • calculateDerivatives

      public static void calculateDerivatives(float[] out, int p, KnotVector knots, int kd, int span, float u, int n, GraphState gs, float[] left, float[] right, float[] ndu)
      Computes B-Spline basis functions and their derivatives at a given parameter value. The computed values are written to out: The k-th derivative of the r-th basis function is written to the component with index k * (p + 1) + (r + p - span). Note that only the basis functions with span - p <= r <= span are computed (because the others are zero).
      Parameters:
      out - the computed basis functions and derivates are written to this array
      p - the degree of the basis functions
      knots - the knot vector
      kd - the dimension-argument for the knot vector
      span - the span index of the knot vector
      u - the parameter
      n - compute up to the n-th derivative
      gs - the GraphState context
      left - a temporary array, minimal size is p + 1
      right - a temporary array, minimal size is p + 1
      ndu - a temporary array, minimal size is (p + 1)2
    • evaluate

      public static void evaluate(float[] out, BSplineCurve curve, float u, GraphState gs)
    • evaluate

      public static void evaluate(float[] out, BSplineSurface surface, float u, float v, GraphState gs)
    • calculateKnotsAndParameters

      public static void calculateKnotsAndParameters(float[] points, int n, int d, int p, boolean centripetal, KnotVectorImpl knots, float[] params)
    • interpolate

      public static void interpolate(float[] points, int n, int d, int p, KnotVectorImpl knots, float[] params, float[] tmp, float[] left, float[] right)
    • refineKnotVector

      public static void refineKnotVector(BSplineCurve curve, float[] newKnots, float[] knotsOut, int ki, float[] verticesOut, int vi, GraphState gs, float[] tmp)
    • raiseDegreeInsertKnots

      public static void raiseDegreeInsertKnots(BSplineCurve curve, boolean leftclamped, int[] multiplicity, int resDegree, float[] resKnots, int[] resMultiplicity, float[] verticesOut, GraphState gs, float[] tmp)
    • makeCompatible

      public static int[] makeCompatible(FloatList out, BSplineCurveList curves, float knotEps, int dimension, boolean makeRational, GraphState gs)
    • decomposeSplineConnection

      public static void decomposeSplineConnection(BSpline.BezierSegmentVisitor v, BSplineCurve curve, Pool pool2, GraphState gs)
    • decompose

      public static void decompose(BSpline.BezierSegmentVisitor v, BSplineCurve curve, boolean normalizeU, GraphState gs)
    • decompose

      public static void decompose(BSpline.BezierPatchVisitor v, BSplineSurface surface, boolean normalizeUV, GraphState state, VertexGridImpl controlPointsOut)
    • set

      public static void set(Tuple4f out, float[] in, int n, boolean w)
    • set

      public static void set(Tuple4f out, float[] in, int offset, int n, boolean w)
    • set

      public static int set(float[] out, float c0, float c1)
    • set

      public static int set(float[] out, float c0, float c1, float c2)
    • set

      public static int set(float[] out, float c0, float c1, float c2, float c3)
    • set

      public static int set(float[] out, float c0, float c1, float c2, float c3, float c4, float c5)
    • set

      public static int set(float[] out, float c0, float c1, float c2, float c3, float c4, float c5, float c6)