46 std::vector<PCB_TRACK*>* buffer;
50 buffer =
new std::vector<PCB_TRACK*>;
55 buffer = (*item).second;
58 buffer->push_back( aTrack );
67 return via->GetWidth( aLayer );
72 return std::min(
pad->GetSize( aLayer ).x,
pad->GetSize( aLayer ).y );
92 &&
pad->GetSize( aLayer ).x
93 ==
pad->GetSize( aLayer ).y );
122 if( zone->IsTeardropArea() )
126 if( !zone->IsOnLayer( layer ) )
129 if( zone->GetNetCode() != aTrack->
GetNetCode() )
133 if( !zone->HasFilledPolysForLayer( layer ) )
136 std::shared_ptr<SHAPE_POLY_SET> fill = zone->GetFilledPolysList( layer );
138 if( !fill || fill->IsEmpty() )
146 if( !fill->Contains( padPos ) )
150 if( !fill->Contains( aTrack->
GetStart() ) && !fill->Contains( aTrack->
GetEnd() ) )
156 PAD*
pad =
static_cast<PAD*
>( aPadOrVia );
177 bool startInside = aOther->
HitTest( start, 0 );
180 if( startInside && endInside )
185 if( !startInside && !endInside )
190 std::swap( start,
end );
192 int maxError =
m_board->GetDesignSettings().m_MaxError;
196 if(
IsRound( aOther, aLayer ) )
203 wxCHECK_MSG( aOther->
Type() ==
PCB_PAD_T, 0, wxT(
"Expected non-round item to be PAD" ) );
204 static_cast<PAD*
>( aOther )->TransformShapeToPolygon( shapebuffer, aLayer, 0, maxError,
219 pt_count = outline.
Intersect( poly, pts );
229 double minDist = std::numeric_limits<double>::max();
233 double d = ( hit.p - start ).EuclideanNorm();
253 return trackItem != aTrackRef;
258 PCB_TRACK* curr_track = static_cast<PCB_TRACK*>( trackItem );
261 if( EDA_ITEM_FLAGS match = curr_track->IsPointOnEnds( aEndPoint, m_tolerance ) )
268 double previous_len = candidate->GetLength();
269 double curr_len = curr_track->GetLength();
271 if( previous_len >= curr_len )
276 candidate = curr_track;
307 std::vector<VECTOR2I>& aPoly,
309 int aTrackHalfWidth,
const VECTOR2D& aTrackDir,
311 std::vector<VECTOR2I>& pts )
const
313 int maxError =
m_board->GetDesignSettings().m_MaxError;
333 double minVpercent = double( aTrackHalfWidth ) /
radius;
334 double weaken = (Vpercent - minVpercent) / ( 1 - minVpercent ) /
radius;
346 vecC = pts[2] - aOtherPos;
356 vecE = pts[4] - aOtherPos;
359 double biasBC = 0.5 *
SEG( pts[1], pts[2] ).
Length();
360 double biasAE = 0.5 *
SEG( pts[4], pts[0] ).
Length();
363 pts[2].y + vecC.
x * biasBC * weaken );
365 pts[4].y - vecE.
x * biasAE * weaken );
367 VECTOR2I tangentB =
VECTOR2I( pts[1].x - aTrackDir.
x * biasBC, pts[1].y - aTrackDir.
y * biasBC );
368 VECTOR2I tangentA =
VECTOR2I( pts[0].x - aTrackDir.
x * biasAE, pts[0].y - aTrackDir.
y * biasAE );
370 std::vector<VECTOR2I> curve_pts;
374 aPoly.push_back( corner );
376 aPoly.push_back( pts[3] );
382 aPoly.push_back( corner );
402 VECTOR2I radial = aAnchor - aCornerCenter;
414 int64_t dot1 =
static_cast<int64_t
>( tangent1.
x ) * aDesiredDir.
x
415 +
static_cast<int64_t
>( tangent1.
y ) * aDesiredDir.
y;
416 int64_t dot2 =
static_cast<int64_t
>( tangent2.
x ) * aDesiredDir.
x
417 +
static_cast<int64_t
>( tangent2.
y ) * aDesiredDir.
y;
419 VECTOR2I tangent = ( dot1 > dot2 ) ? tangent1 : tangent2;
441 VECTOR2I localPt = aPoint - aPadPos;
444 int halfW = aPadSize.
x / 2;
445 int halfH = aPadSize.
y / 2;
449 int radius = std::min( halfW, halfH );
450 bool isHorizontal = halfW > halfH;
455 int centerOffset = halfW -
radius;
458 if(
std::abs( localPt.
x ) <= centerOffset )
462 int centerX = ( localPt.
x > 0 ) ? centerOffset : -centerOffset;
463 aArcCenter =
VECTOR2I( centerX, 0 );
468 int centerOffset = halfH -
radius;
471 if(
std::abs( localPt.
y ) <= centerOffset )
475 int centerY = ( localPt.
y > 0 ) ? centerOffset : -centerOffset;
476 aArcCenter =
VECTOR2I( 0, centerY );
481 aArcCenter += aPadPos;
500 const VECTOR2I& aPadSize,
int aCornerRadius,
504 VECTOR2I localPt = aPoint - aPadPos;
508 int halfW = aPadSize.
x / 2;
509 int halfH = aPadSize.
y / 2;
510 int innerHalfW = halfW - aCornerRadius;
511 int innerHalfH = halfH - aCornerRadius;
514 bool inCornerX =
std::abs( localPt.
x ) > innerHalfW;
515 bool inCornerY =
std::abs( localPt.
y ) > innerHalfH;
517 if( !inCornerX || !inCornerY )
521 int cornerX = ( localPt.
x > 0 ) ? innerHalfW : -innerHalfW;
522 int cornerY = ( localPt.
y > 0 ) ? innerHalfH : -innerHalfH;
524 aCornerCenter =
VECTOR2I( cornerX, cornerY );
528 aCornerCenter += aPadPos;
540 std::vector<VECTOR2I>& aPoly,
int aTdWidth,
542 std::vector<VECTOR2I>& aPts,
548 int maxError =
m_board->GetDesignSettings().m_MaxError;
556 VECTOR2I side1( aPts[2] - aPts[1] );
558 VECTOR2I side2( aPts[4] - aPts[0] );
560 VECTOR2I trackDir( aIntersection - ( aPts[0] + aPts[1] ) / 2 );
563 bool isRoundRect =
false;
565 int cornerRadius = 0;
577 cornerRadius =
pad->GetRoundRectCornerRadius( aLayer );
578 padSize =
pad->GetSize( aLayer );
579 padRotation =
pad->GetOrientation();
584 padSize =
pad->GetSize( aLayer );
585 padRotation =
pad->GetOrientation();
589 std::vector<VECTOR2I> curve_pts;
599 ctrl2 = ( aPts[2] + aIntersection ) / 2;
601 if( isRoundRect && cornerRadius > 0 )
606 padRotation, cornerCenter ) )
617 if(
isPointOnOvalEnd( aPts[2], aOtherPos, padSize, padRotation, arcCenter ) )
628 aPoly.push_back( corner );
630 aPoly.push_back( aPts[3] );
636 ctrl1 = ( aPts[4] + aIntersection ) / 2;
638 if( isRoundRect && cornerRadius > 0 )
643 padRotation, cornerCenter ) )
654 if(
isPointOnOvalEnd( aPts[4], aOtherPos, padSize, padRotation, arcCenter ) )
667 aPoly.push_back( corner );
673 std::vector<VECTOR2I>& aPts )
const
675 int maxError =
m_board->GetDesignSettings().m_MaxError;
706 wxCHECK_MSG( aItem->
Type() ==
PCB_PAD_T,
false, wxT(
"Expected non-round item to be PAD" ) );
712 pad->TransformShapeToPolygon( c_buffer, aLayer, 0, maxError,
ERROR_INSIDE );
719 int halfsize = std::min( aParams.
m_TdMaxWidth, preferred_width )/2;
724 VECTOR2I ref_on_track = ( aPts[0] + aPts[1] ) / 2;
725 VECTOR2I teardrop_axis( aPts[3] - ref_on_track );
737 clipping_rect.
Append( 0, - halfsize );
738 clipping_rect.
Append( 0, halfsize );
739 clipping_rect.
Append( len, halfsize );
740 clipping_rect.
Append( len, - halfsize );
742 clipping_rect.
Rotate( -orient );
743 clipping_rect.
Move( ref_on_track );
759 std::vector<VECTOR2I> points = padpoly.
CPoints();
761 std::vector<VECTOR2I> initialPoints;
762 initialPoints.push_back( aPts[0] );
763 initialPoints.push_back( aPts[1] );
766 initialPoints.emplace_back( pt.x, pt.y );
768 std::vector<VECTOR2I> hull;
775 int found_start = -1;
781 for(
unsigned ii = 0, jj = 0; jj < hull.size(); ii++, jj++ )
783 unsigned next = ii+ 1;
785 if(
next >= hull.size() )
791 prev = hull.size()-1;
793 if( hull[ii] == start )
796 if( hull[
next] != pend )
804 if( hull[ii] == pend )
806 if( hull[
next] != start )
815 if( found_start < 0 )
817 int ii = found_end-1;
827 int ii = found_start-1;
844 double area1 = dummy1.
Area();
846 std::swap( aPts[2], aPts[4] );
848 double area2 = dummy2.
Area();
851 std::swap( aPts[2], aPts[4] );
861 int* aEffectiveTeardropLen )
const
868 int maxError =
m_board->GetDesignSettings().m_MaxError;
874 targetLength = std::min( aParams.
m_TdMaxLen, targetLength );
878 bool need_swap =
false;
882 if( !aOther->
HitTest( start, 0 ) )
884 std::swap( start,
end );
896 wxCHECK_MSG( aOther->
Type() ==
PCB_PAD_T,
false, wxT(
"Expected non-round item to be PAD" ) );
897 static_cast<PAD*
>( aOther )->TransformShapeToPolygon( shapebuffer, aTrack->
GetLayer(), 0,
917 pt_count = outline.
Intersect( poly, pts );
929 aIntersection = pts[0].p;
930 start = aIntersection;
934 actualTdLen = std::min( targetLength,
SEG( start,
end ).Length() );
943 while( actualTdLen + consumed < targetLength )
949 if( connected_track ==
nullptr )
956 constexpr double kMinCosForTwoSegmentExtension = 0.5;
969 - connected_track->
GetEnd() );
972 double cosAngle = firstDir.
x * secondDir.
x + firstDir.
y * secondDir.
y;
974 if( cosAngle < kMinCosForTwoSegmentExtension )
977 consumed += actualTdLen;
979 actualTdLen = std::min( targetLength-consumed,
int( connected_track->
GetLength() ) );
980 aTrack = connected_track;
982 start = connected_track->
GetStart();
987 std::swap( start,
end );
1021 for(
int ii = poly.
PointCount()-1; ii >= 0 ; ii-- )
1023 int dist_from_start = ( poly.
CPoint( ii ) - start ).EuclideanNorm();
1027 if( dist_from_start < actualTdLen || ii == 0 )
1029 start = poly.
CPoint( ii );
1038 actualTdLen -= (start - ref_lenght_point).EuclideanNorm();
1041 if( actualTdLen < 0 )
1044 actualTdLen = std::min( actualTdLen, (
end - start).EuclideanNorm() );
1056 aStartPoint = start;
1059 *aEffectiveTeardropLen = actualTdLen;
1065 std::vector<VECTOR2I>& aCorners,
PCB_TRACK* aTrack,
1098 bool twoSegments = ( aTrack != originalTrack );
1106 if( twoSegments && start != intersection )
1110 int track_halfwidth = aTrack->
GetWidth() / 2;
1111 VECTOR2I pointB = start +
VECTOR2I( vecT.
x * track_stub_len + vecT.
y * track_halfwidth,
1112 vecT.
y * track_stub_len - vecT.
x * track_halfwidth );
1113 VECTOR2I pointA = start +
VECTOR2I( vecT.
x * track_stub_len - vecT.
y * track_halfwidth,
1114 vecT.
y * track_stub_len + vecT.
x * track_halfwidth );
1120 if( !
IsRound( aOther, layer ) )
1124 if(
pad->HitTest( pointA, 0, layer ) )
1127 if(
pad->HitTest( pointB, 0, layer ) )
1135 int padRadius =
GetWidth( aOther, layer ) / 2;
1137 double projOnTrack = -( intToPad.
x * vecVia.
x + intToPad.
y * vecVia.
y );
1138 double effectiveDist = std::max( projOnTrack,
static_cast<double>( padRadius ) );
1151 int maxError =
m_board->GetDesignSettings().m_MaxError;
1153 pad->TransformShapeToPolygon( padPoly, layer, 0, maxError,
ERROR_INSIDE );
1164 double reach = effectiveDist + 2.0 *
pad->GetBoundingRadius() + offset;
1169 padOutline.
Intersect(
SEG( intersection, rayEnd ), hits );
1176 double d = ( hit.p - intersection ).EuclideanNorm();
1179 farEdge = std::max( farEdge, d );
1184 effectiveDist = std::min( effectiveDist, std::max( 0.0, farEdge - 2.0 * offset ) );
1195 double R =
static_cast<double>( padRadius );
1196 double cx = intToPad.
x;
1197 double cy = intToPad.
y;
1198 double distCenterSq = cx * cx + cy * cy;
1203 double disc = projOnTrack * projOnTrack - ( distCenterSq - R * R );
1207 double farEdge = projOnTrack + std::sqrt( disc );
1208 double maxAllowed = std::max( 0.0, farEdge - 2.0 * offset );
1210 if( effectiveDist > maxAllowed )
1211 effectiveDist = maxAllowed;
1216 KiROUND( -vecVia.
y * ( effectiveDist + offset ) ) );
1223 VECTOR2I junctionB_seg2, junctionB_seg1, junctionA_seg2, junctionA_seg1;
1228 KiROUND( -vecT.
x * track_halfwidth ) );
1230 KiROUND( vecT.
x * track_halfwidth ) );
1232 KiROUND( -vecVia.
x * track_halfwidth ) );
1234 KiROUND( vecVia.
x * track_halfwidth ) );
1240 bool skipJunctionA =
false;
1241 bool skipJunctionB =
false;
1247 skipJunctionA = ( transA.
x * anchorDirA.
x + transA.
y * anchorDirA.
y ) < 0;
1251 skipJunctionB = ( transB.
x * anchorDirB.
x + transB.
y * anchorDirB.
y ) < 0;
1254 VECTOR2I anchorA = twoSegments ? junctionA_seg1 : pointA;
1255 VECTOR2I anchorB = twoSegments ? junctionB_seg1 : pointB;
1257 std::vector<VECTOR2I> pts = { anchorA, anchorB, pointC, pointD, pointE };
1264 if(
IsRound( aOther, layer ) )
1270 double perpDistToCenter = padOffset.
x * perpVia.
x + padOffset.
y * perpVia.
y;
1273 if(
std::abs( perpDistToCenter ) > padRadius * 0.1 )
1275 double d =
std::abs( perpDistToCenter );
1281 double maxSymmetric =
static_cast<double>( padRadius ) - d;
1285 int maxHalfWidth = preferred_width / 2;
1288 maxHalfWidth = std::min( maxHalfWidth, aParams.
m_TdMaxWidth / 2 );
1290 double symHalfWidth = std::min( maxSymmetric,
1291 static_cast<double>( maxHalfWidth ) );
1293 if( symHalfWidth > track_halfwidth )
1296 double R =
static_cast<double>( padRadius );
1302 auto findCircleLineIntersection =
1305 double projAlongTrack = padOffset.
x * vecVia.
x
1306 + padOffset.
y * vecVia.
y;
1308 + vecVia * projAlongTrack
1309 + perpVia * perpDist;
1312 double b_coeff = oc.
x * vecVia.
x + oc.
y * vecVia.
y;
1313 double c_coeff = oc.
x * oc.
x + oc.
y * oc.
y - R * R;
1314 double disc = b_coeff * b_coeff - c_coeff;
1320 double sqrtDisc = std::sqrt( disc );
1321 double t1 = -b_coeff - sqrtDisc;
1322 double t2 = -b_coeff + sqrtDisc;
1325 VECTOR2D p1 = lineOrigin + vecVia * t1;
1326 VECTOR2D p2 = lineOrigin + vecVia * t2;
1329 if( ( p1 - intPt ).EuclideanNorm()
1330 < ( p2 - intPt ).EuclideanNorm() )
1345 pts[2] = findCircleLineIntersection( -symHalfWidth );
1346 pts[4] = findCircleLineIntersection( symHalfWidth );
1356 aCorners.push_back( pointA );
1357 aCorners.push_back( pointB );
1359 if( !skipJunctionB )
1360 aCorners.push_back( junctionB_seg2 );
1362 aCorners.push_back( pts[1] );
1363 aCorners.push_back( pts[2] );
1364 aCorners.push_back( pts[3] );
1365 aCorners.push_back( pts[4] );
1366 aCorners.push_back( pts[0] );
1368 if( !skipJunctionA )
1369 aCorners.push_back( junctionA_seg2 );
1373 aCorners = std::move( pts );
1380 if(
IsRound( aOther, layer ) )
1384 std::vector<VECTOR2I> curvePoly;
1386 vecVia, aOther, aOtherPos, pts );
1388 aCorners.push_back( pointB );
1390 if( !skipJunctionB )
1391 aCorners.push_back( junctionB_seg2 );
1393 for(
const VECTOR2I& pt : curvePoly )
1394 aCorners.push_back( pt );
1396 if( !skipJunctionA )
1397 aCorners.push_back( junctionA_seg2 );
1399 aCorners.push_back( pointA );
1404 vecT, aOther, aOtherPos, pts );
1416 std::vector<VECTOR2I> curvePoly;
1418 intersection, aOther, aOtherPos, layer );
1420 aCorners.push_back( pointB );
1422 if( !skipJunctionB )
1423 aCorners.push_back( junctionB_seg2 );
1425 for(
const VECTOR2I& pt : curvePoly )
1426 aCorners.push_back( pt );
1428 if( !skipJunctionA )
1429 aCorners.push_back( junctionA_seg2 );
1431 aCorners.push_back( pointA );
1436 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.