50 #define GBR_USE_MACROS_FOR_CHAMFERED_ROUND_RECT 51 #define GBR_USE_MACROS_FOR_CHAMFERED_RECT 52 #define GBR_USE_MACROS_FOR_ROUNDRECT 53 #define GBR_USE_MACROS_FOR_TRAPEZOID 54 #define GBR_USE_MACROS_FOR_ROTATED_OVAL 55 #define GBR_USE_MACROS_FOR_ROTATED_RECT 56 #define GBR_USE_MACROS_FOR_CUSTOM_PAD 65 #define GBR_MACRO_FOR_CUSTOM_PAD_MAX_CORNER_COUNT 4990 66 #define AM_FREEPOLY_BASENAME "FreePoly" 72 static bool polyCompare(
const std::vector<wxPoint>& aPolygon,
73 const std::vector<wxPoint>& aTestPolygon )
76 if( aTestPolygon.size() != aPolygon.size() )
81 for(
size_t jj = 0; jj < aPolygon.size(); jj++ )
83 if( std::abs( aPolygon[jj].x - aTestPolygon[jj].x ) > margin ||
84 std::abs( aPolygon[jj].y - aTestPolygon[jj].y ) > margin )
123 double aScale,
bool aMirror )
125 wxASSERT( aMirror ==
false );
128 wxASSERT( aScale == 1 );
217 std::string short_attribute_string;
220 aData, clearDict, useX1StructuredComment ) )
226 if( !short_attribute_string.empty() )
275 "G04 Gerber Fmt %d.%d, Leading zero omitted, Abs format (unit %s)*\n",
283 wxDateTime date = wxDateTime::Now();
284 fprintf(
m_outputFile,
"G04 Created by KiCad (%s) date %s*\n",
331 while( fgets( line, 1024,
workFile ) )
335 char* substr = strtok( line,
"\n\r" );
337 if( substr && strcmp( substr,
"G04 APERTURE LIST*" ) == 0 )
378 fputs(
"G04 Aperture macros list end*\n",
m_outputFile );
402 wxASSERT_MSG( aWidth >= 0,
"Plotter called to set negative pen width" );
404 GBR_METADATA* gbr_metadata = static_cast<GBR_METADATA*>( aData );
418 for(
int idx = 0; idx < (int)
m_apertures.size(); ++idx )
423 if( (tool->
m_Type == aType) && (tool->
m_Size == aSize) &&
435 new_tool.
m_DCode = last_D_code + 1;
461 for(
int idx = 0; idx < (int)
m_apertures.size(); ++idx )
467 if( (tool->
m_Type == aType) &&
468 (tool->
m_Corners.size() == aCorners.size() ) &&
484 new_tool.
m_Size = wxSize( 0, 0 );
488 new_tool.
m_DCode = last_D_code + 1;
499 int aApertureAttribute )
514 aType, aApertureAttribute );
530 for(
size_t ii = 0; ii < aCorners.size(); ii++ )
547 aType, aApertureAttribute );
560 wxASSERT( aType>= APERTURE::APERTURE_TYPE::AT_REGULAR_POLY3 &&
561 aType <= APERTURE::APERTURE_TYPE::AT_REGULAR_POLY12 );
563 wxSize size( aDiameter, (
int)( aPolygonRotation * 1000.0 ) );
564 selectAperture( wxSize( 0, 0), aDiameter/2, aPolygonRotation, aType, aApertureAttribute );
573 bool useX1StructuredComment =
false;
576 useX1StructuredComment =
true;
588 int attribute = tool.m_ApertureAttribute;
597 sprintf( cbuf,
"%%ADD%d", tool.m_DCode );
607 switch( tool.m_Type )
610 sprintf( cbuf,
"C,%#f*%%\n", tool.GetDiameter() * fscale );
614 sprintf( cbuf,
"R,%#fX%#f*%%\n", tool.m_Size.x * fscale,
615 tool.m_Size.y * fscale );
619 sprintf( cbuf,
"C,%#f*%%\n", tool.m_Size.x * fscale );
623 sprintf( cbuf,
"O,%#fX%#f*%%\n", tool.m_Size.x * fscale,
624 tool.m_Size.y * fscale );
638 sprintf( cbuf,
"P,%#fX%dX%#f*%%\n", tool.GetDiameter() * fscale,
639 tool.GetRegPolyVerticeCount(), tool.GetRotation() );
645 std::vector<VECTOR2I> corners;
646 wxSize half_size( tool.m_Size.x/2-tool.m_Radius, tool.m_Size.y/2-tool.m_Radius );
648 corners.emplace_back( -half_size.x, -half_size.y );
649 corners.emplace_back( half_size.x, -half_size.y );
650 corners.emplace_back( half_size.x, half_size.y );
651 corners.emplace_back( -half_size.x, half_size.y );
654 for(
int ii = 0; ii < 4; ii++ )
658 tool.m_Radius * fscale );
662 for(
int ii = 0; ii < 4; ii++ )
664 sprintf( cbuf,
"%#fX%#fX",
665 corners[ii].x * fscale, corners[ii].y * fscale );
669 sprintf( cbuf,
"0*%%\n" );
675 tool.m_Size.x * fscale, tool.m_Size.y * fscale,
684 switch( tool.m_Type )
705 for(
size_t ii = 0; ii < tool.m_Corners.size(); ii++ )
707 sprintf( cbuf,
"%#fX%#fX",
708 tool.m_Corners[ii].x * fscale, -tool.m_Corners[ii].y * fscale );
713 sprintf( cbuf,
"%#f*%%\n", tool.m_Rotation );
722 int seg_len = tool.m_Size.x - tool.m_Size.y;
732 tool.m_Size.y * fscale,
733 start.
x * fscale, -start.
y * fscale,
734 end.
x * fscale, -end.
y * fscale );
796 std::vector< wxPoint > cornerList;
799 cornerList.push_back( p1 );
800 wxPoint corner(p1.x, p2.y);
801 cornerList.push_back( corner );
802 cornerList.push_back( p2 );
805 cornerList.push_back( corner );
806 cornerList.push_back( p1 );
808 PlotPoly( cornerList, fill, width );
814 Arc( aCenter, 0, 3600, aDiameter / 2, aFill, aWidth );
819 int aRadius,
FILL_TYPE aFill,
int aWidth )
824 plotArc( aCenter, aStAngle, aEndAngle, aRadius,
false );
829 int aRadius,
bool aPlotInRegion )
847 if( aStAngle < aEndAngle )
863 if( aCornerList.size() <= 2 )
866 GBR_METADATA* gbr_metadata = static_cast<GBR_METADATA*>( aData );
868 bool clearTA_AperFunction =
false;
874 if( !attrib.empty() )
877 clearTA_AperFunction =
true;
884 if( clearTA_AperFunction )
898 FILL_TYPE aFill,
int aWidth,
void * aData )
900 if( aCornerList.size() <= 1 )
906 GBR_METADATA* gbr_metadata = static_cast<GBR_METADATA*>( aData );
918 for(
unsigned ii = 1; ii < aCornerList.size(); ii++ )
919 LineTo( aCornerList[ii] );
922 if( aCornerList[0] != aCornerList[aCornerList.size()-1] )
934 for(
unsigned ii = 1; ii < aCornerList.size(); ii++ )
935 LineTo( aCornerList[ii] );
939 if( aFill !=
FILL_TYPE::NO_FILL &&( aCornerList[aCornerList.size() - 1] != aCornerList[0] ) )
952 GBR_METADATA *gbr_metadata = static_cast<GBR_METADATA*>( aData );
969 int radius,
int width,
OUTLINE_MODE tracemode,
void* aData )
971 GBR_METADATA *gbr_metadata = static_cast<GBR_METADATA*>( aData );
982 Arc( centre, StAngle, EndAngle,
994 GBR_METADATA *gbr_metadata = static_cast<GBR_METADATA*>( aData );
1000 if( tracemode ==
FILLED )
1022 GBR_METADATA *gbr_metadata = static_cast<GBR_METADATA*>( aData );
1028 if( tracemode ==
FILLED )
1046 GBR_METADATA *gbr_metadata = static_cast<GBR_METADATA*>( aData );
1051 if( tracemode ==
FILLED )
1068 wxSize size( diametre, diametre );
1069 GBR_METADATA* gbr_metadata = static_cast<GBR_METADATA*>( aData );
1071 if( trace_mode ==
SKETCH )
1099 wxSize size( aSize );
1100 GBR_METADATA* gbr_metadata = static_cast<GBR_METADATA*>( aData );
1103 if( ( orient == 0 || orient == 900 || orient == 1800 || orient == 2700 )
1104 && trace_mode ==
FILLED )
1106 if( orient == 900 || orient == 2700 )
1107 std::swap( size.x, size.y );
1121 if( trace_mode ==
FILLED )
1123 #ifdef GBR_USE_MACROS_FOR_ROTATED_OVAL 1131 if( size.x < size.y )
1133 std::swap( size.x, size.y );
1158 if( size.x > size.y )
1160 std::swap( size.x, size.y );
1179 wxSize size( aSize );
1180 GBR_METADATA* gbr_metadata = static_cast<GBR_METADATA*>( aData );
1183 switch(
int( orient ) )
1187 std::swap( size.x, size.y );
1192 if( trace_mode ==
SKETCH )
1218 #ifdef GBR_USE_MACROS_FOR_ROTATED_RECT 1242 coord[0].x = -size.x/2;
1243 coord[0].y = size.y/2;
1244 coord[1].x = -size.x/2;
1245 coord[1].y = -size.y/2;
1246 coord[2].x = size.x/2;
1247 coord[2].y = -size.y/2;
1248 coord[3].x = size.x/2;
1249 coord[3].y = size.y/2;
1258 int aCornerRadius,
double aOrient,
1262 GBR_METADATA* gbr_metadata = static_cast<GBR_METADATA*>( aData );
1264 if( aTraceMode !=
FILLED )
1273 std::vector< wxPoint > cornerList;
1278 for(
int ii = 0; ii < poly.
PointCount(); ++ii )
1279 cornerList.emplace_back( poly.
CPoint( ii ).
x, poly.
CPoint( ii ).
y );
1282 cornerList.push_back( cornerList[0] );
1289 #ifdef GBR_USE_MACROS_FOR_ROUNDRECT 1308 bool clearTA_AperFunction =
false;
1315 if( !attrib.empty() )
1318 clearTA_AperFunction =
true;
1326 if( clearTA_AperFunction )
1338 int aCornerRadius,
double aOrient )
1356 double m_arc_angle_start;
1359 const double arc_angle = -900.0;
1360 int hsizeX = aSize.x/2;
1361 int hsizeY = aSize.y/2;
1364 std::vector<RR_EDGE> rr_outline;
1369 curr_edge.m_start.x = -hsizeX;
1370 curr_edge.m_start.y = hsizeY - aCornerRadius;
1371 curr_edge.m_end.x = curr_edge.m_start.x;
1372 curr_edge.m_end.y = -hsizeY + aCornerRadius;
1373 curr_edge.m_center.x = -hsizeX + aCornerRadius;
1374 curr_edge.m_center.y = curr_edge.m_end.y;
1375 curr_edge.m_arc_angle_start = aOrient + 1800.0;
1377 rr_outline.push_back( curr_edge );
1380 curr_edge.m_start.x = -hsizeX + aCornerRadius;
1381 curr_edge.m_start.y = -hsizeY;
1382 curr_edge.m_end.x = hsizeX - aCornerRadius;
1383 curr_edge.m_end.y = curr_edge.m_start.y;
1384 curr_edge.m_center.x = curr_edge.m_end.x;
1385 curr_edge.m_center.y = -hsizeY + aCornerRadius;
1386 curr_edge.m_arc_angle_start = aOrient + 900.0;
1388 rr_outline.push_back( curr_edge );
1391 curr_edge.m_start.x = hsizeX;
1392 curr_edge.m_start.y = -hsizeY + aCornerRadius;
1393 curr_edge.m_end.x = curr_edge.m_start.x;
1394 curr_edge.m_end.y = hsizeY - aCornerRadius;
1395 curr_edge.m_center.x = hsizeX - aCornerRadius;
1396 curr_edge.m_center.y = curr_edge.m_end.y;
1397 curr_edge.m_arc_angle_start = aOrient + 0.0;
1399 rr_outline.push_back( curr_edge );
1402 curr_edge.m_start.x = hsizeX - aCornerRadius;
1403 curr_edge.m_start.y = hsizeY;
1404 curr_edge.m_end.x = -hsizeX + aCornerRadius;
1405 curr_edge.m_end.y = curr_edge.m_start.y;
1406 curr_edge.m_center.x = curr_edge.m_end.x;
1407 curr_edge.m_center.y = hsizeY - aCornerRadius;
1408 curr_edge.m_arc_angle_start = aOrient - 900.0;
1410 rr_outline.push_back( curr_edge );
1413 wxPoint arc_last_center;
1414 int arc_last_angle = curr_edge.m_arc_angle_start+arc_angle;
1416 for( RR_EDGE& rr_edge: rr_outline )
1421 rr_edge.m_start += aRectCenter;
1422 rr_edge.m_end += aRectCenter;
1423 rr_edge.m_center += aRectCenter;
1424 arc_last_center = rr_edge.m_center;
1432 last_pt.x = arc_last_center.x +
KiROUND(
cosdecideg( aCornerRadius, arc_last_angle ) );
1433 last_pt.y = arc_last_center.y -
KiROUND(
sindecideg( aCornerRadius, arc_last_angle ) );
1435 wxPoint first_pt = rr_outline[0].m_start;
1437 #if 0 // For test only: 1438 if( last_pt != first_pt )
1439 wxLogMessage(
"first pt %d %d last pt %d %d",
1440 first_pt.x, first_pt.y, last_pt.x, last_pt.y );
1448 for( RR_EDGE& rr_edge: rr_outline )
1454 rr_edge.m_arc_angle_start, rr_edge.m_arc_angle_start+arc_angle,
1455 aCornerRadius,
true );
1474 gbr_metadata = *static_cast<GBR_METADATA*>( aData );
1478 if( aTraceMode !=
FILLED )
1484 std::vector< wxPoint > cornerList;
1486 for(
int cnt = 0; cnt < polyshape.
OutlineCount(); ++cnt )
1492 for(
int ii = 0; ii < poly.
PointCount(); ++ii )
1493 cornerList.emplace_back( poly.
CPoint( ii ).
x, poly.
CPoint( ii ).
y );
1496 cornerList.push_back( cornerList[0] );
1498 if( aTraceMode ==
SKETCH )
1502 #ifdef GBR_USE_MACROS_FOR_CUSTOM_PAD 1510 for(
size_t ii = 0; ii < cornerList.size(); ii++ )
1512 cornerList[ii] -= aPadPos;
1532 int aCornerRadius,
double aChamferRatio,
1533 int aChamferPositions,
1534 double aPadOrient,
OUTLINE_MODE aPlotMode,
void* aData )
1540 gbr_metadata = *static_cast<GBR_METADATA*>( aData );
1546 std::vector<wxPoint> cornerList;
1548 bool hasRoundedCorner = aCornerRadius != 0 && aChamferPositions != 15;
1550 #ifdef GBR_USE_MACROS_FOR_CHAMFERED_RECT 1556 aCornerRadius, aChamferRatio, aChamferPositions,
1562 for(
int ii = 0; ii < corners.
PointCount(); ii++ )
1563 cornerList.emplace_back( corners.
CPoint( ii ).
x, corners.
CPoint( ii ).
y );
1566 cornerList.push_back( cornerList[0] );
1568 if( aPlotMode ==
SKETCH )
1572 #ifdef GBR_USE_MACROS_FOR_CHAMFERED_ROUND_RECT 1579 for(
size_t ii = 0; ii < cornerList.size(); ii++ )
1581 cornerList[ii] -= aShapePos;
1601 aChamferRatio, aChamferPositions,
1608 for(
int ii = 0; ii < corners.
PointCount(); ii++ )
1609 cornerList.emplace_back( corners.
CPoint( ii ).
x, corners.
CPoint( ii ).
y );
1611 switch( cornerList.size() )
1644 wxLogMessage(
"FlashPadChamferRoundRect(): Unexpected number of corners (%d)",
1645 (
int)cornerList.size() );
1656 double aPadOrient,
OUTLINE_MODE aTrace_Mode,
void* aData )
1660 std::vector<wxPoint> cornerList = { aCorners[0], aCorners[1], aCorners[2], aCorners[3] };
1663 for(
unsigned ii = 0; ii < 4; ii++ )
1666 cornerList[ii] += aPadPos;
1670 cornerList.push_back( cornerList[0] );
1671 GBR_METADATA* gbr_metadata = static_cast<GBR_METADATA*>( aData );
1676 metadata = *gbr_metadata;
1678 if( aTrace_Mode ==
SKETCH )
1685 #ifdef GBR_USE_MACROS_FOR_TRAPEZOID 1692 std::vector<wxPoint> corners = { aCorners[0], aCorners[1], aCorners[2], aCorners[3] };
1708 int aDiameter,
int aCornerCount,
1712 GBR_METADATA* gbr_metadata = static_cast<GBR_METADATA*>( aData );
1717 metadata = *gbr_metadata;
1719 if( aTraceMode ==
SKETCH )
1722 std::vector< wxPoint > cornerList;
1724 double angle_delta = 3600.0 / aCornerCount;
1726 for(
int ii = 0; ii < aCornerCount; ii++ )
1728 double rot = aOrient + (angle_delta*ii);
1729 wxPoint vertice( aDiameter/2, 0 );
1731 vertice += aShapePos;
1732 cornerList.push_back( vertice );
1735 cornerList.push_back( cornerList[0] );
1747 selectAperture( aDiameter, aOrient, apert_type, aperture_attrib );
1758 const wxString& aText,
double aOrient,
const wxSize& aSize,
1761 bool aBold,
bool aMultilineAllowed,
void* aData )
1763 GBR_METADATA* gbr_metadata = static_cast<GBR_METADATA*>( aData );
1768 PLOTTER::Text( aPos, aColor, aText, aOrient, aSize, aH_justify, aV_justify, aWidth, aItalic,
1769 aBold, aMultilineAllowed, aData );
1792 fprintf( aOutput,
"4,1,%d,", (
int)
m_Corners.size() );
1795 int curr_line_corner_count = 0;
1796 const int curr_line_count_max = 20;
1798 for(
size_t ii = 0; ii <=
m_Corners.size(); ii++ )
1806 fprintf( aOutput,
"%#f,%#f,",
1809 if( curr_line_count_max >= 0
1810 && ++curr_line_corner_count >= curr_line_count_max )
1812 fprintf( aOutput,
"\n" );
1813 curr_line_corner_count = 0;
1818 fputs(
"$1*%\n", aOutput );
1824 for(
int idx = 0; idx <
AmCount(); idx++ )
1837 for(
int idx = 0; idx <
AmCount(); idx++ )
1839 if(
m_AMList[idx].IsSamePoly( aPolygon ) )
void segmentAsOval(const wxPoint &start, const wxPoint &end, int width, OUTLINE_MODE tracemode)
Convert a thick segment and plot it as an oval.
virtual void FlashRegularPolygon(const wxPoint &aShapePos, int aDiameter, int aCornerCount, double aOrient, OUTLINE_MODE aTraceMode, void *aData) override
Flash a regular polygon.
void FinishTo(const wxPoint &pos)
#define APER_MACRO_ROUNDRECT_NAME
#define APER_MACRO_ROT_RECT_HEADER
specialized plotter for GERBER files format
void writeApertureList()
Generate the table of D codes.
void clearNetAttribute()
clear a Gerber net attribute record (clear object attribute dictionary) and output the clear object a...
virtual void PenTo(const wxPoint &pos, char plume) override
moveto/lineto primitive, moves the 'pen' to the specified direction
int OutlineCount() const
Return the number of vertices in a given outline/hole.
void plotRoundRectAsRegion(const wxPoint &aRectCenter, const wxSize &aSize, int aCornerRadius, double aOrient)
Plot a round rect (a round rect shape in fact) as a Gerber region using lines and arcs for corners.
FILL_TYPE
The set of fill types used in plotting or drawing enclosed areas.
virtual void SetLayerPolarity(bool aPositive) override
Change the plot polarity and begin a new layer Used to 'scratch off' silk screen away from solder mas...
virtual void EndBlock(void *aData) override
calling this function allows one to define the end of a group of drawing items the group is started b...
bool m_hasApertureChamferedRect
virtual void ThickSegment(const wxPoint &start, const wxPoint &end, int width, OUTLINE_MODE tracemode, void *aData) override
void FlashPadChamferRoundRect(const wxPoint &aShapePos, const wxSize &aPadSize, int aCornerRadius, double aChamferRatio, int aChamferPositions, double aPadOrient, OUTLINE_MODE aPlotMode, void *aData)
flash a chamfered round rect pad.
#define APER_MACRO_SHAPE_OVAL_NAME
void formatNetAttribute(GBR_NETLIST_METADATA *aData)
print a Gerber net attribute object record.
virtual void FlashPadTrapez(const wxPoint &aPadPos, const wxPoint *aCorners, double aPadOrient, OUTLINE_MODE aTraceMode, void *aData) override
Flash a trapezoidal pad.
bool m_hasApertureRotOval
static bool polyCompare(const std::vector< wxPoint > &aPolygon, const std::vector< wxPoint > &aTestPolygon)
FILE * m_outputFile
Output file.
void TransformRoundChamferedRectToPolygon(SHAPE_POLY_SET &aCornerBuffer, const wxPoint &aPosition, const wxSize &aSize, double aRotation, int aCornerRadius, double aChamferRatio, int aChamferCorners, int aError, ERROR_LOC aErrorLoc)
convert a rectangle with rounded corners and/or chamfered corners to a polygon Convert rounded corner...
void plotArc(const wxPoint &aCenter, double aStAngle, double aEndAngle, int aRadius, bool aPlotInRegion)
Plot a Gerber arc.
virtual void ThickArc(const wxPoint ¢re, double StAngle, double EndAngle, int rayon, int width, OUTLINE_MODE tracemode, void *aData) override
#define KI_FALLTHROUGH
The KI_FALLTHROUGH macro is to be used when switch statement cases should purposely fallthrough from ...
#define APER_MACRO_OUTLINE7P_NAME
APER_MACRO_FREEPOLY_LIST m_am_freepoly_list
void RotatePoint(int *pX, int *pY, double angle)
void Inflate(int aAmount, int aCircleSegmentsCount, CORNER_STRATEGY aCornerStrategy=ROUND_ALL_CORNERS)
Perform outline inflation/deflation.
int PointCount() const
Function PointCount()
wxArrayString m_headerExtraLines
virtual void FlashPadRect(const wxPoint &aPadPos, const wxSize &size, double orient, OUTLINE_MODE trace_mode, void *aData) override
#define APER_MACRO_OUTLINE6P_HEADER
bool m_hasApertureOutline4P
virtual bool StartPlot() override
Function StartPlot Write GERBER header to file initialize global variable g_Plot_PlotOutputFile.
void Append(const std::vector< wxPoint > &aPolygon)
append a new APER_MACRO_FREEPOLY containing the polygon aPolygon to the current list
This file contains miscellaneous commonly used macros and functions.
virtual void Text(const wxPoint &aPos, const COLOR4D aColor, const wxString &aText, double aOrient, const wxSize &aSize, enum EDA_TEXT_HJUSTIFY_T aH_justify, enum EDA_TEXT_VJUSTIFY_T aV_justify, int aWidth, bool aItalic, bool aBold, bool aMultilineAllowed=false, void *aData=NULL)
Draws text with the plotter.
bool m_hasApertureRoundRect
double m_plotScale
Plot scale - chosen by the user (even implicitly with 'fit in a4')
virtual void Text(const wxPoint &aPos, const COLOR4D aColor, const wxString &aText, double aOrient, const wxSize &aSize, enum EDA_TEXT_HJUSTIFY_T aH_justify, enum EDA_TEXT_VJUSTIFY_T aV_justify, int aWidth, bool aItalic, bool aBold, bool aMultilineAllowed=false, void *aData=NULL) override
Draws text with the plotter.
virtual int GetCurrentLineWidth() const
#define TO_UTF8(wxstring)
Convert a wxString to a UTF8 encoded C string for all wxWidgets build modes.
virtual void PlotPoly(const std::vector< wxPoint > &aCornerList, FILL_TYPE aFill, int aWidth=USE_DEFAULT_LINE_WIDTH, void *aData=nullptr) override
Gerber polygon: they can (and should) be filled with the appropriate G36/G37 sequence.
const VECTOR2I & CPoint(int aIndex) const
Function Point()
virtual void FlashPadCustom(const wxPoint &aPadPos, const wxSize &aSize, double aPadOrient, SHAPE_POLY_SET *aPolygons, OUTLINE_MODE aTraceMode, void *aData) override
void LineTo(const wxPoint &pos)
static const int USE_DEFAULT_LINE_WIDTH
std::vector< APERTURE > m_apertures
#define APER_MACRO_SHAPE_OVAL_HEADER
#define APER_MACRO_OUTLINE5P_HEADER
virtual void Arc(const wxPoint &aCenter, double aStAngle, double aEndAngle, int aRadius, FILL_TYPE aFill, int aWidth=USE_DEFAULT_LINE_WIDTH) override
Generic fallback: arc rendered as a polyline.
void ClearAllAttributes()
Remove (clear) all attributes from object attributes dictionary (TO.
virtual void SetCurrentLineWidth(int width, void *aData=NULL) override
Set the line width for the next drawing.
wxString GetBuildVersion()
Get the full KiCad version string.
virtual void FlashPadRoundRect(const wxPoint &aPadPos, const wxSize &aSize, int aCornerRadius, double aOrient, OUTLINE_MODE aTraceMode, void *aData) override
virtual void ThickCircle(const wxPoint &pos, int diametre, int width, OUTLINE_MODE tracemode, void *aData) override
Represent a set of closed polygons.
SHAPE_LINE_CHAIN & Outline(int aIndex)
virtual void Circle(const wxPoint &pos, int diametre, FILL_TYPE fill, int width=USE_DEFAULT_LINE_WIDTH) override
std::vector< wxPoint > m_Corners
Base window classes and related definitions.
virtual void SetViewport(const wxPoint &aOffset, double aIusPerDecimil, double aScale, bool aMirror) override
Set the plot offset and scaling for the current plot.
#define APER_MACRO_ROUNDRECT_HEADER
#define APER_MACRO_OUTLINE5P_NAME
RENDER_SETTINGS * m_renderSettings
#define APER_MACRO_OUTLINE8P_NAME
virtual void FlashPadOval(const wxPoint &aPadPos, const wxSize &size, double orient, OUTLINE_MODE trace_mode, void *aData) override
#define APER_MACRO_ROT_RECT_NAME
void emitDcode(const DPOINT &pt, int dcode)
Emit a D-Code record, using proper conversions to format a leading zero omitted gerber coordinate (fo...
std::vector< APER_MACRO_FREEPOLY > m_AMList
#define AM_FREEPOLY_BASENAME
bool m_hasApertureRotRect
void selectAperture(const wxSize &aSize, int aRadius, double aRotDegree, APERTURE::APERTURE_TYPE aType, int aApertureAttribute)
Pick an existing aperture or create a new one, matching the size, type and attributes.
void MoveTo(const wxPoint &pos)
virtual DPOINT userToDeviceCoordinates(const wxPoint &aCoordinate)
Modifies coordinates according to the orientation, scale factor, and offsets trace.
double cosdecideg(double r, double a)
Circle generation utility: computes r * cos(a) Where a is in decidegrees, not in radians.
#define APER_MACRO_OUTLINE4P_NAME
virtual void ThickRect(const wxPoint &p1, const wxPoint &p2, int width, OUTLINE_MODE tracemode, void *aData) override
#define APER_MACRO_OUTLINE7P_HEADER
double sindecideg(double r, double a)
Circle generation utility: computes r * sin(a) Where a is in decidegrees, not in radians.
std::vector< wxPoint > m_Corners
virtual void StartBlock(void *aData) override
calling this function allows one to define the beginning of a group of drawing items (used in X2 form...
int FindAm(const std::vector< wxPoint > &aPolygon) const
int GetOrCreateAperture(const wxSize &aSize, int aRadius, double aRotDegree, APERTURE::APERTURE_TYPE aType, int aApertureAttribute)
#define APER_MACRO_OUTLINE6P_NAME
virtual void Rect(const wxPoint &p1, const wxPoint &p2, FILL_TYPE fill, int width=USE_DEFAULT_LINE_WIDTH) override
void PlotGerberRegion(const std::vector< wxPoint > &aCornerList, void *aData=NULL)
Plot a Gerber region: similar to PlotPoly but plot only filled polygon, and add the TA....
virtual bool EndPlot() override
#define APER_MACRO_OUTLINE4P_HEADER
void Format(FILE *aOutput, double aIu2GbrMacroUnit)
print the aperture macro definition to aOutput
#define GBR_MACRO_FOR_CUSTOM_PAD_MAX_CORNER_COUNT
std::string m_objectAttributesDictionnary
constexpr ret_type KiROUND(fp_type v)
Round a floating point number to an integer using "round halfway cases away from zero".
int GetPlotterArcHighDef() const
virtual void SetGerberCoordinatesFormat(int aResolution, bool aUseInches=false) override
Function SetGerberCoordinatesFormat selection of Gerber units and resolution (number of digits in man...
int GetDefaultPenWidth() const
#define APER_MACRO_OUTLINE8P_HEADER
virtual void FlashPadCircle(const wxPoint &pos, int diametre, OUTLINE_MODE trace_mode, void *aData) override
Filled circular flashes are stored as apertures.
void Format(FILE *aOutput, double aIu2GbrMacroUnit)
print the aperture macro list to aOutput
virtual void FilledCircle(const wxPoint &pos, int diametre, OUTLINE_MODE tracemode, void *aData) override
void SetDefaultPenWidth(int aWidth)
bool m_gerberDisableApertMacros
bool IsSamePoly(const std::vector< wxPoint > &aPolygon) const
static const int DO_NOT_SET_LINE_WIDTH
void sketchOval(const wxPoint &pos, const wxSize &size, double orient, int width)
A color representation with 4 components: red, green, blue, alpha.