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

Go to the source code of this file.

Typedefs

using OVAL_KEY_POINT_FLAGS = unsigned int
 

Enumerations

enum  OVAL_KEY_POINTS {
  OVAL_CENTER = 1 << 0 , OVAL_CAP_TIPS = 1 << 1 , OVAL_CAP_CENTERS = 1 << 2 , OVAL_SIDE_MIDPOINTS = 1 << 3 ,
  OVAL_SIDE_ENDS = 1 << 4 , OVAL_CARDINAL_EXTREMES = 1 << 5 , OVAL_ALL_KEY_POINTS = 0xFF
}
 

Functions

std::vector< VECTOR2IGetOvalKeyPoints (const VECTOR2I &aOvalSize, const EDA_ANGLE &aRotation, OVAL_KEY_POINT_FLAGS aFlags)
 Get a list of interesting points on an oval (rectangle with semicircular end caps)
 

Typedef Documentation

◆ OVAL_KEY_POINT_FLAGS

using OVAL_KEY_POINT_FLAGS = unsigned int

Definition at line 43 of file oval.h.

Enumeration Type Documentation

◆ OVAL_KEY_POINTS

Enumerator
OVAL_CENTER 
OVAL_CAP_TIPS 
OVAL_CAP_CENTERS 
OVAL_SIDE_MIDPOINTS 
OVAL_SIDE_ENDS 
OVAL_CARDINAL_EXTREMES 
OVAL_ALL_KEY_POINTS 

Definition at line 32 of file oval.h.

Function Documentation

◆ GetOvalKeyPoints()

std::vector< VECTOR2I > GetOvalKeyPoints ( const VECTOR2I aOvalSize,
const EDA_ANGLE aRotation,
OVAL_KEY_POINT_FLAGS  aFlags 
)

Get a list of interesting points on an oval (rectangle with semicircular end caps)

This may includes:

  • The middles of the sides
  • The tips of the end caps
  • The extreme cardinal points of the whole oval (if rotated non-cardinally)
Parameters
aOvalSize- The size of the oval (overall length and width)
aRotation- The rotation of the oval
aFlags- The flags indicating which points to return
Returns
std::vector<VECTOR2I> - The list of points

Definition at line 31 of file oval.cpp.

References ANGLE_0, ANGLE_90, EDA_ANGLE::IsCardinal(), EDA_ANGLE::Normalize90(), OVAL_CAP_CENTERS, OVAL_CAP_TIPS, OVAL_CARDINAL_EXTREMES, OVAL_CENTER, OVAL_SIDE_ENDS, OVAL_SIDE_MIDPOINTS, RotatePoint(), VECTOR2< T >::x, and VECTOR2< T >::y.

Referenced by PCB_GRID_HELPER::computeAnchors(), and DoOvalPointTestChecks().