KiCad PCB EDA Suite
|
#include "fix_board_shape.h"
#include <vector>
#include <algorithm>
#include <limits>
#include <pcb_shape.h>
#include <geometry/circle.h>
#include <nanoflann.hpp>
Go to the source code of this file.
Classes | |
struct | PCB_SHAPE_ENDPOINTS_ADAPTOR |
Typedefs | |
using | KDTree |
Functions | |
static PCB_SHAPE * | findNext (PCB_SHAPE *aShape, const VECTOR2I &aPoint, const KDTree &kdTree, const PCB_SHAPE_ENDPOINTS_ADAPTOR &adaptor, double aChainingEpsilon) |
Searches for a PCB_SHAPE matching a given end point or start point in a list. | |
void | ConnectBoardShapes (std::vector< PCB_SHAPE * > &aShapeList, int aChainingEpsilon) |
Connects shapes to each other, making continious contours (adjacent shapes will have a common vertex) aChainingEpsilon is the max distance between vertices of different shapes to connect. | |
using KDTree |
Definition at line 70 of file fix_board_shape.cpp.
void ConnectBoardShapes | ( | std::vector< PCB_SHAPE * > & | aShapeList, |
int | aChainingEpsilon ) |
Connects shapes to each other, making continious contours (adjacent shapes will have a common vertex) aChainingEpsilon is the max distance between vertices of different shapes to connect.
Modifies original shapes
Definition at line 125 of file fix_board_shape.cpp.
References SEG::A, SEG::Angle(), ANGLE_45, ARC, SEG::B, BEZIER, closer_to_first(), delta, findNext(), EDA_SHAPE::GetArcMid(), EDA_SHAPE::GetBezierC1(), EDA_SHAPE::GetBezierC2(), EDA_SHAPE::GetEnd(), EDA_SHAPE::GetShape(), EDA_SHAPE::GetStart(), SEG::IntersectLines(), SEG::Intersects(), SEGMENT, EDA_SHAPE::SetArcGeometry(), EDA_SHAPE::SetBezierC1(), EDA_SHAPE::SetBezierC2(), EDA_SHAPE::SetEnd(), EDA_ITEM::SetFlags(), EDA_SHAPE::SetStart(), and SKIP_STRUCT.
Referenced by GRAPHICS_CLEANER::fixBoardOutlines(), EDIT_TOOL::HealShapes(), PCB_IO_EASYEDA_PARSER::ParseBoard(), PCB_IO_EASYEDAPRO_PARSER::ParseBoard(), PCB_IO_EASYEDA_PARSER::ParseFootprint(), PCB_IO_EASYEDAPRO_PARSER::ParseFootprint(), and DRAWING_TOOL::PlaceImportedGraphics().
|
static |
Searches for a PCB_SHAPE matching a given end point or start point in a list.
aShape | The starting shape. |
aPoint | The starting or ending point to search for. |
kdTree | The KD-tree for efficient nearest neighbor search. |
adaptor | The adaptor containing the endpoints data. |
aChainingEpsilon | is the distance from aPoint that still constitutes a valid find. |
Definition at line 85 of file fix_board_shape.cpp.
References PCB_SHAPE_ENDPOINTS_ADAPTOR::endpoints, EDA_ITEM::GetFlags(), SKIP_STRUCT, VECTOR2< T >::x, and VECTOR2< T >::y.
Referenced by ConnectBoardShapes().