#include <opennurbs_bezier.h>
Public Member Functions | |
| ON_BezierCurve () | |
| ON_BezierCurve (int dim, bool bIsRational, int order) | |
| Creates a bezier with cv memory allocated. More... | |
| ON_BezierCurve (const ON_BezierCurve &) | |
| ON_BezierCurve (const ON_PolynomialCurve &) | |
| ON_BezierCurve (const ON_2dPointArray &) | |
| ON_BezierCurve (const ON_3dPointArray &) | |
| ON_BezierCurve (const ON_4dPointArray &) | |
| ~ON_BezierCurve () | |
| ON_BoundingBox | BoundingBox () const |
| Gets bounding box. More... | |
| bool | ChangeDimension (int desired_dimension) |
| Change dimension of bezier. More... | |
| bool | ChangeWeights (int i0, double w0, int i1, double w1) |
| Use a combination of scaling and reparameterization to set two rational Bezier weights to specified values. More... | |
| const ON_4dPoint | ControlPoint (int cv_index) const |
| double | ControlPolygonLength () const |
| returns the length of the control polygon More... | |
| bool | Create (int dim, bool bIsRational, int order) |
| Creates a bezier with cv memory allocated. More... | |
| ON_3dVector | CurvatureAt (double t) const |
| Evaluate the curvature vector at a parameter. More... | |
| double * | CV (int cv_index) const |
| Expert user function to get a pointer to control vertex memory. If you are not an expert user, please use ON_BezierCurve::GetCV( ON_3dPoint& ) or ON_BezierCurve::GetCV( ON_4dPoint& ). More... | |
| int | CVCount () const |
| int | CVSize () const |
| ON::point_style | CVStyle () const |
| Returns the style of control vertices in the m_cv array. More... | |
| int | Degree () const |
| ON_3dVector | DerivativeAt (double t) const |
| Evaluate first derivative at a parameter. More... | |
| void | Destroy () |
| Deallocates m_cv memory. More... | |
| int | Dimension () const |
| ON_Interval | Domain () const |
| void | Dump (ON_TextLog &) const |
| void | EmergencyDestroy () |
| bool | Ev1Der (double t, ON_3dPoint &point, ON_3dVector &first_derivative) const |
| Evaluate first derivative at a parameter with error checking. More... | |
| bool | Ev2Der (double t, ON_3dPoint &point, ON_3dVector &first_derivative, ON_3dVector &second_derivative) const |
| Evaluate second derivative at a parameter with error checking. More... | |
| bool | Evaluate (double t, int der_count, int v_stride, double *v) const |
| Evaluate a bezier. More... | |
| bool | EvCurvature (double t, ON_3dPoint &point, ON_3dVector &tangent, ON_3dVector &kappa) const |
| Evaluate unit tangent and curvature at a parameter with error checking. More... | |
| bool | EvPoint (double t, ON_3dPoint &point) const |
| Evaluate point at a parameter with error checking. More... | |
| bool | EvTangent (double t, ON_3dPoint &point, ON_3dVector &tangent) const |
| Evaluate unit tangent at a parameter with error checking. More... | |
| bool | GetBBox (double *box_min, double *box_max, bool bGrowBox=false) const |
| Gets bounding box. More... | |
| bool | GetBoundingBox (ON_BoundingBox &bbox, int bGrowBox=false) const |
| Gets bounding box. More... | |
| bool | GetCV (int cv_index, ON::point_style pointstyle, double *cv) const |
| Get location of a control vertex. More... | |
| bool | GetCV (int cv_index, ON_3dPoint &point) const |
| Get location of a control vertex. More... | |
| bool | GetCV (int cv_index, ON_4dPoint &point) const |
| Get value of a control vertex. More... | |
| int | GetNurbForm (ON_NurbsCurve &nurbs_curve) const |
| Get ON_NurbsCurve form of a bezier. More... | |
| bool | GetTightBoundingBox (ON_BoundingBox &tight_bbox, bool bGrowBox=false, const ON_Xform *xform=nullptr) const |
| Get tight bounding box of the bezier. More... | |
| bool | IncreaseDegree (int desired_degree) |
| Increase degree of bezier. More... | |
| bool | IsRational () const |
| bool | IsValid () const |
| bool | Loft (const ON_3dPointArray &points) |
| Loft a bezier curve through a list of points. More... | |
| bool | Loft (int pt_dim, int pt_count, int pt_stride, const double *pt, int t_stride, const double *t) |
| Loft a bezier curve through a list of points. More... | |
| bool | MakeNonRational () |
| Make beizer not rational by setting all control vertices to their euclidean locations and setting m_is_rat to false. More... | |
| bool | MakeRational () |
| Make beizer rational. More... | |
| ON_BezierCurve & | operator= (const ON_BezierCurve &) |
| ON_BezierCurve & | operator= (const ON_PolynomialCurve &) |
| ON_BezierCurve & | operator= (const ON_2dPointArray &) |
| ON_BezierCurve & | operator= (const ON_3dPointArray &) |
| ON_BezierCurve & | operator= (const ON_4dPointArray &) |
| int | Order () const |
| ON_3dPoint | PointAt (double t) const |
| Evaluate point at a parameter. More... | |
| bool | Reparameterize (double c) |
| Use a linear fractional tranformation for [0,1] to reparameterize the bezier. The locus of the curve is not changed, but the parameterization is changed. More... | |
| bool | Reparametrize (double) |
| misspelled function name is obsolete More... | |
| bool | ReserveCVCapacity (int desired_cv_capacity) |
| Tools for managing CV and knot memory. More... | |
| bool | Reverse () |
| Reverses bezier by reversing the order of the control points. More... | |
| bool | Rotate (double sin_angle, double cos_angle, const ON_3dVector &rotation_axis, const ON_3dPoint &rotation_center) |
| Rotates the bezier curve about the specified axis. A positive rotation angle results in a counter-clockwise rotation about the axis (right hand rule). More... | |
| bool | Rotate (double rotation_angle, const ON_3dVector &rotation_axis, const ON_3dPoint &rotation_center) |
| Rotates the bezier curve about the specified axis. A positive rotation angle results in a counter-clockwise rotation about the axis (right hand rule). More... | |
| bool | Scale (double scale_factor) |
| Scales the bezier curve by the specified facotor. The scale is centered at the origin. More... | |
| bool | ScaleConrolPoints (int i, double w) |
| Scale a rational Bezier's control vertices to set a weight to a specified value. More... | |
| bool | SetCV (int cv_index, ON::point_style pointstyle, const double *cv) |
| Set control vertex More... | |
| bool | SetCV (int cv_index, const ON_3dPoint &point) |
| Set location of a control vertex. More... | |
| bool | SetCV (int cv_index, const ON_4dPoint &point) |
| Set value of a control vertex. More... | |
| bool | SetWeight (int cv_index, double weight) |
| Set weight of a control vertex. More... | |
| bool | Split (double t, ON_BezierCurve &left_side, ON_BezierCurve &right_side) const |
| Split() divides the Bezier curve at the specified parameter. The parameter must satisfy 0 < t < 1. You may pass *this as one of the curves to be returned. More... | |
| ON_3dVector | TangentAt (double t) const |
| Evaluate unit tangent vector at a parameter. More... | |
| bool | Transform (const ON_Xform &xform) |
| Transform the bezier. More... | |
| bool | Translate (const ON_3dVector &translation_vector) |
| Translates the bezier curve along the specified vector. More... | |
| bool | Trim (const ON_Interval &interval) |
| Trims (or extends) the bezier so the bezier so that the result starts bezier(interval[0]) and ends at bezier(interval[1]) (Evaluation performed on input bezier.) More... | |
| double | Weight (int cv_index) const |
| bool | ZeroCVs () |
| Zeros control vertices and, if rational, sets weights to 1. More... | |
Public Attributes | |
| double * | m_cv |
| The i-th cv begins at cv[i*m_cv_stride]. More... | |
| int | m_cv_capacity |
| int | m_cv_stride |
| Number of doubles per cv ( >= ((m_is_rat)?m_dim+1:m_dim) ) More... | |
| int | m_dim |
| Implementation. More... | |
| int | m_is_rat |
| 1 if bezier is rational, 0 if bezier is not rational More... | |
| int | m_order |
| order = degree+1 More... | |
| ON_BezierCurve::ON_BezierCurve | ( | ) |
| ON_BezierCurve::ON_BezierCurve | ( | int | dim, |
| bool | bIsRational, | ||
| int | order | ||
| ) |
Creates a bezier with cv memory allocated.
| dim | [in] (>0) dimension of bezier curve |
| bIsRational | [in] true for a rational bezier |
| order | [in] (>=2) order (=degree+1) of bezier curve |
| ON_BezierCurve::~ON_BezierCurve | ( | ) |
| ON_BezierCurve::ON_BezierCurve | ( | const ON_BezierCurve & | ) |
| ON_BezierCurve::ON_BezierCurve | ( | const ON_PolynomialCurve & | ) |
| ON_BezierCurve::ON_BezierCurve | ( | const ON_2dPointArray & | ) |
| ON_BezierCurve::ON_BezierCurve | ( | const ON_3dPointArray & | ) |
| ON_BezierCurve::ON_BezierCurve | ( | const ON_4dPointArray & | ) |
| ON_BoundingBox ON_BezierCurve::BoundingBox | ( | ) | const |
Gets bounding box.
| bool ON_BezierCurve::ChangeDimension | ( | int | desired_dimension | ) |
Change dimension of bezier.
| desired_dimension | [in] |
| bool ON_BezierCurve::ChangeWeights | ( | int | i0, |
| double | w0, | ||
| int | i1, | ||
| double | w1 | ||
| ) |
Use a combination of scaling and reparameterization to set two rational Bezier weights to specified values.
| i0 | [in] control point index (0 <= i0 < order, i0 != i1) |
| w0 | [in] Desired weight for i0-th control point |
| i1 | [in] control point index (0 <= i1 < order, i0 != i1) |
| w1 | [in] Desired weight for i1-th control point |
The i0-th cv will have weight w0 and the i1-rst cv will have weight w1. If v0 and v1 are the cv's input weights, then v0, v1, w0 and w1 must all be nonzero, and w0*v0 and w1*v1 must have the same sign.
The equations
s * r^i0 = w0/v0
s * r^i1 = w1/v1
determine the scaling and reparameterization necessary to change v0,v1 to w0,w1.
If the input Bezier has control vertices
(B_0, ..., B_d),
then the output Bezier has control vertices
(s*B_0, ... s*r^i * B_i, ..., s*r^d * B_d).
| const ON_4dPoint ON_BezierCurve::ControlPoint | ( | int | cv_index | ) | const |
| cv_index | [in] zero based control point index |
If cv_index or the bezier is not valid, then ON_4dPoint::Nan is returned. If dim < 3, unused coordinates are zero. If dim >= 4, the first three coordinates are returned. If is_rat is false, the weight is 1.
| double ON_BezierCurve::ControlPolygonLength | ( | ) | const |
returns the length of the control polygon
| bool ON_BezierCurve::Create | ( | int | dim, |
| bool | bIsRational, | ||
| int | order | ||
| ) |
Creates a bezier with cv memory allocated.
| dim | [in] (>0) dimension of bezier curve |
| bIsRational | [in] true for a rational bezier |
| order | [in] (>=2) order (=degree+1) of bezier curve |
| ON_3dVector ON_BezierCurve::CurvatureAt | ( | double | t | ) | const |
Evaluate the curvature vector at a parameter.
| t | [in] evaluation parameter |
No error handling.
| double* ON_BezierCurve::CV | ( | int | cv_index | ) | const |
Expert user function to get a pointer to control vertex memory. If you are not an expert user, please use ON_BezierCurve::GetCV( ON_3dPoint& ) or ON_BezierCurve::GetCV( ON_4dPoint& ).
| cv_index | [in] (0 <= cv_index < m_order) |
If the Bezier curve is rational, the format of the returned array is a homogeneos rational point with length m_dim+1. If the Bezier curve is not rational, the format of the returned array is a nonrational euclidean point with length m_dim. See Also ON_BezierCurve::CVStyle ON_BezierCurve::GetCV ON_BezierCurve::Weight
| int ON_BezierCurve::CVCount | ( | ) | const |
| int ON_BezierCurve::CVSize | ( | ) | const |
| ON::point_style ON_BezierCurve::CVStyle | ( | ) | const |
Returns the style of control vertices in the m_cv array.
| int ON_BezierCurve::Degree | ( | ) | const |
| ON_3dVector ON_BezierCurve::DerivativeAt | ( | double | t | ) | const |
Evaluate first derivative at a parameter.
| t | [in] evaluation parameter |
No error handling.
| void ON_BezierCurve::Destroy | ( | ) |
Deallocates m_cv memory.
| int ON_BezierCurve::Dimension | ( | ) | const |
| ON_Interval ON_BezierCurve::Domain | ( | ) | const |
| void ON_BezierCurve::Dump | ( | ON_TextLog & | ) | const |
| void ON_BezierCurve::EmergencyDestroy | ( | ) |
| bool ON_BezierCurve::Ev1Der | ( | double | t, |
| ON_3dPoint & | point, | ||
| ON_3dVector & | first_derivative | ||
| ) | const |
Evaluate first derivative at a parameter with error checking.
| t | [in] evaluation parameter |
| point | [out] value of curve at t |
| first_derivative | [out] value of first derivative at t |
| bool ON_BezierCurve::Ev2Der | ( | double | t, |
| ON_3dPoint & | point, | ||
| ON_3dVector & | first_derivative, | ||
| ON_3dVector & | second_derivative | ||
| ) | const |
Evaluate second derivative at a parameter with error checking.
| t | [in] evaluation parameter |
| point | [out] value of curve at t |
| first_derivative | [out] value of first derivative at t |
| second_derivative | [out] value of second derivative at t |
| bool ON_BezierCurve::Evaluate | ( | double | t, |
| int | der_count, | ||
| int | v_stride, | ||
| double * | v | ||
| ) | const |
Evaluate a bezier.
| t | [in] evaluation parameter (usually 0 <= t <= 1) |
| der_count | [in] (>=0) number of derivatives to evaluate |
| v_stride | [in] (>=m_dim) stride to use for the v[] array |
| v | [out] array of length (der_count+1)*v_stride bez(t) is returned in (v[0],...,v[m_dim-1]), bez'(t) is retuned in (v[v_stride],...,v[v_stride+m_dim-1]), bez"(t) is retuned in (v[2*v_stride],...,v[2*v_stride+m_dim-1]), etc. |
| bool ON_BezierCurve::EvCurvature | ( | double | t, |
| ON_3dPoint & | point, | ||
| ON_3dVector & | tangent, | ||
| ON_3dVector & | kappa | ||
| ) | const |
Evaluate unit tangent and curvature at a parameter with error checking.
| t | [in] evaluation parameter |
| point | [out] value of curve at t |
| tangent | [out] value of unit tangent |
| kappa | [out] value of curvature vector |
| bool ON_BezierCurve::EvPoint | ( | double | t, |
| ON_3dPoint & | point | ||
| ) | const |
Evaluate point at a parameter with error checking.
| t | [in] evaluation parameter |
| point | [out] value of curve at t |
| bool ON_BezierCurve::EvTangent | ( | double | t, |
| ON_3dPoint & | point, | ||
| ON_3dVector & | tangent | ||
| ) | const |
Evaluate unit tangent at a parameter with error checking.
| t | [in] evaluation parameter |
| point | [out] value of curve at t |
| tangent | [out] value of unit tangent |
| bool ON_BezierCurve::GetBBox | ( | double * | box_min, |
| double * | box_max, | ||
| bool | bGrowBox = false |
||
| ) | const |
Gets bounding box.
| box_min | [out] minimum corner of axis aligned bounding box The box_min[] array must have size m_dim. |
| box_max | [out] maximum corner of axis aligned bounding box The box_max[] array must have size m_dim. |
| bGrowBox | [in] if true, input box_min/box_max must be set to valid bounding box corners and this box is enlarged to be the union of the input box and the bezier's bounding box. |
| bool ON_BezierCurve::GetBoundingBox | ( | ON_BoundingBox & | bbox, |
| int | bGrowBox = false |
||
| ) | const |
Gets bounding box.
| bbox | [out] axis aligned bounding box returned here. |
| bGrowBox | [in] if true, input bbox must be a valid bounding box and this box is enlarged to be the union of the input box and the bezier's bounding box. |
| bool ON_BezierCurve::GetCV | ( | int | cv_index, |
| ON::point_style | pointstyle, | ||
| double * | cv | ||
| ) | const |
Get location of a control vertex.
| cv_index | [in] control vertex index (0 <= cv_index < m_order) |
| pointstyle | [in] specifes what kind of values to get ON::not_rational cv[] is an array of length m_dim that defines a euclidean (world coordinate) point ON::homogeneous_rational cv[] is an array of length (m_dim+1) that defines a rational homogeneous point. ON::euclidean_rational cv[] is an array of length (m_dim+1). The first m_dim values define the euclidean (world coordinate) location of the point. cv[m_dim] is the weight ON::intrinsic_point_style If m_is_rat is true, cv[] has ON::homogeneous_rational point style. If m_is_rat is false, cv[] has ON::not_rational point style. |
| cv | [out] array with control vertex value. |
| bool ON_BezierCurve::GetCV | ( | int | cv_index, |
| ON_3dPoint & | point | ||
| ) | const |
Get location of a control vertex.
| cv_index | [in] control vertex index (0 <= cv_index < m_order) |
| point | [out] Location of control vertex. If the bezier is rational, the euclidean location is returned. |
| bool ON_BezierCurve::GetCV | ( | int | cv_index, |
| ON_4dPoint & | point | ||
| ) | const |
Get value of a control vertex.
| cv_index | [in] control vertex index (0 <= cv_index < m_order) |
| point | [out] Homogenous value of control vertex. If the bezier is not rational, the weight is 1. |
| int ON_BezierCurve::GetNurbForm | ( | ON_NurbsCurve & | nurbs_curve | ) | const |
Get ON_NurbsCurve form of a bezier.
| nurbs_curve | [out] NURBS curve form of a bezier. The domain is [0,1]. |
| bool ON_BezierCurve::GetTightBoundingBox | ( | ON_BoundingBox & | tight_bbox, |
| bool | bGrowBox = false, |
||
| const ON_Xform * | xform = nullptr |
||
| ) | const |
Get tight bounding box of the bezier.
| tight_bbox | [in/out] tight bounding box |
| bGrowBox | [in] (default=false) If true and the input tight_bbox is valid, then returned tight_bbox is the union of the input tight_bbox and the tight bounding box of the bezier curve. |
| xform | [in] (default=nullptr) If not nullptr, the tight bounding box of the transformed bezier is calculated. The bezier curve is not modified. |
| bool ON_BezierCurve::IncreaseDegree | ( | int | desired_degree | ) |
Increase degree of bezier.
| desired_degree | [in] |
| bool ON_BezierCurve::IsRational | ( | ) | const |
| bool ON_BezierCurve::IsValid | ( | ) | const |
| bool ON_BezierCurve::Loft | ( | const ON_3dPointArray & | points | ) |
Loft a bezier curve through a list of points.
| points | [in] an array of 2 or more points to interpolate |
The result has order = points.Count() and the loft uses the uniform parameterizaton curve( i/(points.Count()-1) ) = points[i].
| bool ON_BezierCurve::Loft | ( | int | pt_dim, |
| int | pt_count, | ||
| int | pt_stride, | ||
| const double * | pt, | ||
| int | t_stride, | ||
| const double * | t | ||
| ) |
Loft a bezier curve through a list of points.
| pt_dim | [in] dimension of points to interpolate |
| pt_count | [in] number of points (>=2) |
| pt_stride | [in] (>=pt_dim) pt[] array stride |
| pt | [in] array of points |
| t_stride | [in] (>=1) t[] array stride |
| t | [in] strictly increasing array of interpolation parameters |
The result has order = points.Count() and the loft uses the parameterizaton curve( t[i] ) = points[i].
| bool ON_BezierCurve::MakeNonRational | ( | ) |
Make beizer not rational by setting all control vertices to their euclidean locations and setting m_is_rat to false.
| bool ON_BezierCurve::MakeRational | ( | ) |
Make beizer rational.
| ON_BezierCurve& ON_BezierCurve::operator= | ( | const ON_BezierCurve & | ) |
| ON_BezierCurve& ON_BezierCurve::operator= | ( | const ON_PolynomialCurve & | ) |
| ON_BezierCurve& ON_BezierCurve::operator= | ( | const ON_2dPointArray & | ) |
| ON_BezierCurve& ON_BezierCurve::operator= | ( | const ON_3dPointArray & | ) |
| ON_BezierCurve& ON_BezierCurve::operator= | ( | const ON_4dPointArray & | ) |
| int ON_BezierCurve::Order | ( | ) | const |
| ON_3dPoint ON_BezierCurve::PointAt | ( | double | t | ) | const |
Evaluate point at a parameter.
| t | [in] evaluation parameter |
| bool ON_BezierCurve::Reparameterize | ( | double | c | ) |
Use a linear fractional tranformation for [0,1] to reparameterize the bezier. The locus of the curve is not changed, but the parameterization is changed.
| c | [in] reparameterization constant (generally speaking, c should be > 0). If c != 1, then the returned bezier will be rational. |
The reparameterization is performed by composing the input Bezier with the function lambda: [0,1] -> [0,1] given by
t -> c*t / ( (c-1)*t + 1 )
Note that lambda(0) = 0, lambda(1) = 1, lambda'(t) > 0, lambda'(0) = c and lambda'(1) = 1/c.
If the input Bezier has control vertices {B_0, ..., B_d}, then the output Bezier has control vertices
(B_0, ... c^i * B_i, ..., c^d * B_d).
To derive this formula, simply compute the i-th Bernstein polynomial composed with lambda().
The inverse parameterization is given by 1/c. That is, the cumulative effect of the two calls
Reparameterize(c)
Reparameterize(1.0/c)
is to leave the bezier unchanged.
| bool ON_BezierCurve::Reparametrize | ( | double | ) |
misspelled function name is obsolete
| bool ON_BezierCurve::ReserveCVCapacity | ( | int | desired_cv_capacity | ) |
Tools for managing CV and knot memory.
Make sure m_cv array has a certain length.
| desired_cv_capacity | [in] minimum length of m_cv array. |
| bool ON_BezierCurve::Reverse | ( | ) |
Reverses bezier by reversing the order of the control points.
| bool ON_BezierCurve::Rotate | ( | double | sin_angle, |
| double | cos_angle, | ||
| const ON_3dVector & | rotation_axis, | ||
| const ON_3dPoint & | rotation_center | ||
| ) |
Rotates the bezier curve about the specified axis. A positive rotation angle results in a counter-clockwise rotation about the axis (right hand rule).
| sin_angle | [in] sine of rotation angle |
| cos_angle | [in] sine of rotation angle |
| rotation_axis | [in] direction of the axis of rotation |
| rotation_center | [in] point on the axis of rotation |
Uses ON_BezierCurve::Transform() function to calculate the result.
| bool ON_BezierCurve::Rotate | ( | double | rotation_angle, |
| const ON_3dVector & | rotation_axis, | ||
| const ON_3dPoint & | rotation_center | ||
| ) |
Rotates the bezier curve about the specified axis. A positive rotation angle results in a counter-clockwise rotation about the axis (right hand rule).
| rotation_angle | [in] angle of rotation in radians |
| rotation_axis | [in] direction of the axis of rotation |
| rotation_center | [in] point on the axis of rotation |
Uses ON_BezierCurve::Transform() function to calculate the result.
| bool ON_BezierCurve::Scale | ( | double | scale_factor | ) |
Scales the bezier curve by the specified facotor. The scale is centered at the origin.
| scale_factor | [in] scale factor |
Uses ON_BezierCurve::Transform() function to calculate the result.
| bool ON_BezierCurve::ScaleConrolPoints | ( | int | i, |
| double | w | ||
| ) |
Scale a rational Bezier's control vertices to set a weight to a specified value.
| i | [in] (0 <= i < order) |
| w | [in] w != 0.0 |
Each control point is multiplied by w/w0, where w0 is the input value of Weight(i).
| bool ON_BezierCurve::SetCV | ( | int | cv_index, |
| ON::point_style | pointstyle, | ||
| const double * | cv | ||
| ) |
Set control vertex
| cv_index | [in] control vertex index (0 <= cv_index < m_order) |
| pointstyle | [in] specifes what kind of values are passed in the cv array. ON::not_rational cv[] is an array of length m_dim that defines a euclidean (world coordinate) point ON::homogeneous_rational cv[] is an array of length (m_dim+1) that defines a rational homogeneous point. ON::euclidean_rational cv[] is an array of length (m_dim+1). The first m_dim values define the euclidean (world coordinate) location of the point. cv[m_dim] is the weight ON::intrinsic_point_style If m_is_rat is true, cv[] has ON::homogeneous_rational point style. If m_is_rat is false, cv[] has ON::not_rational point style. |
| cv | [in] array with control vertex value. |
| bool ON_BezierCurve::SetCV | ( | int | cv_index, |
| const ON_3dPoint & | point | ||
| ) |
Set location of a control vertex.
| cv_index | [in] control vertex index (0 <= cv_index < m_order) |
| point | [in] control vertex location. If the bezier is rational, the weight will be set to 1. |
| bool ON_BezierCurve::SetCV | ( | int | cv_index, |
| const ON_4dPoint & | point | ||
| ) |
Set value of a control vertex.
| cv_index | [in] control vertex index (0 <= cv_index < m_order) |
| point | [in] control vertex value. If the bezier is not rational, the euclidean location of homogenoeous point will be used. |
| bool ON_BezierCurve::SetWeight | ( | int | cv_index, |
| double | weight | ||
| ) |
Set weight of a control vertex.
| cv_index | [in] control vertex index (0 <= cv_index < m_order) |
| weight | [in] weight |
| bool ON_BezierCurve::Split | ( | double | t, |
| ON_BezierCurve & | left_side, | ||
| ON_BezierCurve & | right_side | ||
| ) | const |
Split() divides the Bezier curve at the specified parameter. The parameter must satisfy 0 < t < 1. You may pass *this as one of the curves to be returned.
| t | [in] (0 < t < 1 ) parameter to split at |
| left_side | [out] |
| right_side | [out] |
| ON_3dVector ON_BezierCurve::TangentAt | ( | double | t | ) | const |
Evaluate unit tangent vector at a parameter.
| t | [in] evaluation parameter |
No error handling.
| bool ON_BezierCurve::Transform | ( | const ON_Xform & | xform | ) |
Transform the bezier.
| xform | [in] transformation to apply to bezier |
| bool ON_BezierCurve::Translate | ( | const ON_3dVector & | translation_vector | ) |
Translates the bezier curve along the specified vector.
| translation_vector | [in] translation vector |
Uses ON_BezierCurve::Transform() function to calculate the result.
| bool ON_BezierCurve::Trim | ( | const ON_Interval & | interval | ) |
Trims (or extends) the bezier so the bezier so that the result starts bezier(interval[0]) and ends at bezier(interval[1]) (Evaluation performed on input bezier.)
| interval | [in] |
| double ON_BezierCurve::Weight | ( | int | cv_index | ) | const |
| cv_index | [in] control vertex index (0<=i<m_order) |
| bool ON_BezierCurve::ZeroCVs | ( | ) |
Zeros control vertices and, if rational, sets weights to 1.
| double* ON_BezierCurve::m_cv |
The i-th cv begins at cv[i*m_cv_stride].
| int ON_BezierCurve::m_cv_capacity |
| int ON_BezierCurve::m_cv_stride |
Number of doubles per cv ( >= ((m_is_rat)?m_dim+1:m_dim) )
| int ON_BezierCurve::m_dim |
Implementation.
dimension of bezier (>=1)
| int ON_BezierCurve::m_is_rat |
1 if bezier is rational, 0 if bezier is not rational
| int ON_BezierCurve::m_order |
order = degree+1