Commit ea5a03f9 authored by jean-pierre charras's avatar jean-pierre charras
Browse files

3D viewer: fix very minor issues (better rendering of 3D view).

parent 155a53dc
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -506,7 +506,7 @@ void EDA_3D_CANVAS::Draw3D_Via( SEGVIA* via )

        Draw3D_ZaxisCylinder( via->GetStart(), (outer_radius + inner_radius)/2,
                                  thickness, outer_radius - inner_radius,
                                  zpos, biu_to_3Dunits );
                                  zpos - (thickness/2), biu_to_3Dunits );
        if( layer >= top_layer )
            break;
    }
@@ -515,7 +515,7 @@ void EDA_3D_CANVAS::Draw3D_Via( SEGVIA* via )
    color = g_ColorsSettings.GetItemColor( VIAS_VISIBLE + via->GetShape() );
    SetGLColor( color );
    int height = g_Parm_3D_Visu.GetLayerZcoordBIU(top_layer) -
                 g_Parm_3D_Visu.GetLayerZcoordBIU( bottom_layer );
                 g_Parm_3D_Visu.GetLayerZcoordBIU( bottom_layer ) - thickness;
    int zpos = g_Parm_3D_Visu.GetLayerZcoordBIU(bottom_layer) + thickness/2;

    Draw3D_ZaxisCylinder( via->GetStart(), inner_radius + thickness/2, height,
+1 −1
Original line number Diff line number Diff line
@@ -212,7 +212,7 @@ void Draw3D_SolidHorizontalPolyPolygons( const std::vector<CPolyPt>& aPolysList,
        return;

    // Build the 3D data : vertical side
    Draw3D_VerticalPolygonalCylinder( polylist, aThickness, aZpos, false, aBiuTo3DUnits );
    Draw3D_VerticalPolygonalCylinder( polylist, aThickness, aZpos - (aThickness / 2), false, aBiuTo3DUnits );
}


+16 −0
Original line number Diff line number Diff line
@@ -192,3 +192,19 @@ void INFO3D_VISU::InitSettings( BOARD* aBoard )
        m_LayerZcoord[layer_id] = zpos;
    }
}

/* return the Z position of 3D shapes, in 3D Units
 * aIsFlipped: true for modules on Front (top) layer, false
 * if on back (bottom) layer
 * Note: in draw functions, the copper has a thickness = m_CopperThickness
 * Vias and tracks are draw with the top side position = m_CopperThickness/2
 * and the bottom side position = -m_CopperThickness/2 from the Z layer position
 */
double INFO3D_VISU::GetModulesZcoord3DIU( bool aIsFlipped )
{
    if(  aIsFlipped )
        return m_LayerZcoord[LAYER_N_BACK] - ( m_CopperThickness / 2 );
    else
        return m_LayerZcoord[LAYER_N_FRONT] + ( m_CopperThickness / 2 );
}
+2 −9
Original line number Diff line number Diff line
@@ -110,18 +110,11 @@ public: INFO3D_VISU();

    /**
     * function GetModulesZcoord3DIU
     * @return the Z coordinate of the module, in 3D Units
     * @return the Z position of 3D shapes, in 3D Units
     * @param aIsFlipped: true for modules on Front (top) layer, false
     * if on back (bottom) layer
     * Used to know the Z position of 3D shapes
     */
    double GetModulesZcoord3DIU( bool aIsFlipped )
    {
        if(  aIsFlipped )
            return m_LayerZcoord[ADHESIVE_N_BACK] - m_NonCopperLayerThickness;
        else
            return m_LayerZcoord[ADHESIVE_N_FRONT] + m_NonCopperLayerThickness;
    }
    double GetModulesZcoord3DIU( bool aIsFlipped );

    /**
     * function GetLayerZcoordBIU