KiCad PCB EDA Suite
|
Go to the source code of this file.
Typedefs | |
typedef const std::function< void(const wxString &msg, BOARD_ITEM *itemA, BOARD_ITEM *itemB, const VECTOR2I &pt)> | OUTLINE_ERROR_HANDLER |
Functions | |
bool | TestBoardOutlinesGraphicItems (BOARD *aBoard, int aMinDist, OUTLINE_ERROR_HANDLER *aErrorHandler) |
Test a board graphic items on edge cut layer for validity. | |
bool | ConvertOutlineToPolygon (std::vector< PCB_SHAPE * > &aShapeList, SHAPE_POLY_SET &aPolygons, int aErrorMax, int aChainingEpsilon, bool aAllowDisjoint, OUTLINE_ERROR_HANDLER *aErrorHandler, bool aAllowUseArcsInPolygons=false) |
Build a polygon set with holes from a PCB_SHAPE list. | |
bool | BuildBoardPolygonOutlines (BOARD *aBoard, SHAPE_POLY_SET &aOutlines, int aErrorMax, int aChainingEpsilon, OUTLINE_ERROR_HANDLER *aErrorHandler=nullptr, bool aAllowUseArcsInPolygons=false) |
Extract the board outlines and build a closed polygon from lines, arcs and circle items on edge cut layer. | |
bool | BuildFootprintPolygonOutlines (BOARD *aBoard, SHAPE_POLY_SET &aOutlines, int aErrorMax, int aChainingEpsilon, OUTLINE_ERROR_HANDLER *aErrorHandler=nullptr) |
Extract a board outline for a footprint view. | |
typedef const std::function<void( const wxString& msg, BOARD_ITEM* itemA, BOARD_ITEM* itemB, const VECTOR2I& pt )> OUTLINE_ERROR_HANDLER |
Definition at line 33 of file convert_shape_list_to_polygon.h.
bool BuildBoardPolygonOutlines | ( | BOARD * | aBoard, |
SHAPE_POLY_SET & | aOutlines, | ||
int | aErrorMax, | ||
int | aChainingEpsilon, | ||
OUTLINE_ERROR_HANDLER * | aErrorHandler = nullptr , |
||
bool | aAllowUseArcsInPolygons = false |
||
) |
Extract the board outlines and build a closed polygon from lines, arcs and circle items on edge cut layer.
Any closed outline inside the main outline is a hole. All contours should be closed, i.e. are valid vertices for a closed polygon.
aBoard | is the board to build outlines. |
aOutlines | will contain the outlines ( complex polygons ). |
aErrorMax | is the max error distance when polygonizing a curve (internal units). |
aChainingEpsilon | is the max distance from one endPt to the next startPt (internal units), |
aErrorHandler | = an optional error handler. |
aAllowUseArcsInPolygons | is an option to allow adding arcs in SHAPE_LINE_CHAIN polylines/polygons when building outlines from aShapeList This is mainly for export to STEP files. |
Definition at line 731 of file convert_shape_list_to_polygon.cpp.
References SHAPE_POLY_SET::AddHole(), SHAPE_POLY_SET::Append(), PCB_TYPE_COLLECTOR::Collect(), BOARD::ComputeBoundingBox(), SHAPE_LINE_CHAIN::CPoint(), doConvertOutlineToPolygon(), Edge_Cuts, BOARD::Footprints(), BOARD::GetBoardEdgesBoundingBox(), COLLECTOR::GetCount(), BOX2< Vec >::GetEnd(), EDA_ITEM::GetFlags(), BOX2< Vec >::GetHeight(), PCB_SHAPE::GetLayer(), BOX2< Vec >::GetOrigin(), BOX2< Vec >::GetWidth(), BOX2< Vec >::Inflate(), isCopperOutside(), EDA_IU_SCALE::mmToIU(), SHAPE_POLY_SET::NewOutline(), SHAPE_POLY_SET::Outline(), SHAPE_POLY_SET::OutlineCount(), PCB_SHAPE_T, pcbIUScale, SHAPE_LINE_CHAIN_BASE::PointInside(), SHAPE_POLY_SET::RemoveAllContours(), SKIP_STRUCT, VECTOR2< T >::x, and VECTOR2< T >::y.
Referenced by BOARD::GetBoardPolygonOutlines(), DIALOG_EXPORT_STEP::onExportButton(), and DRC_TEST_PROVIDER_MISC::testOutline().
bool BuildFootprintPolygonOutlines | ( | BOARD * | aBoard, |
SHAPE_POLY_SET & | aOutlines, | ||
int | aErrorMax, | ||
int | aChainingEpsilon, | ||
OUTLINE_ERROR_HANDLER * | aErrorHandler = nullptr |
||
) |
Extract a board outline for a footprint view.
Definition at line 975 of file convert_shape_list_to_polygon.cpp.
References SHAPE_POLY_SET::AddHole(), SHAPE_LINE_CHAIN::Append(), SHAPE_POLY_SET::Append(), buildBoardBoundingBoxPoly(), PCB_TYPE_COLLECTOR::Collect(), SEG::Contains(), doConvertOutlineToPolygon(), Edge_Cuts, findEndSegments(), COLLECTOR::GetCount(), BOARD::GetFirstFootprint(), SHAPE_LINE_CHAIN::GetPoint(), SHAPE_POLY_SET::Hole(), SHAPE_POLY_SET::HoleCount(), SEG::IntersectLines(), SHAPE_LINE_CHAIN::IsClosed(), isCopperOutside(), SHAPE_POLY_SET::NewOutline(), SHAPE_POLY_SET::Outline(), SHAPE_POLY_SET::OutlineCount(), PCB_SHAPE_T, SHAPE_LINE_CHAIN::Segment(), SHAPE_LINE_CHAIN::SegmentCount(), SHAPE_LINE_CHAIN::SetClosed(), SKIP_STRUCT, and traceBoardOutline.
Referenced by BOARD_ADAPTER::createBoardPolygon().
bool ConvertOutlineToPolygon | ( | std::vector< PCB_SHAPE * > & | aShapeList, |
SHAPE_POLY_SET & | aPolygons, | ||
int | aErrorMax, | ||
int | aChainingEpsilon, | ||
bool | aAllowDisjoint, | ||
OUTLINE_ERROR_HANDLER * | aErrorHandler, | ||
bool | aAllowUseArcsInPolygons = false |
||
) |
Build a polygon set with holes from a PCB_SHAPE list.
The shape list is expected to be one or more top-level closed outlines with zero or more holes in each. Optionally, it can be limited to a single top-level closed outline.
aShapeList | the initial list of drawsegments (only lines, circles and arcs). |
aPolygons | will contain the complex polygon. |
aErrorMax | is the max error distance when polygonizing a curve (internal units). |
aChainingEpsilon | is the max distance from one endPt to the next startPt (internal units). |
aAllowDisjoint | indicates multiple top-level outlines are allowed. |
aErrorHandler | is an optional error handler. |
aAllowUseArcsInPolygons | is an option to allow adding arcs in SHAPE_LINE_CHAIN polylines/polygons when building outlines from aShapeList This is mainly for export to STEP files. |
Definition at line 599 of file convert_shape_list_to_polygon.cpp.
References doConvertOutlineToPolygon(), and SKIP_STRUCT.
Referenced by FOOTPRINT::BuildCourtyardCaches().
bool TestBoardOutlinesGraphicItems | ( | BOARD * | aBoard, |
int | aMinDist, | ||
OUTLINE_ERROR_HANDLER * | aErrorHandler | ||
) |
Test a board graphic items on edge cut layer for validity.
aBoard | is the board to test. |
aMinDist | is the min length of a segment (or radius, or diagonal size of a rect) to be valid. |
aErrorHandler | is an optional error handler. |
Definition at line 611 of file convert_shape_list_to_polygon.cpp.
References _, ARC, BEZIER, CIRCLE, PCB_TYPE_COLLECTOR::Collect(), Edge_Cuts, VECTOR2< T >::EuclideanNorm(), COLLECTOR::GetCount(), PCB_SHAPE::GetLayer(), PCB_SHAPE_T, POLY, RECTANGLE, SEGMENT, and UNIMPLEMENTED_FOR.
Referenced by DRC_TEST_PROVIDER_MISC::testOutline().