|
KiCad PCB EDA Suite
|
#include "drc/drc_creepage_utils.h"#include <geometry/intersection.h>#include <geometry/shape_simple.h>#include <pcb_track.h>#include <thread_pool.h>Go to the source code of this file.
Functions | |
| void | BuildCreepageBoardEdges (BOARD &aBoard, std::vector< BOARD_ITEM * > &aVector, std::vector< std::unique_ptr< PCB_SHAPE > > &aOwned, const std::set< const BOARD_ITEM * > *aExclude) |
| Collect the board-edge items used by the creepage graph. | |
| bool | segmentIntersectsArc (const VECTOR2I &p1, const VECTOR2I &p2, const VECTOR2I ¢er, double radius, EDA_ANGLE startAngle, EDA_ANGLE endAngle, std::vector< VECTOR2I > *aIntersectionPoints=nullptr) |
| bool | segments_intersect (const VECTOR2I &p1, const VECTOR2I &q1, const VECTOR2I &p2, const VECTOR2I &q2, std::vector< VECTOR2I > &aIntersectionPoints) |
| bool | compareShapes (const CREEP_SHAPE *a, const CREEP_SHAPE *b) |
| bool | areEquivalent (const CREEP_SHAPE *a, const CREEP_SHAPE *b) |
| VECTOR2I | closestPointOnSegment (const VECTOR2I &A, const VECTOR2I &B, const VECTOR2I &P) |
| bool | segmentIntersectsCircle (const VECTOR2I &p1, const VECTOR2I &p2, const VECTOR2I ¢er, double radius, std::vector< VECTOR2I > *aIntersectPoints) |
| bool | SegmentIntersectsBoard (const VECTOR2I &aP1, const VECTOR2I &aP2, const std::vector< BOARD_ITEM * > &aBe, const std::vector< const BOARD_ITEM * > &aDontTestAgainst, int aMinGrooveWidth) |
| std::vector< PATH_CONNECTION > | GetPaths (CREEP_SHAPE *aS1, CREEP_SHAPE *aS2, double aMaxWeight) |
| bool areEquivalent | ( | const CREEP_SHAPE * | a, |
| const CREEP_SHAPE * | b ) |
Definition at line 259 of file drc_creepage_utils.cpp.
References CREEP_SHAPE::GetPos(), CREEP_SHAPE::GetRadius(), and CREEP_SHAPE::GetType().
Referenced by CREEPAGE_GRAPH::RemoveDuplicatedShapes().
| void BuildCreepageBoardEdges | ( | BOARD & | aBoard, |
| std::vector< BOARD_ITEM * > & | aVector, | ||
| std::vector< std::unique_ptr< PCB_SHAPE > > & | aOwned, | ||
| const std::set< const BOARD_ITEM * > * | aExclude = nullptr ) |
Collect the board-edge items used by the creepage graph.
Gathers Edge.Cuts drawings (flattening Bezier curves to owned segments) and NPTH pad holes (circles and oblong slots) into aVector, with transient owned shapes parked in aOwned. When aExclude is non-null, board items owned by any excluded item (for example the pads of a footprint being dragged) are skipped so the caller can treat them as moving geometry.
Definition at line 27 of file drc_creepage_utils.cpp.
References ARC, BEZIER, CIRCLE, BOARD::Drawings(), Edge_Cuts, BOARD::Footprints(), EDA_SHAPE::GetBezierPoints(), BOARD::GetDesignSettings(), BOARD::GetPads(), EDA_SHAPE::GetShape(), BOARD_DESIGN_SETTINGS::m_MaxError, NPTH, VECTOR2< T >::Perpendicular(), radius, EDA_SHAPE::RebuildBezierToSegmentsPointsList(), VECTOR2< T >::Resize(), and SEGMENT.
Referenced by DRC_TEST_PROVIDER_CREEPAGE::CollectBoardEdges(), and CREEPAGE_ENGINE::populateBoardEdgeGraph().
Definition at line 1612 of file drc_creepage_utils.cpp.
References VECTOR2< T >::Dot(), and VECTOR2< T >::SquaredEuclideanNorm().
Referenced by CU_SHAPE_SEGMENT::Paths().
| bool compareShapes | ( | const CREEP_SHAPE * | a, |
| const CREEP_SHAPE * | b ) |
Definition at line 235 of file drc_creepage_utils.cpp.
References CREEP_SHAPE::GetPos(), CREEP_SHAPE::GetRadius(), and CREEP_SHAPE::GetType().
Referenced by CREEPAGE_GRAPH::RemoveDuplicatedShapes().
| std::vector< PATH_CONNECTION > GetPaths | ( | CREEP_SHAPE * | aS1, |
| CREEP_SHAPE * | aS2, | ||
| double | aMaxWeight ) |
Definition at line 2156 of file drc_creepage_utils.cpp.
References BE_SHAPE_ARC::Paths(), BE_SHAPE_CIRCLE::Paths(), BE_SHAPE_POINT::Paths(), CU_SHAPE_ARC::Paths(), CU_SHAPE_CIRCLE::Paths(), CU_SHAPE_SEGMENT::Paths(), and result.
Referenced by CREEPAGE_GRAPH::GeneratePaths().
| bool segmentIntersectsArc | ( | const VECTOR2I & | p1, |
| const VECTOR2I & | p2, | ||
| const VECTOR2I & | center, | ||
| double | radius, | ||
| EDA_ANGLE | startAngle, | ||
| EDA_ANGLE | endAngle, | ||
| std::vector< VECTOR2I > * | aIntersectionPoints = nullptr ) |
Definition at line 156 of file drc_creepage_utils.cpp.
References EDA_ANGLE::AsRadians(), center, SHAPE_ARC::GetP0(), SHAPE_ARC::GetP1(), and radius.
Referenced by BE_SHAPE_CIRCLE::Paths(), CU_SHAPE_ARC::Paths(), CU_SHAPE_CIRCLE::Paths(), CU_SHAPE_SEGMENT::Paths(), and SegmentIntersectsBoard().
| bool SegmentIntersectsBoard | ( | const VECTOR2I & | aP1, |
| const VECTOR2I & | aP2, | ||
| const std::vector< BOARD_ITEM * > & | aBe, | ||
| const std::vector< const BOARD_ITEM * > & | aDontTestAgainst, | ||
| int | aMinGrooveWidth ) |
Definition at line 1907 of file drc_creepage_utils.cpp.
References ARC, EDA_SHAPE::CalcArcAngles(), center, CIRCLE, DEGREES_T, PCB_SHAPE::GetCenter(), EDA_SHAPE::GetCornerRadius(), EDA_SHAPE::GetEnd(), EDA_SHAPE::GetPolyPoints(), EDA_SHAPE::GetRadius(), EDA_SHAPE::GetShape(), EDA_SHAPE::GetStart(), POLY, radius, RECTANGLE, SEGMENT, segmentIntersectsArc(), segmentIntersectsCircle(), segments_intersect(), VECTOR2< T >::x, and VECTOR2< T >::y.
Referenced by BOOST_AUTO_TEST_CASE(), and PATH_CONNECTION::isValid().
| bool segmentIntersectsCircle | ( | const VECTOR2I & | p1, |
| const VECTOR2I & | p2, | ||
| const VECTOR2I & | center, | ||
| double | radius, | ||
| std::vector< VECTOR2I > * | aIntersectPoints ) |
Definition at line 1885 of file drc_creepage_utils.cpp.
References center, circle(), and radius.
Referenced by SegmentIntersectsBoard().
| bool segments_intersect | ( | const VECTOR2I & | p1, |
| const VECTOR2I & | q1, | ||
| const VECTOR2I & | p2, | ||
| const VECTOR2I & | q2, | ||
| std::vector< VECTOR2I > & | aIntersectionPoints ) |
Definition at line 214 of file drc_creepage_utils.cpp.
Referenced by SegmentIntersectsBoard().