mirror of
https://gitlab.com/kicad/code/kicad.git
synced 2025-09-14 10:13:19 +02:00
Pcbnew 3D: Add a toggle for plated barrel visibility
This can be useful when checking 3D models and/or generating images of components in place on board, or if a dense via field is in the way when looking at something on an inner layer.
This commit is contained in:
parent
71750aa87e
commit
e82d19eeb7
@ -759,6 +759,7 @@ void BOARD_ADAPTER::SetLayerColors( const std::map<int, COLOR4D>& aColors )
|
||||
void BOARD_ADAPTER::SetVisibleLayers( const std::bitset<LAYER_3D_END>& aLayers )
|
||||
{
|
||||
m_Cfg->m_Render.show_board_body = aLayers.test( LAYER_3D_BOARD );
|
||||
m_Cfg->m_Render.show_plated_barrels = aLayers.test( LAYER_3D_PLATED_BARRELS );
|
||||
m_Cfg->m_Render.show_copper_top = aLayers.test( LAYER_3D_COPPER_TOP );
|
||||
m_Cfg->m_Render.show_copper_bottom = aLayers.test( LAYER_3D_COPPER_BOTTOM );
|
||||
m_Cfg->m_Render.show_silkscreen_top = aLayers.test( LAYER_3D_SILKSCREEN_TOP );
|
||||
@ -806,6 +807,7 @@ std::bitset<LAYER_3D_END> BOARD_ADAPTER::GetVisibleLayers() const
|
||||
ret.set( LAYER_3D_ADHESIVE, m_Cfg->m_Render.show_adhesive );
|
||||
}
|
||||
|
||||
ret.set( LAYER_3D_PLATED_BARRELS, true );
|
||||
ret.set( LAYER_3D_COPPER_TOP, true );
|
||||
ret.set( LAYER_3D_COPPER_BOTTOM, true );
|
||||
ret.set( LAYER_3D_SILKSCREEN_TOP, true );
|
||||
@ -836,6 +838,7 @@ std::bitset<LAYER_3D_END> BOARD_ADAPTER::GetVisibleLayers() const
|
||||
}
|
||||
|
||||
ret.set( LAYER_3D_BOARD, m_Cfg->m_Render.show_board_body );
|
||||
ret.set( LAYER_3D_PLATED_BARRELS, m_Cfg->m_Render.show_plated_barrels );
|
||||
ret.set( LAYER_3D_COPPER_TOP, m_Cfg->m_Render.show_copper_top );
|
||||
ret.set( LAYER_3D_COPPER_BOTTOM, m_Cfg->m_Render.show_copper_bottom );
|
||||
ret.set( LAYER_3D_SILKSCREEN_TOP, m_Cfg->m_Render.show_silkscreen_top );
|
||||
@ -934,6 +937,7 @@ std::bitset<LAYER_3D_END> BOARD_ADAPTER::GetDefaultVisibleLayers() const
|
||||
std::bitset<LAYER_3D_END> ret;
|
||||
|
||||
ret.set( LAYER_3D_BOARD, true );
|
||||
ret.set( LAYER_3D_PLATED_BARRELS, true );
|
||||
ret.set( LAYER_3D_COPPER_TOP, true );
|
||||
ret.set( LAYER_3D_COPPER_BOTTOM, true );
|
||||
ret.set( LAYER_3D_SILKSCREEN_TOP, true );
|
||||
|
@ -771,10 +771,13 @@ void RENDER_3D_OPENGL::generateViasAndPads()
|
||||
|
||||
wxASSERT( zbot < ztop );
|
||||
|
||||
if( m_boardAdapter.m_Cfg->m_Render.show_plated_barrels )
|
||||
{
|
||||
generateCylinder( via_center, hole_inner_radius, hole_inner_radius + platingThickness3d,
|
||||
ztop, zbot, nrSegments, layerTriangleVIA );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
m_microviaHoles = new OPENGL_RENDER_LIST( *layerTriangleVIA, 0, 0.0f, 0.0f );
|
||||
|
||||
@ -842,7 +845,7 @@ void RENDER_3D_OPENGL::generateViasAndPads()
|
||||
|
||||
const LIST_OBJECT2D& holes2D = holesContainer.GetList();
|
||||
|
||||
if( holes2D.size() > 0 )
|
||||
if( holes2D.size() > 0 && m_boardAdapter.m_Cfg->m_Render.show_plated_barrels )
|
||||
{
|
||||
float layer_z_top, layer_z_bot, dummy;
|
||||
|
||||
|
@ -38,6 +38,7 @@ LAYER_PRESET_3D::LAYER_PRESET_3D( const wxString& aName ) :
|
||||
name( aName )
|
||||
{
|
||||
layers.set( LAYER_3D_BOARD );
|
||||
layers.set( LAYER_3D_PLATED_BARRELS );
|
||||
layers.set( LAYER_3D_COPPER_TOP );
|
||||
layers.set( LAYER_3D_COPPER_BOTTOM );
|
||||
layers.set( LAYER_3D_SILKSCREEN_TOP );
|
||||
@ -59,6 +60,7 @@ LAYER_PRESET_3D::LAYER_PRESET_3D( const wxString& aName ) :
|
||||
colors[ LAYER_3D_BACKGROUND_TOP ] = BOARD_ADAPTER::g_DefaultBackgroundTop;
|
||||
colors[ LAYER_3D_BACKGROUND_BOTTOM ] = BOARD_ADAPTER::g_DefaultBackgroundBot;
|
||||
colors[ LAYER_3D_BOARD ] = BOARD_ADAPTER::g_DefaultBoardBody;
|
||||
colors[ LAYER_3D_PLATED_BARRELS ] = BOARD_ADAPTER::g_DefaultSurfaceFinish;
|
||||
colors[ LAYER_3D_COPPER_TOP ] = BOARD_ADAPTER::g_DefaultSurfaceFinish;
|
||||
colors[ LAYER_3D_COPPER_BOTTOM ] = BOARD_ADAPTER::g_DefaultSurfaceFinish;
|
||||
colors[ LAYER_3D_SILKSCREEN_TOP ] = BOARD_ADAPTER::g_DefaultSilkscreen;
|
||||
@ -91,6 +93,7 @@ PARAM_LAYER_PRESET_3D::PARAM_LAYER_PRESET_3D( const std::string& aPath,
|
||||
LAYER( "background_bottom", LAYER_3D_BACKGROUND_BOTTOM );
|
||||
LAYER( "background_top", LAYER_3D_BACKGROUND_TOP );
|
||||
LAYER( "board", LAYER_3D_BOARD );
|
||||
LAYER( "plated_barrels", LAYER_3D_PLATED_BARRELS );
|
||||
LAYER( "copper", LAYER_3D_COPPER_TOP );
|
||||
LAYER( "copper_bottom", LAYER_3D_COPPER_BOTTOM );
|
||||
LAYER( "silkscreen_bottom", LAYER_3D_SILKSCREEN_BOTTOM );
|
||||
@ -346,6 +349,8 @@ EDA_3D_VIEWER_SETTINGS::EDA_3D_VIEWER_SETTINGS() :
|
||||
&m_Render.show_navigator, true ) );
|
||||
m_params.emplace_back( new PARAM<bool>( "render.show_board_body",
|
||||
&m_Render.show_board_body, true ) );
|
||||
m_params.emplace_back( new PARAM<bool>( "render.show_plated_barrels",
|
||||
&m_Render.show_plated_barrels, true ) );
|
||||
m_params.emplace_back( new PARAM<bool>( "render.show_comments",
|
||||
&m_Render.show_comments, true ) );
|
||||
m_params.emplace_back( new PARAM<bool>( "render.show_drawings",
|
||||
|
@ -128,6 +128,7 @@ public:
|
||||
bool show_adhesive;
|
||||
bool show_navigator;
|
||||
bool show_board_body;
|
||||
bool show_plated_barrels;
|
||||
bool show_comments;
|
||||
bool show_drawings;
|
||||
bool show_eco1;
|
||||
|
@ -53,6 +53,7 @@ const APPEARANCE_CONTROLS_3D::APPEARANCE_SETTING_3D APPEARANCE_CONTROLS_3D::s_la
|
||||
|
||||
// text id tooltip
|
||||
RR( _HKI( "Board Body" ), LAYER_3D_BOARD, _HKI( "Show board body" ) ),
|
||||
RR( _HKI( "Plated Barrels" ),LAYER_3D_PLATED_BARRELS, _HKI( "Show barrels of plated through-holes and vias" ) ),
|
||||
RR( wxS( "F.Cu" ), LAYER_3D_COPPER_TOP, _HKI( "Show front copper / surface finish color" ) ),
|
||||
RR( wxS( "B.Cu" ), LAYER_3D_COPPER_BOTTOM, _HKI( "Show back copper / surface finish color" ) ),
|
||||
RR( _HKI( "Adhesive" ), LAYER_3D_ADHESIVE, _HKI( "Show adhesive" ) ),
|
||||
@ -429,6 +430,7 @@ void APPEARANCE_CONTROLS_3D::OnLayerVisibilityChanged( int aLayer, bool isVisibl
|
||||
case LAYER_3D_BOARD:
|
||||
case LAYER_3D_COPPER_TOP:
|
||||
case LAYER_3D_COPPER_BOTTOM:
|
||||
case LAYER_3D_PLATED_BARRELS:
|
||||
case LAYER_3D_SILKSCREEN_BOTTOM:
|
||||
case LAYER_3D_SILKSCREEN_TOP:
|
||||
case LAYER_3D_SOLDERMASK_BOTTOM:
|
||||
@ -500,15 +502,23 @@ void APPEARANCE_CONTROLS_3D::onColorSwatchChanged( COLOR_SWATCH* aSwatch )
|
||||
// be applied to all copper layers.
|
||||
COLOR_SWATCH* otherSwatch = nullptr;
|
||||
|
||||
if( layer == LAYER_3D_COPPER_TOP )
|
||||
const std::vector<int> copperIndices{
|
||||
LAYER_3D_COPPER_TOP,
|
||||
LAYER_3D_COPPER_BOTTOM,
|
||||
LAYER_3D_PLATED_BARRELS,
|
||||
};
|
||||
|
||||
// If the changed swatch is one of the copper layers, we need to update the other copper layers
|
||||
if( std::find( copperIndices.begin(), copperIndices.end(), layer ) != copperIndices.end() )
|
||||
{
|
||||
colors[ LAYER_3D_COPPER_BOTTOM ] = newColor;
|
||||
otherSwatch = m_layerSettingsMap[LAYER_3D_COPPER_BOTTOM]->m_Ctl_color;
|
||||
for( int index : copperIndices )
|
||||
{
|
||||
if( layer != index && colors.count( index ) )
|
||||
{
|
||||
colors[index] = newColor;
|
||||
otherSwatch = m_layerSettingsMap[index]->m_Ctl_color;
|
||||
}
|
||||
}
|
||||
else if( layer == LAYER_3D_COPPER_BOTTOM )
|
||||
{
|
||||
colors[ LAYER_3D_COPPER_TOP ] = newColor;
|
||||
otherSwatch = m_layerSettingsMap[LAYER_3D_COPPER_TOP]->m_Ctl_color;
|
||||
}
|
||||
|
||||
if( otherSwatch )
|
||||
@ -1090,5 +1100,3 @@ void APPEARANCE_CONTROLS_3D::passOnFocus()
|
||||
{
|
||||
m_focusOwner->SetFocus();
|
||||
}
|
||||
|
||||
|
||||
|
@ -605,6 +605,7 @@ enum LAYER_3D_ID : int
|
||||
LAYER_3D_NAVIGATOR,
|
||||
LAYER_3D_BOUNDING_BOXES,
|
||||
LAYER_3D_OFF_BOARD_SILK,
|
||||
LAYER_3D_PLATED_BARRELS,
|
||||
|
||||
LAYER_3D_END
|
||||
};
|
||||
|
Loading…
x
Reference in New Issue
Block a user