KiCad PCB EDA Suite
|
Functions to read drill files (EXCELLON format) created by Pcbnew These files use only a subset of EXCELLON commands. More...
#include <math/util.h>
#include <trigo.h>
#include <gerbview.h>
#include <gerbview_frame.h>
#include <gerber_file_image.h>
#include <gerber_file_image_list.h>
#include <excellon_image.h>
#include <excellon_defaults.h>
#include <macros.h>
#include <richio.h>
#include <string_utils.h>
#include <locale_io.h>
#include <X2_gerber_attributes.h>
#include <view/view.h>
#include <gerbview_settings.h>
#include <cmath>
#include <charconv>
#include <dialogs/html_message_box.h>
Go to the source code of this file.
Functions | |
static VECTOR2I | computeCenter (VECTOR2I aStart, VECTOR2I aEnd, int &aRadius, bool aRotCCW) |
int | ReadInt (char *&text, bool aSkipSeparator=true) |
Read an integer from an ASCII character buffer. | |
double | ReadDouble (char *&text, bool aSkipSeparator=true) |
Read a double precision floating point number from an ASCII character buffer. | |
void | fillFlashedGBRITEM (GERBER_DRAW_ITEM *aGbrItem, APERTURE_T aAperture, int Dcode_index, const VECTOR2I &aPos, VECTOR2I aSize, bool aLayerNegative) |
functions to read the rs274d commands from a rs274d/rs274x file | |
void | fillLineGBRITEM (GERBER_DRAW_ITEM *aGbrItem, int Dcode_index, const VECTOR2I &aStart, const VECTOR2I &aEnd, VECTOR2I aPenSize, bool aLayerNegative) |
Initialize a given GBRITEM so that it can draw a linear D code. | |
void | fillArcGBRITEM (GERBER_DRAW_ITEM *aGbrItem, int Dcode_index, const VECTOR2I &aStart, const VECTOR2I &aEnd, const VECTOR2I &aRelCenter, VECTOR2I aPenSize, bool aClockwise, bool aMultiquadrant, bool aLayerNegative) |
Initialize a given GBRITEM so that it can draw an arc G code. | |
Variables | |
static const char | file_attribute [] = ".FileFunction,Other,Drill*" |
static EXCELLON_CMD | excellonHeaderCmdList [] |
static EXCELLON_CMD | excellon_G_CmdList [] |
Functions to read drill files (EXCELLON format) created by Pcbnew These files use only a subset of EXCELLON commands.
Definition in file excellon_read_drill_file.cpp.
|
static |
Definition at line 90 of file excellon_read_drill_file.cpp.
References std::abs(), ANGLE_0, ANGLE_180, ANGLE_360, VECTOR2< T >::EuclideanNorm(), KiROUND(), RotatePoint(), VECTOR2< T >::x, and VECTOR2< T >::y.
Referenced by EXCELLON_IMAGE::FinishRouteCommand().
void fillArcGBRITEM | ( | GERBER_DRAW_ITEM * | aGbrItem, |
int | Dcode_index, | ||
const VECTOR2I & | aStart, | ||
const VECTOR2I & | aEnd, | ||
const VECTOR2I & | aRelCenter, | ||
VECTOR2I | aPenSize, | ||
bool | aClockwise, | ||
bool | aMultiquadrant, | ||
bool | aLayerNegative | ||
) |
Initialize a given GBRITEM so that it can draw an arc G code.
If multiquadrant == true : arc can be 0 to 360 degrees and rel_center is the center coordinate relative to start point.
If multiquadrant == false arc can be only 0 to 90 deg, and only in the same quadrant :
aGbrItem | is the GBRITEM to fill in. |
Dcode_index | is the DCODE value, like D14. |
aStart | is the starting point. |
aEnd | is the ending point. |
aRelCenter | is the center coordinate relative to start point, given in ABSOLUTE VALUE and the sign of values x et y de rel_center must be calculated from the previously given constraint: arc only in the same quadrant. |
aClockwise | true if arc must be created clockwise |
aPenSize | The size of the flash. Note rectangular shapes are legal. |
aMultiquadrant | set to true to create arcs up to 360 degrees, false when arc is inside one quadrant |
aLayerNegative | set to true if the current layer is negative. |
Definition at line 203 of file rs274d.cpp.
References delta, GBR_ARC, GERBER_DRAW_ITEM::m_ArcCentre, GERBER_DRAW_ITEM::m_DCode, GERBER_DRAW_ITEM::m_End, GERBER_DRAW_ITEM::m_Flashed, GERBER_DRAW_ITEM::m_GerberImageFile, GERBER_FILE_IMAGE::m_NetAttributeDict, GERBER_DRAW_ITEM::m_ShapeType, GERBER_DRAW_ITEM::m_Size, GERBER_DRAW_ITEM::m_Start, GERBER_DRAW_ITEM::SetLayerPolarity(), GERBER_DRAW_ITEM::SetNetAttributes(), VECTOR2< T >::x, and VECTOR2< T >::y.
Referenced by GERBER_FILE_IMAGE::Execute_DCODE_Command(), fillArcPOLY(), and EXCELLON_IMAGE::FinishRouteCommand().
void fillFlashedGBRITEM | ( | GERBER_DRAW_ITEM * | aGbrItem, |
APERTURE_T | aAperture, | ||
int | Dcode_index, | ||
const VECTOR2I & | aPos, | ||
VECTOR2I | aSize, | ||
bool | aLayerNegative | ||
) |
functions to read the rs274d commands from a rs274d/rs274x file
Initializes a given GBRITEM so that it can draw a circle which is filled and has no pen border.
aGbrItem | The GBRITEM to fill in. |
aAperture | the associated type of aperture. |
Dcode_index | The DCODE value, like D14. |
aPos | The center point of the flash. |
aSize | The diameter of the round flash. |
aLayerNegative | set to true if the current layer is negative. |
Definition at line 100 of file rs274d.cpp.
References APT_CIRCLE, APT_MACRO, APT_OVAL, APT_POLYGON, APT_RECT, GBR_SPOT_CIRCLE, GBR_SPOT_MACRO, GBR_SPOT_OVAL, GBR_SPOT_POLY, GBR_SPOT_RECT, APERTURE_MACRO::GetApertureMacroShape(), GERBER_DRAW_ITEM::GetDcodeDescr(), D_CODE::GetMacro(), GERBER_DRAW_ITEM::m_DCode, GERBER_DRAW_ITEM::m_End, GERBER_DRAW_ITEM::m_Flashed, GERBER_DRAW_ITEM::m_GerberImageFile, GERBER_FILE_IMAGE::m_NetAttributeDict, GERBER_DRAW_ITEM::m_ShapeType, GERBER_DRAW_ITEM::m_Size, GERBER_DRAW_ITEM::m_Start, GERBER_DRAW_ITEM::SetLayerPolarity(), GERBER_DRAW_ITEM::SetNetAttributes(), VECTOR2< T >::x, and VECTOR2< T >::y.
Referenced by GERBER_FILE_IMAGE::Execute_DCODE_Command(), and EXCELLON_IMAGE::Execute_Drill_Command().
void fillLineGBRITEM | ( | GERBER_DRAW_ITEM * | aGbrItem, |
int | Dcode_index, | ||
const VECTOR2I & | aStart, | ||
const VECTOR2I & | aEnd, | ||
VECTOR2I | aPenSize, | ||
bool | aLayerNegative | ||
) |
Initialize a given GBRITEM so that it can draw a linear D code.
aGbrItem | The GERBER_DRAW_ITEM to fill in. |
Dcode_index | The DCODE value, like D14. |
aStart | The starting point of the line. |
aEnd | The ending point of the line. |
aPenSize | The size of the flash. Note rectangular shapes are legal. |
aLayerNegative | set to true if the current layer is negative. |
Definition at line 154 of file rs274d.cpp.
References GERBER_DRAW_ITEM::m_DCode, GERBER_DRAW_ITEM::m_End, GERBER_DRAW_ITEM::m_Flashed, GERBER_DRAW_ITEM::m_GerberImageFile, GERBER_FILE_IMAGE::m_NetAttributeDict, GERBER_DRAW_ITEM::m_Size, GERBER_DRAW_ITEM::m_Start, GERBER_DRAW_ITEM::SetLayerPolarity(), and GERBER_DRAW_ITEM::SetNetAttributes().
Referenced by GERBER_FILE_IMAGE::Execute_DCODE_Command(), EXCELLON_IMAGE::Execute_Drill_Command(), and EXCELLON_IMAGE::FinishRouteCommand().
double ReadDouble | ( | char *& | text, |
bool | aSkipSeparator = true |
||
) |
Read a double precision floating point number from an ASCII character buffer.
If there is a comma after the number, then skip over that.
text | is a reference to a character pointer from which the ASCII double is read from and the pointer advanced for each character read. |
aSkipSeparator | set to true (default) to skip comma. |
Definition at line 303 of file rs274_read_XY_and_IJ_coordinates.cpp.
int ReadInt | ( | char *& | text, |
bool | aSkipSeparator = true |
||
) |
Read an integer from an ASCII character buffer.
If there is a comma after the integer, then skip over that.
text | is a reference to a character pointer from which bytes are read and the pointer is advanced for each byte read. |
aSkipSeparator | set to true (default) to skip comma. |
Definition at line 266 of file rs274_read_XY_and_IJ_coordinates.cpp.
|
static |
Definition at line 233 of file excellon_read_drill_file.cpp.
Referenced by EXCELLON_IMAGE::Execute_EXCELLON_G_Command().
|
static |
Definition at line 195 of file excellon_read_drill_file.cpp.
Referenced by EXCELLON_IMAGE::Execute_HEADER_And_M_Command().
|
static |
Definition at line 193 of file excellon_read_drill_file.cpp.
Referenced by EXCELLON_IMAGE::LoadFile().