de.grogra.math
public final class BSpline extends java.lang.Object
| Modifier and Type | Class and Description |
|---|---|
static interface |
BSpline.BezierPatchVisitor |
static interface |
BSpline.BezierSegmentVisitor |
| Modifier and Type | Field and Description |
|---|---|
static EnumerationType |
SPLINE_PLANE_TYPE |
| Modifier and Type | Method and Description |
|---|---|
static void |
calculateBasisFunctions(float[] out,
int p,
KnotVector knots,
int kd,
int span,
float u,
GraphState gs,
float[] left,
float[] right) |
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.
|
static void |
calculateKnotsAndParameters(float[] points,
int n,
int d,
int p,
boolean centripetal,
KnotVectorImpl knots,
float[] params) |
static void |
decompose(BSpline.BezierPatchVisitor v,
BSplineSurface surface,
boolean normalizeUV,
GraphState state,
VertexGridImpl controlPointsOut) |
static void |
decompose(BSpline.BezierSegmentVisitor v,
BSplineCurve curve,
boolean normalizeU,
GraphState gs) |
static void |
decomposeSplineConnection(BSpline.BezierSegmentVisitor v,
BSplineCurve curve,
Pool pool2,
GraphState gs) |
static void |
evaluate(float[] out,
BSplineCurve curve,
float u,
GraphState gs) |
static void |
evaluate(float[] out,
BSplineSurface surface,
float u,
float v,
GraphState gs) |
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.
|
static float |
getDefaultKnot(int size,
int degree,
boolean periodic,
boolean bezier,
int index) |
static void |
interpolate(float[] points,
int n,
int d,
int p,
KnotVectorImpl knots,
float[] params,
float[] tmp,
float[] left,
float[] right) |
static boolean |
isValid(BSplineCurve curve,
GraphState gs) |
static boolean |
isValid(BSplineSurface surface,
GraphState gs) |
static int[] |
makeCompatible(FloatList out,
BSplineCurveList curves,
float knotEps,
int dimension,
boolean makeRational,
GraphState gs) |
static void |
makeDefaultKnotVector(float[] knots,
int offset,
int size,
int degree,
boolean periodic) |
static void |
raiseDegreeInsertKnots(BSplineCurve curve,
boolean leftclamped,
int[] multiplicity,
int resDegree,
float[] resKnots,
int[] resMultiplicity,
float[] verticesOut,
GraphState gs,
float[] tmp) |
static void |
refineKnotVector(BSplineCurve curve,
float[] newKnots,
float[] knotsOut,
int ki,
float[] verticesOut,
int vi,
GraphState gs,
float[] tmp) |
static int |
set(float[] out,
float c0,
float c1) |
static int |
set(float[] out,
float c0,
float c1,
float c2) |
static int |
set(float[] out,
float c0,
float c1,
float c2,
float c3) |
static int |
set(float[] out,
float c0,
float c1,
float c2,
float c3,
float c4,
float c5) |
static int |
set(float[] out,
float c0,
float c1,
float c2,
float c3,
float c4,
float c5,
float c6) |
static void |
set(Tuple4f out,
float[] in,
int n,
boolean w) |
static void |
set(Tuple4f out,
float[] in,
int offset,
int n,
boolean w) |
public static final EnumerationType SPLINE_PLANE_TYPE
public static void calculateBasisFunctions(float[] out,
int p,
KnotVector knots,
int kd,
int span,
float u,
GraphState gs,
float[] left,
float[] right)
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)
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).out - the computed basis functions and derivates are written
to this arrayp - the degree of the basis functionsknots - the knot vectorkd - the dimension-argument for the knot vectorspan - the span index of the knot vectoru - the parametern - compute up to the n-th derivativegs - the GraphState contextleft - a temporary array, minimal size is p + 1right - a temporary array, minimal size is p + 1ndu - a temporary array, minimal size is
(p + 1)2public static void calculateKnotsAndParameters(float[] points,
int n,
int d,
int p,
boolean centripetal,
KnotVectorImpl knots,
float[] params)
public static void decompose(BSpline.BezierPatchVisitor v, BSplineSurface surface, boolean normalizeUV, GraphState state, VertexGridImpl controlPointsOut)
public static void decompose(BSpline.BezierSegmentVisitor v, BSplineCurve curve, boolean normalizeU, GraphState gs)
public static void decomposeSplineConnection(BSpline.BezierSegmentVisitor v, BSplineCurve curve, Pool pool2, GraphState gs)
public static void evaluate(float[] out,
BSplineCurve curve,
float u,
GraphState gs)
public static void evaluate(float[] out,
BSplineSurface surface,
float u,
float v,
GraphState gs)
public static int findSpan(int n,
int p,
float u,
KnotVector knots,
int kd,
GraphState gs)
n - the number of control points minus onep - the degree of the basis functions.u - the parameterknots - the knot vectorkd - the dimension-argument for the knot vectorgs - the GraphState contextpublic static float getDefaultKnot(int size,
int degree,
boolean periodic,
boolean bezier,
int index)
public static void interpolate(float[] points,
int n,
int d,
int p,
KnotVectorImpl knots,
float[] params,
float[] tmp,
float[] left,
float[] right)
public static boolean isValid(BSplineCurve curve, GraphState gs)
public static boolean isValid(BSplineSurface surface, GraphState gs)
public static int[] makeCompatible(FloatList out, BSplineCurveList curves, float knotEps, int dimension, boolean makeRational, GraphState gs)
public static void makeDefaultKnotVector(float[] knots,
int offset,
int size,
int degree,
boolean periodic)
public static void raiseDegreeInsertKnots(BSplineCurve curve, boolean leftclamped, int[] multiplicity, int resDegree, float[] resKnots, int[] resMultiplicity, float[] verticesOut, GraphState gs, float[] tmp)
public static void refineKnotVector(BSplineCurve curve, float[] newKnots, float[] knotsOut, int ki, float[] verticesOut, int vi, GraphState gs, float[] tmp)
public static int set(float[] out,
float c0,
float c1)
public static int set(float[] out,
float c0,
float c1,
float c2)
public static int set(float[] out,
float c0,
float c1,
float c2,
float c3)
public static int set(float[] out,
float c0,
float c1,
float c2,
float c3,
float c4,
float c5)
public static int set(float[] out,
float c0,
float c1,
float c2,
float c3,
float c4,
float c5,
float c6)
public static void set(Tuple4f out, float[] in, int n, boolean w)
public static void set(Tuple4f out, float[] in, int offset, int n, boolean w)