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
9d76274a
Commit
9d76274a
authored
Jan 27, 2009
by
vesa_solonen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Polygon enhancements
parent
b5c64fd7
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
0 deletions
+11
-0
zones_convert_brd_items_to_polygons.cpp
pcbnew/zones_convert_brd_items_to_polygons.cpp
+11
-0
No files found.
pcbnew/zones_convert_brd_items_to_polygons.cpp
View file @
9d76274a
...
@@ -467,6 +467,7 @@ void AddPadWithClearancePolygon( Bool_Engine* aBooleng,
...
@@ -467,6 +467,7 @@ void AddPadWithClearancePolygon( Bool_Engine* aBooleng,
for
(
ii
=
0
;
ii
<
s_CircleToSegmentsCount
;
ii
++
)
for
(
ii
=
0
;
ii
<
s_CircleToSegmentsCount
;
ii
++
)
{
{
corner_position
=
wxPoint
(
dx
,
0
);
corner_position
=
wxPoint
(
dx
,
0
);
RotatePoint
(
&
corner_position
,
(
1800
/
s_CircleToSegmentsCount
)
);
// Half increment offset to get more space between
angle
=
ii
*
delta
;
angle
=
ii
*
delta
;
RotatePoint
(
&
corner_position
,
angle
);
RotatePoint
(
&
corner_position
,
angle
);
corner_position
+=
PadShapePos
;
corner_position
+=
PadShapePos
;
...
@@ -487,6 +488,7 @@ void AddPadWithClearancePolygon( Bool_Engine* aBooleng,
...
@@ -487,6 +488,7 @@ void AddPadWithClearancePolygon( Bool_Engine* aBooleng,
for
(
ii
=
0
;
ii
<
s_CircleToSegmentsCount
/
2
+
1
;
ii
++
)
// Half circle end cap...
for
(
ii
=
0
;
ii
<
s_CircleToSegmentsCount
/
2
+
1
;
ii
++
)
// Half circle end cap...
{
{
corner_position
=
wxPoint
(
dx
,
0
);
// Coordinate translation +dx
corner_position
=
wxPoint
(
dx
,
0
);
// Coordinate translation +dx
RotatePoint
(
&
corner_position
,
(
1800
/
s_CircleToSegmentsCount
)
);
RotatePoint
(
&
corner_position
,
angle
);
RotatePoint
(
&
corner_position
,
angle
);
angle_pg
=
ii
*
delta
;
angle_pg
=
ii
*
delta
;
RotatePoint
(
&
corner_position
,
angle_pg
);
RotatePoint
(
&
corner_position
,
angle_pg
);
...
@@ -497,6 +499,7 @@ void AddPadWithClearancePolygon( Bool_Engine* aBooleng,
...
@@ -497,6 +499,7 @@ void AddPadWithClearancePolygon( Bool_Engine* aBooleng,
for
(
ii
=
0
;
ii
<
s_CircleToSegmentsCount
/
2
+
1
;
ii
++
)
// Second half circle end cap...
for
(
ii
=
0
;
ii
<
s_CircleToSegmentsCount
/
2
+
1
;
ii
++
)
// Second half circle end cap...
{
{
corner_position
=
wxPoint
(
-
dx
,
0
);
// Coordinate translation -dx
corner_position
=
wxPoint
(
-
dx
,
0
);
// Coordinate translation -dx
RotatePoint
(
&
corner_position
,
(
1800
/
s_CircleToSegmentsCount
)
);
RotatePoint
(
&
corner_position
,
angle
);
RotatePoint
(
&
corner_position
,
angle
);
angle_pg
=
ii
*
delta
;
angle_pg
=
ii
*
delta
;
RotatePoint
(
&
corner_position
,
angle_pg
);
RotatePoint
(
&
corner_position
,
angle_pg
);
...
@@ -516,6 +519,7 @@ void AddPadWithClearancePolygon( Bool_Engine* aBooleng,
...
@@ -516,6 +519,7 @@ void AddPadWithClearancePolygon( Bool_Engine* aBooleng,
for
(
ii
=
0
;
ii
<
s_CircleToSegmentsCount
/
2
+
1
;
ii
++
)
for
(
ii
=
0
;
ii
<
s_CircleToSegmentsCount
/
2
+
1
;
ii
++
)
{
{
corner_position
=
wxPoint
(
0
,
dy
);
corner_position
=
wxPoint
(
0
,
dy
);
RotatePoint
(
&
corner_position
,
(
1800
/
s_CircleToSegmentsCount
)
);
RotatePoint
(
&
corner_position
,
angle
);
RotatePoint
(
&
corner_position
,
angle
);
angle_pg
=
ii
*
delta
;
angle_pg
=
ii
*
delta
;
RotatePoint
(
&
corner_position
,
angle_pg
);
RotatePoint
(
&
corner_position
,
angle_pg
);
...
@@ -526,6 +530,7 @@ void AddPadWithClearancePolygon( Bool_Engine* aBooleng,
...
@@ -526,6 +530,7 @@ void AddPadWithClearancePolygon( Bool_Engine* aBooleng,
for
(
ii
=
0
;
ii
<
s_CircleToSegmentsCount
/
2
+
1
;
ii
++
)
for
(
ii
=
0
;
ii
<
s_CircleToSegmentsCount
/
2
+
1
;
ii
++
)
{
{
corner_position
=
wxPoint
(
0
,
-
dy
);
corner_position
=
wxPoint
(
0
,
-
dy
);
RotatePoint
(
&
corner_position
,
(
1800
/
s_CircleToSegmentsCount
)
);
RotatePoint
(
&
corner_position
,
angle
);
RotatePoint
(
&
corner_position
,
angle
);
angle_pg
=
ii
*
delta
;
angle_pg
=
ii
*
delta
;
RotatePoint
(
&
corner_position
,
angle_pg
);
RotatePoint
(
&
corner_position
,
angle_pg
);
...
@@ -544,6 +549,7 @@ void AddPadWithClearancePolygon( Bool_Engine* aBooleng,
...
@@ -544,6 +549,7 @@ void AddPadWithClearancePolygon( Bool_Engine* aBooleng,
for
(
int
i
=
0
;
i
<
s_CircleToSegmentsCount
/
4
+
1
;
i
++
)
for
(
int
i
=
0
;
i
<
s_CircleToSegmentsCount
/
4
+
1
;
i
++
)
{
{
corner_position
=
wxPoint
(
0
,
-
rounding_radius
);
corner_position
=
wxPoint
(
0
,
-
rounding_radius
);
RotatePoint
(
&
corner_position
,
(
1800
/
s_CircleToSegmentsCount
)
);
// Start at half increment offset
angle_pg
=
i
*
delta
;
angle_pg
=
i
*
delta
;
RotatePoint
(
&
corner_position
,
angle_pg
);
// Rounding vector rotation
RotatePoint
(
&
corner_position
,
angle_pg
);
// Rounding vector rotation
corner_position
-=
aPad
.
m_Size
/
2
;
// Rounding vector + Pad corner offset
corner_position
-=
aPad
.
m_Size
/
2
;
// Rounding vector + Pad corner offset
...
@@ -555,6 +561,7 @@ void AddPadWithClearancePolygon( Bool_Engine* aBooleng,
...
@@ -555,6 +561,7 @@ void AddPadWithClearancePolygon( Bool_Engine* aBooleng,
for
(
int
i
=
0
;
i
<
s_CircleToSegmentsCount
/
4
+
1
;
i
++
)
for
(
int
i
=
0
;
i
<
s_CircleToSegmentsCount
/
4
+
1
;
i
++
)
{
{
corner_position
=
wxPoint
(
-
rounding_radius
,
0
);
corner_position
=
wxPoint
(
-
rounding_radius
,
0
);
RotatePoint
(
&
corner_position
,
(
1800
/
s_CircleToSegmentsCount
)
);
angle_pg
=
i
*
delta
;
angle_pg
=
i
*
delta
;
RotatePoint
(
&
corner_position
,
angle_pg
);
RotatePoint
(
&
corner_position
,
angle_pg
);
corner_position
-=
wxPoint
(
aPad
.
m_Size
.
x
/
2
,
-
aPad
.
m_Size
.
y
/
2
);
corner_position
-=
wxPoint
(
aPad
.
m_Size
.
x
/
2
,
-
aPad
.
m_Size
.
y
/
2
);
...
@@ -566,6 +573,7 @@ void AddPadWithClearancePolygon( Bool_Engine* aBooleng,
...
@@ -566,6 +573,7 @@ void AddPadWithClearancePolygon( Bool_Engine* aBooleng,
for
(
int
i
=
0
;
i
<
s_CircleToSegmentsCount
/
4
+
1
;
i
++
)
for
(
int
i
=
0
;
i
<
s_CircleToSegmentsCount
/
4
+
1
;
i
++
)
{
{
corner_position
=
wxPoint
(
0
,
rounding_radius
);
corner_position
=
wxPoint
(
0
,
rounding_radius
);
RotatePoint
(
&
corner_position
,
(
1800
/
s_CircleToSegmentsCount
)
);
angle_pg
=
i
*
delta
;
angle_pg
=
i
*
delta
;
RotatePoint
(
&
corner_position
,
angle_pg
);
RotatePoint
(
&
corner_position
,
angle_pg
);
corner_position
+=
aPad
.
m_Size
/
2
;
corner_position
+=
aPad
.
m_Size
/
2
;
...
@@ -577,6 +585,7 @@ void AddPadWithClearancePolygon( Bool_Engine* aBooleng,
...
@@ -577,6 +585,7 @@ void AddPadWithClearancePolygon( Bool_Engine* aBooleng,
for
(
int
i
=
0
;
i
<
s_CircleToSegmentsCount
/
4
+
1
;
i
++
)
for
(
int
i
=
0
;
i
<
s_CircleToSegmentsCount
/
4
+
1
;
i
++
)
{
{
corner_position
=
wxPoint
(
rounding_radius
,
0
);
corner_position
=
wxPoint
(
rounding_radius
,
0
);
RotatePoint
(
&
corner_position
,
(
1800
/
s_CircleToSegmentsCount
)
);
angle_pg
=
i
*
delta
;
angle_pg
=
i
*
delta
;
RotatePoint
(
&
corner_position
,
angle_pg
);
RotatePoint
(
&
corner_position
,
angle_pg
);
corner_position
-=
wxPoint
(
-
aPad
.
m_Size
.
x
/
2
,
aPad
.
m_Size
.
y
/
2
);
corner_position
-=
wxPoint
(
-
aPad
.
m_Size
.
x
/
2
,
aPad
.
m_Size
.
y
/
2
);
...
@@ -923,6 +932,7 @@ void AddThermalReliefPadPolygon( Bool_Engine* aBooleng,
...
@@ -923,6 +932,7 @@ void AddThermalReliefPadPolygon( Bool_Engine* aBooleng,
for
(
int
i
=
0
;
i
<
s_CircleToSegmentsCount
/
4
+
1
;
i
++
)
for
(
int
i
=
0
;
i
<
s_CircleToSegmentsCount
/
4
+
1
;
i
++
)
{
{
wxPoint
corner_position
=
wxPoint
(
0
,
-
rounding_radius
);
wxPoint
corner_position
=
wxPoint
(
0
,
-
rounding_radius
);
RotatePoint
(
&
corner_position
,
(
1800
/
s_CircleToSegmentsCount
)
);
// Start at half increment offset
angle_pg
=
i
*
delta
;
angle_pg
=
i
*
delta
;
RotatePoint
(
&
corner_position
,
angle_pg
);
// Rounding vector rotation
RotatePoint
(
&
corner_position
,
angle_pg
);
// Rounding vector rotation
corner_position
-=
aPad
.
m_Size
/
2
;
// Rounding vector + Pad corner offset
corner_position
-=
aPad
.
m_Size
/
2
;
// Rounding vector + Pad corner offset
...
@@ -1004,6 +1014,7 @@ void AddTrackWithClearancePolygon( Bool_Engine* aBooleng,
...
@@ -1004,6 +1014,7 @@ void AddTrackWithClearancePolygon( Bool_Engine* aBooleng,
for
(
ii
=
0
;
ii
<
s_CircleToSegmentsCount
;
ii
++
)
for
(
ii
=
0
;
ii
<
s_CircleToSegmentsCount
;
ii
++
)
{
{
corner_position
=
wxPoint
(
dx
,
0
);
corner_position
=
wxPoint
(
dx
,
0
);
RotatePoint
(
&
corner_position
,
(
1800
/
s_CircleToSegmentsCount
)
);
angle
=
ii
*
delta
;
angle
=
ii
*
delta
;
RotatePoint
(
&
corner_position
,
angle
);
RotatePoint
(
&
corner_position
,
angle
);
corner_position
+=
aTrack
.
m_Start
;
corner_position
+=
aTrack
.
m_Start
;
...
...
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