KiCad PCB EDA Suite
rs274d.cpp
Go to the documentation of this file.
1 
6 /*
7  * This program source code file is part of KiCad, a free EDA CAD application.
8  *
9  * Copyright (C) 1992-2018 KiCad Developers, see AUTHORS.txt for contributors.
10  *
11  * This program is free software; you can redistribute it and/or
12  * modify it under the terms of the GNU General Public License
13  * as published by the Free Software Foundation; either version 2
14  * of the License, or (at your option) any later version.
15  *
16  * This program is distributed in the hope that it will be useful,
17  * but WITHOUT ANY WARRANTY; without even the implied warranty of
18  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19  * GNU General Public License for more details.
20  *
21  * You should have received a copy of the GNU General Public License
22  * along with this program; if not, you may find one here:
23  * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
24  * or you may search the http://www.gnu.org website for the version 2 license,
25  * or you may write to the Free Software Foundation, Inc.,
26  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
27  */
28 
29 #include <fctsys.h>
30 #include <common.h>
31 
32 #include <gerbview.h>
33 #include <gerbview_frame.h>
34 #include <trigo.h>
35 #include <gerber_file_image.h>
36 #include <X2_gerber_attributes.h>
37 
38 #include <cmath>
39 
40 /* Gerber: NOTES about some important commands found in RS274D and RS274X (G codes).
41  * Some are now deprecated, but deprecated commands must be known by the Gerber reader
42  * Gn =
43  * G01 linear interpolation (linear trace)
44  * G02, G20, G21 Circular interpolation, clockwise
45  * G03, G30, G31 Circular interpolation, counterclockwise
46  * G04 = comment. Since Sept 2014, file attributes and other X2 attributes can be found here
47  * if the line starts by G04 #@!
48  * G06 parabolic interpolation
49  * G07 Cubic Interpolation
50  * G10 linear interpolation (scale x10)
51  * G11 linear interpolation (0.1x range)
52  * G12 linear interpolation (0.01x scale)
53  * G36 Start polygon mode (called a region, because the "polygon" can include arcs)
54  * G37 Stop polygon mode (and close it)
55  * G54 Selection Tool (outdated)
56  * G60 linear interpolation (scale x100)
57  * G70 Select Units = Inches
58  * G71 Select Units = Millimeters
59  * G74 enable 90 deg mode for arcs (CW or CCW)
60  * G75 enable 360 degrees for arcs (CW or CCW)
61  * G90 mode absolute coordinates
62  *
63  * X, Y
64  * X and Y are followed by + or - and m + n digits (not separated)
65  * m = integer part
66  * n = part after the comma
67  * Classic formats: m = 2, n = 3 (size 2.3)
68  * m = 3, n = 4 (size 3.4)
69  * eg
70  * GxxX00345Y-06123*
71  *
72  * Tools and D_CODES
73  * Tool number (identification of shapes)
74  * 10 to 999
75  * D_CODES:
76  * D01 ... D9 = command codes:
77  * D01 = activating light (pen down) when placement
78  * D02 = light extinction (pen up) when placement
79  * D03 = Flash
80  * D09 = VAPE Flash (I never see this command in gerber file)
81  * D51 = G54 preceded by -> Select VAPE
82  *
83  * D10 ... D999 = Identification Tool: tool selection
84  */
85 
86 
87 /* Local Functions (are lower case since they are private to this source file)
88 **/
89 
90 
104  APERTURE_T aAperture,
105  int Dcode_index,
106  const wxPoint& aPos,
107  wxSize aSize,
108  bool aLayerNegative )
109 {
110  aGbrItem->m_Size = aSize;
111  aGbrItem->m_Start = aPos;
112  aGbrItem->m_End = aGbrItem->m_Start;
113  aGbrItem->m_DCode = Dcode_index;
114  aGbrItem->SetLayerPolarity( aLayerNegative );
115  aGbrItem->m_Flashed = true;
116  aGbrItem->SetNetAttributes( aGbrItem->m_GerberImageFile->m_NetAttributeDict );
117 
118  switch( aAperture )
119  {
120  case APT_POLYGON: // flashed regular polygon
121  aGbrItem->m_Shape = GBR_SPOT_POLY;
122  break;
123 
124  case APT_CIRCLE:
125  aGbrItem->m_Shape = GBR_SPOT_CIRCLE;
126  aGbrItem->m_Size.y = aGbrItem->m_Size.x;
127  break;
128 
129  case APT_OVAL:
130  aGbrItem->m_Shape = GBR_SPOT_OVAL;
131  break;
132 
133  case APT_RECT:
134  aGbrItem->m_Shape = GBR_SPOT_RECT;
135  break;
136 
137  case APT_MACRO:
138  aGbrItem->m_Shape = GBR_SPOT_MACRO;
139 
140  // Cache the bounding box for aperture macros
141  aGbrItem->GetDcodeDescr()->GetMacro()->GetApertureMacroShape( aGbrItem, aPos );
142  break;
143  }
144 }
145 
146 
159  int Dcode_index,
160  const wxPoint& aStart,
161  const wxPoint& aEnd,
162  wxSize aPenSize,
163  bool aLayerNegative )
164 {
165  aGbrItem->m_Flashed = false;
166 
167  aGbrItem->m_Size = aPenSize;
168 
169  aGbrItem->m_Start = aStart;
170  aGbrItem->m_End = aEnd;
171 
172  aGbrItem->m_DCode = Dcode_index;
173  aGbrItem->SetLayerPolarity( aLayerNegative );
174 
175  aGbrItem->SetNetAttributes( aGbrItem->m_GerberImageFile->m_NetAttributeDict );
176 }
177 
178 
207 void fillArcGBRITEM( GERBER_DRAW_ITEM* aGbrItem, int Dcode_index,
208  const wxPoint& aStart, const wxPoint& aEnd,
209  const wxPoint& aRelCenter, wxSize aPenSize,
210  bool aClockwise, bool aMultiquadrant,
211  bool aLayerNegative )
212 {
213  wxPoint center, delta;
214 
215  aGbrItem->m_Shape = GBR_ARC;
216  aGbrItem->m_Size = aPenSize;
217  aGbrItem->m_Flashed = false;
218 
219  if( aGbrItem->m_GerberImageFile )
220  aGbrItem->SetNetAttributes( aGbrItem->m_GerberImageFile->m_NetAttributeDict );
221 
222  if( aMultiquadrant )
223  center = aStart + aRelCenter;
224  else
225  {
226  // in single quadrant mode the relative coordinate aRelCenter is always >= 0
227  // So we must recalculate the actual sign of aRelCenter.x and aRelCenter.y
228  center = aRelCenter;
229 
230  // calculate arc end coordinate relative to the starting point,
231  // because center is relative to the center point
232  delta = aEnd - aStart;
233 
234  // now calculate the relative to aStart center position, for a draw function
235  // that use trigonometric arc angle (or counter-clockwise)
236  /* Quadrants:
237  * Y
238  * 2 | 1
239  * -------X
240  * 3 | 4
241  * C = actual relative arc center, S = arc start (axis origin) E = relative arc end
242  */
243  if( (delta.x >= 0) && (delta.y >= 0) )
244  {
245  /* Quadrant 1 (trigo or cclockwise):
246  * C | E
247  * ---S---
248  * 3 | 4
249  */
250  center.x = -center.x;
251  }
252  else if( (delta.x >= 0) && (delta.y < 0) )
253  {
254  /* Quadrant 4 (trigo or cclockwise):
255  * 2 | C
256  * ---S---
257  * 3 | E
258  */
259  // Nothing to do
260  }
261  else if( (delta.x < 0) && (delta.y >= 0) )
262  {
263  /* Quadrant 2 (trigo or cclockwise):
264  * E | 1
265  * ---S---
266  * C | 4
267  */
268  center.x = -center.x;
269  center.y = -center.y;
270  }
271  else
272  {
273  /* Quadrant 3 (trigo or cclockwise):
274  * 2 | 1
275  * ---S---
276  * E | C
277  */
278  center.y = -center.y;
279  }
280 
281  // Due to your draw arc function, we need this:
282  if( !aClockwise )
283  center = - center;
284 
285  // Calculate actual arc center coordinate:
286  center += aStart;
287  }
288 
289  if( aClockwise )
290  {
291  aGbrItem->m_Start = aStart;
292  aGbrItem->m_End = aEnd;
293  }
294  else
295  {
296  aGbrItem->m_Start = aEnd;
297  aGbrItem->m_End = aStart;
298  }
299 
300  aGbrItem->m_ArcCentre = center;
301 
302  aGbrItem->m_DCode = Dcode_index;
303  aGbrItem->SetLayerPolarity( aLayerNegative );
304 }
305 
306 
334 static void fillArcPOLY( GERBER_DRAW_ITEM* aGbrItem,
335  const wxPoint& aStart, const wxPoint& aEnd,
336  const wxPoint& rel_center,
337  bool aClockwise, bool aMultiquadrant,
338  bool aLayerNegative )
339 {
340  /* in order to calculate arc parameters, we use fillArcGBRITEM
341  * so we muse create a dummy track and use its geometric parameters
342  */
343  static GERBER_DRAW_ITEM dummyGbrItem( NULL );
344 
345  aGbrItem->SetLayerPolarity( aLayerNegative );
346 
347  fillArcGBRITEM( &dummyGbrItem, 0,
348  aStart, aEnd, rel_center, wxSize(0, 0),
349  aClockwise, aMultiquadrant, aLayerNegative );
350 
351  aGbrItem->SetNetAttributes( aGbrItem->m_GerberImageFile->m_NetAttributeDict );
352 
353  wxPoint center;
354  center = dummyGbrItem.m_ArcCentre;
355 
356  // Calculate coordinates relative to arc center;
357  wxPoint start = dummyGbrItem.m_Start - center;
358  wxPoint end = dummyGbrItem.m_End - center;
359 
360  /* Calculate angle arc
361  * angles are in 0.1 deg
362  * angle is trigonometrical (counter-clockwise),
363  * and axis is the X,Y gerber coordinates
364  */
365  double start_angle = ArcTangente( start.y, start.x );
366  double end_angle = ArcTangente( end.y, end.x );
367 
368  // dummyTrack has right geometric parameters, but
369  // fillArcGBRITEM calculates arc parameters for a draw function that expects
370  // start_angle < end_angle. So ensure this is the case here:
371  // Due to the fact atan2 returns angles between -180 to + 180 degrees,
372  // this is not always the case ( a modulo 360.0 degrees can be lost )
373  if( start_angle > end_angle )
374  end_angle += 3600;
375 
376  double arc_angle = start_angle - end_angle;
377  // Approximate arc by 36 segments per 360 degree
378  const int increment_angle = 3600 / 36;
379  int count = std::abs( arc_angle / increment_angle );
380 
381  if( aGbrItem->m_Polygon.OutlineCount() == 0 )
382  aGbrItem->m_Polygon.NewOutline();
383 
384  // calculate polygon corners
385  // when arc is counter-clockwise, dummyGbrItem arc goes from end to start
386  // and we must always create a polygon from start to end.
387  wxPoint start_arc = start;
388  for( int ii = 0; ii <= count; ii++ )
389  {
390  double rot;
391  wxPoint end_arc = start;
392  if( aClockwise )
393  rot = ii * increment_angle; // rot is in 0.1 deg
394  else
395  rot = (count - ii) * increment_angle; // rot is in 0.1 deg
396 
397  if( ii < count )
398  RotatePoint( &end_arc, -rot );
399  else // last point
400  end_arc = aClockwise ? end : start;
401 
402  aGbrItem->m_Polygon.Append( VECTOR2I( end_arc + center ) );
403 
404  start_arc = end_arc;
405  }
406 }
407 
408 
409 /* Read the Gnn sequence and returns the value nn.
410  */
412 {
413  int ii = 0;
414  char* text;
415  char line[1024];
416 
417  if( Text == NULL )
418  return 0;
419  Text++;
420  text = line;
421  while( IsNumber( *Text ) )
422  {
423  *(text++) = *(Text++);
424  }
425 
426  *text = 0;
427  ii = atoi( line );
428  return ii;
429 }
430 
431 
432 /* Get the sequence Dnn and returns the value nn
433  */
435 {
436  int ii = 0;
437  char* text;
438  char line[1024];
439 
440  if( Text == NULL )
441  return 0;
442 
443  Text++;
444  text = line;
445  while( IsNumber( *Text ) )
446  *(text++) = *(Text++);
447 
448  *text = 0;
449  ii = atoi( line );
450  return ii;
451 }
452 
453 
454 bool GERBER_FILE_IMAGE::Execute_G_Command( char*& text, int G_command )
455 {
456 // D( printf( "%22s: G_CODE<%d>\n", __func__, G_command ); )
457 
458  switch( G_command )
459  {
460  case GC_PHOTO_MODE: // can starts a D03 flash command: redundant, can
461  // be safely ignored
462  break;
463 
466  break;
467 
470  break;
471 
474  break;
475 
476  case GC_COMMENT:
477  // Skip comment, but only if the line does not start by "G04 #@! "
478  // which is a metadata, i.e. a X2 command inside the comment.
479  // this comment is called a "structured comment"
480  if( strncmp( text, " #@! ", 5 ) == 0 )
481  {
482  text += 5;
483  // The string starting at text is the same as the X2 attribute,
484  // but a X2 attribute ends by '%'. So we build the X2 attribute string
485  std::string x2buf;
486 
487  while( *text && (*text != '*') )
488  {
489  x2buf += *text;
490  text++;
491  }
492  // add the end of X2 attribute string
493  x2buf += "*%";
494  x2buf += '\0';
495 
496  char* cptr = (char*)x2buf.data();
497  int code_command = ReadXCommandID( cptr );
498  ExecuteRS274XCommand( code_command, NULL, 0, cptr );
499  }
500 
501  while( *text && (*text != '*') )
502  text++;
503  break;
504 
505  case GC_SELECT_TOOL:
506  {
507  int D_commande = DCodeNumber( text );
508  if( D_commande < FIRST_DCODE )
509  return false;
510  if( D_commande > (TOOLS_MAX_COUNT - 1) )
511  D_commande = TOOLS_MAX_COUNT - 1;
512  m_Current_Tool = D_commande;
513  D_CODE* pt_Dcode = GetDCODE( D_commande );
514  if( pt_Dcode )
515  pt_Dcode->m_InUse = true;
516  break;
517  }
518 
519  case GC_SPECIFY_INCHES:
520  m_GerbMetric = false; // false = Inches, true = metric
521  break;
522 
524  m_GerbMetric = true; // false = Inches, true = metric
525  break;
526 
527  case GC_TURN_OFF_360_INTERPOL: // disable Multi cadran arc and Arc interpol
528  m_360Arc_enbl = false;
529  m_Iterpolation = GERB_INTERPOL_LINEAR_1X; // not sure it should be done
530  break;
531 
533  m_360Arc_enbl = true;
534  break;
535 
537  m_Relative = false; // false = absolute Coord, true = relative
538  // Coord
539  break;
540 
542  m_Relative = true; // false = absolute Coord, true = relative
543  // Coord
544  break;
545 
547  m_PolygonFillMode = true;
548  m_Exposure = false;
549  break;
550 
552  if( m_Exposure && GetItemsList() ) // End of polygon
553  {
554  GERBER_DRAW_ITEM * gbritem = m_Drawings.GetLast();
555  gbritem->m_Polygon.Append( gbritem->m_Polygon.Vertex( 0 ) );
556  StepAndRepeatItem( *gbritem );
557  }
558  m_Exposure = false;
559  m_PolygonFillMode = false;
561  m_Iterpolation = GERB_INTERPOL_LINEAR_1X; // not sure it should be done
562  break;
563 
564  case GC_MOVE: // Non existent
565  default:
566  {
567  wxString msg;
568  msg.Printf( wxT( "G%0.2d command not handled" ), G_command );
569  AddMessageToList( msg );
570  return false;
571  }
572  }
573 
574 
575  return true;
576 }
577 
578 
579 bool GERBER_FILE_IMAGE::Execute_DCODE_Command( char*& text, int D_commande )
580 {
581  wxSize size( 15, 15 );
582 
583  APERTURE_T aperture = APT_CIRCLE;
584  GERBER_DRAW_ITEM* gbritem;
585 
586  int dcode = 0;
587  D_CODE* tool = NULL;
588  wxString msg;
589 
590  if( D_commande >= FIRST_DCODE ) // This is a "Set tool" command
591  {
592  if( D_commande > (TOOLS_MAX_COUNT - 1) )
593  D_commande = TOOLS_MAX_COUNT - 1;
594 
595  // remember which tool is selected, nothing is done with it in this
596  // call
597  m_Current_Tool = D_commande;
598 
599  D_CODE* pt_Dcode = GetDCODE( D_commande );
600  if( pt_Dcode )
601  pt_Dcode->m_InUse = true;
602 
603  return true;
604  }
605  else // D_commande = 0..9: this is a pen command (usually D1, D2 or D3)
606  {
607  m_Last_Pen_Command = D_commande;
608  }
609 
610  if( m_PolygonFillMode ) // Enter a polygon description:
611  {
612  switch( D_commande )
613  {
614  case 1: // code D01 Draw line, exposure ON
615  if( !m_Exposure ) // Start a new polygon outline:
616  {
617  m_Exposure = true;
618  gbritem = new GERBER_DRAW_ITEM( this );
619  m_Drawings.Append( gbritem );
620  gbritem->m_Shape = GBR_POLYGON;
621  gbritem->m_Flashed = false;
622  }
623 
624  switch( m_Iterpolation )
625  {
628  gbritem = m_Drawings.GetLast();
629 
630  fillArcPOLY( gbritem, m_PreviousPos,
632  ( m_Iterpolation == GERB_INTERPOL_ARC_NEG ) ? false : true,
633  m_360Arc_enbl, GetLayerParams().m_LayerNegative );
634  break;
635 
636  default:
637  gbritem = m_Drawings.GetLast();
638 
639  gbritem->m_Start = m_PreviousPos; // m_Start is used as temporary storage
640  if( gbritem->m_Polygon.OutlineCount() == 0 )
641  {
642  gbritem->m_Polygon.NewOutline();
643  gbritem->m_Polygon.Append( VECTOR2I( gbritem->m_Start ) );
644  }
645 
646  gbritem->m_End = m_CurrentPos; // m_End is used as temporary storage
647  gbritem->m_Polygon.Append( VECTOR2I( gbritem->m_End ) );
648  break;
649  }
650 
653  break;
654 
655  case 2: // code D2: exposure OFF (i.e. "move to")
656  if( m_Exposure && GetItemsList() ) // End of polygon
657  {
658  gbritem = m_Drawings.GetLast();
659  gbritem->m_Polygon.Append( gbritem->m_Polygon.Vertex( 0 ) );
660  StepAndRepeatItem( *gbritem );
661  }
662  m_Exposure = false;
665  break;
666 
667  default:
668  return false;
669  }
670  }
671  else
672  {
673  switch( D_commande )
674  {
675  case 1: // code D01 Draw line, exposure ON
676  m_Exposure = true;
677 
678  tool = GetDCODE( m_Current_Tool );
679  if( tool )
680  {
681  size = tool->m_Size;
682  dcode = tool->m_Num_Dcode;
683  aperture = tool->m_Shape;
684  }
685 
686  switch( m_Iterpolation )
687  {
689  gbritem = new GERBER_DRAW_ITEM( this );
690  m_Drawings.Append( gbritem );
691 
692  fillLineGBRITEM( gbritem, dcode, m_PreviousPos,
693  m_CurrentPos, size, GetLayerParams().m_LayerNegative );
694  StepAndRepeatItem( *gbritem );
695  break;
696 
699  gbritem = new GERBER_DRAW_ITEM( this );
700  m_Drawings.Append( gbritem );
701 
702  if( m_LastCoordIsIJPos )
703  {
704  fillArcGBRITEM( gbritem, dcode, m_PreviousPos,
705  m_CurrentPos, m_IJPos, size,
707  false : true, m_360Arc_enbl, GetLayerParams().m_LayerNegative );
708  m_LastCoordIsIJPos = false;
709  }
710  else
711  {
712  fillLineGBRITEM( gbritem, dcode, m_PreviousPos,
713  m_CurrentPos, size, GetLayerParams().m_LayerNegative );
714  }
715 
716  StepAndRepeatItem( *gbritem );
717 
718  break;
719 
720  default:
721  msg.Printf( wxT( "RS274D: DCODE Command: interpol error (type %X)" ),
722  m_Iterpolation );
723  AddMessageToList( msg );
724  break;
725  }
726 
728  break;
729 
730  case 2: // code D2: exposure OFF (i.e. "move to")
731  m_Exposure = false;
733  break;
734 
735  case 3: // code D3: flash aperture
736  tool = GetDCODE( m_Current_Tool );
737  if( tool )
738  {
739  size = tool->m_Size;
740  dcode = tool->m_Num_Dcode;
741  aperture = tool->m_Shape;
742  }
743 
744  gbritem = new GERBER_DRAW_ITEM( this );
745  m_Drawings.Append( gbritem );
746  fillFlashedGBRITEM( gbritem, aperture, dcode, m_CurrentPos,
747  size, GetLayerParams().m_LayerNegative );
748  StepAndRepeatItem( *gbritem );
750  break;
751 
752  default:
753  return false;
754  }
755  }
756 
757  return true;
758 }
void AddMessageToList(const wxString &aMessage)
Function AddMessageToList Add a message to the message list.
D_CODE * GetDcodeDescr() const
Function GetDcodeDescr returns the GetDcodeDescr of this object, or NULL.
int OutlineCount() const
Returns the number of outlines in the set
bool Execute_DCODE_Command(char *&text, int D_command)
Definition: rs274d.cpp:579
wxSize m_Size
Horizontal and vertical dimensions.
Definition: dcode.h:94
static void fillArcPOLY(GERBER_DRAW_ITEM *aGbrItem, const wxPoint &aStart, const wxPoint &aEnd, const wxPoint &rel_center, bool aClockwise, bool aMultiquadrant, bool aLayerNegative)
Function fillArcPOLY creates an arc G code when found in poly outlines.
Definition: rs274d.cpp:334
T * GetLast() const
Function GetLast returns the last T* in the list without removing it, or NULL if the list is empty.
Definition: dlist.h:170
Definition: dcode.h:53
bool m_InUse
false if the aperure (previously defined) is not used to draw something
Definition: dcode.h:102
APERTURE_T m_Shape
shape ( Line, rectangle, circle , oval .. )
Definition: dcode.h:95
void Append(T *aNewElement)
Function Append adds aNewElement to the end of the list.
Definition: dlist.h:177
D_CODE * GetDCODE(int aDCODE) const
Function GetDCODE returns a pointer to the D_CODE within this GERBER for the given aDCODE.
void RotatePoint(int *pX, int *pY, double angle)
Definition: trigo.cpp:206
void SetNetAttributes(const GBR_NETLIST_METADATA &aNetAttributes)
void fillLineGBRITEM(GERBER_DRAW_ITEM *aGbrItem, int Dcode_index, const wxPoint &aStart, const wxPoint &aEnd, wxSize aPenSize, bool aLayerNegative)
Function fillLineGBRITEM initializes a given GBRITEM so that it can draw a linear D code.
Definition: rs274d.cpp:158
VECTOR2< int > VECTOR2I
Definition: vector2d.h:587
SHAPE_POLY_SET m_Polygon
#define abs(a)
Definition: auxiliary.h:84
int ReadXCommandID(char *&text)
reads two bytes of data and assembles them into an int with the first byte in the sequence put into t...
Definition: rs274x.cpp:114
Definition: dcode.h:52
int GCodeNumber(char *&Text)
Definition: rs274d.cpp:411
VECTOR2I & Vertex(int aIndex, int aOutline, int aHole)
Returns the index-th vertex in a given hole outline within a given outline
bool ExecuteRS274XCommand(int aCommand, char *aBuff, unsigned int aBuffSize, char *&aText)
executes a RS274X command
Definition: rs274x.cpp:239
SHAPE_POLY_SET * GetApertureMacroShape(const GERBER_DRAW_ITEM *aParent, wxPoint aShapePos)
Function GetApertureMacroShape Calculate the primitive shape for flashed items.
double ArcTangente(int dy, int dx)
Definition: trigo.cpp:160
#define FIRST_DCODE
Definition: dcode.h:71
int DCodeNumber(char *&Text)
Definition: rs274d.cpp:434
APERTURE_T
Enum APERTURE_T is the set of all gerber aperture types allowed, according to page 16 of http://gerbv...
Definition: dcode.h:50
int m_Num_Dcode
D code value ( >= 10 )
Definition: dcode.h:96
int NewOutline()
Creates a new empty polygon in the set and returns its index
void fillArcGBRITEM(GERBER_DRAW_ITEM *aGbrItem, int Dcode_index, const wxPoint &aStart, const wxPoint &aEnd, const wxPoint &aRelCenter, wxSize aPenSize, bool aClockwise, bool aMultiquadrant, bool aLayerNegative)
Function fillArcGBRITEM initializes a given GBRITEM so that it can draw an arc G code.
Definition: rs274d.cpp:207
bool m_Exposure
whether an aperture macro tool is flashed on or off
bool Execute_G_Command(char *&text, int G_command)
Definition: rs274d.cpp:454
Class D_CODE holds a gerber DCODE (also called Aperture) definition.
Definition: dcode.h:82
void fillFlashedGBRITEM(GERBER_DRAW_ITEM *aGbrItem, APERTURE_T aAperture, int Dcode_index, const wxPoint &aPos, wxSize aSize, bool aLayerNegative)
Function fillFlashedGBRITEM initializes a given GBRITEM so that it can draw a circle which is filled ...
Definition: rs274d.cpp:103
DLIST< GERBER_DRAW_ITEM > m_Drawings
GERBER_DRAW_ITEM * GetItemsList()
Function GetItemsList.
GBR_NETLIST_METADATA m_NetAttributeDict
#define TOOLS_MAX_COUNT
Definition: dcode.h:73
void SetLayerPolarity(bool aNegative)
The common library.
APERTURE_MACRO * GetMacro() const
Definition: dcode.h:157
#define IsNumber(x)
void StepAndRepeatItem(const GERBER_DRAW_ITEM &aItem)
Function StepAndRepeatItem Gerber format has a command Step an Repeat This function must be called wh...
GERBER_FILE_IMAGE * m_GerberImageFile
GERBER_LAYER & GetLayerParams()
Function GetLayerParams.
int Append(int x, int y, int aOutline=-1, int aHole=-1, bool aAllowDuplication=false)
Appends a vertex at the end of the given outline/hole (default: the last outline)