KiCad PCB EDA Suite
Loading...
Searching...
No Matches
KI_ARC_EDIT Namespace Reference

Functions

void EditArcEndpointKeepCenter (EDA_SHAPE &aArc, const VECTOR2I &aCenter, const VECTOR2I &aStart, const VECTOR2I &aMid, const VECTOR2I &aEnd, const VECTOR2I &aCursor, const EDA_IU_SCALE &aIuScale)
 Move an arc endpoint around the existing center, pulling the opposite endpoint along to keep the radius.
 
void EditArcMidKeepCenter (EDA_SHAPE &aArc, const VECTOR2I &aCenter, const VECTOR2I &aStart, const VECTOR2I &aMid, const VECTOR2I &aEnd, const VECTOR2I &aCursor, const EDA_IU_SCALE &aIuScale)
 Move the mid point of an arc while keeping the center, rotating the endpoints onto the new radius.
 

Function Documentation

◆ EditArcEndpointKeepCenter()

void KI_ARC_EDIT::EditArcEndpointKeepCenter ( EDA_SHAPE & aArc,
const VECTOR2I & aCenter,
const VECTOR2I & aStart,
const VECTOR2I & aMid,
const VECTOR2I & aEnd,
const VECTOR2I & aCursor,
const EDA_IU_SCALE & aIuScale )

Move an arc endpoint around the existing center, pulling the opposite endpoint along to keep the radius.

Move an end point of the arc around the circumference.

The radius floor is 1 mil in aIuScale's units, so callers pass their own scale to avoid snapping small arcs up to the PCB minimum. Exposed for unit testing.

Definition at line 588 of file point_editor_behavior.cpp.

References VECTOR2< T >::EuclideanNorm(), EDA_SHAPE::GetEnd(), EDA_SHAPE::GetStart(), KiROUND(), EDA_UNIT_UTILS::Mils2IU(), radius, VECTOR2< T >::Resize(), EDA_SHAPE::SetCenter(), EDA_SHAPE::SetEnd(), EDA_SHAPE::SetStart(), VECTOR2< T >::x, and VECTOR2< T >::y.

Referenced by BOOST_AUTO_TEST_CASE(), and EDA_ARC_POINT_EDIT_BEHAVIOR::UpdateItem().

◆ EditArcMidKeepCenter()

void KI_ARC_EDIT::EditArcMidKeepCenter ( EDA_SHAPE & aArc,
const VECTOR2I & aCenter,
const VECTOR2I & aStart,
const VECTOR2I & aMid,
const VECTOR2I & aEnd,
const VECTOR2I & aCursor,
const EDA_IU_SCALE & aIuScale )

Move the mid point of an arc while keeping the center, rotating the endpoints onto the new radius.

Move the mid point of the arc, while keeping the two endpoints.

See EditArcEndpointKeepCenter for aIuScale.

Definition at line 687 of file point_editor_behavior.cpp.

References end, KiROUND(), EDA_UNIT_UTILS::Mils2IU(), radius, VECTOR2< T >::Resize(), EDA_SHAPE::SetEnd(), and EDA_SHAPE::SetStart().

Referenced by BOOST_AUTO_TEST_CASE(), and EDA_ARC_POINT_EDIT_BEHAVIOR::UpdateItem().