Eval

verb.eval.Eval

CLASS

Source code

Eval provides all of the core algorithms for evaluating points and derivatives on NURBS curves and surfaces. Most of the time, it makes more sense to use the tools in verb.geom for this, but in some cases this will make more sense.

Eval also provides experimental tools for evaluating points in NURBS volumes.

Many of these algorithms owe their implementation to Piegl & Tiller's "The NURBS Book"

rationalCurveTangent

STATIC METHOD

Source code

rationalCurveTangent(curve : NurbsCurveData, u : Float) : Array<Float>

Compute the tangent at a point on a NURBS curve

params

returns

rationalSurfaceNormal

STATIC METHOD

Source code

rationalSurfaceNormal(surface : NurbsSurfaceData, u : Float, v : Float) : Array<Float>

Compute the derivatives at a point on a NURBS surface

params

returns

rationalSurfaceDerivatives

STATIC METHOD

Source code

rationalSurfaceDerivatives(surface : NurbsSurfaceData, u : Float, v : Float, numDerivs : Int) : Array<Array<Array<Float>>>

Compute the derivatives at a point on a NURBS surface

params

returns

rationalSurfacePoint

STATIC METHOD

Source code

rationalSurfacePoint(surface : NurbsSurfaceData, u : Float, v : Float) : Point

Compute a point on a NURBS surface

params

returns

rationalCurveDerivatives

STATIC METHOD

Source code

rationalCurveDerivatives(curve : NurbsCurveData, u : Float, numDerivs : Int) : Array<Point>

Determine the derivatives of a NURBS curve at a given parameter

params

returns

rationalCurvePoint

STATIC METHOD

Source code

rationalCurvePoint(curve : NurbsCurveData, u : Float) : Point

Compute a point on a NURBS curve

params

returns

surfaceDerivatives

STATIC METHOD

Source code

surfaceDerivatives(surface : NurbsSurfaceData, u : Float, v : Float, numDerivs : Int) : Array<Array<Point>>

Compute the derivatives on a non-uniform, non-rational B spline surface

params

returns

surfaceDerivativesGivenNM

STATIC METHOD

Source code

surfaceDerivativesGivenNM(n : Int, m : Int, surface : NurbsSurfaceData, u : Float, v : Float, numDerivs : Int) : Array<Array<Point>>

Compute the derivatives on a non-uniform, non-rational B spline surface (corresponds to algorithm 3.6 from The NURBS book, Piegl & Tiller 2nd edition)

params

returns

surfacePoint

STATIC METHOD

Source code

surfacePoint(surface : NurbsSurfaceData, u : Float, v : Float) : Point

Compute a point on a non-uniform, non-rational B-spline surface

params

returns

surfacePointGivenNM

STATIC METHOD

Source code

surfacePointGivenNM(n : Int, m : Int, surface : NurbsSurfaceData, u : Float, v : Float) : Point

Compute a point on a non-uniform, non-rational B spline surface (corresponds to algorithm 3.5 from The NURBS book, Piegl & Tiller 2nd edition)

params

returns

curveRegularSamplePoints

STATIC METHOD

Source code

curveRegularSamplePoints(crv : NurbsCurveData, divs : Int)

curveRegularSamplePoints2

STATIC METHOD

Source code

curveRegularSamplePoints2(crv : NurbsCurveData, divs : Int)

rationalSurfaceRegularSampleDerivatives

STATIC METHOD

Source code

rationalSurfaceRegularSampleDerivatives(surface : NurbsSurfaceData, divsU : Int, divsV : Int, numDerivs : Int)

Compute a regularly spaced grid of derivatives on a non-uniform, rational, B spline surface. Generally, this algorithm is faster than directly evaluating these as we can pre-compute all of the basis function arrays

params

returns

surfaceRegularSampleDerivatives

STATIC METHOD

Source code

surfaceRegularSampleDerivatives(surface : NurbsSurfaceData, divsU : Int, divsV : Int, numDerivs : Int)

Compute a regularly spaced grid of derivatives on a non-uniform, non-rational, B spline surface. Generally, this algorithm is faster than directly evaluating these as we can pre-compute all of the basis function arrays

params

returns

rationalSurfaceRegularSamplePoints

STATIC METHOD

Source code

rationalSurfaceRegularSamplePoints(surface : NurbsSurfaceData, divsU : Int, divsV : Int) : Array<Array<Point>>

Compute a regularly spaced grid of points on a non-uniform, rational, B spline surface. Generally, this algorithm is faster than directly evaluating these as we can pre-compute all of the basis function arrays

params

returns

surfaceRegularSamplePoints

STATIC METHOD

Source code

surfaceRegularSamplePoints(surface : NurbsSurfaceData, divsU : Int, divsV : Int) : Array<Array<Point>>

Compute a regularly spaced grid of points on a non-uniform, non-rational, B spline surface. Generally, this algorithm is faster than directly evaluating these as we can pre-compute all of the basis function arrays

params

returns

curveDerivatives

STATIC METHOD

Source code

curveDerivatives(crv : NurbsCurveData, u : Float, numDerivs : Int) : Array<Point>

Determine the derivatives of a non-uniform, non-rational B-spline curve at a given parameter

