29#include <geometry/shape.h>
30#include <convert_to_biu.h>
31#include <math/vector2d.h>
75 SHAPE_ARC(
const SEG& aSegmentA,
const SEG& aSegmentB,
int aRadius,
int aWidth = 0 );
96 double aAngle,
double aWidth = 0 );
108 const VECTOR2I& aCenter,
bool aClockwise =
false,
111 const VECTOR2I& GetP0()
const {
return m_start; }
112 const VECTOR2I& GetP1()
const {
return m_end; }
113 const VECTOR2I& GetArcMid()
const {
return m_mid; }
116 const BOX2I BBox(
int aClearance = 0 )
const override;
118 bool Collide(
const SEG& aSeg,
int aClearance = 0,
int* aActual =
nullptr,
119 VECTOR2I* aLocation =
nullptr )
const override;
120 bool Collide(
const VECTOR2I& aP,
int aClearance = 0,
int* aActual =
nullptr,
121 VECTOR2I* aLocation =
nullptr )
const override;
124 bool Collide(
const SHAPE* aShape,
int aClearance = 0,
int* aActual =
nullptr,
125 VECTOR2I* aLocation =
nullptr )
const override
138 int IntersectLine(
const SEG& aSeg, std::vector<VECTOR2I>* aIpsBuffer )
const;
149 bool IsClockwise()
const;
151 void SetWidth(
int aWidth )
161 bool IsSolid()
const override
166 void Move(
const VECTOR2I& aVector )
override;
176 void Mirror(
bool aX =
true,
bool aY =
false,
const VECTOR2I& aVector = { 0, 0 } );
178 void Mirror(
const SEG& axis );
184 double GetRadius()
const;
188 return SEG( m_start, m_end );
238 double* aEffectiveAccuracy =
nullptr )
const;
240 bool operator==(
SHAPE_ARC const& aArc )
const
242 return ( aArc.m_start == m_start ) && ( aArc.m_end == m_end ) && ( aArc.m_mid == m_mid )
243 && ( aArc.m_width == m_width );
249 return ( ecoord{ aC.y } - aA.y ) * ( ecoord{ aB.x } - aA.x ) >
250 ( ecoord{ aB.y } - aA.y ) * ( ecoord{ aC.x } - aA.x );
255 bool sliceContainsPoint(
const VECTOR2I& p )
const;
267std::ostream& operator<<( std::ostream& aStream,
const SHAPE_ARC& aArc );
Definition shape_arc.h:36
SHAPE_ARC & ConstructFromStartEndAngle(const VECTOR2I &aStart, const VECTOR2I &aEnd, double aAngle, double aWidth=0)
Construct this arc from the given start, end and angle.
Definition shape_arc.cpp:183
double GetEndAngle() const
Definition shape_arc.cpp:414
const BOX2I BBox(int aClearance=0) const override
Compute a bounding box of the shape, with a margin of aClearance a collision.
Definition shape_arc.cpp:340
double GetLength() const
Definition shape_arc.cpp:430
SHAPE_ARC & ConstructFromStartEndCenter(const VECTOR2I &aStart, const VECTOR2I &aEnd, const VECTOR2I &aCenter, bool aClockwise=false, double aWidth=0)
Constructs this arc from the given start, end and center.
Definition shape_arc.cpp:201
int IntersectLine(const SEG &aSeg, std::vector< VECTOR2I > *aIpsBuffer) const
Find intersection points between this arc and aSeg, treating aSeg as an infinite line.
Definition shape_arc.cpp:261
bool Collide(const SEG &aSeg, int aClearance=0, int *aActual=nullptr, VECTOR2I *aLocation=nullptr) const override
Check if the boundary of shape (this) lies closer to the segment aSeg than aClearance,...
Definition shape_arc.cpp:229
const SHAPE_LINE_CHAIN ConvertToPolyline(double aAccuracy=DefaultAccuracyForPCB(), double *aEffectiveAccuracy=nullptr) const
Construct a SHAPE_LINE_CHAIN of segments from a given arc.
Definition shape_arc.cpp:458
int Intersect(const SHAPE_ARC &aArc, std::vector< VECTOR2I > *aIpsBuffer) const
Find intersection points between this arc and aArc.
Definition shape_arc.cpp:279
double GetStartAngle() const
Definition shape_arc.cpp:404
static double DefaultAccuracyForPCB()
Definition shape_arc.h:220
SHAPE * Clone() const override
Return a dynamically allocated copy of the shape.
Definition shape_arc.h:81
double GetCentralAngle() const
Definition shape_arc.cpp:439
void Rotate(double aAngle, const VECTOR2I &aCenter) override
Rotate the arc by a given angle about a point.
Definition shape_arc.cpp:530
Represent a polyline containing arcs as well as line segments: A chain of connected line and/or arc s...
Definition shape_line_chain.h:81
An abstract shape on 2D plane.
Definition shape.h:117
virtual bool Collide(const VECTOR2I &aP, int aClearance=0, int *aActual=nullptr, VECTOR2I *aLocation=nullptr) const
Check if the boundary of shape (this) lies closer to the point aP than aClearance,...
Definition shape.h:165