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
237a8539
Commit
237a8539
authored
Nov 23, 2008
by
charras
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Corrections for zones now have a min thickness filled area parameter
parent
3322e33e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
30 additions
and
7 deletions
+30
-7
zones_convert_brd_items_to_polygons.cpp
pcbnew/zones_convert_brd_items_to_polygons.cpp
+30
-7
No files found.
pcbnew/zones_convert_brd_items_to_polygons.cpp
View file @
237a8539
...
@@ -33,7 +33,7 @@ void AddPadWithClearancePolygon( Bool_Engine* aBooleng, D_PAD& aPad, int
...
@@ -33,7 +33,7 @@ void AddPadWithClearancePolygon( Bool_Engine* aBooleng, D_PAD& aPad, int
void
AddThermalReliefPadPolygon
(
Bool_Engine
*
aBooleng
,
void
AddThermalReliefPadPolygon
(
Bool_Engine
*
aBooleng
,
D_PAD
&
aPad
,
D_PAD
&
aPad
,
int
aThermalGap
,
int
aThermalGap
,
int
aCopperThickness
);
int
aCopperThickness
,
int
aMinThicknessValue
);
void
AddRoundedEndsSegmentPolygon
(
Bool_Engine
*
aBooleng
,
void
AddRoundedEndsSegmentPolygon
(
Bool_Engine
*
aBooleng
,
wxPoint
aStart
,
wxPoint
aEnd
,
wxPoint
aStart
,
wxPoint
aEnd
,
int
aWidth
);
int
aWidth
);
...
@@ -216,8 +216,9 @@ void ZONE_CONTAINER::AddClearanceAreasPolygonsToPolysList( BOARD* aPcb )
...
@@ -216,8 +216,9 @@ void ZONE_CONTAINER::AddClearanceAreasPolygonsToPolysList( BOARD* aPcb )
item_boundingbox
.
Inflate
(
m_ThermalReliefGapValue
,
m_ThermalReliefGapValue
);
item_boundingbox
.
Inflate
(
m_ThermalReliefGapValue
,
m_ThermalReliefGapValue
);
if
(
item_boundingbox
.
Intersects
(
zone_boundingbox
)
)
if
(
item_boundingbox
.
Intersects
(
zone_boundingbox
)
)
AddThermalReliefPadPolygon
(
booleng
,
*
pad
,
AddThermalReliefPadPolygon
(
booleng
,
*
pad
,
m_ThermalReliefGapValue
/* + (m_ZoneMinThickness/2)*/
,
m_ThermalReliefGapValue
,
m_ThermalReliefCopperBridgeValue
/*- m_ZoneMinThickness*/
);
m_ThermalReliefCopperBridgeValue
,
m_ZoneMinThickness
);
break
;
break
;
case
PAD_IN_ZONE
:
case
PAD_IN_ZONE
:
...
@@ -423,7 +424,10 @@ void AddPadWithClearancePolygon( Bool_Engine* aBooleng,
...
@@ -423,7 +424,10 @@ void AddPadWithClearancePolygon( Bool_Engine* aBooleng,
/** function AddThermalReliefPadPolygon
/** function AddThermalReliefPadPolygon
* Add holes around a pad to create a thermal relief
* Add holes around a pad to create a thermal relief
* copper tickness is min (dx/2, aCopperWitdh) or min (dy/2, aCopperWitdh)
* copper tickness is min (dx/2, aCopperWitdh) or min (dy/2, aCopperWitdh)
* gap is aThermalGap
* @param aBooleng = current Bool_Engine
* @param aPad = the current pad used to create the thermal shape
* @param aThermalGap = gap in thermal shape
* @param aMinThicknessValue = min copper thickness allowed
*/
*/
/* thermal reliefs are created as 4 polygons.
/* thermal reliefs are created as 4 polygons.
...
@@ -447,11 +451,14 @@ void AddPadWithClearancePolygon( Bool_Engine* aBooleng,
...
@@ -447,11 +451,14 @@ void AddPadWithClearancePolygon( Bool_Engine* aBooleng,
* So to avoid this, the workaround is do not use holes outlines that include
* So to avoid this, the workaround is do not use holes outlines that include
* angles less than 90 deg between 2 consecutive lines
* angles less than 90 deg between 2 consecutive lines
* this is made in round and oblong thermal reliefs
* this is made in round and oblong thermal reliefs
*
* Note: polygons are drawm using outlines witk a thickness = aMinThicknessValue
* so shapes must keep in account this outline thickness
*/
*/
void
AddThermalReliefPadPolygon
(
Bool_Engine
*
aBooleng
,
void
AddThermalReliefPadPolygon
(
Bool_Engine
*
aBooleng
,
D_PAD
&
aPad
,
D_PAD
&
aPad
,
int
aThermalGap
,
int
aThermalGap
,
int
aCopperThickness
)
int
aCopperThickness
,
int
aMinThicknessValue
)
{
{
wxPoint
corner
,
corner_end
;
wxPoint
corner
,
corner_end
;
wxPoint
PadShapePos
=
aPad
.
ReturnShapePos
();
/* Note: for pad having a shape offset,
wxPoint
PadShapePos
=
aPad
.
ReturnShapePos
();
/* Note: for pad having a shape offset,
...
@@ -463,12 +470,28 @@ void AddThermalReliefPadPolygon( Bool_Engine* aBooleng,
...
@@ -463,12 +470,28 @@ void AddThermalReliefPadPolygon( Bool_Engine* aBooleng,
int
delta
=
3600
/
s_CircleToSegmentsCount
;
// rot angle in 0.1 degree
int
delta
=
3600
/
s_CircleToSegmentsCount
;
// rot angle in 0.1 degree
/* Keep in account the polygon outline thickness
* aThermalGap must be increased by aMinThicknessValue/2 because drawing external outline
* with a thickness of aMinThicknessValue will reduce gap by aMinThicknessValue/2
*/
aThermalGap
+=
aMinThicknessValue
/
2
;
/* Keep in account the polygon outline thickness
* copper_tickness must be decreased by aMinThicknessValue because drawing outlines
* with a thickness of aMinThicknessValue will increase thickness by aMinThicknessValue
*/
aCopperThickness
-=
aMinThicknessValue
;
if
(
aCopperThickness
<
0
)
if
(
aCopperThickness
<
0
)
aCopperThickness
=
0
;
aCopperThickness
=
0
;
copper_tickness
.
x
=
min
(
dx
,
aCopperThickness
);
copper_tickness
.
x
=
min
(
dx
,
aCopperThickness
);
copper_tickness
.
y
=
min
(
dy
,
aCopperThickness
);
copper_tickness
.
y
=
min
(
dy
,
aCopperThickness
);
if
(
copper_tickness
.
x
<
aMinThicknessValue
)
copper_tickness
.
x
=
0
;
if
(
copper_tickness
.
y
<
aMinThicknessValue
)
copper_tickness
.
y
=
0
;
switch
(
aPad
.
m_PadShape
)
switch
(
aPad
.
m_PadShape
)
{
{
case
PAD_CIRCLE
:
// Add 4 similar holes
case
PAD_CIRCLE
:
// Add 4 similar holes
...
@@ -531,8 +554,8 @@ void AddThermalReliefPadPolygon( Bool_Engine* aBooleng,
...
@@ -531,8 +554,8 @@ void AddThermalReliefPadPolygon( Bool_Engine* aBooleng,
// bad filled polygon on some cases, when pads are on a same vertical line
// bad filled polygon on some cases, when pads are on a same vertical line
// this seems a bug in kbool polygon (exists in 1.9 kbool version)
// this seems a bug in kbool polygon (exists in 1.9 kbool version)
// angle = 450 (45.0 degrees orientation) seems work fine.
// angle = 450 (45.0 degrees orientation) seems work fine.
// angle = 0 with thermal shapes without angle < 90 deg
seems works fine also
// angle = 0 with thermal shapes without angle < 90 deg
has problems in rare circumstances
angle
=
0
;
angle
=
45
0
;
int
angle_pad
=
aPad
.
m_Orient
;
// Pad orientation
int
angle_pad
=
aPad
.
m_Orient
;
// Pad orientation
for
(
unsigned
ihole
=
0
;
ihole
<
4
;
ihole
++
)
for
(
unsigned
ihole
=
0
;
ihole
<
4
;
ihole
++
)
{
{
...
...
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