API Reference > OdDb Classes > OdDbNurbSurface Class > OdDbNurbSurface Methods > OdDbNurbSurface::set Method
OdDbNurbSurface::set Method
Syntax
C++
OdResult set(int iUDegree, int iVDegree, bool bRational, int iUNumControlPoints, int iVNumControlPoints, const OdGePoint3dArray& ctrlPtsArr, const OdGeDoubleArray& weights, const OdGeKnotVector& uKnots, const OdGeKnotVector& vKnots);
Parameters 
Description 
int iUDegree 
[in] A new value for degrees in the u direction.  
int iVDegree 
[in] A new value for degrees in the v direction.  
bool bRational 
[in] Determines whether the surface is rational (new value).  
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.
 
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 NURBS 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 periodic in the u direction, the size of the uKnots vector must be equal to iUNumControlPoints + iUDegree + 1. If the surface is periodic in the u direction, the size of the uKnots vector must be iUNumControlPoints + 1. Similarly, if the surface is not periodic in the v direction, the size of the vKnots vector must be equal to iVNumControlPoints + iVDegree + 1. If the surface is periodic 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. 

This method is implemented only for Spatial modeler and returns eNotImplementedYet status for other modelers.

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