← Back to team overview

kicad-developers team mailing list archive

Re: "Close in" work in pcbnew

 

Dick Hollenbeck a écrit :
>
> Jean-Pierre,
>
> Today I had some "close in" work to do in PCBNEW, while aligning some
> zone boundaries which were not on grid. I could not get the job done
> effectively without the following change to the zoom factors and zoom
> travel.
>
> Please advise again the problem with the 5 entry. Maybe that can be
> fixed, I'm game to help with it.
>
> Dick
>
> This works for me:
>
> static const int PcbZoomList[ ] = { 5, 10, 15, 22, 30, 45, 70, 100, 150,
> 220, 350, 500, 800, 1200,
> 2000, 3500, 5000, 20000 };
>
> in classpcb.cpp
>
The problem i found on my computer (under kubuntu 8.10, does not happen 
under XP) is when displaying filled areas.
This can be noticed with the demo interf_u.brd, at zoom level 1, when 
using zone filled using polygons.
when zones are filled using the polygon mode, and mouse cursor on left 
side of the board, filled areas are incorrectly displayed.
Of course this does not happen if you are using the filling mode by 
segments.
I am thinking at 0.5 zoom level (or for large boards) this problem more 
frequently happens

For me it is clearly an integer overflow in drawing routines.

I found these problems when i wrote kicad draw functions a long time ago 
under W98 (coordinates were handled by 16 bits integers)
and linux with arcs.
This explains what kicad has build-in clipping functions inside draw 
functions, and send clipped draw objects to wxDC.
these clipping functions are not pixel accurate, they are intended to 
avoid overflow problems.
(They are also useful, as you know, in PostDirtyRectangle)

Unfortunately polygons used to draw filled areas can have a lot of 
segments (20,000 to 40,000)
and clipping before send them to wxDC draw function takes a too long 
time to be useable.

Of course we can use only the filling mode by segment to avoid this 
problem (this problem is the reason i wrote this option),
but using polygons is also a good idea (i believe): filled areas are 
very clean (when working!).

Any idea in welcomed.

-- 
Jean-Pierre CHARRAS

Maître de conférences
Directeur d'études 2ieme année.
Génie Electrique et Informatique Industrielle 2
Institut Universitaire de Technologie 1 de Grenoble
BP 67, 38402 St Martin d'Heres Cedex

Recherche :
GIPSA-LIS - INPG
Rue de la Houille Blanche
38400 Saint Martin d'Heres

--------------050409020701030403060008 Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
<title></title>
</head>
<body bgcolor="#ffffff" text="#000000">
Dick Hollenbeck a &eacute;crit&nbsp;:
<blockquote cite="mid:4995D547.4010401@..." type="cite">
<meta http-equiv="Context-Type"
content="text/html; charset=ISO-8859-1">
<div>
<div>
<div>
<p>Jean-Pierre,<br>
<br>
Today I had some "close in" work to do in PCBNEW, while aligning some <br>
zone boundaries which were not on grid. I could not get the job done <br>
effectively without the following change to the zoom factors and zoom <br>
travel.<br>
<br>
Please advise again the problem with the 5 entry. Maybe that can be <br>
fixed, I'm game to help with it.<br>
<br>
Dick<br>
<br>
This works for me:<br>
<br>
static const int PcbZoomList[ ] = { 5, 10, 15, 22, 30, 45, 70, 100,
150, <br>
220, 350, 500, 800, 1200,<br>
2000, 3500, 5000, 20000 };<br>
<br>
in classpcb.cpp<br>
<br>
</p>
</div>
</div>
</div>
</blockquote>
The problem i found on my computer (under kubuntu 8.10, does not happen
under XP) is when displaying filled areas.<br>
This can be noticed with the demo interf_u.brd, at zoom level 1, when
using zone filled using polygons.<br>
when zones are filled using the polygon mode, and mouse cursor on left
side of the board, filled areas are incorrectly displayed.<br>
Of course this does not happen if you are using the filling mode by
segments.<br>
I am thinking at 0.5 zoom level (or for large boards) this problem more
frequently happens<br>
<br>
For me it is clearly an integer&nbsp; overflow in drawing routines.<br>
<br>
I found these problems when i wrote kicad draw functions a long time
ago under W98 (coordinates were handled by 16 bits integers)<br>
and linux with arcs.<br>
This explains what kicad has build-in clipping functions inside draw
functions, and send clipped draw objects to wxDC.<br>
these clipping functions are not pixel accurate, they are intended to
avoid overflow problems.<br>
(They are also useful, as you know, in PostDirtyRectangle)<br>
<br>
Unfortunately polygons used to draw filled areas can have a lot of
segments (20,000 to 40,000)<br>
and clipping before send them to wxDC draw function takes a too long
time to be useable.<br>
<br>
Of course we can use only the filling mode by segment to avoid this
problem (this problem is the reason i wrote this option),<br>
but using polygons is also a good idea (i believe):&nbsp; filled areas are
very clean (when working!).<br>
<br>
Any idea in welcomed.<br>
<br>
<pre class="moz-signature" cols="72">-- 
Jean-Pierre CHARRAS

Ma&icirc;tre de conf&eacute;rences
Directeur d'&eacute;tudes 2ieme ann&eacute;e.
G&eacute;nie Electrique et Informatique Industrielle 2
Institut Universitaire de Technologie 1 de Grenoble
BP 67, 38402 St Martin d'Heres Cedex

Recherche :
GIPSA-LIS - INPG
Rue de la Houille Blanche
38400 Saint Martin d'Heres
</pre>
</body>
</html>
 --------------050409020701030403060008-- 




Follow ups

References