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

Go to the source code of this file.

Functions

void SpreadFootprints (std::vector< FOOTPRINT * > *aFootprints, const 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,
const 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
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 119 of file spread_footprints.cpp.

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

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