java.lang.Object
de.grogra.math.BSpline
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interface
static interface
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic 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
static void
-
Field Details
-
SPLINE_PLANE_TYPE
-
-
Method Details
-
isValid
-
isValid
-
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
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 onep
- the degree of the basis functions.u
- the parameterknots
- the knot vectorkd
- thedimension
-argument for the knot vectorgs
- theGraphState
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 toout
: The k-th derivative of the r-th basis function is written to the component with indexk * (p + 1) + (r + p - span)
. Note that only the basis functions withspan - p <= r <= span
are computed (because the others are zero).- Parameters:
out
- the computed basis functions and derivates are written to this arrayp
- the degree of the basis functionsknots
- the knot vectorkd
- thedimension
-argument for the knot vectorspan
- the span index of the knot vectoru
- the parametern
- compute up to then
-th derivativegs
- theGraphState
contextleft
- a temporary array, minimal size isp
+ 1right
- a temporary array, minimal size isp
+ 1ndu
- a temporary array, minimal size is (p
+ 1)2
-
evaluate
-
evaluate
-
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
-
set
-
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)
-