Commit 74df72e9 authored by jean-pierre charras's avatar jean-pierre charras

Fix Bug #1336534 pcbnew 3D viewer wrong vertical model offset.

parent 8a1fd493
...@@ -115,29 +115,32 @@ void INFO3D_VISU::InitSettings( BOARD* aBoard ) ...@@ -115,29 +115,32 @@ void INFO3D_VISU::InitSettings( BOARD* aBoard )
// Init Z position of each layer // Init Z position of each layer
// calculate z position for each copper layer // calculate z position for each copper layer
// Z = 0 is the z position of the back (bottom) layer (layer id = 31)
// Z = m_EpoxyThickness is the z position of the front (top) layer (layer id = 0)
// all unused copper layer z position are set to 0
int layer; int layer;
int copper_layers_cnt = m_CopperLayersCount; int copper_layers_cnt = m_CopperLayersCount;
for( layer = 0; layer < copper_layers_cnt; layer++ ) for( layer = 0; layer < copper_layers_cnt; layer++ )
{ {
m_LayerZcoord[layer] = m_LayerZcoord[layer] =
m_EpoxyThickness * layer / (copper_layers_cnt - 1); m_EpoxyThickness - (m_EpoxyThickness * layer / (copper_layers_cnt - 1));
} }
#define layerThicknessMargin 1.1 #define layerThicknessMargin 1.1
double zpos_offset = m_NonCopperLayerThickness * layerThicknessMargin; double zpos_offset = m_NonCopperLayerThickness * layerThicknessMargin;
double zpos_copper_back = m_LayerZcoord[0] - layerThicknessMargin*m_CopperThickness/2; double zpos_copper_back = - layerThicknessMargin*m_CopperThickness/2;
double zpos_copper_front = m_EpoxyThickness + layerThicknessMargin*m_CopperThickness/2; double zpos_copper_front = m_EpoxyThickness + layerThicknessMargin*m_CopperThickness/2;
// Fill remaining unused copper layers and front layer zpos // Fill remaining unused copper layers and back layer zpos
// with m_EpoxyThickness // with 0
// Solder mask and Solder paste have the same Z position
for( ; layer < MAX_CU_LAYERS; layer++ ) for( ; layer < MAX_CU_LAYERS; layer++ )
{ {
m_LayerZcoord[layer] = m_EpoxyThickness; m_LayerZcoord[layer] = 0;
} }
// calculate z position for each non copper layer // calculate z position for each non copper layer
// Solder mask and Solder paste have the same Z position
for( int layer_id = MAX_CU_LAYERS; layer_id < LAYER_ID_COUNT; layer_id++ ) for( int layer_id = MAX_CU_LAYERS; layer_id < LAYER_ID_COUNT; layer_id++ )
{ {
double zpos; double zpos;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment