|
Aleph-w 3.0
A C++ Library for Data Structures and Algorithms
|
Quadratic and cubic Bézier curves with exact rational arithmetic. More...
#include <geom_algorithms.H>
Classes | |
| struct | SplitResult |
| De Casteljau subdivision: split a cubic Bézier at parameter t into two cubic Béziers (left and right). More... | |
Static Public Member Functions | |
| static Point | quadratic (const Point &p0, const Point &p1, const Point &p2, const Geom_Number &t) |
| Evaluate a quadratic Bézier at parameter t. | |
| static Point | cubic (const Point &p0, const Point &p1, const Point &p2, const Point &p3, const Geom_Number &t) |
| Evaluate a cubic Bézier at parameter t. | |
| static Array< Point > | sample_quadratic (const Point &p0, const Point &p1, const Point &p2, const size_t n) |
| Sample a quadratic Bézier into n+1 points (t = 0, 1/n, ..., 1). | |
| static Array< Point > | sample_cubic (const Point &p0, const Point &p1, const Point &p2, const Point &p3, const size_t n) |
| Sample a cubic Bézier into n+1 points. | |
| static SplitResult | split_cubic (const Point &p0, const Point &p1, const Point &p2, const Point &p3, const Geom_Number &t) |
| static Rectangle | control_bbox (const Point &p0, const Point &p1, const Point &p2, const Point &p3) |
| Compute the bounding box of a cubic Bézier's control polygon. | |
| static Polygon | approximate_quadratic (const Point &p0, const Point &p1, const Point &p2, const size_t n) |
| Approximate a quadratic Bézier as a polyline (polygon without closing). | |
| static Polygon | approximate_cubic (const Point &p0, const Point &p1, const Point &p2, const Point &p3, const size_t n) |
| Approximate a cubic Bézier as a polyline. | |
Quadratic and cubic Bézier curves with exact rational arithmetic.
A Bézier curve is a parametric curve defined by control points.
Since the parameter t ∈ [0,1] is rational, evaluation is exact.
Definition at line 11133 of file geom_algorithms.H.
|
inlinestatic |
Approximate a cubic Bézier as a polyline.
Definition at line 11275 of file geom_algorithms.H.
References Aleph::Polygon::add_vertex(), Aleph::divide_and_conquer_partition_dp(), and sample_cubic().
|
inlinestatic |
Approximate a quadratic Bézier as a polyline (polygon without closing).
Definition at line 11263 of file geom_algorithms.H.
References Aleph::Polygon::add_vertex(), Aleph::divide_and_conquer_partition_dp(), and sample_quadratic().
|
inlinestatic |
Compute the bounding box of a cubic Bézier's control polygon.
Definition at line 11243 of file geom_algorithms.H.
References Aleph::divide_and_conquer_partition_dp(), Aleph::Point::get_x(), and Aleph::Point::get_y().
Referenced by TEST_F().
|
inlinestatic |
Evaluate a cubic Bézier at parameter t.
Definition at line 11154 of file geom_algorithms.H.
References Aleph::divide_and_conquer_partition_dp(), Aleph::Point::get_x(), and Aleph::Point::get_y().
Referenced by sample_cubic(), TEST_F(), TEST_F(), and TEST_F().
|
inlinestatic |
Evaluate a quadratic Bézier at parameter t.
Definition at line 11138 of file geom_algorithms.H.
References Aleph::divide_and_conquer_partition_dp(), Aleph::Point::get_x(), and Aleph::Point::get_y().
Referenced by sample_quadratic(), TEST_F(), and TEST_F().
|
inlinestatic |
Sample a cubic Bézier into n+1 points.
Definition at line 11188 of file geom_algorithms.H.
References ah_domain_error_if, cubic(), Aleph::divide_and_conquer_partition_dp(), and Aleph::Array< T >::reserve().
Referenced by approximate_cubic(), and TEST_F().
|
inlinestatic |
Sample a quadratic Bézier into n+1 points (t = 0, 1/n, ..., 1).
Definition at line 11176 of file geom_algorithms.H.
References ah_domain_error_if, Aleph::divide_and_conquer_partition_dp(), quadratic(), and Aleph::Array< T >::reserve().
Referenced by approximate_quadratic(), and TEST_F().
|
inlinestatic |
Definition at line 11209 of file geom_algorithms.H.
References Aleph::divide_and_conquer_partition_dp(), Aleph::Point::get_x(), Aleph::Point::get_y(), and Aleph::BezierCurve::SplitResult::left.
Referenced by TEST_F().