20 enum class Type { Anchor, QuadraticControl, CubicControl1, CubicControl2 };
42 std::vector<bezier_point>::const_iterator
const begin,
43 std::vector<bezier_point>::const_iterator
const end)
noexcept
49 auto prev_it =
end - 1;
50 auto prev_prev_it =
end - 2;
51 for (
auto it =
begin; it !=
end; it++) {
53 case bezier_point::Type::Anchor:
54 hi_axiom(prev_it->type != bezier_point::Type::CubicControl1);
58 case bezier_point::Type::QuadraticControl:
59 if (it->type == bezier_point::Type::QuadraticControl) {
60 r.
emplace_back(midpoint(prev_it->p, it->p), bezier_point::Type::Anchor);
63 hi_axiom(prev_it->type == bezier_point::Type::Anchor);
68 case bezier_point::Type::CubicControl1:
72 case bezier_point::Type::CubicControl2:
73 if (prev_it->type == bezier_point::Type::Anchor) {
74 hi_axiom(prev_prev_it->type == bezier_point::Type::CubicControl2);
76 r.
emplace_back(reflect(prev_prev_it->p, prev_it->p), bezier_point::Type::CubicControl1);
78 hi_axiom(prev_it->type == bezier_point::Type::CubicControl1);
87 prev_prev_it = prev_it;
91 for (
ssize_t i = 0; i < ssize(r); i++) {
92 if (r[i].type == bezier_point::Type::Anchor) {