KiCad PCB EDA Suite
GERBER_plotter.cpp
Go to the documentation of this file.
1 /*
2  * This program source code file is part of KiCad, a free EDA CAD application.
3  *
4  * Copyright (C) 2019 Jean-Pierre Charras, jp.charras at wanadoo.fr
5  * Copyright (C) 2019 KiCad Developers, see AUTHORS.txt for contributors.
6  *
7  * This program is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU General Public License
9  * as published by the Free Software Foundation; either version 2
10  * of the License, or (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program; if not, you may find one here:
19  * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
20  * or you may search the http://www.gnu.org website for the version 2 license,
21  * or you may write to the Free Software Foundation, Inc.,
22  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
23  */
24 
30 #include <fctsys.h>
31 #include <gr_basic.h>
32 #include <trigo.h>
33 #include <eda_base_frame.h>
34 #include <base_struct.h>
35 #include <common.h>
36 #include <plotter.h>
37 #include <macros.h>
38 #include <kicad_string.h>
40 #include <math/util.h> // for KiROUND
41 
42 #include <build_version.h>
43 
44 #include <gbr_metadata.h>
45 
46 
48 {
49  workFile = NULL;
50  finalFile = NULL;
53 
54  // number of digits after the point (number of digits of the mantissa
55  // Be carefull: the Gerber coordinates are stored in an integer
56  // so 6 digits (inches) or 5 digits (mm) is a good value
57  // To avoid overflow, 7 digits (inches) or 6 digits is a max.
58  // with lower values than 6 digits (inches) or 5 digits (mm),
59  // Creating self-intersecting polygons from non-intersecting polygons
60  // happen easily.
61  m_gerberUnitInch = false;
62  m_gerberUnitFmt = 6;
63  m_useX2format = true;
64  m_useNetAttributes = true;
65 }
66 
67 
68 void GERBER_PLOTTER::SetViewport( const wxPoint& aOffset, double aIusPerDecimil,
69  double aScale, bool aMirror )
70 {
71  wxASSERT( aMirror == false );
72  m_plotMirror = false;
73  plotOffset = aOffset;
74  wxASSERT( aScale == 1 ); // aScale parameter is not used in Gerber
75  plotScale = 1; // Plot scale is *always* 1.0
76 
77  m_IUsPerDecimil = aIusPerDecimil;
78  // gives now a default value to iuPerDeviceUnit (because the units of the caller is now known)
79  // which could be modified later by calling SetGerberCoordinatesFormat()
80  iuPerDeviceUnit = pow( 10.0, m_gerberUnitFmt ) / ( m_IUsPerDecimil * 10000.0 );
81 
82  // We don't handle the filmbox, and it's more useful to keep the
83  // origin at the origin
84  paperSize.x = 0;
85  paperSize.y = 0;
86  SetDefaultLineWidth( 100 * aIusPerDecimil ); // Arbitrary default
87 }
88 
89 
90 void GERBER_PLOTTER::SetGerberCoordinatesFormat( int aResolution, bool aUseInches )
91 {
92  m_gerberUnitInch = aUseInches;
93  m_gerberUnitFmt = aResolution;
94 
95  iuPerDeviceUnit = pow( 10.0, m_gerberUnitFmt ) / ( m_IUsPerDecimil * 10000.0 );
96 
97  if( ! m_gerberUnitInch )
98  iuPerDeviceUnit *= 25.4; // gerber output in mm
99 }
100 
101 
102 void GERBER_PLOTTER::emitDcode( const DPOINT& pt, int dcode )
103 {
104 
105  fprintf( outputFile, "X%dY%dD%02d*\n", KiROUND( pt.x ), KiROUND( pt.y ), dcode );
106 }
107 
109 {
110  // Remove all attributes from object attributes dictionary (TO. and TA commands)
111  if( m_useX2format )
112  fputs( "%TD*%\n", outputFile );
113  else
114  fputs( "G04 #@! TD*\n", outputFile );
115 
117 }
118 
119 
121 {
122  // disable a Gerber net attribute (exists only in X2 with net attributes mode).
123  if( m_objectAttributesDictionnary.empty() ) // No net attribute or not X2 mode
124  return;
125 
126  // Remove all net attributes from object attributes dictionary
127  if( m_useX2format )
128  fputs( "%TD*%\n", outputFile );
129  else
130  fputs( "G04 #@! TD*\n", outputFile );
131 
133 }
134 
135 
136 void GERBER_PLOTTER::StartBlock( void* aData )
137 {
138  // Currently, it is the same as EndBlock(): clear all aperture net attributes
139  EndBlock( aData );
140 }
141 
142 
143 void GERBER_PLOTTER::EndBlock( void* aData )
144 {
145  // Remove all net attributes from object attributes dictionary
147 }
148 
149 
151 {
152  // print a Gerber net attribute record.
153  // it is added to the object attributes dictionary
154  // On file, only modified or new attributes are printed.
155  if( aData == NULL )
156  return;
157 
158  if( !m_useNetAttributes )
159  return;
160 
161  bool useX1StructuredComment = !m_useX2format;
162 
163  bool clearDict;
164  std::string short_attribute_string;
165 
166  if( !FormatNetAttribute( short_attribute_string, m_objectAttributesDictionnary,
167  aData, clearDict, useX1StructuredComment ) )
168  return;
169 
170  if( clearDict )
172 
173  if( !short_attribute_string.empty() )
174  fputs( short_attribute_string.c_str(), outputFile );
175 
176  if( m_useX2format && !aData->m_ExtraData.IsEmpty() )
177  {
178  std::string extra_data = TO_UTF8( aData->m_ExtraData );
179  fputs( extra_data.c_str(), outputFile );
180  }
181 }
182 
183 
185 {
186  wxASSERT( outputFile );
187 
188  finalFile = outputFile; // the actual gerber file will be created later
189 
190  // Create a temporary filename to store gerber file
191  // note tmpfile() does not work under Vista and W7 in user mode
192  m_workFilename = filename + wxT(".tmp");
193  workFile = wxFopen( m_workFilename, wxT( "wt" ));
195  wxASSERT( outputFile );
196 
197  if( outputFile == NULL )
198  return false;
199 
200  for( unsigned ii = 0; ii < m_headerExtraLines.GetCount(); ii++ )
201  {
202  if( ! m_headerExtraLines[ii].IsEmpty() )
203  fprintf( outputFile, "%s\n", TO_UTF8( m_headerExtraLines[ii] ) );
204  }
205 
206  // Set coordinate format to 3.6 or 4.5 absolute, leading zero omitted
207  // the number of digits for the integer part of coordinates is needed
208  // in gerber format, but is not very important when omitting leading zeros
209  // It is fixed here to 3 (inch) or 4 (mm), but is not actually used
210  int leadingDigitCount = m_gerberUnitInch ? 3 : 4;
211 
212  fprintf( outputFile, "%%FSLAX%d%dY%d%d*%%\n",
213  leadingDigitCount, m_gerberUnitFmt,
214  leadingDigitCount, m_gerberUnitFmt );
215  fprintf( outputFile,
216  "G04 Gerber Fmt %d.%d, Leading zero omitted, Abs format (unit %s)*\n",
217  leadingDigitCount, m_gerberUnitFmt,
218  m_gerberUnitInch ? "inch" : "mm" );
219 
220  wxString Title = creator + wxT( " " ) + GetBuildVersion();
221  // In gerber files, ASCII7 chars only are allowed.
222  // So use a ISO date format (using a space as separator between date and time),
223  // not a localized date format
224  wxDateTime date = wxDateTime::Now();
225  fprintf( outputFile, "G04 Created by KiCad (%s) date %s*\n",
226  TO_UTF8( Title ), TO_UTF8( date.FormatISOCombined( ' ') ) );
227 
228  /* Mass parameter: unit = INCHES/MM */
229  if( m_gerberUnitInch )
230  fputs( "%MOIN*%\n", outputFile );
231  else
232  fputs( "%MOMM*%\n", outputFile );
233 
234  // Be sure the usual dark polarity is selected:
235  fputs( "%LPD*%\n", outputFile );
236 
237  fputs( "G04 APERTURE LIST*\n", outputFile );
238 
239  return true;
240 }
241 
242 
244 {
245  char line[1024];
246  wxString msg;
247 
248  wxASSERT( outputFile );
249 
250  /* Outfile is actually a temporary file i.e. workFile */
251  fputs( "M02*\n", outputFile );
252  fflush( outputFile );
253 
254  fclose( workFile );
255  workFile = wxFopen( m_workFilename, wxT( "rt" ));
256  wxASSERT( workFile );
258 
259  // Placement of apertures in RS274X
260  while( fgets( line, 1024, workFile ) )
261  {
262  fputs( line, outputFile );
263 
264  char* substr = strtok( line, "\n\r" );
265 
266  if( substr && strcmp( substr, "G04 APERTURE LIST*" ) == 0 )
267  {
269  fputs( "G04 APERTURE END LIST*\n", outputFile );
270  }
271  }
272 
273  fclose( workFile );
274  fclose( finalFile );
275  ::wxRemoveFile( m_workFilename );
276  outputFile = 0;
277 
278  return true;
279 }
280 
281 
283 {
284  defaultPenWidth = width;
286 }
287 
288 
289 void GERBER_PLOTTER::SetCurrentLineWidth( int width, void* aData )
290 {
291  if( width == DO_NOT_SET_LINE_WIDTH )
292  return;
293 
294  int pen_width;
295 
296  if( width > 0 )
297  pen_width = width;
298  else
299  pen_width = defaultPenWidth;
300 
301  GBR_METADATA* gbr_metadata = static_cast<GBR_METADATA*>( aData );
302  int aperture_attribute = gbr_metadata ? gbr_metadata->GetApertureAttrib() : 0;
303 
304  selectAperture( wxSize( pen_width, pen_width ), APERTURE::AT_PLOTTING, aperture_attribute );
305  currentPenWidth = pen_width;
306 }
307 
308 
309 int GERBER_PLOTTER::GetOrCreateAperture( const wxSize& aSize,
310  APERTURE::APERTURE_TYPE aType, int aApertureAttribute )
311 {
312  int last_D_code = 9;
313 
314  // Search an existing aperture
315  for( int idx = 0; idx < (int)m_apertures.size(); ++idx )
316  {
317  APERTURE* tool = &m_apertures[idx];
318  last_D_code = tool->m_DCode;
319 
320  if( (tool->m_Type == aType) && (tool->m_Size == aSize) &&
321  (tool->m_ApertureAttribute == aApertureAttribute) )
322  return idx;
323  }
324 
325  // Allocate a new aperture
326  APERTURE new_tool;
327  new_tool.m_Size = aSize;
328  new_tool.m_Type = aType;
329  new_tool.m_DCode = last_D_code + 1;
330  new_tool.m_ApertureAttribute = aApertureAttribute;
331 
332  m_apertures.push_back( new_tool );
333 
334  return m_apertures.size() - 1;
335 }
336 
337 
338 void GERBER_PLOTTER::selectAperture( const wxSize& aSize,
340  int aApertureAttribute )
341 {
342  bool change = ( m_currentApertureIdx < 0 ) ||
343  ( m_apertures[m_currentApertureIdx].m_Type != aType ) ||
344  ( m_apertures[m_currentApertureIdx].m_Size != aSize );
345 
346  if( !m_useNetAttributes )
347  aApertureAttribute = 0;
348  else if( !change )
349  change = m_apertures[m_currentApertureIdx].m_ApertureAttribute != aApertureAttribute;
350 
351  if( change )
352  {
353  // Pick an existing aperture or create a new one
354  m_currentApertureIdx = GetOrCreateAperture( aSize, aType, aApertureAttribute );
355  fprintf( outputFile, "D%d*\n", m_apertures[m_currentApertureIdx].m_DCode );
356  }
357 }
358 
359 void GERBER_PLOTTER::selectAperture( int aDiameter, double aPolygonRotation,
360  APERTURE::APERTURE_TYPE aType, int aApertureAttribute )
361 {
362  // Pick an existing aperture or create a new one, matching the
363  // aDiameter, aPolygonRotation, type and attributes for type =
364  // AT_REGULAR_POLY3 to AT_REGULAR_POLY12
365 
366  wxASSERT( aType>= APERTURE::APERTURE_TYPE::AT_REGULAR_POLY3 &&
367  aType <= APERTURE::APERTURE_TYPE::AT_REGULAR_POLY12 );
368 
369  // To use selectAperture( size, ... ) calculate a equivalent aperture size:
370  // for AT_REGULAR_POLYxx the parameter APERTURE::m_Size contains
371  // aDiameter (in m_Size.x) and aPolygonRotation in 1/1000 degree (in m_Size.y)
372  wxSize size( aDiameter, (int)( aPolygonRotation * 1000.0 ) );
373  selectAperture( size, aType, aApertureAttribute );
374 }
375 
377 {
378  wxASSERT( outputFile );
379  char cbuf[1024];
380 
381  bool useX1StructuredComment = false;
382 
383  if( !m_useX2format )
384  useX1StructuredComment = true;
385 
386  // Init
387  for( APERTURE& tool : m_apertures )
388  {
389  // apertude sizes are in inch or mm, regardless the
390  // coordinates format
391  double fscale = 0.0001 * plotScale / m_IUsPerDecimil; // inches
392 
393  if(! m_gerberUnitInch )
394  fscale *= 25.4; // size in mm
395 
396  int attribute = tool.m_ApertureAttribute;
397 
398  if( attribute != m_apertureAttribute )
399  {
402  useX1StructuredComment ).c_str(), outputFile );
403  }
404 
405  char* text = cbuf + sprintf( cbuf, "%%ADD%d", tool.m_DCode );
406 
407  /* Please note: the Gerber specs for mass parameters say that
408  exponential syntax is *not* allowed and the decimal point should
409  also be always inserted. So the %g format is ruled out, but %f is fine
410  (the # modifier forces the decimal point). Sadly the %f formatter
411  can't remove trailing zeros but thats not a problem, since nothing
412  forbid it (the file is only slightly longer) */
413 
414  switch( tool.m_Type )
415  {
416  case APERTURE::AT_CIRCLE:
417  sprintf( text, "C,%#f*%%\n", tool.GetDiameter() * fscale );
418  break;
419 
420  case APERTURE::AT_RECT:
421  sprintf( text, "R,%#fX%#f*%%\n", tool.m_Size.x * fscale,
422  tool.m_Size.y * fscale );
423  break;
424 
426  sprintf( text, "C,%#f*%%\n", tool.m_Size.x * fscale );
427  break;
428 
429  case APERTURE::AT_OVAL:
430  sprintf( text, "O,%#fX%#f*%%\n", tool.m_Size.x * fscale,
431  tool.m_Size.y * fscale );
432  break;
433 
445  sprintf( text, "P,%#fX%dX%#f*%%\n", tool.GetDiameter() * fscale,
446  tool.GetVerticeCount(), tool.GetRotation() );
447  break;
448  }
449 
450  fputs( cbuf, outputFile );
451 
452  m_apertureAttribute = attribute;
453 
454  // Currently reset the aperture attribute. Perhaps a better optimization
455  // is to store the last attribute
456  if( attribute )
457  {
458  if( m_useX2format )
459  fputs( "%TD*%\n", outputFile );
460  else
461  fputs( "G04 #@! TD*\n", outputFile );
462 
464  }
465 
466  }
467 }
468 
469 
470 void GERBER_PLOTTER::PenTo( const wxPoint& aPos, char plume )
471 {
472  wxASSERT( outputFile );
473  DPOINT pos_dev = userToDeviceCoordinates( aPos );
474 
475  switch( plume )
476  {
477  case 'Z':
478  break;
479 
480  case 'U':
481  emitDcode( pos_dev, 2 );
482  break;
483 
484  case 'D':
485  emitDcode( pos_dev, 1 );
486  }
487 
488  penState = plume;
489 }
490 
491 
492 void GERBER_PLOTTER::Rect( const wxPoint& p1, const wxPoint& p2, FILL_T fill, int width )
493 {
494  std::vector< wxPoint > cornerList;
495 
496  // Build corners list
497  cornerList.push_back( p1 );
498  wxPoint corner(p1.x, p2.y);
499  cornerList.push_back( corner );
500  cornerList.push_back( p2 );
501  corner.x = p2.x;
502  corner.y = p1.y;
503  cornerList.push_back( corner );
504  cornerList.push_back( p1 );
505 
506  PlotPoly( cornerList, fill, width );
507 }
508 
509 
510 void GERBER_PLOTTER::Circle( const wxPoint& aCenter, int aDiameter, FILL_T aFill, int aWidth )
511 {
512  Arc( aCenter, 0, 3600, aDiameter / 2, aFill, aWidth );
513 }
514 
515 
516 void GERBER_PLOTTER::Arc( const wxPoint& aCenter, double aStAngle, double aEndAngle,
517  int aRadius, FILL_T aFill, int aWidth )
518 {
519  SetCurrentLineWidth( aWidth );
520 
521  wxPoint start, end;
522  start.x = aCenter.x + KiROUND( cosdecideg( aRadius, aStAngle ) );
523  start.y = aCenter.y - KiROUND( sindecideg( aRadius, aStAngle ) );
524  MoveTo( start );
525  end.x = aCenter.x + KiROUND( cosdecideg( aRadius, aEndAngle ) );
526  end.y = aCenter.y - KiROUND( sindecideg( aRadius, aEndAngle ) );
527  DPOINT devEnd = userToDeviceCoordinates( end );
528  DPOINT devCenter = userToDeviceCoordinates( aCenter ) - userToDeviceCoordinates( start );
529 
530  fprintf( outputFile, "G75*\n" ); // Multiquadrant (360 degrees) mode
531 
532  if( aStAngle < aEndAngle )
533  fprintf( outputFile, "G03*\n" ); // Active circular interpolation, CCW
534  else
535  fprintf( outputFile, "G02*\n" ); // Active circular interpolation, CW
536 
537  fprintf( outputFile, "X%dY%dI%dJ%dD01*\n",
538  KiROUND( devEnd.x ), KiROUND( devEnd.y ),
539  KiROUND( devCenter.x ), KiROUND( devCenter.y ) );
540 
541  fprintf( outputFile, "G01*\n" ); // Back to linear interpol (perhaps useless here).
542 }
543 
544 
545 void GERBER_PLOTTER::PlotGerberRegion( const std::vector< wxPoint >& aCornerList,
546  void * aData )
547 {
548  if( aCornerList.size() <= 2 )
549  return;
550 
551  GBR_METADATA* gbr_metadata = static_cast<GBR_METADATA*>( aData );
552 
553  bool clearTA_AperFunction = false; // true if a TA.AperFunction is used
554 
555  if( gbr_metadata )
556  {
557  std::string attrib = gbr_metadata->m_ApertureMetadata.FormatAttribute( !m_useX2format );
558 
559  if( !attrib.empty() )
560  {
561  fputs( attrib.c_str(), outputFile );
562  clearTA_AperFunction = true;
563  }
564  }
565 
566  PlotPoly( aCornerList, FILLED_SHAPE, 0 , gbr_metadata );
567 
568  // Clear the TA attribute, to avoid the next item to inherit it:
569  if( clearTA_AperFunction )
570  {
571  if( m_useX2format )
572  {
573  fputs( "%TD.AperFunction*%\n", outputFile );
574  }
575  else
576  {
577  fputs( "G04 #@! TD.AperFunction*\n", outputFile );
578  }
579  }
580 }
581 
582 void GERBER_PLOTTER::PlotPoly( const std::vector< wxPoint >& aCornerList,
583  FILL_T aFill, int aWidth, void * aData )
584 {
585  if( aCornerList.size() <= 1 )
586  return;
587 
588  // Gerber format does not know filled polygons with thick outline
589  // Therefore, to plot a filled polygon with outline having a thickness,
590  // one should plot outline as thick segments
591  GBR_METADATA* gbr_metadata = static_cast<GBR_METADATA*>( aData );
592 
593  if( gbr_metadata )
594  formatNetAttribute( &gbr_metadata->m_NetlistMetadata );
595 
596  if( aFill )
597  {
598  fputs( "G36*\n", outputFile );
599 
600  MoveTo( aCornerList[0] );
601  fputs( "G01*\n", outputFile ); // Set linear interpolation.
602 
603  for( unsigned ii = 1; ii < aCornerList.size(); ii++ )
604  LineTo( aCornerList[ii] );
605 
606  // If the polygon is not closed, close it:
607  if( aCornerList[0] != aCornerList[aCornerList.size()-1] )
608  FinishTo( aCornerList[0] );
609 
610  fputs( "G37*\n", outputFile );
611  }
612 
613  if( aWidth > 0 ) // Draw the polyline/polygon outline
614  {
615  SetCurrentLineWidth( aWidth, gbr_metadata );
616 
617  MoveTo( aCornerList[0] );
618 
619  for( unsigned ii = 1; ii < aCornerList.size(); ii++ )
620  LineTo( aCornerList[ii] );
621 
622  // Ensure the thick outline is closed for filled polygons
623  // (if not filled, could be only a polyline)
624  if( aFill && ( aCornerList[aCornerList.size()-1] != aCornerList[0] ) )
625  LineTo( aCornerList[0] );
626 
627  PenFinish();
628  }
629 }
630 
631 
632 void GERBER_PLOTTER::ThickSegment( const wxPoint& start, const wxPoint& end, int width,
633  EDA_DRAW_MODE_T tracemode, void* aData )
634 {
635  if( tracemode == FILLED )
636  {
637  GBR_METADATA *gbr_metadata = static_cast<GBR_METADATA*>( aData );
638  SetCurrentLineWidth( width, gbr_metadata );
639 
640  if( gbr_metadata )
641  formatNetAttribute( &gbr_metadata->m_NetlistMetadata );
642 
643  MoveTo( start );
644  FinishTo( end );
645  }
646  else
647  {
649  segmentAsOval( start, end, width, tracemode );
650  }
651 }
652 
653 void GERBER_PLOTTER::ThickArc( const wxPoint& centre, double StAngle, double EndAngle,
654  int radius, int width, EDA_DRAW_MODE_T tracemode, void* aData )
655 {
656  GBR_METADATA *gbr_metadata = static_cast<GBR_METADATA*>( aData );
657  SetCurrentLineWidth( width, gbr_metadata );
658 
659  if( gbr_metadata )
660  formatNetAttribute( &gbr_metadata->m_NetlistMetadata );
661 
662  if( tracemode == FILLED )
663  Arc( centre, StAngle, EndAngle, radius, NO_FILL, DO_NOT_SET_LINE_WIDTH );
664  else
665  {
667  Arc( centre, StAngle, EndAngle,
668  radius - ( width - currentPenWidth ) / 2,
670  Arc( centre, StAngle, EndAngle,
671  radius + ( width - currentPenWidth ) / 2, NO_FILL,
673  }
674 }
675 
676 
677 void GERBER_PLOTTER::ThickRect( const wxPoint& p1, const wxPoint& p2, int width,
678  EDA_DRAW_MODE_T tracemode, void* aData )
679 {
680  GBR_METADATA *gbr_metadata = static_cast<GBR_METADATA*>( aData );
681  SetCurrentLineWidth( width, gbr_metadata );
682 
683  if( gbr_metadata )
684  formatNetAttribute( &gbr_metadata->m_NetlistMetadata );
685 
686  if( tracemode == FILLED )
687  Rect( p1, p2, NO_FILL, DO_NOT_SET_LINE_WIDTH );
688  else
689  {
691  wxPoint offsetp1( p1.x - (width - currentPenWidth) / 2,
692  p1.y - (width - currentPenWidth) / 2 );
693  wxPoint offsetp2( p2.x + (width - currentPenWidth) / 2,
694  p2.y + (width - currentPenWidth) / 2 );
695  Rect( offsetp1, offsetp2, NO_FILL, -1 );
696  offsetp1.x += (width - currentPenWidth);
697  offsetp1.y += (width - currentPenWidth);
698  offsetp2.x -= (width - currentPenWidth);
699  offsetp2.y -= (width - currentPenWidth);
700  Rect( offsetp1, offsetp2, NO_FILL, DO_NOT_SET_LINE_WIDTH );
701  }
702 }
703 
704 
705 void GERBER_PLOTTER::ThickCircle( const wxPoint& pos, int diametre, int width,
706  EDA_DRAW_MODE_T tracemode, void* aData )
707 {
708  GBR_METADATA *gbr_metadata = static_cast<GBR_METADATA*>( aData );
709  SetCurrentLineWidth( width, gbr_metadata );
710 
711  if( gbr_metadata )
712  formatNetAttribute( &gbr_metadata->m_NetlistMetadata );
713 
714  if( tracemode == FILLED )
715  Circle( pos, diametre, NO_FILL, DO_NOT_SET_LINE_WIDTH );
716  else
717  {
719  Circle( pos, diametre - (width - currentPenWidth),
721  Circle( pos, diametre + (width - currentPenWidth),
723  }
724 }
725 
726 
727 void GERBER_PLOTTER::FlashPadCircle( const wxPoint& pos, int diametre, EDA_DRAW_MODE_T trace_mode, void* aData )
728 {
729  wxSize size( diametre, diametre );
730  GBR_METADATA* gbr_metadata = static_cast<GBR_METADATA*>( aData );
731 
732  if( trace_mode == SKETCH )
733  {
735 
736  if( gbr_metadata )
737  formatNetAttribute( &gbr_metadata->m_NetlistMetadata );
738 
740  }
741  else
742  {
743  DPOINT pos_dev = userToDeviceCoordinates( pos );
744 
745  int aperture_attrib = gbr_metadata ? gbr_metadata->GetApertureAttrib() : 0;
746  selectAperture( size, APERTURE::AT_CIRCLE, aperture_attrib );
747 
748  if( gbr_metadata )
749  formatNetAttribute( &gbr_metadata->m_NetlistMetadata );
750 
751  emitDcode( pos_dev, 3 );
752  }
753 }
754 
755 
756 void GERBER_PLOTTER::FlashPadOval( const wxPoint& pos, const wxSize& aSize, double orient,
757  EDA_DRAW_MODE_T trace_mode, void* aData )
758 {
759  wxASSERT( outputFile );
760  wxSize size( aSize );
761  GBR_METADATA* gbr_metadata = static_cast<GBR_METADATA*>( aData );
762 
763  // Flash a vertical or horizontal shape (this is a basic aperture).
764  if( ( orient == 0 || orient == 900 || orient == 1800 || orient == 2700 )
765  && trace_mode == FILLED )
766  {
767  if( orient == 900 || orient == 2700 ) /* orientation turned 90 deg. */
768  std::swap( size.x, size.y );
769 
770  DPOINT pos_dev = userToDeviceCoordinates( pos );
771  int aperture_attrib = gbr_metadata ? gbr_metadata->GetApertureAttrib() : 0;
772  selectAperture( size, APERTURE::AT_OVAL, aperture_attrib );
773 
774  if( gbr_metadata )
775  formatNetAttribute( &gbr_metadata->m_NetlistMetadata );
776 
777  emitDcode( pos_dev, 3 );
778  }
779  else // Plot pad as region.
780  // Only regions and flashed items accept a object attribute TO.P for the pin name
781  {
782  if( size.x > size.y )
783  {
784  std::swap( size.x, size.y );
785 
786  if( orient < 2700 )
787  orient += 900;
788  else
789  orient -= 2700;
790  }
791 
792  if( trace_mode == FILLED )
793  {
794  // TODO: use an aperture macro to declare the rotated pad
795  // to be able to flash the shape
796  // For now, the pad is drawn as thick segment (painted with only one segment)
797 
798  // The pad is reduced to an segment with dy > dx
799  int delta = size.y - size.x;
800  wxPoint p0( 0, -delta / 2 );
801  wxPoint p1( 0, delta / 2 );
802  RotatePoint( &p0.x, &p0.y, orient );
803  RotatePoint( &p1.x, &p1.y, orient );
804 
805  ThickSegment( pos + p0, pos + p1, size.x, trace_mode, gbr_metadata );
806  }
807  else
808  sketchOval( pos, size, orient, -1 );
809  }
810 }
811 
812 
813 void GERBER_PLOTTER::FlashPadRect( const wxPoint& pos, const wxSize& aSize,
814  double orient, EDA_DRAW_MODE_T trace_mode, void* aData )
815 
816 {
817  wxASSERT( outputFile );
818  wxSize size( aSize );
819  GBR_METADATA* gbr_metadata = static_cast<GBR_METADATA*>( aData );
820 
821  // Plot as an aperture flash
822  switch( int( orient ) )
823  {
824  case 900:
825  case 2700: // rotation of 90 degrees or 270 swaps sizes
826  std::swap( size.x, size.y );
827  // Intentionally fall through
828  case 0:
829  case 1800:
830  if( trace_mode == SKETCH )
831  {
833 
834  if( gbr_metadata )
835  formatNetAttribute( &gbr_metadata->m_NetlistMetadata );
836 
837  Rect( wxPoint( pos.x - (size.x - currentPenWidth) / 2,
838  pos.y - (size.y - currentPenWidth) / 2 ),
839  wxPoint( pos.x + (size.x - currentPenWidth) / 2,
840  pos.y + (size.y - currentPenWidth) / 2 ),
842  }
843  else
844  {
845  DPOINT pos_dev = userToDeviceCoordinates( pos );
846  int aperture_attrib = gbr_metadata ? gbr_metadata->GetApertureAttrib() : 0;
847  selectAperture( size, APERTURE::AT_RECT, aperture_attrib );
848 
849  if( gbr_metadata )
850  formatNetAttribute( &gbr_metadata->m_NetlistMetadata );
851 
852  emitDcode( pos_dev, 3 );
853  }
854  break;
855 
856  default: // plot pad shape as polygon
857  {
858  // XXX to do: use an aperture macro to declare the rotated pad
859  wxPoint coord[4];
860  // coord[0] is assumed the lower left
861  // coord[1] is assumed the upper left
862  // coord[2] is assumed the upper right
863  // coord[3] is assumed the lower right
864 
865  /* Trace the outline. */
866  coord[0].x = -size.x/2; // lower left
867  coord[0].y = size.y/2;
868  coord[1].x = -size.x/2; // upper left
869  coord[1].y = -size.y/2;
870  coord[2].x = size.x/2; // upper right
871  coord[2].y = -size.y/2;
872  coord[3].x = size.x/2; // lower right
873  coord[3].y = size.y/2;
874 
875  FlashPadTrapez( pos, coord, orient, trace_mode, aData );
876  }
877  break;
878  }
879 }
880 
881 void GERBER_PLOTTER::FlashPadRoundRect( const wxPoint& aPadPos, const wxSize& aSize,
882  int aCornerRadius, double aOrient,
883  EDA_DRAW_MODE_T aTraceMode, void* aData )
884 
885 {
886  GBR_METADATA* gbr_metadata = static_cast<GBR_METADATA*>( aData );
887 
888  // Currently, a Pad RoundRect is plotted as polygon.
889  // TODO: use Aperture macro and flash it
890  SHAPE_POLY_SET outline;
891  TransformRoundChamferedRectToPolygon( outline, aPadPos, aSize, aOrient,
892  aCornerRadius, 0.0, 0, GetPlotterArcHighDef() );
893 
894  if( aTraceMode != FILLED )
895  {
897  outline.Inflate( -GetCurrentLineWidth()/2, 16 );
898  }
899 
900  std::vector< wxPoint > cornerList;
901  // TransformRoundRectToPolygon creates only one convex polygon
902  SHAPE_LINE_CHAIN& poly = outline.Outline( 0 );
903  cornerList.reserve( poly.PointCount() + 1 );
904 
905  for( int ii = 0; ii < poly.PointCount(); ++ii )
906  cornerList.emplace_back( poly.CPoint( ii ).x, poly.CPoint( ii ).y );
907 
908  // Close polygon
909  cornerList.push_back( cornerList[0] );
910 
911  if( aTraceMode == SKETCH )
912  PlotPoly( cornerList, NO_FILL, GetCurrentLineWidth(), gbr_metadata );
913  else
914  PlotGerberRegion( cornerList, gbr_metadata );
915 }
916 
917 void GERBER_PLOTTER::FlashPadCustom( const wxPoint& aPadPos, const wxSize& aSize,
918  SHAPE_POLY_SET* aPolygons,
919  EDA_DRAW_MODE_T aTraceMode, void* aData )
920 
921 {
922  // A Pad custom is plotted as polygon (a region in Gerber language).
923 
924  GBR_METADATA gbr_metadata;
925 
926  if( aData )
927  gbr_metadata = *static_cast<GBR_METADATA*>( aData );
928 
929  SHAPE_POLY_SET polyshape = *aPolygons;
930 
931  if( aTraceMode != FILLED )
932  {
934  polyshape.Inflate( -GetCurrentLineWidth()/2, 16 );
935  }
936 
937  std::vector< wxPoint > cornerList;
938 
939  for( int cnt = 0; cnt < polyshape.OutlineCount(); ++cnt )
940  {
941  SHAPE_LINE_CHAIN& poly = polyshape.Outline( cnt );
942 
943  cornerList.clear();
944 
945  for( int ii = 0; ii < poly.PointCount(); ++ii )
946  cornerList.emplace_back( poly.CPoint( ii ).x, poly.CPoint( ii ).y );
947 
948  // Close polygon
949  cornerList.push_back( cornerList[0] );
950 
951  if( aTraceMode == SKETCH )
952  PlotPoly( cornerList, NO_FILL, GetCurrentLineWidth(), &gbr_metadata );
953  else
954  PlotGerberRegion( cornerList, &gbr_metadata );
955  }
956 }
957 
958 
959 void GERBER_PLOTTER::FlashPadTrapez( const wxPoint& aPadPos, const wxPoint* aCorners,
960  double aPadOrient, EDA_DRAW_MODE_T aTrace_Mode, void* aData )
961 
962 {
963  // TODO: use Aperture macro and flash it
964 
965  // polygon corners list
966  std::vector<wxPoint> cornerList = { aCorners[0], aCorners[1], aCorners[2], aCorners[3] };
967 
968  // Draw the polygon and fill the interior as required
969  for( unsigned ii = 0; ii < 4; ii++ )
970  {
971  RotatePoint( &cornerList[ii], aPadOrient );
972  cornerList[ii] += aPadPos;
973  }
974 
975  // Close the polygon
976  cornerList.push_back( cornerList[0] );
977  GBR_METADATA* gbr_metadata = static_cast<GBR_METADATA*>( aData );
978 
979  GBR_METADATA metadata;
980 
981  if( gbr_metadata )
982  metadata = *gbr_metadata;
983 
984  if( aTrace_Mode == SKETCH )
986  &metadata );
987  else
988  PlotGerberRegion( cornerList, &metadata );
989 }
990 
991 
993  int aDiameter, int aCornerCount,
994  double aOrient, EDA_DRAW_MODE_T aTraceMode,
995  void* aData )
996 {
997  GBR_METADATA* gbr_metadata = static_cast<GBR_METADATA*>( aData );
998 
999  if( aTraceMode == SKETCH )
1000  {
1001  // Build the polygon:
1002  std::vector< wxPoint > cornerList;
1003 
1004  double angle_delta = 3600.0 / aCornerCount; // in 0.1 degree
1005 
1006  for( int ii = 0; ii < aCornerCount; ii++ )
1007  {
1008  double rot = aOrient + (angle_delta*ii);
1009  wxPoint vertice( aDiameter/2, 0 );
1010  RotatePoint( &vertice, rot );
1011  vertice += aShapePos;
1012  cornerList.push_back( vertice );
1013  }
1014 
1015  cornerList.push_back( cornerList[0] ); // Close the shape
1016 
1017  SetCurrentLineWidth( aDiameter/8, gbr_metadata );
1018  PlotPoly( cornerList, NO_FILL, GetCurrentLineWidth(), gbr_metadata );
1019  }
1020  else
1021  {
1022  DPOINT pos_dev = userToDeviceCoordinates( aShapePos );
1023 
1024  int aperture_attrib = gbr_metadata ? gbr_metadata->GetApertureAttrib() : 0;
1025 
1026  APERTURE::APERTURE_TYPE apert_type =
1028  selectAperture( aDiameter, aOrient, apert_type, aperture_attrib );
1029 
1030  if( gbr_metadata )
1031  formatNetAttribute( &gbr_metadata->m_NetlistMetadata );
1032 
1033  emitDcode( pos_dev, 3 );
1034  }
1035 }
1036 
1037 
1038 void GERBER_PLOTTER::Text( const wxPoint& aPos, const COLOR4D aColor,
1039  const wxString& aText, double aOrient, const wxSize& aSize,
1040  enum EDA_TEXT_HJUSTIFY_T aH_justify, enum EDA_TEXT_VJUSTIFY_T aV_justify,
1041  int aWidth, bool aItalic, bool aBold, bool aMultilineAllowed,
1042  void* aData )
1043 {
1044  GBR_METADATA* gbr_metadata = static_cast<GBR_METADATA*>( aData );
1045 
1046  if( gbr_metadata )
1047  formatNetAttribute( &gbr_metadata->m_NetlistMetadata );
1048 
1049  PLOTTER::Text( aPos, aColor, aText, aOrient, aSize,
1050  aH_justify, aV_justify, aWidth, aItalic, aBold, aMultilineAllowed, aData );
1051 }
1052 
1053 
1054 void GERBER_PLOTTER::SetLayerPolarity( bool aPositive )
1055 {
1056  if( aPositive )
1057  fprintf( outputFile, "%%LPD*%%\n" );
1058  else
1059  fprintf( outputFile, "%%LPC*%%\n" );
1060 }
virtual void SetDefaultLineWidth(int width) override
Set the default line width.
void FinishTo(const wxPoint &pos)
Definition: plotter.h:270
virtual void FlashPadRoundRect(const wxPoint &aPadPos, const wxSize &aSize, int aCornerRadius, double aOrient, EDA_DRAW_MODE_T aTraceMode, void *aData) override
Roundrect pad at the moment are not handled as aperture, since they require aperture macros TODO: alw...
a class to handle special data (items attributes) during plot.
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...
EDA_TEXT_HJUSTIFY_T
Definition: eda_text.h:44
virtual void ThickSegment(const wxPoint &start, const wxPoint &end, int width, EDA_DRAW_MODE_T tracemode, void *aData) override
virtual void PenTo(const wxPoint &pos, char plume) override
moveto/lineto primitive, moves the 'pen' to the specified direction
void PenFinish()
Definition: plotter.h:276
virtual void FlashPadTrapez(const wxPoint &aPadPos, const wxPoint *aCorners, double aPadOrient, EDA_DRAW_MODE_T aTraceMode, void *aData) override
Trapezoidal pad at the moment are never handled as aperture, since they require aperture macros TODO:...
int OutlineCount() const
Returns the number of outlines in the set
int GetOrCreateAperture(const wxSize &aSize, APERTURE::APERTURE_TYPE aType, int aApertureAttribute)
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...
APERTURE_TYPE
Definition: plotter.h:1058
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...
APERTURE_TYPE m_Type
Definition: plotter.h:1124
wxSize m_Size
Definition: plotter.h:1129
bool m_useNetAttributes
Definition: plotter.h:1385
void formatNetAttribute(GBR_NETLIST_METADATA *aData)
print a Gerber net attribute object record.
virtual void FlashPadCustom(const wxPoint &aPadPos, const wxSize &aSize, SHAPE_POLY_SET *aPolygons, EDA_DRAW_MODE_T aTraceMode, void *aData) override
virtual function FlashPadCustom
virtual void FlashRegularPolygon(const wxPoint &aShapePos, int aDiameter, int aCornerCount, double aOrient, EDA_DRAW_MODE_T aTraceMode, void *aData) override
Flash a regular polygon.
bool FormatNetAttribute(std::string &aPrintedText, std::string &aLastNetAttributes, GBR_NETLIST_METADATA *aData, bool &aClearPreviousAttributes, bool aUseX1StructuredComment)
Generates the string to print to a gerber file, to set a net attribute for a graphic object.
void selectAperture(const wxSize &aSize, APERTURE::APERTURE_TYPE aType, int aApertureAttribute)
Pick an existing aperture or create a new one, matching the size, type and attributes.
char penState
Current pen state: 'U', 'D' or 'Z' (see PenTo)
Definition: plotter.h:592
this class handle info which can be added in a gerber file as attribute of an object the GBR_INFO_TYP...
void RotatePoint(int *pX, int *pY, double angle)
Definition: trigo.cpp:208
double m_IUsPerDecimil
Definition: plotter.h:569
void Inflate(int aAmount, int aCircleSegmentsCount, CORNER_STRATEGY aCornerStrategy=ROUND_ALL_CORNERS)
Performs outline inflation/deflation.
bool m_gerberUnitInch
Definition: plotter.h:1379
int PointCount() const
Function PointCount()
wxArrayString m_headerExtraLines
Definition: plotter.h:602
virtual void FlashPadOval(const wxPoint &pos, const wxSize &size, double orient, EDA_DRAW_MODE_T trace_mode, void *aData) override
Filled oval flashes are handled as aperture in the 90 degree positions only.
wxPoint plotOffset
Plot offset (in IUs)
Definition: plotter.h:575
virtual bool StartPlot() override
Function StartPlot Write GERBER header to file initialize global variable g_Plot_PlotOutputFile.
This file contains miscellaneous commonly used macros and functions.
virtual void ThickRect(const wxPoint &p1, const wxPoint &p2, int width, EDA_DRAW_MODE_T tracemode, void *aData) override
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.
Definition: gr_text.cpp:232
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
Definition: plotter.h:158
#define TO_UTF8(wxstring)
Macro TO_UTF8 converts a wxString to a UTF8 encoded C string for all wxWidgets build modes.
Definition: macros.h:48
const VECTOR2I & CPoint(int aIndex) const
Function Point()
wxString m_ExtraData
a string to print after TO object attributes, if not empty it is printed "as this"
void LineTo(const wxPoint &pos)
Definition: plotter.h:265
virtual void Rect(const wxPoint &p1, const wxPoint &p2, FILL_T fill, int width=USE_DEFAULT_LINE_WIDTH) override
static const int USE_DEFAULT_LINE_WIDTH
Definition: plotter.h:108
virtual void PlotPoly(const std::vector< wxPoint > &aCornerList, FILL_T 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.
std::vector< APERTURE > m_apertures
Definition: plotter.h:1376
bool m_plotMirror
X axis orientation (SVG) and plot mirrored (only for PS, PDF HPGL and SVG)
Definition: plotter.h:579
void ClearAllAttributes()
Remove (clear) all attributes from object attributes dictionary (TO.
#define NULL
virtual void SetCurrentLineWidth(int width, void *aData=NULL) override
Set the line width for the next drawing.
wxString GetBuildVersion()
Function GetBuildVersion Return the build version string.
SHAPE_POLY_SET.
SHAPE_LINE_CHAIN & Outline(int aIndex)
Returns the reference to aIndex-th outline in the set
EDA_DRAW_MODE_T
Definition: eda_text.h:59
int m_gerberUnitFmt
Definition: plotter.h:1380
Base window classes and related definitions.
double plotScale
Plot scale - chosen by the user (even implicitly with 'fit in a4')
Definition: plotter.h:563
virtual void SetViewport(const wxPoint &aOffset, double aIusPerDecimil, double aScale, bool aMirror) override
Set the plot offset and scaling for the current plot.
GBR_APERTURE_METADATA::GBR_APERTURE_ATTRIB GetApertureAttrib()
Definition: gbr_metadata.h:165
void emitDcode(const DPOINT &pt, int dcode)
Emit a D-Code record, using proper conversions to format a leading zero omitted gerber coordinate (fo...
virtual void ThickArc(const wxPoint &centre, double StAngle, double EndAngle, int rayon, int width, EDA_DRAW_MODE_T tracemode, void *aData) override
FILE * finalFile
Definition: plotter.h:1368
virtual void FlashPadCircle(const wxPoint &pos, int diametre, EDA_DRAW_MODE_T trace_mode, void *aData) override
Filled circular flashes are stored as apertures.
EDA_TEXT_VJUSTIFY_T
Definition: eda_text.h:51
void TransformRoundChamferedRectToPolygon(SHAPE_POLY_SET &aCornerBuffer, const wxPoint &aPosition, const wxSize &aSize, double aRotation, int aCornerRadius, double aChamferRatio, int aChamferCorners, int aApproxErrorMax, int aMinSegPerCircleCount=16)
convert a rectangle with rounded corners and/or chamfered corners to a polygon Convert rounded corner...
void MoveTo(const wxPoint &pos)
Definition: plotter.h:260
bool m_useX2format
Definition: plotter.h:1382
virtual DPOINT userToDeviceCoordinates(const wxPoint &aCoordinate)
Modifies coordinates according to the orientation, scale factor, and offsets trace.
Definition: plotter.cpp:99
static std::string FormatAttribute(GBR_APERTURE_ATTRIB aAttribute, bool aUseX1StructuredComment)
double cosdecideg(double r, double a)
Circle generation utility: computes r * cos(a) Where a is in decidegrees, not in radians.
Definition: trigo.h:365
double sindecideg(double r, double a)
Circle generation utility: computes r * sin(a) Where a is in decidegrees, not in radians.
Definition: trigo.h:356
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...
virtual void Arc(const wxPoint &aCenter, double aStAngle, double aEndAngle, int aRadius, FILL_T aFill, int aWidth=USE_DEFAULT_LINE_WIDTH) override
Generic fallback: arc rendered as a polyline.
int currentPenWidth
Definition: plotter.h:590
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....
int defaultPenWidth
true to generate a negative image (PS mode mainly)
Definition: plotter.h:589
virtual bool EndPlot() override
SHAPE_LINE_CHAIN.
FILE * outputFile
true if the Y axis is top to bottom (SVG)
Definition: plotter.h:584
std::string m_objectAttributesDictionnary
Definition: plotter.h:1362
constexpr ret_type KiROUND(fp_type v)
Round a floating point number to an integer using "round halfway cases away from zero".
Definition: util.h:61
The common library.
int GetPlotterArcHighDef() const
Definition: plotter.h:226
virtual void SetGerberCoordinatesFormat(int aResolution, bool aUseInches=false) override
Function SetGerberCoordinatesFormat selection of Gerber units and resolution (number of digits in man...
FILL_T
Enum FILL_T is the set of fill types used in plotting or drawing enclosed areas.
Definition: base_struct.h:42
virtual void FlashPadRect(const wxPoint &pos, const wxSize &size, double orient, EDA_DRAW_MODE_T trace_mode, void *aData) override
Filled rect flashes are handled as aperture in the 0 90 180 or 270 degree orientation only and as pol...
wxString m_workFilename
Definition: plotter.h:1369
GBR_NETLIST_METADATA m_NetlistMetadata
a item to handle object attribute:
Definition: gbr_metadata.h:212
int m_apertureAttribute
Definition: plotter.h:1365
virtual void Circle(const wxPoint &pos, int diametre, FILL_T fill, int width=USE_DEFAULT_LINE_WIDTH) override
int m_DCode
Definition: plotter.h:1132
int m_ApertureAttribute
Definition: plotter.h:1137
FILE * workFile
Definition: plotter.h:1367
double iuPerDeviceUnit
Device scale (from IUs to plotter device units - usually decimils)
Definition: plotter.h:572
static const int DO_NOT_SET_LINE_WIDTH
Definition: plotter.h:107
void segmentAsOval(const wxPoint &start, const wxPoint &end, int width, EDA_DRAW_MODE_T tracemode)
Cdonvert a thick segment and plot it as an oval.
Definition: plotter.cpp:437
wxString filename
Definition: plotter.h:596
virtual void ThickCircle(const wxPoint &pos, int diametre, int width, EDA_DRAW_MODE_T tracemode, void *aData) override
void sketchOval(const wxPoint &pos, const wxSize &size, double orient, int width)
Definition: plotter.cpp:458
wxString creator
Definition: plotter.h:595
wxSize paperSize
Paper size in IU - not in mils.
Definition: plotter.h:600
GBR_APERTURE_METADATA m_ApertureMetadata
a item to handle aperture attribute:
Definition: gbr_metadata.h:207
int m_currentApertureIdx
Definition: plotter.h:1377
COLOR4D is the color representation with 4 components: red, green, blue, alpha.
Definition: color4d.h:39