KiCad PCB EDA Suite
gendrill_gerber_writer.cpp File Reference

Functions to create drill files in gerber X2 format. More...

#include <fctsys.h>
#include <vector>
#include <plotter.h>
#include <kicad_string.h>
#include <pcb_edit_frame.h>
#include <pgm_base.h>
#include <build_version.h>
#include <class_board.h>
#include <class_track.h>
#include <pcbplot.h>
#include <pcbnew.h>
#include <gendrill_gerber_writer.h>
#include <wildcards_and_files_ext.h>
#include <reporter.h>
#include <gbr_metadata.h>
#include <class_module.h>

Go to the source code of this file.

Functions

static void convertOblong2Segment (wxSize aSize, double aOrient, wxPoint &aStart, wxPoint &aEnd)
 

Detailed Description

Functions to create drill files in gerber X2 format.

Functions to create the Gerber job file in JSON format.

Definition in file gendrill_gerber_writer.cpp.

Function Documentation

◆ convertOblong2Segment()

void convertOblong2Segment ( wxSize  aSize,
double  aOrient,
wxPoint aStart,
wxPoint aEnd 
)
static

Definition at line 252 of file gendrill_gerber_writer.cpp.

253 {
254  wxSize size( aSize );
255  double orient = aOrient;
256 
257  /* The pad will be drawn as an oblong shape with size.y > size.x
258  * (Oval vertical orientation 0)
259  */
260  if( size.x > size.y )
261  {
262  std::swap( size.x, size.y );
263  orient = AddAngles( orient, 900 );
264  }
265 
266  int deltaxy = size.y - size.x; // distance between centers of the oval
267 
268  int cx = 0;
269  int cy = deltaxy / 2;
270  RotatePoint( &cx, &cy, orient );
271  aStart = wxPoint( cx, cy );
272  cx = 0; cy = -deltaxy / 2;
273  RotatePoint( &cx, &cy, orient );
274  aEnd = wxPoint( cx, cy );
275 }
void RotatePoint(int *pX, int *pY, double angle)
Definition: trigo.cpp:208
T AddAngles(T a1, T2 a2)
Add two angles (keeping the result normalized). T2 is here.
Definition: trigo.h:304

References AddAngles(), and RotatePoint().

Referenced by GERBER_WRITER::createDrillFile().