Check
verb.eval.Check
CLASS
Check
includes various tools for checking the validity of various NURBS data structures. This is important because it is
very easy to construct such data structures with incorrect structure. This class contains static, immutable functions for
doing those checks.
Note that the classes in verb.eval are very tolerant of incorrect NURBS data structures for performance reasons. You should perform these checks before using these classes.
isValidKnotVector
STATIC METHOD
isValidKnotVector(vec : Array<Float>, degree : Int) : Bool
Check whether a given array is a valid NURBS knot vector. This also checks the validity of the end points. More specifically, this method checks if the knot vector is of the following structure:
The knot vector must be non-decreasing and of length (degree + 1) * 2 or greater
[ (degree + 1 copies of the first knot), internal non-decreasing knots, (degree + 1 copies of the last knot) ]
params
- The knot vector to test
- The degree
returns
- Whether the array is a valid knot vector or knot
isNonDecreasing
STATIC METHOD
isNonDecreasing(vec : Array<Float>)
Check if an array of floating point numbers is non-decreasing, although there may be repeats. This is an important validation step for NURBS knot vectors.
params
- The data object
returns
- Whether the array is non-decreasing
isValidNurbsCurveData
STATIC METHOD
isValidNurbsCurveData(data : NurbsCurveData) : NurbsCurveData
Validate a NurbsCurveData object
params
- The data object
returns
- The original, unmodified data
isValidNurbsSurfaceData
STATIC METHOD
isValidNurbsSurfaceData(data : NurbsSurfaceData) : NurbsSurfaceData
Validate a NurbsSurfaceData object
params
- The data object
returns
- The original, unmodified data