KiCad PCB EDA Suite
Loading...
Searching...
No Matches
bezier_curves.h File Reference
#include <vector>
#include <math/vector2d.h>

Go to the source code of this file.

Classes

class  BEZIER_POLY
 Bezier curves to polygon converter. More...
 
class  BEZIER< NumericType >
 Generic cubic Bezier representation. More...
 

Functions

template<typename T >
void TransformEllipseToBeziers (const ELLIPSE< T > &aEllipse, std::vector< BEZIER< T > > &aBeziers)
 Transforms an ellipse or elliptical arc into a set of quadratic Bezier curves that approximate it.
 

Function Documentation

◆ TransformEllipseToBeziers()

template<typename T >
void TransformEllipseToBeziers ( const ELLIPSE< T > &  aEllipse,
std::vector< BEZIER< T > > &  aBeziers 
)

Transforms an ellipse or elliptical arc into a set of quadratic Bezier curves that approximate it.

Minimum number of Beziers to use for a full circle to keep error manageable.

The number of Beziers needed for the given arc

Angle occupied by each Bezier

Definition at line 600 of file bezier_curves.cpp.

References std::abs(), ANGLE_0, ANGLE_360, EDA_ANGLE::AsRadians(), BEZIER< NumericType >::C1, BEZIER< NumericType >::C2, ELLIPSE< NumericType >::Center, BEZIER< NumericType >::End, ELLIPSE< NumericType >::EndAngle, ELLIPSE< NumericType >::MajorRadius, ELLIPSE< NumericType >::MinorRadius, RADIANS_T, RotatePoint(), ELLIPSE< NumericType >::Rotation, BEZIER< NumericType >::Start, and ELLIPSE< NumericType >::StartAngle.

Referenced by DXF_IMPORT_PLUGIN::addEllipse(), SCH_IO_ALTIUM::ParseEllipse(), and SCH_IO_ALTIUM::ParseEllipticalArc().