rigComponent 0.1.1
RigKit pack API - rigComponent
Loading...
Searching...
No Matches
PathEllipticArc.h File Reference

Builds, flattens, splits, and transforms SVG elliptical arcs held as CPath::ArcTo. More...

#include <glm/glm.hpp>
#include <vector>
#include "CPath.h"
Include dependency graph for PathEllipticArc.h:

Classes

struct  rigkit::path::EllipticArc
 SVG F.6 elliptical arc kept as CPath::ArcTo. More...

Functions

ecs::CPath::Command rigkit::path::makeArcTo (const glm::vec2 &end, float rx, float ry, float xRotDeg, bool largeArc, bool sweep)
 Build an ArcTo command (endpoint + SVG A parameters).
void rigkit::path::flatten (const EllipticArc &arc, float tol, std::vector< glm::vec2 > &out)
 Sample the arc (endpoint last).
void rigkit::path::appendCubics (const EllipticArc &arc, ecs::CPath &out)
 Append CubicTo approximations (SVG F.6).
void rigkit::path::applyLinear (ecs::CPath::Command &cmd, float a, float b, float c, float d)
 Map ellipse axes through a 2x2 (SVG matrix a,b,c,d).
bool rigkit::path::split (const EllipticArc &arc, float t, EllipticArc &left, EllipticArc &right)
 Split at t in (0,1) along the swept angle.

Detailed Description

Builds, flattens, splits, and transforms SVG elliptical arcs held as CPath::ArcTo.

The portable .rig path schema has no arc command, so expand to cubics before saving.

Function Documentation

◆ appendCubics()

void rigkit::path::appendCubics ( const EllipticArc & arc,
ecs::CPath & out )

Append CubicTo approximations (SVG F.6).

LineTo when a radius is zero.

◆ applyLinear()

void rigkit::path::applyLinear ( ecs::CPath::Command & cmd,
float a,
float b,
float c,
float d )

Map ellipse axes through a 2x2 (SVG matrix a,b,c,d).

Flips sweep if det < 0.

Endpoints are transformed by the caller. Radii / rotation update here.

◆ flatten()

void rigkit::path::flatten ( const EllipticArc & arc,
float tol,
std::vector< glm::vec2 > & out )

Sample the arc (endpoint last).

Empty when the arc collapses to a point.

◆ split()

bool rigkit::path::split ( const EllipticArc & arc,
float t,
EllipticArc & left,
EllipticArc & right )

Split at t in (0,1) along the swept angle.

Both pieces stay ArcTo.