Commit 3237ea13 authored by charras's avatar charras

pcbnew PS output: now shows oblong holes with the true shape.

Also, uses kicad/bin in libs.win instead of kicad/winexe
parent dd45a357
...@@ -5,6 +5,11 @@ Started 2007-June-11 ...@@ -5,6 +5,11 @@ 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-Apr-21 UPDATE Jean-Pierre Charras <jean-pierre.charras@inpg.fr>
================================================================================
+pcbnew
PS output: now shows oblong holes with the true shape.
2008-Apr-22 UPDATE Dick Hollenbeck <dick@softplc.com> 2008-Apr-22 UPDATE Dick Hollenbeck <dick@softplc.com>
================================================================================ ================================================================================
......
# File: libs.win # File: libs.win
#binaries path: #binaries path:
KICAD_BIN = /f/kicad/winexe KICAD_BIN = /f/kicad/bin
......
...@@ -143,7 +143,7 @@ void WinEDA_BasePcbFrame::Genere_PS( const wxString& FullFileName, int Layer, bo ...@@ -143,7 +143,7 @@ void WinEDA_BasePcbFrame::Genere_PS( const wxString& FullFileName, int Layer, bo
g_PlotOffset.y = -PaperSize.y / 2 + BoardCenter.y; g_PlotOffset.y = -PaperSize.y / 2 + BoardCenter.y;
else else
g_PlotOffset.y = -PaperSize.y + m_Pcb->m_BoundaryBox.GetBottom() g_PlotOffset.y = -PaperSize.y + m_Pcb->m_BoundaryBox.GetBottom()
+ m_Pcb->m_BoundaryBox.GetY() + PlotMarge_in_mils * U_PCB; + m_Pcb->m_BoundaryBox.GetY() + PlotMarge_in_mils * U_PCB;
} }
InitPlotParametresPS( g_PlotOffset, SheetPS, scale_x, scale_y, g_PlotOrient ); InitPlotParametresPS( g_PlotOffset, SheetPS, scale_x, scale_y, g_PlotOrient );
...@@ -211,7 +211,7 @@ void WinEDA_BasePcbFrame::Genere_PS( const wxString& FullFileName, int Layer, bo ...@@ -211,7 +211,7 @@ void WinEDA_BasePcbFrame::Genere_PS( const wxString& FullFileName, int Layer, bo
else else
tracevia = 0; tracevia = 0;
Plot_Layer_PS( dest, layer_mask, g_DesignSettings.m_MaskMargin, Plot_Layer_PS( dest, layer_mask, g_DesignSettings.m_MaskMargin,
tracevia, modetrace ); tracevia, modetrace );
break; break;
case SOLDERPASTE_N_CU: case SOLDERPASTE_N_CU:
...@@ -257,22 +257,22 @@ void WinEDA_BasePcbFrame::Plot_Layer_PS( FILE* File, int masque_layer, ...@@ -257,22 +257,22 @@ void WinEDA_BasePcbFrame::Plot_Layer_PS( FILE* File, int masque_layer,
{ {
case TYPEDRAWSEGMENT: case TYPEDRAWSEGMENT:
PlotDrawSegment( (DRAWSEGMENT*) PtStruct, PLOT_FORMAT_POST, PlotDrawSegment( (DRAWSEGMENT*) PtStruct, PLOT_FORMAT_POST,
masque_layer ); masque_layer );
break; break;
case TYPETEXTE: case TYPETEXTE:
PlotTextePcb( (TEXTE_PCB*) PtStruct, PLOT_FORMAT_POST, PlotTextePcb( (TEXTE_PCB*) PtStruct, PLOT_FORMAT_POST,
masque_layer ); masque_layer );
break; break;
case TYPECOTATION: case TYPECOTATION:
PlotCotation( (COTATION*) PtStruct, PLOT_FORMAT_POST, PlotCotation( (COTATION*) PtStruct, PLOT_FORMAT_POST,
masque_layer ); masque_layer );
break; break;
case TYPEMIRE: case TYPEMIRE:
PlotMirePcb( (MIREPCB*) PtStruct, PLOT_FORMAT_POST, PlotMirePcb( (MIREPCB*) PtStruct, PLOT_FORMAT_POST,
masque_layer ); masque_layer );
break; break;
case TYPEMARKER: case TYPEMARKER:
...@@ -280,7 +280,7 @@ void WinEDA_BasePcbFrame::Plot_Layer_PS( FILE* File, int masque_layer, ...@@ -280,7 +280,7 @@ void WinEDA_BasePcbFrame::Plot_Layer_PS( FILE* File, int masque_layer,
default: default:
DisplayError( this, DisplayError( this,
wxT( "WinEDA_BasePcbFrame::Plot_Layer_PS() : Unexpected Draw Type" ) ); wxT( "WinEDA_BasePcbFrame::Plot_Layer_PS() : Unexpected Draw Type" ) );
break; break;
} }
} }
...@@ -341,7 +341,7 @@ void WinEDA_BasePcbFrame::Plot_Layer_PS( FILE* File, int masque_layer, ...@@ -341,7 +341,7 @@ void WinEDA_BasePcbFrame::Plot_Layer_PS( FILE* File, int masque_layer,
wxSize delta; wxSize delta;
delta = PtPad->m_DeltaSize; delta = PtPad->m_DeltaSize;
trace_1_pad_TRAPEZE_POST( pos, size, delta, trace_1_pad_TRAPEZE_POST( pos, size, delta,
PtPad->m_Orient, modetrace ); PtPad->m_Orient, modetrace );
break; break;
} }
...@@ -437,7 +437,7 @@ static void PrintDrillMark( BOARD* Pcb ) ...@@ -437,7 +437,7 @@ static void PrintDrillMark( BOARD* Pcb )
/* Draw a drill mark for pads and vias. /* Draw a drill mark for pads and vias.
* Must be called after all drawings, because it * Must be called after all drawings, because it
* redraw the drill mark on a pad or via * redraw the drill mark on a pad or via, as a negative (i.e. white) shape
*/ */
{ {
const int SMALL_DRILL = 150; const int SMALL_DRILL = 150;
...@@ -458,7 +458,7 @@ static void PrintDrillMark( BOARD* Pcb ) ...@@ -458,7 +458,7 @@ static void PrintDrillMark( BOARD* Pcb )
diam.x = diam.y = (g_DrillShapeOpt == DRILL_MARK) ? SMALL_DRILL : diam.x = diam.y = (g_DrillShapeOpt == DRILL_MARK) ? SMALL_DRILL :
g_DesignSettings.m_ViaDrill; g_DesignSettings.m_ViaDrill;
for( pts = Pcb->m_Track; pts != NULL; pts = (TRACK*) pts->Pnext ) for( pts = Pcb->m_Track; pts != NULL; pts = pts->Next() )
{ {
if( pts->Type() != TYPEVIA ) if( pts->Type() != TYPEVIA )
continue; continue;
...@@ -474,17 +474,25 @@ static void PrintDrillMark( BOARD* Pcb ) ...@@ -474,17 +474,25 @@ static void PrintDrillMark( BOARD* Pcb )
Module = Pcb->m_Modules; Module = Pcb->m_Modules;
for( ; Module != NULL; Module = (MODULE*) Module->Pnext ) for( ; Module != NULL; Module = (MODULE*) Module->Pnext )
{ {
PtPad = (D_PAD*) Module->m_Pads; PtPad = Module->m_Pads;
for( ; PtPad != NULL; PtPad = (D_PAD*) PtPad->Pnext ) for( ; PtPad != NULL; PtPad = PtPad->Next() )
{ {
if( PtPad->m_Drill.x == 0 ) if( PtPad->m_Drill.x == 0 )
continue; continue;
// calcul de la position des trous, selon echelle // Output hole shapes:
pos = PtPad->m_Pos; pos = PtPad->m_Pos;
diam.x = diam.y = (g_DrillShapeOpt == DRILL_MARK) ? SMALL_DRILL : if( PtPad->m_DrillShape == PAD_OVAL )
PtPad->m_Drill.x; {
trace_1_pastille_RONDE_POST( pos, diam.x, FILLED ); diam = PtPad->m_Drill;
trace_1_pastille_OVALE_POST( pos, diam, PtPad->m_Orient, FILLED );
}
else
{
diam.x = (g_DrillShapeOpt == DRILL_MARK) ? SMALL_DRILL :
PtPad->m_Drill.x;
trace_1_pastille_RONDE_POST( pos, diam.x, FILLED );
}
} }
} }
...@@ -525,7 +533,7 @@ void trace_1_pastille_OVALE_POST( wxPoint pos, wxSize size, int orient, int mode ...@@ -525,7 +533,7 @@ void trace_1_pastille_OVALE_POST( wxPoint pos, wxSize size, int orient, int mode
if( modetrace == FILLED ) if( modetrace == FILLED )
{ {
PlotFilledSegmentPS( wxPoint( pos.x + x0, pos.y + y0 ), PlotFilledSegmentPS( wxPoint( pos.x + x0, pos.y + y0 ),
wxPoint( pos.x + x1, pos.y + y1 ), size.x ); wxPoint( pos.x + x1, pos.y + y1 ), size.x );
} }
else else
{ {
...@@ -545,7 +553,7 @@ void trace_1_pastille_OVALE_POST( wxPoint pos, wxSize size, int orient, int mode ...@@ -545,7 +553,7 @@ void trace_1_pastille_OVALE_POST( wxPoint pos, wxSize size, int orient, int mode
RotatePoint( &x0, &y0, orient ); RotatePoint( &x0, &y0, orient );
RotatePoint( &x1, &y1, orient ); RotatePoint( &x1, &y1, orient );
PlotFilledSegmentPS( wxPoint( pos.x + x0, pos.y + y0 ), PlotFilledSegmentPS( wxPoint( pos.x + x0, pos.y + y0 ),
wxPoint( pos.x + x1, pos.y + y1 ), w ); wxPoint( pos.x + x1, pos.y + y1 ), w );
x0 = rayon; x0 = rayon;
y0 = -delta / 2; y0 = -delta / 2;
...@@ -554,7 +562,7 @@ void trace_1_pastille_OVALE_POST( wxPoint pos, wxSize size, int orient, int mode ...@@ -554,7 +562,7 @@ void trace_1_pastille_OVALE_POST( wxPoint pos, wxSize size, int orient, int mode
RotatePoint( &x0, &y0, orient ); RotatePoint( &x0, &y0, orient );
RotatePoint( &x1, &y1, orient ); RotatePoint( &x1, &y1, orient );
PlotFilledSegmentPS( wxPoint( pos.x + x0, pos.y + y0 ), PlotFilledSegmentPS( wxPoint( pos.x + x0, pos.y + y0 ),
wxPoint( pos.x + x1, pos.y + y1 ), w ); wxPoint( pos.x + x1, pos.y + y1 ), w );
} }
} }
...@@ -566,7 +574,7 @@ void trace_1_pastille_RONDE_POST( wxPoint centre, int diametre, int modetrace ) ...@@ -566,7 +574,7 @@ void trace_1_pastille_RONDE_POST( wxPoint centre, int diametre, int modetrace )
/* Trace 1 pastille RONDE (via,pad rond) en position pos_X,Y /* Trace 1 pastille RONDE (via,pad rond) en position pos_X,Y
*/ */
{ {
int rayon, w; int rayon, w;
wxSize diam( diametre, diametre ); wxSize diam( diametre, diametre );
...@@ -575,12 +583,12 @@ void trace_1_pastille_RONDE_POST( wxPoint centre, int diametre, int modetrace ) ...@@ -575,12 +583,12 @@ void trace_1_pastille_RONDE_POST( wxPoint centre, int diametre, int modetrace )
if( modetrace == FILLED ) if( modetrace == FILLED )
{ {
SetCurrentLineWidthPS(0); SetCurrentLineWidthPS( 0 );
rayon = diam.x / 2; rayon = diam.x / 2;
if( rayon < 1 ) if( rayon < 1 )
rayon = 1; rayon = 1;
fprintf( dest, "newpath %d %d %d 0 360 arc fill stroke\n", fprintf( dest, "newpath %d %d %d 0 360 arc fill stroke\n",
centre.x, centre.y, rayon ); centre.x, centre.y, rayon );
} }
else else
{ {
...@@ -590,9 +598,9 @@ void trace_1_pastille_RONDE_POST( wxPoint centre, int diametre, int modetrace ) ...@@ -590,9 +598,9 @@ void trace_1_pastille_RONDE_POST( wxPoint centre, int diametre, int modetrace )
rayon = 1; rayon = 1;
if( rayon < w ) if( rayon < w )
w = rayon; w = rayon;
SetCurrentLineWidthPS(w); SetCurrentLineWidthPS( w );
fprintf( dest, "newpath %d %d %d 0 360 arc stroke\n", fprintf( dest, "newpath %d %d %d 0 360 arc stroke\n",
centre.x, centre.y, rayon ); centre.x, centre.y, rayon );
} }
} }
......
...@@ -673,7 +673,7 @@ bool WinEDA_PcbFrame::Genere_Pad_Connexion( wxDC* DC, int layer ) ...@@ -673,7 +673,7 @@ bool WinEDA_PcbFrame::Genere_Pad_Connexion( wxDC* DC, int layer )
dy += abs( pt_pad->m_DeltaSize.x ) / 2; dy += abs( pt_pad->m_DeltaSize.x ) / 2;
} }
/* calculate the 4 segment coordintes (starting from the pad centre cX,cY) */ /* calculate the 4 segment coordinates (starting from the pad centre cX,cY) */
sommet[0][0] = 0; sommet[0][1] = -dy; sommet[0][0] = 0; sommet[0][1] = -dy;
sommet[1][0] = -dx; sommet[1][1] = 0; sommet[1][0] = -dx; sommet[1][1] = 0;
sommet[2][0] = 0; sommet[2][1] = dy; sommet[2][0] = 0; sommet[2][1] = dy;
...@@ -698,8 +698,14 @@ bool WinEDA_PcbFrame::Genere_Pad_Connexion( wxDC* DC, int layer ) ...@@ -698,8 +698,14 @@ bool WinEDA_PcbFrame::Genere_Pad_Connexion( wxDC* DC, int layer )
/* Test if the segment is allowed */ /* Test if the segment is allowed */
if( BAD_DRC==m_drc->DrcBlind( pt_track, m_Pcb->m_Track ) ) if( BAD_DRC==m_drc->DrcBlind( pt_track, m_Pcb->m_Track ) )
{ {
delete pt_track; // Drc error, retry with a smaller width
continue; // because some drc errors are due to a track width > filling zone size.
pt_track->m_Width = g_GridRoutingSize;
if( BAD_DRC==m_drc->DrcBlind( pt_track, m_Pcb->m_Track ) )
{
delete pt_track;
continue;
}
} }
/* Search for a zone segment */ /* Search for a zone segment */
......
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