KiCad PCB EDA Suite
footprint.cpp File Reference
#include <core/mirror.h>
#include <confirm.h>
#include <refdes_utils.h>
#include <bitmaps.h>
#include <unordered_set>
#include <string_utils.h>
#include <pcb_edit_frame.h>
#include <board.h>
#include <board_design_settings.h>
#include <fp_shape.h>
#include <macros.h>
#include <pad.h>
#include <pcb_text.h>
#include <pcb_marker.h>
#include <pcb_group.h>
#include <pcb_track.h>
#include <footprint.h>
#include <zone.h>
#include <view/view.h>
#include <geometry/shape_null.h>
#include <i18n_utility.h>
#include <convert_shape_list_to_polygon.h>
#include <geometry/convex_hull.h>

Go to the source code of this file.

Classes

struct  FOOTPRINT_DESC
 

Macros

#define MINIMAL_ZOOM_LEVEL_FOR_VISIBILITY   1.5
 

Functions

static double polygonArea (SHAPE_POLY_SET &aPolySet)
 

Variables

static struct FOOTPRINT_DESC _FOOTPRINT_DESC
 

Macro Definition Documentation

◆ MINIMAL_ZOOM_LEVEL_FOR_VISIBILITY

#define MINIMAL_ZOOM_LEVEL_FOR_VISIBILITY   1.5

Function Documentation

◆ polygonArea()

static double polygonArea ( SHAPE_POLY_SET aPolySet)
static

Definition at line 1836 of file footprint.cpp.

1837 {
1838  // Ensure all outlines are closed, before calculating the SHAPE_POLY_SET area
1839  for( int ii = 0; ii < aPolySet.OutlineCount(); ii++ )
1840  {
1841  SHAPE_LINE_CHAIN& outline = aPolySet.Outline( ii );
1842  outline.SetClosed( true );
1843 
1844  for( int jj = 0; jj < aPolySet.HoleCount( ii ); jj++ )
1845  aPolySet.Hole( ii, jj ).SetClosed( true );
1846  }
1847 
1848  return aPolySet.Area();
1849 }
int OutlineCount() const
Return the number of vertices in a given outline/hole.
SHAPE_LINE_CHAIN & Hole(int aOutline, int aHole)
Return the aIndex-th subpolygon in the set.
double Area()
Count the number of arc shapes present.
void SetClosed(bool aClosed)
Mark the line chain as closed (i.e.
SHAPE_LINE_CHAIN & Outline(int aIndex)
int HoleCount(int aOutline) const
Return the reference to aIndex-th outline in the set.
Represent a polyline (an zero-thickness chain of connected line segments).

References SHAPE_POLY_SET::Area(), SHAPE_POLY_SET::Hole(), SHAPE_POLY_SET::HoleCount(), SHAPE_POLY_SET::Outline(), SHAPE_POLY_SET::OutlineCount(), and SHAPE_LINE_CHAIN::SetClosed().

Referenced by FOOTPRINT::CoverageRatio(), and FOOTPRINT::GetCoverageArea().

Variable Documentation

◆ _FOOTPRINT_DESC

struct FOOTPRINT_DESC _FOOTPRINT_DESC
static