H3DU.BSplineSurface

Back to documentation index.

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

Augments: 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 BSplineCurve.

Parameters

Examples

Together with ‘convertToHomogen’ given in the BSplineCurve documentation, the following function can be used to convert an array of arrays of control points, each consisting of conventional coordinates and a weight, to homogeneous coordinates. For example, the single-control point array ‘[[[2, 3, 4, 0.1]]]’ becomes ‘[[[0.2, 0.3, 0.4, 0.1]]]’; the return value can then be used in the BSplineSurface constructor to create a rational B-Spline surface.

function convertSurfaceToHomogen(cp) {
var ret = [];
for(var i = 0; i < cp.length; i++) {
ret.push(convertToHomogen(cp[i]));
}
return ret;
};

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. (Type: BSplineSurface)

### 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: 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 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 BSplineSurface. (Type: Array.<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. (Type: BSplineSurface)

Back to documentation index.