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 <kicad_string.h>
#include <pcb_edit_frame.h>
#include <board.h>
#include <fp_shape.h>
#include <pcb_text.h>
#include <pcb_marker.h>
#include <pcb_group.h>
#include <footprint.h>
#include <view/view.h>
#include <geometry/shape_null.h>
#include <i18n_utility.h>
#include <convert_drawsegment_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 1716 of file footprint.cpp.

1717 {
1718  double area = 0.0;
1719 
1720  for( int ii = 0; ii < aPolySet.OutlineCount(); ii++ )
1721  {
1722  SHAPE_LINE_CHAIN& outline = aPolySet.Outline( ii );
1723  // Ensure the curr outline is closed, to calculate area
1724  outline.SetClosed( true );
1725 
1726  area += outline.Area();
1727  }
1728 
1729  return area;
1730 }
int OutlineCount() const
Return the number of vertices in a given outline/hole.
void SetClosed(bool aClosed)
Function SetClosed()
SHAPE_LINE_CHAIN & Outline(int aIndex)
SHAPE_LINE_CHAIN.

References SHAPE_LINE_CHAIN::Area(), 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