A sequence of Bezier curves, possibly connected at end points. More...
#include <eagine/math/curve.hpp>
Public Member Functions | |
| auto | is_connected () const noexcept -> bool |
| Returns true if the individual curves are connected. | |
| auto | is_separated () const noexcept -> bool |
| Returns true if the individual curves are disconnected. | |
| bezier_curves (std::vector< Type > points) | |
Creates the bezier curves from the control points. More... | |
| bezier_curves (std::vector< Type > points, bool connected) | |
Creates the bezier curves from the control points. More... | |
| template<typename P , typename S > | |
| bezier_curves (memory::basic_span< const Type, P, S > points) | |
Creates the bezier curves from the control points. More... | |
| template<typename P , typename S > | |
| bezier_curves (memory::basic_span< const Type, P, S > points, bool connected) | |
Creates the bezier curves from the control points. More... | |
| auto | segment_count () const noexcept -> span_size_t |
| Returns the count of individual curves in the sequence. | |
| auto | control_points () const noexcept -> const std::vector< Type > & |
| Returns the contol points of the curve. | |
| auto | position01 (Parameter t) const noexcept -> Type |
| Gets the point on the curve at position t (must be in (0.0, 1.0)). | |
| auto | position (Parameter t) const noexcept -> Type |
| Gets the point on the curve at position t wrapped to [0.0, 1.0]. | |
| void | approximate (std::vector< Type > &dest, valid_if_positive< span_size_t > n) const noexcept |
| Makes a sequence of points on the curve (n points per segment). | |
| auto | approximate (valid_if_positive< span_size_t > n) const -> std::vector< Type > |
| Returns a sequence of points on the curve (n points per segment). | |
| auto | derivative () const noexcept -> bezier_curves< Type, Parameter, Order - 1 > |
| Returns a derivative of this curve. | |
Static Public Member Functions | |
| static auto | are_connected (const std::vector< Type > &points) noexcept -> bool |
| Returns whether the curves made from points are connected. | |
| static auto | points_are_ok (const std::vector< Type > &points) noexcept -> bool |
| checks if the sequence of control points is OK for this curve type. | |
| static auto | wrap (Parameter t) noexcept -> Parameter |
| Wraps the parameter value to [0.0, 1.0]. | |
A sequence of Bezier curves, possibly connected at end points.
This class stores the data for a sequence of connected Bezier curves of a given Order. The begin of the i-th curve (segment) is equal to the end of the (i-1)-th curve and the end of the i-th curve is equal to the begin of the (i+1)-th curve. Between the begin and end (control) points there is a fixed number (Order - 1) of curve control points. The curves pass through the begin and end and are influenced by the other control points.
|
inline |
Creates the bezier curves from the control points.
The number of points must be ((C * Order) + 1) or (C * (Order + 1)) where C is the number of curves (segments) in the sequence. If both of the above are true then the curves are considered to be connected.
|
inline |
Creates the bezier curves from the control points.
The number of points must be ((C * Order) + 1) and connected or (C * (Order + 1)) and not(connected), where C is the number of curves (segments) in the sequence.
|
inline |
Creates the bezier curves from the control points.
The number of points must be ((C * Order) + 1) or (C * (Order + 1)) where C is the number of curves (segments) in the sequence. If both of the above are true then the curves are considered to be connected.
|
inline |
Creates the bezier curves from the control points.
The number of points must be ((C * Order) + 1) or (C * (Order + 1)) where C is the number of curves (segments) in the sequence. If both of the above are true then the curves are considered to be connected.