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

Plain ellipse / elliptical-arc data. More...

#include <ellipse.h>

Public Member Functions

 ELLIPSE ()
 
 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.
 
 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.
 
void Mirror (const VECTOR2< NumericType > &aRef, FLIP_DIRECTION aFlipDirection)
 Mirror the ellipse along a horizontal or vertical axis passing through aRef.
 

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 >

Plain ellipse / elliptical-arc data.

Used by SHAPE_ELLIPSE, by EDA_SHAPE's native ellipse storage, and by importers that need to round-trip ellipses.

Definition at line 31 of file ellipse.h.

Constructor & Destructor Documentation

◆ ELLIPSE() [1/3]

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

Definition at line 34 of file ellipse.h.

References MajorRadius, and MinorRadius.

◆ 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.

References Center, EndAngle, MajorRadius, MinorRadius, Rotation, and StartAngle.

◆ 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 Center, EndAngle, VECTOR2< T >::EuclideanNorm(), MajorRadius, MinorRadius, RADIANS_T, Rotation, StartAngle, VECTOR2< T >::x, and VECTOR2< T >::y.

Member Function Documentation

◆ Mirror()

template<typename NumericType>
void ELLIPSE< NumericType >::Mirror ( const VECTOR2< NumericType > & aRef,
FLIP_DIRECTION aFlipDirection )

Mirror the ellipse along a horizontal or vertical axis passing through aRef.

Definition at line 52 of file ellipse.cpp.

References Center, EndAngle, LEFT_RIGHT, Rotation, StartAngle, VECTOR2< T >::x, and VECTOR2< T >::y.

Member Data Documentation

◆ Center

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

◆ EndAngle

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

◆ MajorRadius

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

◆ MinorRadius

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

◆ Rotation

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

◆ StartAngle

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

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