KiCad PCB EDA Suite
ar_autoplacer.cpp File Reference
#include <fctsys.h>
#include <confirm.h>
#include <pcbnew.h>
#include <pcb_edit_frame.h>
#include <gr_basic.h>
#include <macros.h>
#include <msgpanel.h>
#include <class_board.h>
#include <class_module.h>
#include <class_track.h>
#include <class_drawsegment.h>
#include <class_pad.h>
#include <board_commit.h>
#include <connectivity/connectivity_data.h>
#include <ratsnest_data.h>
#include <widgets/progress_reporter.h>
#include "ar_matrix.h"
#include "ar_cell.h"
#include "ar_autoplacer.h"

Go to the source code of this file.

Macros

#define AR_GAIN   16
 
#define AR_KEEPOUT_MARGIN   500
 
#define AR_ABORT_PLACEMENT   -1
 
#define STEP_AR_MM   1.0
 

Functions

static bool sortFootprintsByComplexity (MODULE *ref, MODULE *compare)
 
static bool sortFootprintsByRatsnestSize (MODULE *ref, MODULE *compare)
 

Variables

static const double OrientationPenalty [11]
 

Macro Definition Documentation

◆ AR_ABORT_PLACEMENT

#define AR_ABORT_PLACEMENT   -1

Definition at line 50 of file ar_autoplacer.cpp.

◆ AR_GAIN

#define AR_GAIN   16

Definition at line 48 of file ar_autoplacer.cpp.

◆ AR_KEEPOUT_MARGIN

#define AR_KEEPOUT_MARGIN   500

Definition at line 49 of file ar_autoplacer.cpp.

◆ STEP_AR_MM

#define STEP_AR_MM   1.0

Definition at line 52 of file ar_autoplacer.cpp.

Function Documentation

◆ sortFootprintsByComplexity()

static bool sortFootprintsByComplexity ( MODULE ref,
MODULE compare 
)
static

Definition at line 776 of file ar_autoplacer.cpp.

777 {
778  double ff1, ff2;
779 
780  ff1 = ref->GetArea() * ref->GetPadCount();
781  ff2 = compare->GetArea() * compare->GetPadCount();
782 
783  return ff2 < ff1;
784 }
unsigned GetPadCount(INCLUDE_NPTH_T aIncludeNPTH=INCLUDE_NPTH_T(INCLUDE_NPTH)) const
GetPadCount returns the number of pads.
double GetArea(int aPadding=0) const

References MODULE::GetArea(), and MODULE::GetPadCount().

Referenced by AR_AUTOPLACER::pickModule().

◆ sortFootprintsByRatsnestSize()

static bool sortFootprintsByRatsnestSize ( MODULE ref,
MODULE compare 
)
static

Definition at line 787 of file ar_autoplacer.cpp.

788 {
789  double ff1, ff2;
790 
791  ff1 = ref->GetArea() * ref->GetFlag();
792  ff2 = compare->GetArea() * compare->GetFlag();
793  return ff2 < ff1;
794 }
double GetArea(int aPadding=0) const
int GetFlag() const
Definition: class_module.h:244

References MODULE::GetArea(), and MODULE::GetFlag().

Referenced by AR_AUTOPLACER::pickModule().

Variable Documentation

◆ OrientationPenalty

const double OrientationPenalty[11]
static
Initial value:
=
{
2.0,
1.9,
1.8,
1.7,
1.6,
1.5,
1.4,
1.3,
1.2,
1.1,
1.0
}

Definition at line 57 of file ar_autoplacer.cpp.

Referenced by AR_AUTOPLACER::AutoplaceModules().