params

returns

curveDerivativesGivenN

STATIC METHOD

Source code

curveDerivativesGivenN(n : Int, curve : NurbsCurveData, u : Float, numDerivs : Int) : Array<Point>

Determine the derivatives of a non-uniform, non-rational B-spline curve at a given parameter (corresponds to algorithm 3.1 from The NURBS book, Piegl & Tiller 2nd edition)

params

returns

curvePoint

STATIC METHOD

Source code

curvePoint(curve : NurbsCurveData, u : Float)

Compute a point on a non-uniform, non-rational b-spline curve

params

returns

areValidRelations

STATIC METHOD

Source code

areValidRelations(degree : Int, num_controlPoints : Int, knots_length : Int) : Bool

Confirm the relations between degree (p), number of control points(n+1), and the number of knots (m+1) via The NURBS Book (section 3.2, Second Edition)

params

returns

curvePointGivenN

STATIC METHOD

Source code

curvePointGivenN(n : Int, curve : NurbsCurveData, u : Float) : Point

Compute a point on a non-uniform, non-rational b-spline curve (corresponds to algorithm 3.1 from The NURBS book, Piegl & Tiller 2nd edition)

params

returns

volumePoint

STATIC METHOD

Source code

volumePoint(volume : VolumeData, u : Float, v : Float, w : Float) : Point

Compute a point in a non-uniform, non-rational B spline volume

params

returns

volumePointGivenNML

STATIC METHOD

Source code

volumePointGivenNML(volume : VolumeData, n : Int, m : Int, l : Int, u : Float, v : Float, w : Float) : Point

Compute a point in a non-uniform, non-rational B spline volume

params

returns

derivativeBasisFunctions

STATIC METHOD

Source code

derivativeBasisFunctions(u : Float, degree : Int, knots : KnotArray) : Array<Array<Float>>

Compute the non-vanishing basis functions and their derivatives

params

returns

derivativeBasisFunctionsGivenNI

STATIC METHOD

Source code

derivativeBasisFunctionsGivenNI(knotIndex : Int, u : Float, p : Int, n : Int, knots : KnotArray) : Array<Array<Float>>

Compute the non-vanishing basis functions and their derivatives (corresponds to algorithm 2.3 from The NURBS book, Piegl & Tiller 2nd edition)

params

returns

basisFunctions

STATIC METHOD

Source code

basisFunctions(u : Float, degree : Int, knots : KnotArray) : Array<Float>

Compute the non-vanishing basis functions

params

returns

basisFunctionsGivenKnotSpanIndex

STATIC METHOD

Source code

basisFunctionsGivenKnotSpanIndex(knotSpan_index : Int, u : Float, degree : Int, knots : KnotArray) : Array<Float>

Compute the non-vanishing basis functions (corresponds to algorithm 2.2 from The NURBS book, Piegl & Tiller 2nd edition)

params

returns

knotSpan

STATIC METHOD

Source code

knotSpan(degree : Int, u : Float, knots : Array<Float>) : Int

Find the span on the knot Array without supplying n

params

returns

knotSpanGivenN

STATIC METHOD

Source code

knotSpanGivenN(n : Int, degree : Int, u : Float, knots : Array<Float>) : Int

Find the span on the knot Array knots of the given parameter (corresponds to algorithm 2.1 from The NURBS book, Piegl & Tiller 2nd edition)

params

returns

dehomogenize

STATIC METHOD

Source code

dehomogenize(homoPoint : Point) : Point

Dehomogenize a point

params

returns

rational1d

STATIC METHOD

Source code

rational1d(homoPoints : Array<Point>) : Array<Point>

Obtain the point from a point in homogeneous space without dehomogenization, assuming all are the same length

params

returns

rational2d

STATIC METHOD

Source code

rational2d(homoPoints : Array<Array<Point>>) : Array<Array<Point>>

Obtain the weight from a collection of points in homogeneous space, assuming all are the same dimension

params

returns

weight1d

STATIC METHOD

Source code

weight1d(homoPoints : Array<Point>) : Array<Float>

Obtain the weight from a collection of points in homogeneous space, assuming all are the same dimension

params

returns

weight2d

STATIC METHOD

Source code

weight2d(homoPoints : Array<Array<Point>>) : Array<Array<Float>>

Obtain the weight from a collection of points in homogeneous space, assuming all are the same dimension

params

returns

dehomogenize1d

STATIC METHOD

Source code

dehomogenize1d(homoPoints : Array<Point>) : Array<Point>

Dehomogenize an array of points

params

returns

dehomogenize2d

STATIC METHOD

Source code

dehomogenize2d(homoPoints : Array<Array<Point>>) : Array<Array<Point>>

Dehomogenize a 2d array of pts

params

returns

homogenize1d

STATIC METHOD

Source code

homogenize1d(controlPoints : Array<Point>, weights : Array<Float>) : Array<Point>

Transform a 1d array of points into their homogeneous equivalents

params

returns

homogenize2d

STATIC METHOD

Source code

homogenize2d(controlPoints : Array<Array<Point>>, weights : Array<Array<Float>>) : Array<Array<Point>>

params

returns