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
e6b2f392
Commit
e6b2f392
authored
Dec 08, 2010
by
jean-pierre charras
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix minor issue relative to thermal shapes: better shape of thermal having removed stubs.
parent
3fed7b9d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
44 additions
and
33 deletions
+44
-33
zones_convert_to_polygons_aux_functions.cpp
pcbnew/zones_convert_to_polygons_aux_functions.cpp
+44
-33
No files found.
pcbnew/zones_convert_to_polygons_aux_functions.cpp
View file @
e6b2f392
...
@@ -47,11 +47,11 @@ void BuildUnconnectedThermalStubsPolygonList( std::vector<CPolyPt>& aCornerBuffe
...
@@ -47,11 +47,11 @@ void BuildUnconnectedThermalStubsPolygonList( std::vector<CPolyPt>& aCornerBuffe
biggest_clearance
=
MAX
(
biggest_clearance
,
zone_clearance
);
biggest_clearance
=
MAX
(
biggest_clearance
,
zone_clearance
);
zone_boundingbox
.
Inflate
(
biggest_clearance
);
zone_boundingbox
.
Inflate
(
biggest_clearance
);
// Calculate thermal bridge half width
int
iDTRC
=
aZone
->
m_ThermalReliefCopperBridgeValue
/
2
;
// half size of the pen used to draw/plot zones outlines
// half size of the pen used to draw/plot zones outlines
int
pen_radius
=
aZone
->
m_ZoneMinThickness
/
2
;
int
pen_radius
=
aZone
->
m_ZoneMinThickness
/
2
;
// Calculate thermal bridge half width
int
thermbridgeWidth
=
aZone
->
m_ThermalReliefCopperBridgeValue
/
2
;
for
(
MODULE
*
module
=
aPcb
->
m_Modules
;
module
;
module
=
module
->
Next
()
)
for
(
MODULE
*
module
=
aPcb
->
m_Modules
;
module
;
module
=
module
->
Next
()
)
{
{
for
(
D_PAD
*
pad
=
module
->
m_Pads
;
pad
!=
NULL
;
pad
=
pad
->
Next
()
)
for
(
D_PAD
*
pad
=
module
->
m_Pads
;
pad
!=
NULL
;
pad
=
pad
->
Next
()
)
...
@@ -67,27 +67,38 @@ void BuildUnconnectedThermalStubsPolygonList( std::vector<CPolyPt>& aCornerBuffe
...
@@ -67,27 +67,38 @@ void BuildUnconnectedThermalStubsPolygonList( std::vector<CPolyPt>& aCornerBuffe
if
(
!
(
item_boundingbox
.
Intersects
(
zone_boundingbox
)
)
)
if
(
!
(
item_boundingbox
.
Intersects
(
zone_boundingbox
)
)
)
continue
;
continue
;
// test point
// Thermal bridges are like a segment from a starting point inside the pad
int
dx
=
(
pad
->
m_Size
.
x
/
2
)
+
aZone
->
m_ThermalReliefGapValue
;
// to an ending point outside the pad
int
dy
=
(
pad
->
m_Size
.
y
/
2
)
+
aZone
->
m_ThermalReliefGapValue
;
wxPoint
startpoint
,
endpoint
;
endpoint
.
x
=
(
pad
->
m_Size
.
x
/
2
)
+
aZone
->
m_ThermalReliefGapValue
;
endpoint
.
y
=
(
pad
->
m_Size
.
y
/
2
)
+
aZone
->
m_ThermalReliefGapValue
;
int
copperThickness
=
aZone
->
m_ThermalReliefCopperBridgeValue
-
aZone
->
m_ZoneMinThickness
;
if
(
copperThickness
<
0
)
copperThickness
=
0
;
startpoint
.
x
=
min
(
pad
->
m_Size
.
x
,
copperThickness
);
startpoint
.
y
=
min
(
pad
->
m_Size
.
y
,
copperThickness
);
startpoint
.
x
/=
2
;
startpoint
.
y
/=
2
;
// This is CIRCLE pad tweak (for circle pads the thermal stubs are at 45 deg)
// This is CIRCLE pad tweak (for circle pads the thermal stubs are at 45 deg)
int
fAngle
=
pad
->
m_Orient
;
int
fAngle
=
pad
->
m_Orient
;
if
(
pad
->
m_PadShape
==
PAD_CIRCLE
)
if
(
pad
->
m_PadShape
==
PAD_CIRCLE
)
{
{
dx
=
(
int
)
(
d
x
*
aArcCorrection
);
endpoint
.
x
=
(
int
)
(
endpoint
.
x
*
aArcCorrection
);
dy
=
d
x
;
endpoint
.
y
=
endpoint
.
x
;
fAngle
=
aRoundPadThermalRotation
;
fAngle
=
aRoundPadThermalRotation
;
}
}
// contour line width has to be taken into calculation to avoid "thermal stub bleed"
// contour line width has to be taken into calculation to avoid "thermal stub bleed"
d
x
+=
pen_radius
;
endpoint
.
x
+=
pen_radius
;
d
y
+=
pen_radius
;
endpoint
.
y
+=
pen_radius
;
// compute north, south, west and east points for zone connection.
// compute north, south, west and east points for zone connection.
ptTest
[
0
]
=
wxPoint
(
0
,
dy
);
ptTest
[
0
]
=
wxPoint
(
0
,
endpoint
.
y
);
// lower point
ptTest
[
1
]
=
wxPoint
(
0
,
-
dy
);
ptTest
[
1
]
=
wxPoint
(
0
,
-
endpoint
.
y
);
// upper point
ptTest
[
2
]
=
wxPoint
(
dx
,
0
);
ptTest
[
2
]
=
wxPoint
(
endpoint
.
x
,
0
);
// right point
ptTest
[
3
]
=
wxPoint
(
-
dx
,
0
);
ptTest
[
3
]
=
wxPoint
(
-
endpoint
.
x
,
0
);
// left point
// Test all sides
// Test all sides
for
(
int
i
=
0
;
i
<
4
;
i
++
)
for
(
int
i
=
0
;
i
<
4
;
i
++
)
...
@@ -105,32 +116,32 @@ void BuildUnconnectedThermalStubsPolygonList( std::vector<CPolyPt>& aCornerBuffe
...
@@ -105,32 +116,32 @@ void BuildUnconnectedThermalStubsPolygonList( std::vector<CPolyPt>& aCornerBuffe
// polygons are rectangles with width of copper bridge value
// polygons are rectangles with width of copper bridge value
switch
(
i
)
switch
(
i
)
{
{
case
0
:
case
0
:
// lower stub
corners_buffer
.
push_back
(
wxPoint
(
-
iDTRC
,
d
y
)
);
corners_buffer
.
push_back
(
wxPoint
(
-
thermbridgeWidth
,
endpoint
.
y
)
);
corners_buffer
.
push_back
(
wxPoint
(
+
iDTRC
,
d
y
)
);
corners_buffer
.
push_back
(
wxPoint
(
+
thermbridgeWidth
,
endpoint
.
y
)
);
corners_buffer
.
push_back
(
wxPoint
(
+
iDTRC
,
iDTRC
)
);
corners_buffer
.
push_back
(
wxPoint
(
+
thermbridgeWidth
,
startpoint
.
y
)
);
corners_buffer
.
push_back
(
wxPoint
(
-
iDTRC
,
iDTRC
)
);
corners_buffer
.
push_back
(
wxPoint
(
-
thermbridgeWidth
,
startpoint
.
y
)
);
break
;
break
;
case
1
:
case
1
:
// upper stub
corners_buffer
.
push_back
(
wxPoint
(
-
iDTRC
,
-
d
y
)
);
corners_buffer
.
push_back
(
wxPoint
(
-
thermbridgeWidth
,
-
endpoint
.
y
)
);
corners_buffer
.
push_back
(
wxPoint
(
+
iDTRC
,
-
d
y
)
);
corners_buffer
.
push_back
(
wxPoint
(
+
thermbridgeWidth
,
-
endpoint
.
y
)
);
corners_buffer
.
push_back
(
wxPoint
(
+
iDTRC
,
-
iDTRC
)
);
corners_buffer
.
push_back
(
wxPoint
(
+
thermbridgeWidth
,
-
startpoint
.
y
)
);
corners_buffer
.
push_back
(
wxPoint
(
-
iDTRC
,
-
iDTRC
)
);
corners_buffer
.
push_back
(
wxPoint
(
-
thermbridgeWidth
,
-
startpoint
.
y
)
);
break
;
break
;
case
2
:
case
2
:
// right stub
corners_buffer
.
push_back
(
wxPoint
(
dx
,
-
iDTRC
)
);
corners_buffer
.
push_back
(
wxPoint
(
endpoint
.
x
,
-
thermbridgeWidth
)
);
corners_buffer
.
push_back
(
wxPoint
(
dx
,
iDTRC
)
);
corners_buffer
.
push_back
(
wxPoint
(
endpoint
.
x
,
thermbridgeWidth
)
);
corners_buffer
.
push_back
(
wxPoint
(
+
iDTRC
,
iDTRC
)
);
corners_buffer
.
push_back
(
wxPoint
(
+
startpoint
.
x
,
thermbridgeWidth
)
);
corners_buffer
.
push_back
(
wxPoint
(
+
iDTRC
,
-
iDTRC
)
);
corners_buffer
.
push_back
(
wxPoint
(
+
startpoint
.
x
,
-
thermbridgeWidth
)
);
break
;
break
;
case
3
:
case
3
:
// left stub
corners_buffer
.
push_back
(
wxPoint
(
-
dx
,
-
iDTRC
)
);
corners_buffer
.
push_back
(
wxPoint
(
-
endpoint
.
x
,
-
thermbridgeWidth
)
);
corners_buffer
.
push_back
(
wxPoint
(
-
dx
,
iDTRC
)
);
corners_buffer
.
push_back
(
wxPoint
(
-
endpoint
.
x
,
thermbridgeWidth
)
);
corners_buffer
.
push_back
(
wxPoint
(
-
iDTRC
,
iDTRC
)
);
corners_buffer
.
push_back
(
wxPoint
(
-
startpoint
.
x
,
thermbridgeWidth
)
);
corners_buffer
.
push_back
(
wxPoint
(
-
iDTRC
,
-
iDTRC
)
);
corners_buffer
.
push_back
(
wxPoint
(
-
startpoint
.
x
,
-
thermbridgeWidth
)
);
break
;
break
;
}
}
...
...
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