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
6bd572f5
Commit
6bd572f5
authored
Aug 29, 2008
by
dickelbeck
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix case where first edge segment is an arc
parent
9536bdce
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
64 additions
and
63 deletions
+64
-63
specctra_export.cpp
pcbnew/specctra_export.cpp
+64
-63
No files found.
pcbnew/specctra_export.cpp
View file @
6bd572f5
...
...
@@ -748,91 +748,92 @@ void SPECCTRA_DB::fillBOUNDARY( BOARD* aBoard, BOUNDARY* boundary ) throw( IOErr
items
.
Remove
(
0
);
prevPt
=
graphic
->
GetEnd
();
path
->
AppendPoint
(
mapPt
(
graphic
->
GetStart
()
)
);
path
->
AppendPoint
(
mapPt
(
graphic
->
GetEnd
()
)
);
while
(
items
.
GetCount
()
)
// do not append the other end point yet, this first edge item might be an arc
for
(;;)
{
graphic
=
findPoint
(
prevPt
,
&
items
);
if
(
graphic
)
switch
(
graphic
->
m_Shape
)
{
switch
(
graphic
->
m_Shape
)
case
S_ARC
:
// freerouter does not yet understand arcs, so approximate
// an arc with a series of short lines and put those
// line segments into the !same! PATH.
{
case
S_ARC
:
// freerouter does not yet understand arcs, so approximate
// an arc with a series of short lines and put those
// line segments into the !same! PATH.
const
int
STEPS
=
9
;
// in an arc of 90 degrees
wxPoint
start
=
graphic
->
GetStart
();
wxPoint
end
=
graphic
->
GetEnd
();
wxPoint
center
=
graphic
->
m_Start
;
int
angle
=
-
graphic
->
m_Angle
;
if
(
prevPt
!=
start
)
{
const
int
STEPS
=
9
;
// in an arc of 90 degrees
wxASSERT
(
prevPt
==
graphic
->
GetEnd
()
);
wxPoint
start
=
graphic
->
GetStart
();
wxPoint
end
=
graphic
->
GetEnd
();
wxPoint
center
=
graphic
->
m_Start
;
int
angle
=
-
graphic
->
m_Angle
;
angle
=
-
angle
;
EXCHG
(
start
,
end
);
}
if
(
prevPt
!=
start
)
{
wxASSERT
(
prevPt
==
graphic
->
GetEnd
()
);
wxPoint
nextPt
;
angle
=
-
angle
;
EXCHG
(
start
,
end
);
}
for
(
int
step
=
1
;
step
<=
STEPS
;
++
step
)
{
int
rotation
=
(
angle
*
step
)
/
STEPS
;
wxPoint
nextP
t
;
nextPt
=
star
t
;
for
(
int
step
=
1
;
step
<=
STEPS
;
++
step
)
{
int
rotation
=
(
angle
*
step
)
/
STEPS
;
RotatePoint
(
&
nextPt
.
x
,
&
nextPt
.
y
,
center
.
x
,
center
.
y
,
rotation
);
nextPt
=
start
;
path
->
AppendPoint
(
mapPt
(
nextPt
)
);
}
RotatePoint
(
&
nextPt
.
x
,
&
nextPt
.
y
,
center
.
x
,
center
.
y
,
rotation
);
prevPt
=
nextPt
;
}
break
;
path
->
AppendPoint
(
mapPt
(
nextPt
)
);
}
case
S_CIRCLE
:
// do not output a circle, freerouter does not understand it.
// this might be a mounting hole or something, ignore it without error
break
;
prevPt
=
nextPt
;
}
break
;
default
:
{
wxString
error
;
case
S_CIRCLE
:
// do not output a circle, freerouter does not understand it.
// this might be a mounting hole or something, ignore it without error
break
;
error
.
Printf
(
_
(
"Unsupported DRAWSEGMENT type %s"
),
BOARD_ITEM
::
ShowShape
(
(
Track_Shapes
)
graphic
->
m_Shape
).
GetData
()
);
default
:
{
wxString
error
;
ThrowIOError
(
error
);
}
break
;
error
.
Printf
(
_
(
"Unsupported DRAWSEGMENT type %s"
),
BOARD_ITEM
::
ShowShape
(
(
Track_Shapes
)
graphic
->
m_Shape
).
GetData
()
);
case
S_SEGMENT
:
{
POINT
nextPt
;
ThrowIOError
(
error
);
if
(
prevPt
!=
graphic
->
GetStart
()
)
{
wxASSERT
(
prevPt
==
graphic
->
GetEnd
()
);
nextPt
=
mapPt
(
graphic
->
GetStart
()
);
prevPt
=
graphic
->
GetStart
();
}
break
;
case
S_SEGMENT
:
else
{
POINT
nextPt
;
if
(
prevPt
!=
graphic
->
GetStart
()
)
{
wxASSERT
(
prevPt
==
graphic
->
GetEnd
()
);
nextPt
=
mapPt
(
graphic
->
GetStart
()
);
prevPt
=
graphic
->
GetStart
();
}
else
{
nextPt
=
mapPt
(
graphic
->
GetStart
()
);
prevPt
=
graphic
->
GetEnd
();
}
path
->
AppendPoint
(
nextPt
);
}
}
nextPt
=
mapPt
(
graphic
->
GetStart
()
);
prevPt
=
graphic
->
GetEnd
();
}
path
->
AppendPoint
(
nextPt
);
}
}
else
if
(
items
.
GetCount
()
==
0
)
break
;
graphic
=
findPoint
(
prevPt
,
&
items
);
if
(
!
graphic
)
{
wxString
error
;
...
...
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