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 | ConvertOutlineToPolygon (std::vector< PCB_SHAPE * > &aShapeList, SHAPE_POLY_SET &aPolygons, int aErrorMax, int aChainingEpsilon, bool aAllowDisjoint, OUTLINE_ERROR_HANDLER *aErrorHandler) |
Function ConvertOutlineToPolygon build a polygon set (with holes) from a PCB_SHAPE list, which is expected to be one or more top-level closed outlines, with zero or more holes in each. More... | |
bool | BuildBoardPolygonOutlines (BOARD *aBoard, SHAPE_POLY_SET &aOutlines, int aErrorMax, int aChainingEpsilon, OUTLINE_ERROR_HANDLER *aErrorHandler=nullptr) |
Extracts the board outlines and build a closed polygon from lines, arcs and circle items on edge cut layer. More... | |
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 |
||
) |
Extracts 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.
Definition at line 604 of file convert_shape_list_to_polygon.cpp.
References SHAPE_POLY_SET::AddHole(), SHAPE_POLY_SET::Append(), PCB_TYPE_COLLECTOR::Collect(), BOARD::ComputeBoundingBox(), ConvertOutlineToPolygon(), SHAPE_LINE_CHAIN::CPoint(), Edge_Cuts, BOARD::Footprints(), BOARD::GetBoardEdgesBoundingBox(), COLLECTOR::GetCount(), BOX2< Vec >::GetEnd(), EDA_ITEM::GetFlags(), BOX2< Vec >::GetHeight(), BOARD_ITEM::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_FP_SHAPE_T, 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 ConvertOutlineToPolygon | ( | std::vector< PCB_SHAPE * > & | aShapeList, |
SHAPE_POLY_SET & | aPolygons, | ||
int | aErrorMax, | ||
int | aChainingEpsilon, | ||
bool | aAllowDisjoint, | ||
OUTLINE_ERROR_HANDLER * | aErrorHandler | ||
) |
Function ConvertOutlineToPolygon build a polygon set (with holes) from a PCB_SHAPE list, which 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 | = an optional error handler |
Function ConvertOutlineToPolygon build a polygon set (with holes) from a PCB_SHAPE list, which is expected to be one or more top-level closed outlines, with zero or more holes in each.
These closed inner outlines are considered as holes in the main outline.
aShapeList | the initial list of SHAPEs (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 error distance when polygonizing a curve (internal units) |
aAllowDisjoint | indicates multiple top-level outlines are allowed |
aErrorHandler | = an optional error handler |
Definition at line 175 of file convert_shape_list_to_polygon.cpp.
References _, SHAPE_POLY_SET::AddHole(), SHAPE_POLY_SET::AddOutline(), PNS::angle(), ANGLE_0, ANGLE_360, SHAPE_LINE_CHAIN::Append(), ARC, BEZIER, CIRCLE, SHAPE_POLY_SET::CIterate(), close_enough(), closer_to_first(), findNext(), FULL_CIRCLE, EDA_SHAPE::GetArcAngle(), GetArcToSegmentCount(), EDA_SHAPE::GetBezierPoints(), PCB_SHAPE::GetCenter(), EDA_SHAPE::GetEnd(), EDA_ITEM::GetFlags(), FOOTPRINT::GetOrientation(), PCB_SHAPE::GetParentFootprint(), EDA_SHAPE::GetPolyShape(), FOOTPRINT::GetPosition(), EDA_SHAPE::GetRadius(), EDA_SHAPE::GetRectCorners(), SHAPE_LINE_CHAIN::GetSegment(), EDA_SHAPE::GetShape(), EDA_SHAPE::GetStart(), SHAPE_POLY_SET::IsEmpty(), SHAPE_POLY_SET::IterateSegmentsWithHoles(), SHAPE_POLY_SET::Outline(), SHAPE_POLY_SET::OutlineCount(), SHAPE_LINE_CHAIN_BASE::PointInside(), POLY, RECT, RotatePoint(), SEGMENT, SHAPE_LINE_CHAIN::SetClosed(), EDA_ITEM::SetFlags(), EDA_SHAPE::SHAPE_T_asString(), SKIP_STRUCT, UNIMPLEMENTED_FOR, and VECTOR2< T >::x.
Referenced by BuildBoardPolygonOutlines(), FOOTPRINT::BuildCourtyardCaches(), and BuildFootprintPolygonOutlines().