KiCad PCB EDA Suite
Loading...
Searching...
No Matches
corner_operations.cpp File Reference

Go to the source code of this file.

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 
)

Compute the chamfer points for a given line pair and chamfer parameters.

Definition at line 69 of file corner_operations.cpp.

References SEG::B, chamfer, KIGEOM::GetOtherEnd(), KIGEOM::GetSharedEndpoint(), SEG::Length(), CHAMFER_PARAMS::m_chamfer_setback_a, and CHAMFER_PARAMS::m_chamfer_setback_b.

Referenced by DoChamferTestChecks(), and LINE_CHAMFER_ROUTINE::ProcessLinePair().

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