CGAL 4.12.1 - 2D Arrangements
CGAL::Arr_Bezier_curve_traits_2< RatKernel, AlgKernel, NtTraits >::Curve_2 Class Reference

#include <CGAL/Arr_Bezier_curve_traits_2.h>

Definition

The Curve_2 class nested within the Bézier traits class is used to represent a Bézier curve of arbitrary degree, which is defined by a sequence of rational control points.

In addition to the methods listed below, the I/O operators operator<< and operator>> for standard output-streams are also supported. The copy constructor and assignment operator are supported as well.

Creation

Curve_2 ()
default constructor.

template<class InputIterator >
Curve_2 (InputIterator pts_begin, InputIterator pts_end)
constructs a Bézier curve as defined by the given range of control points. More...

Access Functions

size_t number_of_control_points () const
returns the number of control points that define B.

RatKernel::Point_2 control_point (size_t k) const
returns the $$k$$th control point. More...

RatKernel::Point_2 operator() (const Rational &t) const
returns the point $$B(t)$$ on the curve that corresponds to the given rational parameter value.

AlgKernel::Point_2 operator() (const Algebraic &t) const
returns the point $$B(t)$$ on the curve that corresponds to the given algebraic parameter value.

◆ Curve_2()

template<typename RatKernel , typename AlgKernel , typename NtTraits >
template<class InputIterator >
 CGAL::Arr_Bezier_curve_traits_2< RatKernel, AlgKernel, NtTraits >::Curve_2::Curve_2 ( InputIterator pts_begin, InputIterator pts_end )

constructs a Bézier curve as defined by the given range of control points.

The value-type of InputIterator is RatKernel::Point_2.

Precondition
The input range must contain at least two control points.

◆ control_point()

template<typename RatKernel , typename AlgKernel , typename NtTraits >
 RatKernel::Point_2 CGAL::Arr_Bezier_curve_traits_2< RatKernel, AlgKernel, NtTraits >::Curve_2::control_point ( size_t k ) const

returns the $$k$$th control point.

Note that the first control point equals the curve source, while the last control point equals its target. The rest of the control points do not lie on the curve.

Precondition
$$k$$ is smaller than the number of control points.