Commit 24a6c34a authored by peud's avatar peud

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

parent 07a0e142
......@@ -430,7 +430,8 @@ void 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;
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 );
scale = g_Parm_3D_Visu.m_BoardScale;
ux0 = m_Start.x;
uy0 = m_Start.y;
dx = m_End.x;
dy = m_End.y;
zpos = g_Parm_3D_Visu.m_LayerZcoord[m_Layer];
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;
y = m_Start.y * g_Parm_3D_Visu.m_BoardScale;
fx = dx * 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 );
#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;
case S_CIRCLE:
rayon = (int) hypot( (double) (dx - ux0), (double) (dy - uy0) );
/* TO DO */
Draw3D_CircleSegment( x, -y, fx, -fy, w, zpos);
#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;
case S_ARC:
rayon = (int) hypot( (double) (dx - ux0), (double) (dy - uy0) );
StAngle = (int) ArcTangente( dy - uy0, dx - ux0 );
EndAngle = StAngle + m_Angle;
/* TO DO */
Draw3D_ArcSegment( x, -y, fx, -fy, w, zpos);
#if 0
s.Printf("Draw Arc: %g, %g, %g, %g, %g, %g\n",x,-y,fx,-fy,w,zpos);
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;
}
}
......
......@@ -5,6 +5,13 @@ Started 2007-June-11
Please add newer entries at the top, list the date and your name with
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>
================================================================================
+pcbnew
......
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