Menu - Top - Home - Donate to Me

H3DU.BSplineSurface

Back to documentation index.

H3DU.BSplineSurface(controlPoints, knotsU, knotsV, [bits])

Augments: H3DU.Surface

A surface evaluator object for a B-spline (basis spline) surface, whose edges are made up of B-spline curves. For more on B-spline curves, see the constructor for H3DU.BSplineCurve.

Parameters

Methods

H3DU.BSplineSurface#bitangent(u, v)

Finds the bitangent vector at the given point on the surface.

Parameters

Return Value

An array giving the bitangent vector. It will have as many elements as a control point (or one fewer if DIVIDE_BIT is set), as specified in the constructor. (Type: Array.<number>)

(static) H3DU.BSplineSurface.clamped(controlPoints, [degreeU], [degreeV], [bits])

Creates a B-spline surface with uniform knots, except that the surface's edges lie on the edges of the control point array.

Parameters

Return Value

Return value. The first knot of the curve will be 0 and the last knot will be 1. (This is a change from previous versions.) (Type: H3DU.BSplineSurface)

H3DU.BSplineSurface#endPoints()

Returns the starting and ending U and V coordinates of this surface. This method calls the evaluator's endPoints method if it implements it; otherwise, returns [0, 1, 0, 1]

Return Value

A four-element array. The first and second elements are the starting and ending U coordinates, respectively, of the surface, and the third and fourth elements are its starting and ending V coordinates. Returns [0, 1, 0, 1] if the evaluator doesn't implement an endPoints method.

H3DU.BSplineSurface#evaluate(u, v)

Evaluates the surface function based on a point in a B-spline surface.

Parameters

Return Value

An array of the result of the evaluation. It will have as many elements as a control point (or one fewer if DIVIDE_BIT is set), as specified in the constructor. (Type: Array.<number>)

(static) H3DU.BSplineSurface.fromBezierSurface(controlPoints, [bits])

Creates a B-spline surface from the control points of a Bézier surface.

Parameters

Return Value

Return value. (Type: H3DU.BSplineSurface)

H3DU.BSplineSurface#getControlPoints()

Gets a reference to the array of control point arrays used in this surface object.

Return Value

An object described in the constructor to H3DU.BSplineCurve. (Type: Array.<Array.<number>>)

H3DU.BSplineSurface#getKnots()

Gets a reference to the array of knot vectors used in this curve object.

Return Value

An object described in the constructor to H3DU.BSplineSurface. (Type: Array.<Array.<number>>)

H3DU.BSplineSurface#gradient(u, v)

Finds an approximate gradient vector of this surface at the given U and V coordinates.

The implementation in H3DU.Surface calls the evaluator's gradient method if it implements it; otherwise uses the surface's tangent and bitangent vectors to implement the gradient (however, this approach is generally only meaningful for a three-dimensional surface).

The gradient is a vector pointing up and away from the surface. If the evaluator describes a regular three-dimensional surface (usually a continuous, unbroken surface such as a sphere, an open cylinder, or a disk rotated in three dimensions), this can be the cross product of the tangent vector and bitangent vector, in that order. The gradient returned by this method should not be "normalized" to a unit vector.

Parameters

Return Value

An array describing a gradient vector. It should have at least as many elements as the number of dimensions of the underlying surface. (Type: Array.<number>)

H3DU.BSplineSurface#normal(u, v)

Convenience method for finding an approximate normal vector of this surface at the given U and V coordinates. The normal vector is the same as the gradient vector, but "normalized" to a unit vector.

Parameters

Return Value

An array describing a normal vector. It should have at least as many elements as the number of dimensions of the underlying surface. (Type: Array.<number>)

H3DU.BSplineSurface#tangent(u, v)

Finds the tangent vector at the given point on the surface.

Parameters

Return Value

An array giving the tangent vector. It will have as many elements as a control point (or one fewer if DIVIDE_BIT is set), as specified in the constructor. (Type: Array.<number>)

(static) H3DU.BSplineSurface.uniform(controlPoints, [degreeU], [degreeV], [bits])

Creates a B-spline surface with uniform knots.

Parameters

Return Value

Return value. The first knot of the curve will be 0 and the last knot will be 1. (This is a change from previous versions.) (Type: H3DU.BSplineSurface)

Back to documentation index.