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-2024 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 <layer_range.h>
35#include <3d_math.h>
36#include "3d_fastmath.h"
38#include <lset.h>
39#include <pgm_base.h>
41#include <wx/log.h>
42#include <pcbnew_settings.h>
43#include <advanced_config.h>
44
45
46#define DEFAULT_BOARD_THICKNESS pcbIUScale.mmToIU( 1.6 )
47#define DEFAULT_COPPER_THICKNESS pcbIUScale.mmToIU( 0.035 ) // for 35 um
48// The solder mask layer (and silkscreen) thickness
49#define DEFAULT_TECH_LAYER_THICKNESS pcbIUScale.mmToIU( 0.025 )
50// The solder paste thickness is chosen bigger than the solder mask layer
51// to be sure is covers the mask when overlapping.
52#define SOLDERPASTE_LAYER_THICKNESS pcbIUScale.mmToIU( 0.04 )
53
54
60
70
71// To be used in Raytracing render to create bevels on layer items
73
74static bool g_ColorsLoaded = false;
75
84const wxChar *BOARD_ADAPTER::m_logTrace = wxT( "KI_TRACE_EDA_CINFO3D_VISU" );
85
86
88 m_Cfg( nullptr ),
89 m_IsBoardView( true ),
90 m_MousewheelPanning( true ),
91 m_IsPreviewer( false ),
92 m_board( nullptr ),
93 m_3dModelManager( nullptr ),
94 m_colors( nullptr ),
95 m_layerZcoordTop(),
96 m_layerZcoordBottom()
97{
98 wxLogTrace( m_logTrace, wxT( "BOARD_ADAPTER::BOARD_ADAPTER" ) );
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
147 m_frontPlatedCopperPolys = nullptr;
148 m_backPlatedCopperPolys = nullptr;
149
151
152 if( !g_ColorsLoaded )
153 {
154#define ADD_COLOR( list, r, g, b, a, name ) \
155 list.emplace_back( r/255.0, g/255.0, b/255.0, a, name )
156
157 ADD_COLOR( g_SilkColors, 245, 245, 245, 1.0, NotSpecifiedPrm() ); // White
158 ADD_COLOR( g_SilkColors, 20, 51, 36, 1.0, wxT( "Green" ) );
159 ADD_COLOR( g_SilkColors, 181, 19, 21, 1.0, wxT( "Red" ) );
160 ADD_COLOR( g_SilkColors, 2, 59, 162, 1.0, wxT( "Blue" ) );
161 ADD_COLOR( g_SilkColors, 11, 11, 11, 1.0, wxT( "Black" ) );
162 ADD_COLOR( g_SilkColors, 245, 245, 245, 1.0, wxT( "White" ) );
163 ADD_COLOR( g_SilkColors, 32, 2, 53, 1.0, wxT( "Purple" ) );
164 ADD_COLOR( g_SilkColors, 194, 195, 0, 1.0, wxT( "Yellow" ) );
165
166 ADD_COLOR( g_MaskColors, 20, 51, 36, 0.83, NotSpecifiedPrm() ); // Green
167 ADD_COLOR( g_MaskColors, 20, 51, 36, 0.83, wxT( "Green" ) );
168 ADD_COLOR( g_MaskColors, 91, 168, 12, 0.83, wxT( "Light Green" ) );
169 ADD_COLOR( g_MaskColors, 13, 104, 11, 0.83, wxT( "Saturated Green" ) );
170 ADD_COLOR( g_MaskColors, 181, 19, 21, 0.83, wxT( "Red" ) );
171 ADD_COLOR( g_MaskColors, 210, 40, 14, 0.83, wxT( "Light Red" ) );
172 ADD_COLOR( g_MaskColors, 239, 53, 41, 0.83, wxT( "Red/Orange" ) );
173 ADD_COLOR( g_MaskColors, 2, 59, 162, 0.83, wxT( "Blue" ) );
174 ADD_COLOR( g_MaskColors, 54, 79, 116, 0.83, wxT( "Light Blue 1" ) );
175 ADD_COLOR( g_MaskColors, 61, 85, 130, 0.83, wxT( "Light Blue 2" ) );
176 ADD_COLOR( g_MaskColors, 21, 70, 80, 0.83, wxT( "Green/Blue" ) );
177 ADD_COLOR( g_MaskColors, 11, 11, 11, 0.83, wxT( "Black" ) );
178 ADD_COLOR( g_MaskColors, 245, 245, 245, 0.83, wxT( "White" ) );
179 ADD_COLOR( g_MaskColors, 32, 2, 53, 0.83, wxT( "Purple" ) );
180 ADD_COLOR( g_MaskColors, 119, 31, 91, 0.83, wxT( "Light Purple" ) );
181 ADD_COLOR( g_MaskColors, 194, 195, 0, 0.83, wxT( "Yellow" ) );
182
183 ADD_COLOR( g_PasteColors, 128, 128, 128, 1.0, wxT( "Grey" ) );
184 ADD_COLOR( g_PasteColors, 90, 90, 90, 1.0, wxT( "Dark Grey" ) );
185 ADD_COLOR( g_PasteColors, 213, 213, 213, 1.0, wxT( "Silver" ) );
186
187 ADD_COLOR( g_FinishColors, 184, 115, 50, 1.0, wxT( "Copper" ) );
188 ADD_COLOR( g_FinishColors, 178, 156, 0, 1.0, wxT( "Gold" ) );
189 ADD_COLOR( g_FinishColors, 213, 213, 213, 1.0, wxT( "Silver" ) );
190 ADD_COLOR( g_FinishColors, 160, 160, 160, 1.0, wxT( "Tin" ) );
191
192 ADD_COLOR( g_BoardColors, 51, 43, 22, 0.83, wxT( "FR4 natural, dark" ) );
193 ADD_COLOR( g_BoardColors, 109, 116, 75, 0.83, wxT( "FR4 natural" ) );
194 ADD_COLOR( g_BoardColors, 252, 252, 250, 0.90, wxT( "PTFE natural" ) );
195 ADD_COLOR( g_BoardColors, 205, 130, 0, 0.68, wxT( "Polyimide" ) );
196 ADD_COLOR( g_BoardColors, 92, 17, 6, 0.90, wxT( "Phenolic natural" ) );
197 ADD_COLOR( g_BoardColors, 146, 99, 47, 0.83, wxT( "Brown 1" ) );
198 ADD_COLOR( g_BoardColors, 160, 123, 54, 0.83, wxT( "Brown 2" ) );
199 ADD_COLOR( g_BoardColors, 146, 99, 47, 0.83, wxT( "Brown 3" ) );
200 ADD_COLOR( g_BoardColors, 213, 213, 213, 1.0, wxT( "Aluminum" ) );
201
202 g_DefaultBackgroundTop = COLOR4D( 0.80, 0.80, 0.90, 1.0 );
203 g_DefaultBackgroundBot = COLOR4D( 0.40, 0.40, 0.50, 1.0 );
204
205 g_DefaultSilkscreen = COLOR4D( 0.94, 0.94, 0.94, 1.0 );
206 g_DefaultSolderMask = COLOR4D( 0.08, 0.20, 0.14, 0.83 );
207 g_DefaultSolderPaste = COLOR4D( 0.50, 0.50, 0.50, 1.0 );
208 g_DefaultSurfaceFinish = COLOR4D( 0.75, 0.61, 0.23, 1.0 );
209 g_DefaultBoardBody = COLOR4D( 0.43, 0.45, 0.30, 0.90 );
210
211 g_DefaultComments = COLOR4D( 0.85, 0.85, 0.85, 1.0 );
212 g_DefaultECOs = COLOR4D( 0.70, 0.10, 0.10, 1.0 );
213
214 g_ColorsLoaded = true;
215 }
216#undef ADD_COLOR
217}
218
219
221{
223}
224
225
227{
228 wxCHECK( PgmOrNull(), /* void */ );
229
230 PCBNEW_SETTINGS* cfg = nullptr;
231
232 try
233 {
235 }
236 catch( const std::runtime_error& e )
237 {
238 wxFAIL_MSG( e.what() );
239 }
240
241 if( cfg )
242 {
245 }
246}
247
248
250 const std::bitset<LAYER_3D_END>& aVisibilityFlags ) const
251{
252 wxASSERT( aLayer < PCB_LAYER_ID_COUNT );
253
254 if( m_board && !m_board->IsLayerEnabled( aLayer ) )
255 return false;
256
257 switch( aLayer )
258 {
259 case B_Cu: return aVisibilityFlags.test( LAYER_3D_COPPER_BOTTOM );
260 case F_Cu: return aVisibilityFlags.test( LAYER_3D_COPPER_TOP );
261 case B_Adhes: return aVisibilityFlags.test( LAYER_3D_ADHESIVE );
262 case F_Adhes: return aVisibilityFlags.test( LAYER_3D_ADHESIVE );
263 case B_Paste: return aVisibilityFlags.test( LAYER_3D_SOLDERPASTE );
264 case F_Paste: return aVisibilityFlags.test( LAYER_3D_SOLDERPASTE );
265 case B_SilkS: return aVisibilityFlags.test( LAYER_3D_SILKSCREEN_BOTTOM );
266 case F_SilkS: return aVisibilityFlags.test( LAYER_3D_SILKSCREEN_TOP );
267 case B_Mask: return aVisibilityFlags.test( LAYER_3D_SOLDERMASK_BOTTOM );
268 case F_Mask: return aVisibilityFlags.test( LAYER_3D_SOLDERMASK_TOP );
269 case Dwgs_User: return aVisibilityFlags.test( LAYER_3D_USER_DRAWINGS );
270 case Cmts_User: return aVisibilityFlags.test( LAYER_3D_USER_COMMENTS );
271 case Eco1_User: return aVisibilityFlags.test( LAYER_3D_USER_ECO1 );
272 case Eco2_User: return aVisibilityFlags.test( LAYER_3D_USER_ECO2 );
273 default: return m_board && m_board->IsLayerVisible( aLayer );
274 }
275}
276
277
279{
280 if( m_IsPreviewer ) // In panel Preview, footprints are always shown, of course
281 return true;
282
283 if( aFPAttributes & FP_EXCLUDE_FROM_POS_FILES )
284 {
286 return false;
287 }
288
289 if( aFPAttributes & FP_DNP )
290 {
292 return false;
293 }
294
295 if( aFPAttributes & FP_SMD )
297
298 if( aFPAttributes & FP_THROUGH_HOLE )
300
302}
303
304
306{
309}
310
311
312unsigned int BOARD_ADAPTER::GetCircleSegmentCount( float aDiameter3DU ) const
313{
314 wxASSERT( aDiameter3DU > 0.0f );
315
316 return GetCircleSegmentCount( (int)( aDiameter3DU / m_biuTo3Dunits ) );
317}
318
319
320unsigned int BOARD_ADAPTER::GetCircleSegmentCount( int aDiameterBIU ) const
321{
322 wxASSERT( aDiameterBIU > 0 );
323
324 return GetArcToSegmentCount( aDiameterBIU / 2, ARC_HIGH_DEF, FULL_CIRCLE );
325}
326
327
328void BOARD_ADAPTER::InitSettings( REPORTER* aStatusReporter, REPORTER* aWarningReporter )
329{
330 wxLogTrace( m_logTrace, wxT( "BOARD_ADAPTER::InitSettings" ) );
331
332 if( aStatusReporter )
333 aStatusReporter->Report( _( "Build board outline" ) );
334
335 wxString msg;
336
337 const bool haveOutline = createBoardPolygon( &msg );
338
339 if( aWarningReporter )
340 {
341 if( !haveOutline )
342 aWarningReporter->Report( msg, RPT_SEVERITY_WARNING );
343 else
344 aWarningReporter->Report( wxEmptyString );
345 }
346
347 BOX2I bbbox;
348
349 if( m_board )
350 bbbox = m_board->ComputeBoundingBox( !m_board->IsFootprintHolder() && haveOutline );
351
352 // Gives a non null size to avoid issues in zoom / scale calculations
353 if( ( bbbox.GetWidth() == 0 ) && ( bbbox.GetHeight() == 0 ) )
354 bbbox.Inflate( pcbIUScale.mmToIU( 10 ) );
355
356 m_boardSize = bbbox.GetSize();
357 m_boardPos = bbbox.Centre();
358
359 wxASSERT( (m_boardSize.x > 0) && (m_boardSize.y > 0) );
360
361 m_boardPos.y = -m_boardPos.y; // The y coord is inverted in 3D viewer
362
364
365 // Ensure the board has 2 sides for 3D views, because it is hard to find
366 // a *really* single side board in the true life...
367 if( m_copperLayersCount < 2 )
369
370 // Calculate the conversion to apply to all positions.
372
373 // Hack to keep "home" zoom from being too small.
374 if( !m_board || !m_board->IsFootprintHolder() )
375 m_biuTo3Dunits *= 1.6f;
376
378
384
385 g_BevelThickness3DU = pcbIUScale.mmToIU( ADVANCED_CFG::GetCfg().m_3DRT_BevelHeight_um / 1000.0 ) * m_biuTo3Dunits;
386
387 if( m_board )
388 {
390
391 if( bds.GetStackupDescriptor().GetCount() )
392 {
393 int thickness = 0;
394
395 for( BOARD_STACKUP_ITEM* item : bds.GetStackupDescriptor().GetList() )
396 {
397 switch( item->GetType() )
398 {
400 for( int sublayer = 0; sublayer < item->GetSublayersCount(); sublayer++ )
401 thickness += item->GetThickness( sublayer );
402 break;
403
405 {
406 // The copper thickness must be > 0 to avoid draw issues (divide by 0 for instance)
407 // We use a minimal arbitrary value = 1 micrometer here:
408 int copper_thickness = std::max( item->GetThickness(), pcbIUScale.mmToIU( 0.001 ) );
409
410 if( item->GetBrdLayerId() == F_Cu )
411 m_frontCopperThickness3DU = copper_thickness * m_biuTo3Dunits;
412 else if( item->GetBrdLayerId() == B_Cu )
413 m_backCopperThickness3DU = copper_thickness * m_biuTo3Dunits;
414 else if( item->IsEnabled() )
415 thickness += copper_thickness;
416 }
417 break;
418
419 default:
420 break;
421 }
422 }
423
425 }
426 }
427
428 // Init Z position of each layer
429 // calculate z position for each copper layer
430 // Zstart = -m_epoxyThickness / 2.0 is the z position of the back (bottom layer) (layer id = B_Cu)
431 // Zstart = +m_epoxyThickness / 2.0 is the z position of the front (top layer) (layer id = F_Cu)
432
433 // ____==__________==________==______ <- Bottom = +m_epoxyThickness / 2.0,
434 // | | Top = Bottom + m_copperThickness
435 // |__________________________________|
436 // == == == == <- Bottom = -m_epoxyThickness / 2.0,
437 // Top = Bottom - m_copperThickness
438
439 // Generate the Z position of copper layers
440 // A copper layer Z position has 2 values: its top Z position and its bottom Z position
441 for( auto layer_id : LAYER_RANGE( F_Cu, B_Cu, m_copperLayersCount ) )
442 {
443 // This approximates internal layer positions (because we're treating all the dielectric
444 // layers as having the same thickness). But we don't render them anyway so it doesn't
445 // really matter.
446 int layer_pos; // the position of the copper layer from board top to bottom
447
448 switch( layer_id )
449 {
450 case F_Cu: layer_pos = 0; break;
451 case B_Cu: layer_pos = m_copperLayersCount - 1; break;
452 default: layer_pos = ( layer_id - B_Cu )/2; break;
453 };
454
456 - ( m_boardBodyThickness3DU * layer_pos
457 / ( m_copperLayersCount - 1 ) );
458
459 if( layer_pos < (m_copperLayersCount / 2) )
461 else
463 }
464
465 #define layerThicknessMargin 1.1
466 const float zpos_offset = m_nonCopperLayerThickness3DU * layerThicknessMargin;
467
468 // This is the top of the copper layer thickness.
469 const float zpos_copperTop_back = m_layerZcoordTop[B_Cu];
470 const float zpos_copperTop_front = m_layerZcoordTop[F_Cu];
471
472 // Fill not copper layers zpos with a dummy position
473 // (m_layerZcoordTop[B_Cu]with a small margin)
474 // Some important layer position will be set later
475 for( int layer_id = 0; layer_id < PCB_LAYER_ID_COUNT; layer_id++ )
476 {
477 if( IsCopperLayer( (PCB_LAYER_ID)layer_id ) )
478 continue;
479
480 m_layerZcoordBottom[(PCB_LAYER_ID)layer_id] = zpos_copperTop_back - 2.0f * zpos_offset;
482 }
483
484 // calculate z position for each technical layer
485 // Solder mask and Solder paste have the same Z position
487 {
488 float zposTop = 0.0;
489 float zposBottom = 0.0;
490
491 switch( layer_id )
492 {
493 case B_Adhes:
494 zposBottom = zpos_copperTop_back - 2.0f * zpos_offset;
495 zposTop = zposBottom - m_nonCopperLayerThickness3DU;
496 break;
497
498 case F_Adhes:
499 zposBottom = zpos_copperTop_front + 2.0f * zpos_offset;
500 zposTop = zposBottom + m_nonCopperLayerThickness3DU;
501 break;
502
503 case B_Mask:
504 zposBottom = zpos_copperTop_back;
505 zposTop = zpos_copperTop_back - m_nonCopperLayerThickness3DU;
506 break;
507
508 case B_Paste:
509 zposBottom = zpos_copperTop_back;
510 zposTop = zpos_copperTop_back - m_solderPasteLayerThickness3DU;
511 break;
512
513 case F_Mask:
514 zposBottom = zpos_copperTop_front;
515 zposTop = zpos_copperTop_front + m_nonCopperLayerThickness3DU;
516 break;
517
518 case F_Paste:
519 zposBottom = zpos_copperTop_front;
520 zposTop = zpos_copperTop_front + m_solderPasteLayerThickness3DU;
521 break;
522
523 case B_SilkS:
524 zposBottom = zpos_copperTop_back - 1.0f * zpos_offset;
525 zposTop = zposBottom - m_nonCopperLayerThickness3DU;
526 break;
527
528 case F_SilkS:
529 zposBottom = zpos_copperTop_front + 1.0f * zpos_offset;
530 zposTop = zposBottom + m_nonCopperLayerThickness3DU;
531 break;
532
533 default:
534 break;
535 }
536
537 m_layerZcoordTop[layer_id] = zposTop;
538 m_layerZcoordBottom[layer_id] = zposBottom;
539 }
540
542
544 0.0f );
545 boardSize /= 2.0f;
546
547 SFVEC3F boardMin = ( m_boardCenter - boardSize );
548 SFVEC3F boardMax = ( m_boardCenter + boardSize );
549
550 boardMin.z = m_layerZcoordTop[B_Adhes];
551 boardMax.z = m_layerZcoordTop[F_Adhes];
552
553 m_boardBoundingBox = BBOX_3D( boardMin, boardMax );
554
555#ifdef PRINT_STATISTICS_3D_VIEWER
556 int64_t stats_startCreateBoardPolyTime = GetRunningMicroSecs();
557#endif
558
559 if( aStatusReporter )
560 aStatusReporter->Report( _( "Create layers" ) );
561
562 createLayers( aStatusReporter );
563
564 auto to_SFVEC4F =
565 []( const COLOR4D& src )
566 {
567 return SFVEC4F( src.r, src.g, src.b, src.a );
568 };
569
570 std::map<int, COLOR4D> colors = GetLayerColors();
571
572 m_BgColorTop = to_SFVEC4F( colors[ LAYER_3D_BACKGROUND_TOP ] );
573 m_BgColorBot = to_SFVEC4F( colors[ LAYER_3D_BACKGROUND_BOTTOM ] );
574 m_SolderPasteColor = to_SFVEC4F( colors[ LAYER_3D_SOLDERPASTE ] );
575 m_SilkScreenColorBot = to_SFVEC4F( colors[ LAYER_3D_SILKSCREEN_BOTTOM ] );
576 m_SilkScreenColorTop = to_SFVEC4F( colors[ LAYER_3D_SILKSCREEN_TOP ] );
577 m_SolderMaskColorBot = to_SFVEC4F( colors[ LAYER_3D_SOLDERMASK_BOTTOM ] );
578 m_SolderMaskColorTop = to_SFVEC4F( colors[ LAYER_3D_SOLDERMASK_TOP ] );
579 m_CopperColor = to_SFVEC4F( colors[ LAYER_3D_COPPER_TOP ] );
580 m_BoardBodyColor = to_SFVEC4F( colors[ LAYER_3D_BOARD ] );
581 m_UserDrawingsColor = to_SFVEC4F( colors[ LAYER_3D_USER_DRAWINGS ] );
582 m_UserCommentsColor = to_SFVEC4F( colors[ LAYER_3D_USER_COMMENTS ] );
583 m_ECO1Color = to_SFVEC4F( colors[ LAYER_3D_USER_ECO1 ] );
584 m_ECO2Color = to_SFVEC4F( colors[ LAYER_3D_USER_ECO2 ] );
585}
586
587
588std::map<int, COLOR4D> BOARD_ADAPTER::GetDefaultColors() const
589{
590 std::map<int, COLOR4D> colors;
591
606
607 return colors;
608}
609
610
612{
613 m_BoardEditorColors.clear();
614
615 if( m_copperLayersCount <= 0 )
616 return;
617
619
620 LSET copperLayers = LSET::AllCuMask();
621
622 for( auto layer : LAYER_RANGE( F_Cu, B_Cu, m_copperLayersCount ) )
623 {
624 m_BoardEditorColors[ layer ] = settings->GetColor( layer );
625 }
626}
627
628
629std::map<int, COLOR4D> BOARD_ADAPTER::GetLayerColors() const
630{
631 std::map<int, COLOR4D> colors;
632
634 {
635 colors = preset->colors;
636 }
637 else
638 {
640
641 for( const auto& [ layer, defaultColor /* unused */ ] : GetDefaultColors() )
642 colors[ layer ] = settings->GetColor( layer );
643 }
644
646 {
648 KIGFX::COLOR4D bodyColor( 0, 0, 0, 0 );
649
650 auto findColor =
651 []( const wxString& aColorName, const CUSTOM_COLORS_LIST& aColorSet )
652 {
653 if( aColorName.StartsWith( wxT( "#" ) ) )
654 {
655 return KIGFX::COLOR4D( aColorName );
656 }
657 else
658 {
659 for( const CUSTOM_COLOR_ITEM& color : aColorSet )
660 {
661 if( color.m_ColorName == aColorName )
662 return color.m_Color;
663 }
664 }
665
666 return KIGFX::COLOR4D();
667 };
668
669 for( const BOARD_STACKUP_ITEM* stackupItem : stackup.GetList() )
670 {
671 wxString colorName = stackupItem->GetColor();
672
673 switch( stackupItem->GetType() )
674 {
676 if( stackupItem->GetBrdLayerId() == F_SilkS )
677 colors[ LAYER_3D_SILKSCREEN_TOP ] = findColor( colorName, g_SilkColors );
678 else
679 colors[ LAYER_3D_SILKSCREEN_BOTTOM ] = findColor( colorName, g_SilkColors );
680
681 break;
682
684 if( stackupItem->GetBrdLayerId() == F_Mask )
685 colors[ LAYER_3D_SOLDERMASK_TOP ] = findColor( colorName, g_MaskColors );
686 else
687 colors[ LAYER_3D_SOLDERMASK_BOTTOM ] = findColor( colorName, g_MaskColors );
688
689 break;
690
692 {
693 KIGFX::COLOR4D layerColor = findColor( colorName, g_BoardColors );
694
695 if( bodyColor == COLOR4D( 0, 0, 0, 0 ) )
696 bodyColor = layerColor;
697 else
698 bodyColor = bodyColor.Mix( layerColor, 1.0 - layerColor.a );
699
700 bodyColor.a += ( 1.0 - bodyColor.a ) * layerColor.a / 2;
701 break;
702 }
703
704 default:
705 break;
706 }
707 }
708
709 if( bodyColor != COLOR4D( 0, 0, 0, 0 ) )
710 colors[ LAYER_3D_BOARD ] = bodyColor;
711
712 const wxString& finishName = stackup.m_FinishType;
713
714 if( finishName.EndsWith( wxT( "OSP" ) ) )
715 {
716 colors[ LAYER_3D_COPPER_TOP ] = findColor( wxT( "Copper" ), g_FinishColors );
717 }
718 else if( finishName.EndsWith( wxT( "IG" ) )
719 || finishName.EndsWith( wxT( "gold" ) ) )
720 {
721 colors[ LAYER_3D_COPPER_TOP ] = findColor( wxT( "Gold" ), g_FinishColors );
722 }
723 else if( finishName.StartsWith( wxT( "HAL" ) )
724 || finishName.StartsWith( wxT( "HASL" ) )
725 || finishName.EndsWith( wxT( "tin" ) )
726 || finishName.EndsWith( wxT( "nickel" ) ) )
727 {
728 colors[ LAYER_3D_COPPER_TOP ] = findColor( wxT( "Tin" ), g_FinishColors );
729 }
730 else if( finishName.EndsWith( wxT( "silver" ) ) )
731 {
732 colors[ LAYER_3D_COPPER_TOP ] = findColor( wxT( "Silver" ), g_FinishColors );
733 }
734 }
735
736 colors[ LAYER_3D_COPPER_BOTTOM ] = colors[ LAYER_3D_COPPER_TOP ];
737
738 for( const auto& [layer, val] : m_ColorOverrides )
739 colors[layer] = val;
740
741 return colors;
742}
743
744
745void BOARD_ADAPTER::SetLayerColors( const std::map<int, COLOR4D>& aColors )
746{
748
749 for( const auto& [ layer, color ] : aColors )
750 settings->SetColor( layer, color );
751
752 Pgm().GetSettingsManager().SaveColorSettings( settings, "3d_viewer" );
753}
754
755
756void BOARD_ADAPTER::SetVisibleLayers( const std::bitset<LAYER_3D_END>& aLayers )
757{
758 m_Cfg->m_Render.show_board_body = aLayers.test( LAYER_3D_BOARD );
769 m_Cfg->m_Render.show_eco1 = aLayers.test( LAYER_3D_USER_ECO1 );
770 m_Cfg->m_Render.show_eco2 = aLayers.test( LAYER_3D_USER_ECO2 );
771
777
779 m_Cfg->m_Render.show_fp_values = aLayers.test( LAYER_FP_VALUES );
780 m_Cfg->m_Render.show_fp_text = aLayers.test( LAYER_FP_TEXT );
781
784 m_Cfg->m_Render.show_axis = aLayers.test( LAYER_3D_AXES );
785}
786
787
788std::bitset<LAYER_3D_END> BOARD_ADAPTER::GetVisibleLayers() const
789{
790 std::bitset<LAYER_3D_END> ret;
791
805
809
815
819
821 {
822 if( !m_board )
823 return ret;
824
825 ret.set( LAYER_3D_BOARD, true );
838
840 ret.set( layer, m_board->IsElementVisible( layer ) );
841 }
843 {
844 if( !m_board )
845 return ret;
846
847 const PCB_PLOT_PARAMS& plotParams = m_board->GetPlotOptions();
848 LSET layers = plotParams.GetLayerSelection() | plotParams.GetPlotOnAllLayersSelection();
849
850 ret.set( LAYER_3D_BOARD, true );
851 ret.set( LAYER_3D_COPPER_TOP, layers.test( F_Cu ) );
852 ret.set( LAYER_3D_COPPER_BOTTOM, layers.test( B_Cu ) );
853 ret.set( LAYER_3D_SILKSCREEN_TOP, layers.test( F_SilkS ) );
854 ret.set( LAYER_3D_SILKSCREEN_BOTTOM, layers.test( B_SilkS ) );
855 ret.set( LAYER_3D_SOLDERMASK_TOP, layers.test( F_Mask ) );
856 ret.set( LAYER_3D_SOLDERMASK_BOTTOM, layers.test( B_Mask ) );
857 ret.set( LAYER_3D_SOLDERPASTE, layers.test( F_Paste ) );
858 ret.set( LAYER_3D_ADHESIVE, layers.test( F_Adhes ) );
859 ret.set( LAYER_3D_USER_COMMENTS, layers.test( Cmts_User ) );
860 ret.set( LAYER_3D_USER_DRAWINGS, layers.test( Dwgs_User ) );
861 ret.set( LAYER_3D_USER_ECO1, layers.test( Eco1_User ) );
862 ret.set( LAYER_3D_USER_ECO2, layers.test( Eco2_User ) );
863
864 ret.set( LAYER_FP_REFERENCES, plotParams.GetPlotReference() );
865 ret.set( LAYER_FP_VALUES, plotParams.GetPlotValue() );
866 ret.set( LAYER_FP_TEXT, plotParams.GetPlotFPText() );
867 }
868 else if( LAYER_PRESET_3D* preset = m_Cfg->FindPreset( m_Cfg->m_CurrentPreset ) )
869 {
870 ret = preset->layers;
871 }
872 else
873 {
887
891 }
892
893 return ret;
894}
895
896
897std::bitset<LAYER_3D_END> BOARD_ADAPTER::GetDefaultVisibleLayers() const
898{
899 std::bitset<LAYER_3D_END> ret;
900
901 ret.set( LAYER_3D_BOARD, true );
902 ret.set( LAYER_3D_COPPER_TOP, true );
903 ret.set( LAYER_3D_COPPER_BOTTOM, true );
904 ret.set( LAYER_3D_SILKSCREEN_TOP, true );
905 ret.set( LAYER_3D_SILKSCREEN_BOTTOM, true );
906 ret.set( LAYER_3D_SOLDERMASK_TOP, true );
907 ret.set( LAYER_3D_SOLDERMASK_BOTTOM, true );
908 ret.set( LAYER_3D_SOLDERPASTE, true );
909 ret.set( LAYER_3D_ADHESIVE, true );
910 ret.set( LAYER_3D_USER_COMMENTS, false );
911 ret.set( LAYER_3D_USER_DRAWINGS, false );
912 ret.set( LAYER_3D_USER_ECO1, false );
913 ret.set( LAYER_3D_USER_ECO2, false );
914
915 ret.set( LAYER_FP_REFERENCES, true );
916 ret.set( LAYER_FP_VALUES, true );
917 ret.set( LAYER_FP_TEXT, true );
918
919 ret.set( LAYER_3D_TH_MODELS, true );
920 ret.set( LAYER_3D_SMD_MODELS, true );
921 ret.set( LAYER_3D_VIRTUAL_MODELS, true );
922 ret.set( LAYER_3D_MODELS_NOT_IN_POS, false );
923 ret.set( LAYER_3D_MODELS_MARKED_DNP, false );
924
925 ret.set( LAYER_3D_BOUNDING_BOXES, false );
926 ret.set( LAYER_3D_OFF_BOARD_SILK, false );
927 ret.set( LAYER_3D_AXES, true );
928
929 return ret;
930}
931
932
933bool BOARD_ADAPTER::createBoardPolygon( wxString* aErrorMsg )
934{
936
937 if( !m_board )
938 return false;
939
940 bool success;
941
943 {
944 if( !m_board->GetFirstFootprint() )
945 {
946 if( aErrorMsg )
947 *aErrorMsg = _( "No footprint loaded." );
948
949 return false;
950 }
951
952 // max dist from one endPt to next startPt
953 int chainingEpsilon = m_board->GetOutlinesChainingEpsilon();
954
957 chainingEpsilon );
958
959 // Make polygon strictly simple to avoid issues (especially in 3D viewer)
961
962 if( !success && aErrorMsg )
963 {
964 *aErrorMsg = _( "Footprint outline is missing or malformed. Run Footprint Checker for "
965 "a full analysis." );
966 }
967 }
968 else
969 {
970 success = m_board->GetBoardPolygonOutlines( m_board_poly, nullptr, false, true );
971
972 if( !success && aErrorMsg )
973 *aErrorMsg = _( "Board outline is missing or malformed. Run DRC for a full analysis." );
974 }
975
976 return success;
977}
978
979
980float BOARD_ADAPTER::GetFootprintZPos( bool aIsFlipped ) const
981{
982 if( aIsFlipped )
983 {
984 if( auto it = m_layerZcoordBottom.find( B_Paste ); it != m_layerZcoordBottom.end() )
985 return it->second;
986 }
987 else
988 {
989 if( auto it = m_layerZcoordTop.find( F_Paste ); it != m_layerZcoordTop.end() )
990 return it->second;
991 }
992
993 return 0.0;
994}
995
996
998{
999 wxASSERT( aLayerId < PCB_LAYER_ID_COUNT );
1000
1001 const COLOR4D color = m_colors->GetColor( aLayerId );
1002
1003 return SFVEC4F( color.r, color.g, color.b, color.a );
1004}
1005
1006
1008{
1009 return GetColor( m_colors->GetColor( aItemId ) );
1010}
1011
1012
1014{
1015 return SFVEC4F( aColor.r, aColor.g, aColor.b, aColor.a );
1016}
1017
1018
1020{
1021 SFVEC2F sphericalCoord =
1022 SFVEC2F( ( m_Cfg->m_Render.raytrace_lightElevation[i] + 90.0f ) / 180.0f,
1023 m_Cfg->m_Render.raytrace_lightAzimuth[i] / 180.0f );
1024
1025 sphericalCoord.x = glm::clamp( sphericalCoord.x, 0.0f, 1.0f );
1026 sphericalCoord.y = glm::clamp( sphericalCoord.y, 0.0f, 2.0f );
1027
1028 return sphericalCoord;
1029}
Defines math related functions.
Defines math related functions.
int color
Definition: DXF_plotter.cpp:58
constexpr int ARC_HIGH_DEF
Definition: base_units.h:120
constexpr EDA_IU_SCALE pcbIUScale
Definition: base_units.h:108
#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:45
@ BS_ITEM_TYPE_SILKSCREEN
Definition: board_stackup.h:51
@ BS_ITEM_TYPE_DIELECTRIC
Definition: board_stackup.h:46
@ BS_ITEM_TYPE_SOLDERMASK
Definition: board_stackup.h:49
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:189
BASE_SET & set(size_t pos)
Definition: base_set.h:115
std::map< int, COLOR4D > m_BoardEditorColors
list of colors used by the board editor
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
std::map< PCB_LAYER_ID, float > m_layerZcoordBottom
Bottom (Start) Z position of each layer in 3D units.
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
Build a color list which is used to store colors layers.
SHAPE_POLY_SET * m_frontPlatedCopperPolys
BVH_CONTAINER_2D m_TH_ODs
List of PTH outer diameters.
SHAPE_POLY_SET * m_frontPlatedPadAndGraphicPolys
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
std::bitset< LAYER_3D_END > GetDefaultVisibleLayers() const
std::map< PCB_LAYER_ID, float > m_layerZcoordTop
Top (End) Z position of each layer in 3D units.
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
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)
EDA_3D_VIEWER_SETTINGS * m_Cfg
std::map< int, COLOR4D > m_ColorOverrides
allows to override color scheme colors
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.
SHAPE_POLY_SET * m_backPlatedPadAndGraphicPolys
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
void GetBoardEditorCopperLayerColors(PCBNEW_SETTINGS *aCfg)
Build the copper color list used by the board editor, and store it in m_BoardEditorColors.
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
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:96
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:2493
bool IsFootprintHolder() const
Find out if the board is being used to hold a single footprint for editing/viewing.
Definition: board.h:320
bool IsElementVisible(GAL_LAYER_ID aLayer) const
Test whether a given element category is visible.
Definition: board.cpp:841
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:801
FOOTPRINT * GetFirstFootprint() const
Get the first footprint on the board or nullptr.
Definition: board.h:448
BOX2I ComputeBoundingBox(bool aBoardEdgesOnly=false) const
Calculate the bounding box containing all board items (or board edge segments).
Definition: board.cpp:1670
int GetCopperLayerCount() const
Definition: board.cpp:738
const PCB_PLOT_PARAMS & GetPlotOptions() const
Definition: board.h:692
int GetOutlinesChainingEpsilon()
Definition: board.h:739
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:781
BOARD_DESIGN_SETTINGS & GetDesignSettings() const
Definition: board.cpp:892
constexpr BOX2< Vec > & Inflate(coord_type dx, coord_type dy)
Inflates the rectangle horizontally by dx and vertically by dy.
Definition: box2.h:558
constexpr size_type GetWidth() const
Definition: box2.h:214
constexpr Vec Centre() const
Definition: box2.h:97
constexpr size_type GetHeight() const
Definition: box2.h:215
constexpr const SizeVec & GetSize() const
Definition: box2.h:206
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:392
double g
Green component.
Definition: color4d.h:393
double a
Alpha component.
Definition: color4d.h:395
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:394
LSET is a set of PCB_LAYER_IDs.
Definition: lset.h:36
static LSET AllCuMask(int aCuLayerCount=MAX_CU_LAYERS)
Return a mask holding the requested number of Cu PCB_LAYER_IDs.
Definition: lset.cpp:676
Parameters and options when plotting/printing a board.
LSET GetLayerSelection() const
bool GetPlotReference() const
LSET GetPlotOnAllLayersSelection() const
bool GetPlotValue() const
bool GetPlotFPText() const
virtual SETTINGS_MANAGER & GetSettingsManager() const
Definition: pgm_base.h:142
A pure virtual class used to derive REPORTER objects from.
Definition: reporter.h:72
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 SaveColorSettings(COLOR_SETTINGS *aSettings, const std::string &aNamespace="")
Safely saves a COLOR_SETTINGS to disk, preserving any changes outside the given namespace.
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.
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:399
FOOTPRINT_ATTR_T
The set of attributes allowed within a FOOTPRINT, using FOOTPRINT::SetAttributes() and FOOTPRINT::Get...
Definition: footprint.h:74
@ FP_SMD
Definition: footprint.h:76
@ FP_DNP
Definition: footprint.h:83
@ FP_EXCLUDE_FROM_POS_FILES
Definition: footprint.h:77
@ FP_THROUGH_HOLE
Definition: footprint.h:75
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:461
@ LAYER_3D_BOUNDING_BOXES
Definition: layer_ids.h:474
@ LAYER_3D_ADHESIVE
Definition: layer_ids.h:463
@ LAYER_3D_SMD_MODELS
Definition: layer_ids.h:469
@ LAYER_3D_BACKGROUND_TOP
Definition: layer_ids.h:454
@ LAYER_3D_USER_COMMENTS
Definition: layer_ids.h:464
@ LAYER_3D_SOLDERMASK_BOTTOM
Definition: layer_ids.h:460
@ LAYER_3D_BOARD
Definition: layer_ids.h:455
@ LAYER_3D_USER_ECO1
Definition: layer_ids.h:466
@ LAYER_3D_USER_ECO2
Definition: layer_ids.h:467
@ LAYER_3D_TH_MODELS
Definition: layer_ids.h:468
@ LAYER_3D_AXES
Definition: layer_ids.h:473
@ LAYER_3D_SILKSCREEN_TOP
Definition: layer_ids.h:459
@ LAYER_3D_VIRTUAL_MODELS
Definition: layer_ids.h:470
@ LAYER_3D_MODELS_MARKED_DNP
Definition: layer_ids.h:472
@ LAYER_3D_COPPER_TOP
Definition: layer_ids.h:456
@ LAYER_3D_SOLDERPASTE
Definition: layer_ids.h:462
@ LAYER_3D_OFF_BOARD_SILK
Definition: layer_ids.h:475
@ LAYER_3D_MODELS_NOT_IN_POS
Definition: layer_ids.h:471
@ LAYER_3D_USER_DRAWINGS
Definition: layer_ids.h:465
@ LAYER_3D_COPPER_BOTTOM
Definition: layer_ids.h:457
@ LAYER_3D_BACKGROUND_BOTTOM
Definition: layer_ids.h:453
@ LAYER_3D_SILKSCREEN_BOTTOM
Definition: layer_ids.h:458
bool IsCopperLayer(int aLayerId)
Tests whether a layer is a copper layer.
Definition: layer_ids.h:531
GAL_LAYER_ID
GAL layers are "virtual" layers, i.e.
Definition: layer_ids.h:191
@ LAYER_FP_REFERENCES
show footprints references (when texts are visible)
Definition: layer_ids.h:212
@ LAYER_FP_TEXT
Definition: layer_ids.h:199
@ LAYER_FP_VALUES
show footprints values (when texts are visible)
Definition: layer_ids.h:211
PCB_LAYER_ID
A quick note on layer IDs:
Definition: layer_ids.h:60
@ B_Adhes
Definition: layer_ids.h:103
@ Dwgs_User
Definition: layer_ids.h:107
@ F_Paste
Definition: layer_ids.h:104
@ Cmts_User
Definition: layer_ids.h:108
@ F_Adhes
Definition: layer_ids.h:102
@ B_Mask
Definition: layer_ids.h:98
@ B_Cu
Definition: layer_ids.h:65
@ Eco1_User
Definition: layer_ids.h:109
@ F_Mask
Definition: layer_ids.h:97
@ B_Paste
Definition: layer_ids.h:105
@ F_SilkS
Definition: layer_ids.h:100
@ Eco2_User
Definition: layer_ids.h:110
@ B_SilkS
Definition: layer_ids.h:101
@ PCB_LAYER_ID_COUNT
Definition: layer_ids.h:135
@ F_Cu
Definition: layer_ids.h:64
PGM_BASE & Pgm()
The global Program "get" accessor.
Definition: pgm_base.cpp:1060
PGM_BASE * PgmOrNull()
similar to PGM_BASE& Pgm(), but return a reference that can be nullptr when running a shared lib from...
Definition: pgm_base.cpp:1067
see class PGM_BASE
int64_t GetRunningMicroSecs()
An alternate way to calculate an elapsed time (in microsecondes) to class PROF_COUNTER.
@ RPT_SEVERITY_WARNING
wxString NotSpecifiedPrm()
Manage a bounding box defined by two SFVEC3F min max points.
Definition: bbox_3d.h:43
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:88
VECTOR2< int32_t > VECTOR2I
Definition: vector2d.h:691
glm::vec2 SFVEC2F
Definition: xv3d_types.h:42
glm::vec3 SFVEC3F
Definition: xv3d_types.h:44
glm::vec4 SFVEC4F
Definition: xv3d_types.h:46