KiCad PCB EDA Suite
Loading...
Searching...
No Matches
oval.cpp File Reference
#include "geometry/oval.h"
#include <trigo.h>

Go to the source code of this file.

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)
 

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