Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
K
kicad-source-mirror
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
Elphel
kicad-source-mirror
Commits
e44bf712
Commit
e44bf712
authored
Sep 12, 2008
by
charras
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed a subtle problem in zone filling calculations (see changelog)
parent
b92dc298
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
47 additions
and
24 deletions
+47
-24
change_log.txt
change_log.txt
+10
-0
build_version.h
include/build_version.h
+2
-2
graphpcb.cpp
pcbnew/graphpcb.cpp
+27
-14
zone_filling_algorithm.cpp
pcbnew/zone_filling_algorithm.cpp
+8
-8
No files found.
change_log.txt
View file @
e44bf712
...
@@ -5,6 +5,16 @@ Started 2007-June-11
...
@@ -5,6 +5,16 @@ 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-Sep-14 UPDATE Jean-Pierre Charras <jean-pierre.charras@inpg.fr>
================================================================================
+pcbnew:
Fixed a problem in zone filling algo: due tu differents ways to truncate coordinates
between 2 functions (one round coordinates, and others truncate coordinates),
some start points used to fill zones can be inside the zone outlines,
but placed outside when init matrix parameters when rounding them instead of truncate.
So zone was filled inside and outside when happens.
2008-Sep-9 UPDATE Dick Hollenbeck <dick@softplc.com>
2008-Sep-9 UPDATE Dick Hollenbeck <dick@softplc.com>
================================================================================
================================================================================
+eeschema
+eeschema
...
...
include/build_version.h
View file @
e44bf712
...
@@ -9,7 +9,7 @@ COMMON_GLOBL wxString g_BuildVersion
...
@@ -9,7 +9,7 @@ COMMON_GLOBL wxString g_BuildVersion
# include "config.h"
# include "config.h"
(
wxT
(
KICAD_SVN_VERSION
))
(
wxT
(
KICAD_SVN_VERSION
))
# else
# else
(
wxT
(
"(20080
825
)"
))
/* main program version */
(
wxT
(
"(20080
912
)"
))
/* main program version */
# endif
# endif
#endif
#endif
;
;
...
@@ -20,7 +20,7 @@ COMMON_GLOBL wxString g_BuildAboutVersion
...
@@ -20,7 +20,7 @@ COMMON_GLOBL wxString g_BuildAboutVersion
# include "config.h"
# include "config.h"
(
wxT
(
KICAD_ABOUT_VERSION
))
(
wxT
(
KICAD_ABOUT_VERSION
))
# else
# else
(
wxT
(
"(20080
825-final
)"
))
/* svn date & rev (normally overridden) */
(
wxT
(
"(20080
912
)"
))
/* svn date & rev (normally overridden) */
# endif
# endif
#endif
#endif
;
;
...
...
pcbnew/graphpcb.cpp
View file @
e44bf712
...
@@ -13,24 +13,24 @@
...
@@ -13,24 +13,24 @@
#include "trigo.h"
#include "trigo.h"
#include "cell.h"
#include "cell.h"
/* Exported functions */
int
ToMatrixCoordinate
(
int
aPhysicalCoordinate
);
void
TraceLignePcb
(
int
x0
,
int
y0
,
int
x1
,
int
y1
,
int
layer
,
int
color
);
void
TraceArc
(
int
ux0
,
int
uy0
,
int
ux1
,
int
uy1
,
int
ArcAngle
,
int
lg
,
int
layer
,
int
color
,
int
op_logique
);
/* Routines externes */
/* routines internes */
/* Local functions */
void
TraceLignePcb
(
int
x0
,
int
y0
,
int
x1
,
int
y1
,
int
layer
,
int
color
);
static
void
DrawSegmentQcq
(
int
ux0
,
int
uy0
,
int
ux1
,
int
uy1
,
int
lg
,
int
layer
,
void
DrawSegmentQcq
(
int
ux0
,
int
uy0
,
int
ux1
,
int
uy1
,
int
lg
,
int
layer
,
int
color
,
int
op_logique
);
int
color
,
int
op_logique
);
void
DrawHVSegment
(
int
ux0
,
int
uy0
,
int
ux1
,
int
uy1
,
int
demi_largeur
,
int
layer
,
static
void
DrawHVSegment
(
int
ux0
,
int
uy0
,
int
ux1
,
int
uy1
,
int
demi_largeur
,
int
layer
,
int
color
,
int
op_logique
);
int
color
,
int
op_logique
);
void
TraceFilledCercle
(
BOARD
*
Pcb
,
int
cx
,
int
cy
,
int
rayon
,
int
masque_layer
,
static
void
TraceFilledCercle
(
BOARD
*
Pcb
,
int
cx
,
int
cy
,
int
rayon
,
int
masque_layer
,
int
color
,
int
op_logique
);
int
color
,
int
op_logique
);
void
TraceCercle
(
int
ux0
,
int
uy0
,
int
ux1
,
int
uy1
,
int
lg
,
int
layer
,
static
void
TraceCercle
(
int
ux0
,
int
uy0
,
int
ux1
,
int
uy1
,
int
lg
,
int
layer
,
int
color
,
int
op_logique
);
int
color
,
int
op_logique
);
void
TraceArc
(
int
ux0
,
int
uy0
,
int
ux1
,
int
uy1
,
int
ArcAngle
,
int
lg
,
int
layer
,
int
color
,
int
op_logique
);
/* Macro d'appel de mise a jour de cellules */
/* Macro d'appel de mise a jour de cellules */
#define OP_CELL( layer, dy, dx ) { if( layer < 0 ) \
#define OP_CELL( layer, dy, dx ) { if( layer < 0 ) \
{ \
{ \
...
@@ -46,6 +46,15 @@ void TraceArc( int ux0, int uy0, int ux1, int uy1, int ArcAngle, int lg, int
...
@@ -46,6 +46,15 @@ void TraceArc( int ux0, int uy0, int ux1, int uy1, int ArcAngle, int lg, int
WriteCell( dy, dx, TOP, color );\
WriteCell( dy, dx, TOP, color );\
} }
} }
int
ToMatrixCoordinate
(
int
aPhysicalCoordinate
)
/** Function ToMatrixCoordinate
* compute the coordinate in the routing matrix from the real (board) value
* @param aPhysicalCoordinate = value to convert
* @return the coordinate relative to the matrix
*/
{
return
aPhysicalCoordinate
/
g_GridRoutingSize
;
}
/******************************************************************************/
/******************************************************************************/
void
Place_1_Pad_Board
(
BOARD
*
Pcb
,
D_PAD
*
pt_pad
,
int
color
,
int
marge
,
int
op_logique
)
void
Place_1_Pad_Board
(
BOARD
*
Pcb
,
D_PAD
*
pt_pad
,
int
color
,
int
marge
,
int
op_logique
)
...
@@ -349,7 +358,8 @@ void TraceLignePcb( int x0, int y0, int x1, int y1, int layer, int color, int op
...
@@ -349,7 +358,8 @@ void TraceLignePcb( int x0, int y0, int x1, int y1, int layer, int color, int op
{
{
if
(
y1
<
y0
)
if
(
y1
<
y0
)
EXCHG
(
y0
,
y1
);
EXCHG
(
y0
,
y1
);
dy
=
y0
/
g_GridRoutingSize
;
lim
=
y1
/
g_GridRoutingSize
;
dy
=
y0
/
g_GridRoutingSize
;
lim
=
y1
/
g_GridRoutingSize
;
dx
=
x0
/
g_GridRoutingSize
;
dx
=
x0
/
g_GridRoutingSize
;
/* Clipping aux limites du board */
/* Clipping aux limites du board */
if
(
(
dx
<
0
)
||
(
dx
>=
Ncols
)
)
if
(
(
dx
<
0
)
||
(
dx
>=
Ncols
)
)
...
@@ -370,7 +380,8 @@ void TraceLignePcb( int x0, int y0, int x1, int y1, int layer, int color, int op
...
@@ -370,7 +380,8 @@ void TraceLignePcb( int x0, int y0, int x1, int y1, int layer, int color, int op
{
{
if
(
x1
<
x0
)
if
(
x1
<
x0
)
EXCHG
(
x0
,
x1
);
EXCHG
(
x0
,
x1
);
dx
=
x0
/
g_GridRoutingSize
;
lim
=
x1
/
g_GridRoutingSize
;
dx
=
x0
/
g_GridRoutingSize
;
lim
=
x1
/
g_GridRoutingSize
;
dy
=
y0
/
g_GridRoutingSize
;
dy
=
y0
/
g_GridRoutingSize
;
/* Clipping aux limites du board */
/* Clipping aux limites du board */
if
(
(
dy
<
0
)
||
(
dy
>=
Nrows
)
)
if
(
(
dy
<
0
)
||
(
dy
>=
Nrows
)
)
...
@@ -395,7 +406,8 @@ void TraceLignePcb( int x0, int y0, int x1, int y1, int layer, int color, int op
...
@@ -395,7 +406,8 @@ void TraceLignePcb( int x0, int y0, int x1, int y1, int layer, int color, int op
EXCHG
(
x1
,
x0
);
EXCHG
(
y1
,
y0
);
EXCHG
(
x1
,
x0
);
EXCHG
(
y1
,
y0
);
}
}
dx
=
x0
/
g_GridRoutingSize
;
lim
=
x1
/
g_GridRoutingSize
;
dx
=
x0
/
g_GridRoutingSize
;
lim
=
x1
/
g_GridRoutingSize
;
dy
=
y0
/
g_GridRoutingSize
;
dy
=
y0
/
g_GridRoutingSize
;
inc
=
1
;
if
(
y1
<
y0
)
inc
=
1
;
if
(
y1
<
y0
)
inc
=
-
1
;
inc
=
-
1
;
...
@@ -421,7 +433,8 @@ void TraceLignePcb( int x0, int y0, int x1, int y1, int layer, int color, int op
...
@@ -421,7 +433,8 @@ void TraceLignePcb( int x0, int y0, int x1, int y1, int layer, int color, int op
EXCHG
(
x1
,
x0
);
EXCHG
(
y1
,
y0
);
EXCHG
(
x1
,
x0
);
EXCHG
(
y1
,
y0
);
}
}
dy
=
y0
/
g_GridRoutingSize
;
lim
=
y1
/
g_GridRoutingSize
;
dy
=
y0
/
g_GridRoutingSize
;
lim
=
y1
/
g_GridRoutingSize
;
dx
=
x0
/
g_GridRoutingSize
;
dx
=
x0
/
g_GridRoutingSize
;
inc
=
1
;
if
(
x1
<
x0
)
inc
=
1
;
if
(
x1
<
x0
)
inc
=
-
1
;
inc
=
-
1
;
...
...
pcbnew/zone_filling_algorithm.cpp
View file @
e44bf712
...
@@ -145,9 +145,9 @@ int ZONE_CONTAINER::Fill_Zone( WinEDA_PcbFrame* frame, wxDC* DC, bool verbose )
...
@@ -145,9 +145,9 @@ int ZONE_CONTAINER::Fill_Zone( WinEDA_PcbFrame* frame, wxDC* DC, bool verbose )
if
(
m_Poly
->
TestPointInside
(
pos
.
x
,
pos
.
y
)
)
if
(
m_Poly
->
TestPointInside
(
pos
.
x
,
pos
.
y
)
)
{
{
pos
-=
Pcb
->
m_BoundaryBox
.
m_Pos
;
pos
-=
Pcb
->
m_BoundaryBox
.
m_Pos
;
ZoneStartFill
.
x
=
(
pos
.
x
+
(
g_GridRoutingSize
/
2
)
)
/
g_GridRoutingSize
;
ZoneStartFill
.
x
=
pos
.
x
/
g_GridRoutingSize
;
ZoneStartFill
.
y
=
(
pos
.
y
+
(
g_GridRoutingSize
/
2
)
)
/
g_GridRoutingSize
;
ZoneStartFill
.
y
=
pos
.
y
/
g_GridRoutingSize
;
BoardCell
cell
=
GetCell
(
ZoneStartFill
.
y
,
ZoneStartFill
.
x
,
BOTTOM
);
BoardCell
cell
=
GetCell
(
ZoneStartFill
.
y
,
ZoneStartFill
.
x
,
BOTTOM
);
if
(
(
cell
&
CELL_is_EDGE
)
==
0
)
if
(
(
cell
&
CELL_is_EDGE
)
==
0
)
{
{
...
@@ -167,9 +167,9 @@ int ZONE_CONTAINER::Fill_Zone( WinEDA_PcbFrame* frame, wxDC* DC, bool verbose )
...
@@ -167,9 +167,9 @@ int ZONE_CONTAINER::Fill_Zone( WinEDA_PcbFrame* frame, wxDC* DC, bool verbose )
if
(
m_Poly
->
TestPointInside
(
pos
.
x
,
pos
.
y
)
)
if
(
m_Poly
->
TestPointInside
(
pos
.
x
,
pos
.
y
)
)
{
{
pos
-=
Pcb
->
m_BoundaryBox
.
m_Pos
;
pos
-=
Pcb
->
m_BoundaryBox
.
m_Pos
;
ZoneStartFill
.
x
=
(
pos
.
x
+
(
g_GridRoutingSize
/
2
)
)
/
g_GridRoutingSize
;
ZoneStartFill
.
x
=
pos
.
x
/
g_GridRoutingSize
;
ZoneStartFill
.
y
=
(
pos
.
y
+
(
g_GridRoutingSize
/
2
)
)
/
g_GridRoutingSize
;
ZoneStartFill
.
y
=
pos
.
y
/
g_GridRoutingSize
;
BoardCell
cell
=
GetCell
(
ZoneStartFill
.
y
,
ZoneStartFill
.
x
,
BOTTOM
);
BoardCell
cell
=
GetCell
(
ZoneStartFill
.
y
,
ZoneStartFill
.
x
,
BOTTOM
);
if
(
(
cell
&
CELL_is_EDGE
)
==
0
)
if
(
(
cell
&
CELL_is_EDGE
)
==
0
)
{
{
...
@@ -181,9 +181,9 @@ int ZONE_CONTAINER::Fill_Zone( WinEDA_PcbFrame* frame, wxDC* DC, bool verbose )
...
@@ -181,9 +181,9 @@ int ZONE_CONTAINER::Fill_Zone( WinEDA_PcbFrame* frame, wxDC* DC, bool verbose )
if
(
m_Poly
->
TestPointInside
(
pos
.
x
,
pos
.
y
)
)
if
(
m_Poly
->
TestPointInside
(
pos
.
x
,
pos
.
y
)
)
{
{
pos
-=
Pcb
->
m_BoundaryBox
.
m_Pos
;
pos
-=
Pcb
->
m_BoundaryBox
.
m_Pos
;
ZoneStartFill
.
x
=
(
pos
.
x
+
(
g_GridRoutingSize
/
2
)
)
/
g_GridRoutingSize
;
ZoneStartFill
.
x
=
pos
.
x
/
g_GridRoutingSize
;
ZoneStartFill
.
y
=
(
pos
.
y
+
(
g_GridRoutingSize
/
2
)
)
/
g_GridRoutingSize
;
ZoneStartFill
.
y
=
pos
.
y
/
g_GridRoutingSize
;
BoardCell
cell
=
GetCell
(
ZoneStartFill
.
y
,
ZoneStartFill
.
x
,
BOTTOM
);
BoardCell
cell
=
GetCell
(
ZoneStartFill
.
y
,
ZoneStartFill
.
x
,
BOTTOM
);
if
(
(
cell
&
CELL_is_EDGE
)
==
0
)
if
(
(
cell
&
CELL_is_EDGE
)
==
0
)
{
{
...
@@ -277,9 +277,9 @@ int ZONE_CONTAINER::Fill_Zone( WinEDA_PcbFrame* frame, wxDC* DC, bool verbose )
...
@@ -277,9 +277,9 @@ int ZONE_CONTAINER::Fill_Zone( WinEDA_PcbFrame* frame, wxDC* DC, bool verbose )
if
(
m_Poly
->
TestPointInside
(
pos
.
x
,
pos
.
y
)
)
if
(
m_Poly
->
TestPointInside
(
pos
.
x
,
pos
.
y
)
)
{
{
pos
-=
Pcb
->
m_BoundaryBox
.
m_Pos
;
pos
-=
Pcb
->
m_BoundaryBox
.
m_Pos
;
ZoneStartFill
.
x
=
(
pos
.
x
+
(
g_GridRoutingSize
/
2
)
)
/
g_GridRoutingSize
;
ZoneStartFill
.
x
=
pos
.
x
/
g_GridRoutingSize
;
ZoneStartFill
.
y
=
(
pos
.
y
+
(
g_GridRoutingSize
/
2
)
)
/
g_GridRoutingSize
;
ZoneStartFill
.
y
=
pos
.
y
/
g_GridRoutingSize
;
BoardCell
cell
=
GetCell
(
ZoneStartFill
.
y
,
ZoneStartFill
.
x
,
BOTTOM
);
BoardCell
cell
=
GetCell
(
ZoneStartFill
.
y
,
ZoneStartFill
.
x
,
BOTTOM
);
if
(
(
cell
&
CELL_is_EDGE
)
==
0
)
if
(
(
cell
&
CELL_is_EDGE
)
==
0
)
OrCell
(
ZoneStartFill
.
y
,
ZoneStartFill
.
x
,
BOTTOM
,
CELL_is_ZONE
);
OrCell
(
ZoneStartFill
.
y
,
ZoneStartFill
.
x
,
BOTTOM
,
CELL_is_ZONE
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment