KiCad PCB EDA Suite
Loading...
Searching...
No Matches
ELLIPSE< NumericType > Class Template Reference

This class was created to handle importing ellipses from other file formats that support them natively. More...

#include <ellipse.h>

Public Member Functions

 ELLIPSE ()=default
 
 ELLIPSE (const VECTOR2< NumericType > &aCenter, NumericType aMajorRadius, NumericType aMinorRadius, EDA_ANGLE aRotation, EDA_ANGLE aStartAngle=ANGLE_0, EDA_ANGLE aEndAngle=FULL_CIRCLE)
 Constructs an ellipse or elliptical arc. More...
 
 ELLIPSE (const VECTOR2< NumericType > &aCenter, const VECTOR2< NumericType > &aMajor, double aRatio, EDA_ANGLE aStartAngle=ANGLE_0, EDA_ANGLE aEndAngle=FULL_CIRCLE)
 Constructs a DXF-style ellipse or elliptical arc, where the major axis is given by a point rather than a radius, and therefore defines not only the major radius but also the rotation of the ellipse. More...
 

Public Attributes

VECTOR2< NumericType > Center
 
NumericType MajorRadius
 
NumericType MinorRadius
 
EDA_ANGLE Rotation
 
EDA_ANGLE StartAngle
 
EDA_ANGLE EndAngle
 

Detailed Description

template<typename NumericType>
class ELLIPSE< NumericType >

This class was created to handle importing ellipses from other file formats that support them natively.

The storage format and API may need to be refactored before this is used as part of a potential future native KiCad ellipse.

Definition at line 33 of file ellipse.h.

Constructor & Destructor Documentation

◆ ELLIPSE() [1/3]

template<typename NumericType >
ELLIPSE< NumericType >::ELLIPSE ( )
default

◆ ELLIPSE() [2/3]

template<typename NumericType >
ELLIPSE< NumericType >::ELLIPSE ( const VECTOR2< NumericType > &  aCenter,
NumericType  aMajorRadius,
NumericType  aMinorRadius,
EDA_ANGLE  aRotation,
EDA_ANGLE  aStartAngle = ANGLE_0,
EDA_ANGLE  aEndAngle = FULL_CIRCLE 
)

Constructs an ellipse or elliptical arc.

The ellipse sweeps from aStartAngle to aEndAngle in a counter-clockwise direction.

Parameters
aCenteris the center point of the ellipse.
aMajorRadiusis the radius of the "x-axis" dimension of the ellipse.
aMinorRadiusis the radius of the "y-axis" dimension of the ellipse.
aRotationis the angle of the ellipse "x-axis" relative to world x-axis.
aStartAngleis the starting angle of the elliptical arc.
aEndAngleis the ending angle of the elliptical arc.

Definition at line 24 of file ellipse.cpp.

◆ ELLIPSE() [3/3]

template<typename NumericType >
ELLIPSE< NumericType >::ELLIPSE ( const VECTOR2< NumericType > &  aCenter,
const VECTOR2< NumericType > &  aMajor,
double  aRatio,
EDA_ANGLE  aStartAngle = ANGLE_0,
EDA_ANGLE  aEndAngle = FULL_CIRCLE 
)

Constructs a DXF-style ellipse or elliptical arc, where the major axis is given by a point rather than a radius, and therefore defines not only the major radius but also the rotation of the ellipse.

Parameters
aCenteris the center point of the ellipse.
aMajoris the endpoint of the major axis, relative to the center.
aRatiois the ratio of the minor axis length to the major axis length.
aStartAngleis the starting angle of the elliptical arc.
aEndAngleis the ending angle of the elliptical arc.

Definition at line 38 of file ellipse.cpp.

References VECTOR2< T >::EuclideanNorm(), ELLIPSE< NumericType >::MajorRadius, ELLIPSE< NumericType >::MinorRadius, RADIANS_T, ELLIPSE< NumericType >::Rotation, VECTOR2< T >::x, and VECTOR2< T >::y.

Member Data Documentation

◆ Center

template<typename NumericType >
VECTOR2<NumericType> ELLIPSE< NumericType >::Center

Definition at line 67 of file ellipse.h.

Referenced by TransformEllipseToBeziers().

◆ EndAngle

template<typename NumericType >
EDA_ANGLE ELLIPSE< NumericType >::EndAngle

Definition at line 72 of file ellipse.h.

Referenced by TransformEllipseToBeziers().

◆ MajorRadius

template<typename NumericType >
NumericType ELLIPSE< NumericType >::MajorRadius

Definition at line 68 of file ellipse.h.

Referenced by ELLIPSE< NumericType >::ELLIPSE(), and TransformEllipseToBeziers().

◆ MinorRadius

template<typename NumericType >
NumericType ELLIPSE< NumericType >::MinorRadius

Definition at line 69 of file ellipse.h.

Referenced by ELLIPSE< NumericType >::ELLIPSE(), and TransformEllipseToBeziers().

◆ Rotation

template<typename NumericType >
EDA_ANGLE ELLIPSE< NumericType >::Rotation

Definition at line 70 of file ellipse.h.

Referenced by ELLIPSE< NumericType >::ELLIPSE(), and TransformEllipseToBeziers().

◆ StartAngle

template<typename NumericType >
EDA_ANGLE ELLIPSE< NumericType >::StartAngle

Definition at line 71 of file ellipse.h.

Referenced by TransformEllipseToBeziers().


The documentation for this class was generated from the following files: