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
4c920f52
Commit
4c920f52
authored
Mar 19, 2009
by
charras
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
finishing worl on trapezoidal pads in zones
parent
df3939f8
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
34 additions
and
26 deletions
+34
-26
zones_convert_brd_items_to_polygons.cpp
pcbnew/zones_convert_brd_items_to_polygons.cpp
+34
-26
No files found.
pcbnew/zones_convert_brd_items_to_polygons.cpp
View file @
4c920f52
...
...
@@ -151,7 +151,7 @@ void ZONE_CONTAINER::AddClearanceAreasPolygonsToPolysList( BOARD* aPcb )
CopyPolygonsFromBoolengineToFilledPolysList
(
booleng
);
delete
booleng
;
if
(
m_FilledPolysList
.
size
()
==
0
)
if
(
m_FilledPolysList
.
size
()
==
0
)
return
;
/* Second, Add the main (corrected) polygon (i.e. the filled area using only one outline)
...
...
@@ -202,7 +202,10 @@ void ZONE_CONTAINER::AddClearanceAreasPolygonsToPolysList( BOARD* aPcb )
continue
;
}
if
(
(
m_PadOption
==
PAD_NOT_IN_ZONE
)
||
(
GetNet
()
==
0
)
||
pad
->
m_PadShape
==
PAD_TRAPEZOID
)
if
(
(
m_PadOption
==
PAD_NOT_IN_ZONE
)
||
(
GetNet
()
==
0
)
||
pad
->
m_PadShape
==
PAD_TRAPEZOID
)
// PAD_TRAPEZOID shapes are *never* in zones becuase they are used in microwave apps
// and the shae *must not* be changed by thermal pads or others
{
item_boundingbox
=
pad
->
GetBoundingBox
();
if
(
item_boundingbox
.
Intersects
(
zone_boundingbox
)
)
...
...
@@ -210,7 +213,6 @@ void ZONE_CONTAINER::AddClearanceAreasPolygonsToPolysList( BOARD* aPcb )
AddPadWithClearancePolygon
(
booleng
,
*
pad
,
clearance
);
have_poly_to_substract
=
true
;
}
}
}
}
...
...
@@ -287,7 +289,7 @@ void ZONE_CONTAINER::AddClearanceAreasPolygonsToPolysList( BOARD* aPcb )
}
/* calculates copper areas */
if
(
have_poly_to_substract
)
if
(
have_poly_to_substract
)
{
booleng
->
Do_Operation
(
BOOL_A_SUB_B
);
...
...
@@ -353,7 +355,6 @@ void ZONE_CONTAINER::AddClearanceAreasPolygonsToPolysList( BOARD* aPcb )
// Remove insulated islands:
if
(
GetNet
()
>
0
)
Test_For_Copper_Island_And_Remove_Insulated_Islands
(
aPcb
);
}
// Now we remove all unused thermal stubs.
...
...
@@ -432,7 +433,8 @@ void ZONE_CONTAINER::AddClearanceAreasPolygonsToPolysList( BOARD* aPcb )
// polygons are rectangles with width of copper bridge value
// contour line width has to be taken into calculation to avoid "thermal stub bleed"
const
int
iDTRC
=
(
m_ThermalReliefCopperBridgeValue
-
m_ZoneMinThickness
)
/
2
;
const
int
iDTRC
=
(
m_ThermalReliefCopperBridgeValue
-
m_ZoneMinThickness
)
/
2
;
switch
(
i
)
{
...
...
@@ -485,19 +487,21 @@ void ZONE_CONTAINER::AddClearanceAreasPolygonsToPolysList( BOARD* aPcb )
}
/* compute copper areas */
if
(
have_poly_to_substract
)
if
(
have_poly_to_substract
)
{
booleng
->
Do_Operation
(
BOOL_A_SUB_B
);
/* put these areas in m_FilledPolysList */
m_FilledPolysList
.
clear
();
CopyPolygonsFromBoolengineToFilledPolysList
(
booleng
);
// Remove insulated islands, if any:
if
(
GetNet
()
>
0
)
Test_For_Copper_Island_And_Remove_Insulated_Islands
(
aPcb
);
}
delete
booleng
;
//#endif
}
...
...
@@ -519,6 +523,9 @@ void AddPadWithClearancePolygon( Bool_Engine* aBooleng,
int
delta
=
3600
/
s_CircleToSegmentsCount
;
// rot angle in 0.1 degree
wxPoint
PadShapePos
=
aPad
.
ReturnShapePos
();
/* Note: for pad having a shape offset,
* the pad position is NOT the shape position */
wxSize
psize
=
aPad
.
m_Size
;
/* pad size unsed in RECT and TRAPEZOIDAL pads
* trapezoidal pads are considered as rect pad shape having they boudary box size
*/
switch
(
aPad
.
m_PadShape
)
{
...
...
@@ -601,11 +608,11 @@ void AddPadWithClearancePolygon( Bool_Engine* aBooleng,
break
;
}
default
:
case
PAD_TRAPEZOID
:
default
:
/* @todo: the others shapes must be calculated: see trapezoidal shape
* but before this is made, the rect shape is used insteed.
* A polygon *must* be created because we have started a polygon in kbool engine
*/
psize
.
x
+=
ABS
(
aPad
.
m_DeltaSize
.
y
);
psize
.
y
+=
ABS
(
aPad
.
m_DeltaSize
.
x
);
// fall through
case
PAD_RECT
:
// Easy implementation for rectangular cutouts with rounded corners // Easy implementation for rectangular cutouts with rounded corners
angle
=
aPad
.
m_Orient
;
int
rounding_radius
=
(
int
)
(
aClearanceValue
*
s_Correction
);
// Corner rounding radius
...
...
@@ -617,7 +624,7 @@ void AddPadWithClearancePolygon( Bool_Engine* aBooleng,
RotatePoint
(
&
corner_position
,
(
1800
/
s_CircleToSegmentsCount
)
);
// Start at half increment offset
angle_pg
=
i
*
delta
;
RotatePoint
(
&
corner_position
,
angle_pg
);
// Rounding vector rotation
corner_position
-=
aPad
.
m_S
ize
/
2
;
// Rounding vector + Pad corner offset
corner_position
-=
ps
ize
/
2
;
// Rounding vector + Pad corner offset
RotatePoint
(
&
corner_position
,
angle
);
// Rotate according to module orientation
corner_position
+=
PadShapePos
;
// Shift origin to position
aBooleng
->
AddPoint
(
corner_position
.
x
,
corner_position
.
y
);
...
...
@@ -629,7 +636,7 @@ void AddPadWithClearancePolygon( Bool_Engine* aBooleng,
RotatePoint
(
&
corner_position
,
(
1800
/
s_CircleToSegmentsCount
)
);
angle_pg
=
i
*
delta
;
RotatePoint
(
&
corner_position
,
angle_pg
);
corner_position
-=
wxPoint
(
aPad
.
m_Size
.
x
/
2
,
-
aPad
.
m_S
ize
.
y
/
2
);
corner_position
-=
wxPoint
(
psize
.
x
/
2
,
-
ps
ize
.
y
/
2
);
RotatePoint
(
&
corner_position
,
angle
);
corner_position
+=
PadShapePos
;
aBooleng
->
AddPoint
(
corner_position
.
x
,
corner_position
.
y
);
...
...
@@ -641,7 +648,7 @@ void AddPadWithClearancePolygon( Bool_Engine* aBooleng,
RotatePoint
(
&
corner_position
,
(
1800
/
s_CircleToSegmentsCount
)
);
angle_pg
=
i
*
delta
;
RotatePoint
(
&
corner_position
,
angle_pg
);
corner_position
+=
aPad
.
m_S
ize
/
2
;
corner_position
+=
ps
ize
/
2
;
RotatePoint
(
&
corner_position
,
angle
);
corner_position
+=
PadShapePos
;
aBooleng
->
AddPoint
(
corner_position
.
x
,
corner_position
.
y
);
...
...
@@ -653,7 +660,7 @@ void AddPadWithClearancePolygon( Bool_Engine* aBooleng,
RotatePoint
(
&
corner_position
,
(
1800
/
s_CircleToSegmentsCount
)
);
angle_pg
=
i
*
delta
;
RotatePoint
(
&
corner_position
,
angle_pg
);
corner_position
-=
wxPoint
(
-
aPad
.
m_Size
.
x
/
2
,
aPad
.
m_S
ize
.
y
/
2
);
corner_position
-=
wxPoint
(
-
psize
.
x
/
2
,
ps
ize
.
y
/
2
);
RotatePoint
(
&
corner_position
,
angle
);
corner_position
+=
PadShapePos
;
aBooleng
->
AddPoint
(
corner_position
.
x
,
corner_position
.
y
);
...
...
@@ -703,7 +710,8 @@ void AddPadWithClearancePolygon( Bool_Engine* aBooleng,
*
* Note 2:
* Trapezoidal pads are not considered here because they are very special case
* and are used in microwave applications and they do not have a therma relief that change the shape
* and are used in microwave applications and they *DO NOT* have a thermal relief that change the shape
* by creating stubs and destroy their properties.
*/
void
AddThermalReliefPadPolygon
(
Bool_Engine
*
aBooleng
,
D_PAD
&
aPad
,
...
...
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