KiCad PCB EDA Suite
Loading...
Searching...
No Matches
corner_operations.h File Reference
#include <optional>
#include <geometry/seg.h>
#include <geometry/shape_arc.h>

Go to the source code of this file.

Classes

struct  CHAMFER_PARAMS
 Parameters that define a simple chamfer operation. More...
 
struct  CHAMFER_RESULT
 
struct  DOGBONE_RESULT
 

Functions

std::optional< CHAMFER_RESULTComputeChamferPoints (const SEG &aSegA, const SEG &aSegB, const CHAMFER_PARAMS &aChamferParams)
 Compute the chamfer points for a given line pair and chamfer parameters.
 
std::optional< DOGBONE_RESULTComputeDogbone (const SEG &aSegA, const SEG &aSegB, int aDogboneRadius, bool aAddSlots)
 Compute the dogbone geometry for a given line pair and dogbone parameters.
 

Function Documentation

◆ ComputeChamferPoints()

std::optional< CHAMFER_RESULT > ComputeChamferPoints ( const SEG aSegA,
const SEG aSegB,
const CHAMFER_PARAMS aChamferParams 
)

◆ ComputeDogbone()

std::optional< DOGBONE_RESULT > ComputeDogbone ( const SEG aSegA,
const SEG aSegB,
int  aDogboneRadius,
bool  aAddSlots 
)

Compute the dogbone geometry for a given line pair and dogbone parameters.

This turns a sharp internal corner into a "dogbone" shape, which allows it to be routed with a cutter that has a radius, and still allows a sharp external corner to fit into the space.

   _----_

---—/ | ------—+ / | | | |

Definition at line 129 of file corner_operations.cpp.

References std::abs(), SEG::Angle(), ANGLE_180, ANGLE_90, SEG::B, DEGREES_T, SHAPE_ARC::GetCentralAngle(), KIGEOM::GetOtherEnd(), SHAPE_ARC::GetP0(), SHAPE_ARC::GetP1(), GetRotated(), KIGEOM::GetSharedEndpoint(), CIRCLE::Intersect(), EDA_ANGLE::IsHorizontal(), KIGEOM::PointsAreInSameDirection(), and SHAPE_ARC::Reverse().

Referenced by DoDogboneTestChecks(), and DOGBONE_CORNER_ROUTINE::ProcessLinePair().