Donner
Embeddable browser-grade SVG2 engine
Loading...
Searching...
No Matches
BezierUtils.h File Reference
#include <array>
#include <utility>
#include <vector>
#include "donner/base/Box.h"
#include "donner/base/SmallVector.h"
#include "donner/base/Vector2.h"
Include dependency graph for BezierUtils.h:
This graph shows which files directly or indirectly include this file:

Namespaces

namespace  donner
 Top-level Donner namespace, which is split into different sub-namespaces such as donner::svg and donner::css.

Functions

Vector2d donner::EvalQuadratic (const Vector2d &p0, const Vector2d &p1, const Vector2d &p2, double t)
 Evaluate a quadratic Bezier curve at parameter t using the standard basis expansion.
Vector2d donner::EvalCubic (const Vector2d &p0, const Vector2d &p1, const Vector2d &p2, const Vector2d &p3, double t)
 Evaluate a cubic Bezier curve at parameter t using the standard basis expansion.
std::pair< std::array< Vector2d, 3 >, std::array< Vector2d, 3 > > donner::SplitQuadratic (const Vector2d &p0, const Vector2d &p1, const Vector2d &p2, double t)
 Split a quadratic Bezier curve at parameter t using De Casteljau subdivision.
std::pair< std::array< Vector2d, 4 >, std::array< Vector2d, 4 > > donner::SplitCubic (const Vector2d &p0, const Vector2d &p1, const Vector2d &p2, const Vector2d &p3, double t)
 Split a cubic Bezier curve at parameter t using De Casteljau subdivision.
void donner::ApproximateCubicWithQuadratics (const Vector2d &p0, const Vector2d &p1, const Vector2d &p2, const Vector2d &p3, double tolerance, std::vector< Vector2d > &out)
 Approximate a cubic Bezier curve as a sequence of quadratic Bezier curves within a given tolerance.
SmallVector< double, 1 > donner::QuadraticYExtrema (const Vector2d &p0, const Vector2d &p1, const Vector2d &p2)
 Find parameter values where the Y-derivative is zero for a quadratic Bezier curve.
SmallVector< double, 2 > donner::CubicYExtrema (const Vector2d &p0, const Vector2d &p1, const Vector2d &p2, const Vector2d &p3)
 Find parameter values where the Y-derivative is zero for a cubic Bezier curve.
Box2d donner::QuadraticBounds (const Vector2d &p0, const Vector2d &p1, const Vector2d &p2)
 Compute the tight axis-aligned bounding box of a quadratic Bezier curve.
Box2d donner::CubicBounds (const Vector2d &p0, const Vector2d &p1, const Vector2d &p2, const Vector2d &p3)
 Compute the tight axis-aligned bounding box of a cubic Bezier curve.