|
openNURBS SDK Help
6.0
|
#include <opennurbs_bezier.h>
Public Member Functions | |
| ON_BezierCurve () | |
| ON_BezierCurve (int dim, bool bIsRational, int order) | |
| ON_BezierCurve (const ON_BezierCurve &) | |
| ON_BezierCurve (const ON_PolynomialCurve &) | |
| ON_BezierCurve (const ON_2dPointArray &) | |
| sets control points More... | |
| ON_BezierCurve (const ON_3dPointArray &) | |
| sets control points More... | |
| ON_BezierCurve (const ON_4dPointArray &) | |
| sets control points More... | |
| ~ON_BezierCurve () | |
| ON_BoundingBox | BoundingBox () const |
| bool | ChangeDimension (int desired_dimension) |
| bool | ChangeWeights (int i0, double w0, int i1, double w1) |
| const ON_4dPoint | ControlPoint (int cv_index) const |
| double | ControlPolygonLength () const |
| bool | Create (int dim, bool bIsRational, int order) |
| ON_3dVector | CurvatureAt (double t) const |
| double * | CV (int cv_index) const |
| int | CVCount () const |
| int | CVSize () const |
| ON::point_style | CVStyle () const |
| int | Degree () const |
| ON_3dVector | DerivativeAt (double t) const |
| void | Destroy () |
| int | Dimension () const |
| ON_Interval | Domain () const |
| void | Dump (ON_TextLog &) const |
| for debugging More... | |
| void | EmergencyDestroy () |
| call if memory used by ON_NurbsCurve becomes invalid More... | |
| bool | Ev1Der (double t, ON_3dPoint &point, ON_3dVector &first_derivative) const |
| bool | Ev2Der (double t, ON_3dPoint &point, ON_3dVector &first_derivative, ON_3dVector &second_derivative) const |
| bool | Evaluate (double t, int der_count, int v_stride, double *v) const |
| bool | EvCurvature (double t, ON_3dPoint &point, ON_3dVector &tangent, ON_3dVector &kappa) const |
| bool | EvPoint (double t, ON_3dPoint &point) const |
| bool | EvTangent (double t, ON_3dPoint &point, ON_3dVector &tangent) const |
| bool | GetBBox (double *box_min, double *box_max, bool bGrowBox=false) const |
| bool | GetBoundingBox (ON_BoundingBox &bbox, int bGrowBox=false) const |
| bool | GetCV (int cv_index, ON::point_style pointstyle, double *cv) const |
| bool | GetCV (int cv_index, ON_3dPoint &point) const |
| bool | GetCV (int cv_index, ON_4dPoint &point) const |
| int | GetNurbForm (ON_NurbsCurve &nurbs_curve) const |
| bool | GetTightBoundingBox (ON_BoundingBox &tight_bbox, bool bGrowBox=false, const ON_Xform *xform=nullptr) const |
| bool | IncreaseDegree (int desired_degree) |
| bool | IsRational () const |
| bool | IsValid () const |
| bool | Loft (const ON_3dPointArray &points) |
| bool | Loft (int pt_dim, int pt_count, int pt_stride, const double *pt, int t_stride, const double *t) |
| bool | MakeNonRational () |
| bool | MakeRational () |
| ON_BezierCurve & | operator= (const ON_BezierCurve &) |
| ON_BezierCurve & | operator= (const ON_PolynomialCurve &) |
| ON_BezierCurve & | operator= (const ON_2dPointArray &) |
| sets control points More... | |
| ON_BezierCurve & | operator= (const ON_3dPointArray &) |
| sets control points More... | |
| ON_BezierCurve & | operator= (const ON_4dPointArray &) |
| sets control points More... | |
| int | Order () const |
| order = degree + 1 More... | |
| ON_3dPoint | PointAt (double t) const |
| bool | Reparameterize (double c) |
| 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 () |
| bool | Rotate (double sin_angle, double cos_angle, const ON_3dVector &rotation_axis, const ON_3dPoint &rotation_center) |
| bool | Rotate (double rotation_angle, const ON_3dVector &rotation_axis, const ON_3dPoint &rotation_center) |
| bool | Scale (double scale_factor) |
| bool | ScaleConrolPoints (int i, double w) |
| bool | SetCV (int cv_index, ON::point_style pointstyle, const double *cv) |
| bool | SetCV (int cv_index, const ON_3dPoint &point) |
| bool | SetCV (int cv_index, const ON_4dPoint &point) |
| bool | SetWeight (int cv_index, double weight) |
| bool | Split (double t, ON_BezierCurve &left_side, ON_BezierCurve &right_side) const |
| ON_3dVector | TangentAt (double t) const |
| bool | Transform (const ON_Xform &xform) |
| bool | Translate (const ON_3dVector &translation_vector) |
| bool | Trim (const ON_Interval &interval) |
| double | Weight (int cv_index) const |
| bool | ZeroCVs () |
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 | ||
| ) |
Description: Creates a bezier with cv memory allocated. Parameters: 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 & | ) |
sets control points
| ON_BezierCurve::ON_BezierCurve | ( | const ON_3dPointArray & | ) |
sets control points
| ON_BezierCurve::ON_BezierCurve | ( | const ON_4dPointArray & | ) |
sets control points
| ON_BoundingBox ON_BezierCurve::BoundingBox | ( | ) | const |
Description: Gets bounding box. Returns: Axis aligned bounding box.
| bool ON_BezierCurve::ChangeDimension | ( | int | desired_dimension | ) |
Description: Change dimension of bezier. Parameters: desired_dimension - [in] Returns: true if successful. false if desired_dimension < 1
| bool ON_BezierCurve::ChangeWeights | ( | int | i0, |
| double | w0, | ||
| int | i1, | ||
| double | w1 | ||
| ) |
Description: Use a combination of scaling and reparameterization to set two rational Bezier weights to specified values. Parameters: 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 Returns: True if successful. The returned bezier has the same locus but probably has a different parameterization. Remarks: 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).
See Also: ON_Bezier::Reparameterize ON_Bezier::ScaleConrolPoints
| const ON_4dPoint ON_BezierCurve::ControlPoint | ( | int | cv_index | ) | const |
Parameters: cv_index - [in] zero based control point index Returns: Control point as an ON_4dPoint. Remarks: 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 |
Description: returns the length of the control polygon
| bool ON_BezierCurve::Create | ( | int | dim, |
| bool | bIsRational, | ||
| int | order | ||
| ) |
Description: Creates a bezier with cv memory allocated. Parameters: dim - [in] (>0) dimension of bezier curve bIsRational - [in] true for a rational bezier order - [in] (>=2) order (=degree+1) of bezier curve Returns: true if successful.
| ON_3dVector ON_BezierCurve::CurvatureAt | ( | double | t | ) | const |
Description: Evaluate the curvature vector at a parameter. Parameters: t - [in] evaluation parameter Returns: curvature vector of the curve at the parameter t. Remarks: No error handling. See Also: ON_Curve::EvCurvature
| double* ON_BezierCurve::CV | ( | int | cv_index | ) | const |
Description: 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& ). Parameters: cv_index - [in] (0 <= cv_index < m_order) Returns: Pointer to control vertex. Remarks: 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 |
Returns: Number of control vertices in the bezier. This is always the same as the order of the bezier.
| int ON_BezierCurve::CVSize | ( | ) | const |
Returns: Number of doubles per control vertex. (= IsRational() ? Dim()+1 : Dim())
| ON::point_style ON_BezierCurve::CVStyle | ( | ) | const |
Description: Returns the style of control vertices in the m_cv array. Returns: table ON::not_rational m_is_rat is false ON::homogeneous_rational m_is_rat is true
| int ON_BezierCurve::Degree | ( | ) | const |
Returns: Degree of the bezier. (degree=order-1)
| ON_3dVector ON_BezierCurve::DerivativeAt | ( | double | t | ) | const |
Description: Evaluate first derivative at a parameter. Parameters: t - [in] evaluation parameter Returns: First derivative of the curve at the parameter t. Remarks: No error handling. See Also: ON_Curve::Ev1Der
| void ON_BezierCurve::Destroy | ( | ) |
Description: Deallocates m_cv memory.
| int ON_BezierCurve::Dimension | ( | ) | const |
Returns: Dimension of bezier.
| ON_Interval ON_BezierCurve::Domain | ( | ) | const |
Returns: Domain of bezier (always [0,1]).
| void ON_BezierCurve::Dump | ( | ON_TextLog & | ) | const |
for debugging
| void ON_BezierCurve::EmergencyDestroy | ( | ) |
call if memory used by ON_NurbsCurve becomes invalid
| bool ON_BezierCurve::Ev1Der | ( | double | t, |
| ON_3dPoint & | point, | ||
| ON_3dVector & | first_derivative | ||
| ) | const |
Description: Evaluate first derivative at a parameter with error checking. Parameters: t - [in] evaluation parameter point - [out] value of curve at t first_derivative - [out] value of first derivative at t Returns: false if unable to evaluate.
| bool ON_BezierCurve::Ev2Der | ( | double | t, |
| ON_3dPoint & | point, | ||
| ON_3dVector & | first_derivative, | ||
| ON_3dVector & | second_derivative | ||
| ) | const |
Description: Evaluate second derivative at a parameter with error checking. Parameters: 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 Returns: false if unable to evaluate.
| bool ON_BezierCurve::Evaluate | ( | double | t, |
| int | der_count, | ||
| int | v_stride, | ||
| double * | v | ||
| ) | const |
Description: Evaluate a bezier. Parameters: 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. Returns: true if successful
| bool ON_BezierCurve::EvCurvature | ( | double | t, |
| ON_3dPoint & | point, | ||
| ON_3dVector & | tangent, | ||
| ON_3dVector & | kappa | ||
| ) | const |
Description: Evaluate unit tangent and curvature at a parameter with error checking. Parameters: t - [in] evaluation parameter point - [out] value of curve at t tangent - [out] value of unit tangent kappa - [out] value of curvature vector Returns: false if unable to evaluate.
| bool ON_BezierCurve::EvPoint | ( | double | t, |
| ON_3dPoint & | point | ||
| ) | const |
Description: Evaluate point at a parameter with error checking. Parameters: t - [in] evaluation parameter point - [out] value of curve at t Returns: false if unable to evaluate.
| bool ON_BezierCurve::EvTangent | ( | double | t, |
| ON_3dPoint & | point, | ||
| ON_3dVector & | tangent | ||
| ) | const |
Description: Evaluate unit tangent at a parameter with error checking. Parameters: t - [in] evaluation parameter point - [out] value of curve at t tangent - [out] value of unit tangent Returns: false if unable to evaluate. See Also: ON_Curve::TangentAt ON_Curve::Ev1Der
| bool ON_BezierCurve::GetBBox | ( | double * | box_min, |
| double * | box_max, | ||
| bool | bGrowBox = false |
||
| ) | const |
Description: Gets bounding box. Parameters: 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. Returns: true if successful.
| box_min | returns true if successful |
| bool ON_BezierCurve::GetBoundingBox | ( | ON_BoundingBox & | bbox, |
| int | bGrowBox = false |
||
| ) | const |
Description: Gets bounding box. Parameters: 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. Returns: true if successful.
| bool ON_BezierCurve::GetCV | ( | int | cv_index, |
| ON::point_style | pointstyle, | ||
| double * | cv | ||
| ) | const |
Description: Get location of a control vertex. Parameters: 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. Returns: true if successful. false if cv_index is invalid.
| bool ON_BezierCurve::GetCV | ( | int | cv_index, |
| ON_3dPoint & | point | ||
| ) | const |
Description: Get location of a control vertex. Parameters: 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. Returns: true if successful.
| bool ON_BezierCurve::GetCV | ( | int | cv_index, |
| ON_4dPoint & | point | ||
| ) | const |
Description: Get value of a control vertex. Parameters: 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. Returns: true if successful.
| int ON_BezierCurve::GetNurbForm | ( | ON_NurbsCurve & | nurbs_curve | ) | const |
Description: Get ON_NurbsCurve form of a bezier. Parameters: nurbs_curve - [out] NURBS curve form of a bezier. The domain is [0,1]. Returns: 0 = failure 1 = success
| bool ON_BezierCurve::GetTightBoundingBox | ( | ON_BoundingBox & | tight_bbox, |
| bool | bGrowBox = false, |
||
| const ON_Xform * | xform = nullptr |
||
| ) | const |
Description: Get tight bounding box of the bezier. Parameters: 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. Returns: True if the returned tight_bbox is set to a valid bounding box.
| bool ON_BezierCurve::IncreaseDegree | ( | int | desired_degree | ) |
Description: Increase degree of bezier. Parameters: desired_degree - [in] Returns: true if successful. false if desired_degree < current degree.
| bool ON_BezierCurve::IsRational | ( | ) | const |
Returns: true if bezier is rational.
| bool ON_BezierCurve::IsValid | ( | ) | const |
| bool ON_BezierCurve::Loft | ( | const ON_3dPointArray & | points | ) |
Description: Loft a bezier curve through a list of points. Parameters: points - [in] an array of 2 or more points to interpolate Returns: true if successful Remarks: 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 | ||
| ) |
Description: Loft a bezier curve through a list of points. Parameters: 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 Returns: true if successful Remarks: The result has order = points.Count() and the loft uses the parameterizaton curve( t[i] ) = points[i].
| bool ON_BezierCurve::MakeNonRational | ( | ) |
Description: Make beizer not rational by setting all control vertices to their euclidean locations and setting m_is_rat to false. See Also: ON_Bezier::MakeRational
| bool ON_BezierCurve::MakeRational | ( | ) |
Description: Make beizer rational. Returns: true if successful. See Also: ON_Bezier::MakeNonRational
| ON_BezierCurve& ON_BezierCurve::operator= | ( | const ON_BezierCurve & | ) |
| ON_BezierCurve& ON_BezierCurve::operator= | ( | const ON_PolynomialCurve & | ) |
| ON_BezierCurve& ON_BezierCurve::operator= | ( | const ON_2dPointArray & | ) |
sets control points
| ON_BezierCurve& ON_BezierCurve::operator= | ( | const ON_3dPointArray & | ) |
sets control points
| ON_BezierCurve& ON_BezierCurve::operator= | ( | const ON_4dPointArray & | ) |
sets control points
| int ON_BezierCurve::Order | ( | ) | const |
order = degree + 1
Returns: Order of the bezier. (order=degree+1)
| ON_3dPoint ON_BezierCurve::PointAt | ( | double | t | ) | const |
Description: Evaluate point at a parameter. Parameters: t - [in] evaluation parameter Returns: Point (location of curve at the parameter t).
| bool ON_BezierCurve::Reparameterize | ( | double | c | ) |
Description: 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. Parameters: c - [in] reparameterization constant (generally speaking, c should be > 0). If c != 1, then the returned bezier will be rational. Returns: true if successful. Remarks: 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. See Also: ON_Bezier::ScaleConrolPoints
| 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.
Description: Make sure m_cv array has a certain length. Parameters: desired_cv_capacity - [in] minimum length of m_cv array. Returns: true if successful.
| bool ON_BezierCurve::Reverse | ( | ) |
Description: 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 | ||
| ) |
Description: Rotates the bezier curve about the specified axis. A positive rotation angle results in a counter-clockwise rotation about the axis (right hand rule). Parameters: 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 Returns: true if bezier curve successfully rotated Remarks: 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 | ||
| ) |
Description: Rotates the bezier curve about the specified axis. A positive rotation angle results in a counter-clockwise rotation about the axis (right hand rule). Parameters: 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 Returns: true if bezier curve successfully rotated Remarks: Uses ON_BezierCurve::Transform() function to calculate the result.
| bool ON_BezierCurve::Scale | ( | double | scale_factor | ) |
Description: Scales the bezier curve by the specified facotor. The scale is centered at the origin. Parameters: scale_factor - [in] scale factor Returns: true if bezier curve successfully scaled Remarks: Uses ON_BezierCurve::Transform() function to calculate the result.
| bool ON_BezierCurve::ScaleConrolPoints | ( | int | i, |
| double | w | ||
| ) |
Description: Scale a rational Bezier's control vertices to set a weight to a specified value. Parameters: i - [in] (0 <= i < order) w - [in] w != 0.0 Returns: True if successful. The i-th control vertex will have weight w. Remarks: Each control point is multiplied by w/w0, where w0 is the input value of Weight(i). See Also: ON_Bezier::Reparameterize ON_Bezier::ChangeWeights
| bool ON_BezierCurve::SetCV | ( | int | cv_index, |
| ON::point_style | pointstyle, | ||
| const double * | cv | ||
| ) |
Description: Set control vertex Parameters: 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. Returns: true if the point can be set.
| bool ON_BezierCurve::SetCV | ( | int | cv_index, |
| const ON_3dPoint & | point | ||
| ) |
Description: Set location of a control vertex. Parameters: 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. Returns: true if successful. See Also: ON_BezierCurve::CV, ON_BezierCurve::SetCV, ON_BezierCurve::SetWeight, ON_BezierCurve::Weight
| bool ON_BezierCurve::SetCV | ( | int | cv_index, |
| const ON_4dPoint & | point | ||
| ) |
Description: Set value of a control vertex. Parameters: 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. Returns: true if successful. See Also: ON_BezierCurve::CV, ON_BezierCurve::SetCV, ON_BezierCurve::SetWeight, ON_BezierCurve::Weight
| bool ON_BezierCurve::SetWeight | ( | int | cv_index, |
| double | weight | ||
| ) |
Description: Set weight of a control vertex. Parameters: cv_index - [in] control vertex index (0 <= cv_index < m_order) weight - [in] weight Returns: true if the weight can be set. If weight is not 1 and the bezier is not rational, then false is returned. Use ON_BezierCurve::MakeRational to make a bezier curve rational. See Also: ON_BezierCurve::SetCV, ON_BezierCurve::MakeRational, ON_BezierCurve::IsRational, ON_BezierCurve::Weight
| bool ON_BezierCurve::Split | ( | double | t, |
| ON_BezierCurve & | left_side, | ||
| ON_BezierCurve & | right_side | ||
| ) | const |
Description: 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. Parameters: t - [in] (0 < t < 1 ) parameter to split at left_side - [out] right_side - [out]
Example: ON_BezierCurve crv = ...; ON_BezierCurve right_side; crv.Split( 0.5, crv, right_side ); would split crv at the 1/2, put the left side in crv, and return the right side in right_side.
| ON_3dVector ON_BezierCurve::TangentAt | ( | double | t | ) | const |
Description: Evaluate unit tangent vector at a parameter. Parameters: t - [in] evaluation parameter Returns: Unit tangent vector of the curve at the parameter t. Remarks: No error handling. See Also: ON_Curve::EvTangent
| bool ON_BezierCurve::Transform | ( | const ON_Xform & | xform | ) |
Description: Transform the bezier. Parameters: xform - [in] transformation to apply to bezier Returns: true if successful. false if bezier is invalid and cannot be transformed.
| bool ON_BezierCurve::Translate | ( | const ON_3dVector & | translation_vector | ) |
Description: Translates the bezier curve along the specified vector. Parameters: translation_vector - [in] translation vector Returns: true if bezier curve successfully translated Remarks: Uses ON_BezierCurve::Transform() function to calculate the result.
| bool ON_BezierCurve::Trim | ( | const ON_Interval & | interval | ) |
Description: 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.) Parameters: interval -[in] Example: An interval of [0,1] leaves the bezier unchanged. An interval of [0.5,1] would trim away the left half. An interval of [0.0,2.0] would extend the right end.
| double ON_BezierCurve::Weight | ( | int | cv_index | ) | const |
Parameters: cv_index - [in] control vertex index (0<=i<m_order) Returns: Weight of the i-th control vertex.
| bool ON_BezierCurve::ZeroCVs | ( | ) |
Description: 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 |
Number of doubles in m_cv array. If m_cv_capacity is zero and m_cv is not nullptr, an expert user is managing the m_cv memory. ~ON_BezierCurve will not deallocate m_cv unless m_cv_capacity is greater than zero.
| 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.
NOTE: These members are left "public" so that expert users may efficiently create bezier curves using the default constructor and borrow the knot and CV arrays from their native NURBS representation. No technical support will be provided for users who access these members directly. If you can't get your stuff to work, then use the constructor with the arguments and the SetKnot() and SetCV() functions to fill in the arrays. 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
1.8.14