KiCad PCB EDA Suite
pcb_plot_params.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) 1992-2022 KiCad Developers, see AUTHORS.txt for contributors.
5 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * as published by the Free Software Foundation; either version 2
9 * of the License, or (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, you may find one here:
18 * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
19 * or you may search the http://www.gnu.org website for the version 2 license,
20 * or you may write to the Free Software Foundation, Inc.,
21 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
22 */
23
25#include <charconv>
26#include <layer_ids.h>
27#include <macros.h>
28#include <math/util.h> // for KiROUND
29#include <pcb_plot_params.h>
31#include <plotters/plotter.h>
33
34
35#define PLOT_LINEWIDTH_DEFAULT ( DEFAULT_TEXT_WIDTH * IU_PER_MM )
36
37#define HPGL_PEN_DIAMETER_MIN 0
38#define HPGL_PEN_DIAMETER_MAX 100.0 // Unit = mil
39#define HPGL_PEN_SPEED_MIN 1 // this param is always in cm/s
40#define HPGL_PEN_SPEED_MAX 99 // this param is always in cm/s
41#define HPGL_PEN_NUMBER_MIN 1
42#define HPGL_PEN_NUMBER_MAX 16
43
44#define SVG_PRECISION_MIN 3U
45#define SVG_PRECISION_MAX 6U
46#define SVG_PRECISION_DEFAULT 4
47
48
49// default trailing digits in Gerber coordinates, when units are mm
50// This is also the max usable precision (i.e. internal Pcbnew Units)
51static const int gbrDefaultPrecision = 6;
52
53
54using namespace PCBPLOTPARAMS_T;
55
56
57static const char* getTokenName( T aTok )
58{
59 return PCB_PLOT_PARAMS_LEXER::TokenName( aTok );
60}
61
62
63static bool setInt( int* aTarget, int aValue, int aMin, int aMax )
64{
65 int temp = aValue;
66
67 if( aValue < aMin )
68 temp = aMin;
69 else if( aValue > aMax )
70 temp = aMax;
71
72 *aTarget = temp;
73 return ( temp == aValue );
74}
75
76
77static bool setDouble( double* aTarget, double aValue, double aMin, double aMax )
78{
79 double temp = aValue;
80
81 if( aValue < aMin )
82 temp = aMin;
83 else if( aValue > aMax )
84 temp = aMax;
85
86 *aTarget = temp;
87 return ( temp == aValue );
88}
89
90
92{
99 m_dashedLineDashRatio = 12.0; // From ISO 128-2
100 m_dashedLineGapRatio = 3.0; // From ISO 128-2
101
102 // we used 0.1mils for SVG step before, but nm precision is more accurate, so we use nm
104 m_plotFrameRef = false;
105 m_plotViaOnMaskLayer = false;
109 m_useAuxOrigin = false;
110 m_HPGLPenNum = 1;
111 m_HPGLPenSpeed = 20; // this param is always in cm/s
112 m_HPGLPenDiam = 15; // in mils
113 m_negative = false;
114 m_A4Output = false;
115 m_plotReference = true;
116 m_plotValue = true;
117 m_plotInvisibleText = false;
121 m_mirror = false;
123 m_autoScale = false;
124 m_scale = 1.0;
126 m_fineScaleAdjustX = 1.0;
127 m_fineScaleAdjustY = 1.0;
128 m_widthAdjust = 0.;
130 m_outputDirectory.clear();
133 | LSET::AllCuMask();
134
135 // This parameter controls if the NPTH pads will be plotted or not
136 // it is a "local" parameter
137 m_skipNPTH_Pads = false;
138
139 // line width to plot items in outline mode.
141
142 m_default_colors = std::make_shared<COLOR_SETTINGS>();
144
145 m_blackAndWhite = true;
146}
147
148
150{
151 // Currently Gerber files use mm.
152 // accepted precision is only 6 (max value, this is the resolution of Pcbnew)
153 // or 5, min value for professional boards, when 6 creates problems
154 // to board makers.
155
158}
159
160
161void PCB_PLOT_PARAMS::SetSvgPrecision( unsigned aPrecision )
162{
164}
165
166
168 int aNestLevel, int aControl ) const
169{
170 auto printBool =
171 []( bool aBool ) -> const char*
172 {
173 return aBool ? "true" : "false";
174 };
175
176 aFormatter->Print( aNestLevel, "(pcbplotparams\n" );
177
178 aFormatter->Print( aNestLevel+1, "(layerselection 0x%s)\n",
179 m_layerSelection.FmtHex().c_str() );
180
181 aFormatter->Print( aNestLevel+1, "(plot_on_all_layers_selection 0x%s)\n",
183
184 aFormatter->Print( aNestLevel+1, "(disableapertmacros %s)\n",
185 printBool( m_gerberDisableApertMacros ) );
186
187 aFormatter->Print( aNestLevel+1, "(usegerberextensions %s)\n",
188 printBool( m_useGerberProtelExtensions) );
189
190 aFormatter->Print( aNestLevel+1, "(usegerberattributes %s)\n",
191 printBool( GetUseGerberX2format()) );
192
193 aFormatter->Print( aNestLevel+1, "(usegerberadvancedattributes %s)\n",
194 printBool( GetIncludeGerberNetlistInfo()) );
195
196 aFormatter->Print( aNestLevel+1, "(creategerberjobfile %s)\n",
197 printBool( GetCreateGerberJobFile()) );
198
199 // save this option only if it is not the default value,
200 // to avoid incompatibility with older Pcbnew version
202 aFormatter->Print( aNestLevel+1, "(gerberprecision %d)\n", m_gerberPrecision );
203
204 aFormatter->Print( aNestLevel+1, "(dashed_line_dash_ratio %f)\n", GetDashedLineDashRatio() );
205 aFormatter->Print( aNestLevel+1, "(dashed_line_gap_ratio %f)\n", GetDashedLineGapRatio() );
206
207 // SVG options
208 aFormatter->Print( aNestLevel+1, "(svgprecision %d)\n", m_svgPrecision );
209
210 aFormatter->Print( aNestLevel+1, "(plotframeref %s)\n", printBool( m_plotFrameRef ) );
211 aFormatter->Print( aNestLevel+1, "(viasonmask %s)\n", printBool( m_plotViaOnMaskLayer ) );
212 aFormatter->Print( aNestLevel+1, "(mode %d)\n", GetPlotMode() == SKETCH ? 2 : 1 );
213 aFormatter->Print( aNestLevel+1, "(useauxorigin %s)\n", printBool( m_useAuxOrigin ) );
214
215 // HPGL options
216 aFormatter->Print( aNestLevel+1, "(hpglpennumber %d)\n", m_HPGLPenNum );
217 aFormatter->Print( aNestLevel+1, "(hpglpenspeed %d)\n", m_HPGLPenSpeed );
218 aFormatter->Print( aNestLevel+1, "(hpglpendiameter %f)\n", m_HPGLPenDiam );
219
220 // DXF options
221 aFormatter->Print( aNestLevel+1, "(%s %s)\n", getTokenName( T_dxfpolygonmode ),
222 printBool( m_DXFplotPolygonMode ) );
223 aFormatter->Print( aNestLevel+1, "(%s %s)\n", getTokenName( T_dxfimperialunits ),
224 printBool( m_DXFplotUnits == DXF_UNITS::INCHES ) );
225 aFormatter->Print( aNestLevel+1, "(%s %s)\n", getTokenName( T_dxfusepcbnewfont ),
226 printBool( m_textMode != PLOT_TEXT_MODE::NATIVE ) );
227
228 aFormatter->Print( aNestLevel+1, "(%s %s)\n", getTokenName( T_psnegative ),
229 printBool( m_negative ) );
230 aFormatter->Print( aNestLevel+1, "(%s %s)\n", getTokenName( T_psa4output ),
231 printBool( m_A4Output ) );
232 aFormatter->Print( aNestLevel+1, "(plotreference %s)\n", printBool( m_plotReference ) );
233 aFormatter->Print( aNestLevel+1, "(plotvalue %s)\n", printBool( m_plotValue ) );
234 aFormatter->Print( aNestLevel+1, "(plotinvisibletext %s)\n", printBool( m_plotInvisibleText ) );
235 aFormatter->Print( aNestLevel+1, "(sketchpadsonfab %s)\n",
236 printBool( m_sketchPadsOnFabLayers ) );
237 aFormatter->Print( aNestLevel+1, "(subtractmaskfromsilk %s)\n",
238 printBool( m_subtractMaskFromSilk ) );
239 aFormatter->Print( aNestLevel+1, "(outputformat %d)\n", static_cast<int>( m_format ) );
240 aFormatter->Print( aNestLevel+1, "(mirror %s)\n", printBool( m_mirror ) );
241 aFormatter->Print( aNestLevel+1, "(drillshape %d)\n", (int)m_drillMarks );
242 aFormatter->Print( aNestLevel+1, "(scaleselection %d)\n", m_scaleSelection );
243 aFormatter->Print( aNestLevel+1, "(outputdirectory \"%s\")",
244 (const char*) m_outputDirectory.utf8_str() );
245 aFormatter->Print( 0, "\n" );
246 aFormatter->Print( aNestLevel, ")\n" );
247}
248
249
251{
252 aParser->Parse( this );
253}
254
255
256bool PCB_PLOT_PARAMS::IsSameAs( const PCB_PLOT_PARAMS &aPcbPlotParams ) const
257{
258 if( m_layerSelection != aPcbPlotParams.m_layerSelection )
259 return false;
260
262 return false;
263
265 return false;
266
268 return false;
269
270 if( m_useGerberX2format != aPcbPlotParams.m_useGerberX2format )
271 return false;
272
274 return false;
275
276 if( m_createGerberJobFile != aPcbPlotParams.m_createGerberJobFile )
277 return false;
278
279 if( m_gerberPrecision != aPcbPlotParams.m_gerberPrecision )
280 return false;
281
282 if( m_dashedLineDashRatio != aPcbPlotParams.m_dashedLineDashRatio )
283 return false;
284
285 if( m_dashedLineGapRatio != aPcbPlotParams.m_dashedLineGapRatio )
286 return false;
287
288 if( m_plotFrameRef != aPcbPlotParams.m_plotFrameRef )
289 return false;
290
291 if( m_plotViaOnMaskLayer != aPcbPlotParams.m_plotViaOnMaskLayer )
292 return false;
293
294 if( m_plotMode != aPcbPlotParams.m_plotMode )
295 return false;
296
297 if( m_DXFplotPolygonMode != aPcbPlotParams.m_DXFplotPolygonMode )
298 return false;
299
300 if( m_DXFplotUnits != aPcbPlotParams.m_DXFplotUnits )
301 return false;
302
303 if( m_svgPrecision != aPcbPlotParams.m_svgPrecision )
304 return false;
305
306 if( m_useAuxOrigin != aPcbPlotParams.m_useAuxOrigin )
307 return false;
308
309 if( m_HPGLPenNum != aPcbPlotParams.m_HPGLPenNum )
310 return false;
311
312 if( m_HPGLPenSpeed != aPcbPlotParams.m_HPGLPenSpeed )
313 return false;
314
315 if( m_HPGLPenDiam != aPcbPlotParams.m_HPGLPenDiam )
316 return false;
317
318 if( m_negative != aPcbPlotParams.m_negative )
319 return false;
320
321 if( m_A4Output != aPcbPlotParams.m_A4Output )
322 return false;
323
324 if( m_plotReference != aPcbPlotParams.m_plotReference )
325 return false;
326
327 if( m_plotValue != aPcbPlotParams.m_plotValue )
328 return false;
329
330 if( m_plotInvisibleText != aPcbPlotParams.m_plotInvisibleText )
331 return false;
332
334 return false;
335
336 if( m_subtractMaskFromSilk != aPcbPlotParams.m_subtractMaskFromSilk )
337 return false;
338
339 if( m_format != aPcbPlotParams.m_format )
340 return false;
341
342 if( m_mirror != aPcbPlotParams.m_mirror )
343 return false;
344
345 if( m_drillMarks != aPcbPlotParams.m_drillMarks )
346 return false;
347
348 if( m_scaleSelection != aPcbPlotParams.m_scaleSelection )
349 return false;
350
351 if( m_autoScale != aPcbPlotParams.m_autoScale )
352 return false;
353
354 if( m_scale != aPcbPlotParams.m_scale )
355 return false;
356
357 if( m_fineScaleAdjustX != aPcbPlotParams.m_fineScaleAdjustX )
358 return false;
359
360 if( m_fineScaleAdjustY != aPcbPlotParams.m_fineScaleAdjustY )
361 return false;
362
363 if( m_widthAdjust != aPcbPlotParams.m_widthAdjust )
364 return false;
365
366 if( m_textMode != aPcbPlotParams.m_textMode )
367 return false;
368
369 if( m_blackAndWhite != aPcbPlotParams.m_blackAndWhite )
370 return false;
371
372 if( !m_outputDirectory.IsSameAs( aPcbPlotParams.m_outputDirectory ) )
373 return false;
374
375 return true;
376}
377
378
380{
382}
383
384
386{
388}
389
390
392 PCB_PLOT_PARAMS_LEXER( aReader )
393{
394}
395
396
397PCB_PLOT_PARAMS_PARSER::PCB_PLOT_PARAMS_PARSER( char* aLine, const wxString& aSource ) :
398 PCB_PLOT_PARAMS_LEXER( aLine, aSource )
399{
400}
401
402
404{
405 T token;
406
407 while( ( token = NextTok() ) != T_RIGHT )
408 {
409 if( token == T_EOF)
410 Unexpected( T_EOF );
411
412 if( token == T_LEFT )
413 token = NextTok();
414
415 if( token == T_pcbplotparams )
416 continue;
417
418 bool skip_right = false;
419
420 switch( token )
421 {
422 case T_layerselection:
423 {
424 token = NeedSYMBOLorNUMBER();
425
426 const std::string& cur = CurStr();
427
428 if( token == T_NUMBER ) // pretty 3 format had legacy Cu stack.
429 {
430 // It's not possible to convert a legacy Cu layer number to a new Cu layer
431 // number without knowing the number or total Cu layers in the legacy board.
432 // We do not have that information here, so simply set all layers ON. User
433 // can turn them off in the UI.
434 aPcbPlotParams->m_layerSelection = LSET( 2, F_SilkS, B_SilkS ) | LSET::AllCuMask();
435 }
436 else if( cur.find_first_of( "0x" ) == 0 ) // pretty ver. 4.
437 {
438 // skip the leading 2 0x bytes.
439 aPcbPlotParams->m_layerSelection.ParseHex( cur.c_str() + 2, cur.size() - 2 );
440 }
441 else
442 {
443 Expecting( "integer or hex layerSelection" );
444 }
445
446 break;
447 }
448
449 case T_plot_on_all_layers_selection:
450 {
451 token = NeedSYMBOLorNUMBER();
452
453 const std::string& cur = CurStr();
454
455 if( cur.find_first_of( "0x" ) == 0 )
456 {
457 // skip the leading 2 0x bytes.
458 aPcbPlotParams->m_plotOnAllLayersSelection.ParseHex( cur.c_str() + 2,
459 cur.size() - 2 );
460 }
461 else
462 {
463 Expecting( "hex plot_on_all_layers_selection" );
464 }
465
466 break;
467 }
468
469 case T_disableapertmacros:
470 aPcbPlotParams->m_gerberDisableApertMacros = parseBool();
471 break;
472
473 case T_usegerberextensions:
474 aPcbPlotParams->m_useGerberProtelExtensions = parseBool();
475 break;
476
477 case T_usegerberattributes:
478 aPcbPlotParams->m_useGerberX2format = parseBool();
479 break;
480
481 case T_usegerberadvancedattributes:
482 aPcbPlotParams->m_includeGerberNetlistInfo = parseBool();
483 break;
484
485 case T_creategerberjobfile:
486 aPcbPlotParams->m_createGerberJobFile = parseBool();
487 break;
488
489 case T_gerberprecision:
490 aPcbPlotParams->m_gerberPrecision = parseInt( gbrDefaultPrecision - 1,
492 break;
493
494 case T_dashed_line_dash_ratio:
495 aPcbPlotParams->m_dashedLineDashRatio = parseDouble();
496 break;
497
498 case T_dashed_line_gap_ratio:
499 aPcbPlotParams->m_dashedLineGapRatio = parseDouble();
500 break;
501
502 case T_svgprecision:
504 break;
505
506 case T_svguseinch:
507 parseBool(); // Unused. For compatibility
508 break;
509
510 case T_psa4output:
511 aPcbPlotParams->m_A4Output = parseBool();
512 break;
513
514 case T_excludeedgelayer:
515 if( !parseBool() )
516 aPcbPlotParams->m_plotOnAllLayersSelection.set( Edge_Cuts );
517
518 break;
519
520 case T_plotframeref:
521 aPcbPlotParams->m_plotFrameRef = parseBool();
522 break;
523
524 case T_viasonmask:
525 aPcbPlotParams->m_plotViaOnMaskLayer = parseBool();
526 break;
527
528 case T_mode:
529 aPcbPlotParams->SetPlotMode( parseInt( 0, 2 ) > 1 ? SKETCH : FILLED );
530 break;
531
532 case T_useauxorigin:
533 aPcbPlotParams->m_useAuxOrigin = parseBool();
534 break;
535
536 case T_hpglpennumber:
538 break;
539
540 case T_hpglpenspeed:
542 break;
543
544 case T_hpglpendiameter:
545 aPcbPlotParams->m_HPGLPenDiam = parseDouble();
546 break;
547
548 case T_hpglpenoverlay:
549 // No more used. just here for compatibility with old versions
551 break;
552
553 case T_dxfpolygonmode:
554 aPcbPlotParams->m_DXFplotPolygonMode = parseBool();
555 break;
556
557 case T_dxfimperialunits:
558 aPcbPlotParams->m_DXFplotUnits = parseBool() ? DXF_UNITS::INCHES
560 break;
561
562 case T_dxfusepcbnewfont:
563 aPcbPlotParams->m_textMode = parseBool() ? PLOT_TEXT_MODE::DEFAULT
565 break;
566
567 case T_pscolor:
568 NeedSYMBOL(); // This actually was never used...
569 break;
570
571 case T_psnegative:
572 aPcbPlotParams->m_negative = parseBool();
573 break;
574
575 case T_plotreference:
576 aPcbPlotParams->m_plotReference = parseBool();
577 break;
578
579 case T_plotvalue:
580 aPcbPlotParams->m_plotValue = parseBool();
581 break;
582
583 case T_plotinvisibletext:
584 aPcbPlotParams->m_plotInvisibleText = parseBool();
585 break;
586
587 case T_sketchpadsonfab:
588 aPcbPlotParams->m_sketchPadsOnFabLayers= parseBool();
589 break;
590
591 case T_subtractmaskfromsilk:
592 aPcbPlotParams->m_subtractMaskFromSilk = parseBool();
593 break;
594
595 case T_outputformat:
596 aPcbPlotParams->m_format = static_cast<PLOT_FORMAT>(
597 parseInt( static_cast<int>( PLOT_FORMAT::FIRST_FORMAT ),
598 static_cast<int>( PLOT_FORMAT::LAST_FORMAT ) ) );
599 break;
600
601 case T_mirror:
602 aPcbPlotParams->m_mirror = parseBool();
603 break;
604
605 case T_drillshape:
606 aPcbPlotParams->m_drillMarks = static_cast<DRILL_MARKS> ( parseInt( 0, 2 ) );
607 break;
608
609 case T_scaleselection:
610 aPcbPlotParams->m_scaleSelection = parseInt( 0, 4 );
611 break;
612
613 case T_outputdirectory:
614 NeedSYMBOLorNUMBER(); // a dir name can be like a number
615 aPcbPlotParams->m_outputDirectory = FROM_UTF8( CurText() );
616 break;
617
618 default:
619 skipCurrent(); // skip unknown or outdated plot parameter
620 skip_right = true; // the closing right token is already read.
621 break;
622 }
623
624 if( ! skip_right )
625 NeedRIGHT();
626 }
627}
628
629
631{
632 T token = NeedSYMBOL();
633
634 if( token != T_false && token != T_true )
635 Expecting( "true|false" );
636
637 return token == T_true;
638}
639
640
641int PCB_PLOT_PARAMS_PARSER::parseInt( int aMin, int aMax )
642{
643 T token = NextTok();
644
645 if( token != T_NUMBER )
646 Expecting( T_NUMBER );
647
648 int val = atoi( CurText() );
649
650 if( val < aMin )
651 val = aMin;
652 else if( val > aMax )
653 val = aMax;
654
655 return val;
656}
657
658
660{
661 T token = NextTok();
662
663 if( token != T_NUMBER )
664 Expecting( T_NUMBER );
665
666 return DSNLEXER::parseDouble();
667}
668
669
671{
672 int curr_level = 0;
673 T token;
674
675 while( ( token = NextTok() ) != T_EOF )
676 {
677 if( token == T_LEFT )
678 curr_level--;
679
680 if( token == T_RIGHT )
681 {
682 curr_level++;
683
684 if( curr_level > 0 )
685 return;
686 }
687 }
688}
constexpr EDA_IU_SCALE pcbIUScale
Definition: base_units.h:109
double parseDouble()
Parse the current token as an ASCII numeric string with possible leading whitespace into a double pre...
Definition: dsnlexer.cpp:825
An abstract class from which implementation specific LINE_READERs may be derived to read single lines...
Definition: richio.h:81
LSET is a set of PCB_LAYER_IDs.
Definition: layer_ids.h:532
int ParseHex(const char *aStart, int aCount)
Convert the output of FmtHex() and replaces this set's values with those given in the input string.
Definition: lset.cpp:359
static LSET AllCuMask(int aCuLayerCount=MAX_CU_LAYERS)
Return a mask holding the requested number of Cu PCB_LAYER_IDs.
Definition: lset.cpp:773
std::string FmtHex() const
Return a hex string showing contents of this LSEQ.
Definition: lset.cpp:321
An interface used to output 8 bit text in a convenient way.
Definition: richio.h:310
int PRINTF_FUNC Print(int nestLevel, const char *fmt,...)
Format and write text to the output stream.
Definition: richio.cpp:433
The parser for PCB_PLOT_PARAMS.
void skipCurrent()
Skip the current token level.
int parseInt(int aMin, int aMax)
Parse an integer and constrains it between two values.
PCB_PLOT_PARAMS_PARSER(LINE_READER *aReader)
double parseDouble()
Parse a double precision floating point number.
void Parse(PCB_PLOT_PARAMS *aPcbPlotParams)
Parameters and options when plotting/printing a board.
bool m_sketchPadsOnFabLayers
Plots pads outlines on fab layers.
int m_HPGLPenNum
HPGL only: pen number selection(1 to 9)
DXF_UNITS m_DXFplotUnits
DXF format: Units to use when plotting the DXF.
double m_dashedLineGapRatio
int m_gerberPrecision
precision of coordinates in Gerber files: accepted 5 or 6 when units are in mm (6 or 7 in inches,...
std::shared_ptr< COLOR_SETTINGS > m_default_colors
Dummy colors object that can be created if there is no Pgm context.
OUTLINE_MODE m_plotMode
FILLED or SKETCH selects how to plot filled objects.
bool m_A4Output
Autoscale the plot to fit an A4 (landscape?) sheet.
int m_scaleSelection
Scale ratio index (UI only)
PLOT_TEXT_MODE m_textMode
Choose how represent text with PS, PDF and DXF drivers.
bool m_plotValue
Enable plotting of part values.
wxString m_outputDirectory
Output directory for plot files (usually relative to the board file)
bool m_autoScale
When true set the scale to fit the board in the page.
bool m_useGerberProtelExtensions
When plotting gerber files, use a conventional set of Protel extensions instead of ....
int m_HPGLPenSpeed
HPGL only: pen speed, always in cm/s (1 to 99 cm/s)
bool GetCreateGerberJobFile() const
bool m_useAuxOrigin
Plot gerbers using auxiliary (drill) origin instead of absolute coordinates.
double m_scale
Global scale factor, 1.0 plots a board with its actual size.
int m_widthAdjust
This width factor is intended to compensate PS printers/ plotters that do not strictly obey line widt...
bool SetHPGLPenDiameter(double aValue)
double m_fineScaleAdjustX
fine scale adjust X axis
LSET m_plotOnAllLayersSelection
Set of layers that get plotted on each of the layers to plot.
double m_dashedLineDashRatio
void Format(OUTPUTFORMATTER *aFormatter, int aNestLevel, int aControl=0) const
bool m_plotFrameRef
True to plot/print frame references.
void SetGerberPrecision(int aPrecision)
bool m_blackAndWhite
Plot in black and white only.
bool SetHPGLPenSpeed(int aValue)
bool m_plotInvisibleText
Force plotting of fields marked invisible.
PLOT_FORMAT m_format
Plot format type (chooses the driver to be used)
bool m_createGerberJobFile
generate the auxiliary "job file" in gerber format
bool m_plotReference
Enable plotting of part references.
double m_fineScaleAdjustY
fine scale adjust Y axis
double m_HPGLPenDiam
HPGL only: pen diameter in MILS, useful to fill areas However, it is in mm in hpgl files.
bool m_DXFplotPolygonMode
DXF format: Plot items in outline (polygon) mode.
bool m_gerberDisableApertMacros
Disable aperture macros in Gerber format (only for broken Gerber readers) Ideally,...
void Parse(PCB_PLOT_PARAMS_PARSER *aParser)
bool m_subtractMaskFromSilk
On gerbers 'scrape' away the solder mask from silkscreen (trim silks)
COLOR_SETTINGS * m_colors
Pointer to active color settings to be used for plotting.
bool GetUseGerberX2format() const
bool m_mirror
Mirror the plot around the X axis.
bool IsSameAs(const PCB_PLOT_PARAMS &aPcbPlotParams) const
Compare current settings to aPcbPlotParams, including not saved parameters in brd file.
bool m_includeGerberNetlistInfo
Include netlist info (only in Gerber X2 format) (chapter ? in revision ?)
unsigned m_svgPrecision
precision of coordinates in SVG files: accepted 3 - 6 6 is the internal resolution of Pcbnew
bool GetIncludeGerberNetlistInfo() const
void SetPlotMode(OUTLINE_MODE aPlotMode)
double GetDashedLineGapRatio() const
double GetDashedLineDashRatio() const
void SetSvgPrecision(unsigned aPrecision)
DRILL_MARKS m_drillMarks
Holes can be not plotted, have a small mark or plotted in actual size.
bool m_useGerberX2format
Include attributes from the Gerber X2 format (chapter 5 in revision J2)
bool m_negative
Plot in negative color (supported only by some drivers)
bool m_plotViaOnMaskLayer
True if vias are drawn on Mask layer (ie untented, exposed by mask)
OUTLINE_MODE GetPlotMode() const
LSET m_layerSelection
Set of layers to plot.
@ Edge_Cuts
Definition: layer_ids.h:113
@ F_Paste
Definition: layer_ids.h:101
@ B_Mask
Definition: layer_ids.h:106
@ F_Mask
Definition: layer_ids.h:107
@ B_Paste
Definition: layer_ids.h:100
@ F_SilkS
Definition: layer_ids.h:104
@ B_SilkS
Definition: layer_ids.h:103
This file contains miscellaneous commonly used macros and functions.
static wxString FROM_UTF8(const char *cstring)
Convert a UTF8 encoded C string to a wxString for all wxWidgets build modes.
Definition: macros.h:110
@ SKETCH
Definition: outline_mode.h:26
@ FILLED
Definition: outline_mode.h:27
#define HPGL_PEN_NUMBER_MAX
static bool setDouble(double *aTarget, double aValue, double aMin, double aMax)
#define SVG_PRECISION_MIN
#define HPGL_PEN_SPEED_MAX
static bool setInt(int *aTarget, int aValue, int aMin, int aMax)
#define HPGL_PEN_DIAMETER_MIN
static const char * getTokenName(T aTok)
#define HPGL_PEN_DIAMETER_MAX
static const int gbrDefaultPrecision
#define HPGL_PEN_SPEED_MIN
#define HPGL_PEN_NUMBER_MIN
#define SVG_PRECISION_MAX
#define SVG_PRECISION_DEFAULT
DRILL_MARKS
Plots and prints can show holes in pads and vias 3 options are available:
Plot settings, and plotting engines (PostScript, Gerber, HPGL and DXF)
PLOT_FORMAT
The set of supported output plot formats.
Definition: plotter.h:70
constexpr int mmToIU(double mm) const
Definition: base_units.h:89
constexpr T Clamp(const T &lower, const T &value, const T &upper)
Limit value within the range lower <= value <= upper.
Definition: util.h:64