← Back to team overview

kicad-developers team mailing list archive

Re: Re: Bugs 2003834 and 1956732

 

Jean-Pierre,

I fixed this on HEAD and committed. If you want to apply the changes to 
the recent TAG branch, the patch is attached. Other than compile it, I 
again did not test this. (That strategy is not proving to be very 
successful lately. Lorenzo and others, please test your patches.)

Thanks,

Dick


> Seems the thickness and fill arguments of PlotCirclePS got mixed up.
> Why is the fill argument not a boolean? 
> I put a patch in the file area, plot_rtn.patch, but repeat it here as 
> well:
>
> Index: pcbnew/plot_rtn.cpp
> ===================================================================
> --- pcbnew/plot_rtn.cpp	(revision 1178)
> +++ pcbnew/plot_rtn.cpp	(working copy)
> @@ -791,7 +791,7 @@
> break;
> 
> case PLOT_FORMAT_POST:
> - PlotCirclePS( centre, radius * 2, thickness, 0);
> + PlotCirclePS( centre, radius * 2, 0, thickness);
> break;
> }
> }
>
> /tomas
>
> --- In kicad-devel@xxxxxxxxxxxxxxx, Dick Hollenbeck <dick@...> wrote:
> 
>> Thanks Lorenzo.
>>
>> Since the patch looks plausible, I will be applying it in a few 
>> 
> minutes.
> 
>> I will not have time to test it. It there is a world wide epidemic 
>> 
> of 
> 
>> exploding laser jet printers, then that is not on me.
>>
>>
>> Dick
>>
>>
>> 
>>> --- In kicad-devel@xxxxxxxxxxxxxxx, "Lorenzo" <lomarcan@> wrote:
>>>
>>> OK, done that. The BgFill is treated as a normal Fill, for now, 
>>> 
> but
> 
>>> it's all in the postscript prefix, so it can be changed easily. 
>>> 
> HPGL
> 
>>> plotting is NOT changed, by design, since a lot of the importers 
>>> 
> don't
> 
>>> recognize the fill commands. Said that it could be implemented 
>>> 
> using
> 
>>> the WG, RA, and the (HPGL/2 IIRC) PM/FP filled polygon commands.
>>>
>>> The real question is, really, today WHO wants an hpgl export? :D
>>>
>>> I put the patch in the files zone.
>>>
>>> Awaiting for comments or issues :P
>>>
>>>
>>> 
>
>
> 

 --------------050001020803080705020007 Content-Type: text/x-diff;
name="plot_fill.patch"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
filename="plot_fill.patch"

Index: eeschema/libcmp.h
===================================================================
--- eeschema/libcmp.h	(revision 1178)
+++ eeschema/libcmp.h	(working copy)
@@ -258,8 +258,8 @@
class LibDrawCircle : public LibEDA_BaseStruct
{
public:
- int m_Rayon;
- int m_Fill;
+ int m_Rayon;
+ bool m_Fill;

public:
LibDrawCircle();
Index: pcbnew/plot_rtn.cpp
===================================================================
--- pcbnew/plot_rtn.cpp	(revision 1178)
+++ pcbnew/plot_rtn.cpp	(working copy)
@@ -791,7 +791,7 @@
break;

case PLOT_FORMAT_POST:
- PlotCirclePS( centre, radius * 2, thickness, 0);
+ PlotCirclePS( centre, radius * 2, 0, thickness);
break;
}
}
Index: include/plot_common.h
===================================================================
--- include/plot_common.h	(revision 1178)
+++ include/plot_common.h	(working copy)
@@ -1,5 +1,5 @@
/********************/
-/*	plot_common.h	*/
+/* plot_common.h */
/********************/

