API Reference > OdDg Classes > OdDgBSplineSurface Class > OdDgBSplineSurface Methods > OdDgBSplineSurface::set Method
OdDgBSplineSurface::set Method
Syntax
C++
OdResult set(OdUInt8 uOrderU, OdUInt8 uOrderV, bool bRational, bool bClosedInU, bool bClosedInV, int iUNumControlPoints, int iVNumControlPoints, const OdGePoint3dArray& ctrlPtsArr, const OdGeDoubleArray& weights, const OdGeKnotVector& uKnots, const OdGeKnotVector& vKnots);
Parameters 
Description 
bool bRational 
[in] Determines whether the surface is rational (new value).  
bool bClosedInU 
[in] A new value closed state in the u direction.  
bool bClosedInV 
[in] A new value closed state in the v direction.  
int iVNumControlPoints 
[in] A new value of the quantity of control points in the v direction.  
const OdGePoint3dArray& ctrlPtsArr 
[in] A new array of control points (in WCS coordinates).  
const OdGeDoubleArray& weights 
[in] A new array of the weights for each control point.  
const OdGeKnotVector& uKnots 
[in] A new array of the knot values in the u direction.  
const OdGeKnotVector& vKnots 
[in] A new array of the knot values in the v direction.
 
uOredrU 
[in] A new value for order in the u direction.  
uOredrV 
[in] A new value for order in the v direction.  
IUNumControlPoints 
[in] A new value of the quantity of control points in the u direction.  

Returns eOk if successful or an appropriate error code otherwise.

Set new data for the existing b-spline surface. 

 

The column indexes is for the v direction, and row indexes are for the u direction. For example, if the surface has n control points in the u direction and m control points in the v direction, the array looks like [0,0], [0,1], ...[0,n-1], ..., [m-1,0], [m-1,1], ...[m-1,n-1]. 

If the surface is rational (bRational == true), the weights array must contain the same number of entries as the ctrlPts array. All weight values must be greater than 0.0. The values in weights and ctrlPts arrays must have the same sequential order as the control points array. If the surface is not rational (bRational == false), the weight array must be empty. 

If the surface is not closed in the u direction, the size of the uKnots vector must be equal to iUNumControlPoints + uOrderU. If the surface is closed in the u direction, the size of the uKnots vector must be iUNumControlPoints + 1. Similarly, if the surface is not closed in the v direction, the size of the vKnots vector must be equal to iVNumControlPoints + uOrderV. If the surface is closed in the v direction, the size of the vKnots vector must be iVNumControlPoints + 1. Each knot must have a value greater than or equal to the value of its predecessor in the array. 

If any of the passed-in parameters are not valid, the surface will not be created.

Copyright © 2002–2020. Open Design Alliance. All rights reserved.