KiCad PCB EDA Suite
|
Bezier curves to polygon converter. More...
#include <bezier_curves.h>
Public Member Functions | |
BEZIER_POLY (const VECTOR2I &aStart, const VECTOR2I &aCtrl1, const VECTOR2I &aCtrl2, const VECTOR2I &aEnd) | |
BEZIER_POLY (const std::vector< VECTOR2I > &aControlPoints) | |
BEZIER_POLY (const std::vector< VECTOR2D > &aControlPoints) | |
void | GetPoly (std::vector< VECTOR2I > &aOutput, int aMinSegLen=0, int aMaxSegCount=32) |
Convert a Bezier curve to a polygon. More... | |
void | GetPoly (std::vector< VECTOR2D > &aOutput, double aMinSegLen=0.0, int aMaxSegCount=32) |
Private Attributes | |
double | m_minSegLen |
Control points. More... | |
std::vector< VECTOR2D > | m_ctrlPts |
Bezier curves to polygon converter.
Only quadratic and cubic Bezier curves are handled
Definition at line 37 of file bezier_curves.h.
BEZIER_POLY::BEZIER_POLY | ( | const VECTOR2I & | aStart, |
const VECTOR2I & | aCtrl1, | ||
const VECTOR2I & | aCtrl2, | ||
const VECTOR2I & | aEnd | ||
) |
Definition at line 35 of file bezier_curves.cpp.
References m_ctrlPts, and m_minSegLen.
BEZIER_POLY::BEZIER_POLY | ( | const std::vector< VECTOR2I > & | aControlPoints | ) |
Definition at line 47 of file bezier_curves.cpp.
References m_ctrlPts, and m_minSegLen.
|
inline |
Definition at line 45 of file bezier_curves.h.
References m_minSegLen.
void BEZIER_POLY::GetPoly | ( | std::vector< VECTOR2D > & | aOutput, |
double | aMinSegLen = 0.0 , |
||
int | aMaxSegCount = 32 |
||
) |
Definition at line 71 of file bezier_curves.cpp.
void BEZIER_POLY::GetPoly | ( | std::vector< VECTOR2I > & | aOutput, |
int | aMinSegLen = 0 , |
||
int | aMaxSegCount = 32 |
||
) |
Convert a Bezier curve to a polygon.
aOutput | will be used as an output vector storing polygon points. |
aMinSegLen | is the min dist between 2 successive points. It can be used to reduce the number of points. (the last point is always generated) aMaxSegCount is the max number of segments created |
Definition at line 58 of file bezier_curves.cpp.
References GetPoly().
Referenced by IPC2581_PLUGIN::addShape(), KIFONT::OUTLINE_DECOMPOSER::approximateCubicBezierCurve(), PLOTTER::BezierCurve(), EDA_SHAPE::buildBezierToSegmentsPointsList(), TEARDROP_MANAGER::computeCurvedForRectShape(), TEARDROP_MANAGER::computeCurvedForRoundShape(), KIGFX::PCB_PAINTER::draw(), KIGFX::OPENGL_GAL::DrawCurve(), EDA_SHAPE::flip(), GetPoly(), SCH_ALTIUM_PLUGIN::ParseBezier(), PCB_EASYEDAPRO_PARSER::ParseContour(), EASYEDA_PARSER_BASE::ParseLineChains(), and EDA_SHAPE::TransformShapeToPolygon().
|
private |
Definition at line 67 of file bezier_curves.h.
Referenced by BEZIER_POLY(), and GetPoly().
|
private |