KiCad PCB EDA Suite
Loading...
Searching...
No Matches
bezier_curves.cpp File Reference
#include <bezier_curves.h>
#include <geometry/ellipse.h>
#include <trigo.h>
#include <math/vector2d.h>
#include <wx/debug.h>

Go to the source code of this file.

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.
 
template void TransformEllipseToBeziers (const ELLIPSE< double > &aEllipse, std::vector< BEZIER< double > > &aBeziers)
 
template void TransformEllipseToBeziers (const ELLIPSE< int > &aEllipse, std::vector< BEZIER< int > > &aBeziers)
 

Function Documentation

◆ TransformEllipseToBeziers() [1/3]

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

◆ TransformEllipseToBeziers() [2/3]

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

◆ TransformEllipseToBeziers() [3/3]

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 118 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().