KiCad PCB EDA Suite
Loading...
Searching...
No Matches
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 <string_utils.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_plotDrawingSheet = false;
105 m_plotViaOnMaskLayer = false;
107 m_DXFPolygonMode = true;
108 m_DXFUnits = DXF_UNITS::INCHES;
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_plotFPText = true;
118 m_plotInvisibleText = false;
121 m_format = PLOT_FORMAT::GERBER;
122 m_mirror = false;
123 m_drillMarks = DRILL_MARKS::SMALL_DRILL_SHAPE;
124 m_autoScale = false;
125 m_scale = 1.0;
127 m_fineScaleAdjustX = 1.0;
128 m_fineScaleAdjustY = 1.0;
129 m_widthAdjust = 0.;
130 m_textMode = PLOT_TEXT_MODE::DEFAULT;
131 m_outputDirectory.clear();
134 | LSET::AllCuMask();
135
138
139 // This parameter controls if the NPTH pads will be plotted or not
140 // it is a "local" parameter
141 m_skipNPTH_Pads = false;
142
143 // line width to plot items in outline mode.
145
146 m_default_colors = std::make_shared<COLOR_SETTINGS>();
148
149 m_blackAndWhite = true;
150}
151
152
154{
155 // Currently Gerber files use mm.
156 // accepted precision is only 6 (max value, this is the resolution of Pcbnew)
157 // or 5, min value for professional boards, when 6 creates problems
158 // to board makers.
159
162}
163
164
165void PCB_PLOT_PARAMS::SetSvgPrecision( unsigned aPrecision )
166{
168}
169
170
172 int aNestLevel, int aControl ) const
173{
174 auto printBool =
175 []( bool aBool ) -> const char*
176 {
177 return aBool ? "true" : "false";
178 };
179
180 aFormatter->Print( aNestLevel, "(pcbplotparams\n" );
181
182 aFormatter->Print( aNestLevel+1, "(layerselection 0x%s)\n",
183 m_layerSelection.FmtHex().c_str() );
184
185 aFormatter->Print( aNestLevel+1, "(plot_on_all_layers_selection 0x%s)\n",
187
188 aFormatter->Print( aNestLevel+1, "(disableapertmacros %s)\n",
189 printBool( m_gerberDisableApertMacros ) );
190
191 aFormatter->Print( aNestLevel+1, "(usegerberextensions %s)\n",
192 printBool( m_useGerberProtelExtensions) );
193
194 aFormatter->Print( aNestLevel+1, "(usegerberattributes %s)\n",
195 printBool( GetUseGerberX2format()) );
196
197 aFormatter->Print( aNestLevel+1, "(usegerberadvancedattributes %s)\n",
198 printBool( GetIncludeGerberNetlistInfo()) );
199
200 aFormatter->Print( aNestLevel+1, "(creategerberjobfile %s)\n",
201 printBool( GetCreateGerberJobFile()) );
202
203 // save this option only if it is not the default value,
204 // to avoid incompatibility with older Pcbnew version
206 aFormatter->Print( aNestLevel+1, "(gerberprecision %d)\n", m_gerberPrecision );
207
208 aFormatter->Print( aNestLevel+1, "(dashed_line_dash_ratio %f)\n", GetDashedLineDashRatio() );
209 aFormatter->Print( aNestLevel+1, "(dashed_line_gap_ratio %f)\n", GetDashedLineGapRatio() );
210
211 // SVG options
212 aFormatter->Print( aNestLevel+1, "(svgprecision %d)\n", m_svgPrecision );
213
214 aFormatter->Print( aNestLevel+1, "(plotframeref %s)\n", printBool( m_plotDrawingSheet ) );
215 aFormatter->Print( aNestLevel+1, "(viasonmask %s)\n", printBool( m_plotViaOnMaskLayer ) );
216 aFormatter->Print( aNestLevel+1, "(mode %d)\n", GetPlotMode() == SKETCH ? 2 : 1 );
217 aFormatter->Print( aNestLevel+1, "(useauxorigin %s)\n", printBool( m_useAuxOrigin ) );
218
219 // HPGL options
220 aFormatter->Print( aNestLevel+1, "(hpglpennumber %d)\n", m_HPGLPenNum );
221 aFormatter->Print( aNestLevel+1, "(hpglpenspeed %d)\n", m_HPGLPenSpeed );
222 aFormatter->Print( aNestLevel+1, "(hpglpendiameter %f)\n", m_HPGLPenDiam );
223
224 // PDF options
225 aFormatter->Print( aNestLevel+1, "(%s %s)\n", getTokenName( T_pdf_front_fp_property_popups ),
226 printBool( m_PDFFrontFPPropertyPopups ) );
227 aFormatter->Print( aNestLevel+1, "(%s %s)\n", getTokenName( T_pdf_back_fp_property_popups ),
228 printBool( m_PDFBackFPPropertyPopups ) );
229
230 // DXF options
231 aFormatter->Print( aNestLevel+1, "(%s %s)\n", getTokenName( T_dxfpolygonmode ),
232 printBool( m_DXFPolygonMode ) );
233 aFormatter->Print( aNestLevel+1, "(%s %s)\n", getTokenName( T_dxfimperialunits ),
234 printBool( m_DXFUnits == DXF_UNITS::INCHES ) );
235 aFormatter->Print( aNestLevel+1, "(%s %s)\n", getTokenName( T_dxfusepcbnewfont ),
236 printBool( m_textMode != PLOT_TEXT_MODE::NATIVE ) );
237
238 aFormatter->Print( aNestLevel+1, "(%s %s)\n", getTokenName( T_psnegative ),
239 printBool( m_negative ) );
240 aFormatter->Print( aNestLevel+1, "(%s %s)\n", getTokenName( T_psa4output ),
241 printBool( m_A4Output ) );
242 aFormatter->Print( aNestLevel+1, "(plotreference %s)\n", printBool( m_plotReference ) );
243 aFormatter->Print( aNestLevel+1, "(plotvalue %s)\n", printBool( m_plotValue ) );
244 aFormatter->Print( aNestLevel+1, "(plotfptext %s)\n", printBool( m_plotFPText ) );
245 aFormatter->Print( aNestLevel+1, "(plotinvisibletext %s)\n", printBool( m_plotInvisibleText ) );
246 aFormatter->Print( aNestLevel+1, "(sketchpadsonfab %s)\n",
247 printBool( m_sketchPadsOnFabLayers ) );
248 aFormatter->Print( aNestLevel+1, "(subtractmaskfromsilk %s)\n",
249 printBool( m_subtractMaskFromSilk ) );
250 aFormatter->Print( aNestLevel+1, "(outputformat %d)\n", static_cast<int>( m_format ) );
251 aFormatter->Print( aNestLevel+1, "(mirror %s)\n", printBool( m_mirror ) );
252 aFormatter->Print( aNestLevel+1, "(drillshape %d)\n", (int)m_drillMarks );
253 aFormatter->Print( aNestLevel+1, "(scaleselection %d)\n", m_scaleSelection );
254 aFormatter->Print( aNestLevel+1, "(outputdirectory \"%s\")",
255 (const char*) m_outputDirectory.utf8_str() );
256 aFormatter->Print( 0, "\n" );
257 aFormatter->Print( aNestLevel, ")\n" );
258}
259
260
262{
263 aParser->Parse( this );
264}
265
266
267bool PCB_PLOT_PARAMS::IsSameAs( const PCB_PLOT_PARAMS &aPcbPlotParams ) const
268{
269 if( m_layerSelection != aPcbPlotParams.m_layerSelection )
270 return false;
271
273 return false;
274
276 return false;
277
279 return false;
280
281 if( m_useGerberX2format != aPcbPlotParams.m_useGerberX2format )
282 return false;
283
285 return false;
286
287 if( m_createGerberJobFile != aPcbPlotParams.m_createGerberJobFile )
288 return false;
289
290 if( m_gerberPrecision != aPcbPlotParams.m_gerberPrecision )
291 return false;
292
293 if( m_dashedLineDashRatio != aPcbPlotParams.m_dashedLineDashRatio )
294 return false;
295
296 if( m_dashedLineGapRatio != aPcbPlotParams.m_dashedLineGapRatio )
297 return false;
298
299 if( m_plotDrawingSheet != aPcbPlotParams.m_plotDrawingSheet )
300 return false;
301
302 if( m_plotViaOnMaskLayer != aPcbPlotParams.m_plotViaOnMaskLayer )
303 return false;
304
305 if( m_plotMode != aPcbPlotParams.m_plotMode )
306 return false;
307
308 if( m_DXFPolygonMode != aPcbPlotParams.m_DXFPolygonMode )
309 return false;
310
311 if( m_DXFUnits != aPcbPlotParams.m_DXFUnits )
312 return false;
313
314 if( m_svgPrecision != aPcbPlotParams.m_svgPrecision )
315 return false;
316
317 if( m_useAuxOrigin != aPcbPlotParams.m_useAuxOrigin )
318 return false;
319
320 if( m_HPGLPenNum != aPcbPlotParams.m_HPGLPenNum )
321 return false;
322
323 if( m_HPGLPenSpeed != aPcbPlotParams.m_HPGLPenSpeed )
324 return false;
325
326 if( m_HPGLPenDiam != aPcbPlotParams.m_HPGLPenDiam )
327 return false;
328
329 if( m_negative != aPcbPlotParams.m_negative )
330 return false;
331
333 return false;
334
336 return false;
337
338 if( m_A4Output != aPcbPlotParams.m_A4Output )
339 return false;
340
341 if( m_plotReference != aPcbPlotParams.m_plotReference )
342 return false;
343
344 if( m_plotValue != aPcbPlotParams.m_plotValue )
345 return false;
346
347 if( m_plotFPText != aPcbPlotParams.m_plotFPText )
348 return false;
349
350 if( m_plotInvisibleText != aPcbPlotParams.m_plotInvisibleText )
351 return false;
352
354 return false;
355
356 if( m_subtractMaskFromSilk != aPcbPlotParams.m_subtractMaskFromSilk )
357 return false;
358
359 if( m_format != aPcbPlotParams.m_format )
360 return false;
361
362 if( m_mirror != aPcbPlotParams.m_mirror )
363 return false;
364
365 if( m_drillMarks != aPcbPlotParams.m_drillMarks )
366 return false;
367
368 if( m_scaleSelection != aPcbPlotParams.m_scaleSelection )
369 return false;
370
371 if( m_autoScale != aPcbPlotParams.m_autoScale )
372 return false;
373
374 if( m_scale != aPcbPlotParams.m_scale )
375 return false;
376
377 if( m_fineScaleAdjustX != aPcbPlotParams.m_fineScaleAdjustX )
378 return false;
379
380 if( m_fineScaleAdjustY != aPcbPlotParams.m_fineScaleAdjustY )
381 return false;
382
383 if( m_widthAdjust != aPcbPlotParams.m_widthAdjust )
384 return false;
385
386 if( m_textMode != aPcbPlotParams.m_textMode )
387 return false;
388
389 if( m_blackAndWhite != aPcbPlotParams.m_blackAndWhite )
390 return false;
391
392 if( !m_outputDirectory.IsSameAs( aPcbPlotParams.m_outputDirectory ) )
393 return false;
394
395 return true;
396}
397
398
400{
402}
403
404
406{
408}
409
410
412 PCB_PLOT_PARAMS_LEXER( aReader )
413{
414}
415
416
417PCB_PLOT_PARAMS_PARSER::PCB_PLOT_PARAMS_PARSER( char* aLine, const wxString& aSource ) :
418 PCB_PLOT_PARAMS_LEXER( aLine, aSource )
419{
420}
421
422
424{
425 T token;
426
427 while( ( token = NextTok() ) != T_RIGHT )
428 {
429 if( token == T_EOF)
430 Unexpected( T_EOF );
431
432 if( token == T_LEFT )
433 token = NextTok();
434
435 if( token == T_pcbplotparams )
436 continue;
437
438 bool skip_right = false;
439
440 switch( token )
441 {
442 case T_layerselection:
443 {
444 token = NeedSYMBOLorNUMBER();
445
446 const std::string& cur = CurStr();
447
448 if( token == T_NUMBER ) // pretty 3 format had legacy Cu stack.
449 {
450 // It's not possible to convert a legacy Cu layer number to a new Cu layer
451 // number without knowing the number or total Cu layers in the legacy board.
452 // We do not have that information here, so simply set all layers ON. User
453 // can turn them off in the UI.
454 aPcbPlotParams->m_layerSelection = LSET( 2, F_SilkS, B_SilkS ) | LSET::AllCuMask();
455 }
456 else if( cur.find_first_of( "0x" ) == 0 ) // pretty ver. 4.
457 {
458 // skip the leading 2 0x bytes.
459 aPcbPlotParams->m_layerSelection.ParseHex( cur.c_str() + 2, cur.size() - 2 );
460 }
461 else
462 {
463 Expecting( "integer or hex layerSelection" );
464 }
465
466 break;
467 }
468
469 case T_plot_on_all_layers_selection:
470 {
471 token = NeedSYMBOLorNUMBER();
472
473 const std::string& cur = CurStr();
474
475 if( cur.find_first_of( "0x" ) == 0 )
476 {
477 // skip the leading 2 0x bytes.
478 aPcbPlotParams->m_plotOnAllLayersSelection.ParseHex( cur.c_str() + 2,
479 cur.size() - 2 );
480 }
481 else
482 {
483 Expecting( "hex plot_on_all_layers_selection" );
484 }
485
486 break;
487 }
488
489 case T_disableapertmacros:
490 aPcbPlotParams->m_gerberDisableApertMacros = parseBool();
491 break;
492
493 case T_usegerberextensions:
494 aPcbPlotParams->m_useGerberProtelExtensions = parseBool();
495 break;
496
497 case T_usegerberattributes:
498 aPcbPlotParams->m_useGerberX2format = parseBool();
499 break;
500
501 case T_usegerberadvancedattributes:
502 aPcbPlotParams->m_includeGerberNetlistInfo = parseBool();
503 break;
504
505 case T_creategerberjobfile:
506 aPcbPlotParams->m_createGerberJobFile = parseBool();
507 break;
508
509 case T_gerberprecision:
510 aPcbPlotParams->m_gerberPrecision = parseInt( gbrDefaultPrecision - 1,
512 break;
513
514 case T_dashed_line_dash_ratio:
515 aPcbPlotParams->m_dashedLineDashRatio = parseDouble();
516 break;
517
518 case T_dashed_line_gap_ratio:
519 aPcbPlotParams->m_dashedLineGapRatio = parseDouble();
520 break;
521
522 case T_svgprecision:
524 break;
525
526 case T_svguseinch:
527 parseBool(); // Unused. For compatibility
528 break;
529
530 case T_psa4output:
531 aPcbPlotParams->m_A4Output = parseBool();
532 break;
533
534 case T_excludeedgelayer:
535 if( !parseBool() )
536 aPcbPlotParams->m_plotOnAllLayersSelection.set( Edge_Cuts );
537
538 break;
539
540 case T_plotframeref:
541 aPcbPlotParams->m_plotDrawingSheet = parseBool();
542 break;
543
544 case T_viasonmask:
545 aPcbPlotParams->m_plotViaOnMaskLayer = parseBool();
546 break;
547
548 case T_mode:
549 aPcbPlotParams->SetPlotMode( parseInt( 0, 2 ) > 1 ? SKETCH : FILLED );
550 break;
551
552 case T_useauxorigin:
553 aPcbPlotParams->m_useAuxOrigin = parseBool();
554 break;
555
556 case T_hpglpennumber:
558 break;
559
560 case T_hpglpenspeed:
562 break;
563
564 case T_hpglpendiameter:
565 aPcbPlotParams->m_HPGLPenDiam = parseDouble();
566 break;
567
568 case T_hpglpenoverlay:
569 // No more used. just here for compatibility with old versions
571 break;
572
573 case T_pdf_front_fp_property_popups:
574 aPcbPlotParams->m_PDFFrontFPPropertyPopups = parseBool();
575 break;
576
577 case T_pdf_back_fp_property_popups:
578 aPcbPlotParams->m_PDFFrontFPPropertyPopups = parseBool();
579 break;
580
581 case T_dxfpolygonmode:
582 aPcbPlotParams->m_DXFPolygonMode = parseBool();
583 break;
584
585 case T_dxfimperialunits:
586 aPcbPlotParams->m_DXFUnits = parseBool() ? DXF_UNITS::INCHES
587 : DXF_UNITS::MILLIMETERS;
588 break;
589
590 case T_dxfusepcbnewfont:
591 aPcbPlotParams->m_textMode = parseBool() ? PLOT_TEXT_MODE::DEFAULT
592 : PLOT_TEXT_MODE::NATIVE;
593 break;
594
595 case T_pscolor:
596 NeedSYMBOL(); // This actually was never used...
597 break;
598
599 case T_psnegative:
600 aPcbPlotParams->m_negative = parseBool();
601 break;
602
603 case T_plotreference:
604 aPcbPlotParams->m_plotReference = parseBool();
605 break;
606
607 case T_plotfptext:
608 aPcbPlotParams->m_plotFPText = parseBool();
609 break;
610
611 case T_plotvalue:
612 aPcbPlotParams->m_plotValue = parseBool();
613 break;
614
615 case T_plotinvisibletext:
616 aPcbPlotParams->m_plotInvisibleText = parseBool();
617 break;
618
619 case T_sketchpadsonfab:
620 aPcbPlotParams->m_sketchPadsOnFabLayers= parseBool();
621 break;
622
623 case T_subtractmaskfromsilk:
624 aPcbPlotParams->m_subtractMaskFromSilk = parseBool();
625 break;
626
627 case T_outputformat:
628 aPcbPlotParams->m_format = static_cast<PLOT_FORMAT>(
629 parseInt( static_cast<int>( PLOT_FORMAT::FIRST_FORMAT ),
630 static_cast<int>( PLOT_FORMAT::LAST_FORMAT ) ) );
631 break;
632
633 case T_mirror:
634 aPcbPlotParams->m_mirror = parseBool();
635 break;
636
637 case T_drillshape:
638 aPcbPlotParams->m_drillMarks = static_cast<DRILL_MARKS> ( parseInt( 0, 2 ) );
639 break;
640
641 case T_scaleselection:
642 aPcbPlotParams->m_scaleSelection = parseInt( 0, 4 );
643 break;
644
645 case T_outputdirectory:
646 NeedSYMBOLorNUMBER(); // a dir name can be like a number
647 aPcbPlotParams->m_outputDirectory = From_UTF8( CurText() );
648 break;
649
650 default:
651 skipCurrent(); // skip unknown or outdated plot parameter
652 skip_right = true; // the closing right token is already read.
653 break;
654 }
655
656 if( ! skip_right )
657 NeedRIGHT();
658 }
659}
660
661
663{
664 T token = NeedSYMBOL();
665
666 if( token != T_false && token != T_true )
667 Expecting( "true|false" );
668
669 return token == T_true;
670}
671
672
673int PCB_PLOT_PARAMS_PARSER::parseInt( int aMin, int aMax )
674{
675 T token = NextTok();
676
677 if( token != T_NUMBER )
678 Expecting( T_NUMBER );
679
680 int val = atoi( CurText() );
681
682 if( val < aMin )
683 val = aMin;
684 else if( val > aMax )
685 val = aMax;
686
687 return val;
688}
689
690
692{
693 T token = NextTok();
694
695 if( token != T_NUMBER )
696 Expecting( T_NUMBER );
697
698 return DSNLEXER::parseDouble();
699}
700
701
703{
704 int curr_level = 0;
705 T token;
706
707 while( ( token = NextTok() ) != T_EOF )
708 {
709 if( token == T_LEFT )
710 curr_level--;
711
712 if( token == T_RIGHT )
713 {
714 curr_level++;
715
716 if( curr_level > 0 )
717 return;
718 }
719 }
720}
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:93
LSET is a set of PCB_LAYER_IDs.
Definition: layer_ids.h:552
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:322
int PRINTF_FUNC Print(int nestLevel, const char *fmt,...)
Format and write text to the output stream.
Definition: richio.cpp:475
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)
double m_dashedLineGapRatio
int m_gerberPrecision
Precision of coordinates in Gerber: accepted 5 or 6 when units are in mm, 6 or 7 in inches (but Pcbne...
std::shared_ptr< COLOR_SETTINGS > m_default_colors
Pointer to color settings to be used for plotting.
OUTLINE_MODE m_plotMode
Used to disable NPTH pads plotting on copper layers.
bool m_A4Output
In polygon mode, each item to plot is converted to a polygon and all polygons are merged.
int m_scaleSelection
Scale ratio index (UI only)
DXF_UNITS m_DXFUnits
PLOT_TEXT_MODE m_textMode
Holes can be not plotted, have a small mark, or be plotted in actual size.
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
Autoscale the plot to fit an A4 (landscape?) sheet.
bool m_useGerberProtelExtensions
On gerbers 'scrape' away the solder mask from silkscreen (trim silks)
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
When true set the scale to fit the board in the page.
int m_widthAdjust
Compensation for PS printers/plotters that do not strictly obey line width settings.
bool SetHPGLPenDiameter(double aValue)
bool m_PDFFrontFPPropertyPopups
Generate PDF property popup menus for footprints.
double m_fineScaleAdjustX
Compensation for printer scale errors (and therefore.
LSET m_plotOnAllLayersSelection
double m_dashedLineDashRatio
void Format(OUTPUTFORMATTER *aFormatter, int aNestLevel, int aControl=0) const
void SetGerberPrecision(int aPrecision)
bool m_blackAndWhite
Plot in negative color (supported only by some drivers)
bool SetHPGLPenSpeed(int aValue)
bool m_plotInvisibleText
Force plotting of fields marked invisible.
PLOT_FORMAT m_format
bool m_createGerberJobFile
generate the auxiliary "job file" in gerber format
bool m_plotReference
Enable plotting of part references.
double m_fineScaleAdjustY
expected to be very near 1.0).
double m_HPGLPenDiam
HPGL only: pen diameter in MILS, useful to fill areas However, it is in mm in hpgl files.
bool m_gerberDisableApertMacros
Disable aperture macros in Gerber format (only for broken Gerber readers).
void Parse(PCB_PLOT_PARAMS_PARSER *aParser)
bool m_subtractMaskFromSilk
True if vias are drawn on Mask layer (ie untented, exposed by mask)
COLOR_SETTINGS * m_colors
bool GetUseGerberX2format() const
bool m_mirror
Global scale factor, 1.0 plots a board at actual size.
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: accepted 3 - 6; 6 is the internal resolution of Pcbnew.
bool GetIncludeGerberNetlistInfo() const
void SetPlotMode(OUTLINE_MODE aPlotMode)
double GetDashedLineGapRatio() const
bool m_PDFBackFPPropertyPopups
on front and/or back of board
double GetDashedLineDashRatio() const
void SetSvgPrecision(unsigned aPrecision)
DRILL_MARKS m_drillMarks
FILLED or SKETCH for filled objects.
bool m_useGerberX2format
Include attributes from the Gerber X2 format (chapter 5 in revision J2)
bool m_negative
Mirror the plot around the X axis.
bool m_plotDrawingSheet
Plot in black and white only.
OUTLINE_MODE GetPlotMode() const
LSET m_layerSelection
Plot format type (chooses the driver to be used)
static bool setDouble(double *aResult, double aValue, double aMin, double aMax)
static bool setInt(int *aResult, int aValue, int aMin, int aMax)
static const char * getTokenName(T aTok)
static const bool FILLED
Definition: gr_basic.cpp:30
@ Edge_Cuts
Definition: layer_ids.h:114
@ F_Paste
Definition: layer_ids.h:102
@ B_Mask
Definition: layer_ids.h:107
@ F_Mask
Definition: layer_ids.h:108
@ B_Paste
Definition: layer_ids.h:101
@ F_SilkS
Definition: layer_ids.h:105
@ B_SilkS
Definition: layer_ids.h:104
@ SKETCH
Definition: outline_mode.h:26
#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_FORMAT
The set of supported output plot formats.
Definition: plotter.h:64
wxString From_UTF8(const char *cstring)
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