KiCad PCB EDA Suite
Loading...
Searching...
No Matches
fix_board_shape.cpp File Reference
#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_SHAPEfindNext (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.
 

Typedef Documentation

◆ KDTree

using KDTree
Initial value:
nanoflann::KDTreeSingleIndexAdaptor<nanoflann::L2_Simple_Adaptor<double, PCB_SHAPE_ENDPOINTS_ADAPTOR>,
2 >

Definition at line 70 of file fix_board_shape.cpp.

Function Documentation

◆ ConnectBoardShapes()

◆ findNext()

static PCB_SHAPE * findNext ( PCB_SHAPE * aShape,
const VECTOR2I & aPoint,
const KDTree & kdTree,
const PCB_SHAPE_ENDPOINTS_ADAPTOR & adaptor,
double aChainingEpsilon )
static

Searches for a PCB_SHAPE matching a given end point or start point in a list.

Parameters
aShapeThe starting shape.
aPointThe starting or ending point to search for.
kdTreeThe KD-tree for efficient nearest neighbor search.
adaptorThe adaptor containing the endpoints data.
aChainingEpsilonis the distance from aPoint that still constitutes a valid find.
Returns
PCB_SHAPE* - The first PCB_SHAPE that has a start or end point matching aPoint, otherwise NULL if none.

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().