KiCad PCB EDA Suite
Loading...
Searching...
No Matches
spread_footprints.h File Reference
#include <vector>
#include <footprint.h>
#include <base_units.h>
#include <math/vector2d.h>
#include <board.h>

Go to the source code of this file.

Functions

void SpreadFootprints (std::vector< FOOTPRINT * > *aFootprints, VECTOR2I aTargetBoxPosition, bool aGroupBySheet=true, int aComponentGap=pcbIUScale.mmToIU(1), int aGroupGap=pcbIUScale.mmToIU(1.5))
 Footprints (after loaded by reading a netlist for instance) are moved to be in a small free area (outside the current board) without overlapping.
 

Function Documentation

◆ SpreadFootprints()

void SpreadFootprints ( std::vector< FOOTPRINT * > *  aFootprints,
VECTOR2I  aTargetBoxPosition,
bool  aGroupBySheet = true,
int  aComponentGap = pcbIUScale.mmToIU(1),
int  aGroupGap = pcbIUScale.mmToIU(1.5) 
)

Footprints (after loaded by reading a netlist for instance) are moved to be in a small free area (outside the current board) without overlapping.

Parameters
aBoardis the board to edit.
aFootprintsa list of footprints to be spread out.
aTargetBoxPositionthe position of the upper left corner of the area allowed to spread footprints

Definition at line 125 of file spread_footprints.cpp.

References compareFootprintsbyRef(), BOX2< Vec >::GetArea(), FOOTPRINT::GetBoundingBox(), BOX2< Vec >::GetHeight(), BOX2< Vec >::GetOrigin(), BOX2< Vec >::GetWidth(), BOX2< Vec >::Inflate(), BOX2< Vec >::Merge(), FOOTPRINT::Move(), path, scale, spreadRectangles(), VECTOR2< T >::x, and VECTOR2< T >::y.

Referenced by PCB_EDIT_FRAME::OnNetlistChanged(), and EDIT_TOOL::PackAndMoveFootprints().