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
6d91cdd6
Commit
6d91cdd6
authored
Feb 25, 2009
by
charras
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed: a problem when using arcs as edge pcb in zones and when filling zones
parent
d055f673
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
28 additions
and
37 deletions
+28
-37
zones_convert_brd_items_to_polygons.cpp
pcbnew/zones_convert_brd_items_to_polygons.cpp
+27
-36
version.txt
version.txt
+1
-1
No files found.
pcbnew/zones_convert_brd_items_to_polygons.cpp
View file @
6d91cdd6
...
...
@@ -54,7 +54,7 @@ void AddTextBoxWithClearancePolygon( Bool_Engine* aBooleng,
static
void
AddRingPolygon
(
Bool_Engine
*
aBooleng
,
wxPoint
aCentre
,
wxPoint
aStart
,
wxPoint
aEnd
,
int
aArcAngle
,
int
aWidth
);
// Local Variables:
...
...
@@ -231,22 +231,16 @@ void ZONE_CONTAINER::AddClearanceAreasPolygonsToPolysList( BOARD* aPcb )
switch
(
(
(
DRAWSEGMENT
*
)
item
)
->
m_Shape
)
{
case
S_CIRCLE
:
AddRingPolygon
(
booleng
,
(
(
DRAWSEGMENT
*
)
item
)
->
m_Start
,
(
(
DRAWSEGMENT
*
)
item
)
->
m_End
,
(
(
DRAWSEGMENT
*
)
item
)
->
m_End
,
AddRingPolygon
(
booleng
,
(
(
DRAWSEGMENT
*
)
item
)
->
m_Start
,
// Circle centre
(
(
DRAWSEGMENT
*
)
item
)
->
m_End
,
3600
,
(
(
DRAWSEGMENT
*
)
item
)
->
m_Width
+
(
2
*
m_ZoneClearance
)
);
break
;
case
S_ARC
:
{
wxPoint
arc_start
,
arc_end
;
arc_start
=
(
(
DRAWSEGMENT
*
)
item
)
->
m_End
;
arc_end
=
(
(
DRAWSEGMENT
*
)
item
)
->
m_End
;
RotatePoint
(
&
arc_end
,
(
(
DRAWSEGMENT
*
)
item
)
->
m_Start
,
-
(
(
DRAWSEGMENT
*
)
item
)
->
m_Angle
);
AddRingPolygon
(
booleng
,
(
(
DRAWSEGMENT
*
)
item
)
->
m_Start
,
arc_start
,
arc_end
,
AddRingPolygon
(
booleng
,
(
(
DRAWSEGMENT
*
)
item
)
->
m_Start
,
// Arc centre
(
(
DRAWSEGMENT
*
)
item
)
->
m_End
,
(
(
DRAWSEGMENT
*
)
item
)
->
m_Angle
,
(
(
DRAWSEGMENT
*
)
item
)
->
m_Width
+
(
2
*
m_ZoneClearance
)
);
}
break
;
default
:
...
...
@@ -1144,46 +1138,43 @@ void AddRoundedEndsSegmentPolygon( Bool_Engine* aBooleng,
/** Function AddRingPolygon
* Add a polygon cutout for an Arc in a zone area
* Convert arcs to multiple straight segments
* For a cicle, aStart = aEnd
* @param aBooleng = the bool engine to use
* @param aCentre = centre of the arc or circle
* @param aStart = start point of the arc, or apoint of the circle
* @param aArcAngle = arc angle in 0.1 degrees. For a circle, aArcAngle = 3600
* @param aWidth = width of the line
*/
void
AddRingPolygon
(
Bool_Engine
*
aBooleng
,
wxPoint
aCentre
,
wxPoint
aStart
,
wxPoint
aEnd
,
wxPoint
aStart
,
int
aArcAngle
,
int
aWidth
)
{
wxPoint
start
,
end
;
int
arc_angle
;
wxPoint
arc_start
,
arc_end
;
int
delta
=
3600
/
s_CircleToSegmentsCount
;
// rot angle in 0.1 degree
if
(
aEnd
==
aStart
)
arc_angle
=
3600
;
else
arc_end
=
arc_start
=
aStart
;
if
(
aArcAngle
!=
3600
)
{
double
angle
=
atan2
(
aEnd
.
y
-
aCentre
.
y
,
aEnd
.
x
-
aCentre
.
x
)
-
atan2
(
aStart
.
y
-
aCentre
.
y
,
aStart
.
x
-
aCentre
.
x
);
// delta_angle is in 0.1 degrees
arc_angle
=
(
int
)
round
(
1800.0
/
M_PI
*
angle
);
NEGATE
(
arc_angle
);
// Due to reverse orientation of Y axis,
// angles are negated, comparing to the mathematical Y orient.
RotatePoint
(
&
arc_end
,
aCentre
,
-
aArcAngle
);
}
if
(
a
rc_a
ngle
<
0
)
if
(
a
ArcA
ngle
<
0
)
{
EXCHG
(
a
Start
,
aE
nd
);
NEGATE
(
a
rc_a
ngle
);
EXCHG
(
a
rc_start
,
arc_e
nd
);
NEGATE
(
a
ArcA
ngle
);
}
// Compute the ends of segments and creates poly
end
=
start
=
aS
tart
;
for
(
int
ii
=
delta
;
ii
<
a
rc_a
ngle
;
ii
+=
delta
)
wxPoint
curr_end
=
arc_start
,
curr_start
=
arc_s
tart
;
for
(
int
ii
=
delta
;
ii
<
a
ArcA
ngle
;
ii
+=
delta
)
{
end
=
aS
tart
;
RotatePoint
(
&
end
,
aCentre
,
ii
);
AddRoundedEndsSegmentPolygon
(
aBooleng
,
start
,
end
,
aWidth
);
start
=
end
;
curr_end
=
arc_s
tart
;
RotatePoint
(
&
curr_end
,
aCentre
,
-
ii
);
AddRoundedEndsSegmentPolygon
(
aBooleng
,
curr_start
,
curr_
end
,
aWidth
);
curr_start
=
curr_
end
;
}
if
(
end
!=
aE
nd
)
AddRoundedEndsSegmentPolygon
(
aBooleng
,
end
,
aE
nd
,
aWidth
);
if
(
curr_end
!=
arc_e
nd
)
AddRoundedEndsSegmentPolygon
(
aBooleng
,
curr_end
,
arc_e
nd
,
aWidth
);
}
...
...
version.txt
View file @
6d91cdd6
release version:
16 feb 2009
files (.zip,.tgz):
kicad-2009-02-16-RC
2
kicad-2009-02-16-RC
3
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