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
045ba78d
Commit
045ba78d
authored
May 12, 2011
by
jean-pierre charras
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Pcbnew: fix RDC error, for DRC between a an OVAL pad and an other pad.
Minor other fixes.
parent
4fd912c3
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
39 additions
and
25 deletions
+39
-25
collectors.cpp
pcbnew/collectors.cpp
+6
-0
collectors.h
pcbnew/collectors.h
+6
-1
controle.cpp
pcbnew/controle.cpp
+4
-0
drc_clearance_test_functions.cpp
pcbnew/drc_clearance_test_functions.cpp
+22
-23
zones_by_polygon_fill_functions.cpp
pcbnew/zones_by_polygon_fill_functions.cpp
+1
-1
No files found.
pcbnew/collectors.cpp
View file @
045ba78d
...
@@ -119,6 +119,12 @@ const KICAD_T GENERAL_COLLECTOR::Tracks[] = {
...
@@ -119,6 +119,12 @@ const KICAD_T GENERAL_COLLECTOR::Tracks[] = {
EOT
EOT
};
};
const
KICAD_T
GENERAL_COLLECTOR
::
Zones
[]
=
{
TYPE_ZONE_CONTAINER
,
EOT
};
/**
/**
* Function Inspect
* Function Inspect
...
...
pcbnew/collectors.h
View file @
045ba78d
...
@@ -187,7 +187,7 @@ public:
...
@@ -187,7 +187,7 @@ public:
* Philosophy: this class knows nothing of the context in which a BOARD is used
* Philosophy: this class knows nothing of the context in which a BOARD is used
* and that means it knows nothing about which layers are visible or current,
* and that means it knows nothing about which layers are visible or current,
* but can handle those concerns by the SetPreferredLayer() function and the
* but can handle those concerns by the SetPreferredLayer() function and the
* SetLayerMask() fuction.
* SetLayerMask() fu
n
ction.
*/
*/
class
GENERAL_COLLECTOR
:
public
COLLECTOR
class
GENERAL_COLLECTOR
:
public
COLLECTOR
{
{
...
@@ -227,6 +227,11 @@ public:
...
@@ -227,6 +227,11 @@ public:
*/
*/
static
const
KICAD_T
AllButZones
[];
static
const
KICAD_T
AllButZones
[];
/**
* A scan list for zones outlines only
*/
static
const
KICAD_T
Zones
[];
/**
/**
* A scan list for all primary board items, omitting items which are subordinate to
* A scan list for all primary board items, omitting items which are subordinate to
...
...
pcbnew/controle.cpp
View file @
045ba78d
...
@@ -107,6 +107,10 @@ BOARD_ITEM* PCB_BASE_FRAME::PcbGeneralLocateAndDisplay( int aHotKeyCode )
...
@@ -107,6 +107,10 @@ BOARD_ITEM* PCB_BASE_FRAME::PcbGeneralLocateAndDisplay( int aHotKeyCode )
scanList
=
GENERAL_COLLECTOR
::
ModuleItems
;
scanList
=
GENERAL_COLLECTOR
::
ModuleItems
;
break
;
break
;
case
ID_PCB_ZONES_BUTT
:
scanList
=
GENERAL_COLLECTOR
::
Zones
;
break
;
default
:
default
:
scanList
=
DisplayOpt
.
DisplayZonesMode
==
0
?
scanList
=
DisplayOpt
.
DisplayZonesMode
==
0
?
GENERAL_COLLECTOR
::
AllBoardItems
:
GENERAL_COLLECTOR
::
AllBoardItems
:
...
...
pcbnew/drc_clearance_test_functions.cpp
View file @
045ba78d
...
@@ -141,19 +141,6 @@ bool trapezoid2pointDRC( wxPoint aTref[4], wxPoint aPcompare, int aDist )
...
@@ -141,19 +141,6 @@ bool trapezoid2pointDRC( wxPoint aTref[4], wxPoint aPcompare, int aDist )
return
true
;
return
true
;
}
}
// Rotate a vector by an angle
wxPoint
rotate
(
wxPoint
p
,
int
angle
)
{
wxPoint
n
;
double
theta
=
M_PI
*
(
double
)
angle
/
1800.0
;
n
.
x
=
wxRound
(
(
double
)
p
.
x
*
cos
(
theta
)
-
(
double
)
p
.
y
*
sin
(
theta
)
);
n
.
y
=
wxRound
(
p
.
x
*
sin
(
theta
)
+
p
.
y
*
cos
(
theta
)
);
return
n
;
}
/***********************************************************************/
/***********************************************************************/
bool
DRC
::
doTrackDrc
(
TRACK
*
aRefSeg
,
TRACK
*
aStart
,
bool
testPads
)
bool
DRC
::
doTrackDrc
(
TRACK
*
aRefSeg
,
TRACK
*
aStart
,
bool
testPads
)
/***********************************************************************/
/***********************************************************************/
...
@@ -621,7 +608,7 @@ bool DRC::checkClearancePadToPad( D_PAD* aRefPad, D_PAD* aPad )
...
@@ -621,7 +608,7 @@ bool DRC::checkClearancePadToPad( D_PAD* aRefPad, D_PAD* aPad )
case
PAD_CIRCLE
:
case
PAD_CIRCLE
:
/* One can use checkClearanceSegmToPad to test clearance
/* One can use checkClearanceSegmToPad to test clearance
* aRefPad is like a track segment with a null leng
ht
and a witdth = m_Size.x
* aRefPad is like a track segment with a null leng
th
and a witdth = m_Size.x
*/
*/
m_segmLength
=
0
;
m_segmLength
=
0
;
m_segmAngle
=
0
;
m_segmAngle
=
0
;
...
@@ -725,14 +712,19 @@ bool DRC::checkClearancePadToPad( D_PAD* aRefPad, D_PAD* aPad )
...
@@ -725,14 +712,19 @@ bool DRC::checkClearancePadToPad( D_PAD* aRefPad, D_PAD* aPad )
wxPoint
segstart
;
wxPoint
segstart
;
segstart
.
x
=
-
m_segmLength
/
2
;
// Start point coordinate of the horizontal equivalent segment
segstart
.
x
=
-
m_segmLength
/
2
;
// Start point coordinate of the horizontal equivalent segment
RotatePoint
(
&
segstart
,
m_segmAngle
);
// True start point coordinate of the equivalent segment
RotatePoint
(
&
segstart
,
m_segmAngle
);
// actual start point coordinate of the equivalent segment
// Calculate segment end position relative to the segment origin
m_segmEnd
.
x
=
-
2
*
segstart
.
x
;
m_segmEnd
.
y
=
-
2
*
segstart
.
y
;
// Recalculate the equivalent segment angle in 0,1 degrees
// to prepare a call to checkClearanceSegmToPad()
m_segmAngle
=
ArcTangente
(
m_segmEnd
.
y
,
m_segmEnd
.
x
);
// move pad position relative to the segment origin
// move pad position relative to the segment origin
m_padToTestPos
=
relativePadPos
-
segstart
;
m_padToTestPos
=
relativePadPos
-
segstart
;
// Calculate segment end
// Use segment to pad check to test the second pad:
m_segmEnd
.
x
=
-
2
*
segstart
.
x
;
m_segmEnd
.
y
=
-
2
*
segstart
.
y
;
// end of segment coordinate
diag
=
checkClearanceSegmToPad
(
aPad
,
segm_width
,
dist_min
);
diag
=
checkClearanceSegmToPad
(
aPad
,
segm_width
,
dist_min
);
break
;
break
;
}
}
...
@@ -769,6 +761,7 @@ bool DRC::checkClearancePadToPad( D_PAD* aRefPad, D_PAD* aPad )
...
@@ -769,6 +761,7 @@ bool DRC::checkClearancePadToPad( D_PAD* aRefPad, D_PAD* aPad )
/* test if distance between a segment is > aMinDist
/* test if distance between a segment is > aMinDist
* segment start point is assumed in (0,0) and segment start point in m_segmEnd
* segment start point is assumed in (0,0) and segment start point in m_segmEnd
* and its orientation is m_segmAngle (m_segmAngle must be already initialized)
* and have aSegmentWidth.
* and have aSegmentWidth.
*/
*/
bool
DRC
::
checkClearanceSegmToPad
(
const
D_PAD
*
aPad
,
int
aSegmentWidth
,
int
aMinDist
)
bool
DRC
::
checkClearanceSegmToPad
(
const
D_PAD
*
aPad
,
int
aSegmentWidth
,
int
aMinDist
)
...
@@ -787,7 +780,7 @@ bool DRC::checkClearanceSegmToPad( const D_PAD* aPad, int aSegmentWidth, int aMi
...
@@ -787,7 +780,7 @@ bool DRC::checkClearanceSegmToPad( const D_PAD* aPad, int aSegmentWidth, int aMi
if
(
aPad
->
m_PadShape
==
PAD_TRAPEZOID
)
// The size is bigger, due to m_DeltaSize extra size
if
(
aPad
->
m_PadShape
==
PAD_TRAPEZOID
)
// The size is bigger, due to m_DeltaSize extra size
{
{
padHalfsize
.
x
+=
ABS
(
aPad
->
m_DeltaSize
.
y
)
/
2
;
// Remember: m_DeltaSize.y is the m_Size.x change
padHalfsize
.
x
+=
ABS
(
aPad
->
m_DeltaSize
.
y
)
/
2
;
// Remember: m_DeltaSize.y is the m_Size.x change
padHalfsize
.
y
+=
ABS
(
aPad
->
m_DeltaSize
.
x
)
/
2
;
// Remember: m_DeltaSize.x is the m_Size.
x
change
padHalfsize
.
y
+=
ABS
(
aPad
->
m_DeltaSize
.
x
)
/
2
;
// Remember: m_DeltaSize.x is the m_Size.
y
change
}
}
if
(
aPad
->
m_PadShape
==
PAD_CIRCLE
)
if
(
aPad
->
m_PadShape
==
PAD_CIRCLE
)
...
@@ -843,7 +836,7 @@ bool DRC::checkClearanceSegmToPad( const D_PAD* aPad, int aSegmentWidth, int aMi
...
@@ -843,7 +836,7 @@ bool DRC::checkClearanceSegmToPad( const D_PAD* aPad, int aSegmentWidth, int aMi
}
}
deltay
=
padHalfsize
.
y
-
padHalfsize
.
x
;
deltay
=
padHalfsize
.
y
-
padHalfsize
.
x
;
//
ici: padHalfsize.x = rayon
, delta = dist centre cercles a centre pad
//
here: padHalfsize.x = radius
, delta = dist centre cercles a centre pad
// Test the rectangle area between the two circles
// Test the rectangle area between the two circles
m_xcliplo
=
m_padToTestPos
.
x
-
seuil
-
padHalfsize
.
x
;
m_xcliplo
=
m_padToTestPos
.
x
-
seuil
-
padHalfsize
.
x
;
...
@@ -851,10 +844,12 @@ bool DRC::checkClearanceSegmToPad( const D_PAD* aPad, int aSegmentWidth, int aMi
...
@@ -851,10 +844,12 @@ bool DRC::checkClearanceSegmToPad( const D_PAD* aPad, int aSegmentWidth, int aMi
m_xcliphi
=
m_padToTestPos
.
x
+
seuil
+
padHalfsize
.
x
;
m_xcliphi
=
m_padToTestPos
.
x
+
seuil
+
padHalfsize
.
x
;
m_ycliphi
=
m_padToTestPos
.
y
+
segmHalfWidth
+
deltay
;
m_ycliphi
=
m_padToTestPos
.
y
+
segmHalfWidth
+
deltay
;
if
(
!
checkLine
(
startPoint
,
endPoint
)
)
if
(
!
checkLine
(
startPoint
,
endPoint
)
)
{
return
false
;
return
false
;
}
// test the first circle
// test the first circle
startPoint
.
x
=
m_padToTestPos
.
x
;
// s
egStartPoint.x,segStartPoint.y
= centre of the upper circle of the oval shape
startPoint
.
x
=
m_padToTestPos
.
x
;
// s
tartPoint
= centre of the upper circle of the oval shape
startPoint
.
y
=
m_padToTestPos
.
y
+
deltay
;
startPoint
.
y
=
m_padToTestPos
.
y
+
deltay
;
// Calculate the actual position of the circle, given the pad orientation:
// Calculate the actual position of the circle, given the pad orientation:
...
@@ -863,16 +858,20 @@ bool DRC::checkClearanceSegmToPad( const D_PAD* aPad, int aSegmentWidth, int aMi
...
@@ -863,16 +858,20 @@ bool DRC::checkClearanceSegmToPad( const D_PAD* aPad, int aSegmentWidth, int aMi
// Calculate the actual position of the circle in the new X,Y axis:
// Calculate the actual position of the circle in the new X,Y axis:
RotatePoint
(
&
startPoint
,
m_segmAngle
);
RotatePoint
(
&
startPoint
,
m_segmAngle
);
if
(
!
checkMarginToCircle
(
startPoint
,
padHalfsize
.
x
+
seuil
,
m_segmLength
)
)
if
(
!
checkMarginToCircle
(
startPoint
,
padHalfsize
.
x
+
seuil
,
m_segmLength
)
)
{
return
false
;
return
false
;
}
// test the second circle
// test the second circle
startPoint
.
x
=
m_padToTestPos
.
x
;
// s
egStartPoint.x,segStartPoint.y
= centre of the lower circle of the oval shape
startPoint
.
x
=
m_padToTestPos
.
x
;
// s
tartPoint
= centre of the lower circle of the oval shape
startPoint
.
y
=
m_padToTestPos
.
y
-
deltay
;
startPoint
.
y
=
m_padToTestPos
.
y
-
deltay
;
RotatePoint
(
&
startPoint
,
m_padToTestPos
,
orient
);
RotatePoint
(
&
startPoint
,
m_padToTestPos
,
orient
);
RotatePoint
(
&
startPoint
,
m_segmAngle
);
RotatePoint
(
&
startPoint
,
m_segmAngle
);
if
(
!
checkMarginToCircle
(
startPoint
,
padHalfsize
.
x
+
seuil
,
m_segmLength
)
)
if
(
!
checkMarginToCircle
(
startPoint
,
padHalfsize
.
x
+
seuil
,
m_segmLength
)
)
{
return
false
;
return
false
;
}
break
;
break
;
case
PAD_RECT
:
/* 2 rectangle + 4 1/4 cercles a tester */
case
PAD_RECT
:
/* 2 rectangle + 4 1/4 cercles a tester */
...
@@ -962,7 +961,7 @@ bool DRC::checkMarginToCircle( wxPoint aCentre, int aRadius, int aLength )
...
@@ -962,7 +961,7 @@ bool DRC::checkMarginToCircle( wxPoint aCentre, int aRadius, int aLength )
if
(
abs
(
aCentre
.
y
)
>
aRadius
)
// trivial case
if
(
abs
(
aCentre
.
y
)
>
aRadius
)
// trivial case
return
true
;
return
true
;
// Here, di
d
stance between aCentre and X axis is < aRadius
// Here, distance between aCentre and X axis is < aRadius
if
(
(
aCentre
.
x
>=
-
aRadius
)
&&
(
aCentre
.
x
<=
(
aLength
+
aRadius
)
)
)
if
(
(
aCentre
.
x
>=
-
aRadius
)
&&
(
aCentre
.
x
<=
(
aLength
+
aRadius
)
)
)
{
{
if
(
(
aCentre
.
x
>=
0
)
&&
(
aCentre
.
x
<=
aLength
)
)
if
(
(
aCentre
.
x
>=
0
)
&&
(
aCentre
.
x
<=
aLength
)
)
...
...
pcbnew/zones_by_polygon_fill_functions.cpp
View file @
045ba78d
...
@@ -147,7 +147,7 @@ int PCB_EDIT_FRAME::Fill_All_Zones( bool verbose )
...
@@ -147,7 +147,7 @@ int PCB_EDIT_FRAME::Fill_All_Zones( bool verbose )
// Create a message with a long net name, and build a wxProgressDialog
// Create a message with a long net name, and build a wxProgressDialog
// with a correct size to show this long net name
// with a correct size to show this long net name
msg
.
Printf
(
FORMAT_STRING
,
msg
.
Printf
(
FORMAT_STRING
,
000
,
999
,
wxT
(
"XXXXXXXXXXXXXXXXX"
)
);
000
,
areaCount
,
wxT
(
"XXXXXXXXXXXXXXXXX"
)
);
wxProgressDialog
progressDialog
(
_
(
"Fill All Zones"
),
msg
,
wxProgressDialog
progressDialog
(
_
(
"Fill All Zones"
),
msg
,
areaCount
+
2
,
this
,
areaCount
+
2
,
this
,
wxPD_AUTO_HIDE
|
wxPD_APP_MODAL
|
wxPD_CAN_ABORT
);
wxPD_AUTO_HIDE
|
wxPD_APP_MODAL
|
wxPD_CAN_ABORT
);
...
...
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