KiCad PCB EDA Suite
plot_brditems_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) 1992-2020 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 
24 #include <algorithm> // for min
25 #include <bitset> // for bitset, operator&, __bi...
26 #include <math.h> // for abs
27 #include <stddef.h> // for NULL, size_t
28 #include <vector> // for vector, __vector_base<>...
29 
30 #include <geometry/seg.h> // for SEG
31 #include <geometry/shape_circle.h>
32 #include <geometry/shape_line_chain.h> // for SHAPE_LINE_CHAIN
33 #include <geometry/shape_poly_set.h> // for SHAPE_POLY_SET, SHAPE_P...
34 #include <geometry/shape_segment.h>
35 #include <kicad_string.h>
36 #include <macros.h>
37 #include <math/util.h> // for KiROUND, Clamp
38 #include <math/vector2d.h> // for VECTOR2I
39 #include <plotter.h>
40 #include <plotters_specific.h>
41 #include <trigo.h>
42 
43 #include <board_design_settings.h> // for BOARD_DESIGN_SETTINGS
44 #include <core/typeinfo.h> // for dyn_cast, PCB_DIMENSION_T
45 #include <outline_mode.h>
46 #include <gal/color4d.h> // for COLOR4D, operator!=
47 #include <gbr_metadata.h>
48 #include <gbr_netlist_metadata.h> // for GBR_NETLIST_METADATA
49 #include <layers_id_colors_and_visibility.h> // for LSET, IsCopperLayer
50 #include <pad_shapes.h> // for PAD_ATTRIB::NPTH
51 #include <pcbplot.h>
52 #include <pcb_plot_params.h> // for PCB_PLOT_PARAMS, PCB_PL...
53 #include <advanced_config.h>
54 
55 #include <board.h>
56 #include <board_item.h> // for BOARD_ITEM, S_CIRCLE
57 #include <pcb_dimension.h>
58 #include <pcb_shape.h>
59 #include <fp_shape.h>
60 #include <footprint.h>
61 #include <fp_text.h>
62 #include <pcb_track.h>
63 #include <pad.h>
64 #include <pcb_target.h>
65 #include <pcb_text.h>
66 #include <zone.h>
67 
68 #include <wx/debug.h> // for wxASSERT_MSG
69 #include <wx/gdicmn.h>
70 
71 
72 /* class BRDITEMS_PLOTTER is a helper class to plot board items
73  * and a group of board items
74  */
75 
77 {
78  COLOR4D color = ColorSettings()->GetColor( aLayer );
79 
80  // A hack to avoid plotting a white item in white color, expecting the paper
81  // is also white: use a non white color:
82  if( color == COLOR4D::WHITE )
83  color = COLOR4D( LIGHTGRAY );
84 
85  return color;
86 }
87 
88 
89 void BRDITEMS_PLOTTER::PlotPad( const PAD* aPad, COLOR4D aColor, OUTLINE_MODE aPlotMode )
90 {
91  wxPoint shape_pos = aPad->ShapePos();
92  GBR_METADATA gbr_metadata;
93 
94  bool plotOnCopperLayer = ( m_layerMask & LSET::AllCuMask() ).any();
95  bool plotOnExternalCopperLayer = ( m_layerMask & LSET::ExternalCuMask() ).any();
96 
97  // Pad not on the solder mask layer cannot be soldered.
98  // therefore it can have a specific aperture attribute.
99  // Not yet in use.
100  // bool isPadOnBoardTechLayers = ( aPad->GetLayerSet() & LSET::AllBoardTechMask() ).any();
101 
102  gbr_metadata.SetCmpReference( aPad->GetParent()->GetReference() );
103 
104  if( plotOnCopperLayer )
105  {
106  gbr_metadata.SetNetAttribType( GBR_NETINFO_ALL );
107  gbr_metadata.SetCopper( true );
108  // Gives a default attribute, for instance for pads used as tracks in net ties:
109  // Connector pads and SMD pads are on external layers
110  // if on internal layers, they are certainly used as net tie
111  // and are similar to tracks: just conductor items
113 
114  const bool useUTF8 = false;
115  const bool useQuoting = false;
116  gbr_metadata.SetPadName( aPad->GetName(), useUTF8, useQuoting );
117 
118  if( !aPad->GetName().IsEmpty() )
119  gbr_metadata.SetPadPinFunction( aPad->GetPinFunction(), useUTF8, useQuoting );
120 
121  gbr_metadata.SetNetName( aPad->GetNetname() );
122 
123  // Some pads are mechanical pads ( through hole or smd )
124  // when this is the case, they have no pad name and/or are not plated.
125  // In this case gerber files have slightly different attributes.
126  if( aPad->GetAttribute() == PAD_ATTRIB::NPTH || aPad->GetName().IsEmpty() )
127  gbr_metadata.m_NetlistMetadata.m_NotInNet = true;
128 
129  if( !plotOnExternalCopperLayer )
130  {
131  // the .P object attribute (GBR_NETLIST_METADATA::GBR_NETINFO_PAD)
132  // is used on outer layers, unless the component is embedded
133  // or a "etched" component (fp only drawn, not a physical component)
134  // Currently, Pcbnew does not handle embedded component, so we disable the .P
135  // attribute on internal layers
136  // Note the Gerber doc is not really clear about through holes pads about the .P
139 
140  }
141 
142  // Some attributes are reserved to the external copper layers:
143  // GBR_APERTURE_ATTRIB_CONNECTORPAD and GBR_APERTURE_ATTRIB_SMDPAD_CUDEF
144  // for instance.
145  // Pad with type PAD_ATTRIB::CONN or PAD_ATTRIB::SMD that is not on outer layer
146  // has its aperture attribute set to GBR_APERTURE_ATTRIB_CONDUCTOR
147  switch( aPad->GetAttribute() )
148  {
149  case PAD_ATTRIB::NPTH: // Mechanical pad through hole
151  break;
152 
153  case PAD_ATTRIB::PTH : // Pad through hole, a hole is also expected
155  break;
156 
157  case PAD_ATTRIB::CONN: // Connector pads, no solder paste but with solder mask.
158  if( plotOnExternalCopperLayer )
160  break;
161 
162  case PAD_ATTRIB::SMD: // SMD pads (on external copper layer only)
163  // with solder paste and mask
164  if( plotOnExternalCopperLayer )
166  break;
167  }
168 
169  // Fabrication properties can have specific GBR_APERTURE_METADATA options
170  // that replace previous aperture attribute:
171  switch( aPad->GetProperty() )
172  {
173  case PAD_PROP::BGA: // Only applicable to outer layers
174  if( plotOnExternalCopperLayer )
176  break;
177 
180  break;
181 
184  break;
185 
186  case PAD_PROP::TESTPOINT: // Only applicable to outer layers
187  if( plotOnExternalCopperLayer )
189  break;
190 
191  case PAD_PROP::HEATSINK:
193  break;
194 
197  break;
198 
199  case PAD_PROP::NONE:
200  break;
201  }
202 
203  // Ensure NPTH pads have *always* the GBR_APERTURE_ATTRIB_WASHERPAD attribute
204  if( aPad->GetAttribute() == PAD_ATTRIB::NPTH )
206  }
207  else
208  {
210  }
211 
212  // Set plot color (change WHITE to LIGHTGRAY because
213  // the white items are not seen on a white paper or screen
214  m_plotter->SetColor( aColor != WHITE ? aColor : LIGHTGRAY);
215 
216  if( aPlotMode == SKETCH )
218 
219  switch( aPad->GetShape() )
220  {
221  case PAD_SHAPE::CIRCLE:
222  m_plotter->FlashPadCircle( shape_pos, aPad->GetSize().x, aPlotMode, &gbr_metadata );
223  break;
224 
225  case PAD_SHAPE::OVAL:
226  m_plotter->FlashPadOval( shape_pos, aPad->GetSize(), aPad->GetOrientation(), aPlotMode,
227  &gbr_metadata );
228  break;
229 
230  case PAD_SHAPE::RECT:
231  m_plotter->FlashPadRect( shape_pos, aPad->GetSize(), aPad->GetOrientation(), aPlotMode,
232  &gbr_metadata );
233  break;
234 
236  m_plotter->FlashPadRoundRect( shape_pos, aPad->GetSize(), aPad->GetRoundRectCornerRadius(),
237  aPad->GetOrientation(), aPlotMode, &gbr_metadata );
238  break;
239 
241  {
242  // Build the pad polygon in coordinates relative to the pad
243  // (i.e. for a pad at pos 0,0, rot 0.0). Needed to use aperture macros,
244  // to be able to create a pattern common to all trapezoid pads having the same shape
245  wxPoint coord[4];
246  // Order is lower left, lower right, upper right, upper left
247  wxSize half_size = aPad->GetSize()/2;
248  wxSize trap_delta = aPad->GetDelta()/2;
249 
250  coord[0] = wxPoint( -half_size.x - trap_delta.y, half_size.y + trap_delta.x );
251  coord[1] = wxPoint( half_size.x + trap_delta.y, half_size.y - trap_delta.x );
252  coord[2] = wxPoint( half_size.x - trap_delta.y, -half_size.y + trap_delta.x );
253  coord[3] = wxPoint( -half_size.x + trap_delta.y, -half_size.y - trap_delta.x );
254 
255  m_plotter->FlashPadTrapez( shape_pos, coord, aPad->GetOrientation(), aPlotMode,
256  &gbr_metadata );
257  }
258  break;
259 
262  {
263  static_cast<GERBER_PLOTTER*>( m_plotter )->FlashPadChamferRoundRect(
264  shape_pos, aPad->GetSize(),
265  aPad->GetRoundRectCornerRadius(),
266  aPad->GetChamferRectRatio(),
267  aPad->GetChamferPositions(),
268  aPad->GetOrientation(), aPlotMode, &gbr_metadata );
269  break;
270  }
272 
273  default:
274  case PAD_SHAPE::CUSTOM:
275  {
276  const std::shared_ptr<SHAPE_POLY_SET>& polygons = aPad->GetEffectivePolygon();
277 
278  if( polygons->OutlineCount() )
279  {
280  m_plotter->FlashPadCustom( shape_pos, aPad->GetSize(), aPad->GetOrientation(),
281  polygons.get(), aPlotMode, &gbr_metadata );
282  }
283  }
284  break;
285  }
286 }
287 
288 
290 {
291  const FP_TEXT* textItem = &aFootprint->Reference();
292  LAYER_NUM textLayer = textItem->GetLayer();
293 
294  // Reference and value are specific items, not in graphic items list
295  if( GetPlotReference() && m_layerMask[textLayer]
296  && ( textItem->IsVisible() || GetPlotInvisibleText() ) )
297  {
298  PlotFootprintTextItem( textItem, getColor( textLayer ) );
299  }
300 
301  textItem = &aFootprint->Value();
302  textLayer = textItem->GetLayer();
303 
304  if( GetPlotValue() && m_layerMask[textLayer]
305  && ( textItem->IsVisible() || GetPlotInvisibleText() ) )
306  {
307  PlotFootprintTextItem( textItem, getColor( textLayer ) );
308  }
309 
310  for( const BOARD_ITEM* item : aFootprint->GraphicalItems() )
311  {
312  textItem = dyn_cast<const FP_TEXT*>( item );
313 
314  if( !textItem )
315  continue;
316 
317  if( !textItem->IsVisible() )
318  continue;
319 
320  textLayer = textItem->GetLayer();
321 
322  if( textLayer == Edge_Cuts || textLayer >= PCB_LAYER_ID_COUNT )
323  continue;
324 
325  if( !m_layerMask[textLayer] )
326  continue;
327 
328  if( textItem->GetText() == wxT( "${REFERENCE}" ) && !GetPlotReference() )
329  continue;
330 
331  if( textItem->GetText() == wxT( "${VALUE}" ) && !GetPlotValue() )
332  continue;
333 
334  PlotFootprintTextItem( textItem, getColor( textLayer ) );
335  }
336 }
337 
338 
339 // plot items like text and graphics, but not tracks and footprints
341 {
342  for( BOARD_ITEM* item : m_board->Drawings() )
343  {
344  switch( item->Type() )
345  {
346  case PCB_SHAPE_T:
347  PlotPcbShape( (PCB_SHAPE*) item );
348  break;
349 
350  case PCB_TEXT_T:
351  PlotPcbText( (PCB_TEXT*) item );
352  break;
353 
354  case PCB_DIM_ALIGNED_T:
355  case PCB_DIM_CENTER_T:
357  case PCB_DIM_LEADER_T:
359  break;
360 
361  case PCB_TARGET_T:
362  PlotPcbTarget( (PCB_TARGET*) item );
363  break;
364 
365  default:
366  break;
367  }
368  }
369 }
370 
372 {
373  if( aColor == COLOR4D::WHITE )
374  aColor = COLOR4D( LIGHTGRAY );
375 
376  m_plotter->SetColor( aColor );
377 
378  // calculate some text parameters :
379  wxSize size = aTextMod->GetTextSize();
380  wxPoint pos = aTextMod->GetTextPos();
381  double orient = aTextMod->GetDrawRotation();
382  int thickness = aTextMod->GetEffectiveTextPenWidth();
383 
384  if( aTextMod->IsMirrored() )
385  size.x = -size.x; // Text is mirrored
386 
387  // Non bold texts thickness is clamped at 1/6 char size by the low level draw function.
388  // but in Pcbnew we do not manage bold texts and thickness up to 1/4 char size
389  // (like bold text) and we manage the thickness.
390  // So we set bold flag to true
391  bool allow_bold = true;
392 
393  GBR_METADATA gbr_metadata;
394 
395  if( IsCopperLayer( aTextMod->GetLayer() ) )
397 
398  gbr_metadata.SetNetAttribType( GBR_NETLIST_METADATA::GBR_NETINFO_CMP );
399  const FOOTPRINT* parent = static_cast<const FOOTPRINT*> ( aTextMod->GetParent() );
400  gbr_metadata.SetCmpReference( parent->GetReference() );
401 
402  m_plotter->SetCurrentLineWidth( thickness );
403 
404  m_plotter->Text( pos, aColor, aTextMod->GetShownText(), orient, size,
405  aTextMod->GetHorizJustify(), aTextMod->GetVertJustify(), thickness,
406  aTextMod->IsItalic(), allow_bold, false, &gbr_metadata );
407 }
408 
409 
411 {
412  if( !m_layerMask[aDim->GetLayer()] )
413  return;
414 
415  PCB_SHAPE draw;
416 
417  draw.SetWidth( aDim->GetLineThickness() );
418  draw.SetLayer( aDim->GetLayer() );
419 
420  COLOR4D color = ColorSettings()->GetColor( aDim->GetLayer() );
421 
422  // Set plot color (change WHITE to LIGHTGRAY because
423  // the white items are not seen on a white paper or screen
425 
426  PlotPcbText( &aDim->Text() );
427 
428  for( const std::shared_ptr<SHAPE>& shape : aDim->GetShapes() )
429  {
430  switch( shape->Type() )
431  {
432  case SH_SEGMENT:
433  {
434  const SEG& seg = static_cast<const SHAPE_SEGMENT*>( shape.get() )->GetSeg();
435 
437  draw.SetStart( wxPoint( seg.A ) );
438  draw.SetEnd( wxPoint( seg.B ) );
439 
440  PlotPcbShape( &draw );
441  break;
442  }
443 
444  case SH_CIRCLE:
445  {
446  wxPoint start( shape->Centre() );
447  int radius = static_cast<const SHAPE_CIRCLE*>( shape.get() )->GetRadius();
448 
450  draw.SetFilled( false );
451  draw.SetStart( start );
452  draw.SetEnd( wxPoint( start.x + radius, start.y ) );
453 
454  PlotPcbShape( &draw );
455  break;
456  }
457 
458  default:
459  break;
460  }
461  }
462 }
463 
464 
466 {
467  int dx1, dx2, dy1, dy2, radius;
468 
469  if( !m_layerMask[aMire->GetLayer()] )
470  return;
471 
472  m_plotter->SetColor( getColor( aMire->GetLayer() ) );
473 
474  PCB_SHAPE draw;
475 
477  draw.SetFilled( false );
478  draw.SetWidth( aMire->GetWidth() );
479  draw.SetLayer( aMire->GetLayer() );
480  draw.SetStart( aMire->GetPosition() );
481  radius = aMire->GetSize() / 3;
482 
483  if( aMire->GetShape() ) // shape X
484  radius = aMire->GetSize() / 2;
485 
486  // Draw the circle
487  draw.SetEnd( wxPoint( draw.GetStart().x + radius, draw.GetStart().y ) );
488 
489  PlotPcbShape( &draw );
490 
492 
493  radius = aMire->GetSize() / 2;
494  dx1 = radius;
495  dy1 = 0;
496  dx2 = 0;
497  dy2 = radius;
498 
499  if( aMire->GetShape() ) // Shape X
500  {
501  dx1 = dy1 = radius;
502  dx2 = dx1;
503  dy2 = -dy1;
504  }
505 
506  wxPoint mirePos( aMire->GetPosition() );
507 
508  // Draw the X or + shape:
509  draw.SetStart( wxPoint( mirePos.x - dx1, mirePos.y - dy1 ) );
510  draw.SetEnd( wxPoint( mirePos.x + dx1, mirePos.y + dy1 ) );
511  PlotPcbShape( &draw );
512 
513  draw.SetStart( wxPoint( mirePos.x - dx2, mirePos.y - dy2 ) );
514  draw.SetEnd( wxPoint( mirePos.x + dx2, mirePos.y + dy2 ) );
515  PlotPcbShape( &draw );
516 }
517 
518 
519 // Plot footprints graphic items (outlines)
521 {
522  for( const BOARD_ITEM* item : aFootprint->GraphicalItems() )
523  {
524  const FP_SHAPE* shape = dynamic_cast<const FP_SHAPE*>( item );
525 
526  if( shape && m_layerMask[ shape->GetLayer() ] )
527  PlotFootprintGraphicItem( shape );
528  }
529 }
530 
531 
532 //* Plot a graphic item (outline) relative to a footprint
534 {
535  if( aShape->Type() != PCB_FP_SHAPE_T )
536  return;
537 
538  m_plotter->SetColor( getColor( aShape->GetLayer() ) );
539 
540  bool sketch = GetPlotMode() == SKETCH;
541  int thickness = aShape->GetWidth();
542  wxPoint pos( aShape->GetStart() );
543  wxPoint end( aShape->GetEnd() );
544 
545  GBR_METADATA gbr_metadata;
547  const FOOTPRINT* parent = static_cast<const FOOTPRINT*> ( aShape->GetParent() );
548  gbr_metadata.SetCmpReference( parent->GetReference() );
549 
550  bool isOnCopperLayer = ( m_layerMask & LSET::AllCuMask() ).any();
551 
552  if( aShape->GetLayer() == Edge_Cuts ) // happens also when plotting copper layers
553  {
554  gbr_metadata.SetApertureAttrib( GBR_APERTURE_METADATA::GBR_APERTURE_ATTRIB_EDGECUT );
555  }
556  else if( isOnCopperLayer ) // only for items not on Edge_Cuts.
557  {
558  gbr_metadata.SetApertureAttrib( GBR_APERTURE_METADATA::GBR_APERTURE_ATTRIB_ETCHEDCMP );
559  gbr_metadata.SetCopper( true );
560  }
561 
562  int radius; // Circle/arc radius.
563 
564  switch( aShape->GetShape() )
565  {
567  m_plotter->ThickSegment( pos, end, thickness, GetPlotMode(), &gbr_metadata );
568  break;
569 
571  {
572  std::vector<wxPoint> pts = aShape->GetRectCorners();
573 
574  if( sketch || thickness > 0 )
575  {
576  m_plotter->ThickSegment( pts[0], pts[1], thickness, GetPlotMode(), &gbr_metadata );
577  m_plotter->ThickSegment( pts[1], pts[2], thickness, GetPlotMode(), &gbr_metadata );
578  m_plotter->ThickSegment( pts[2], pts[3], thickness, GetPlotMode(), &gbr_metadata );
579  m_plotter->ThickSegment( pts[3], pts[0], thickness, GetPlotMode(), &gbr_metadata );
580  }
581 
582  if( !sketch && aShape->IsFilled() )
583  {
584  SHAPE_LINE_CHAIN poly;
585 
586  for( const wxPoint& pt : pts )
587  poly.Append( pt );
588 
589  m_plotter->PlotPoly( poly, FILL_TYPE::FILLED_SHAPE, -1, &gbr_metadata );
590  }
591  }
592  break;
593 
595  radius = KiROUND( GetLineLength( end, pos ) );
596 
597  if( aShape->IsFilled() )
598  m_plotter->FilledCircle( pos, radius * 2 + thickness, GetPlotMode(), &gbr_metadata );
599  else
600  m_plotter->ThickCircle( pos, radius * 2, thickness, GetPlotMode(), &gbr_metadata );
601 
602  break;
603 
604  case PCB_SHAPE_TYPE::ARC:
605  {
606  radius = KiROUND( GetLineLength( end, pos ) );
607  double startAngle = ArcTangente( end.y - pos.y, end.x - pos.x );
608  double endAngle = startAngle + aShape->GetAngle();
609 
610  // when startAngle == endAngle ThickArc() doesn't know whether it's 0 deg and 360 deg
611  if( std::abs( aShape->GetAngle() ) == 3600.0 )
612  {
613  m_plotter->ThickCircle( pos, radius * 2, thickness, GetPlotMode(), &gbr_metadata );
614  }
615  else
616  {
617  m_plotter->ThickArc( pos, -endAngle, -startAngle, radius, thickness, GetPlotMode(),
618  &gbr_metadata );
619  }
620  }
621  break;
622 
624  if( aShape->IsPolyShapeValid() )
625  {
626  const std::vector<wxPoint> &polyPoints = aShape->BuildPolyPointsList();
627 
628  // We must compute board coordinates from m_PolyList which are relative to the parent
629  // position at orientation 0
630  const FOOTPRINT *parentFootprint = aShape->GetParentFootprint();
631 
632  std::vector<wxPoint> cornerList;
633 
634  cornerList.reserve( polyPoints.size() );
635 
636  for( wxPoint corner : polyPoints )
637  {
638  if( parentFootprint )
639  {
640  RotatePoint( &corner, parentFootprint->GetOrientation() );
641  corner += parentFootprint->GetPosition();
642  }
643 
644  cornerList.push_back( corner );
645  }
646 
647  if( sketch || thickness > 0 )
648  {
649  for( size_t i = 1; i < cornerList.size(); i++ )
650  {
651  m_plotter->ThickSegment( cornerList[i - 1], cornerList[i], thickness,
652  GetPlotMode(), &gbr_metadata );
653  }
654 
655  m_plotter->ThickSegment( cornerList.back(), cornerList.front(), thickness,
656  GetPlotMode(), &gbr_metadata );
657 
658  }
659 
660  if( !sketch && aShape->IsFilled() )
661  {
662  // This must be simplified and fractured to prevent overlapping polygons
663  // from generating invalid Gerber files
664 
665  SHAPE_LINE_CHAIN line( cornerList );
666  SHAPE_POLY_SET tmpPoly;
667 
668  line.SetClosed( true );
669  tmpPoly.AddOutline( line );
671 
672  for( int jj = 0; jj < tmpPoly.OutlineCount(); ++jj )
673  {
674  SHAPE_LINE_CHAIN &poly = tmpPoly.Outline( jj );
675  m_plotter->PlotPoly( poly, FILL_TYPE::FILLED_SHAPE, thickness, &gbr_metadata );
676  }
677  }
678  }
679  break;
680 
682  m_plotter->BezierCurve( aShape->GetStart(), aShape->GetBezControl1(),
683  aShape->GetBezControl2(), aShape->GetEnd(), 0, thickness );
684  break;
685 
686  default:
687  wxASSERT_MSG( false, "Unhandled FP_SHAPE shape" );
688  break;
689  }
690 }
691 
692 
693 // Plot a PCB Text, i.e. a text found on a copper or technical layer
695 {
696  wxString shownText( aText->GetShownText() );
697 
698  if( shownText.IsEmpty() )
699  return;
700 
701  if( !m_layerMask[aText->GetLayer()] )
702  return;
703 
704  GBR_METADATA gbr_metadata;
705 
706  if( IsCopperLayer( aText->GetLayer() ) )
708 
709  COLOR4D color = getColor( aText->GetLayer() );
711 
712  wxSize size = aText->GetTextSize();
713  wxPoint pos = aText->GetTextPos();
714  double orient = aText->GetTextAngle();
715  int thickness = aText->GetEffectiveTextPenWidth();
716 
717  if( aText->IsMirrored() )
718  size.x = -size.x;
719 
720  // Non bold texts thickness is clamped at 1/6 char size by the low level draw function.
721  // but in Pcbnew we do not manage bold texts and thickness up to 1/4 char size
722  // (like bold text) and we manage the thickness.
723  // So we set bold flag to true
724  bool allow_bold = true;
725 
726  m_plotter->SetCurrentLineWidth( thickness );
727 
728  if( aText->IsMultilineAllowed() )
729  {
730  std::vector<wxPoint> positions;
731  wxArrayString strings_list;
732  wxStringSplit( shownText, strings_list, '\n' );
733  positions.reserve( strings_list.Count() );
734 
735  aText->GetLinePositions( positions, strings_list.Count() );
736 
737  for( unsigned ii = 0; ii < strings_list.Count(); ii++ )
738  {
739  wxString& txt = strings_list.Item( ii );
740  m_plotter->Text( positions[ii], color, txt, orient, size, aText->GetHorizJustify(),
741  aText->GetVertJustify(), thickness, aText->IsItalic(),
742  allow_bold, false, &gbr_metadata );
743  }
744  }
745  else
746  {
747  m_plotter->Text( pos, color, shownText, orient, size, aText->GetHorizJustify(),
748  aText->GetVertJustify(), thickness, aText->IsItalic(), allow_bold,
749  false, &gbr_metadata );
750  }
751 }
752 
753 
754 void BRDITEMS_PLOTTER::PlotFilledAreas( const ZONE* aZone, const SHAPE_POLY_SET& polysList )
755 {
756  if( polysList.IsEmpty() )
757  return;
758 
759  GBR_METADATA gbr_metadata;
760 
761  bool isOnCopperLayer = aZone->IsOnCopperLayer();
762 
763  if( isOnCopperLayer )
764  {
765  gbr_metadata.SetNetName( aZone->GetNetname() );
766  gbr_metadata.SetCopper( true );
767 
768  // Zones with no net name can exist.
769  // they are not used to connect items, so the aperture attribute cannot
770  // be set as conductor
771  if( aZone->GetNetname().IsEmpty() )
772  {
774  }
775  else
776  {
779  }
780  }
781 
782  m_plotter->SetColor( getColor( aZone->GetLayer() ) );
783 
784  m_plotter->StartBlock( nullptr ); // Clean current object attributes
785 
786  /* Plot all filled areas: filled areas have a filled area and a thick
787  * outline (depending on the fill area option we must plot the filled area itself
788  * and plot the thick outline itself, if the thickness has meaning (at least is > 1)
789  *
790  * in non filled mode the outline is plotted, but not the filling items
791  */
792  int outline_thickness = aZone->GetFilledPolysUseThickness() ? aZone->GetMinThickness() : 0;
793 
794  for( int idx = 0; idx < polysList.OutlineCount(); ++idx )
795  {
796  const SHAPE_LINE_CHAIN& outline = polysList.Outline( idx );
797 
798  // Plot the current filled area (as region for Gerber plotter
799  // to manage attributes) and its outline for thick outline
800  if( GetPlotMode() == FILLED )
801  {
803  {
804  if( outline_thickness > 0 )
805  {
807  outline_thickness, &gbr_metadata );
808  }
809 
810  static_cast<GERBER_PLOTTER*>( m_plotter )->PlotGerberRegion(
811  outline, &gbr_metadata );
812  }
813  else
814  {
816  outline_thickness, &gbr_metadata );
817  }
818  }
819  else
820  {
821  if( outline_thickness )
822  {
823  for( int jj = 1; jj < outline.PointCount(); jj++ )
824  {
825  m_plotter->ThickSegment( wxPoint( outline.CPoint( jj - 1) ),
826  wxPoint( outline.CPoint( jj ) ),
827  outline_thickness,
828  GetPlotMode(), &gbr_metadata );
829  }
830  }
831 
833  }
834  }
835 
836  m_plotter->EndBlock( nullptr ); // Clear object attributes
837 }
838 
839 
840 /* Plot items type PCB_SHAPE on layers allowed by aLayerMask
841  */
843 {
844  if( !m_layerMask[aShape->GetLayer()] )
845  return;
846 
847  int radius = 0;
848  double StAngle = 0, EndAngle = 0;
849  bool sketch = GetPlotMode() == SKETCH;
850  int thickness = aShape->GetWidth();
851 
852  m_plotter->SetColor( getColor( aShape->GetLayer() ) );
853 
854  wxPoint start( aShape->GetStart() );
855  wxPoint end( aShape->GetEnd() );
856 
857  GBR_METADATA gbr_metadata;
858 
859  if( aShape->GetLayer() == Edge_Cuts )
861 
862  if( IsCopperLayer( aShape->GetLayer() ) )
863  // Graphic items (PCB_SHAPE, TEXT) having no net have the NonConductor attribute
864  // Graphic items having a net have the Conductor attribute, but are not (yet?)
865  // supported in Pcbnew
866  gbr_metadata.SetApertureAttrib( GBR_APERTURE_METADATA::GBR_APERTURE_ATTRIB_NONCONDUCTOR );
867 
868  switch( aShape->GetShape() )
869  {
871  m_plotter->ThickSegment( start, end, thickness, GetPlotMode(), &gbr_metadata );
872  break;
873 
875  radius = KiROUND( GetLineLength( end, start ) );
876 
877  if( aShape->IsFilled() )
878  m_plotter->FilledCircle( start, radius * 2 + thickness, GetPlotMode(), &gbr_metadata );
879  else
880  m_plotter->ThickCircle( start, radius * 2, thickness, GetPlotMode(), &gbr_metadata );
881 
882  break;
883 
884  case PCB_SHAPE_TYPE::ARC:
885  radius = KiROUND( GetLineLength( end, start ) );
886  StAngle = ArcTangente( end.y - start.y, end.x - start.x );
887  EndAngle = StAngle + aShape->GetAngle();
888 
889  // when startAngle == endAngle ThickArc() doesn't know whether it's 0 deg and 360 deg
890  if( std::abs( aShape->GetAngle() ) == 3600.0 )
891  {
892  m_plotter->ThickCircle( start, radius * 2, thickness, GetPlotMode(), &gbr_metadata );
893  }
894  else
895  {
896  m_plotter->ThickArc( start, -EndAngle, -StAngle, radius, thickness, GetPlotMode(),
897  &gbr_metadata );
898  }
899  break;
900 
902  m_plotter->BezierCurve( aShape->GetStart(), aShape->GetBezControl1(),
903  aShape->GetBezControl2(), aShape->GetEnd(), 0, thickness );
904  break;
905 
907  if( aShape->IsPolyShapeValid() )
908  {
909  if( sketch || thickness > 0 )
910  {
911  for( auto it = aShape->GetPolyShape().CIterateSegments( 0 ); it; it++ )
912  {
913  auto seg = it.Get();
914  m_plotter->ThickSegment( wxPoint( seg.A ), wxPoint( seg.B ),
915  thickness, GetPlotMode(), &gbr_metadata );
916  }
917  }
918 
919  if( !sketch && aShape->IsFilled() )
920  {
921  m_plotter->SetCurrentLineWidth( thickness, &gbr_metadata );
922  // Draw the polygon: only one polygon is expected
923  // However we provide a multi polygon shape drawing
924  // ( for the future or to show a non expected shape )
925  // This must be simplified and fractured to prevent overlapping polygons
926  // from generating invalid Gerber files
927  auto tmpPoly = SHAPE_POLY_SET( aShape->GetPolyShape() );
929 
930  for( int jj = 0; jj < tmpPoly.OutlineCount(); ++jj )
931  {
932  SHAPE_LINE_CHAIN& poly = tmpPoly.Outline( jj );
933  m_plotter->PlotPoly( poly, FILL_TYPE::FILLED_SHAPE, thickness, &gbr_metadata );
934  }
935  }
936  }
937  break;
938 
940  {
941  std::vector<wxPoint> pts = aShape->GetRectCorners();
942 
943  if( sketch || thickness > 0 )
944  {
945  m_plotter->ThickSegment( pts[0], pts[1], thickness, GetPlotMode(), &gbr_metadata );
946  m_plotter->ThickSegment( pts[1], pts[2], thickness, GetPlotMode(), &gbr_metadata );
947  m_plotter->ThickSegment( pts[2], pts[3], thickness, GetPlotMode(), &gbr_metadata );
948  m_plotter->ThickSegment( pts[3], pts[0], thickness, GetPlotMode(), &gbr_metadata );
949  }
950 
951  if( !sketch && aShape->IsFilled() )
952  {
953  SHAPE_LINE_CHAIN poly;
954 
955  for( const wxPoint& pt : pts )
956  poly.Append( pt );
957 
958  m_plotter->PlotPoly( poly, FILL_TYPE::FILLED_SHAPE, -1, &gbr_metadata );
959  }
960  }
961  break;
962 
963  default:
964  wxASSERT_MSG( false, "Unhandled PCB_SHAPE shape" );
965  m_plotter->ThickSegment( start, end, thickness, GetPlotMode(), &gbr_metadata );
966  }
967 }
968 
969 
973 void BRDITEMS_PLOTTER::plotOneDrillMark( PAD_DRILL_SHAPE_T aDrillShape, const wxPoint &aDrillPos,
974  wxSize aDrillSize, const wxSize &aPadSize,
975  double aOrientation, int aSmallDrill )
976 {
977  // Small drill marks have no significance when applied to slots
978  if( aSmallDrill && aDrillShape == PAD_DRILL_SHAPE_CIRCLE )
979  aDrillSize.x = std::min( aSmallDrill, aDrillSize.x );
980 
981  // Round holes only have x diameter, slots have both
982  aDrillSize.x -= getFineWidthAdj();
983  aDrillSize.x = Clamp( 1, aDrillSize.x, aPadSize.x - 1 );
984 
985  if( aDrillShape == PAD_DRILL_SHAPE_OBLONG )
986  {
987  aDrillSize.y -= getFineWidthAdj();
988  aDrillSize.y = Clamp( 1, aDrillSize.y, aPadSize.y - 1 );
989  m_plotter->FlashPadOval( aDrillPos, aDrillSize, aOrientation, GetPlotMode(), NULL );
990  }
991  else
992  {
993  m_plotter->FlashPadCircle( aDrillPos, aDrillSize.x, GetPlotMode(), NULL );
994  }
995 }
996 
997 
999 {
1000  /* If small drills marks were requested prepare a clamp value to pass
1001  to the helper function */
1003  ? Millimeter2iu( ADVANCED_CFG::GetCfg().m_SmallDrillMarkSize ) : 0;
1004 
1005  /* In the filled trace mode drill marks are drawn white-on-black to scrape
1006  the underlying pad. This works only for drivers supporting color change,
1007  obviously... it means that:
1008  - PS, SVG and PDF output is correct (i.e. you have a 'donut' pad)
1009  - In HPGL you can't see them
1010  - In gerbers you can't see them, too. This is arguably the right thing to
1011  do since having drill marks and high speed drill stations is a sure
1012  recipe for broken tools and angry manufacturers. If you *really* want them
1013  you could start a layer with negative polarity to scrape the film.
1014  - In DXF they go into the 'WHITE' layer. This could be useful.
1015  */
1016  if( GetPlotMode() == FILLED )
1017  m_plotter->SetColor( WHITE );
1018 
1019  for( PCB_TRACK* tracks : m_board->Tracks() )
1020  {
1021  const PCB_VIA* via = dyn_cast<const PCB_VIA*>( tracks );
1022 
1023  if( via )
1024  {
1026  wxSize( via->GetDrillValue(), 0 ),
1027  wxSize( via->GetWidth(), 0 ), 0, smallDrill );
1028  }
1029  }
1030 
1031  for( FOOTPRINT* footprint : m_board->Footprints() )
1032  {
1033  for( PAD* pad : footprint->Pads() )
1034  {
1035  if( pad->GetDrillSize().x == 0 )
1036  continue;
1037 
1038  plotOneDrillMark( pad->GetDrillShape(), pad->GetPosition(), pad->GetDrillSize(),
1039  pad->GetSize(), pad->GetOrientation(), smallDrill );
1040  }
1041  }
1042 
1043  if( GetPlotMode() == FILLED )
1044  m_plotter->SetColor( BLACK );
1045 }
virtual double GetDrawRotation() const override
Definition: fp_text.cpp:239
static LSET AllCuMask(int aCuLayerCount=MAX_CU_LAYERS)
Return a mask holding the requested number of Cu PCB_LAYER_IDs.
Definition: lset.cpp:750
bool IsPolyShapeValid() const
Definition: pcb_shape.cpp:1242
OUTLINE_MODE GetPlotMode() const
Handle special data (items attributes) during plot.
void PlotPcbTarget(const PCB_TARGET *aMire)
COLOR4D getColor(LAYER_NUM aLayer) const
White color is special because it cannot be seen on a white paper in B&W mode.
OUTLINE_MODE
Definition: outline_mode.h:24
aperture used for etched components.
Definition: gbr_metadata.h:94
bool IsFilled() const
Definition: pcb_shape.h:75
Plot settings, and plotting engines (PostScript, Gerber, HPGL and DXF)
class PCB_DIM_ALIGNED, a linear dimension (graphic item)
Definition: typeinfo.h:100
class PCB_DIM_LEADER, a leader dimension (graphic item)
Definition: typeinfo.h:101
virtual void PlotPoly(const std::vector< wxPoint > &aCornerList, FILL_TYPE aFill, int aWidth=USE_DEFAULT_LINE_WIDTH, void *aData=nullptr)=0
Draw a polygon ( filled or not ).
int OutlineCount() const
Return the number of vertices in a given outline/hole.
EDA_TEXT_VJUSTIFY_T GetVertJustify() const
Definition: eda_text.h:206
bool IsMirrored() const
Definition: eda_text.h:196
double GetLineLength(const wxPoint &aPointA, const wxPoint &aPointB)
Return the length of a line segment defined by aPointA and aPointB.
Definition: trigo.h:223
virtual void FlashPadRoundRect(const wxPoint &aPadPos, const wxSize &aSize, int aCornerRadius, double aOrient, OUTLINE_MODE aTraceMode, void *aData)=0
virtual void EndBlock(void *aData)
calling this function allows one to define the end of a group of drawing items for instance in SVG or...
Definition: plotter.h:496
aperture used for castellated pads in copper layer files.
Definition: gbr_metadata.h:131
virtual void ThickCircle(const wxPoint &pos, int diametre, int width, OUTLINE_MODE tracemode, void *aData)
Definition: plotter.cpp:575
SHAPE_POLY_SET & GetPolyShape()
Definition: pcb_shape.h:239
const wxPoint & GetEnd() const
Return the ending point of the graphic.
Definition: pcb_shape.h:134
virtual void SetLayer(PCB_LAYER_ID aLayer)
Set the layer this item is on.
Definition: board_item.h:192
print info associated to a component (TO.C attribute)
A base class for any item which can be embedded within the BOARD container class, and therefore insta...
Definition: board_item.h:80
Plotting engines (PostScript, Gerber, HPGL and DXF)
PAD_PROP GetProperty() const
Definition: pad.h:371
PCB_TEXT & Text()
int GetSize() const
Definition: pcb_target.h:62
PCB_SHAPE_TYPE GetShape() const
Definition: pcb_shape.h:110
void SetFilled(bool aFlag)
Definition: pcb_shape.h:73
void PlotFootprintGraphicItems(const FOOTPRINT *aFootprint)
bool IsVisible() const
Definition: eda_text.h:193
void SetNetAttribType(int aNetAttribType)
Definition: gbr_metadata.h:219
class PCB_DIM_CENTER, a center point marking (graphic item)
Definition: typeinfo.h:102
int color
Definition: DXF_plotter.cpp:60
bool IsEmpty() const
std::vector< wxPoint > GetRectCorners() const
Definition: pcb_shape.cpp:998
int GetWidth() const
Definition: pcb_shape.h:97
Like smd, does not appear on the solder paste layer (default)
Smd pad, appears on the solder paste layer (default)
virtual void FlashPadOval(const wxPoint &aPadPos, const wxSize &aSize, double aPadOrient, OUTLINE_MODE aTraceMode, void *aData)=0
PLOTTER * m_plotter
Definition: pcbplot.h:142
void PlotDrillMarks()
Draw a drill mark for pads and vias.
double GetOrientation() const
Definition: footprint.h:181
virtual void StartBlock(void *aData)
calling this function allows one to define the beginning of a group of drawing items,...
Definition: plotter.h:487
double GetTextAngle() const
Definition: eda_text.h:181
class PCB_TEXT, text on a layer
Definition: typeinfo.h:91
void PlotPcbText(const PCB_TEXT *aText)
const std::vector< std::shared_ptr< SHAPE > > & GetShapes() const
aperture used for SMD pad. Excluded BGA pads which have their own type.
Definition: gbr_metadata.h:105
virtual void FilledCircle(const wxPoint &pos, int diametre, OUTLINE_MODE tracemode, void *aData)
Definition: plotter.cpp:591
class FP_SHAPE, a footprint edge
Definition: typeinfo.h:93
#define KI_FALLTHROUGH
The KI_FALLTHROUGH macro is to be used when switch statement cases should purposely fallthrough from ...
Definition: macros.h:83
Abstract dimension API.
Definition: pcb_dimension.h:95
virtual void BezierCurve(const wxPoint &aStart, const wxPoint &aControl1, const wxPoint &aControl2, const wxPoint &aEnd, int aTolerance, int aLineThickness=USE_DEFAULT_LINE_WIDTH)
Generic fallback: Cubic Bezier curve rendered as a polyline In KiCad the bezier curves have 4 control...
Definition: plotter.cpp:210
aperture used for castellated pads in drill files.
Definition: gbr_metadata.h:134
void PlotPad(const PAD *aPad, COLOR4D aColor, OUTLINE_MODE aPlotMode)
Plot a pad.
void PlotFootprintGraphicItem(const FP_SHAPE *aShape)
Definition: color4d.h:44
void RotatePoint(int *pX, int *pY, double angle)
Definition: trigo.cpp:228
void PlotFootprintTextItems(const FOOTPRINT *aFootprint)
a test point pad
int PointCount() const
Function PointCount()
PAD_DRILL_SHAPE_T
The set of pad drill shapes, used with PAD::{Set,Get}DrillShape()
Definition: pad_shapes.h:67
BOARD * m_board
Definition: pcbplot.h:143
virtual void ThickSegment(const wxPoint &start, const wxPoint &end, int width, OUTLINE_MODE tracemode, void *aData)
Definition: plotter.cpp:513
int GetEffectiveTextPenWidth(int aDefaultWidth=0) const
The EffectiveTextPenWidth uses the text thickness if > 1 or aDefaultWidth.
Definition: eda_text.cpp:149
void Append(int aX, int aY, bool aAllowDuplication=false)
Function Append()
Plated through hole pad.
This file contains miscellaneous commonly used macros and functions.
virtual void FlashPadTrapez(const wxPoint &aPadPos, const wxPoint *aCorners, double aPadOrient, OUTLINE_MODE aTraceMode, void *aData)=0
Flash a trapezoidal pad.
FP_TEXT & Value()
read/write accessors:
Definition: footprint.h:457
void SetPadPinFunction(const wxString &aPadPinFunction, bool aUseUTF8, bool aEscapeString)
Definition: gbr_metadata.h:236
Board plot function definition file.
polygon (not yet used for tracks, but could be in microwave apps)
bool IsItalic() const
Definition: eda_text.h:187
FP_TEXT & Reference()
Definition: footprint.h:458
a pad used as heat sink, usually in SMD footprints
wxPoint GetPosition() const override
Definition: pcb_target.h:56
wxString GetShownText(int aDepth=0) const override
Return the string actually shown after processing of the base text.
Definition: pcb_text.cpp:56
const VECTOR2I & CPoint(int aIndex) const
Function Point()
const std::vector< wxPoint > BuildPolyPointsList() const
Build and return the list of corners in a std::vector<wxPoint>
Definition: pcb_shape.cpp:1225
void SetClosed(bool aClosed)
Function SetClosed()
aperture used for edge connector pad (outer layers).
Definition: gbr_metadata.h:117
int GetWidth() const
Definition: pcb_target.h:65
wxPoint ShapePos() const
Definition: pad.cpp:660
like PAD_PTH, but not plated
aperture used for fiducial pad (outer layers), at footprint level.
Definition: gbr_metadata.h:125
virtual void FlashPadRect(const wxPoint &aPadPos, const wxSize &aSize, double aPadOrient, OUTLINE_MODE aTraceMode, void *aData)=0
EDA_TEXT_HJUSTIFY_T GetHorizJustify() const
Definition: eda_text.h:205
int GetMinThickness() const
Definition: zone.h:241
#define NULL
double GetOrientation() const
Return the rotation angle of the pad in a variety of units (the basic call returns tenths of degrees)...
Definition: pad.h:346
Represent a set of closed polygons.
void SetPadName(const wxString &aPadname, bool aUseUTF8=false, bool aEscapeString=false)
Definition: gbr_metadata.h:231
SHAPE_LINE_CHAIN & Outline(int aIndex)
virtual PCB_LAYER_ID GetLayer() const override
Return the primary layer this item is on.
Definition: zone.cpp:218
virtual PLOT_FORMAT GetPlotterType() const =0
Returns the effective plot engine in use.
void PlotBoardGraphicItems()
Plot items like text and graphics but not tracks and footprints.
const wxSize & GetTextSize() const
Definition: eda_text.h:245
segment with non rounded ends
FOOTPRINTS & Footprints()
Definition: board.h:233
const wxSize & GetSize() const
Definition: pad.h:229
int getFineWidthAdj() const
Definition: pcbplot.h:75
const wxPoint & GetStart() const
Return the starting point of the graphic.
Definition: pcb_shape.h:124
Smd pad, used in BGA footprints.
const wxString & GetName() const
Definition: pad.h:130
static LSET ExternalCuMask()
Return a mask holding the Front and Bottom layers.
Definition: lset.cpp:780
PAD_SHAPE GetShape() const
Definition: pad.h:166
const wxString & GetReference() const
Definition: footprint.h:421
a fiducial (usually a smd) local to the parent footprint
DRAWINGS & GraphicalItems()
Definition: footprint.h:162
Handle a list of polygons defining a copper zone.
Definition: zone.h:57
aperture used for mechanical pads (NPTH).
Definition: gbr_metadata.h:121
Metadata which can be added in a gerber file as attribute in X2 format.
Definition: gbr_metadata.h:204
void Fracture(POLYGON_MODE aFastMode)
Convert a single outline slitted ("fractured") polygon into a set ouf outlines with holes.
bool IsMultilineAllowed() const
Definition: eda_text.h:203
circle
Definition: shape.h:46
class PCB_TARGET, a target (graphic item)
Definition: typeinfo.h:104
int LAYER_NUM
This can be replaced with int and removed.
void wxStringSplit(const wxString &aText, wxArrayString &aStrings, wxChar aSplitter)
Split aString to a string list separated at aSplitter.
Definition: string.cpp:895
virtual void SetColor(const COLOR4D &color)=0
bool GetPlotValue() const
void PlotFilledAreas(const ZONE *aZone, const SHAPE_POLY_SET &aPolysList)
aperture used for test point pad (outer layers).
Definition: gbr_metadata.h:122
int GetRoundRectCornerRadius() const
Definition: pad.cpp:240
Definition: color4d.h:48
const wxSize & GetDelta() const
Definition: pad.h:236
FOOTPRINT * GetParent() const
Definition: pad.cpp:1338
Definition: seg.h:40
int AddOutline(const SHAPE_LINE_CHAIN &aOutline)
Adds a new hole to the given outline (default: last) and returns its index.
void SetNetName(const wxString &aNetname)
Definition: gbr_metadata.h:229
COLOR4D GetColor(int aLayer) const
Board layer functions and definitions.
a fiducial (usually a smd) for the full board
double GetChamferRectRatio() const
Definition: pad.h:529
void plotOneDrillMark(PAD_DRILL_SHAPE_T aDrillShape, const wxPoint &aDrillPos, wxSize aDrillSize, const wxSize &aPadSize, double aOrientation, int aSmallDrill)
Helper function to plot a single drill mark.
FOOTPRINT * GetParentFootprint() const
Return the parent footprint or NULL if PCB_SHAPE does not belong to a footprint.
Definition: pcb_shape.cpp:490
no special fabrication property
void SetStart(const wxPoint &aStart)
Definition: pcb_shape.h:127
void PlotPcbShape(const PCB_SHAPE *aShape)
SHAPE_LINE_CHAIN.
PAD_ATTRIB GetAttribute() const
Definition: pad.h:368
LSET m_layerMask
Definition: pcbplot.h:144
const wxPoint & GetBezControl2() const
Definition: pcb_shape.h:116
VECTOR2I A
Definition: seg.h:48
double GetAngle() const
Definition: pcb_shape.h:107
int GetShape() const
Definition: pcb_target.h:59
usual segment : line with rounded ends
bool IsOnCopperLayer() const override
Definition: zone.cpp:224
void SetWidth(int aWidth)
Definition: pcb_shape.h:96
aperture used for heat sink pad (typically for SMDs).
Definition: gbr_metadata.h:128
const std::shared_ptr< SHAPE_POLY_SET > & GetEffectivePolygon() const
Definition: pad.cpp:271
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:70
aperture used for BGA pads with a solder mask defined by the copper shape.
Definition: gbr_metadata.h:111
const T & Clamp(const T &lower, const T &value, const T &upper)
Function Clamp limits value within the range lower <= value <= upper.
Definition: util.h:49
bool GetPlotInvisibleText() const
wxPoint GetPosition() const override
Definition: footprint.h:177
int GetSketchPadLineWidth() const
virtual void ThickArc(const wxPoint &centre, double StAngle, double EndAngle, int rayon, int width, OUTLINE_MODE tracemode, void *aData)
Definition: plotter.cpp:537
virtual void FlashPadCustom(const wxPoint &aPadPos, const wxSize &aSize, double aPadOrient, SHAPE_POLY_SET *aPolygons, OUTLINE_MODE aTraceMode, void *aData)=0
void GetLinePositions(std::vector< wxPoint > &aPositions, int aLineCount) const
Populate aPositions with the position of each line of a multiline text, according to the vertical jus...
Definition: eda_text.cpp:430
bool IsCopperLayer(LAYER_NUM aLayerId)
Tests whether a layer is a copper layer.
int GetChamferPositions() const
Definition: pad.h:539
const wxPoint & GetTextPos() const
Definition: eda_text.h:254
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=nullptr)
Draw text with the plotter.
Definition: gr_text.cpp:217
static const ADVANCED_CFG & GetCfg()
Get the singleton instance's config, which is shared by all consumers.
void SetApertureAttrib(GBR_APERTURE_METADATA::GBR_APERTURE_ATTRIB aApertAttribute)
Definition: gbr_metadata.h:209
COLOR_SETTINGS * ColorSettings() const
a pad with a castellated through hole
class PCB_DIM_ORTHOGONAL, a linear dimension constrained to x/y
Definition: typeinfo.h:103
bool m_NotInNet
true if a pad of a footprint cannot be connected (for instance a mechanical NPTH, ot a not named pad)...
GBR_NETLIST_METADATA m_NetlistMetadata
An item to handle object attribute.
Definition: gbr_metadata.h:262
CONST_SEGMENT_ITERATOR CIterateSegments(int aFirst, int aLast, bool aIterateHoles=false) const
Return an iterator object, for iterating aPolygonIdx-th polygon edges.
double ArcTangente(int dy, int dx)
Definition: trigo.cpp:182
Definition: pad.h:57
void SetShape(PCB_SHAPE_TYPE aShape)
Definition: pcb_shape.h:109
Arcs (with rounded ends)
BOARD_ITEM_CONTAINER * GetParent() const
Definition: board_item.h:166
void SetCopper(bool aValue)
Definition: gbr_metadata.h:252
virtual wxString GetShownText(int aDepth=0) const override
Return the string actually shown after processing of the base text.
Definition: fp_text.cpp:414
DrillMarksType GetDrillMarksType() const
class PCB_SHAPE, a segment not on copper layers
Definition: typeinfo.h:90
void PlotDimension(const PCB_DIMENSION_BASE *aDim)
static constexpr int Millimeter2iu(double mm)
print info associated to a net (TO.N attribute)
virtual PCB_LAYER_ID GetLayer() const
Return the primary layer this item is on.
Definition: board_item.h:171
const wxString & GetPinFunction() const
Definition: pad.h:136
virtual void SetCurrentLineWidth(int width, void *aData=nullptr)=0
Set the line width for the next drawing.
const wxPoint & GetBezControl1() const
Definition: pcb_shape.h:113
bool GetPlotReference() const
DRAWINGS & Drawings()
Definition: board.h:236
virtual const wxString & GetText() const
Return the string associated with the text object.
Definition: eda_text.h:133
int GetLineThickness() const
void SetCmpReference(const wxString &aComponentRef)
Definition: gbr_metadata.h:241
TRACKS & Tracks()
Definition: board.h:230
void PlotFootprintTextItem(const FP_TEXT *aText, COLOR4D aColor)
virtual void FlashPadCircle(const wxPoint &aPadPos, int aDiameter, OUTLINE_MODE aTraceMode, void *aData)=0
void SetEnd(const wxPoint &aEnd)
Definition: pcb_shape.h:137
#define GBR_NETINFO_ALL
KICAD_T Type() const
Returns the type of object.
Definition: eda_item.h:113
line segment
Definition: shape.h:44
bool GetFilledPolysUseThickness() const
Definition: zone.h:686
A color representation with 4 components: red, green, blue, alpha.
Definition: color4d.h:103
VECTOR2I B
Definition: seg.h:49