KiCad PCB EDA Suite
GERBER_plotter.cpp File Reference

specialized plotter for GERBER files format More...

#include <string_utils.h>
#include <convert_basic_shapes_to_polygon.h>
#include <macros.h>
#include <math/util.h>
#include <trigo.h>
#include <wx/log.h>
#include <build_version.h>
#include <plotters/plotter_gerber.h>
#include <plotters/gbr_plotter_aperture_macros.h>
#include <gbr_metadata.h>

Go to the source code of this file.

Macros

#define GBR_USE_MACROS_FOR_CHAMFERED_ROUND_RECT
 
#define GBR_USE_MACROS_FOR_CHAMFERED_RECT
 
#define GBR_USE_MACROS_FOR_ROUNDRECT
 
#define GBR_USE_MACROS_FOR_TRAPEZOID
 
#define GBR_USE_MACROS_FOR_ROTATED_OVAL
 
#define GBR_USE_MACROS_FOR_ROTATED_RECT
 
#define GBR_USE_MACROS_FOR_CUSTOM_PAD
 
#define GBR_MACRO_FOR_CUSTOM_PAD_MAX_CORNER_COUNT   4990
 
#define AM_FREEPOLY_BASENAME   "FreePoly"
 

Functions

static bool polyCompare (const std::vector< wxPoint > &aPolygon, const std::vector< wxPoint > &aTestPolygon)
 

Detailed Description

specialized plotter for GERBER files format

Definition in file GERBER_plotter.cpp.

Macro Definition Documentation

◆ AM_FREEPOLY_BASENAME

#define AM_FREEPOLY_BASENAME   "FreePoly"

Definition at line 64 of file GERBER_plotter.cpp.

◆ GBR_MACRO_FOR_CUSTOM_PAD_MAX_CORNER_COUNT

#define GBR_MACRO_FOR_CUSTOM_PAD_MAX_CORNER_COUNT   4990

Definition at line 63 of file GERBER_plotter.cpp.

◆ GBR_USE_MACROS_FOR_CHAMFERED_RECT

#define GBR_USE_MACROS_FOR_CHAMFERED_RECT

Definition at line 49 of file GERBER_plotter.cpp.

◆ GBR_USE_MACROS_FOR_CHAMFERED_ROUND_RECT

#define GBR_USE_MACROS_FOR_CHAMFERED_ROUND_RECT

Definition at line 48 of file GERBER_plotter.cpp.

◆ GBR_USE_MACROS_FOR_CUSTOM_PAD

#define GBR_USE_MACROS_FOR_CUSTOM_PAD

Definition at line 54 of file GERBER_plotter.cpp.

◆ GBR_USE_MACROS_FOR_ROTATED_OVAL

#define GBR_USE_MACROS_FOR_ROTATED_OVAL

Definition at line 52 of file GERBER_plotter.cpp.

◆ GBR_USE_MACROS_FOR_ROTATED_RECT

#define GBR_USE_MACROS_FOR_ROTATED_RECT

Definition at line 53 of file GERBER_plotter.cpp.

◆ GBR_USE_MACROS_FOR_ROUNDRECT

#define GBR_USE_MACROS_FOR_ROUNDRECT

Definition at line 50 of file GERBER_plotter.cpp.

◆ GBR_USE_MACROS_FOR_TRAPEZOID

#define GBR_USE_MACROS_FOR_TRAPEZOID

Definition at line 51 of file GERBER_plotter.cpp.

Function Documentation

◆ polyCompare()

static bool polyCompare ( const std::vector< wxPoint > &  aPolygon,
const std::vector< wxPoint > &  aTestPolygon 
)
static

Definition at line 71 of file GERBER_plotter.cpp.

73 {
74  // fast test: polygon sizes must be the same:
75  if( aTestPolygon.size() != aPolygon.size() )
76  return false;
77 
78  const int margin = 2;
79 
80  for( size_t jj = 0; jj < aPolygon.size(); jj++ )
81  {
82  if( std::abs( aPolygon[jj].x - aTestPolygon[jj].x ) > margin ||
83  std::abs( aPolygon[jj].y - aTestPolygon[jj].y ) > margin )
84  return false;
85  }
86 
87  return true;
88 }

Referenced by GERBER_PLOTTER::GetOrCreateAperture(), and APER_MACRO_FREEPOLY::IsSamePoly().