API Reference > OdGe Classes > OdGeNurbCurve3d Class > OdGeNurbCurve3d Constructor > OdGeNurbCurve3d::OdGeNurbCurve3d Constructor (int, OdGeKnotVector&, OdGePoint3d*, OdUInt32, double*, OdUInt32, bool)
OdGeNurbCurve3d::OdGeNurbCurve3d Constructor (int, OdGeKnotVector&, OdGePoint3d*, OdUInt32, double*, OdUInt32, bool)
Syntax
C++
OdGeNurbCurve3d(int degree, const OdGeKnotVector& knots, const OdGePoint3d* controlPoints, OdUInt32 numControlPoints, const double* weights, OdUInt32 numWeights, bool isPeriodic = false);
Parameters 
Description 
int degree 
[in] Degree of curve.  
const OdGeKnotVector& knots 
[in] Knot vector.  
const OdGePoint3d* controlPoints 
[in] A pointer to an array of 3D control points.  
OdUInt32 numControlPoints 
[in] A number of control points in the passed array.  
const double* weights 
[in] Array of 3D control points.  
OdUInt32 numWeights 
[in] A number of weight values in the passed array.  
bool isPeriodic = false 
[in] True if and only if the curve is periodic. 

Constructor for the OdGeNurbCurve3d class. 

 

High degree values make curve more flexible. For example degree 1 is used to define a polyline, degree 2 is used to define a nurb circle, etc. 

A knot vector defines a sequence of parameter values that determine where and how the control points affect the curve. The knot vector is a sequence of parameter values and divides the parametric space into intervals, usually called knot spans. Values of knot vector must be provided in ascending order, for example: (0, 0, 0, 1, 2, 3, 3, 3) can be valid while (0, 0, 2, 0, 3, 1, 3, 3) cannot be valid. Knot vector does not affect the form of the nurb curve, it only affects its parameterization. 

The control points specify the placement of the curve and adjust its shape. The quantity of control points must be at least the degree + 1. 

The closer the weight value is to zero, the closer the curve is to a straight line near the corresponding control point. If the weight increases, the curve pulls toward the corresponding control point. If the weight decreases, the curve pushes from the corresponding control point. 

If isPeriodic is false, then knots.length() must equal controlPoints.length() + degree + 1 If isPeriodic is true, then knots.length() must equal controlPoints.length(), the first and last controlPoints must be equal.

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