Commit 24a6c34a authored by peud's avatar peud
Browse files

Add ARC and CIRCLE shapes to 3d-viewer when used at module edge or pcb edge.

parent 07a0e142
Loading
Loading
Loading
Loading
+30 −16
Original line number Original line Diff line number Diff line
@@ -430,7 +430,8 @@ void MODULE::Draw3D( Pcb3D_GLCanvas* glcanvas )
void EDGE_MODULE::Draw3D( Pcb3D_GLCanvas* glcanvas )
void EDGE_MODULE::Draw3D( Pcb3D_GLCanvas* glcanvas )
/***************************************************/
/***************************************************/
{
{
    int    ux0, uy0, dx, dy, rayon, StAngle, EndAngle;
	wxString s;
    int    dx, dy;
    double scale, x, y, fx, fy, w, zpos;
    double scale, x, y, fx, fy, w, zpos;
    int    color = g_Parm_3D_Visu.m_BoardSettings->m_LayerColor[m_Layer];
    int    color = g_Parm_3D_Visu.m_BoardSettings->m_LayerColor[m_Layer];


@@ -441,33 +442,46 @@ void EDGE_MODULE::Draw3D( Pcb3D_GLCanvas* glcanvas )
    glNormal3f( 0.0, 0.0, (m_Layer == COPPER_LAYER_N) ? -1.0 : 1.0 );
    glNormal3f( 0.0, 0.0, (m_Layer == COPPER_LAYER_N) ? -1.0 : 1.0 );
    scale = g_Parm_3D_Visu.m_BoardScale;
    scale = g_Parm_3D_Visu.m_BoardScale;


    ux0  = m_Start.x;
    uy0  = m_Start.y;
    dx   = m_End.x;
    dx   = m_End.x;
    dy   = m_End.y;
    dy   = m_End.y;
    zpos = g_Parm_3D_Visu.m_LayerZcoord[m_Layer];
    zpos = g_Parm_3D_Visu.m_LayerZcoord[m_Layer];
    w    = m_Width * g_Parm_3D_Visu.m_BoardScale;
    w    = m_Width * g_Parm_3D_Visu.m_BoardScale;

    switch( m_Shape )
    {
    case S_SEGMENT:
    x  = m_Start.x * g_Parm_3D_Visu.m_BoardScale;
    x  = m_Start.x * g_Parm_3D_Visu.m_BoardScale;
    y  = m_Start.y * g_Parm_3D_Visu.m_BoardScale;
    y  = m_Start.y * g_Parm_3D_Visu.m_BoardScale;
    fx = dx * g_Parm_3D_Visu.m_BoardScale;
    fx = dx * g_Parm_3D_Visu.m_BoardScale;
    fy = dy * g_Parm_3D_Visu.m_BoardScale;
    fy = dy * g_Parm_3D_Visu.m_BoardScale;


	switch( m_Shape )
    {
    case S_SEGMENT:
        Draw3D_FilledSegment( x, -y, fx, -fy, w, zpos );
        Draw3D_FilledSegment( x, -y, fx, -fy, w, zpos );
#if 0
		s.Printf("Draw FilledSegment: %g, %g, %g, %g, %g, %g\n",x,-y,fx,-fy,w,zpos);
		printf( CONV_TO_UTF8( s ) );
#endif
        break;
        break;


    case S_CIRCLE:
    case S_CIRCLE:
        rayon = (int) hypot( (double) (dx - ux0), (double) (dy - uy0) );
		Draw3D_CircleSegment( x, -y, fx, -fy, w, zpos);
        /* TO DO */
#if 0
		s.Printf("Draw Circle: %g, %g, %g, %g, %g, %g\n",x,-y,fx,-fy,w,zpos);
		printf( CONV_TO_UTF8( s ) );
#endif
        break;
        break;


    case S_ARC:
    case S_ARC:
        rayon    = (int) hypot( (double) (dx - ux0), (double) (dy - uy0) );
		Draw3D_ArcSegment( x, -y, fx, -fy, w, zpos);
        StAngle  = (int) ArcTangente( dy - uy0, dx - ux0 );
#if 0
        EndAngle = StAngle + m_Angle;
		s.Printf("Draw Arc: %g, %g, %g, %g, %g, %g\n",x,-y,fx,-fy,w,zpos);
        /* TO DO */
		printf( CONV_TO_UTF8( s ) );
#endif
		break;

	default:
		s.Printf(wxT("Error: Shape nr %d not implemented!\n"), m_Shape);
		printf( CONV_TO_UTF8( s ) );
	
		break;
		break;
    }
    }
}
}
+7 −0
Original line number Original line Diff line number Diff line
@@ -5,6 +5,13 @@ Started 2007-June-11
Please add newer entries at the top, list the date and your name with
Please add newer entries at the top, list the date and your name with
email address.
email address.


2008-Mar-11 UPDATE   Per Uddén <p.udden@telia.com>
================================================================================
+3d-viewer
  * Fix TODO: Add S_ARC and S_CIRCLE shape render to board edge and module edge.
	Ex. Now is a board with arcs at corners showing correctly. 


2008-Mar-10 UPDATE   Dick Hollenbeck <dick@softplc.com>
2008-Mar-10 UPDATE   Dick Hollenbeck <dick@softplc.com>
================================================================================
================================================================================
+pcbnew
+pcbnew