KiCad PCB EDA Suite
Loading...
Searching...
No Matches
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-2023 Mario Luzeiro <[email protected]>
5 * Copyright (C) 2023 CERN
6 * Copyright (C) 1992-2023 KiCad Developers, see AUTHORS.txt for contributors.
7 *
8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public License
10 * as published by the Free Software Foundation; either version 2
11 * of the License, or (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, you may find one here:
20 * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
21 * or you may search the http://www.gnu.org website for the version 2 license,
22 * or you may write to the Free Software Foundation, Inc.,
23 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
24 */
25
26#include <gal/3d/camera.h>
27#include "board_adapter.h"
32#include <board.h>
34#include <3d_math.h>
35#include "3d_fastmath.h"
37#include <pgm_base.h>
39#include <wx/log.h>
40#include <pcbnew_settings.h>
41#include <advanced_config.h>
42
43
44#define DEFAULT_BOARD_THICKNESS pcbIUScale.mmToIU( 1.6 )
45#define DEFAULT_COPPER_THICKNESS pcbIUScale.mmToIU( 0.035 ) // for 35 um
46// The solder mask layer (and silkscreen) thickness
47#define DEFAULT_TECH_LAYER_THICKNESS pcbIUScale.mmToIU( 0.025 )
48// The solder paste thickness is chosen bigger than the solder mask layer
49// to be sure is covers the mask when overlapping.
50#define SOLDERPASTE_LAYER_THICKNESS pcbIUScale.mmToIU( 0.04 )
51
52
58
68
69// To be used in Raytracing render to create bevels on layer items
71
72static bool g_ColorsLoaded = false;
73
82const wxChar *BOARD_ADAPTER::m_logTrace = wxT( "KI_TRACE_EDA_CINFO3D_VISU" );
83
84
86 m_Cfg( nullptr ),
87 m_IsBoardView( true ),
88 m_MousewheelPanning( true ),
89 m_IsPreviewer( false ),
90 m_board( nullptr ),
91 m_3dModelManager( nullptr ),
92 m_colors( nullptr ),
93 m_layerZcoordTop(),
94 m_layerZcoordBottom()
95{
96 wxLogTrace( m_logTrace, wxT( "BOARD_ADAPTER::BOARD_ADAPTER" ) );
97
99
102 m_boardCenter = SFVEC3F( 0.0f );
103
105
106 m_TH_IDs.Clear();
107 m_TH_ODs.Clear();
109
111
112 m_biuTo3Dunits = 1.0;
118
119 m_trackCount = 0;
120 m_viaCount = 0;
122 m_holeCount = 0;
124 m_averageTrackWidth = 0.0f;
125
126 m_BgColorBot = SFVEC4F( 0.4, 0.4, 0.5, 1.0 );
127 m_BgColorTop = SFVEC4F( 0.8, 0.8, 0.9, 1.0 );
128 m_BoardBodyColor = SFVEC4F( 0.4, 0.4, 0.5, 0.9 );
129 m_SolderMaskColorTop = SFVEC4F( 0.1, 0.2, 0.1, 0.83 );
130 m_SolderMaskColorBot = SFVEC4F( 0.1, 0.2, 0.1, 0.83 );
131 m_SolderPasteColor = SFVEC4F( 0.4, 0.4, 0.4, 1.0 );
132 m_SilkScreenColorTop = SFVEC4F( 0.9, 0.9, 0.9, 1.0 );
133 m_SilkScreenColorBot = SFVEC4F( 0.9, 0.9, 0.9, 1.0 );
134 m_CopperColor = SFVEC4F( 0.75, 0.61, 0.23, 1.0 );
135 m_UserDrawingsColor = SFVEC4F( 0.85, 0.85, 0.85, 1.0 );
136 m_UserCommentsColor = SFVEC4F( 0.85, 0.85, 0.85, 1.0 );
137 m_ECO1Color = SFVEC4F( 0.70, 0.10, 0.10, 1.0 );
138 m_ECO2Color = SFVEC4F( 0.70, 0.10, 0.10, 1.0 );
139
140 m_platedPadsFront = nullptr;
141 m_platedPadsBack = nullptr;
142 m_offboardPadsFront = nullptr;
143 m_offboardPadsBack = nullptr;
144
145 m_frontPlatedPadPolys = nullptr;
146 m_backPlatedPadPolys = nullptr;
147 m_frontPlatedCopperPolys = nullptr;
148 m_backPlatedCopperPolys = nullptr;
149
150 if( !g_ColorsLoaded )
151 {
152#define ADD_COLOR( list, r, g, b, a, name ) \
153 list.emplace_back( r/255.0, g/255.0, b/255.0, a, name )
154
155 ADD_COLOR( g_SilkColors, 245, 245, 245, 1.0, NotSpecifiedPrm() ); // White
156 ADD_COLOR( g_SilkColors, 20, 51, 36, 1.0, wxT( "Green" ) );
157 ADD_COLOR( g_SilkColors, 181, 19, 21, 1.0, wxT( "Red" ) );
158 ADD_COLOR( g_SilkColors, 2, 59, 162, 1.0, wxT( "Blue" ) );
159 ADD_COLOR( g_SilkColors, 11, 11, 11, 1.0, wxT( "Black" ) );
160 ADD_COLOR( g_SilkColors, 245, 245, 245, 1.0, wxT( "White" ) );
161 ADD_COLOR( g_SilkColors, 32, 2, 53, 1.0, wxT( "Purple" ) );
162 ADD_COLOR( g_SilkColors, 194, 195, 0, 1.0, wxT( "Yellow" ) );
163
164 ADD_COLOR( g_MaskColors, 20, 51, 36, 0.83, NotSpecifiedPrm() ); // Green
165 ADD_COLOR( g_MaskColors, 20, 51, 36, 0.83, wxT( "Green" ) );
166 ADD_COLOR( g_MaskColors, 91, 168, 12, 0.83, wxT( "Light Green" ) );
167 ADD_COLOR( g_MaskColors, 13, 104, 11, 0.83, wxT( "Saturated Green" ) );
168 ADD_COLOR( g_MaskColors, 181, 19, 21, 0.83, wxT( "Red" ) );
169 ADD_COLOR( g_MaskColors, 210, 40, 14, 0.83, wxT( "Light Red" ) );
170 ADD_COLOR( g_MaskColors, 239, 53, 41, 0.83, wxT( "Red/Orange" ) );
171 ADD_COLOR( g_MaskColors, 2, 59, 162, 0.83, wxT( "Blue" ) );
172 ADD_COLOR( g_MaskColors, 54, 79, 116, 0.83, wxT( "Light Blue 1" ) );
173 ADD_COLOR( g_MaskColors, 61, 85, 130, 0.83, wxT( "Light Blue 2" ) );
174 ADD_COLOR( g_MaskColors, 21, 70, 80, 0.83, wxT( "Green/Blue" ) );
175 ADD_COLOR( g_MaskColors, 11, 11, 11, 0.83, wxT( "Black" ) );
176 ADD_COLOR( g_MaskColors, 245, 245, 245, 0.83, wxT( "White" ) );
177 ADD_COLOR( g_MaskColors, 32, 2, 53, 0.83, wxT( "Purple" ) );
178 ADD_COLOR( g_MaskColors, 119, 31, 91, 0.83, wxT( "Light Purple" ) );
179 ADD_COLOR( g_MaskColors, 194, 195, 0, 0.83, wxT( "Yellow" ) );
180
181 ADD_COLOR( g_PasteColors, 128, 128, 128, 1.0, wxT( "Grey" ) );
182 ADD_COLOR( g_PasteColors, 90, 90, 90, 1.0, wxT( "Dark Grey" ) );
183 ADD_COLOR( g_PasteColors, 213, 213, 213, 1.0, wxT( "Silver" ) );
184
185 ADD_COLOR( g_FinishColors, 184, 115, 50, 1.0, wxT( "Copper" ) );
186 ADD_COLOR( g_FinishColors, 178, 156, 0, 1.0, wxT( "Gold" ) );
187 ADD_COLOR( g_FinishColors, 213, 213, 213, 1.0, wxT( "Silver" ) );
188 ADD_COLOR( g_FinishColors, 160, 160, 160, 1.0, wxT( "Tin" ) );
189
190 ADD_COLOR( g_BoardColors, 51, 43, 22, 0.83, wxT( "FR4 natural, dark" ) );
191 ADD_COLOR( g_BoardColors, 109, 116, 75, 0.83, wxT( "FR4 natural" ) );
192 ADD_COLOR( g_BoardColors, 252, 252, 250, 0.90, wxT( "PTFE natural" ) );
193 ADD_COLOR( g_BoardColors, 205, 130, 0, 0.68, wxT( "Polyimide" ) );
194 ADD_COLOR( g_BoardColors, 92, 17, 6, 0.90, wxT( "Phenolic natural" ) );
195 ADD_COLOR( g_BoardColors, 146, 99, 47, 0.83, wxT( "Brown 1" ) );
196 ADD_COLOR( g_BoardColors, 160, 123, 54, 0.83, wxT( "Brown 2" ) );
197 ADD_COLOR( g_BoardColors, 146, 99, 47, 0.83, wxT( "Brown 3" ) );
198 ADD_COLOR( g_BoardColors, 213, 213, 213, 1.0, wxT( "Aluminum" ) );
199
200 g_DefaultBackgroundTop = COLOR4D( 0.80, 0.80, 0.90, 1.0 );
201 g_DefaultBackgroundBot = COLOR4D( 0.40, 0.40, 0.50, 1.0 );
202
203 g_DefaultSilkscreen = COLOR4D( 0.94, 0.94, 0.94, 1.0 );
204 g_DefaultSolderMask = COLOR4D( 0.08, 0.20, 0.14, 0.83 );
205 g_DefaultSolderPaste = COLOR4D( 0.50, 0.50, 0.50, 1.0 );
206 g_DefaultSurfaceFinish = COLOR4D( 0.75, 0.61, 0.23, 1.0 );
207 g_DefaultBoardBody = COLOR4D( 0.43, 0.45, 0.30, 0.90 );
208
209 g_DefaultComments = COLOR4D( 0.85, 0.85, 0.85, 1.0 );
210 g_DefaultECOs = COLOR4D( 0.70, 0.10, 0.10, 1.0 );
211
212 g_ColorsLoaded = true;
213 }
214#undef ADD_COLOR
215}
216
217
219{
221}
222
223
225{
226 wxCHECK( PgmOrNull(), /* void */ );
227
228 PCBNEW_SETTINGS* cfg = nullptr;
229
230 try
231 {
232 cfg = Pgm().GetSettingsManager().GetAppSettings<PCBNEW_SETTINGS>();
233 }
234 catch( const std::runtime_error& e )
235 {
236 wxFAIL_MSG( e.what() );
237 }
238
239 if( cfg )
240 {
241 m_colors = Pgm().GetSettingsManager().GetColorSettings( cfg->m_ColorTheme );
242 }
243}
244
245
247 const std::bitset<LAYER_3D_END>& aVisibilityFlags ) const
248{
249 wxASSERT( aLayer < PCB_LAYER_ID_COUNT );
250
251 if( m_board && !m_board->IsLayerEnabled( aLayer ) )
252 return false;
253
254 switch( aLayer )
255 {
256 case B_Cu: return aVisibilityFlags.test( LAYER_3D_COPPER_BOTTOM );
257 case F_Cu: return aVisibilityFlags.test( LAYER_3D_COPPER_TOP );
258 case B_Adhes: return aVisibilityFlags.test( LAYER_3D_ADHESIVE );
259 case F_Adhes: return aVisibilityFlags.test( LAYER_3D_ADHESIVE );
260 case B_Paste: return aVisibilityFlags.test( LAYER_3D_SOLDERPASTE );
261 case F_Paste: return aVisibilityFlags.test( LAYER_3D_SOLDERPASTE );
262 case B_SilkS: return aVisibilityFlags.test( LAYER_3D_SILKSCREEN_BOTTOM );
263 case F_SilkS: return aVisibilityFlags.test( LAYER_3D_SILKSCREEN_TOP );
264 case B_Mask: return aVisibilityFlags.test( LAYER_3D_SOLDERMASK_BOTTOM );
265 case F_Mask: return aVisibilityFlags.test( LAYER_3D_SOLDERMASK_TOP );
266 case Dwgs_User: return aVisibilityFlags.test( LAYER_3D_USER_DRAWINGS );
267 case Cmts_User: return aVisibilityFlags.test( LAYER_3D_USER_COMMENTS );
268 case Eco1_User: return aVisibilityFlags.test( LAYER_3D_USER_ECO1 );
269 case Eco2_User: return aVisibilityFlags.test( LAYER_3D_USER_ECO2 );
270 default: return m_board && m_board->IsLayerVisible( aLayer );
271 }
272}
273
274
276{
277 if( m_IsPreviewer ) // In panel Preview, footprints are always shown, of course
278 return true;
279
280 if( aFPAttributes & FP_EXCLUDE_FROM_POS_FILES )
281 {
283 return false;
284 }
285
286 if( aFPAttributes & FP_DNP )
287 {
289 return false;
290 }
291
292 if( aFPAttributes & FP_SMD )
294
295 if( aFPAttributes & FP_THROUGH_HOLE )
297
299}
300
301
303{
306}
307
308
309unsigned int BOARD_ADAPTER::GetCircleSegmentCount( float aDiameter3DU ) const
310{
311 wxASSERT( aDiameter3DU > 0.0f );
312
313 return GetCircleSegmentCount( (int)( aDiameter3DU / m_biuTo3Dunits ) );
314}
315
316
317unsigned int BOARD_ADAPTER::GetCircleSegmentCount( int aDiameterBIU ) const
318{
319 wxASSERT( aDiameterBIU > 0 );
320
321 return GetArcToSegmentCount( aDiameterBIU / 2, ARC_HIGH_DEF, FULL_CIRCLE );
322}
323
324
325void BOARD_ADAPTER::InitSettings( REPORTER* aStatusReporter, REPORTER* aWarningReporter )
326{
327 wxLogTrace( m_logTrace, wxT( "BOARD_ADAPTER::InitSettings" ) );
328
329 if( aStatusReporter )
330 aStatusReporter->Report( _( "Build board outline" ) );
331
332 wxString msg;
333
334 const bool haveOutline = createBoardPolygon( &msg );
335
336 if( aWarningReporter )
337 {
338 if( !haveOutline )
339 aWarningReporter->Report( msg, RPT_SEVERITY_WARNING );
340 else
341 aWarningReporter->Report( wxEmptyString );
342 }
343
344 BOX2I bbbox;
345
346 if( m_board )
347 bbbox = m_board->ComputeBoundingBox( !m_board->IsFootprintHolder() && haveOutline );
348
349 // Gives a non null size to avoid issues in zoom / scale calculations
350 if( ( bbbox.GetWidth() == 0 ) && ( bbbox.GetHeight() == 0 ) )
351 bbbox.Inflate( pcbIUScale.mmToIU( 10 ) );
352
353 m_boardSize = bbbox.GetSize();
354 m_boardPos = bbbox.Centre();
355
356 wxASSERT( (m_boardSize.x > 0) && (m_boardSize.y > 0) );
357
358 m_boardPos.y = -m_boardPos.y; // The y coord is inverted in 3D viewer
359
361
362 // Ensure the board has 2 sides for 3D views, because it is hard to find
363 // a *really* single side board in the true life...
364 if( m_copperLayersCount < 2 )
366
367 // Calculate the conversion to apply to all positions.
369
370 // Hack to keep "home" zoom from being too small.
371 if( !m_board || !m_board->IsFootprintHolder() )
372 m_biuTo3Dunits *= 1.6f;
373
379
380 g_BevelThickness3DU = pcbIUScale.mmToIU( ADVANCED_CFG::GetCfg().m_3DRT_BevelHeight_um / 1000.0 ) * m_biuTo3Dunits;
381
382 if( m_board )
383 {
385
386 if( bds.GetStackupDescriptor().GetCount() )
387 {
388 int thickness = 0;
389
390 for( BOARD_STACKUP_ITEM* item : bds.GetStackupDescriptor().GetList() )
391 {
392 switch( item->GetType() )
393 {
395 for( int sublayer = 0; sublayer < item->GetSublayersCount(); sublayer++ )
396 thickness += item->GetThickness( sublayer );
397 break;
398
400 if( item->GetBrdLayerId() == F_Cu )
401 m_frontCopperThickness3DU = item->GetThickness() * m_biuTo3Dunits;
402 else if( item->GetBrdLayerId() == B_Cu )
403 m_backCopperThickness3DU = item->GetThickness() * m_biuTo3Dunits;
404 else if( item->IsEnabled() )
405 thickness += item->GetThickness();
406
407 break;
408
409 default:
410 break;
411 }
412 }
413
415 }
416 }
417
418 // Init Z position of each layer
419 // calculate z position for each copper layer
420 // Zstart = -m_epoxyThickness / 2.0 is the z position of the back (bottom layer) (layer id = 31)
421 // Zstart = +m_epoxyThickness / 2.0 is the z position of the front (top layer) (layer id = 0)
422
423 // ____==__________==________==______ <- Bottom = +m_epoxyThickness / 2.0,
424 // | | Top = Bottom + m_copperThickness
425 // |__________________________________|
426 // == == == == <- Bottom = -m_epoxyThickness / 2.0,
427 // Top = Bottom - m_copperThickness
428
429 unsigned int layer;
430
431 for( layer = 0; layer < m_copperLayersCount; ++layer )
432 {
433 // This approximates internal layer positions (because we're treating all the dielectric
434 // layers as having the same thickness). But we don't render them anyway so it doesn't
435 // really matter.
438
439 if( layer < (m_copperLayersCount / 2) )
441 else
443 }
444
445 #define layerThicknessMargin 1.1
446 const float zpos_offset = m_nonCopperLayerThickness3DU * layerThicknessMargin;
447
448 // Fill remaining unused copper layers and back layer zpos with -m_boardBodyThickness / 2.0
449 for( ; layer < MAX_CU_LAYERS; layer++ )
450 {
451 m_layerZcoordBottom[layer] = -( m_boardBodyThickness3DU / 2.0f );
453 }
454
455 // This is the top of the copper layer thickness.
456 const float zpos_copperTop_back = m_layerZcoordTop[B_Cu];
457 const float zpos_copperTop_front = m_layerZcoordTop[F_Cu];
458
459 // calculate z position for each non copper layer
460 // Solder mask and Solder paste have the same Z position
461 for( int layer_id = MAX_CU_LAYERS; layer_id < PCB_LAYER_ID_COUNT; ++layer_id )
462 {
463 float zposTop;
464 float zposBottom;
465
466 switch( layer_id )
467 {
468 case B_Adhes:
469 zposBottom = zpos_copperTop_back - 2.0f * zpos_offset;
470 zposTop = zposBottom - m_nonCopperLayerThickness3DU;
471 break;
472
473 case F_Adhes:
474 zposBottom = zpos_copperTop_front + 2.0f * zpos_offset;
475 zposTop = zposBottom + m_nonCopperLayerThickness3DU;
476 break;
477
478 case B_Mask:
479 zposBottom = zpos_copperTop_back;
480 zposTop = zpos_copperTop_back - m_nonCopperLayerThickness3DU;
481 break;
482
483 case B_Paste:
484 zposBottom = zpos_copperTop_back;
485 zposTop = zpos_copperTop_back - m_solderPasteLayerThickness3DU;
486 break;
487
488 case F_Mask:
489 zposBottom = zpos_copperTop_front;
490 zposTop = zpos_copperTop_front + m_nonCopperLayerThickness3DU;
491 break;
492
493 case F_Paste:
494 zposBottom = zpos_copperTop_front;
495 zposTop = zpos_copperTop_front + m_solderPasteLayerThickness3DU;
496 break;
497
498 case B_SilkS:
499 zposBottom = zpos_copperTop_back - 1.0f * zpos_offset;
500 zposTop = zposBottom - m_nonCopperLayerThickness3DU;
501 break;
502
503 case F_SilkS:
504 zposBottom = zpos_copperTop_front + 1.0f * zpos_offset;
505 zposTop = zposBottom + m_nonCopperLayerThickness3DU;
506 break;
507
508 default:
509 zposTop = zpos_copperTop_front + (layer_id - MAX_CU_LAYERS + 3.0f) * zpos_offset;
510 zposBottom = zposTop - m_nonCopperLayerThickness3DU;
511 break;
512 }
513
514 m_layerZcoordTop[layer_id] = zposTop;
515 m_layerZcoordBottom[layer_id] = zposBottom;
516 }
517
519
521 0.0f );
522 boardSize /= 2.0f;
523
524 SFVEC3F boardMin = ( m_boardCenter - boardSize );
525 SFVEC3F boardMax = ( m_boardCenter + boardSize );
526
527 boardMin.z = m_layerZcoordTop[B_Adhes];
528 boardMax.z = m_layerZcoordTop[F_Adhes];
529
530 m_boardBoundingBox = BBOX_3D( boardMin, boardMax );
531
532#ifdef PRINT_STATISTICS_3D_VIEWER
533 unsigned stats_startCreateBoardPolyTime = GetRunningMicroSecs();
534#endif
535
536 if( aStatusReporter )
537 aStatusReporter->Report( _( "Create layers" ) );
538
539 createLayers( aStatusReporter );
540
541 auto to_SFVEC4F =
542 []( const COLOR4D& src )
543 {
544 return SFVEC4F( src.r, src.g, src.b, src.a );
545 };
546
547 std::map<int, COLOR4D> colors = GetLayerColors();
548
549 m_BgColorTop = to_SFVEC4F( colors[ LAYER_3D_BACKGROUND_TOP ] );
550 m_BgColorBot = to_SFVEC4F( colors[ LAYER_3D_BACKGROUND_BOTTOM ] );
551 m_SolderPasteColor = to_SFVEC4F( colors[ LAYER_3D_SOLDERPASTE ] );
552 m_SilkScreenColorBot = to_SFVEC4F( colors[ LAYER_3D_SILKSCREEN_BOTTOM ] );
553 m_SilkScreenColorTop = to_SFVEC4F( colors[ LAYER_3D_SILKSCREEN_TOP ] );
554 m_SolderMaskColorBot = to_SFVEC4F( colors[ LAYER_3D_SOLDERMASK_BOTTOM ] );
555 m_SolderMaskColorTop = to_SFVEC4F( colors[ LAYER_3D_SOLDERMASK_TOP ] );
556 m_CopperColor = to_SFVEC4F( colors[ LAYER_3D_COPPER_TOP ] );
557 m_BoardBodyColor = to_SFVEC4F( colors[ LAYER_3D_BOARD ] );
558 m_UserDrawingsColor = to_SFVEC4F( colors[ LAYER_3D_USER_DRAWINGS ] );
559 m_UserCommentsColor = to_SFVEC4F( colors[ LAYER_3D_USER_COMMENTS ] );
560 m_ECO1Color = to_SFVEC4F( colors[ LAYER_3D_USER_ECO1 ] );
561 m_ECO2Color = to_SFVEC4F( colors[ LAYER_3D_USER_ECO2 ] );
562}
563
564
565std::map<int, COLOR4D> BOARD_ADAPTER::GetDefaultColors() const
566{
567 std::map<int, COLOR4D> colors;
568
583
584 return colors;
585}
586
587
588std::map<int, COLOR4D> BOARD_ADAPTER::GetLayerColors() const
589{
590 std::map<int, COLOR4D> colors;
591
593 {
594 colors = GetDefaultColors();
595
596 if( !m_board )
597 return colors;
598
600 KIGFX::COLOR4D bodyColor( 0, 0, 0, 0 );
601
602 auto findColor =
603 []( const wxString& aColorName, const CUSTOM_COLORS_LIST& aColorSet )
604 {
605 if( aColorName.StartsWith( wxT( "#" ) ) )
606 {
607 return KIGFX::COLOR4D( aColorName );
608 }
609 else
610 {
611 for( const CUSTOM_COLOR_ITEM& color : aColorSet )
612 {
613 if( color.m_ColorName == aColorName )
614 return color.m_Color;
615 }
616 }
617
618 return KIGFX::COLOR4D();
619 };
620
621 for( const BOARD_STACKUP_ITEM* stackupItem : stackup.GetList() )
622 {
623 wxString colorName = stackupItem->GetColor();
624
625 switch( stackupItem->GetType() )
626 {
628 if( stackupItem->GetBrdLayerId() == F_SilkS )
629 colors[ LAYER_3D_SILKSCREEN_TOP ] = findColor( colorName, g_SilkColors );
630 else
631 colors[ LAYER_3D_SILKSCREEN_BOTTOM ] = findColor( colorName, g_SilkColors );
632
633 break;
634
636 if( stackupItem->GetBrdLayerId() == F_Mask )
637 colors[ LAYER_3D_SOLDERMASK_TOP ] = findColor( colorName, g_MaskColors );
638 else
639 colors[ LAYER_3D_SOLDERMASK_BOTTOM ] = findColor( colorName, g_MaskColors );
640
641 break;
642
644 {
645 KIGFX::COLOR4D layerColor = findColor( colorName, g_BoardColors );
646
647 if( bodyColor == COLOR4D( 0, 0, 0, 0 ) )
648 bodyColor = layerColor;
649 else
650 bodyColor = bodyColor.Mix( layerColor, 1.0 - layerColor.a );
651
652 bodyColor.a += ( 1.0 - bodyColor.a ) * layerColor.a / 2;
653 break;
654 }
655
656 default:
657 break;
658 }
659 }
660
661 if( bodyColor != COLOR4D( 0, 0, 0, 0 ) )
662 colors[ LAYER_3D_BOARD ] = bodyColor;
663
664 const wxString& finishName = stackup.m_FinishType;
665
666 if( finishName.EndsWith( wxT( "OSP" ) ) )
667 {
668 colors[ LAYER_3D_COPPER_TOP ] = findColor( wxT( "Copper" ), g_FinishColors );
669 }
670 else if( finishName.EndsWith( wxT( "IG" ) )
671 || finishName.EndsWith( wxT( "gold" ) ) )
672 {
673 colors[ LAYER_3D_COPPER_TOP ] = findColor( wxT( "Gold" ), g_FinishColors );
674 }
675 else if( finishName.StartsWith( wxT( "HAL" ) )
676 || finishName.StartsWith( wxT( "HASL" ) )
677 || finishName.EndsWith( wxT( "tin" ) )
678 || finishName.EndsWith( wxT( "nickel" ) ) )
679 {
680 colors[ LAYER_3D_COPPER_TOP ] = findColor( wxT( "Tin" ), g_FinishColors );
681 }
682 else if( finishName.EndsWith( wxT( "silver" ) ) )
683 {
684 colors[ LAYER_3D_COPPER_TOP ] = findColor( wxT( "Silver" ), g_FinishColors );
685 }
686
687 SETTINGS_MANAGER& mgr = Pgm().GetSettingsManager();
688 PCBNEW_SETTINGS* pcbnewSettings = mgr.GetAppSettings<PCBNEW_SETTINGS>();
689 COLOR_SETTINGS* pcbnewColors = mgr.GetColorSettings( pcbnewSettings->m_ColorTheme );
690
691 colors[ LAYER_3D_USER_DRAWINGS ] = pcbnewColors->GetColor( Dwgs_User );
692 colors[ LAYER_3D_USER_COMMENTS ] = pcbnewColors->GetColor( Cmts_User );
693 colors[ LAYER_3D_USER_ECO1 ] = pcbnewColors->GetColor( Eco1_User );
694 colors[ LAYER_3D_USER_ECO2 ] = pcbnewColors->GetColor( Eco2_User );
695 }
696 else if( LAYER_PRESET_3D* preset = m_Cfg->FindPreset( m_Cfg->m_CurrentPreset ) )
697 {
698 return preset->colors;
699 }
700 else
701 {
702 COLOR_SETTINGS* settings = Pgm().GetSettingsManager().GetColorSettings();
703
704 for( const auto& [ layer, color ] : GetDefaultColors() )
705 colors[ layer ] = settings->GetColor( layer );
706 }
707
708 colors[ LAYER_3D_COPPER_BOTTOM ] = colors[ LAYER_3D_COPPER_TOP ];
709 return colors;
710}
711
712
713void BOARD_ADAPTER::SetLayerColors( const std::map<int, COLOR4D>& aColors )
714{
715 COLOR_SETTINGS* settings = Pgm().GetSettingsManager().GetColorSettings();
716
717 for( const auto& [ layer, color ] : aColors )
718 settings->SetColor( layer, color );
719}
720
721
722void BOARD_ADAPTER::SetVisibleLayers( const std::bitset<LAYER_3D_END>& aLayers )
723{
724 m_Cfg->m_Render.show_board_body = aLayers.test( LAYER_3D_BOARD );
735 m_Cfg->m_Render.show_eco1 = aLayers.test( LAYER_3D_USER_ECO1 );
736 m_Cfg->m_Render.show_eco2 = aLayers.test( LAYER_3D_USER_ECO2 );
737
743
745 m_Cfg->m_Render.show_fp_values = aLayers.test( LAYER_FP_VALUES );
746 m_Cfg->m_Render.show_fp_text = aLayers.test( LAYER_FP_TEXT );
747
750 m_Cfg->m_Render.show_axis = aLayers.test( LAYER_3D_AXES );
751}
752
753
754std::bitset<LAYER_3D_END> BOARD_ADAPTER::GetVisibleLayers() const
755{
756 std::bitset<LAYER_3D_END> ret;
757
771
775
781
785
787 {
788 if( !m_board )
789 return ret;
790
791 ret.set( LAYER_3D_BOARD, true );
804
806 ret.set( layer, m_board->IsElementVisible( layer ) );
807 }
809 {
810 if( !m_board )
811 return ret;
812
813 const PCB_PLOT_PARAMS& plotParams = m_board->GetPlotOptions();
814 LSET layers = plotParams.GetLayerSelection() | plotParams.GetPlotOnAllLayersSelection();
815
816 ret.set( LAYER_3D_BOARD, true );
817 ret.set( LAYER_3D_COPPER_TOP, layers.test( F_Cu ) );
818 ret.set( LAYER_3D_COPPER_BOTTOM, layers.test( B_Cu ) );
819 ret.set( LAYER_3D_SILKSCREEN_TOP, layers.test( F_SilkS ) );
820 ret.set( LAYER_3D_SILKSCREEN_BOTTOM, layers.test( B_SilkS ) );
821 ret.set( LAYER_3D_SOLDERMASK_TOP, layers.test( F_Mask ) );
822 ret.set( LAYER_3D_SOLDERMASK_BOTTOM, layers.test( B_Mask ) );
823 ret.set( LAYER_3D_SOLDERPASTE, layers.test( F_Paste ) );
824 ret.set( LAYER_3D_ADHESIVE, layers.test( F_Adhes ) );
825 ret.set( LAYER_3D_USER_COMMENTS, layers.test( Cmts_User ) );
826 ret.set( LAYER_3D_USER_DRAWINGS, layers.test( Dwgs_User ) );
827 ret.set( LAYER_3D_USER_ECO1, layers.test( Eco1_User ) );
828 ret.set( LAYER_3D_USER_ECO2, layers.test( Eco2_User ) );
829
830 ret.set( LAYER_FP_REFERENCES, plotParams.GetPlotReference() );
831 ret.set( LAYER_FP_VALUES, plotParams.GetPlotValue() );
832 ret.set( LAYER_FP_TEXT, plotParams.GetPlotFPText() );
833 }
834 else if( LAYER_PRESET_3D* preset = m_Cfg->FindPreset( m_Cfg->m_CurrentPreset ) )
835 {
836 ret = preset->layers;
837 }
838 else
839 {
853
857 }
858
859 return ret;
860}
861
862
863bool BOARD_ADAPTER::createBoardPolygon( wxString* aErrorMsg )
864{
866
867 if( !m_board )
868 return false;
869
870 bool success;
871
873 {
874 if( !m_board->GetFirstFootprint() )
875 {
876 if( aErrorMsg )
877 *aErrorMsg = _( "No footprint loaded." );
878
879 return false;
880 }
881
882 // max dist from one endPt to next startPt
883 int chainingEpsilon = m_board->GetOutlinesChainingEpsilon();
884
887 chainingEpsilon );
888
889 // Make polygon strictly simple to avoid issues (especially in 3D viewer)
891
892 if( !success && aErrorMsg )
893 {
894 *aErrorMsg = _( "Footprint outline is missing or malformed. Run Footprint Checker for "
895 "a full analysis." );
896 }
897 }
898 else
899 {
900 success = m_board->GetBoardPolygonOutlines( m_board_poly, nullptr, false, true );
901
902 if( !success && aErrorMsg )
903 *aErrorMsg = _( "Board outline is missing or malformed. Run DRC for a full analysis." );
904 }
905
906 return success;
907}
908
909
910float BOARD_ADAPTER::GetFootprintZPos( bool aIsFlipped ) const
911{
912 if( aIsFlipped )
914 else
916}
917
918
920{
921 wxASSERT( aLayerId < PCB_LAYER_ID_COUNT );
922
923 const COLOR4D color = m_colors->GetColor( aLayerId );
924
925 return SFVEC4F( color.r, color.g, color.b, color.a );
926}
927
928
930{
931 return GetColor( m_colors->GetColor( aItemId ) );
932}
933
934
936{
937 return SFVEC4F( aColor.r, aColor.g, aColor.b, aColor.a );
938}
939
940
942{
943 SFVEC2F sphericalCoord =
944 SFVEC2F( ( m_Cfg->m_Render.raytrace_lightElevation[i] + 90.0f ) / 180.0f,
945 m_Cfg->m_Render.raytrace_lightAzimuth[i] / 180.0f );
946
947 sphericalCoord.x = glm::clamp( sphericalCoord.x, 0.0f, 1.0f );
948 sphericalCoord.y = glm::clamp( sphericalCoord.y, 0.0f, 2.0f );
949
950 return sphericalCoord;
951}
Defines math related functions.
Defines math related functions.
int color
Definition: DXF_plotter.cpp:58
constexpr int ARC_HIGH_DEF
Definition: base_units.h:121
constexpr EDA_IU_SCALE pcbIUScale
Definition: base_units.h:109
#define SOLDERPASTE_LAYER_THICKNESS
#define ADD_COLOR(list, r, g, b, a, name)
float g_BevelThickness3DU
#define DEFAULT_TECH_LAYER_THICKNESS
#define DEFAULT_BOARD_THICKNESS
#define layerThicknessMargin
static bool g_ColorsLoaded
#define DEFAULT_COPPER_THICKNESS
#define RANGE_SCALE_3D
This defines the range that all coord will have to be rendered.
Definition: board_adapter.h:66
@ BS_ITEM_TYPE_COPPER
Definition: board_stackup.h:43
@ BS_ITEM_TYPE_SILKSCREEN
Definition: board_stackup.h:49
@ BS_ITEM_TYPE_DIELECTRIC
Definition: board_stackup.h:44
@ BS_ITEM_TYPE_SOLDERMASK
Definition: board_stackup.h:47
Define an abstract camera.
static const ADVANCED_CFG & GetCfg()
Get the singleton instance's config, which is shared by all consumers.
wxString m_ColorTheme
Active color theme name.
Definition: app_settings.h:173
BVH_CONTAINER_2D * m_offboardPadsBack
SFVEC4F m_BgColorTop
background top color
SFVEC4F m_ECO2Color
void SetVisibleLayers(const std::bitset< LAYER_3D_END > &aLayers)
float m_solderPasteLayerThickness3DU
void createLayers(REPORTER *aStatusReporter)
VECTOR2I m_boardPos
Board center position in board internal units.
float m_backCopperThickness3DU
static KIGFX::COLOR4D g_DefaultComments
SFVEC4F m_SolderPasteColor
in realistic mode: solder paste color
static CUSTOM_COLORS_LIST g_PasteColors
BBOX_3D m_boardBoundingBox
3D bounding box of the board in 3D units.
static CUSTOM_COLORS_LIST g_FinishColors
static KIGFX::COLOR4D g_DefaultBoardBody
unsigned int m_viaCount
COLOR_SETTINGS * m_colors
bool IsFootprintShown(FOOTPRINT_ATTR_T aFPAttributes) const
Test if footprint should be displayed in relation to attributes and the flags.
static KIGFX::COLOR4D g_DefaultSolderMask
std::map< int, COLOR4D > GetLayerColors() const
std::array< float, PCB_LAYER_ID_COUNT > m_layerZcoordBottom
Bottom (Start) Z position of each layer in 3D units.
SHAPE_POLY_SET * m_frontPlatedCopperPolys
BVH_CONTAINER_2D m_TH_ODs
List of PTH outer diameters.
unsigned int m_trackCount
float m_averageTrackWidth
SHAPE_POLY_SET m_board_poly
Board outline polygon.
std::bitset< LAYER_3D_END > GetVisibleLayers() const
SFVEC4F m_SolderMaskColorBot
in realistic mode: solder mask color ( bot )
bool m_IsPreviewer
true if we're in a 3D preview panel, false for the standard 3D viewer
static CUSTOM_COLORS_LIST g_MaskColors
int GetHolePlatingThickness() const noexcept
Get the hole plating thickness (NB: in BOARD UNITS!).
void InitSettings(REPORTER *aStatusReporter, REPORTER *aWarningReporter)
Function to be called by the render when it need to reload the settings for the board.
static KIGFX::COLOR4D g_DefaultECOs
SFVEC4F m_SolderMaskColorTop
in realistic mode: solder mask color ( top )
SFVEC4F GetColor(const COLOR4D &aColor) const
BVH_CONTAINER_2D * m_offboardPadsFront
float m_averageViaHoleDiameter
static KIGFX::COLOR4D g_DefaultBackgroundTop
static CUSTOM_COLORS_LIST g_SilkColors
float m_averageHoleDiameter
static KIGFX::COLOR4D g_DefaultSurfaceFinish
SFVEC4F m_CopperColor
in realistic mode: copper color
void ReloadColorSettings() noexcept
SFVEC2F GetSphericalCoord(int i) const
BVH_CONTAINER_2D * m_platedPadsBack
float GetFootprintZPos(bool aIsFlipped) const
Get the position of the footprint in 3d integer units considering if it is flipped or not.
float m_frontCopperThickness3DU
static KIGFX::COLOR4D g_DefaultSolderPaste
float m_boardBodyThickness3DU
std::array< float, PCB_LAYER_ID_COUNT > m_layerZcoordTop
Top (End) Z position of each layer in 3D units.
static CUSTOM_COLORS_LIST g_BoardColors
VECTOR2I m_boardSize
Board size in board internal units.
SHAPE_POLY_SET * m_backPlatedCopperPolys
void SetLayerColors(const std::map< int, COLOR4D > &aColors)
SHAPE_POLY_SET * m_backPlatedPadPolys
EDA_3D_VIEWER_SETTINGS * m_Cfg
SFVEC4F m_SilkScreenColorTop
in realistic mode: SilkScreen color ( top )
SFVEC4F m_SilkScreenColorBot
in realistic mode: SilkScreen color ( bot )
SFVEC4F GetItemColor(int aItemId) const
Get the technical color of a layer.
unsigned int GetCircleSegmentCount(float aDiameter3DU) const
float m_nonCopperLayerThickness3DU
unsigned int m_holeCount
BVH_CONTAINER_2D m_viaAnnuli
List of via annular rings.
SFVEC4F m_BoardBodyColor
in realistic mode: FR4 board color
bool createBoardPolygon(wxString *aErrorMsg)
Create the board outline polygon.
unsigned int m_copperLayersCount
std::map< int, COLOR4D > GetDefaultColors() const
BVH_CONTAINER_2D m_TH_IDs
List of PTH inner diameters.
SFVEC4F m_UserCommentsColor
static KIGFX::COLOR4D g_DefaultSilkscreen
BVH_CONTAINER_2D * m_platedPadsFront
SFVEC3F m_boardCenter
3D center position of the board in 3D units.
static KIGFX::COLOR4D g_DefaultBackgroundBot
SFVEC4F GetLayerColor(PCB_LAYER_ID aLayerId) const
Get the technical color of a layer.
bool Is3dLayerEnabled(PCB_LAYER_ID aLayer, const std::bitset< LAYER_3D_END > &aVisibilityFlags) const
Check if a layer is enabled.
SFVEC4F m_ECO1Color
SFVEC4F m_UserDrawingsColor
double m_biuTo3Dunits
Scale factor to convert board internal units to 3D units normalized between -1.0 and 1....
SFVEC4F m_BgColorBot
background bottom color
SHAPE_POLY_SET * m_frontPlatedPadPolys
Container for design settings for a BOARD object.
int GetHolePlatingThickness() const
Pad & via drills are finish size.
BOARD_STACKUP & GetStackupDescriptor()
Manage one layer needed to make a physical board.
Definition: board_stackup.h:94
Manage layers needed to make a physical board.
const std::vector< BOARD_STACKUP_ITEM * > & GetList() const
int GetCount() const
wxString m_FinishType
The name of external copper finish.
bool GetBoardPolygonOutlines(SHAPE_POLY_SET &aOutlines, OUTLINE_ERROR_HANDLER *aErrorHandler=nullptr, bool aAllowUseArcsInPolygons=false, bool aIncludeNPTHAsOutlines=false)
Extract the board outlines and build a closed polygon from lines, arcs and circle items on edge cut l...
Definition: board.cpp:2194
bool IsFootprintHolder() const
Find out if the board is being used to hold a single footprint for editing/viewing.
Definition: board.h:306
bool IsElementVisible(GAL_LAYER_ID aLayer) const
Test whether a given element category is visible.
Definition: board.cpp:718
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.cpp:678
FOOTPRINT * GetFirstFootprint() const
Get the first footprint on the board or nullptr.
Definition: board.h:414
BOX2I ComputeBoundingBox(bool aBoardEdgesOnly=false) const
Calculate the bounding box containing all board items (or board edge segments).
Definition: board.cpp:1380
int GetCopperLayerCount() const
Definition: board.cpp:628
const PCB_PLOT_PARAMS & GetPlotOptions() const
Definition: board.h:653
int GetOutlinesChainingEpsilon()
Definition: board.h:700
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:658
BOARD_DESIGN_SETTINGS & GetDesignSettings() const
Definition: board.cpp:769
coord_type GetHeight() const
Definition: box2.h:189
coord_type GetWidth() const
Definition: box2.h:188
BOX2< Vec > & Inflate(coord_type dx, coord_type dy)
Inflates the rectangle horizontally by dx and vertically by dy.
Definition: box2.h:507
Vec Centre() const
Definition: box2.h:71
const Vec & GetSize() const
Definition: box2.h:180
void Clear() override
Color settings are a bit different than most of the settings objects in that there can be more than o...
void SetColor(int aLayer, const COLOR4D &aColor)
COLOR4D GetColor(int aLayer) const
LAYER_PRESET_3D * FindPreset(const wxString &aName)
A color representation with 4 components: red, green, blue, alpha.
Definition: color4d.h:104
double r
Red component.
Definition: color4d.h:376
double g
Green component.
Definition: color4d.h:377
double a
Alpha component.
Definition: color4d.h:379
COLOR4D Mix(const COLOR4D &aColor, double aFactor) const
Return a color that is mixed with the input by a factor.
Definition: color4d.h:295
double b
Blue component.
Definition: color4d.h:378
LSET is a set of PCB_LAYER_IDs.
Definition: layer_ids.h:573
Parameters and options when plotting/printing a board.
LSET GetLayerSelection() const
bool GetPlotReference() const
LSET GetPlotOnAllLayersSelection() const
bool GetPlotValue() const
bool GetPlotFPText() const
A pure virtual class used to derive REPORTER objects from.
Definition: reporter.h:71
virtual REPORTER & Report(const wxString &aText, SEVERITY aSeverity=RPT_SEVERITY_UNDEFINED)=0
Report a string with a given severity.
T * GetAppSettings()
Returns a handle to the a given settings by type If the settings have already been loaded,...
COLOR_SETTINGS * GetColorSettings(const wxString &aName="user")
Retrieves a color settings object that applications can read colors from.
void RemoveAllContours()
Remove all outlines & holes (clears) the polygon set.
void Simplify(POLYGON_MODE aFastMode)
Simplify the polyset (merges overlapping polys, eliminates degeneracy/self-intersections) For aFastMo...
bool BuildFootprintPolygonOutlines(BOARD *aBoard, SHAPE_POLY_SET &aOutlines, int aErrorMax, int aChainingEpsilon, OUTLINE_ERROR_HANDLER *aErrorHandler)
Extract a board outline for a footprint view.
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:160
std::vector< CUSTOM_COLOR_ITEM > CUSTOM_COLORS_LIST
#define _(s)
#define FOLLOW_PLOT_SETTINGS
#define FOLLOW_PCB
static constexpr EDA_ANGLE FULL_CIRCLE
Definition: eda_angle.h:433
FOOTPRINT_ATTR_T
The set of attributes allowed within a FOOTPRINT, using FOOTPRINT::SetAttributes() and FOOTPRINT::Get...
Definition: footprint.h:71
@ FP_SMD
Definition: footprint.h:73
@ FP_DNP
Definition: footprint.h:80
@ FP_EXCLUDE_FROM_POS_FILES
Definition: footprint.h:74
@ FP_THROUGH_HOLE
Definition: footprint.h:72
a few functions useful in geometry calculations.
int GetArcToSegmentCount(int aRadius, int aErrorMax, const EDA_ANGLE &aArcAngle)
static const wxChar * m_logTrace
Trace mask used to enable or disable debug output for this class.
@ LAYER_3D_SOLDERMASK_TOP
Definition: layer_ids.h:457
@ LAYER_3D_BOUNDING_BOXES
Definition: layer_ids.h:470
@ LAYER_3D_ADHESIVE
Definition: layer_ids.h:459
@ LAYER_3D_SMD_MODELS
Definition: layer_ids.h:465
@ LAYER_3D_BACKGROUND_TOP
Definition: layer_ids.h:450
@ LAYER_3D_USER_COMMENTS
Definition: layer_ids.h:460
@ LAYER_3D_SOLDERMASK_BOTTOM
Definition: layer_ids.h:456
@ LAYER_3D_BOARD
Definition: layer_ids.h:451
@ LAYER_3D_USER_ECO1
Definition: layer_ids.h:462
@ LAYER_3D_USER_ECO2
Definition: layer_ids.h:463
@ LAYER_3D_TH_MODELS
Definition: layer_ids.h:464
@ LAYER_3D_AXES
Definition: layer_ids.h:469
@ LAYER_3D_SILKSCREEN_TOP
Definition: layer_ids.h:455
@ LAYER_3D_VIRTUAL_MODELS
Definition: layer_ids.h:466
@ LAYER_3D_MODELS_MARKED_DNP
Definition: layer_ids.h:468
@ LAYER_3D_COPPER_TOP
Definition: layer_ids.h:452
@ LAYER_3D_SOLDERPASTE
Definition: layer_ids.h:458
@ LAYER_3D_OFF_BOARD_SILK
Definition: layer_ids.h:471
@ LAYER_3D_MODELS_NOT_IN_POS
Definition: layer_ids.h:467
@ LAYER_3D_USER_DRAWINGS
Definition: layer_ids.h:461
@ LAYER_3D_COPPER_BOTTOM
Definition: layer_ids.h:453
@ LAYER_3D_BACKGROUND_BOTTOM
Definition: layer_ids.h:449
@ LAYER_3D_SILKSCREEN_BOTTOM
Definition: layer_ids.h:454
#define MAX_CU_LAYERS
Definition: layer_ids.h:141
GAL_LAYER_ID
GAL layers are "virtual" layers, i.e.
Definition: layer_ids.h:193
@ LAYER_FP_REFERENCES
show footprints references (when texts are visible)
Definition: layer_ids.h:214
@ LAYER_FP_TEXT
Definition: layer_ids.h:201
@ LAYER_FP_VALUES
show footprints values (when texts are visible)
Definition: layer_ids.h:213
PCB_LAYER_ID
A quick note on layer IDs:
Definition: layer_ids.h:60
@ B_Adhes
Definition: layer_ids.h:98
@ Dwgs_User
Definition: layer_ids.h:110
@ F_Paste
Definition: layer_ids.h:102
@ Cmts_User
Definition: layer_ids.h:111
@ F_Adhes
Definition: layer_ids.h:99
@ B_Mask
Definition: layer_ids.h:107
@ B_Cu
Definition: layer_ids.h:96
@ Eco1_User
Definition: layer_ids.h:112
@ F_Mask
Definition: layer_ids.h:108
@ B_Paste
Definition: layer_ids.h:101
@ F_SilkS
Definition: layer_ids.h:105
@ Eco2_User
Definition: layer_ids.h:113
@ B_SilkS
Definition: layer_ids.h:104
@ PCB_LAYER_ID_COUNT
Definition: layer_ids.h:138
@ F_Cu
Definition: layer_ids.h:65
see class PGM_BASE
unsigned GetRunningMicroSecs()
An alternate way to calculate an elapsed time (in microsecondes) to class PROF_COUNTER.
@ RPT_SEVERITY_WARNING
KIWAY Kiway & Pgm(), KFCTL_STANDALONE
The global Program "get" accessor.
Definition: single_top.cpp:119
wxString NotSpecifiedPrm()
Manage a bounding box defined by two SFVEC3F min max points.
Definition: bbox_3d.h:42
void Reset()
Reset the bounding box to zero and de-initialize it.
Definition: bbox_3d.cpp:95
A class to handle a custom color (predefined color) for the color picker dialog.
constexpr int mmToIU(double mm) const
Definition: base_units.h:89
VECTOR2< int > VECTOR2I
Definition: vector2d.h:588
glm::vec2 SFVEC2F
Definition: xv3d_types.h:42
glm::vec3 SFVEC3F
Definition: xv3d_types.h:44
glm::vec4 SFVEC4F
Definition: xv3d_types.h:46