50 std::vector<PCB_TRACK*>* buffer;
54 buffer =
new std::vector<PCB_TRACK*>;
59 buffer = (*item).second;
62 buffer->push_back( aTrack );
71 return via->GetWidth( aLayer );
76 return std::min(
pad->GetSize( aLayer ).x,
pad->GetSize( aLayer ).y );
96 &&
pad->GetSize( aLayer ).x
97 ==
pad->GetSize( aLayer ).y );
126 if( zone->IsTeardropArea() )
130 if( !zone->IsOnLayer( layer ) )
133 if( zone->GetNetCode() != aTrack->
GetNetCode() )
137 if( !zone->HasFilledPolysForLayer( layer ) )
140 std::shared_ptr<SHAPE_POLY_SET> fill = zone->GetFilledPolysList( layer );
142 if( !fill || fill->IsEmpty() )
150 if( !fill->Contains( padPos ) )
154 if( !fill->Contains( aTrack->
GetStart() ) && !fill->Contains( aTrack->
GetEnd() ) )
160 PAD*
pad =
static_cast<PAD*
>( aPadOrVia );
181 bool startInside = aOther->
HitTest( start, 0 );
184 if( startInside && endInside )
189 if( !startInside && !endInside )
194 std::swap( start,
end );
196 int maxError =
m_board->GetDesignSettings().m_MaxError;
200 if(
IsRound( aOther, aLayer ) )
207 wxCHECK_MSG( aOther->
Type() ==
PCB_PAD_T, 0, wxT(
"Expected non-round item to be PAD" ) );
208 static_cast<PAD*
>( aOther )->TransformShapeToPolygon( shapebuffer, aLayer, 0, maxError,
223 pt_count = outline.
Intersect( poly, pts );
233 double minDist = std::numeric_limits<double>::max();
237 double d = ( hit.p - start ).EuclideanNorm();
257 return trackItem != aTrackRef;
262 PCB_TRACK* curr_track = static_cast<PCB_TRACK*>( trackItem );
265 if( EDA_ITEM_FLAGS match = curr_track->IsPointOnEnds( aEndPoint, m_tolerance ) )
272 double previous_len = candidate->GetLength();
273 double curr_len = curr_track->GetLength();
275 if( previous_len >= curr_len )
280 candidate = curr_track;
311 std::vector<VECTOR2I>& aPoly,
313 int aTrackHalfWidth,
const VECTOR2D& aTrackDir,
315 std::vector<VECTOR2I>& pts )
const
317 int maxError =
m_board->GetDesignSettings().m_MaxError;
337 double minVpercent = double( aTrackHalfWidth ) /
radius;
338 double weaken = (Vpercent - minVpercent) / ( 1 - minVpercent ) /
radius;
350 vecC = pts[2] - aOtherPos;
360 vecE = pts[4] - aOtherPos;
363 double biasBC = 0.5 *
SEG( pts[1], pts[2] ).
Length();
364 double biasAE = 0.5 *
SEG( pts[4], pts[0] ).
Length();
367 pts[2].y + vecC.
x * biasBC * weaken );
369 pts[4].y - vecE.
x * biasAE * weaken );
371 VECTOR2I tangentB =
VECTOR2I( pts[1].x - aTrackDir.
x * biasBC, pts[1].y - aTrackDir.
y * biasBC );
372 VECTOR2I tangentA =
VECTOR2I( pts[0].x - aTrackDir.
x * biasAE, pts[0].y - aTrackDir.
y * biasAE );
374 std::vector<VECTOR2I> curve_pts;
378 aPoly.push_back( corner );
380 aPoly.push_back( pts[3] );
386 aPoly.push_back( corner );
406 VECTOR2I radial = aAnchor - aCornerCenter;
418 int64_t dot1 =
static_cast<int64_t
>( tangent1.
x ) * aDesiredDir.
x
419 +
static_cast<int64_t
>( tangent1.
y ) * aDesiredDir.
y;
420 int64_t dot2 =
static_cast<int64_t
>( tangent2.
x ) * aDesiredDir.
x
421 +
static_cast<int64_t
>( tangent2.
y ) * aDesiredDir.
y;
423 VECTOR2I tangent = ( dot1 > dot2 ) ? tangent1 : tangent2;
445 VECTOR2I localPt = aPoint - aPadPos;
448 int halfW = aPadSize.
x / 2;
449 int halfH = aPadSize.
y / 2;
453 int radius = std::min( halfW, halfH );
454 bool isHorizontal = halfW > halfH;
459 int centerOffset = halfW -
radius;
462 if(
std::abs( localPt.
x ) <= centerOffset )
466 int centerX = ( localPt.
x > 0 ) ? centerOffset : -centerOffset;
467 aArcCenter =
VECTOR2I( centerX, 0 );
472 int centerOffset = halfH -
radius;
475 if(
std::abs( localPt.
y ) <= centerOffset )
479 int centerY = ( localPt.
y > 0 ) ? centerOffset : -centerOffset;
480 aArcCenter =
VECTOR2I( 0, centerY );
485 aArcCenter += aPadPos;
504 const VECTOR2I& aPadSize,
int aCornerRadius,
508 VECTOR2I localPt = aPoint - aPadPos;
512 int halfW = aPadSize.
x / 2;
513 int halfH = aPadSize.
y / 2;
514 int innerHalfW = halfW - aCornerRadius;
515 int innerHalfH = halfH - aCornerRadius;
518 bool inCornerX =
std::abs( localPt.
x ) > innerHalfW;
519 bool inCornerY =
std::abs( localPt.
y ) > innerHalfH;
521 if( !inCornerX || !inCornerY )
525 int cornerX = ( localPt.
x > 0 ) ? innerHalfW : -innerHalfW;
526 int cornerY = ( localPt.
y > 0 ) ? innerHalfH : -innerHalfH;
528 aCornerCenter =
VECTOR2I( cornerX, cornerY );
532 aCornerCenter += aPadPos;
544 std::vector<VECTOR2I>& aPoly,
int aTdWidth,
546 std::vector<VECTOR2I>& aPts,
552 int maxError =
m_board->GetDesignSettings().m_MaxError;
560 VECTOR2I side1( aPts[2] - aPts[1] );
562 VECTOR2I side2( aPts[4] - aPts[0] );
564 VECTOR2I trackDir( aIntersection - ( aPts[0] + aPts[1] ) / 2 );
567 bool isRoundRect =
false;
569 int cornerRadius = 0;
581 cornerRadius =
pad->GetRoundRectCornerRadius( aLayer );
582 padSize =
pad->GetSize( aLayer );
583 padRotation =
pad->GetOrientation();
588 padSize =
pad->GetSize( aLayer );
589 padRotation =
pad->GetOrientation();
593 std::vector<VECTOR2I> curve_pts;
603 ctrl2 = ( aPts[2] + aIntersection ) / 2;
605 if( isRoundRect && cornerRadius > 0 )
610 padRotation, cornerCenter ) )
621 if(
isPointOnOvalEnd( aPts[2], aOtherPos, padSize, padRotation, arcCenter ) )
632 aPoly.push_back( corner );
634 aPoly.push_back( aPts[3] );
640 ctrl1 = ( aPts[4] + aIntersection ) / 2;
642 if( isRoundRect && cornerRadius > 0 )
647 padRotation, cornerCenter ) )
658 if(
isPointOnOvalEnd( aPts[4], aOtherPos, padSize, padRotation, arcCenter ) )
671 aPoly.push_back( corner );
677 std::vector<VECTOR2I>& aPts )
const
679 int maxError =
m_board->GetDesignSettings().m_MaxError;
710 wxCHECK_MSG( aItem->
Type() ==
PCB_PAD_T,
false, wxT(
"Expected non-round item to be PAD" ) );
716 pad->TransformShapeToPolygon( c_buffer, aLayer, 0, maxError,
ERROR_INSIDE );
723 int halfsize = std::min( aParams.
m_TdMaxWidth, preferred_width )/2;
728 VECTOR2I ref_on_track = ( aPts[0] + aPts[1] ) / 2;
729 VECTOR2I teardrop_axis( aPts[3] - ref_on_track );
741 clipping_rect.
Append( 0, - halfsize );
742 clipping_rect.
Append( 0, halfsize );
743 clipping_rect.
Append( len, halfsize );
744 clipping_rect.
Append( len, - halfsize );
746 clipping_rect.
Rotate( -orient );
747 clipping_rect.
Move( ref_on_track );
763 std::vector<VECTOR2I> points = padpoly.
CPoints();
765 std::vector<VECTOR2I> initialPoints;
766 initialPoints.push_back( aPts[0] );
767 initialPoints.push_back( aPts[1] );
770 initialPoints.emplace_back( pt.x, pt.y );
772 std::vector<VECTOR2I> hull;
779 int found_start = -1;
785 for(
unsigned ii = 0, jj = 0; jj < hull.size(); ii++, jj++ )
787 unsigned next = ii+ 1;
789 if(
next >= hull.size() )
795 prev = hull.size()-1;
797 if( hull[ii] == start )
800 if( hull[
next] != pend )
808 if( hull[ii] == pend )
810 if( hull[
next] != start )
819 if( found_start < 0 )
821 int ii = found_end-1;
831 int ii = found_start-1;
848 double area1 = dummy1.
Area();
850 std::swap( aPts[2], aPts[4] );
852 double area2 = dummy2.
Area();
855 std::swap( aPts[2], aPts[4] );
865 int* aEffectiveTeardropLen )
const
872 int maxError =
m_board->GetDesignSettings().m_MaxError;
878 targetLength = std::min( aParams.
m_TdMaxLen, targetLength );
882 bool need_swap =
false;
886 if( !aOther->
HitTest( start, 0 ) )
888 std::swap( start,
end );
900 wxCHECK_MSG( aOther->
Type() ==
PCB_PAD_T,
false, wxT(
"Expected non-round item to be PAD" ) );
901 static_cast<PAD*
>( aOther )->TransformShapeToPolygon( shapebuffer, aTrack->
GetLayer(), 0,
921 pt_count = outline.
Intersect( poly, pts );
933 aIntersection = pts[0].p;
934 start = aIntersection;
938 actualTdLen = std::min( targetLength,
SEG( start,
end ).Length() );
947 while( actualTdLen + consumed < targetLength )
953 if( connected_track ==
nullptr )
960 constexpr double kMinCosForTwoSegmentExtension = 0.5;
973 - connected_track->
GetEnd() );
976 double cosAngle = firstDir.
x * secondDir.
x + firstDir.
y * secondDir.
y;
978 if( cosAngle < kMinCosForTwoSegmentExtension )
981 consumed += actualTdLen;
983 actualTdLen = std::min( targetLength-consumed,
int( connected_track->
GetLength() ) );
984 aTrack = connected_track;
986 start = connected_track->
GetStart();
991 std::swap( start,
end );
1025 for(
int ii = poly.
PointCount()-1; ii >= 0 ; ii-- )
1027 int dist_from_start = ( poly.
CPoint( ii ) - start ).EuclideanNorm();
1031 if( dist_from_start < actualTdLen || ii == 0 )
1033 start = poly.
CPoint( ii );
1042 actualTdLen -= (start - ref_lenght_point).EuclideanNorm();
1045 if( actualTdLen < 0 )
1048 actualTdLen = std::min( actualTdLen, (
end - start).EuclideanNorm() );
1060 aStartPoint = start;
1063 *aEffectiveTeardropLen = actualTdLen;
1069 std::vector<VECTOR2I>& aCorners,
PCB_TRACK* aTrack,
1102 bool twoSegments = ( aTrack != originalTrack );
1110 if( twoSegments && start != intersection )
1114 int track_halfwidth = aTrack->
GetWidth() / 2;
1115 VECTOR2I pointB = start +
VECTOR2I( vecT.
x * track_stub_len + vecT.
y * track_halfwidth,
1116 vecT.
y * track_stub_len - vecT.
x * track_halfwidth );
1117 VECTOR2I pointA = start +
VECTOR2I( vecT.
x * track_stub_len - vecT.
y * track_halfwidth,
1118 vecT.
y * track_stub_len + vecT.
x * track_halfwidth );
1124 if( !
IsRound( aOther, layer ) )
1128 if(
pad->HitTest( pointA, 0, layer ) )
1131 if(
pad->HitTest( pointB, 0, layer ) )
1139 int padRadius =
GetWidth( aOther, layer ) / 2;
1141 double projOnTrack = -( intToPad.
x * vecVia.
x + intToPad.
y * vecVia.
y );
1142 double effectiveDist = std::max( projOnTrack,
static_cast<double>( padRadius ) );
1153 KiROUND( -vecVia.
y * ( effectiveDist + offset ) ) );
1155 if( !
pad->HitTest( candidateD, 0, layer ) )
1157 int maxError =
m_board->GetDesignSettings().m_MaxError;
1159 pad->TransformShapeToPolygon( padPoly, layer, 0, maxError,
ERROR_INSIDE );
1170 padOutline.
Intersect(
SEG( rayStart, candidateD ), hits );
1174 double maxExitDist = 0;
1178 double d = ( hit.p - intersection ).EuclideanNorm();
1180 if( d > maxExitDist )
1184 effectiveDist = std::max( 0.0, maxExitDist - 2.0 * offset );
1197 double R =
static_cast<double>( padRadius );
1198 double cx = intToPad.
x;
1199 double cy = intToPad.
y;
1200 double distCenterSq = cx * cx + cy * cy;
1205 double disc = projOnTrack * projOnTrack - ( distCenterSq - R * R );
1209 double farEdge = projOnTrack + std::sqrt( disc );
1210 double maxAllowed = std::max( 0.0, farEdge - 2.0 * offset );
1212 if( effectiveDist > maxAllowed )
1213 effectiveDist = maxAllowed;
1218 KiROUND( -vecVia.
y * ( effectiveDist + offset ) ) );
1225 VECTOR2I junctionB_seg2, junctionB_seg1, junctionA_seg2, junctionA_seg1;
1230 KiROUND( -vecT.
x * track_halfwidth ) );
1232 KiROUND( vecT.
x * track_halfwidth ) );
1234 KiROUND( -vecVia.
x * track_halfwidth ) );
1236 KiROUND( vecVia.
x * track_halfwidth ) );
1242 bool skipJunctionA =
false;
1243 bool skipJunctionB =
false;
1249 skipJunctionA = ( transA.
x * anchorDirA.
x + transA.
y * anchorDirA.
y ) < 0;
1253 skipJunctionB = ( transB.
x * anchorDirB.
x + transB.
y * anchorDirB.
y ) < 0;
1256 VECTOR2I anchorA = twoSegments ? junctionA_seg1 : pointA;
1257 VECTOR2I anchorB = twoSegments ? junctionB_seg1 : pointB;
1259 std::vector<VECTOR2I> pts = { anchorA, anchorB, pointC, pointD, pointE };
1266 if(
IsRound( aOther, layer ) )
1272 double perpDistToCenter = padOffset.
x * perpVia.
x + padOffset.
y * perpVia.
y;
1275 if(
std::abs( perpDistToCenter ) > padRadius * 0.1 )
1277 double d =
std::abs( perpDistToCenter );
1283 double maxSymmetric =
static_cast<double>( padRadius ) - d;
1287 int maxHalfWidth = preferred_width / 2;
1290 maxHalfWidth = std::min( maxHalfWidth, aParams.
m_TdMaxWidth / 2 );
1292 double symHalfWidth = std::min( maxSymmetric,
1293 static_cast<double>( maxHalfWidth ) );
1295 if( symHalfWidth > track_halfwidth )
1298 double R =
static_cast<double>( padRadius );
1304 auto findCircleLineIntersection =
1307 double projAlongTrack = padOffset.
x * vecVia.
x
1308 + padOffset.
y * vecVia.
y;
1310 + vecVia * projAlongTrack
1311 + perpVia * perpDist;
1314 double b_coeff = oc.
x * vecVia.
x + oc.
y * vecVia.
y;
1315 double c_coeff = oc.
x * oc.
x + oc.
y * oc.
y - R * R;
1316 double disc = b_coeff * b_coeff - c_coeff;
1322 double sqrtDisc = std::sqrt( disc );
1323 double t1 = -b_coeff - sqrtDisc;
1324 double t2 = -b_coeff + sqrtDisc;
1327 VECTOR2D p1 = lineOrigin + vecVia * t1;
1328 VECTOR2D p2 = lineOrigin + vecVia * t2;
1331 if( ( p1 - intPt ).EuclideanNorm()
1332 < ( p2 - intPt ).EuclideanNorm() )
1347 pts[2] = findCircleLineIntersection( -symHalfWidth );
1348 pts[4] = findCircleLineIntersection( symHalfWidth );
1358 aCorners.push_back( pointA );
1359 aCorners.push_back( pointB );
1361 if( !skipJunctionB )
1362 aCorners.push_back( junctionB_seg2 );
1364 aCorners.push_back( pts[1] );
1365 aCorners.push_back( pts[2] );
1366 aCorners.push_back( pts[3] );
1367 aCorners.push_back( pts[4] );
1368 aCorners.push_back( pts[0] );
1370 if( !skipJunctionA )
1371 aCorners.push_back( junctionA_seg2 );
1375 aCorners = std::move( pts );
1382 if(
IsRound( aOther, layer ) )
1386 std::vector<VECTOR2I> curvePoly;
1388 vecVia, aOther, aOtherPos, pts );
1390 aCorners.push_back( pointB );
1392 if( !skipJunctionB )
1393 aCorners.push_back( junctionB_seg2 );
1395 for(
const VECTOR2I& pt : curvePoly )
1396 aCorners.push_back( pt );
1398 if( !skipJunctionA )
1399 aCorners.push_back( junctionA_seg2 );
1401 aCorners.push_back( pointA );
1406 vecT, aOther, aOtherPos, pts );
1418 std::vector<VECTOR2I> curvePoly;
1420 intersection, aOther, aOtherPos, layer );
1422 aCorners.push_back( pointB );
1424 if( !skipJunctionB )
1425 aCorners.push_back( junctionB_seg2 );
1427 for(
const VECTOR2I& pt : curvePoly )
1428 aCorners.push_back( pt );
1430 if( !skipJunctionA )
1431 aCorners.push_back( junctionA_seg2 );
1433 aCorners.push_back( pointA );
1438 intersection, aOther, aOtherPos, layer );
constexpr EDA_IU_SCALE pcbIUScale
constexpr BOX2I KiROUND(const BOX2D &aBoxD)
Bezier curves to polygon converter.
void GetPoly(std::vector< VECTOR2I > &aOutput, int aMaxError=10)
Convert a Bezier curve to a polygon.
PCB_LAYER_ID GetLayer() const override
Return the primary layer this item is on.
A base class for any item which can be embedded within the BOARD container class, and therefore insta...
virtual VECTOR2I GetPosition() const
KICAD_T Type() const
Returns the type of object.
virtual bool HitTest(const VECTOR2I &aPosition, int aAccuracy=0) const
Test if aPosition is inside or on the boundary of this item.
const VECTOR2I & GetMid() const
virtual double GetLength() const
Get the length of the track using the hypotenuse calculation.
const VECTOR2I & GetStart() const
const VECTOR2I & GetEnd() const
virtual int GetWidth() const
int Length() const
Return the length (this).
const SHAPE_LINE_CHAIN ConvertToPolyline(int aMaxError=DefaultAccuracyForPCB(), int *aActualError=nullptr) const
Construct a SHAPE_LINE_CHAIN of segments from a given arc.
Represent a polyline containing arcs as well as line segments: A chain of connected line and/or arc s...
void SetClosed(bool aClosed)
Mark the line chain as closed (i.e.
int Intersect(const SEG &aSeg, INTERSECTIONS &aIp) const
Find all intersection points between our line chain and the segment aSeg.
int PointCount() const
Return the number of points (vertices) in this line chain.
double Area(bool aAbsolute=true) const
Return the area of this chain.
const VECTOR2I & CPoint(int aIndex) const
Return a reference to a given point in the line chain.
std::vector< INTERSECTION > INTERSECTIONS
const std::vector< VECTOR2I > & CPoints() const
Represent a set of closed polygons.
void Rotate(const EDA_ANGLE &aAngle, const VECTOR2I &aCenter={ 0, 0 }) override
Rotate all vertices by a given angle.
int Append(int x, int y, int aOutline=-1, int aHole=-1, bool aAllowDuplication=false)
Appends a vertex at the end of the given outline/hole (default: the last outline)
SHAPE_LINE_CHAIN & Outline(int aIndex)
Return the reference to aIndex-th outline in the set.
int NewOutline()
Creates a new empty polygon in the set and returns its index.
void BooleanIntersection(const SHAPE_POLY_SET &b)
Perform boolean polyset intersection.
int OutlineCount() const
Return the number of outlines in the set.
void Move(const VECTOR2I &aVector) override
static bool IsRound(BOARD_ITEM *aItem, PCB_LAYER_ID aLayer)
bool computeAnchorPoints(const TEARDROP_PARAMETERS &aParams, PCB_LAYER_ID aLayer, BOARD_ITEM *aItem, const VECTOR2I &aPos, std::vector< VECTOR2I > &aPts) const
Compute the 2 points on pad/via of the teardrop shape.
static int GetWidth(BOARD_ITEM *aItem, PCB_LAYER_ID aLayer)
bool computeTeardropPolygon(const TEARDROP_PARAMETERS &aParams, std::vector< VECTOR2I > &aCorners, PCB_TRACK *aTrack, BOARD_ITEM *aOther, const VECTOR2I &aOtherPos) const
Compute all teardrop points of the polygon shape.
void computeCurvedForRectShape(const TEARDROP_PARAMETERS &aParams, std::vector< VECTOR2I > &aPoly, int aTdWidth, int aTrackHalfWidth, std::vector< VECTOR2I > &aPts, const VECTOR2I &aIntersection, BOARD_ITEM *aOther, const VECTOR2I &aOtherPos, PCB_LAYER_ID aLayer) const
Compute the curve part points for teardrops connected to a rectangular/polygonal shape The Bezier cur...
void computeCurvedForRoundShape(const TEARDROP_PARAMETERS &aParams, std::vector< VECTOR2I > &aPoly, PCB_LAYER_ID aLayer, int aTrackHalfWidth, const VECTOR2D &aTrackDir, BOARD_ITEM *aOther, const VECTOR2I &aOtherPos, std::vector< VECTOR2I > &aPts) const
Compute the curve part points for teardrops connected to a round shape The Bezier curve control point...
PCB_TRACK * findTouchingTrack(EDA_ITEM_FLAGS &aMatchType, PCB_TRACK *aTrackRef, const VECTOR2I &aEndPoint) const
Find a track connected to the end of another track.
TRACK_BUFFER m_trackLookupList
bool areItemsInSameZone(BOARD_ITEM *aPadOrVia, PCB_TRACK *aTrack) const
friend class TEARDROP_PARAMETERS
bool findAnchorPointsOnTrack(const TEARDROP_PARAMETERS &aParams, VECTOR2I &aStartPoint, VECTOR2I &aEndPoint, VECTOR2I &aIntersection, PCB_TRACK *&aTrack, BOARD_ITEM *aOther, const VECTOR2I &aOtherPos, int *aEffectiveTeardropLen) const
int computeEmergingTrackLength(PCB_TRACK *aTrack, BOARD_ITEM *aOther, PCB_LAYER_ID aLayer) const
Return the length of the portion of aTrack that lies outside aOther's copper shape on aLayer.
double m_BestWidthRatio
The height of a teardrop as ratio between height and size of pad/via.
int m_TdMaxLen
max allowed length for teardrops in IU. <= 0 to disable
bool m_AllowUseTwoTracks
True to create teardrops using 2 track segments if the first in too small.
int m_TdMaxWidth
max allowed height for teardrops in IU. <= 0 to disable
double m_BestLengthRatio
The length of a teardrop as ratio between length and size of pad/via.
bool m_CurvedEdges
True if the teardrop should be curved.
int idxFromLayNet(int aLayer, int aNetcode) const
void AddTrack(PCB_TRACK *aTrack, int aLayer, int aNetcode)
Add a track in buffer, in space grouping tracks having the same netcode and the same layer.
std::map< int, std::vector< PCB_TRACK * > * > m_map_tracks
T EuclideanNorm() const
Compute the Euclidean norm of the vector, which is defined as sqrt(x ** 2 + y ** 2).
VECTOR2< T > Resize(T aNewLength) const
Return a vector of the same direction, but length specified in aNewLength.
Handle a list of polygons defining a copper zone.
void TransformCircleToPolygon(SHAPE_LINE_CHAIN &aBuffer, const VECTOR2I &aCenter, int aRadius, int aError, ERROR_LOC aErrorLoc, int aMinSegCount=0)
Convert a circle to a polygon, using multiple straight lines.
void BuildConvexHull(std::vector< VECTOR2I > &aResult, const std::vector< VECTOR2I > &aPoly)
Calculate the convex hull of a list of points in counter-clockwise order.
std::uint32_t EDA_ITEM_FLAGS
#define STARTPOINT
When a line is selected, these flags indicate which.
PCB_LAYER_ID
A quick note on layer IDs:
EDA_ANGLE abs(const EDA_ANGLE &aAngle)
PAD_SHAPE
The set of pad shapes, used with PAD::{Set,Get}Shape()
Represent an intersection between two line segments.
static bool isPointOnRoundedCorner(const VECTOR2I &aPoint, const VECTOR2I &aPadPos, const VECTOR2I &aPadSize, int aCornerRadius, const EDA_ANGLE &aRotation, VECTOR2I &aCornerCenter)
Check if a point is within a rounded corner region of a rounded rectangle pad.
static bool isPointOnOvalEnd(const VECTOR2I &aPoint, const VECTOR2I &aPadPos, const VECTOR2I &aPadSize, const EDA_ANGLE &aRotation, VECTOR2I &aArcCenter)
Check if a point is on the curved (semicircular) end of an oval pad.
static VECTOR2D NormalizeVector(const VECTOR2I &aVector)
static VECTOR2I computeCornerTangentControlPoint(const VECTOR2I &aAnchor, const VECTOR2I &aCornerCenter, double aBias, const VECTOR2I &aDesiredDir)
Helper to compute a control point for a teardrop anchor on a rounded rectangle corner.
void RotatePoint(int *pX, int *pY, const EDA_ANGLE &aAngle)
Calculate the new point of coord coord pX, pY, for a rotation center 0, 0.
@ PCB_VIA_T
class PCB_VIA, a via (like a track segment on a copper layer)
@ PCB_PAD_T
class PAD, a pad in a footprint
@ PCB_ARC_T
class PCB_ARC, an arc track segment on a copper layer
@ PCB_TRACE_T
class PCB_TRACK, a track segment (segment on a copper layer)
VECTOR2< int32_t > VECTOR2I
VECTOR2< double > VECTOR2D
@ NONE
Pads are not covered.