![]() |
KiCad PCB EDA Suite
|
functions to convert a shape built with DRAWSEGMENTS to a polygon. More...
Go to the source code of this file.
Typedefs | |
typedef const std::function< void(const wxString &msg, BOARD_ITEM *itemA, BOARD_ITEM *itemB, const wxPoint &pt)> | OUTLINE_ERROR_HANDLER |
Functions | |
bool | ConvertOutlineToPolygon (std::vector< PCB_SHAPE * > &aSegList, SHAPE_POLY_SET &aPolygons, int aErrorMax, int aChainingEpsilon, OUTLINE_ERROR_HANDLER *aErrorHandler=nullptr) |
Function ConvertOutlineToPolygon build a polygon (with holes) from a PCB_SHAPE list, which is expected to be a outline, therefore a closed main outline with perhaps closed inner outlines. 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... | |
functions to convert a shape built with DRAWSEGMENTS to a polygon.
expecting the shape describes shape similar to a polygon
Definition in file convert_drawsegment_list_to_polygon.h.
typedef const std::function<void( const wxString& msg, BOARD_ITEM* itemA, BOARD_ITEM* itemB, const wxPoint& pt )> OUTLINE_ERROR_HANDLER |
Definition at line 35 of file convert_drawsegment_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 878 of file convert_drawsegment_list_to_polygon.cpp.
References SHAPE_POLY_SET::Append(), PCB_TYPE_COLLECTOR::Collect(), BOARD::ComputeBoundingBox(), ConvertOutlineToPolygon(), Edge_Cuts, EOT, BOARD::GetBoardEdgesBoundingBox(), COLLECTOR::GetCount(), EDA_RECT::GetEnd(), EDA_RECT::GetHeight(), GetLayer(), EDA_RECT::GetOrigin(), EDA_RECT::GetWidth(), EDA_RECT::Inflate(), Millimeter2iu(), SHAPE_POLY_SET::NewOutline(), SHAPE_POLY_SET::OutlineCount(), PCB_FP_SHAPE_T, PCB_SHAPE_T, and SHAPE_POLY_SET::RemoveAllContours().
Referenced by BOARD::GetBoardPolygonOutlines(), DIALOG_EXPORT_STEP::onExportButton(), and DRC_TEST_PROVIDER_MISC::testOutline().
bool ConvertOutlineToPolygon | ( | std::vector< PCB_SHAPE * > & | aSegList, |
SHAPE_POLY_SET & | aPolygons, | ||
int | aErrorMax, | ||
int | aChainingEpsilon, | ||
OUTLINE_ERROR_HANDLER * | aErrorHandler | ||
) |
Function ConvertOutlineToPolygon build a polygon (with holes) from a PCB_SHAPE list, which is expected to be a outline, therefore a closed main outline with perhaps closed inner outlines.
These closed inner outlines are considered as holes in the main outline
aSegList | 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) |
aErrorHandler | = an optional error handler |
Function ConvertOutlineToPolygon build a polygon (with holes) from a PCB_SHAPE list, which is expected to be a outline, therefore a closed main outline with perhaps closed inner outlines.
These closed inner outlines are considered as holes in the main outline.
aSegList | 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 error distance when polygonizing a curve (internal units) |
aErrorHandler | = an optional error handler |
Definition at line 177 of file convert_drawsegment_list_to_polygon.cpp.
References _, PNS::angle(), SHAPE_POLY_SET::Append(), SHAPE_POLY_SET::CIterate(), EDA_ITEM::ClearFlags(), close_enough(), closer_to_first(), ERROR_INSIDE, findNext(), PCB_SHAPE::GetAngle(), PCB_SHAPE::GetArcEnd(), PCB_SHAPE::GetArcStart(), GetArcToSegmentCount(), PCB_SHAPE::GetBezierPoints(), PCB_SHAPE::GetCenter(), PCB_SHAPE::GetEnd(), EDA_ITEM::GetFlags(), FOOTPRINT::GetOrientation(), PCB_SHAPE::GetParentFootprint(), PCB_SHAPE::GetPolyShape(), FOOTPRINT::GetPosition(), PCB_SHAPE::GetRadius(), PCB_SHAPE::GetRectCorners(), PCB_SHAPE::GetShape(), PCB_SHAPE::GetStart(), PCB_SHAPE::GetWidth(), SHAPE_POLY_SET::IterateSegmentsWithHoles(), SHAPE_POLY_SET::NewHole(), SHAPE_POLY_SET::NewOutline(), PCB_SHAPE::RebuildBezierToSegmentsPointsList(), RotatePoint(), S_ARC, S_CIRCLE, S_CURVE, S_POLYGON, S_RECT, S_SEGMENT, EDA_ITEM::SetFlags(), BOARD_ITEM::ShowShape(), SKIP_STRUCT, TransformCircleToPolygon(), VECTOR2< T >::x, and VECTOR2< T >::y.
Referenced by BuildBoardPolygonOutlines(), BuildFootprintPolygonOutlines(), and FOOTPRINT::BuildPolyCourtyards().