KiCad PCB EDA Suite
board_adapter.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) 2015-2016 Mario Luzeiro <mrluzeiro@ua.pt>
5  * Copyright (C) 1992-2021 KiCad Developers, see AUTHORS.txt for contributors.
6  *
7  * This program is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU General Public License
9  * as published by the Free Software Foundation; either version 2
10  * of the License, or (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program; if not, you may find one here:
19  * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
20  * or you may search the http://www.gnu.org website for the version 2 license,
21  * or you may write to the Free Software Foundation, Inc.,
22  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
23  */
24 
30 #include "../3d_rendering/camera.h"
31 #include "board_adapter.h"
33 #include <board.h>
34 #include <3d_math.h>
35 #include "3d_fastmath.h"
37 #include <convert_to_biu.h>
38 #include <pgm_base.h>
40 
49 const wxChar *BOARD_ADAPTER::m_logTrace = wxT( "KI_TRACE_EDA_CINFO3D_VISU" );
50 
51 
53  m_board( nullptr ),
54  m_3dModelManager( nullptr ),
55  m_colors( nullptr ),
56  m_layerZcoordTop(),
57  m_layerZcoordBottom()
58 {
59  wxLogTrace( m_logTrace, wxT( "BOARD_ADAPTER::BOARD_ADAPTER" ) );
60 
63  m_drawFlags.resize( FL_LAST, false );
64 
65  if( PgmOrNull() )
66  m_colors = Pgm().GetSettingsManager().GetColorSettings();
67 
70 
71  m_boardPos = wxPoint();
72  m_boardSize = wxSize();
73  m_boardCenter = SFVEC3F( 0.0f );
74 
76 
80 
82  m_epoxyThickness3DU = 0.0f;
83  m_copperThickness3DU = 0.0f;
86  m_biuTo3Dunits = 1.0;
87 
88  m_trackCount = 0;
89  m_viaCount = 0;
91  m_holeCount = 0;
92  m_averageHoleDiameter = 0.0f;
93  m_averageTrackWidth = 0.0f;
94 
97  SetFlag( FL_SHOW_BOARD_BODY, true );
102  SetFlag( FL_ZONE, true );
103  SetFlag( FL_SILKSCREEN, true );
104  SetFlag( FL_SOLDERMASK, true );
106 
112 
113  SetFlag( FL_USE_SELECTION, true );
114 
115  m_BgColorBot = SFVEC4F( 0.4, 0.4, 0.5, 1.0 );
116  m_BgColorTop = SFVEC4F( 0.8, 0.8, 0.9, 1.0 );
117  m_BoardBodyColor = SFVEC4F( 0.4, 0.4, 0.5, 0.9 );
118  m_SolderMaskColorTop = SFVEC4F( 0.1, 0.2, 0.1, 0.83 );
119  m_SolderMaskColorBot = SFVEC4F( 0.1, 0.2, 0.1, 0.83 );
120  m_SolderPasteColor = SFVEC4F( 0.4, 0.4, 0.4, 1.0 );
121  m_SilkScreenColorTop = SFVEC4F( 0.9, 0.9, 0.9, 1.0 );
122  m_SilkScreenColorBot = SFVEC4F( 0.9, 0.9, 0.9, 1.0 );
123  m_CopperColor = SFVEC4F( 0.75, 0.61, 0.23, 1.0 );
124 
125  m_platedPadsFront = nullptr;
126  m_platedPadsBack = nullptr;
127 
128  m_frontPlatedPadPolys = nullptr;
129  m_backPlatedPadPolys = nullptr;
130 
131  // Avoid raytracing options not initialized:
135 
136  m_RtSpreadShadows = 0.0;
137  m_RtSpreadReflections = 0.0;
138  m_RtSpreadRefractions = 0.0;
139 
142 }
143 
144 
146 {
147  destroyLayers();
148 }
149 
150 
152 {
153  wxASSERT( aLayer < PCB_LAYER_ID_COUNT );
154 
155  if( !m_board->IsLayerEnabled( aLayer ) )
156  return false;
157 
158  // see if layer needs to be shown
159  // check the flags
160  switch( aLayer )
161  {
162  case B_Adhes:
163  case F_Adhes:
164  return GetFlag( FL_ADHESIVE );
165 
166  case B_Paste:
167  case F_Paste:
168  return GetFlag( FL_SOLDERPASTE );
169 
170  case B_SilkS:
171  case F_SilkS:
172  return GetFlag( FL_SILKSCREEN );
173 
174  case B_Mask:
175  case F_Mask:
176  return GetFlag( FL_SOLDERMASK );
177 
178  case Dwgs_User:
179  case Cmts_User:
181  return false;
182 
183  return GetFlag( FL_COMMENTS );
184 
185  case Eco1_User:
186  case Eco2_User:
188  return false;
189 
190  return GetFlag( FL_ECO );
191 
192  case Edge_Cuts:
194  return false;
195 
196  return true;
197 
198  case Margin:
200  return false;
201 
202  return true;
203 
204  case B_Cu:
205  case F_Cu:
206  return m_board->IsLayerVisible( aLayer ) || GetFlag( FL_USE_REALISTIC_MODE );
207 
208  default:
209  // the layer is an internal copper layer, used the visibility
210  return m_board->IsLayerVisible( aLayer );
211  }
212 }
213 
214 
216 {
217  wxASSERT( aFlag < FL_LAST );
218 
219  return m_drawFlags[aFlag];
220 }
221 
222 
223 void BOARD_ADAPTER::SetFlag( DISPLAY3D_FLG aFlag, bool aState )
224 {
225  wxASSERT( aFlag < FL_LAST );
226 
227  m_drawFlags[aFlag] = aState;
228 }
229 
230 
232 {
233  if( aFPAttributes & FP_SMD )
235  else if( aFPAttributes & FP_THROUGH_HOLE )
237  else
239 }
240 
241 
242 // !TODO: define the actual copper thickness by user from board stackup
243 #define COPPER_THICKNESS Millimeter2iu( 0.035 ) // for 35 um
244 // The solder mask layer (and silkscreen) thickness
245 #define TECH_LAYER_THICKNESS Millimeter2iu( 0.04 )
246 // The solder paste thickness is chosen bigger than the solder mask layer
247 // to be sure is covers the mask when overlapping.
248 #define SOLDERPASTE_LAYER_THICKNESS Millimeter2iu( 0.08 )
249 
251 {
253 }
254 
255 
256 unsigned int BOARD_ADAPTER::GetCircleSegmentCount( float aDiameter3DU ) const
257 {
258  wxASSERT( aDiameter3DU > 0.0f );
259 
260  return GetCircleSegmentCount( (int)( aDiameter3DU / m_biuTo3Dunits ) );
261 }
262 
263 
264 unsigned int BOARD_ADAPTER::GetCircleSegmentCount( int aDiameterBIU ) const
265 {
266  wxASSERT( aDiameterBIU > 0 );
267 
268  return GetArcToSegmentCount( aDiameterBIU / 2, ARC_HIGH_DEF, 360.0 );
269 }
270 
271 
272 void BOARD_ADAPTER::InitSettings( REPORTER* aStatusReporter, REPORTER* aWarningReporter )
273 {
274  wxLogTrace( m_logTrace, wxT( "BOARD_ADAPTER::InitSettings" ) );
275 
276  if( aStatusReporter )
277  aStatusReporter->Report( _( "Build board outline" ) );
278 
279  wxString msg;
280 
281  const bool succeedToGetBoardPolygon = createBoardPolygon( &msg );
282 
283  if( aWarningReporter )
284  {
285  if( !succeedToGetBoardPolygon )
286  aWarningReporter->Report( msg, RPT_SEVERITY_WARNING );
287  else
288  aWarningReporter->Report( wxEmptyString );
289  }
290 
291  // Calculates the board bounding box (board outlines + items)
292  // to ensure any item, even outside the board outlines can be seen
293  bool boardEdgesOnly = true;
294 
296  || !succeedToGetBoardPolygon )
297  boardEdgesOnly = false;
298 
299  EDA_RECT bbbox = m_board->ComputeBoundingBox( boardEdgesOnly );
300 
301  // Gives a non null size to avoid issues in zoom / scale calculations
302  if( ( bbbox.GetWidth() == 0 ) && ( bbbox.GetHeight() == 0 ) )
303  bbbox.Inflate( Millimeter2iu( 10 ) );
304 
305  m_boardSize = bbbox.GetSize();
306  m_boardPos = bbbox.Centre();
307 
308  wxASSERT( (m_boardSize.x > 0) && (m_boardSize.y > 0) );
309 
310  m_boardPos.y = -m_boardPos.y; // The y coord is inverted in 3D viewer
311 
313 
314  // Ensure the board has 2 sides for 3D views, because it is hard to find
315  // a *really* single side board in the true life...
316  if( m_copperLayersCount < 2 )
318 
319  // Calculate the conversion to apply to all positions.
321 
323 
324  // !TODO: use value defined by user (currently use default values by ctor
328 
329  // Init Z position of each layer
330  // calculate z position for each copper layer
331  // Zstart = -m_epoxyThickness / 2.0 is the z position of the back (bottom layer) (layer id = 31)
332  // Zstart = +m_epoxyThickness / 2.0 is the z position of the front (top layer) (layer id = 0)
333  // all unused copper layer z position are set to 0
334 
335  // ____==__________==________==______ <- Bottom = +m_epoxyThickness / 2.0,
336  // | | Top = Bottom + m_copperThickness
337  // |__________________________________|
338  // == == == == <- Bottom = -m_epoxyThickness / 2.0,
339  // Top = Bottom - m_copperThickness
340 
341  unsigned int layer;
342 
343  for( layer = 0; layer < m_copperLayersCount; ++layer )
344  {
345  m_layerZcoordBottom[layer] = m_epoxyThickness3DU / 2.0f -
346  (m_epoxyThickness3DU * layer / (m_copperLayersCount - 1) );
347 
348  if( layer < (m_copperLayersCount / 2) )
350  else
352  }
353 
354  #define layerThicknessMargin 1.1
355  const float zpos_offset = m_nonCopperLayerThickness3DU * layerThicknessMargin;
356 
357  // Fill remaining unused copper layers and back layer zpos
358  // with -m_epoxyThickness / 2.0
359  for( ; layer < MAX_CU_LAYERS; layer++ )
360  {
361  m_layerZcoordBottom[layer] = -(m_epoxyThickness3DU / 2.0f);
363  }
364 
365  // This is the top of the copper layer thickness.
366  const float zpos_copperTop_back = m_layerZcoordTop[B_Cu];
367  const float zpos_copperTop_front = m_layerZcoordTop[F_Cu];
368 
369  // calculate z position for each non copper layer
370  // Solder mask and Solder paste have the same Z position
371  for( int layer_id = MAX_CU_LAYERS; layer_id < PCB_LAYER_ID_COUNT; ++layer_id )
372  {
373  float zposTop;
374  float zposBottom;
375 
376  switch( layer_id )
377  {
378  case B_Adhes:
379  zposBottom = zpos_copperTop_back - 2.0f * zpos_offset;
380  zposTop = zposBottom - m_nonCopperLayerThickness3DU;
381  break;
382 
383  case F_Adhes:
384  zposBottom = zpos_copperTop_front + 2.0f * zpos_offset;
385  zposTop = zposBottom + m_nonCopperLayerThickness3DU;
386  break;
387 
388  case B_Mask:
389  zposBottom = zpos_copperTop_back;
390  zposTop = zpos_copperTop_back - m_nonCopperLayerThickness3DU;
391  break;
392 
393  case B_Paste:
394  zposBottom = zpos_copperTop_back;
395  zposTop = zpos_copperTop_back - m_solderPasteLayerThickness3DU;
396  break;
397 
398  case F_Mask:
399  zposBottom = zpos_copperTop_front;
400  zposTop = zpos_copperTop_front + m_nonCopperLayerThickness3DU;
401  break;
402 
403  case F_Paste:
404  zposBottom = zpos_copperTop_front;
405  zposTop = zpos_copperTop_front + m_solderPasteLayerThickness3DU;
406  break;
407 
408  case B_SilkS:
409  zposBottom = zpos_copperTop_back - 1.0f * zpos_offset;
410  zposTop = zposBottom - m_nonCopperLayerThickness3DU;
411  break;
412 
413  case F_SilkS:
414  zposBottom = zpos_copperTop_front + 1.0f * zpos_offset;
415  zposTop = zposBottom + m_nonCopperLayerThickness3DU;
416  break;
417 
418  // !TODO: review
419  default:
420  zposTop = zpos_copperTop_front + (layer_id - MAX_CU_LAYERS + 3.0f) * zpos_offset;
421  zposBottom = zposTop - m_nonCopperLayerThickness3DU;
422  break;
423  }
424 
425  m_layerZcoordTop[layer_id] = zposTop;
426  m_layerZcoordBottom[layer_id] = zposBottom;
427  }
428 
430 
432  0.0f );
433  boardSize /= 2.0f;
434 
435  SFVEC3F boardMin = ( m_boardCenter - boardSize );
436  SFVEC3F boardMax = ( m_boardCenter + boardSize );
437 
438  boardMin.z = m_layerZcoordTop[B_Adhes];
439  boardMax.z = m_layerZcoordTop[F_Adhes];
440 
441  m_boardBoundingBox = BBOX_3D( boardMin, boardMax );
442 
443 #ifdef PRINT_STATISTICS_3D_VIEWER
444  unsigned stats_startCreateBoardPolyTime = GetRunningMicroSecs();
445 #endif
446 
447  if( aStatusReporter )
448  aStatusReporter->Report( _( "Create layers" ) );
449 
450  createLayers( aStatusReporter );
451 }
452 
453 
454 extern bool BuildFootprintPolygonOutlines( BOARD* aBoard, SHAPE_POLY_SET& aOutlines,
455  int aErrorMax, int aChainingEpsilon,
456  OUTLINE_ERROR_HANDLER* aErrorHandler = nullptr );
457 
458 
459 bool BOARD_ADAPTER::createBoardPolygon( wxString* aErrorMsg )
460 {
462 
463  bool success;
464 
465  if( m_board->IsFootprintHolder() )
466  {
467  if( !m_board->GetFirstFootprint() )
468  {
469  if( aErrorMsg )
470  *aErrorMsg = _( "No footprint loaded." );
471 
472  return false;
473  }
474 
475  int chainingEpsilon = Millimeter2iu( 0.02 ); // max dist from one endPt to next startPt
476 
479  chainingEpsilon );
480 
481  // Make polygon strictly simple to avoid issues (especially in 3D viewer)
483 
484  if( !success && aErrorMsg )
485  {
486  *aErrorMsg = _( "Footprint outline is missing or malformed. Run Footprint Checker for "
487  "a full analysis." );
488  }
489  }
490  else
491  {
493 
494  if( !success && aErrorMsg )
495  *aErrorMsg = _( "Board outline is missing or malformed. Run DRC for a full analysis." );
496  }
497 
498  return success;
499 }
500 
501 
502 float BOARD_ADAPTER::GetFootprintZPos( bool aIsFlipped ) const
503 {
504  if( aIsFlipped )
505  {
506  if( GetFlag( FL_SOLDERPASTE ) )
508  else
510  }
511  else
512  {
513  if( GetFlag( FL_SOLDERPASTE ) )
514  return m_layerZcoordTop[F_SilkS];
515  else
516  return m_layerZcoordTop[F_Paste];
517  }
518 }
519 
520 
522 {
523  wxASSERT( aLayerId < PCB_LAYER_ID_COUNT );
524 
525  const COLOR4D color = m_colors->GetColor( aLayerId );
526 
527  return SFVEC4F( color.r, color.g, color.b, color.a );
528 }
529 
530 
532 {
533  return GetColor( m_colors->GetColor( aItemId ) );
534 }
535 
536 
538 {
539  return SFVEC4F( aColor.r, aColor.g, aColor.b, aColor.a );
540 }
bool GetFlag(DISPLAY3D_FLG aFlag) const
Get a configuration status of a flag.
SFVEC4F GetColor(COLOR4D aColor) const
BVH_CONTAINER_2D * m_platedPadsFront
int m_RtShadowSampleCount
Defines math related functions.
#define TECH_LAYER_THICKNESS
SFVEC4F m_SilkScreenColorBot
in realistic mode: SilkScreen color ( bot )
bool GetBoardPolygonOutlines(SHAPE_POLY_SET &aOutlines, OUTLINE_ERROR_HANDLER *aErrorHandler=nullptr)
Extract the board outlines and build a closed polygon from lines, arcs and circle items on edge cut l...
Definition: board.cpp:1922
bool BuildFootprintPolygonOutlines(BOARD *aBoard, SHAPE_POLY_SET &aOutlines, int aErrorMax, int aChainingEpsilon, OUTLINE_ERROR_HANDLER *aErrorHandler=nullptr)
This function is used to extract a board outline for a footprint view.
SHAPE_POLY_SET * m_backPlatedPadPolys
Polygon contours for hole outer diameters for each layer.
float m_solderPasteLayerThickness3DU
Number of tracks in the board.
BVH_CONTAINER_2D m_throughHoleIds
List of through hole vias with the radius of the hole inflated with the copper thickness.
bool IsFootprintShown(FOOTPRINT_ATTR_T aFPAttributes) const
Test if footprint should be displayed in relation to attributes and the flags.
float m_nonCopperLayerThickness3DU
solder paste layers thickness in 3D units.
SHAPE_POLY_SET * m_frontPlatedPadPolys
Manage a bounding box defined by two SFVEC3F min max points.
Definition: bbox_3d.h:41
float m_averageHoleDiameter
glm::vec4 SFVEC4F
Definition: xv3d_types.h:46
int GetHolePlatingThickness() const
Pad & via drills are finish size.
void SetFlag(DISPLAY3D_FLG aFlag, bool aState)
Set the status of a flag.
COLOR_SETTINGS * m_colors
SFVEC4F m_SolderMaskColorTop
in realistic mode: solder mask color ( top )
int color
Definition: DXF_plotter.cpp:60
int GetWidth() const
Definition: eda_rect.h:114
BVH_CONTAINER_2D m_throughHoleOds
List of plated through hole annular rings.
void InitSettings(REPORTER *aStatusReporter, REPORTER *aWarningReporter)
Function to be called by the render when it need to reload the settings for the board.
SFVEC4F m_BoardBodyColor
in realistic mode: FR4 board color
SFVEC4F m_SolderPasteColor
in realistic mode: solder paste color
BOARD_DESIGN_SETTINGS & GetDesignSettings() const
Definition: board.h:593
double g
Green component.
Definition: color4d.h:359
#define layerThicknessMargin
float m_averageTrackWidth
Number of through hole vias in the board.
SFVEC4F m_SolderMaskColorBot
in realistic mode: solder mask color ( bot )
wxPoint m_boardPos
Board center position in board internal units.
bool IsFootprintHolder() const
Find out if the board is being used to hold a single footprint for editing/viewing.
Definition: board.h:293
A pure virtual class used to derive REPORTER objects from.
Definition: reporter.h:64
std::array< float, PCB_LAYER_ID_COUNT > m_layerZcoordBottom
Copper thickness in 3D units.
bool IsLayerEnabled(PCB_LAYER_ID aLayer) const
A proxy function that calls the correspondent function in m_BoardSettings tests whether a given layer...
Definition: board.h:515
float m_epoxyThickness3DU
Non copper layers thickness in 3D units.
float m_copperThickness3DU
Epoxy thickness in 3D units.
KIWAY Kiway & Pgm(), KFCTL_STANDALONE
The global Program "get" accessor.
Definition: single_top.cpp:106
float m_RtSpreadRefractions
virtual REPORTER & Report(const wxString &aText, SEVERITY aSeverity=RPT_SEVERITY_UNDEFINED)=0
Report a string with a given severity.
FOOTPRINT_ATTR_T
The set of attributes allowed within a FOOTPRINT, using FOOTPRINT::SetAttributes() and FOOTPRINT::Get...
Definition: footprint.h:66
double b
Blue component.
Definition: color4d.h:360
bool Is3dLayerEnabled(PCB_LAYER_ID aLayer) const
Check if a layer is enabled.
PCB_LAYER_ID
A quick note on layer IDs:
double a
Alpha component.
Definition: color4d.h:361
int m_RtRecursiveReflectionCount
float m_RtSpreadReflections
SFVEC4F m_BgColorTop
background top color
unsigned int m_trackCount
Track average width.
std::vector< bool > m_drawFlags
std::array< float, PCB_LAYER_ID_COUNT > m_layerZcoordTop
Bottom (Start) Z position of each layer in 3D units.
FOOTPRINT * GetFirstFootprint() const
Gets the first footprint on the board or nullptr.
Definition: board.h:382
GRID3D_TYPE m_gridType
SHAPE_POLY_SET m_board_poly
Board outline polygon.
PGM_BASE * PgmOrNull()
similar to PGM_BASE& Pgm(), but return a reference that can be nullptr when running a shared lib from...
Definition: cvpcb.cpp:112
BVH_CONTAINER_2D * m_platedPadsBack
The holes per each layer.
BBOX_3D m_boardBoundingBox
3D bounding box of the board in 3D units.
Represent a set of closed polygons.
Use all material properties from model file.
double m_biuTo3Dunits
Top (End) Z position of each layer in 3D units.
SFVEC4F m_BgColorBot
background bottom color
a few functions useful in geometry calculations.
void Simplify(POLYGON_MODE aFastMode)
BVH_CONTAINER_2D m_throughHoleAnnularRings
List of through hole inner diameters.
unsigned int m_viaCount
Computed average diameter of the via holes in 3D units.
int m_RtRecursiveRefractionCount
int m_RtRefractionSampleCount
SFVEC4F GetItemColor(int aItemId) const
Get the technical color of a layer.
void createLayers(REPORTER *aStatusReporter)
int GetHeight() const
Definition: eda_rect.h:115
#define SOLDERPASTE_LAYER_THICKNESS
float GetFootprintZPos(bool aIsFlipped) const
Get the position of the footprint in 3d integer units considering if it is flipped or not.
DISPLAY3D_FLG
Flags used in rendering options.
Definition: 3d_enums.h:34
RENDER_ENGINE m_renderEngine
COLOR4D GetColor(int aLayer) const
wxSize m_boardSize
Board size in board internal units.
bool IsLayerVisible(PCB_LAYER_ID aLayer) const
A proxy function that calls the correspondent function in m_BoardSettings tests whether a given layer...
Definition: board.cpp:453
SFVEC4F GetLayerColor(PCB_LAYER_ID aLayerId) const
Get the technical color of a layer.
see class PGM_BASE
MATERIAL_MODE m_materialMode
static const wxChar * m_logTrace
Trace mask used to enable or disable the trace output of this class.
Information pertinent to a Pcbnew printed circuit board.
Definition: board.h:190
#define _(s)
Definition: 3d_actions.cpp:33
unsigned GetRunningMicroSecs()
An alternate way to calculate an elapset time (in microsecondes) to class PROF_COUNTER.
glm::vec3 SFVEC3F
Definition: xv3d_types.h:44
unsigned int m_copperLayersCount
Scale factor to convert board internal units to 3D units normalized between -1.0 and 1....
bool createBoardPolygon(wxString *aErrorMsg)
Create the board outline polygon.
SFVEC4F m_CopperColor
in realistic mode: copper color
int GetCopperLayerCount() const
Definition: board.cpp:435
Handle the component boundary box.
Definition: eda_rect.h:42
const std::function< void(const wxString &msg, BOARD_ITEM *itemA, BOARD_ITEM *itemB, const wxPoint &pt)> OUTLINE_ERROR_HANDLER
wxPoint Centre() const
Definition: eda_rect.h:60
EDA_RECT ComputeBoundingBox(bool aBoardEdgesOnly=false) const
Calculate the bounding box containing all board items (or board edge segments).
Definition: board.cpp:1050
Defines math related functions.
SFVEC4F m_SilkScreenColorTop
in realistic mode: SilkScreen color ( top )
ANTIALIASING_MODE m_antiAliasingMode
SFVEC3F m_boardCenter
3D center position of the board in 3D units.
#define COPPER_THICKNESS
double r
Red component.
Definition: color4d.h:358
float m_averageViaHoleDiameter
Number of holes in the board.
float m_RtSpreadShadows
static constexpr int Millimeter2iu(double mm)
void Clear() override
#define RANGE_SCALE_3D
This defines the range that all coord will have to be rendered.
Definition: board_adapter.h:61
void Reset()
Reset the bounding box to zero and de-initialize it.
Definition: bbox_3d.cpp:95
int GetArcToSegmentCount(int aRadius, int aErrorMax, double aArcAngleDegree)
unsigned int GetCircleSegmentCount(float aDiameter3DU) const
int m_RtReflectionSampleCount
EDA_RECT & Inflate(wxCoord dx, wxCoord dy)
Inflate the rectangle horizontally by dx and vertically by dy.
Definition: eda_rect.cpp:363
unsigned int m_holeCount
Computed average diameter of the holes in 3D units.
const wxSize GetSize() const
Definition: eda_rect.h:96
int GetHolePlatingThickness() const noexcept
Get the current copper layer thickness.
A color representation with 4 components: red, green, blue, alpha.
Definition: color4d.h:98