OGLplus  (0.59.0) a C++ wrapper for rendering APIs

eagine::math::cubic_bezier_loop< Type, Parameter > Class Template Reference

A closed smooth cubic Bezier spline passing through all input points. More...

#include <eagine/math/curve.hpp>

Public Member Functions

template<typename P , typename S >
 cubic_bezier_loop (memory::basic_span< const Type, P, S > points, Parameter r=Parameter(1)/Parameter(3))
 Creates a loop passing through the sequence of the input points.
 
- Public Member Functions inherited from eagine::math::bezier_curves< Type, Parameter, 3 >
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...
 
 bezier_curves (memory::basic_span< const Type, P, S > points)
 Creates the bezier curves from the control points. More...
 
 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.
 

Additional Inherited Members

- Static Public Member Functions inherited from eagine::math::bezier_curves< Type, Parameter, 3 >
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].
 

Detailed Description

template<typename Type, typename Parameter>
class eagine::math::cubic_bezier_loop< Type, Parameter >

A closed smooth cubic Bezier spline passing through all input points.

This class constructs a closed sequence of Bezier curves that are smooth at the curve connection points. The control points between the begin and end points of each segment are calculated automatically to make the transition between the individual segments smooth.


The documentation for this class was generated from the following file:

Copyright © 2015-2021 Matúš Chochlík.
<chochlik -at -gmail.com>
Documentation generated on Tue Apr 13 2021 by Doxygen (version 1.8.17).