#ifndef PLOT_COMMON_H
@@ -61,12 +61,12 @@
double yscale,
int orient = 0 );
void SetDefaultLineWidthPS( int width );
-void	PlotRectPS(wxPoint p1, wxPoint p2, int fill, int width = -1);
-void PlotCirclePS( wxPoint pos, int diametre, int fill, int width = -1 );
-void PlotArcPS( wxPoint centre, int StAngle, int EndAngle, int rayon, int fill, int width = -1 );
+void PlotRectPS( wxPoint p1, wxPoint p2, bool fill, int width = -1 );
+void PlotCirclePS( wxPoint pos, int diametre, bool fill, int width = -1 );
+void PlotArcPS( wxPoint centre, int StAngle, int EndAngle, int rayon, bool fill, int width = -1 );

// Plot an arc: StAngle, EndAngle = start and end arc in 0.1 degree
-void PlotPolyPS( int nb_segm, int* coord, int fill, int width = -1 );
+void PlotPolyPS( int nb_segm, int* coord, bool fill, int width = -1 );
void PlotFilledSegmentPS( wxPoint start, wxPoint end, int width );
void LineTo_PS( wxPoint pos, int plume );
void PrintHeaderPS( FILE* file,
@@ -85,10 +85,10 @@
void InitPlotParametresHPGL( wxPoint offset, double xscale, double yscale, int orient = 0 );
bool PrintHeaderHPGL( FILE* plot_file, int pen_speed, int pen_num );
bool CloseFileHPGL( FILE* plot_file );
-void PlotCircleHPGL( wxPoint centre, int diameter, int fill, int width = -1 );
-void	PlotRectHPGL(wxPoint t1, wxPoint t2, int fill, int width = -1);
-void PlotArcHPGL( wxPoint centre, int StAngle, int EndAngle, int rayon, int fill, int width = -1 );
-void PlotPolyHPGL( int nb, int* coord, int fill, int width = -1 );
+void PlotCircleHPGL( wxPoint centre, int diameter, bool fill, int width = -1 );
+void PlotRectHPGL( wxPoint t1, wxPoint t2, bool fill, int width = -1 );
+void PlotArcHPGL( wxPoint centre, int StAngle, int EndAngle, int rayon, bool fill, int width = -1 );
+void PlotPolyHPGL( int nb, int* coord, bool fill, int width = -1 );
void Move_Plume_HPGL( wxPoint pos, int plume );
void Plume_HPGL( int plume );

Index: common/common_plotPS_functions.cpp
===================================================================
--- common/common_plotPS_functions.cpp	(revision 1178)
+++ common/common_plotPS_functions.cpp	(working copy)
@@ -114,19 +114,19 @@
}

/***************************************************************/
-void PlotRectPS( wxPoint p1, wxPoint p2, int fill, int width )
+void PlotRectPS( wxPoint p1, wxPoint p2, bool fill, int width )
/***************************************************************/
{
UserToDeviceCoordinate( p1 );
UserToDeviceCoordinate( p2 );

SetCurrentLineWidthPS( width );
- fprintf( PlotOutputFile, "%d %d %d %d rect%d\n", p1.x, p1.y, 
-	p2.x-p1.x, p2.y-p1.y, fill );
+ fprintf( PlotOutputFile, "%d %d %d %d rect%d\n", p1.x, p1.y,
+ p2.x-p1.x, p2.y-p1.y, fill );
}

