KiCad PCB EDA Suite
|
#include <cmath>
#include <geometry/geometry_utils.h>
#include <gerbview.h>
#include <gerbview_frame.h>
#include <gerber_file_image.h>
#include <trigo.h>
#include <X2_gerber_attributes.h>
Go to the source code of this file.
Functions | |
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. | |
static void | fillArcPOLY (GERBER_DRAW_ITEM *aGbrItem, const VECTOR2I &aStart, const VECTOR2I &aEnd, const VECTOR2I &rel_center, bool aClockwise, bool aMultiquadrant, bool aLayerNegative) |
Create an arc G code when found in polygon outlines. | |
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().
|
static |
Create an arc G code when found in polygon outlines.
If multiquadrant == true : arc can be 0 to 360 degrees and rel_center is the center coordinate relative to start point. If not multiquadrant, the arc can be only 0 to 90 deg, and only in the same quadrant:
aGbrItem | is the GBRITEM to fill in. |
aStart | is the starting point. |
aEnd | is the ending point. |
rel_center | 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 |
aMultiquadrant | set to true to create arcs up to 360 deg or false when arc is inside one quadrant |
aLayerNegative | set to true if the current layer is negative |
Definition at line 329 of file rs274d.cpp.
References std::abs(), ANGLE_360, SHAPE_POLY_SET::Append(), VECTOR2< T >::EuclideanNorm(), fillArcGBRITEM(), gerbIUScale, GetArcToSegmentCount(), GERBER_DRAW_ITEM::m_ArcCentre, GERBER_DRAW_ITEM::m_End, GERBER_DRAW_ITEM::m_GerberImageFile, GERBER_FILE_IMAGE::m_NetAttributeDict, GERBER_DRAW_ITEM::m_ShapeAsPolygon, GERBER_DRAW_ITEM::m_Start, EDA_IU_SCALE::mmToIU(), SHAPE_POLY_SET::NewOutline(), SHAPE_POLY_SET::OutlineCount(), RotatePoint(), GERBER_DRAW_ITEM::SetLayerPolarity(), and GERBER_DRAW_ITEM::SetNetAttributes().
Referenced by GERBER_FILE_IMAGE::Execute_DCODE_Command().
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().