/******************************************************/
-void PlotCirclePS( wxPoint pos, int diametre, int fill, int width )
+void PlotCirclePS( wxPoint pos, int diametre, bool fill, int width )
/******************************************************/
{
int rayon;
@@ -145,7 +145,7 @@


/**************************************************************************************/
-void PlotArcPS( wxPoint centre, int StAngle, int EndAngle, int rayon, int fill, int width )
+void PlotArcPS( wxPoint centre, int StAngle, int EndAngle, int rayon, bool fill, int width )
/**************************************************************************************/

/* Plot an arc:
@@ -165,11 +165,11 @@
if( PlotOrientOptions == PLOT_MIROIR )
sprintf( Line, "%d %d %d %f %f arc%d\n", centre.x, centre.y,
(int) (rayon * XScale), (float) StAngle / 10, (float) EndAngle / 10,
-	fill);
+ fill);
else
sprintf( Line, "%d %d %d %f %f arc%d\n", centre.x, centre.y,
(int) (rayon * XScale), -(float) EndAngle / 10, -(float) StAngle / 10,
-	fill);
+ fill);

// Undo internationalization printf (float x.y printed x,y)
to_point( Line );
@@ -178,7 +178,7 @@


/*****************************************************************/
-void PlotPolyPS( int nb_segm, int* coord, int fill, int width )
+void PlotPolyPS( int nb_segm, int* coord, bool fill, int width )
/*****************************************************************/

/* Draw a polygon ( a filled polygon if fill == 1 ) in POSTSCRIPT format
@@ -270,18 +270,18 @@
" lineto\n",
" stroke\n",
"} bind def\n",
-	"/cir0 { newpath 0 360 arc stroke } bind def\n",
-	"/cir1 { newpath 0 360 arc gsave fill grestore stroke } bind def\n",
-	"/cir2 { newpath 0 360 arc gsave fill grestore stroke } bind def\n",
-	"/arc0 { newpath arc stroke } bind def\n",
-	"/arc1 { newpath 4 index 4 index moveto arc closepath gsave fill grestore stroke } bind def\n",
-	"/arc2 { newpath 4 index 4 index moveto arc closepath gsave fill grestore stroke } bind def\n",
-	"/poly0 { stroke } bind def\n",
-	"/poly1 { closepath gsave fill grestore stroke } bind def\n",
-	"/poly2 { closepath gsave fill grestore stroke } bind def\n",
-	"/rect0 { rectstroke } bind def\n",
-	"/rect1 { rectfill } bind def\n",
-	"/rect2 { rectfill } bind def\n",
+ "/cir0 { newpath 0 360 arc stroke } bind def\n",
+ "/cir1 { newpath 0 360 arc gsave fill grestore stroke } bind def\n",
+ "/cir2 { newpath 0 360 arc gsave fill grestore stroke } bind def\n",
+ "/arc0 { newpath arc stroke } bind def\n",
+ "/arc1 { newpath 4 index 4 index moveto arc closepath gsave fill grestore stroke } bind def\n",
+ "/arc2 { newpath 4 index 4 index moveto arc closepath gsave fill grestore stroke } bind def\n",
+ "/poly0 { stroke } bind def\n",
+ "/poly1 { closepath gsave fill grestore stroke } bind def\n",
+ "/poly2 { closepath gsave fill grestore stroke } bind def\n",
+ "/rect0 { rectstroke } bind def\n",
+ "/rect1 { rectfill } bind def\n",
+ "/rect2 { rectfill } bind def\n",
"gsave\n",
"72 72 scale\t\t\t% Talk inches\n",
"1 setlinecap\n",
Index: common/common_plotHPGL_functions.cpp
===================================================================
--- common/common_plotHPGL_functions.cpp	(revision 1178)
+++ common/common_plotHPGL_functions.cpp	(working copy)
@@ -69,7 +69,7 @@
}

/************************************************************/
-void PlotRectHPGL( wxPoint p1, wxPoint p2, int fill, int width )
+void PlotRectHPGL( wxPoint p1, wxPoint p2, bool fill, int width )
/************************************************************/
{
char Line[256];
@@ -86,7 +86,7 @@


/************************************************************/
-void PlotCircleHPGL( wxPoint centre, int diameter, int fill, int width )
+void PlotCircleHPGL( wxPoint centre, int diameter, bool fill, int width )
/************************************************************/
{
int rayon;
@@ -107,7 +107,7 @@


/********************************************************************/
-void PlotArcHPGL( wxPoint centre, int StAngle, int EndAngle, int rayon, int fill, int width )
+void PlotArcHPGL( wxPoint centre, int StAngle, int EndAngle, int rayon, bool fill, int width )
/********************************************************************/

/* trace d'un arc de cercle:
@@ -153,7 +153,7 @@


/*****************************************************/
-void PlotPolyHPGL( int nb, int* coord, int fill, int width )
+void PlotPolyHPGL( int nb, int* coord, bool fill, int width )
/*****************************************************/

/* Trace un polygone (ferme si rempli) en format HPGL
 --------------050001020803080705020007-- 




References